text:
SET gp_create_table_random_default_distribution=off;
-- end_ignore
DROP TABLE IF EXISTS reindex_aoco;

CREATE TABLE reindex_aoco (a INT) WITH (appendonly=true, orientation=column);
insert into reindex_aoco select generate_series(1,1000);
insert into reindex_aoco select generate_series(1,1000);
create index idx_btree_reindex_aoco on reindex_aoco(a);
SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class')   WHERE relname = 'idx_btree_reindex_aoco' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);


text:
package gov.nih.nci.cabig.caaers.domain.repository;

import gov.nih.nci.cabig.caaers.dao.LabLoadDao;
import gov.nih.nci.cabig.caaers.domain.LabLoad;

import org.springframework.transaction.annotation.Transactional;

/**
 * The Class LabLoadRepository.
 *
 * @author Srini Akkala
 */
@Transactional(readOnly = true)
public class LabLoadRepository {

	/** The lab load dao. */
	LabLoadDao labLoadDao;

 	/**
 	 * Saves a labLoad object.
 	 *
 	 * @param labLoad the labLoad object
 	 * @throws Exception runtime exception object
 	 */

    @Transactional(readOnly = false)
    public void save(LabLoad labLoad) throws Exception {
    	labLoadDao.save(labLoad);
    }

	/**
	 * Sets the lab load dao.
	 *
	 * @param labLoadDao the new lab load dao
	 */
	public void setLabLoadDao(LabLoadDao labLoadDao) {
		this.labLoadDao = labLoadDao;
	}
}

redpajama_set_name: RedPajamaGithub


text:
package org.ros2.rcljava.client;

import java.lang.ref.WeakReference;
import java.util.AbstractMap;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.Future;

import org.ros2.rcljava.RCLJava;
import org.ros2.rcljava.common.JNIUtils;
import org.ros2.rcljava.concurrent.RCLFuture;
import org.ros2.rcljava.consumers.Consumer;
import org.ros2.rcljava.interfaces.MessageDefinition;
import org.ros2.rcljava.interfaces.ServiceDefinition;
import org.ros2.rcljava.node.Node;
import org.ros2.rcljava.service.RMWRequestId;

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

public class ClientImpl<T extends ServiceDefinition> implements Client<T> {
  private static final Logger logger = LoggerFactory.getLogger(ClientImpl.class);

  static {
    try {
      JNIUtils.loadImplementation(ClientImpl.class);
    } catch (UnsatisfiedLinkError ule) {
      logger.error("Native code library failed to load.\n" + ule);
      System.exit(1);
    }
  }

  private final WeakReference<Node> nodeReference;
  private long handle;
  private final String serviceName;
  private long sequenceNumber = 0;
  private Map<Long, Map.Entry<Consumer, RCLFuture>> pendingRequests;

  private final Class<MessageDefinition> requestType;
  private final Class<MessageDefinition> responseType;

  public ClientImpl(final WeakReference<Node> nodeReference, final long handle,
      final String serviceName, final Class<MessageDefinition> requestType,
      final Class<MessageDefinition> responseType) {
    this.nodeReference = nodeReference;
    this.handle = handle;
    this.serviceName = serviceName;
    this.requestType = requestType;
    this.responseType = responseType;
    this.pendingRequests = new HashMap<Long, Map.Entry<Consumer, RCLFuture>>();
  }

  public final <U extends MessageDefinition, V extends MessageDefinition> Future<V>
  asyncSendRequest(final U request) {
    return asyncSendRequest(request, new Consumer<Future<V>>() {
      public void accept(Future<V> input) {}
    });
  }

  public final <U extends MessageDefinition, V extends MessageDefinition> Future<V>
  asyncSendRequest(final U request, final Consumer<Future<V>> callback) {
    synchronized (pendingRequests) {
      sequenceNumber++;
      nativeSendClientRequest(handle, sequenceNumber, request.getFromJavaConverterInstance(),
          request.getToJavaConverterInstance(), request.getDestructorInstance(), request);
      RCLFuture<V> future = new RCLFuture<V>(this.nodeReference);

      Map.Entry<Consumer, RCLFuture> entry =
          new AbstractMap.SimpleEntry<Consumer, RCLFuture>(callback, future);
      pendingRequests.put(sequenceNumber, entry);
      return future;
    }
  }

  public final <U extends MessageDefinition> void handleResponse(
      final RMWRequestId header, final U response) {
    synchronized (pendingRequests) {
      long sequenceNumber = header.sequenceNumber;
      Map.Entry<Consumer, RCLFuture> entry = pendingRequests.remove(sequenceNumber);
      Consumer<Future> callback = entry.getKey();
      RCLFuture<U> future = entry.getValue();
      future.set(response);
      callback.accept(future);
    }
  }

  private static native void nativeSendClientRequest(long handle, long sequenceNumber,
      long requestFromJavaConverterHandle, long requestToJavaConverterHandle,
      long requestDestructorHandle, MessageDefinition requestMessage);

  public final Class<MessageDefinition> getRequestType() {
    return this.requestType;
  }

  public final Class<MessageDefinition> getResponseType() {
    return this.responseType;
  }

  /**
   * Destroy a ROS2 client (rcl_client_t).
   *
   * @param nodeHandle A pointer to the underlying ROS2 node structure that
   *     created this client, as an integer. Must not be zero.
   * @param handle A pointer to the underlying ROS2 client
   *     structure, as an integer. Must not be zero.
   */
  private static native void nativeDispose(long nodeHandle, long handle);

  /**
   * {@inheritDoc}
   */
  public final void dispose() {
    Node node = this.nodeReference.get();
    if (node != null) {
      nativeDispose(node.getHandle(), this.handle);
      this.handle = 0;
    }
  }

  /**
   * {@inheritDoc}
   */
  public final long getHandle() {
    return this.handle;
  }

  public String getServiceName() {
    return this.serviceName;
  }
}


text:
run_cmd=
PROG=shortpath
ARGS=4 N=1000 start=0 end=999 verbose
PERF_RUN_ARGS=auto N=1000 start=0 end=99 silent

# icpc by default
ifneq (,$(shell which icc 2>/dev/null))
    CXX=icpc
endif

# autodetect C++11 support
include ../../common/examples-common.inc

ifeq ($(shell uname), Linux)
ifeq ($(target), android)
LIBS+= --sysroot=$(SYSROOT)
run_cmd=../../common/android.linux.launcher.sh
else
LIBS+= -lrt
endif
else ifeq ($(shell uname), Darwin)
override CXXFLAGS += -Wl,-rpath,$(TBBROOT)/lib
endif

all:    release test

release: *.cpp
	$(CXX) -O2 -DNDEBUG $(CXXFLAGS) -o $(PROG) $^ -ltbb $(LIBS) $(CXX0XFLAGS)

debug: *.cpp
	$(CXX) -O0 -g -DTBB_USE_DEBUG $(CXXFLAGS) -o $(PROG) $^ -ltbb_debug $(LIBS) $(CXX0XFLAGS)

clean:
	$(RM) $(PROG) *.o *.d

test:
	$(run_cmd) ./$(PROG) $(ARGS)

perf_build: release

perf_run:
	$(run_cmd) ./$(PROG) $(PERF_RUN_ARGS)


text: standalone website for my business card https://jokeyrhyme.github.io/business-card/


text:
<?php

use Owl\Events\Item\CreateEvent;

class CreateEventTest extends \TestCase
{
    public function testValidInstance()
    {
        $event = new CreateEvent('itemId', 'userId');
        $this->assertInstanceOf('Owl\Events\Item\CreateEvent', $event);
    }
}


text:
require 'loc_counter'

support_dir = File.expand_path('../support', __FILE__)
Dir.glob("#{support_dir}/**/*.rb").each { |file| require file }

RSpec.configure do |config|
  config.include FilesCollectionHelpers
end


text:
omd start
service apache2 restart
/bin/bash


text:
	<title>Modify2</title>
	<link rel ="stylesheet" type="text/css" href="sample.css" >

Modify2

	<?php
		$adultTickets = $_POST['adultTickets'];
		$childTickets = $_POST['childTickets'];

		$discount = 0.00;
		$totalCost = $adultTickets * 6.50 + $childTickets * 4.50 - $discount;
		print("
You ordered $adultTickets adult tickets and
		$childTickets children's tickets.
");
		print("
Your cost is $$totalCost.
");
		print("
Your discount was $$discount.
");

	?>


text:
from bipy.toolbox import deseq
from bipy.utils import replace_suffix
from bcbio.utils import safe_makedir, file_exists
import os
import unittest

class TestDeseq(unittest.TestCase):

    def setUp(self):
        self.count_file = "test/data/pasilla_gene_counts.tsv"
        self.conds = ["untreat", "untreat", "untreat", "untreat",
                      "treat", "treat", "treat"]

    def test_run(self):
        out_prefix = "results/tests/deseq/test_deseq"
        safe_makedir(os.path.dirname(out_prefix))
        result = deseq.run(self.count_file, self.conds, out_prefix=out_prefix)
        self.assertTrue(file_exists(result))

if __name__ == "__main__":
    suite = unittest.TestLoader().loadTestsFromTestCase(TestDeseq)
    unittest.TextTestRunner(verbosity=2).run(suite)


text:
from south.db import db, engine
from south.v2 import SchemaMigration

class Migration(SchemaMigration):

    def forwards(self, orm):

        # Changing field 'Category.slug'
        db.alter_column('qa_category', 'slug', self.gf('django.db.models.fields.SlugField')(unique=True, max_length=255))

        # Changing field 'Category.name'
        db.alter_column('qa_category', 'name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=255))

        # Changing field 'Reference.name'
        db.alter_column('qa_reference', 'name', self.gf('django.db.models.fields.CharField')(max_length=255))

        # Changing field 'Test.name'
        db.alter_column('qa_test', 'name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=255))

        if 'sql_server' in engine:
            sql_server_idxs = (('qa_testlist', 'name'), ('qa_testlistcycle', 'name'),)
            for table_name, column_name in sql_server_idxs:
                try:
                    db.drop_index(table_name, column_name)
                except:
                    pass
                # sqlserver_utils.drop_index(db,table_name,column_name)

        # Changing field 'TestList.name'
        db.alter_column('qa_testlist', 'name', self.gf('django.db.models.fields.CharField')(max_length=255))

        # Changing field 'TestListCycle.name'
        db.alter_column('qa_testlistcycle', 'name', self.gf('django.db.models.fields.CharField')(max_length=255))

        if 'sql_server' in engine:
            for table_name, column_name in sql_server_idxs:
                db.create_index(table_name, [column_name])

    def backwards(self, orm):

        # Changing field 'Category.slug'
        db.alter_column('qa_category', 'slug', self.gf('django.db.models.fields.SlugField')(max_length=255, unique=True))

        # Changing field 'Category.name'
        db.alter_column('qa_category', 'name', self.gf('django.db.models.fields.CharField')(max_length=255, unique=True))

        # Changing field 'Reference.name'
        db.alter_column('qa_reference', 'name', self.gf('django.db.models.fields.CharField')(max_length=255))

        # Changing field 'Test.name'
        db.alter_column('qa_test', 'name', self.gf('django.db.models.fields.CharField')(max_length=255, unique=True))

        # Changing field 'TestList.name'
        db.alter_column('qa_testlist', 'name', self.gf('django.db.models.fields.CharField')(max_length=255))

        # Changing field 'TestListCycle.name'
        db.alter_column('qa_testlistcycle', 'name', self.gf('django.db.models.fields.CharField')(max_length=255))

    models = {
        'auth.group': {
            'Meta': {'object_name': 'Group'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
        },
        'auth.permission': {
            'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
        },
        'auth.user': {
            'Meta': {'object_name': 'User'},
            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
        },
        'contenttypes.contenttype': {
            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
        },
        'qa.category': {
            'Meta': {'object_name': 'Category'},
            'description': ('django.db.models.fields.TextField', [], {}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
            'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '255'})
        },
        'qa.frequency': {
            'Meta': {'ordering': "('nominal_interval',)", 'object_name': 'Frequency'},
            'due_interval': ('django.db.models.fields.PositiveIntegerField', [], {}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50'}),
            'nominal_interval': ('django.db.models.fields.PositiveIntegerField', [], {}),
            'overdue_interval': ('django.db.models.fields.PositiveIntegerField', [], {}),
            'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50'})
        },
        'qa.reference': {
            'Meta': {'object_name': 'Reference'},
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
            'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'reference_creators'", 'to': "orm['auth.User']"}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
            'modified_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'reference_modifiers'", 'to': "orm['auth.User']"}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
            'type': ('django.db.models.fields.CharField', [], {'default': "'numerical'", 'max_length': '15'}),
            'value': ('django.db.models.fields.FloatField', [], {})
        },
        'qa.test': {
            'Meta': {'object_name': 'Test'},
            'calculation_procedure': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
            'category': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['qa.Category']"}),
            'choices': ('django.db.models.fields.CharField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}),
            'constant_value': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
            'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'test_creator'", 'to': "orm['auth.User']"}),
            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
            'modified_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'test_modifier'", 'to': "orm['auth.User']"}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}),
            'procedure': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}),
            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '128'}),
            'type': ('django.db.models.fields.CharField', [], {'default': "'simple'", 'max_length': '10'})
        },
        'qa.testinstance': {
            'Meta': {'ordering': "('work_completed',)", 'object_name': 'TestInstance'},
            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
            'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'test_instance_creator'", 'to': "orm['auth.User']"}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'in_progress': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
            'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
            'modified_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'test_instance_modifier'", 'to': "orm['auth.User']"}),
            'pass_fail': ('django.db.models.fields.CharField', [], {'max_length': '20', 'db_index': 'True'}),
            'reference': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['qa.Reference']", 'null': 'True', 'on_delete': 'models.SET_NULL', 'blank': 'True'}),
            'review_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            'reviewed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}),
            'skipped': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'status': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['qa.TestInstanceStatus']"}),
            'test_list_instance': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['qa.TestListInstance']", 'null': 'True', 'blank': 'True'}),
            'tolerance': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['qa.Tolerance']", 'null': 'True', 'on_delete': 'models.SET_NULL', 'blank': 'True'}),
            'unit_test_info': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['qa.UnitTestInfo']"}),
            'value': ('django.db.models.fields.FloatField', [], {'null': 'True'}),
            'work_completed': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'db_index': 'True'}),
            'work_started': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'})
        },
        'qa.testinstancestatus': {
            'Meta': {'object_name': 'TestInstanceStatus'},
            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
            'export_by_default': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'is_default': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50'}),
            'requires_comment': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'requires_review': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
            'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50'}),
            'valid': ('django.db.models.fields.BooleanField', [], {'default': 'True'})
        },
        'qa.testlist': {
            'Meta': {'object_name': 'TestList'},
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
            'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'qa_testlist_created'", 'to': "orm['auth.User']"}),
            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
            'modified_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'qa_testlist_modified'", 'to': "orm['auth.User']"}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}),
            'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50'}),
            'sublists': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['qa.TestList']", 'null': 'True', 'blank': 'True'}),
            'tests': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['qa.Test']", 'through': "orm['qa.TestListMembership']", 'symmetrical': 'False'})
        },
        'qa.testlistcycle': {
            'Meta': {'object_name': 'TestListCycle'},
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
            'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'qa_testlistcycle_created'", 'to': "orm['auth.User']"}),
            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
            'modified_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'qa_testlistcycle_modified'", 'to': "orm['auth.User']"}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}),
            'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50'}),
            'test_lists': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['qa.TestList']", 'through': "orm['qa.TestListCycleMembership']", 'symmetrical': 'False'})
        },
        'qa.testlistcyclemembership': {
            'Meta': {'ordering': "('order',)", 'object_name': 'TestListCycleMembership'},
            'cycle': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['qa.TestListCycle']"}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'order': ('django.db.models.fields.IntegerField', [], {}),
            'test_list': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['qa.TestList']"})
        },
        'qa.testlistinstance': {
            'Meta': {'ordering': "('work_completed',)", 'object_name': 'TestListInstance'},
            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
            'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'test_list_instance_creator'", 'to': "orm['auth.User']"}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'in_progress': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
            'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
            'modified_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'test_list_instance_modifier'", 'to': "orm['auth.User']"}),
            'test_list': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['qa.TestList']"}),
            'unit_test_collection': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['qa.UnitTestCollection']"}),
            'work_completed': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'null': 'True', 'db_index': 'True'}),
            'work_started': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'})
        },
        'qa.testlistmembership': {
            'Meta': {'ordering': "('order',)", 'unique_together': "(('test_list', 'test'),)", 'object_name': 'TestListMembership'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'order': ('django.db.models.fields.IntegerField', [], {'db_index': 'True'}),
            'test': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['qa.Test']"}),
            'test_list': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['qa.TestList']"})
        },
        'qa.tolerance': {
            'Meta': {'object_name': 'Tolerance'},
            'act_high': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),
            'act_low': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),
            'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'tolerance_creators'", 'to': "orm['auth.User']"}),
            'created_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'mc_pass_choices': ('django.db.models.fields.CharField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}),
            'mc_tol_choices': ('django.db.models.fields.CharField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}),
            'modified_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'tolerance_modifiers'", 'to': "orm['auth.User']"}),
            'modified_date': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50'}),
            'tol_high': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),
            'tol_low': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),
            'type': ('django.db.models.fields.CharField', [], {'max_length': '20'})
        },
        'qa.unittestcollection': {
            'Meta': {'ordering': "('testlist__name', 'testlistcycle__name')", 'unique_together': "(('unit', 'frequency', 'content_type', 'object_id'),)", 'object_name': 'UnitTestCollection'},
            'active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True'}),
            'assigned_to': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.Group']", 'null': 'True'}),
            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
            'frequency': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['qa.Frequency']"}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'last_instance': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['qa.TestListInstance']", 'null': 'True', 'on_delete': 'models.SET_NULL'}),
            'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}),
            'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['units.Unit']"}),
            'visible_to': ('django.db.models.fields.related.ManyToManyField', [], {'default': '[]', 'related_name': "'test_collection_visibility'", 'symmetrical': 'False', 'to': "orm['auth.Group']"})
        },
        'qa.unittestinfo': {
            'Meta': {'unique_together': "(['test', 'unit'],)", 'object_name': 'UnitTestInfo'},
            'active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True'}),
            'assigned_to': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.Group']", 'null': 'True', 'on_delete': 'models.SET_NULL', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'last_instance': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['qa.TestInstance']", 'null': 'True', 'on_delete': 'models.SET_NULL'}),
            'reference': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['qa.Reference']", 'null': 'True', 'on_delete': 'models.SET_NULL', 'blank': 'True'}),
            'test': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['qa.Test']"}),
            'tolerance': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['qa.Tolerance']", 'null': 'True', 'on_delete': 'models.SET_NULL', 'blank': 'True'}),
            'unit': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['units.Unit']"})
        },
        'units.modality': {
            'Meta': {'unique_together': "[('type', 'energy')]", 'object_name': 'Modality'},
            'energy': ('django.db.models.fields.FloatField', [], {}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'type': ('django.db.models.fields.CharField', [], {'max_length': '20'})
        },
        'units.unit': {
            'Meta': {'ordering': "['number']", 'object_name': 'Unit'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'install_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
            'location': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
            'modalities': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['units.Modality']", 'symmetrical': 'False'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
            'number': ('django.db.models.fields.PositiveIntegerField', [], {'unique': 'True'}),
            'serial_number': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
            'type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['units.UnitType']"})
        },
        'units.unittype': {
            'Meta': {'unique_together': "[('name', 'model')]", 'object_name': 'UnitType'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'model': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
            'vendor': ('django.db.models.fields.CharField', [], {'max_length': '50'})
        }
    }

    complete_apps = ['qa']


text:
module NNTP
  module Client
    class Session
      attr_reader :group, :connection

      def self.start(host, port = 119)
        grabber = NNTP::Client::Session.new(host, port)

        if block_given?
          yield grabber
          grabber.finish!
        else
          grabber
        end
      end

      def initialize(host, port = 119)
        @connection = NNTP::Client::Connection.new(host, port)
      end

      def group(group_title)
        group = NNTP::Client::Group.new(self)
        group.title = group_title
        group
      end

      def newsgroups
        groups = []
        @connection.query("LIST") do |group_str|
          group = NNTP::Client::Group.new(self)
          group.parse!(group_str)
          groups << group
        end
        groups
      end

      def posts(group)
        raise ArgumentError if group.nil?
        posts = []
        @connection.query("LISTGROUP #{group}") do |post_id|
          post = Post.new(self)
          post.post_id = post_id
          posts << post
        end
        posts
      end

      def post(post_id)
        post = Post.new(self)
        post.post_id = post_id
        post
      end

      def finish!
        @connection.close unless @connection.closed?
      end
    end
  end
end


text:
.navbar-default .navbar-brand{
  color:#EE4E2B;
}
.nav li a.btn-danger:focus, .nav li a.btn-danger:hover{
  background-color: #D9534F;
}
/*.clearboth
{
  clear:both;
  display:block;
}*/
p.submit{text-align:right}
input:valid{border-color:green;}
/*input:invalid{border-color:red;}*/

ul.noPoint{list-style:none}
/*#pushProfond{display:none}*/
div.PushDestiRecherche{display:none}

a.actionPhotosIcon{
    padding:4px 2px 2px 9px;
}

a.actionLoginIcon{
   padding:4px 2px 2px 4px;
}

span.ajaxRotate{
    margin-top: 2px;
    padding:4px 2px 2px 4px;
    cursor:pointer;
}

img.imgAsync{
    cursor:pointer;
}

.metismenu .arrow {
    float: right;
    line-height: 1.42857;
}

*[dir="rtl"] .metismenu .arrow {
    float: left;
}

/*
 * Require Bootstrap
 * https://github.com/twbs/bootstrap
*/

.metismenu .glyphicon.arrow:before {
    content: "\e079";
}
.metismenu .active > a > .glyphicon.arrow:before {
    content: "\e114";
}

/*
 * Require Font-Awesome
 * http://fortawesome.github.io/Font-Awesome/
*/

.metismenu .fa.arrow:before {
    content: "\f104";
}
.metismenu .active > a > .fa.arrow:before {
    content: "\f107";
}

/*
 * Require Ionicons
 * http://ionicons.com/
*/

.metismenu .ion.arrow:before {
    content: "\f3d2"
}
.metismenu .active > a > .ion.arrow:before {
    content: "\f3d0";
}
.metismenu .plus-times {
    float: right;
}
*[dir="rtl"] .metismenu .plus-times {
    float: left;
}
.metismenu .fa.plus-times:before {
    content: "\f067";
}
.metismenu .active > a > .fa.plus-times {
    transform: rotate(45deg);
}
.metismenu .plus-minus {
    float: right;
}
*[dir="rtl"] .metismenu .plus-minus {
    float: left;
}
.metismenu .fa.plus-minus:before {
    content: "\f067";
}
.metismenu .active > a > .fa.plus-minus:before {
    content: "\f068";
}
.metismenu .collapse {
    display: none;
}
.metismenu .collapse.in {
    display: block;
}
.metismenu .collapsing {
    position: relative;
    height: 0;
    overflow: hidden;
    transition-timing-function: ease;
    transition-duration: .35s;
    transition-property: height, visibility;
}


text:
package edu.duke.cabig.c3pr.utils.web.spring.tabbedflow;

import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.validation.BindException;
import org.springframework.validation.Errors;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.SimpleFormController;

import edu.duke.cabig.c3pr.dao.C3PRBaseDao;
import edu.duke.cabig.c3pr.domain.AbstractMutableDeletableDomainObject;
import edu.duke.cabig.c3pr.utils.StringUtils;

public abstract class SimpleFormAjaxableController<C extends AbstractMutableDeletableDomainObject, D extends AbstractMutableDeletableDomainObject, A extends C3PRBaseDao<D>>
                extends SimpleFormController {

    private InPlaceEditableTab<C> page;

    protected abstract A getDao();

    public InPlaceEditableTab<C> getPage() {
        return page;
    }

    public SimpleFormAjaxableController() {
        super();
    }

    public void setPage(InPlaceEditableTab<C> page) {
        this.page = page;
    }

    @Override
    protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response,
                    Object command, BindException errors) throws Exception {
        // TODO Auto-generated method stub
        if (isAjaxRequest(request)) {
            request.getParameter("_asynchronous");
            ModelAndView modelAndView = page.postProcessAsynchronous(request, (C) command, errors);
            if (!errors.hasErrors() && shouldSave(request, (C) command)) {
                command = save((C) command, errors);
            }
            request.setAttribute(getFormSessionAttributeName(), command);
            if (isAjaxResponseFreeText(modelAndView)) {
                respondAjaxFreeText(modelAndView, response);
                return null;
            }
            return modelAndView;
        }
        else {
            return onSynchronousSubmit(request, response, (C) command, errors);
        }
    }

    protected ModelAndView onSynchronousSubmit(HttpServletRequest request,
                    HttpServletResponse response, Object command, BindException errors)
                    throws Exception {
        if (getSuccessView() == null) {
            throw new ServletException("successView isn't set");
        }
        return new ModelAndView(getSuccessView(), errors.getModel());
    }

    protected boolean isAjaxRequest(HttpServletRequest request) {
        if (StringUtils.getBlankIfNull(request.getParameter(getAjaxRequestParamName()))
                        .equalsIgnoreCase("true")) return true;
        return false;
    }

    protected void setAjaxModelAndView(HttpServletRequest request, ModelAndView modelAndView) {
        request.setAttribute(getAjaxModelAndViewAttr(), modelAndView);
    }

    protected ModelAndView getAjaxModelAndView(HttpServletRequest request) {
        return (ModelAndView) request.getAttribute(getAjaxModelAndViewAttr());
    }

    protected boolean isAjaxResponseFreeText(ModelAndView modelAndView) {
        if (StringUtils.getBlankIfNull(modelAndView.getViewName()).equals("")) {
            return true;
        }
        return false;
    }

    protected void respondAjaxFreeText(ModelAndView modelAndView, HttpServletResponse response)
                    throws Exception {
        PrintWriter pr = response.getWriter();
        pr.println(modelAndView.getModel().get(getFreeTextModelName()));
        pr.flush();
    }

    protected String getAjaxRequestParamName() {
        return "_asynchronous";
    }

    protected String getAjaxModelAndViewAttr() {
        return "async_model_and_view";
    }

    protected String getFreeTextModelName() {
        return "free_text";
    }

    protected ModelAndView postProcessAsynchronous(HttpServletRequest request, C command,
                    Errors error) throws Exception {
        return new ModelAndView(getAjaxViewName(request));
    }

    protected String getAjaxViewName(HttpServletRequest request) {
        return request.getParameter(getAjaxViewParamName());
    }

    protected String getAjaxViewParamName() {
        return "_asyncViewName";
    }

    protected boolean shouldSave(HttpServletRequest request, C command) {
        return true;
    }

    protected C save(C command, BindException errors) {
        getDao().save(getPrimaryDomainObject(command));
        return command;
    }

    protected abstract C getPrimaryDomainObject(C command);
}


text:
import WebAudioModule from "synth/webAudioModule";

class Limiter {
  constructor(audioCtx) {
    this.limiter = audioCtx.createDynamicsCompressor();
    this.limiter.threshold.value = 0.0;
    this.limiter.knee.value = 0.0;
    this.limiter.ratio.value = 20.0;
    this.limiter.attack.value = 0.005;
    this.limiter.release.value = 0.005;

    this.input = this.limiter;
    this.output = this.limiter;
  }
}

export default WebAudioModule(Limiter);


text:
'use strict'

module.exports = (function() {
  var fs = require('fs')
  var PEG = require('pegjs')

  // TODO: if webpack build, drop the filename concat used by browserify
  return PEG.buildParser(fs.readFileSync(__dirname + '/issuemd-parser.pegjs', 'utf8')) // eslint-disable-line no-path-concat
})()


text:
#ifndef _WORKQUEUE_H_
#define _WORKQUEUE_H_

typedef void (*workunit_func_t) (void *args);
typedef struct _workqueue workqueue_t;

workqueue_t *workqueue_alloc     (void);
void         workqueue_release   (workqueue_t *queue);

void         workqueue_wait      (workqueue_t *queue);

int          workqueue_additem   (workqueue_t *queue,
                                  workunit_func_t func,
                                  void *args);

#endif /* !_WORKQUEUE_H_ */


text:
cask "unexpectedly" do
  version "1.0b"
  sha256 :no_check

  url "http://s.sudre.free.fr/Software/files/Unexpectedly.dmg"
  name "Unexpectedly"
  desc "Browse and visualize the reports from crashes"
  homepage "http://s.sudre.free.fr/Software/Unexpectedly/about.html"

  livecheck do
    url :homepage
    regex(%r{Version:	(\d+(?:\.\d+)*\w)}i)
  end

  app "Unexpectedly.app"

  zap trash: "~/Library/Preferences/fr.whitebox.unexpectedly.plist"
end


text:
postgresql['shared_buffers'] = '1MB'

# Manage accounts with docker
manage_accounts['enable'] = false

# Get hostname from shell
host = `hostname`.strip
external_url "http://#{host}"

# Load custom config from environment variable: GITLAB_OMNIBUS_CONFIG
eval ENV["GITLAB_OMNIBUS_CONFIG"].to_s

# Load configuration stored in /etc/gitlab/gitlab.rb
from_file("/etc/gitlab/gitlab.rb")


text:
package org.apache.hadoop.mapred;

import java.io.IOException;
import java.text.NumberFormat;

import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.compress.CompressionCodec;
import org.apache.hadoop.mapred.workflow.WorkflowConf;
import org.apache.hadoop.mapreduce.security.TokenCache;
import org.apache.hadoop.util.Progressable;

/** A base class for {@link OutputFormat}. */
public abstract class FileOutputFormat<K, V> implements OutputFormat<K, V> {

  public static enum Counter {
    BYTES_WRITTEN
  }

  /**
   * Set whether the output of the job is compressed.
   * @param conf the {@link JobConf} to modify
   * @param compress should the output of the job be compressed?
   */
  public static void setCompressOutput(JobConf conf, boolean compress) {
    conf.setBoolean("mapred.output.compress", compress);
  }

  /**
   * Is the job output compressed?
   * @param conf the {@link JobConf} to look in
   * @return true if the job output should be compressed,
   *         false otherwise
   */
  public static boolean getCompressOutput(JobConf conf) {
    return conf.getBoolean("mapred.output.compress", false);
  }

  /**
   * Set the {@link CompressionCodec} to be used to compress job outputs.
   * @param conf the {@link JobConf} to modify
   * @param codecClass the {@link CompressionCodec} to be used to
   *                   compress the job outputs
   */
  public static void
  setOutputCompressorClass(JobConf conf,
                           Class<? extends CompressionCodec> codecClass) {
    setCompressOutput(conf, true);
    conf.setClass("mapred.output.compression.codec", codecClass,
                  CompressionCodec.class);
  }

  /**
   * Get the {@link CompressionCodec} for compressing the job outputs.
   * @param conf the {@link JobConf} to look in
   * @param defaultValue the {@link CompressionCodec} to return if not set
   * @return the {@link CompressionCodec} to be used to compress the
   *         job outputs
   * @throws IllegalArgumentException if the class was specified, but not found
   */
  public static Class<? extends CompressionCodec>
  getOutputCompressorClass(JobConf conf,
		                       Class<? extends CompressionCodec> defaultValue) {
    Class<? extends CompressionCodec> codecClass = defaultValue;

    String name = conf.get("mapred.output.compression.codec");
    if (name != null) {
      try {
        codecClass =
        	conf.getClassByName(name).asSubclass(CompressionCodec.class);
      } catch (ClassNotFoundException e) {
        throw new IllegalArgumentException("Compression codec " + name +
                                           " was not found.", e);
      }
    }
    return codecClass;
  }

  public abstract RecordWriter<K, V> getRecordWriter(FileSystem ignored,
                                               JobConf job, String name,
                                               Progressable progress)
    throws IOException;

  public void checkOutputSpecs(FileSystem ignored, JobConf job)
    throws FileAlreadyExistsException,
           InvalidJobConfException, IOException {
    // Ensure that the output directory is set and not already there
    Path outDir = getOutputPath(job);
    if (outDir == null && job.getNumReduceTasks() != 0) {
      throw new InvalidJobConfException("Output directory not set in JobConf.");
    }
    if (outDir != null) {
      FileSystem fs = outDir.getFileSystem(job);
      // normalize the output directory
      outDir = fs.makeQualified(outDir);
      setOutputPath(job, outDir);

      // get delegation token for the outDir's file system
      TokenCache.obtainTokensForNamenodes(job.getCredentials(),
                                          new Path[] {outDir}, job);

      // Check for output directory existence.
      // Workflow jobs can have the same output directory (exit jobs).
      if (fs.exists(outDir) && job.getWorkflowId() == null) {
        throw new FileAlreadyExistsException(
            "Output directory " + outDir + " already exists");
      }
    }
  }

  /**
   * Set the {@link Path} of the output directory for the map-reduce job.
   *
   * @param conf The configuration of the job.
   * @param outputDir the {@link Path} of the output directory for
   * the map-reduce job.
   */
  public static void setOutputPath(JobConf conf, Path outputDir) {
    outputDir = new Path(conf.getWorkingDirectory(), outputDir);
    conf.set("mapred.output.dir", outputDir.toString());
  }

  /**
   * Set the {@link Path} of the output directory for the map-reduce workflow.
   *
   * @param conf The configuration of the workflow.
   * @param outputDir the {@link Path} of the output directory for the
   *          map-reduce workflow.
   */
  public static void setOutputPath(WorkflowConf conf, Path outputDir) {
    outputDir = new Path(conf.getWorkingDirectory(), outputDir);
    conf.set("mapred.output.dir", outputDir.toString());
  }

  /**
   * Set the {@link Path} of the task's temporary output directory
   * for the map-reduce job.
   *
   *
Note: Task output path is set by the framework.
   *

   * @param conf The configuration of the job.
   * @param outputDir the {@link Path} of the output directory
   * for the map-reduce job.
   */

  static void setWorkOutputPath(JobConf conf, Path outputDir) {
    outputDir = new Path(conf.getWorkingDirectory(), outputDir);
    conf.set("mapred.work.output.dir", outputDir.toString());
  }

  /**
   * Get the {@link Path} to the output directory for the map-reduce job.
   *
   * @return the {@link Path} to the output directory for the map-reduce job.
   * @see FileOutputFormat#getWorkOutputPath(JobConf)
   */
  public static Path getOutputPath(JobConf conf) {
    String name = conf.get("mapred.output.dir");
    return name == null ? null: new Path(name);
  }

  /**
   *  Get the {@link Path} to the task's temporary output directory
   *  for the map-reduce job
   *
   *
Tasks' Side-Effect Files

   *
   *
Note: The following is valid only if the {@link OutputCommitter}
   *  is {@link FileOutputCommitter}. If OutputCommitter is not
   *  a FileOutputCommitter, the task's temporary output
   *  directory is same as {@link #getOutputPath(JobConf)} i.e.
   *  <tt>${mapred.output.dir}$</tt>

   *
   *
Some applications need to create/write-to side-files, which differ from
   * the actual job-outputs.
   *
   *
In such cases there could be issues with 2 instances of the same TIP
   * (running simultaneously e.g. speculative tasks) trying to open/write-to the
   * same file (path) on HDFS. Hence the application-writer will have to pick
   * unique names per task-attempt (e.g. using the attemptid, say
   * <tt>attempt_200709221812_0001_m_000000_0</tt>), not just per TIP.

   *
   *
To get around this the Map-Reduce framework helps the application-writer
   * out by maintaining a special
   * <tt>${mapred.output.dir}/_temporary/_${taskid}</tt>
   * sub-directory for each task-attempt on HDFS where the output of the
   * task-attempt goes. On successful completion of the task-attempt the files
   * in the <tt>${mapred.output.dir}/_temporary/_${taskid}</tt> (only)
   * are promoted to <tt>${mapred.output.dir}</tt>. Of course, the
   * framework discards the sub-directory of unsuccessful task-attempts. This
   * is completely transparent to the application.

   *
   *
The application-writer can take advantage of this by creating any
   * side-files required in <tt>${mapred.work.output.dir}</tt> during execution
   * of his reduce-task i.e. via {@link #getWorkOutputPath(JobConf)}, and the
   * framework will move them out similarly - thus she doesn't have to pick
   * unique paths per task-attempt.

   *
   *
Note: the value of <tt>${mapred.work.output.dir}</tt> during
   * execution of a particular task-attempt is actually
   * <tt>${mapred.output.dir}/_temporary/_{$taskid}</tt>, and this value is
   * set by the map-reduce framework. So, just create any side-files in the
   * path  returned by {@link #getWorkOutputPath(JobConf)} from map/reduce
   * task to take advantage of this feature.

   *
   *
The entire discussion holds true for maps of jobs with
   * reducer=NONE (i.e. 0 reduces) since output of the map, in that case,
   * goes directly to HDFS.

   *
   * @return the {@link Path} to the task's temporary output directory
   * for the map-reduce job.
   */
  public static Path getWorkOutputPath(JobConf conf) {
    String name = conf.get("mapred.work.output.dir");
    return name == null ? null: new Path(name);
  }

  /**
   * Helper function to create the task's temporary output directory and
   * return the path to the task's output file.
   *
   * @param conf job-configuration
   * @param name temporary task-output filename
   * @return path to the task's temporary output file
   * @throws IOException
   */
  public static Path getTaskOutputPath(JobConf conf, String name)
  throws IOException {
    // ${mapred.out.dir}
    Path outputPath = getOutputPath(conf);
    if (outputPath == null) {
      throw new IOException("Undefined job output-path");
    }

    OutputCommitter committer = conf.getOutputCommitter();
    Path workPath = outputPath;
    TaskAttemptContext context = new TaskAttemptContext(conf,
                TaskAttemptID.forName(conf.get("mapred.task.id")));
    if (committer instanceof FileOutputCommitter) {
      workPath = ((FileOutputCommitter)committer).getWorkPath(context,
                                                              outputPath);
    }

    // ${mapred.out.dir}/_temporary/_${taskid}/${name}
    return new Path(workPath, name);
  }

  /**
   * Helper function to generate a name that is unique for the task.
   *
   *
The generated name can be used to create custom files from within the
   * different tasks for the job, the names for different tasks will not collide
   * with each other.

   *
   *
The given name is postfixed with the task type, 'm' for maps, 'r' for
   * reduces and the task partition number. For example, give a name 'test'
   * running on the first map o the job the generated name will be
   * 'test-m-00000'.

   *
   * @param conf the configuration for the job.
   * @param name the name to make unique.
   * @return a unique name accross all tasks of the job.
   */
  public static String getUniqueName(JobConf conf, String name) {
    int partition = conf.getInt("mapred.task.partition", -1);
    if (partition == -1) {
      throw new IllegalArgumentException(
        "This method can only be called from within a Job");
    }

    String taskType = (conf.getBoolean("mapred.task.is.map", true)) ? "m" : "r";

    NumberFormat numberFormat = NumberFormat.getInstance();
    numberFormat.setMinimumIntegerDigits(5);
    numberFormat.setGroupingUsed(false);

    return name + "-" + taskType + "-" + numberFormat.format(partition);
  }

  /**
   * Helper function to generate a {@link Path} for a file that is unique for
   * the task within the job output directory.
   *
   *
The path can be used to create custom files from within the map and
   * reduce tasks. The path name will be unique for each task. The path parent
   * will be the job output directory.
ls
   *
   *
This method uses the {@link #getUniqueName} method to make the file name
   * unique for the task.

   *
   * @param conf the configuration for the job.
   * @param name the name for the file.
   * @return a unique path accross all tasks of the job.
   */
  public static Path getPathForCustomFile(JobConf conf, String name) {
    return new Path(getWorkOutputPath(conf), getUniqueName(conf, name));
  }
}


text:
/*jshint laxcomma: true, smarttabs: true, esnext: true, mocha: true, node:true*/
'use strict';
var should = require('should')
  , hapi = require('hapi')
  , tastypie = require('../')
  , HttpResource
  ;

HttpResource = tastypie.Resource.extend({
  options:{}
  ,constructor: function( options ){
    this.parent('constructor', options);
  }
  ,prepend_urls: function(){
    return [{
      name: 'status'
      ,path: '/api/v1/http/status/{status}'
      ,method:'*'
      ,handler: this.get_status.bind( this )
    },{
      name: 'redirect'
      ,path: '/api/v1/http/redirect/{status}'
      ,method:'*'
      ,handler: this.get_redirect.bind( this )
    }]
  }

  ,get_status: function(request, reply){
    var status = request.params.status
    return this.respond(this.bundle(request,reply), tastypie.http[status] || tastypie.http.noFound );
  }

  ,get_redirect: function( request, reply ){
    var status = request.params.status
    return this.respond(this.bundle(request,reply), tastypie.http[status] || tastypie.http.noFound, `/api/v1/fake/${status}` );
  }
});

describe('Resource', function(){
  describe('http responses',function(){
    var server
    before(function(done){
      server = new hapi.Server();
      server.connection({host:'localhost'})

      var api = new tastypie.Api('/api/v1');
      api.use('http',new HttpResource())
      server.register( api, done )
    })

    it('should responsd with a 101 using http.switching', function( done ){
      server.inject({
        url:'/api/v1/http/status/switching'
        ,method:'GET'
      },function( response ){
        response.statusCode.should.equal( 101 );
        done()
      })
    })

    it('should responsd with a 102 using http.processing', function( done ){
      server.inject({
        url:'/api/v1/http/status/processing'
        ,method:'GET'
      },function( response ){
        response.statusCode.should.equal( 102 );
        done()
      })
    })

    it('should responsd with a 201 using http.created', function( done ){
      server.inject({
        url:'/api/v1/http/status/created'
        ,method:'POST'
      },function( response ){
        response.statusCode.should.equal( 201 );
        done()
      })
    })

    it('should responsd with a 202 using http.accepted', function( done ){
      server.inject({
        url:'/api/v1/http/status/accepted'
        ,method:'GET'
      },function( response ){
        response.statusCode.should.equal( 202 );
        done()
      })
    })

    it('should responsd with a 203 using http.nonAutoritative', function( done ){
      server.inject({
        url:'/api/v1/http/status/nonAutoritative'
        ,method:'GET'
      },function( response ){
        response.statusCode.should.equal( 203 );
        done()
      })
    })

    it('should responsd with a 204 using http.noContent', function( done ){
      server.inject({
        url:'/api/v1/http/status/noContent'
        ,method:'GET'
      },function( response ){
        response.statusCode.should.equal( 204 );
        done()
      })
    })

    it('should responsd with a 205 using http.resetContent', function( done ){
      server.inject({
        url:'/api/v1/http/status/resetContent'
        ,method:'GET'
      },function( response ){
        response.statusCode.should.equal( 205 );
        done()
      })
    })

    it('should responsd with a 206 using http.partialContent', function( done ){
      server.inject({
        url:'/api/v1/http/status/partialContent'
        ,method:'GET'
      },function( response ){
        response.statusCode.should.equal( 206 );
        done()
      })
    })

    it('should responsd with a 400 using http.badRequest', function( done ){
      server.inject({
        url:'/api/v1/http/status/badRequest'
        ,method:'GET'
      },function( response ){
        response.statusCode.should.equal( 400 );
        done()
      })
    })

    it('should responsd with a 401 using http.unauthorized', function( done ){
      server.inject({
        url:'/api/v1/http/status/unauthorized'
        ,method:'GET'
      },function( response ){
        response.statusCode.should.equal( 401 );
        done()
      })
    })

    it('should responsd with a 403 using http.forbidden', function( done ){
      server.inject({
        url:'/api/v1/http/status/forbidden'
        ,method:'GET'
      },function( response ){
        response.statusCode.should.equal( 403 );
        done()
      })
    })

    it('should responsd with a 404 using http.notFound', function( done ){
      server.inject({
        url:'/api/v1/http/status/notFound'
        ,method:'GET'
      },function( response ){
        response.statusCode.should.equal( 404 );
        done()
      })
    });

    it('should responsd with a 405 using http.methodNotAllowed', function( done ){
      server.inject({
        url:'/api/v1/http/status/methodNotAllowed'
        ,method:'GET'
      },function( response ){
        response.statusCode.should.equal( 405 );
        done()
      })
    })

    it('should responsd with a 406 using http.notAcceptable', function( done ){
      server.inject({
        url:'/api/v1/http/status/notAcceptable'
        ,method:'GET'
      },function( response ){
        response.statusCode.should.equal( 406 );
        done()
      })
    });

    it('should responsd with a 407 using http.proxyAuthenticationRequired', function( done ){
      server.inject({
        url:'/api/v1/http/status/proxyAuthenticationRequired'
        ,method:'GET'
      },function( response ){
        response.statusCode.should.equal( 407 );
        done()
      })
    });

    it('should responsd with a 408 using http.requestTimeout', function( done ){
      server.inject({
        url:'/api/v1/http/status/requestTimeout'
        ,method:'GET'
      },function( response ){
        response.statusCode.should.equal( 408 );
        done()
      })
    });

    it('should responsd with a 409 using http.conflict', function( done ){
      server.inject({
        url:'/api/v1/http/status/conflict'
        ,method:'GET'
      },function( response ){
        response.statusCode.should.equal( 409 );
        done()
      })
    });

    it('should responsd with a 410 using http.gone', function( done ){
      server.inject({
        url:'/api/v1/http/status/gone'
        ,method:'GET'
      },function( response ){
        response.statusCode.should.equal( 410 );
        done();
      })
    });

    it('should responsd with a 411 using http.lengthRequired', function( done ){
      server.inject({
        url:'/api/v1/http/status/lengthRequired'
        ,method:'GET'
      },function( response ){
        response.statusCode.should.equal( 411 );
        done()
      })
    });

    it('should responsd with a 412 using http.preconditionFailed', function( done ){
      server.inject({
        url:'/api/v1/http/status/preconditionFailed'
        ,method:'GET'
      },function( response ){
        response.statusCode.should.equal( 412 );
        done()
      })
    });

    it('should responsd with a 413 using http.payloadTooLarge', function( done ){
      server.inject({
        url:'/api/v1/http/status/payloadTooLarge'
        ,method:'GET'
      },function( response ){
        response.statusCode.should.equal( 413 );
        done()
      })
    });

    it('should responsd with a 415 using http.unsupportedMediaType', function( done ){
      server.inject({
        url:'/api/v1/http/status/unsupportedMediaType'
        ,method:'GET'
      },function( response ){
        response.statusCode.should.equal( 415 );
        done()
      })
    });

    it('should responsd with a 417 using http.expectationFailed', function( done ){
      server.inject({
        url:'/api/v1/http/status/expectationFailed'
        ,method:'GET'
      },function( response ){
        response.statusCode.should.equal( 417 );
        done()
      })
    });

    it('should responsd with a 422 using http.unprocessableEntity', function( done ){
      server.inject({
        url:'/api/v1/http/status/unprocessableEntity'
        ,method:'GET'
      },function( response ){
        response.statusCode.should.equal( 422 );
        done()
      })
    });

    it('should responsd with a 429 using http.tooManyRequests', function( done ){
      server.inject({
        url:'/api/v1/http/status/tooManyRequests'
        ,method:'GET'
      },function( response ){
        response.statusCode.should.equal( 429 );
        done()
      })
    });

    it('should responsd with a 500 using http.serverError', function( done ){
      server.inject({
        url:'/api/v1/http/status/serverError'
        ,method:'GET'
      },function( response ){
        response.statusCode.should.equal( 500 );
        done()
      })
    });

    it('should responsd with a 501 using http.notImplemented', function( done ){
      server.inject({
        url:'/api/v1/http/status/notImplemented'
        ,method:'GET'
      },function( response ){
        response.statusCode.should.equal( 501 );
        done()
      })
    });

    it('should responsd with a 502 using http.badGateway', function( done ){
      server.inject({
        url:'/api/v1/http/status/badGateway'
        ,method:'GET'
      },function( response ){
        response.statusCode.should.equal( 502 );
        done()
      })
    });

    it('should responsd with a 503 using http.serviceUnavailable', function( done ){
      server.inject({
        url:'/api/v1/http/status/serviceUnavailable'
        ,method:'GET'
      },function( response ){
        response.statusCode.should.equal( 503 );
        done()
      })
    });

    it('should responsd with a 504 using http.gatewayTimeout', function( done ){
      server.inject({
        url:'/api/v1/http/status/gatewayTimeout'
        ,method:'GET'
      },function( response ){
        response.statusCode.should.equal( 504 );
        done()
      })
    });

    it('should responsd with a 505 using http.httpVersionNotSupported', function( done ){
      server.inject({
        url:'/api/v1/http/status/httpVersionNotSupported'
        ,method:'GET'
      },function( response ){
        response.statusCode.should.equal( 505 );
        done()
      })
    });

    it('should responsd with a 507 using http.insufficientStorage', function( done ){
      server.inject({
        url:'/api/v1/http/status/insufficientStorage'
        ,method:'GET'
      },function( response ){
        response.statusCode.should.equal( 507 );
        done()
      })
    });

    describe("redirects", function(){

      it('should responsd with a 301 using http.movedPermanently', function( done ){
        server.inject({
          url:'/api/v1/http/redirect/movedPermanently'
          ,method:'GET'
        },function( response ){
          response.statusCode.should.equal( 301 );
          response.headers.location.should.equal('/api/v1/fake/movedPermanently')
          done()
        })
      });

      it('should responsd with a 302 using http.found', function( done ){
        server.inject({
          url:'/api/v1/http/redirect/found'
          ,method:'GET'
        },function( response ){
          response.statusCode.should.equal( 302 );
          response.headers.location.should.equal('/api/v1/fake/found')
          done()
        })
      });

      it('should responsd with a 303 using http.seeOther', function( done ){
        server.inject({
          url:'/api/v1/http/redirect/seeOther'
          ,method:'GET'
        },function( response ){
          response.statusCode.should.equal( 303 );
          response.headers.location.should.equal('/api/v1/fake/seeOther')
          done()
        })
      });

      it('should responsd with a 306 using http.switchProxy', function( done ){
        server.inject({
          url:'/api/v1/http/redirect/switchProxy'
          ,method:'GET'
        },function( response ){
          response.statusCode.should.equal( 306 );
          response.headers.location.should.equal('/api/v1/fake/switchProxy')
          done()
        })
      });

      it('should responsd with a 307 using http.temporaryRedirect', function( done ){
        server.inject({
          url:'/api/v1/http/redirect/temporaryRedirect'
          ,method:'GET'
        },function( response ){
          response.statusCode.should.equal( 307 );
          response.headers.location.should.equal('/api/v1/fake/temporaryRedirect')
          done()
        })
      });

    })

  })
})


text:
namespace content {

// Shall only be set once and never go back to NULL.
WebRtcLogMessageDelegate* g_webrtc_logging_delegate = NULL;

void InitWebRtcLoggingDelegate(WebRtcLogMessageDelegate* delegate) {
  CHECK(!g_webrtc_logging_delegate);
  CHECK(delegate);

  g_webrtc_logging_delegate = delegate;
}

void InitWebRtcLogging() {
  talk_base::InitDiagnosticLoggingDelegateFunction(WebRtcLogMessage);
}

void WebRtcLogMessage(const std::string& message) {
  if (g_webrtc_logging_delegate)
    g_webrtc_logging_delegate->LogMessage(message);
}

}  // namespace content


text:
We had some 2-dimensional coordinates, like `"(1, 3)"` or `"(2, 0.5)"`.  Then, we removed all commas, decimal points, and spaces, and ended up with the string `S`.  Return a list of strings representing all possibilities for what our original coordinates could have been.

Our original representation never had extraneous zeroes, so we never started with numbers like "00", "0.0", "0.00", "1.0", "001", "00.01", or any other number that can be represented with less digits.  Also, a decimal point within a number never occurs without at least one digit occuring before it, so we never started with numbers like ".1".

The final answer list can be returned in any order.  Also note that all coordinates in the final answer have exactly one space between them (occurring after the comma.)

Example 1:
Input: "(123)"
Output: ["(1, 23)", "(12, 3)", "(1.2, 3)", "(1, 2.3)"]

Example 2:
Input: "(00011)"
Output:  ["(0.001, 1)", "(0, 0.011)"]
Explanation:
0.0, 00, 0001 or 00.01 are not allowed.

Example 3:
Input: "(0123)"
Output: ["(0, 123)", "(0, 12.3)", "(0, 1.23)", "(0.1, 23)", "(0.1, 2.3)", "(0.12, 3)"]

Example 4:
Input: "(100)"
Output: [(10, 0)]
Explanation:
1.0 is not allowed.

**Note:**

- `4 <= S.length <= 12`.
- `S[0]` = "(", `S[S.length - 1]` = ")", and the other elements in `S` are digits.

### [Editorial](https://leetcode.com/articles/ambiguous-coordinates/)


text:
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.Mvc;
using DevTest;
using PagedList;

namespace DevTest.Controllers
{
    public class ResultController : Controller
    {
        private DevTestAdminEntities db = new DevTestAdminEntities();
        private string defaultSite = "Select a site";
        private int pageSize = 5;

        // GET: Result
        public ActionResult Index()
        {
            var devTestUserResults = db.devTestUserResults.Include(d => d.devTestUser);

            if (devTestUserResults == null)
            {
                return HttpNotFound();
            }

            List<string> siteList = new List<string>();
            siteList.Add(defaultSite);

            // try catch in case underlying data provider fails to open
            try
            {
                ViewBag.RecordCount = devTestUserResults.Count();
                siteList.AddRange(devTestUserResults.Select(r => r.devTestUser.site).Distinct());
            }
            catch (Exception e)
            {
                return HttpNotFound();
            }

            ViewBag.Sites = new SelectList(siteList);
            ViewBag.ScoreLength = devTestUserResults.Select(r => r.testResultDenominator).Max().ToString().Length;
            ViewBag.DefaultSite = defaultSite;
            ViewBag.Record = 1;

            devTestUserResults = devTestUserResults.OrderBy(r => r.id);

            return View(devTestUserResults.ToPagedList(1, pageSize));
        }

        public ActionResult UpdateTable(string sort, string name, string site, string lowScore, string upScore, string dateStart, string dateEnd, int? page, int? record)
        {
            var devTestUserResults = db.devTestUserResults.Include(d => d.devTestUser);
            ViewBag.RecordCount = devTestUserResults.Count();
            int minScore = 0;
            int maxScore = devTestUserResults.Select(r => r.testResultDenominator).Max();

            if (!String.IsNullOrEmpty(name))
            {
                devTestUserResults = devTestUserResults.Where(r => r.devTestUser.firstName.Contains(name)
                                        || r.devTestUser.lastName.Contains(name));
            }

            if (!String.IsNullOrEmpty(site) && site != defaultSite)
            {
                devTestUserResults = devTestUserResults.Where(r => r.devTestUser.site == site);
            }

            if (!String.IsNullOrEmpty(lowScore))
            {
                Int32.TryParse(lowScore, out minScore);
            }

            if (!String.IsNullOrEmpty(upScore))
            {
                Int32.TryParse(upScore, out maxScore);
            }

            devTestUserResults = devTestUserResults.Where(r => r.testResultNumerator >= minScore && r.testResultNumerator <= maxScore);

            if (!String.IsNullOrEmpty(dateStart) && !String.IsNullOrEmpty(dateEnd))
            {
                DateTime start;
                DateTime end;
                if (DateTime.TryParse(dateStart, out start))
                {
                    if (DateTime.TryParse(dateEnd, out end))
                    {
                        devTestUserResults = devTestUserResults.Where(r => r.dateTaken >= start && r.dateTaken <= end);
                    }
                }
            }

            switch (sort)
            {
                case "firstNameDesc":
                    devTestUserResults = devTestUserResults.OrderByDescending(r => r.devTestUser.firstName);
                    break;
                case "firstNameAsc":
                    devTestUserResults = devTestUserResults.OrderBy(r => r.devTestUser.firstName);
                    break;
                case "lastNameDesc":
                    devTestUserResults = devTestUserResults.OrderByDescending(r => r.devTestUser.lastName);
                    break;
                case "lastNameAsc":
                    devTestUserResults = devTestUserResults.OrderBy(r => r.devTestUser.lastName);
                    break;
                case "siteDesc":
                    devTestUserResults = devTestUserResults.OrderByDescending(r => r.devTestUser.site);
                    break;
                case "siteAsc":
                    devTestUserResults = devTestUserResults.OrderBy(r => r.devTestUser.site);
                    break;
                case "joinedDesc":
                    devTestUserResults = devTestUserResults.OrderByDescending(r => r.devTestUser.dateCreated);
                    break;
                case "joinedAsc":
                    devTestUserResults = devTestUserResults.OrderBy(r => r.devTestUser.dateCreated);
                    break;
                case "scoreDesc":
                    devTestUserResults = devTestUserResults.OrderByDescending(r => r.testResultNumerator);
                    break;
                case "scoreAsc":
                    devTestUserResults = devTestUserResults.OrderBy(r => r.testResultNumerator);
                    break;
                case "takenDesc":
                    devTestUserResults = devTestUserResults.OrderByDescending(r => r.dateTaken);
                    break;
                case "takenAsc":
                    devTestUserResults = devTestUserResults.OrderBy(r => r.dateTaken);
                    break;
                default:
                    devTestUserResults = devTestUserResults.OrderBy(r => r.id);
                    break;
            }

            // set values for page number and record number if none supplied
            int pageNumber = (page ?? 1);
            int recordNumber = (record ?? 1);
            // validate page number and record number
            pageNumber = (pageNumber >= 1 && pageNumber <= ((devTestUserResults.Count() / pageSize) + 1)) ? pageNumber : 1;
            recordNumber = (recordNumber <= pageSize) ? recordNumber : 1;

            ViewBag.Sort = sort;
            ViewBag.Record = recordNumber;
            ViewBag.DefaultSite = defaultSite;

            return PartialView("_ResultTable", devTestUserResults.ToPagedList(pageNumber, pageSize));
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                db.Dispose();
            }
            base.Dispose(disposing);
        }
    }
}


text:
[![CircleCI](https://circleci.com/gh/kukiron/graphql-messaging-app.svg?style=svg)](https://circleci.com/gh/kukiron/graphql-messaging-app) [![Build Status](https://travis-ci.org/kukiron/graphql-messaging-app.svg?branch=master)](https://travis-ci.org/kukiron/graphql-messaging-app) [![Code Climate](https://codeclimate.com/github/kukiron/graphql-messaging-app/badges/gpa.svg)](https://codeclimate.com/github/kukiron/graphql-messaging-app)

GraphQL messaing/todo app with React, Redux and Apollo

### Objectives

1. Build a React app with GraphQL and Apollo
2. Build a GraphQL server
3. Adding mutations to React/GraphQL app

## Getting Started

Clone the repo using
```
> git clone https://github.com/kukiron/graphql-messaging-app.git
> cd graphql-messaging-app/client
> npm install
> npm start
```
To start the server, open anoter command line & use
```
> cd ..
> cd server
> npm install
> npm start
```
You'll be navigated to http://localhost:3000.
Add new messages to the existing ones.

To create a production build, use npm run build


text:
"use strict";

var fs = require("fs");
var path = require("path");
var marked = require("marked");
var RSS = require("rss");

var resolve_path = require("./helper/resolve-path");

module.exports = function(grunt) {
  grunt.registerMultiTask(
    "create-website-news-rss",
    "Creates RSS html files for the news.",
    function() {
      var self = this;

      var root_dir = resolve_path(this.data.repo_root);
      var input_news_file = resolve_path(this.data.input.news);
      var output_dir = resolve_path(this.data.output.dir);

      /* MAIN FUNCTION */

      this.build = function() {
        // load earlier create array of news posts
        var news = grunt.file.readJSON(input_news_file);

        // prepare RSS feed
        var feed = new RSS(self.data.feed);

        // iterate through news posts and handle them
        news.forEach(function(post) {
          if (post.type === "file") {
            self.handleNewsPost(post, feed);
          }
        });

        // save feed
        var xml = feed.xml({ indent: true });
        grunt.file.write(path.join(output_dir, self.data.output.feed), xml);

        grunt.log.ok("Website RSS news generated successfully!");
      };

      /* HELPING FUNCTIONS */

      this.handleNewsPost = function(post, feed) {
        // read content
        var content = fs
          .readFileSync(path.join(root_dir, post.file))
          .toString();

        // filter guid from news post
        var guid = new RegExp(
          self.data.regex.guid.pattern,
          self.data.regex.guid.flags
        ).exec(content);
        if (guid === null || guid.length < 2) {
          grunt.log.warn(
            "News post " +
              post.name +
              " has no guid that can be used to generate an RSS post!"
          );
          return; // no guid, no RSS!
        }
        guid = guid[1]; // first capture group

        // parse markdown into html
        content = marked(content);

        // put content into html template
        content =
          '<!doctype html public "-//W3C//DTD HTML 4.0 Transitional //EN">' +
          '<meta http-equiv="Content-Type" content="text/html; charset-us-ascii">' +
          content +
          "";

        // write rss news html to disk
        grunt.file.write(path.join(output_dir, guid + ".html"), content);

        // add post to rss feed
        feed.item({
          title: post.title,
          description: content,
          url: self.data.post_url + guid + ".html",
          guid: guid,
          date: new Date(Date.parse(post.date)).toUTCString()
        });
      };

      // finally, run the build!
      this.build();
    }
  );
};


text:
class CreateBetToRides < ActiveRecord::Migration
  def change
    create_table :bet_to_rides do |t|
      t.integer :bet_winner
      t.boolean :success
      t.belongs_to :riding, index: true, foreign_key: true
      t.belongs_to :bet, index: true, foreign_key: true

      t.timestamps null: false
    end
  end
end


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace OneDriveWeb.Data {
  public class OneDriveWebInitializer : System.Data.Entity.DropCreateDatabaseIfModelChanges<OneDriveWebContext> {

  }

}


text:
//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <string>

// template<> struct char_traits<wchar_t>

// static constexpr bool eq_int_type(int_type c1, int_type c2);

#include <string>
#include <cassert>
#include "libcxx_tc_common.h"

int tc_libcxx_strings_char_traits_specializations_wchar_t_eq_int_type(void)
{
    TC_ASSERT_EXPR( std::char_traits<wchar_t>::eq_int_type(L'a', L'a'));
    TC_ASSERT_EXPR(!std::char_traits<wchar_t>::eq_int_type(L'a', L'A'));
    TC_ASSERT_EXPR(!std::char_traits<wchar_t>::eq_int_type(std::char_traits<wchar_t>::eof(), L'A'));
    TC_ASSERT_EXPR( std::char_traits<wchar_t>::eq_int_type(std::char_traits<wchar_t>::eof(),
                                                   std::char_traits<wchar_t>::eof()));
    TC_SUCCESS_RESULT();
    return 0;
}


text:
"""
Settings file for jsonfield_compat tests
"""
import os

from django import VERSION as DJANGO_VERSION

SECRET_KEY = 'test'

INSTALLED_APPS = [
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'test_app',
]

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
)

USE_DB = os.environ.get('DB', 'postgresql')

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': 'auditlog_tests.db',
    }
}

ROOT_URLCONF = []

JSONFIELD_ENCODER_CLASS = 'tests.test_app.json_encoder.TestJSONEncoder'


text:
class GradeMatrix
  attr_reader :course, :as_seen_by

  def initialize(course, as_seen_by)
    @course = course
    @as_seen_by = as_seen_by

    # TODO: make caching logic much more clear
    # only need to generate objects if they're going to be used
    cache_key = GradeMatrix.cache_key @course.id
    @matrix = Rails.cache.fetch cache_key do
      AssociationCache.new(@course) do |_|
        _.load_latest_submissions
        _.load_auds
        _.load_course_user_data
        _.load_assessments
      end

      ActiveSupport::Gzip.compress(matrix!.to_json)
    end
    @matrix = JSON.parse ActiveSupport::Gzip.decompress(@matrix)
  end

  def last_updated
    @matrix["last_updated"]
  end

  def before_grading_deadline?(asmt_id)
    @matrix["asmt_before_grading_deadline"]["#{asmt_id}"]
  end

  def cell(asmt_id, cud_id)
    @matrix["cell_by_asmt"]["#{asmt_id}"]["#{cud_id}"]
  end

  def category_average(cat, cud_id)
    @matrix["cat_avg_by_cat"]["#{cat}"]["#{cud_id}"]
  end

  def course_average(cud_id)
    @matrix["course_avg_by_user"]["#{cud_id}"]
  end

  def cells_for_assessment(asmt_id)
    @matrix["cell_by_asmt"]["#{asmt_id}"].values
  end

  def averages_for_category(cat)
    @matrix["cat_avg_by_cat"]["#{cat}"].values
  end

  def course_averages
    @matrix["course_avg_by_user"].values
  end

  # Check whether the specified assessment is included in the GradeMatrix cache
  # This is necessary when clients are using a cached GradeMatrix that might not
  # be up to date with the current course (e.g.: an assessment was added since)
  def has_assessment?(asmt_id)
    @matrix["cell_by_asmt"]["#{asmt_id}"] != nil
  end

  # Check whether the specified user is included in the GradeMatrix cache
  def has_cud?(cud_id)
    @matrix["course_avg_by_user"]["#{cud_id}"] != nil
  end

  # Check whether the specified category is included in the GradeMatrix cache
  def has_category?(cat)
    @matrix["cat_avg_by_cat"]["#{cat}"] != nil
  end

  def self.invalidate(course)
    Rails.cache.delete cache_key(course.id)
  end

  def self.cache_key(course_id)
    "course_#{course_id}_grade_matrix"
  end

private

  def matrix!
    cell_by_asmt = {}
    cat_avg_by_cat = {}
    course_avg_by_user = {}
    asmt_before_grading_deadline = {}

    @course.assessments.each do |a|
      asmt_before_grading_deadline["#{a.id}"] = a.before_grading_deadline?
    end

    @course.course_user_data.each do |cud|
      next unless cud.student?
      next if cud.dropped?

      @course.assessments.each do |a|
        s = summarize a.aud_for(cud.id)
        cell_by_asmt["#{a.id}"] ||= {}
        cell_by_asmt["#{a.id}"]["#{cud.id}"] = s
      end

      @course.assessment_categories.each do |cat|
        a = cud.category_average(cat, @as_seen_by)
        cat_avg_by_cat[cat] ||= {}
        cat_avg_by_cat[cat]["#{cud.id}"] = a
      end

      course_avg_by_user["#{cud.id}"] = cud.average @as_seen_by
    end

    {
      "cell_by_asmt" => cell_by_asmt,
      "cat_avg_by_cat" => cat_avg_by_cat,
      "course_avg_by_user" => course_avg_by_user,
      "asmt_before_grading_deadline" => asmt_before_grading_deadline,
      "last_updated" => Time.now
    }
  end

  def summarize(aud)
    info = {}

    info["status"] = aud.status @as_seen_by

    info["final_score"] = aud.final_score @as_seen_by
    info["grade_type"] = (AssessmentUserDatum.grade_type_to_sym aud.grade_type).to_s
    info["submission_status"] = aud.submission_status.to_s

    # TODO: need to convert this to local time on *client*
    # TODO: convert to 12-hour time
    if aud.end_at.nil?    # Infinite extension.
      info["end_at"] = end_at_display(aud.end_at)
    else                        # Finite (or zero) extension.
      # Convert the format from "to_s" to "to_formatted_s :long".
      end_at = end_at_display(aud.end_at).to_datetime
      info["end_at"] = end_at.to_formatted_s :long
    end

    info
  end

  include AssessmentUserDatumHelper
end


text:
namespace media {

class DemuxerStream;
class VideoDecoder;
class VideoFrame;

class MEDIA_EXPORT VideoRenderer {
 public:
  // Used to paint VideoFrame.
  typedef base::Callback<void(const scoped_refptr<VideoFrame>&)> PaintCB;

  // Used to query the current time or duration of the media.
  typedef base::Callback<base::TimeDelta()> TimeDeltaCB;

  VideoRenderer();

  // Stops all operations and fires all pending callbacks.
  virtual ~VideoRenderer();

  // Initializes a VideoRenderer with |stream|, executing |init_cb| upon
  // completion. If initialization fails, only |init_cb| (not |error_cb|) will
  // be called.
  //
  // |set_decryptor_ready_cb| is fired when a Decryptor is needed, i.e. when the
  // |stream| is encrypted.
  //
  // |statistics_cb| is executed periodically with video rendering stats, such
  // as dropped frames.
  //
  // |buffering_state_cb| is executed when video rendering has either run out of
  // data or has enough data to continue playback.
  //
  // |paint_cb| is executed on the video frame timing thread whenever a new
  // frame is available for painting. Can be called from any thread.
  //
  // |ended_cb| is executed when video rendering has reached the end of stream.
  //
  // |error_cb| is executed if an error was encountered after initialization.
  //
  // |get_time_cb| is used to query the current media playback time.
  //
  // |waiting_for_decryption_key_cb| is executed whenever the key needed to
  // decrypt the stream is not available.
  virtual void Initialize(
      DemuxerStream* stream,
      const PipelineStatusCB& init_cb,
      const SetDecryptorReadyCB& set_decryptor_ready_cb,
      const StatisticsCB& statistics_cb,
      const BufferingStateCB& buffering_state_cb,
      const PaintCB& paint_cb,
      const base::Closure& ended_cb,
      const PipelineStatusCB& error_cb,
      const TimeDeltaCB& get_time_cb,
      const base::Closure& waiting_for_decryption_key_cb) = 0;

  // Discards any video data and stops reading from |stream|, executing
  // |callback| when completed.
  //
  // Clients should expect |buffering_state_cb| to be called with
  // BUFFERING_HAVE_NOTHING while flushing is in progress.
  virtual void Flush(const base::Closure& callback) = 0;

  // Starts playback at |timestamp| by reading from |stream| and decoding and
  // rendering video.
  //
  // Only valid to call after a successful Initialize() or Flush().
  virtual void StartPlayingFrom(base::TimeDelta timestamp) = 0;

 private:
  DISALLOW_COPY_AND_ASSIGN(VideoRenderer);
};

}  // namespace media

#endif  // MEDIA_BASE_VIDEO_RENDERER_H_


text:
A podTemplate may or may not inherit from an existing template. This means that the podTemplate will inherit node selector, service account, image pull secrets, containerTemplates and volumes from the template it inheritsFrom.

Service account and Node selector when are overridden completely substitute any possible value found on the 'parent'.

Container templates that are added to the podTemplate, that has a matching containerTemplate (a containerTemplate with the same name) in the 'parent' template, will inherit the configuration of the parent containerTemplate.
If no matching containerTemplate is found, the template is added as is.

Volume inheritance works exactly as Container templates.

Image Pull Secrets** are combined (all secrets defined both on 'parent' and 'current' template are used).


text:
class MeSerializer < ActiveModel::Serializer
  attributes :email, :company_owner

  belongs_to :company

  has_one :profile
end


text: export { default as DisplayName } from './DisplayName';


text:
from Src.BioDataFileManagement.CrossCutting.Filters.FeListMicroRnaSampleFile import FeListMicroRnaSampleFile
from Src.BioDataFileManagement.Managers.MicroRnaSampleFileManager import MicroRnaSampleFileManager
from Src.BioDataImporter.Contracts.BioDataImporterBase import BioDataImporterBase
from Src.BioDataImporter.Mappers.Mapper import Mapper
from Src.BioDataManagement.CrossCutting.DTOs.MicroRnaSampleDto import MicroRnaSampleDto
from Src.BioDataManagement.Managers.MicroRnaSampleManager import MicroRnaSampleManager
from Src.Config import mirna_sample_file_sub_directory, mirna_sample_importer_page_size
from Src.Core.Entity.ProcessInfo import ProcessInfo
from Src.Core.Entity.Status import Status

class MicroRnaSampleImporter(BioDataImporterBase):
    """
    This class is responsible for importing microRNA samples.
    """
    def __init__(self):
        """"""
        self.__mirna_file_manager = MicroRnaSampleFileManager()
        self.__mirna_manager = MicroRnaSampleManager()

    def execute(self) -> ProcessInfo:
        """
        Execute the import data process for microRNA samples.
        """
        importation_info = None

        try:
            fe_mirna_sample_file = self.__mirna_file_manager.get(
                FeListMicroRnaSampleFile(page_size=mirna_sample_importer_page_size,
                                         sub_directory=mirna_sample_file_sub_directory))

            while fe_mirna_sample_file.current_page <= fe_mirna_sample_file.page_count + 1:
                mirna_samples = [Mapper.get_instance().map(mirna, MicroRnaSampleDto) for mirna in
                                 fe_mirna_sample_file.result_list]

                try:
                    self.__mirna_manager.add_many(mirna_samples)

                    fe_mirna_sample_file = self.__mirna_file_manager.get(
                        FeListMicroRnaSampleFile(page_size=mirna_sample_importer_page_size,
                                                 current_page=fe_mirna_sample_file.current_page,
                                                 sub_directory=mirna_sample_file_sub_directory))

                except:
                    importation_info = ProcessInfo(status=Status.Fail,
                                                   message='MicroRNA Gene Target Importation has failed. See details to more information.',
                                                   details=['{0}. {1}'.format(Status.Fail,
                                                                              'Error in saving microRNA samples.')])
                    break

            importation_info = ProcessInfo(status=Status.OK,
                                           message='MicroRNA sample importation has been successful. See details to more information.',
                                           details=['{0}. {1}'.format(Status.OK.name,
                                                                      'MicroRNA samples have saved in the system.')])

        except:
            importation_info = ProcessInfo(status=Status.Fail,
                                           message='MicroRNA sample importation has failed. See details to more information.',
                                           details=['{0}. {1}'.format(Status.Fail,
                                                                      'Error in getting microRNA sample files.')])

        return importation_info


text:
/**
 * @fileoverview
 * @suppress {missingRequire}
 */

import {patchMethod, scheduleMacroTaskWithCurrentZone, zoneSymbol} from './utils';

const taskSymbol = zoneSymbol('zoneTask');

interface TimerOptions extends TaskData {
  handleId?: number;
  args: any[];
}

export function patchTimer(window: any, setName: string, cancelName: string, nameSuffix: string) {
  let setNative: Function|null = null;
  let clearNative: Function|null = null;
  setName += nameSuffix;
  cancelName += nameSuffix;

  const tasksByHandleId: {[id: number]: Task} = {};

  function scheduleTask(task: Task) {
    const data = <TimerOptions>task.data;
    function timer(this: unknown) {
      try {
        task.invoke.apply(this, arguments);
      } finally {
        // issue-934, task will be cancelled
        // even it is a periodic task such as
        // setInterval
        if (!(task.data && task.data.isPeriodic)) {
          if (typeof data.handleId === 'number') {
            // in non-nodejs env, we remove timerId
            // from local cache
            delete tasksByHandleId[data.handleId];
          } else if (data.handleId) {
            // Node returns complex objects as handleIds
            // we remove task reference from timer object
            (data.handleId as any)[taskSymbol] = null;
          }
        }
      }
    }
    data.args[0] = timer;
    data.handleId = setNative !.apply(window, data.args);
    return task;
  }

  function clearTask(task: Task) { return clearNative !((<TimerOptions>task.data).handleId); }

  setNative =
      patchMethod(window, setName, (delegate: Function) => function(self: any, args: any[]) {
        if (typeof args[0] === 'function') {
          const options: TimerOptions = {
            isPeriodic: nameSuffix === 'Interval',
            delay: (nameSuffix === 'Timeout' || nameSuffix === 'Interval') ? args[1] || 0 :
                                                                             undefined,
            args: args
          };
          const task =
              scheduleMacroTaskWithCurrentZone(setName, args[0], options, scheduleTask, clearTask);
          if (!task) {
            return task;
          }
          // Node.js must additionally support the ref and unref functions.
          const handle: any = (<TimerOptions>task.data).handleId;
          if (typeof handle === 'number') {
            // for non nodejs env, we save handleId: task
            // mapping in local cache for clearTimeout
            tasksByHandleId[handle] = task;
          } else if (handle) {
            // for nodejs env, we save task
            // reference in timerId Object for clearTimeout
            handle[taskSymbol] = task;
          }

          // check whether handle is null, because some polyfill or browser
          // may return undefined from setTimeout/setInterval/setImmediate/requestAnimationFrame
          if (handle && handle.ref && handle.unref && typeof handle.ref === 'function' &&
              typeof handle.unref === 'function') {
            (<any>task).ref = (<any>handle).ref.bind(handle);
            (<any>task).unref = (<any>handle).unref.bind(handle);
          }
          if (typeof handle === 'number' || handle) {
            return handle;
          }
          return task;
        } else {
          // cause an error by calling it directly.
          return delegate.apply(window, args);
        }
      });

  clearNative =
      patchMethod(window, cancelName, (delegate: Function) => function(self: any, args: any[]) {
        const id = args[0];
        let task: Task;
        if (typeof id === 'number') {
          // non nodejs env.
          task = tasksByHandleId[id];
        } else {
          // nodejs env.
          task = id && id[taskSymbol];
          // other environments.
          if (!task) {
            task = id;
          }
        }
        if (task && typeof task.type === 'string') {
          if (task.state !== 'notScheduled' &&
              (task.cancelFn && task.data !.isPeriodic || task.runCount === 0)) {
            if (typeof id === 'number') {
              delete tasksByHandleId[id];
            } else if (id) {
              id[taskSymbol] = null;
            }
            // Do not cancel already canceled functions
            task.zone.cancelTask(task);
          }
        } else {
          // cause an error by calling it directly.
          delegate.apply(window, args);
        }
      });
}


text:
package gov.nih.nci.cabig.caaers.service.synchronizer.report;

import gov.nih.nci.cabig.caaers.domain.BiologicalIntervention;
import gov.nih.nci.cabig.caaers.domain.DietarySupplementIntervention;
import gov.nih.nci.cabig.caaers.domain.ExpeditedAdverseEventReport;

import java.util.List;

/**
 * @author Biju Joseph
 * @since 1.5
 */
public class DietarySupplementInterventionSynchronizer extends AbstractAEInterventionSynchronizer {
    @Override
    public List<DietarySupplementIntervention> existingInterventions(ExpeditedAdverseEventReport aeReport) {
        return aeReport.getDietaryInterventions();
    }

    @Override
    public List<DietarySupplementIntervention> xmlInterventions(ExpeditedAdverseEventReport aeReport) {
        return aeReport.getDietaryInterventions();
    }
}


text:
export const ADD_PRODUCT = 'ADD_PRODUCT'
export const DESTROY_PRODUCT = 'DESTROY_PRODUCT'
export const LOAD_PRODUCT = 'LOAD_PRODUCT'
export const LOAD_PRODUCTS = 'LOAD_PRODUCTS'
export const UPDATE_PRODUCT = 'UPDATE_PRODUCT'
export const UPDATE_PRODUCT_FIELD = 'UPDATE_PRODUCT_FIELD'


text:
import { FileSystem } from './FileSystem';
/**
 * It's an implementation of the FileSystem interface which reads and writes directly to the real file system.
 *
 * @param caseSensitive
 */
declare function createRealFileSystem(caseSensitive?: boolean): FileSystem;
export { createRealFileSystem };