text:
REMOTE_SERVER=S3ProxyApp-A.local
FOLDER=/s3proxychunkupload/upload

if [[ "$REMOTE_SERVER" == "$(mount | grep -o $REMOTE_SERVER)" ]]
then
   echo $REMOTE_SERVER NFS share has already been mounted
   echo Unmounting it...
   sudo /bin/umount $REMOTE_SERVER:$FOLDER
   echo Done.
fi

echo
echo Sync local folder with remote server $REMOTE_SERVER
# ending slash in source path is important for rsync
rsync -az --progress $FOLDER/ $REMOTE_SERVER:$FOLDER
echo

echo Mount NFS share from server $REMOTE_SERVER
echo $FOLDER
sudo /bin/mount $REMOTE_SERVER:$FOLDER
echo Done.


text:
#ifndef FIRESTORE_CORE_SRC_REMOTE_GRPC_UTIL_H_
#define FIRESTORE_CORE_SRC_REMOTE_GRPC_UTIL_H_

#include "Firestore/core/src/util/status_fwd.h"
#include "grpcpp/support/status.h"

namespace firebase {
namespace firestore {
namespace remote {

util::Status ConvertStatus(const grpc::Status& from);

}  // namespace remote
}  // namespace firestore
}  // namespace firebase

#endif  // FIRESTORE_CORE_SRC_REMOTE_GRPC_UTIL_H_

redpajama_set_name: RedPajamaGithub


text:
.selectpicker_base
{
  height: 20px;
  display: inline-block;
  width: 300px;
}
.selectpicker_frame
{
  min-width: 250px;
  max-width: 100px;
  padding: 2px 10px;
  border: 1px solid #999999;
  border-radius: 5px;
  background-color: #ffffff;
}
.selectpicker_label
{
  width: 235px;
  height: 18px;
  padding-left: 15px;
  line-height: 18px;
  padding-right: 15px;
  overflow: hidden;
  white-space: nowrap;
}
.selectpicker_label_open
{
  /* background-image: url("../images/selectpicker_open.png"); */
  background-image: url("../images/selectpicker_toggle.png");
  background-repeat: no-repeat;
  background-position: left center;
}
.selectpicker_label_close
{
  /* background-image: url("../images/selectpicker_close.png"); */
  background-image: url("../images/selectpicker_toggle.png");
  background-repeat: no-repeat;
  background-position: left center;
}
.selectpicker_search
{
  margin-top: 5px;
  margin-bottom: 5px;
  padding-left: 15px;
  font-weight: bold;
  width: 95%;
  height: 18px;
  line-height: 18px;
  border: 1px solid #aaaaaa;
  background-image: url("../images/selectpicker_search.png");
  background-repeat: no-repeat;
  background-position: left center;
}
.selectpicker_list
{
  list-style-type: none;
  padding: 0;
  margin:  0;
  min-height: 50px;
  max-height: 300px;
  overflow: scroll;
  overflow-x: hidden;
  overflow-y: scroll;
}
.selectpicker_item
{
  width: auto;
  height: 18px;
  line-height: 18px;
  padding: 0;
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
}
.selectpicker_item > a,
.selectpicker_item > a:hover,
.selectpicker_item > a:visited
{
  text-decoration: none !important;
  color: #666666 !important;
  text-align: left;
  padding-left: 18px;
  padding-right: 18px;
  display: block;
  width: 100%;
  height: 100%;
}
.selectpicker_item > a:hover,
.selectpicker_current_pick
{
  background-color: #add8e6 !important;
}


text:
package ch.squix.feederator.rest;

import org.restlet.Application;
import org.restlet.Restlet;
import org.restlet.routing.Router;

import ch.squix.feederator.model.Feed;
import ch.squix.feederator.model.FeedItem;
import ch.squix.feederator.rest.feeds.FeedResource;
import ch.squix.feederator.rest.feeds.FeedsResource;
import ch.squix.feederator.rest.fulltext.FullTextResource;
import ch.squix.feederator.rest.items.FeedItemResource;
import ch.squix.feederator.rest.items.InboxItemResource;
import ch.squix.feederator.rest.items.ItemResource;
import ch.squix.feederator.rest.parser.ParserResource;
import ch.squix.feederator.rest.parser.UpdateFeedsResource;
import ch.squix.feederator.rest.ping.PingResource;
import ch.squix.feederator.rest.testdata.TestDataResource;

import com.googlecode.objectify.ObjectifyService;

public class RestApplication extends Application {

    static {
        ObjectifyService.register(Feed.class);
        ObjectifyService.register(FeedItem.class);
        // ObjectifyService.register(Highscore.class);
    }

    @Override
    public Restlet createInboundRoot() {
        // Create a router Restlet that routes each call to a
        // new instance of HelloWorldResource.
        Router router = new Router(getContext());
        router.attach("/ping", PingResource.class);
        router.attach("/admin/parser/{feedId}", ParserResource.class);
        router.attach("/admin/updateFeeds", UpdateFeedsResource.class);
        router.attach("/user/testdata", TestDataResource.class);
        router.attach("/user/inbox", InboxItemResource.class);
        router.attach("/user/feeds/{feedId}", FeedResource.class);
        router.attach("/user/feeds", FeedsResource.class);
        router.attach("/user/feeds/{feedId}/items", FeedItemResource.class);
        router.attach("/user/item/{itemId}", ItemResource.class);
        router.attach("/user/fulltext/{url}", FullTextResource.class);

        return router;
    }

}


text:
Install
=======

This library requires [Ruby](https://www.ruby-lang.org) (**>= 1.9.2**).  See [how to install ruby](https://github.com/OpenBEL/bel.rb/blob/master/INSTALL_RUBY.md).

Install from [RubyGems.org](http://rubygems.org/gems/bel)

```bash
    gem install bel
```

Build from master branch

1. Obtain source for master branch.
  - `git clone git@github.com:OpenBEL/bel.rb.git`

2. Build
  - `gem build bel.gemspec`
  - `gem install bel-[VERSION].gem`


text:
/**
 * A long-running task, which periodically pings the server for its task status
 */

define(
  function( require ) {
    "use strict";

    var Marionette = require( "marionette" ),
        Backbone = require( "backbone" ),
        _ = require( "underscore" ),
        fui = require( "app/fui" ),
        sprintf = require( "sprintf" );

    /* Constants */

    var MS = 1000;
    var MAX_DELAY = 10 * MS;

    /**
     * This model represents a long running task process
     */
    var Task = function( ds, operationType, taskDescription ) {
      this.taskDescription = taskDescription;
      this.ds = ds;
      this.operationType = operationType;
      this.delay = 500;

      _.bindAll( this, "checkTaskStatus", "onCurrentTaskStatusFail", "onCurrentTaskStatus" );

      this.checkTaskStatus();
    };

    _.extend( Task.prototype, {
      /** Return the unique ID (on this server) of the task */
      taskId: function() {
        return this.taskDescription.taskId;
      },

      accaessToken: function getUrlVars()
    {
      var vars = [], hash;
      var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
      for(var i = 0; i < hashes.length; i++)
      {
        hash = hashes[i].split('=');
        vars.push(hash[0]);
        vars[hash[0]] = hash[1];
      }
      //alert("sassaaaaasasasasaasasasa : " +vars)
      //return vars;
      return '?access_token='+vars.access_token;
    },

      /** Return the URL for the task's API */
      taskURL: function() {
        return sprintf( "%s/$/tasks/%s/%s", this.ds.baseURL(), this.taskId() ,accaessToken);
      },

      /** Test the current status of the task */
      checkTaskStatus: function() {
        $.getJSON( this.taskURL() )
         .done( this.onCurrentTaskStatus )
         .fail( this.onCurrentTaskStatusFail )
      },

      /** Successful result from checking the task */
      onCurrentTaskStatus: function( taskDescription ) {
        this.taskDescription = taskDescription;

        var status = {
            task: this,
            dsId: this.ds.name(),
            finished: this.taskFinished()
        };

        fui.vent.trigger( "task.status", status );

        this.queueTaskStatusCheck();
      },

      /** Failed to check the task */
      onCurrentTaskStatusFail: function( jqxhr, msg, err ) {
        var status = {
            task: this,
            dsId: this.ds.name(),
            errorMessage: err || msg
        };

        fui.vent.trigger( "task.failed", status );
      },

      /** Re-queue the status check if the task is not yet complete */
      queueTaskStatusCheck: function() {
        if (!this.taskFinished()) {
          _.delay( this.checkTaskStatus, this.statusDelay() );
        }
      },

      /** Return the completion time if the task has been fid, otherwise null */
      taskFinished: function() {
        return this.taskDescription.finished;
      },

      /** Return the delay in ms until the next status check is due. */
      statusDelay: function() {
        var t = this.delay;

        if (t < MAX_DELAY) {
          this.delay = t * 2;
        }

        return t;
      }
    } );

    return Task;
  }
);


text:
angular.module('visualReplyCtrl', [])

.controller('visualReplyController', ['Visualization', 'Replies', '$rootScope', '$stateParams', function (Visualization, Replies, $rootScope, $stateParams){

  var vm = this;

  // Retrieve the current organization.
  vm.org = $stateParams.org;
  // Get the current user.
  vm.user = $rootScope.logInfo;
  vm.username = vm.user.username;
  vm.profileImg = vm.user.pictureUrl;
  // The value for toggling the reply option.
  vm.isReplying = false;

  // Toggle the reply option on click.
  vm.toggleReplying = function(){
    vm.isReplying = !vm.isReplying;
  };

  // Add the reply to the current message on the visualization.
  vm.addVisualReply = function (e, index) {
    if(e.keyCode === 13) {
      Replies.addVisualReply(vm.username, vm.profileImg, vm.replyText, index, vm.org);
      vm.replyText = '';
      vm.toggleReplying();
    }
  };
}]);


text:
<?php
namespace webapp\modules\<%= moduleName %>\controllers;

use Yii;
use yii\web\Controller;

class SiteController extends Controller
{
    public function actionIndex()
    {
        echo 'webapp site index action';
    }
}


text:
'use strict';

Object.defineProperty(exports, "__esModule", {
    value: true
});

var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = require('babel-runtime/helpers/createClass');

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = require('babel-runtime/helpers/inherits');

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _Constants = require('./Constants');

var _select = require('../select');

var _select2 = _interopRequireDefault(_select);

var _radio = require('../radio');

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

var Option = _select2['default'].Option;

var Header = function (_React$Component) {
    (0, _inherits3['default'])(Header, _React$Component);

    function Header() {
        (0, _classCallCheck3['default'])(this, Header);

        var _this = (0, _possibleConstructorReturn3['default'])(this, (Header.__proto__ || Object.getPrototypeOf(Header)).apply(this, arguments));

        _this.onYearChange = function (year) {
            var newValue = _this.props.value.clone();
            newValue.year(parseInt(year, 10));
            var onValueChange = _this.props.onValueChange;
            if (onValueChange) {
                onValueChange(newValue);
            }
        };
        _this.onMonthChange = function (month) {
            var newValue = _this.props.value.clone();
            newValue.month(parseInt(month, 10));
            var onValueChange = _this.props.onValueChange;
            if (onValueChange) {
                onValueChange(newValue);
            }
        };
        _this.onTypeChange = function (e) {
            var onTypeChange = _this.props.onTypeChange;
            if (onTypeChange) {
                onTypeChange(e.target.value);
            }
        };
        return _this;
    }

    (0, _createClass3['default'])(Header, [{
        key: 'getYearSelectElement',
        value: function getYearSelectElement(year) {
            var _props = this.props,
                yearSelectOffset = _props.yearSelectOffset,
                yearSelectTotal = _props.yearSelectTotal,
                locale = _props.locale,
                prefixCls = _props.prefixCls,
                fullscreen = _props.fullscreen;

            var start = year - yearSelectOffset;
            var end = start + yearSelectTotal;
            var suffix = locale.year === '年' ? '年' : '';
            var options = [];
            for (var index = start; index < end; index++) {
                options.push(_react2['default'].createElement(
                    Option,
                    { key: '' + index },
                    index + suffix
                ));
            }
            return _react2['default'].createElement(
                _select2['default'],
                { size: fullscreen ? 'default' : 'small', dropdownMatchSelectWidth: false, className: prefixCls + '-year-select', onChange: this.onYearChange, value: String(year) },
                options
            );
        }
    }, {
        key: 'getMonthsLocale',
        value: function getMonthsLocale(value) {
            var current = value.clone();
            var localeData = value.localeData();
            var months = [];
            for (var i = 0; i < 12; i++) {
                current.month(i);
                months.push(localeData.monthsShort(current));
            }
            return months;
        }
    }, {
        key: 'getMonthSelectElement',
        value: function getMonthSelectElement(month, months) {
            var props = this.props;
            var prefixCls = props.prefixCls,
                fullscreen = props.fullscreen;

            var options = [];
            for (var index = 0; index < 12; index++) {
                options.push(_react2['default'].createElement(
                    Option,
                    { key: '' + index },
                    months[index]
                ));
            }
            return _react2['default'].createElement(
                _select2['default'],
                { size: fullscreen ? 'default' : 'small', dropdownMatchSelectWidth: false, className: prefixCls + '-month-select', value: String(month), onChange: this.onMonthChange },
                options
            );
        }
    }, {
        key: 'render',
        value: function render() {
            var _props2 = this.props,
                type = _props2.type,
                value = _props2.value,
                prefixCls = _props2.prefixCls,
                locale = _props2.locale,
                fullscreen = _props2.fullscreen;

            var yearSelect = this.getYearSelectElement(value.year());
            var monthSelect = type === 'date' ? this.getMonthSelectElement(value.month(), this.getMonthsLocale(value)) : null;
            var size = fullscreen ? 'default' : 'small';
            var typeSwitch = _react2['default'].createElement(
                _radio.Group,
                { onChange: this.onTypeChange, value: type, size: size },
                _react2['default'].createElement(
                    _radio.Button,
                    { value: 'date' },
                    locale.month
                ),
                _react2['default'].createElement(
                    _radio.Button,
                    { value: 'month' },
                    locale.year
                )
            );
            return _react2['default'].createElement(
                'div',
                { className: prefixCls + '-header' },
                yearSelect,
                monthSelect,
                typeSwitch
            );
        }
    }]);
    return Header;
}(_react2['default'].Component);

exports['default'] = Header;

Header.defaultProps = {
    prefixCls: _Constants.PREFIX_CLS + '-header',
    yearSelectOffset: 10,
    yearSelectTotal: 20
};
module.exports = exports['default'];


text:
'use strict';

var moduleStateValue = 'default';

function setModuleStateValue(value) {
  moduleStateValue = value;
}

function getModuleStateValue() {
  return moduleStateValue;
}

exports.getModuleStateValue = getModuleStateValue;
exports.isManualMockModule = true;
exports.setModuleStateValue = setModuleStateValue;


text:
 #ifndef SkTwoPointConicalGradient_DEFINED
 #define SkTwoPointConicalGradient_DEFINED

#include "SkGradientShaderPriv.h"

struct TwoPtRadial {
    enum {
        kDontDrawT  = 0x80000000
    };

    float   fCenterX, fCenterY;
    float   fDCenterX, fDCenterY;
    float   fRadius;
    float   fDRadius;
    float   fA;
    float   fRadius2;
    float   fRDR;

    void init(const SkPoint& center0, SkScalar rad0,
              const SkPoint& center1, SkScalar rad1);

    // used by setup and nextT
    float   fRelX, fRelY, fIncX, fIncY;
    float   fB, fDB;

    void setup(SkScalar fx, SkScalar fy, SkScalar dfx, SkScalar dfy);
    SkFixed nextT();

    static bool DontDrawT(SkFixed t) {
        return kDontDrawT == (uint32_t)t;
    }
};

class SkTwoPointConicalGradient : public SkGradientShaderBase {
    TwoPtRadial fRec;
    void init();

public:
    SkTwoPointConicalGradient(const SkPoint& start, SkScalar startRadius,
                              const SkPoint& end, SkScalar endRadius,
                              const SkColor colors[], const SkScalar pos[],
                              int colorCount, SkShader::TileMode mode,
                              SkUnitMapper* mapper);

    virtual void shadeSpan(int x, int y, SkPMColor* dstCParam,
                           int count) SK_OVERRIDE;
    virtual bool setContext(const SkBitmap& device,
                            const SkPaint& paint,
                            const SkMatrix& matrix) SK_OVERRIDE;

    virtual BitmapType asABitmap(SkBitmap* bitmap,
                                 SkMatrix* matrix,
                                 TileMode* xy) const;
    virtual SkShader::GradientType asAGradient(GradientInfo* info) const  SK_OVERRIDE;
    virtual GrCustomStage* asNewCustomStage(GrContext* context,
        GrSamplerState* sampler) const SK_OVERRIDE;

    SkScalar getCenterX1() const { return SkPoint::Distance(fCenter1, fCenter2); }
    SkScalar getStartRadius() const { return fRadius1; }
    SkScalar getDiffRadius() const { return fRadius2 - fRadius1; }

    SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkTwoPointConicalGradient)

protected:
    SkTwoPointConicalGradient(SkFlattenableReadBuffer& buffer);
    virtual void flatten(SkFlattenableWriteBuffer& buffer) const SK_OVERRIDE;

private:
    typedef SkGradientShaderBase INHERITED;
    const SkPoint fCenter1;
    const SkPoint fCenter2;
    const SkScalar fRadius1;
    const SkScalar fRadius2;
};

#endif


text:
package com.symantec.gwt.flot.client.line;

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

import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONNumber;
import com.google.gwt.json.client.JSONValue;
import com.symantec.gwt.flot.client.Series;

public class LineSeries extends Series<Point>
{
	private List<Point> points;

	public LineSeries(int colorHex, String label)
	{
		super(colorHex, label);
		points = new ArrayList<Point>();
	}

	public LineSeries(int colorHex, String label, List<Point> points)
	{
		this(colorHex, label);
		this.points.addAll(points);
	}

	public List<Point> getPoints()
	{
		return points;
	}

	public void setPoints(List<Point> points)
	{
		this.points = points;
	}

	public void addPoint(Point point)
	{
		if(points == null)
		{
			points = new ArrayList<Point>();
		}

		points.add(point);
	}

	public void addPoint(double xVal, double yVal)
	{
		addPoint(new Point(xVal, yVal));
	}

	@Override
	protected JSONValue getDataObject()
	{
		JSONArray jsonPoints = new JSONArray();
		int i = 0;
		for(Point p : points)
		{
			JSONArray jpoint = new JSONArray();
			jpoint.set(0, new JSONNumber(p.getX()));
			jpoint.set(1, new JSONNumber(p.getY()));

			jsonPoints.set(i++, jpoint);
		}

		return jsonPoints;
	}

}


text:
<component name="libraryTable">
  <library name="Maven: org.activiti:activiti-explorer:5.15.1">
    <CLASSES>
      <root url="jar://$USER_HOME$/.m2/repository/org/activiti/activiti-explorer/5.15.1/activiti-explorer-5.15.1.jar!/" />
    </CLASSES>
    <JAVADOC>
      <root url="jar://$USER_HOME$/.m2/repository/org/activiti/activiti-explorer/5.15.1/activiti-explorer-5.15.1-javadoc.jar!/" />
    </JAVADOC>
    <SOURCES>
      <root url="jar://$USER_HOME$/.m2/repository/org/activiti/activiti-explorer/5.15.1/activiti-explorer-5.15.1-sources.jar!/" />
    </SOURCES>
  </library>
</component>


text:
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/kdev_t.h>
#include <linux/major.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/pagemap.h>
#include <linux/bootmem.h>
#include <linux/mount.h>
#include <linux/blkdev.h>
#include <linux/module.h>
#include <linux/ioport.h>

#include <asm/setup.h>
#include <asm/machdep.h>
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/atarihw.h>
#include <asm/atari_stram.h>
#include <asm/io.h>

/*
 * The ST-RAM allocator allocates memory from a pool of reserved ST-RAM of
 * configurable size, set aside on ST-RAM init.
 * As long as this pool is not exhausted, allocation of real ST-RAM can be
 * guaranteed.
 */

/* set if kernel is in ST-RAM */
static int kernel_in_stram;

static struct resource stram_pool = {
	.name = "ST-RAM Pool"
};

static unsigned long pool_size = 1024*1024;

static unsigned long stram_virt_offset;

static int __init atari_stram_setup(char *arg)
{
	if (!MACH_IS_ATARI)
		return 0;

	pool_size = memparse(arg, NULL);
	return 0;
}

early_param("stram_pool", atari_stram_setup);

/*
 * This init function is called very early by atari/config.c
 * It initializes some internal variables needed for stram_alloc()
 */
void __init atari_stram_init(void)
{
	int i;

	/*
	 * determine whether kernel code resides in ST-RAM
	 * (then ST-RAM is the first memory block at virtual 0x0)
	 */
	kernel_in_stram = (m68k_memory[0].addr == 0);

	for (i = 0; i < m68k_num_memory; ++i) {
		if (m68k_memory[i].addr == 0) {
			return;
		}
	}

	/* Should never come here! (There is always ST-Ram!) */
	panic("atari_stram_init: no ST-RAM found!");
}

/*
 * This function is called from setup_arch() to reserve the pages needed for
 * ST-RAM management, if the kernel resides in ST-RAM.
 */
void __init atari_stram_reserve_pages(void *start_mem)
{
	if (kernel_in_stram) {
		pr_debug("atari_stram pool: kernel in ST-RAM, using alloc_bootmem!\n");
		stram_pool.start = (resource_size_t)alloc_bootmem_low_pages(pool_size);
		stram_pool.end = stram_pool.start + pool_size - 1;
		request_resource(&iomem_resource, &stram_pool);
		stram_virt_offset = 0;
		pr_debug("atari_stram pool: size = %lu bytes, resource = %pR\n",
			pool_size, &stram_pool);
		pr_debug("atari_stram pool: stram_virt_offset = %lx\n",
			stram_virt_offset);
	}
}

/*
 * This function is called as arch initcall to reserve the pages needed for
 * ST-RAM management, if the kernel does not reside in ST-RAM.
 */
int __init atari_stram_map_pages(void)
{
	if (!kernel_in_stram) {
		/*
		 * Skip page 0, as the fhe first 2 KiB are supervisor-only!
		 */
		pr_debug("atari_stram pool: kernel not in ST-RAM, using ioremap!\n");
		stram_pool.start = PAGE_SIZE;
		stram_pool.end = stram_pool.start + pool_size - 1;
		request_resource(&iomem_resource, &stram_pool);
		stram_virt_offset = (unsigned long) ioremap(stram_pool.start,
				resource_size(&stram_pool)) - stram_pool.start;
		pr_debug("atari_stram pool: size = %lu bytes, resource = %pR\n",
			pool_size, &stram_pool);
		pr_debug("atari_stram pool: stram_virt_offset = %lx\n",
			stram_virt_offset);
	}
	return 0;
}
arch_initcall(atari_stram_map_pages);

void *atari_stram_to_virt(unsigned long phys)
{
	return (void *)(phys + stram_virt_offset);
}
EXPORT_SYMBOL(atari_stram_to_virt);

unsigned long atari_stram_to_phys(void *virt)
{
	return (unsigned long)(virt - stram_virt_offset);
}
EXPORT_SYMBOL(atari_stram_to_phys);

void *atari_stram_alloc(unsigned long size, const char *owner)
{
	struct resource *res;
	int error;

	pr_debug("atari_stram_alloc: allocate %lu bytes\n", size);

	/* round up */
	size = PAGE_ALIGN(size);

	res = kzalloc(sizeof(struct resource), GFP_KERNEL);
	if (!res)
		return NULL;

	res->name = owner;
	error = allocate_resource(&stram_pool, res, size, 0, UINT_MAX,
				  PAGE_SIZE, NULL, NULL);
	if (error < 0) {
		pr_err("atari_stram_alloc: allocate_resource() failed %d!\n",
		       error);
		kfree(res);
		return NULL;
	}

	pr_debug("atari_stram_alloc: returning %pR\n", res);
	return atari_stram_to_virt(res->start);
}
EXPORT_SYMBOL(atari_stram_alloc);

void atari_stram_free(void *addr)
{
	unsigned long start = atari_stram_to_phys(addr);
	struct resource *res;
	unsigned long size;

	res = lookup_resource(&stram_pool, start);
	if (!res) {
		pr_err("atari_stram_free: trying to free nonexistent region "
		       "at %p\n", addr);
		return;
	}

	size = resource_size(res);
	pr_debug("atari_stram_free: free %lu bytes at %p\n", size, addr);
	release_resource(res);
	kfree(res);
}
EXPORT_SYMBOL(atari_stram_free);


text:
A robotic space cockroach with a computer controlled brain.

## Description
This is a project used in [fly me to the moon][book], that explores genetic
programming. It models a robotic space cockroach that tries to find a source of
food.

> The cockroach moves along a line. Each turn it either takes a step forward,
> takes a step backwards, or stops.

See the [documentation][] for a detailed description.

[book]: https://leanpub.com/flymetothemoon
[documentation]: https://darwins-challenge.github.io/nadezhda/


text:
namespace BlueDwarf {
TEST(MessageTest, CanCreateFromLogLevelAndString) {
    const LogLevel expectedLogLevel = LogLevel::Info;
    const std::string expectedMessage = "My awesome message";

    auto message = Message{expectedLogLevel, expectedMessage};

    EXPECT_EQ(expectedLogLevel, message.GetLogLevel());
    EXPECT_EQ(expectedMessage, message.GetMessage());
    EXPECT_FALSE(message.IsExceptionMessage());
    EXPECT_EQ(std::this_thread::get_id(), message.GetThreadId());
}

TEST(MessageTest, CanCreateFromLogLevelAndException) {
    struct TestException : std::exception {
        TestException(const std::string& message) : message(message) {}

        const char* what() const noexcept {
            return message.c_str();
        }

        std::string message;
    };

    const LogLevel expectedLogLevel = LogLevel::Info;
    const std::exception& expectedException = TestException("My Message");

    auto message = Message{expectedLogLevel, expectedException};

    EXPECT_EQ(expectedLogLevel, message.GetLogLevel());
    EXPECT_EQ(expectedException.what(), message.GetMessage());
    EXPECT_TRUE(message.IsExceptionMessage());
    EXPECT_EQ(std::this_thread::get_id(), message.GetThreadId());
}

TEST(MessageTest, ReturnsMessageAsTextIfNoTextHasBeenSet) {
    const LogLevel expectedLogLevel = LogLevel::Info;
    const std::string expectedMessage = "My awesome message";

    auto message = Message{expectedLogLevel,  expectedMessage};

    EXPECT_EQ(expectedLogLevel, message.GetLogLevel());
    EXPECT_FALSE(message.IsExceptionMessage());
    EXPECT_EQ(std::this_thread::get_id(), message.GetThreadId());
    EXPECT_EQ(expectedMessage, message.GetText());
}

TEST(MessageTest, ReturnsTextIfTextHasBeenSet) {
    const LogLevel expectedLogLevel = LogLevel::Info;
    const std::string expectedMessage = "My awesome message";
    const std::string expectedText = "My Text";

    auto message = Message{expectedLogLevel,  expectedMessage};
    message.SetText(expectedText);

    EXPECT_EQ(expectedLogLevel, message.GetLogLevel());
    EXPECT_FALSE(message.IsExceptionMessage());
    EXPECT_EQ(std::this_thread::get_id(), message.GetThreadId());
    EXPECT_EQ(expectedMessage, message.GetMessage());
    EXPECT_EQ(expectedText, message.GetText());
}

TEST(MessageTest, CanSetAndGetCustomProperties) {
    const LogLevel expectedLogLevel = LogLevel::Info;
    const std::string expectedMessage = "My awesome message";

    const std::string expectedCustomProperty = "My prop";

    auto message = Message{expectedLogLevel, expectedMessage};
    message.SetProperty("CustomProp", expectedCustomProperty);

    EXPECT_EQ(expectedLogLevel, message.GetLogLevel());
    EXPECT_EQ(expectedMessage, message.GetMessage());
    EXPECT_FALSE(message.IsExceptionMessage());
    EXPECT_EQ(std::this_thread::get_id(), message.GetThreadId());
    EXPECT_EQ(expectedCustomProperty, message.GetProperty("CustomProp"));
}

TEST(MessageTest, CanSetAndGetSource) {
    const LogLevel expectedLogLevel = LogLevel::Info;
    const std::string expectedMessage = "My awesome message";
    const std::string expectedSource = "My source";

    auto message = Message{expectedLogLevel, expectedMessage};
    message.SetSource(expectedSource);

    EXPECT_EQ(expectedLogLevel, message.GetLogLevel());
    EXPECT_EQ(expectedMessage, message.GetMessage());
    EXPECT_FALSE(message.IsExceptionMessage());
    EXPECT_EQ(std::this_thread::get_id(), message.GetThreadId());
    EXPECT_EQ(expectedSource, message.GetSource());
}
}


text:
'use strict';

module.exports = function(d3_behavior_drag, d3_event, d3_select, accessor_value, plot, plotMixin) {  // Injected dependencies
  return function() { // Closure function
    var p = {};  // Container for private, direct access mixed in variables

    function supstance(g) {
      var group = plot.groupSelect(g, plot.dataMapper.unity);

      group.entry.append('path').attr('class', 'supstance');

      group.entry.append('g').attr('class', 'interaction').style({ opacity: 0, fill: 'none' })
        .append('path').style('stroke-width', 16);

      supstance.refresh(g);
    }

    supstance.refresh = function(g) {
      refresh(g, p.accessor, p.xScale, p.yScale);
    };

    supstance.drag = function(g) {
      g.selectAll('.interaction path')
        .call(dragBody(d3_behavior_drag, d3_event, d3_select, p.accessor, p.xScale, p.yScale));
    };

    // Mixin 'superclass' methods and variables
    plotMixin(supstance, p, accessor_value());

    return supstance;
  };
};

function refresh(g, accessor, x, y) {
  g.selectAll('path.supstance').attr('d', supstancePath(accessor, x, y));
  g.selectAll('.interaction path').attr('d', supstancePath(accessor, x, y));
}

function supstancePath(accessor, x, y) {
  return function(d) {
    var path = [],
        range = x.range();

    path.push('M', range[0], y(accessor.v(d)));
    path.push('L', range[range.length-1], y(accessor.v(d)));

    return path.join(' ');
  };
}

function dragBody(d3_behavior_drag, d3_event, d3_select, accessor, x, y) {
  return d3_behavior_drag()
    .origin(function(d) {
      // TODO Fire listeners
      return { x: 0, y: y(accessor.v(d)) };
    })
    .on('drag', function(d) {
      accessor.v(d, y.invert(d3_event().y));
      refresh(d3_select(this.parentNode.parentNode), accessor, x, y);
      // TODO Fire listeners
    });
}


text:
const static = require('../assets/data/static');

const metaInfo = {
    title: 'Swagata Kumar Kundu-Work Experience',
    description: 'Skilled in Node.js, Bootstrap, AngularJS, JavaScript, and MongoDB'
}

const work = [{
        name: 'Night Out',
        desc: `My Night out is a business concept for various cities.
        Here business owner register their business and public user can find them as useful.
        This business are mainly of Restaurant, Hotel, Bar types.
         Business owners have facility to promote their business and organize various events at their place by letting know the customer via this media. This project has mobile application development and as well as website. There are multiple level of business in this model. Site owner make lease of various city website to local licensee. Later licensee sales spot on the site to business owners.
        There are various notification scenarios via mail as well as push notification at realtime like reservation reminder, new event reminder, business expiry reminder etc to make the users always updated.`,
        tech: 'Node JS, Express, Angular Js, MySQL, Bootstrap',
        duration: 'April 2016 - Present',
        role: `Designed database and created API for mobile APP`,
        images: ['assets/images/portfolio/mno_1.jpg'],
        url: 'http://www.sanantonionightout.com/'
    },
    {
        name: 'Trip Plot',
        desc: `It is an application for users to share their journey and experience which can later help other users. Users also get recommended destination of a location to go. It is also helpful for managing trip with lots of trip members
	It is a mobile application where user can signup and create profile. User can create a trip by entering trip detail eg. Trip route, points. Then he can invite friends to join with him. User can also create past trip. Google location service has been used for plotting trip points. User can find recommended destination within a radius. User can receive live notification about trip status. User can upload trip images and a video will automatically created from those images and will be uploaded to AWS`,

        tech: 'Node.Js, Express, MongoDb, AngularJS',
        duration: 'December 2015 - February 2016',
        role: `Worked on creating web services for mobile application and Implemented Socket.IO for real-time notification to mobile devices
        Used ffmpeg to generate video from images and merge video with user uploaded song`,
        images: ['assets/images/portfolio/tp_1.jpg', 'assets/images/portfolio/tp_2.jpg'],
        url: 'https://play.google.com/store/apps/details?id=com.trip.plot&hl=en'
    },
    {
        name: 'QED Game Portal',
        desc: `QED Game portal is used for manage QED game show online. It is an online quiz site. QED is a quiz show for students in Nigerian Secondary Schools to assess their intelligence and celebrate outstanding students across Nigeria. The role of the admin web portal to manage session, episode, players, question of  Quiz. Using this portal admin can create new session or episode and send push notification for mobile and other connected clients.`,

        tech: 'Web API, Angular.JS, SQL Server 2008 and SignalR',
        duration: 'Auguest 2015 - December 2015',
        role: `Consumed web services in Angularjs. Worked on Admin module to manage administrative users and public users. Designing the back-end of the application (Admin Panel). Worked on real-time notification using SignalR. We followed TDD approach in this project and maintain code coverage above 85% in AngularJs code`,
        images: ['assets/images/portfolio/cbp_1.jpg', 'assets/images/portfolio/cbp_2.jpg'],
        url: 'http://cowbellpedia.com'
    }

]

module.exports = (req, res, next) => {
    res
        .render('work', {
            data: static,
            metainfo: metaInfo,
            work: work
        }, (err, html) => {
            if (err) {
                return next(err);
            }
            return res.send(html);
        });
};


text:
using System;
using System.Runtime.Serialization;

namespace Docker.DotNet.Models
{
    [DataContract]
    public class Secret // (swarm.Secret)
    {
        public Secret()
        {
        }

        public Secret(Meta Meta)
        {
            if (Meta != null)
            {
                this.Version = Meta.Version;
                this.CreatedAt = Meta.CreatedAt;
                this.UpdatedAt = Meta.UpdatedAt;
            }
        }

        [DataMember(Name = "ID", EmitDefaultValue = false)]
        public string ID { get; set; }

        [DataMember(Name = "Version", EmitDefaultValue = false)]
        public Version Version { get; set; }

        [DataMember(Name = "CreatedAt", EmitDefaultValue = false)]
        public DateTime CreatedAt { get; set; }

        [DataMember(Name = "UpdatedAt", EmitDefaultValue = false)]
        public DateTime UpdatedAt { get; set; }

        [DataMember(Name = "Spec", EmitDefaultValue = false)]
        public SecretSpec Spec { get; set; }
    }
}


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

namespace LionFire.Behaviors
{
    /// <summary>
    /// Typical scenario: evaluate whether condition is true right away.  If not, attach
    /// to events and wait for it.  Then detach.
    /// </summary>
    public abstract class AttachingCondition : Condition
    {
        protected override BehaviorStatus OnStart()
        {
            Refresh();
            //bool result = TestCondition();
            //OnCondition(result);

            if (!IsFinished) // THREADSAFETY.  If condition got flipped between here and above we will miss it
            {
                IsAttached = true;
                return BehaviorStatus.Running;
            }
            else
            {
                return Status;
            }
        }

        public void Refresh()
        {
            OnCondition(TestCondition());
        }

        private void OnCondition(bool state)
        {
            //bool isDone = state;
                //(state && DoneWhenTestsTrue) || (!state && !DoneWhenTestsTrue);

            if (state)
            //{
                if (SucceedWhenDone)
                //{
                    Succeed();
                //}
                else
                //{
                    Fail();
                //}
                //return false;
            //}
            //return true;
        }

        public abstract bool TestCondition();

        protected override void OnFinished()
        {
            IsAttached = false;
            base.OnFinished();
        }

        protected abstract bool IsAttached
        {
            set;
        }
    }
}


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package io.trino.plugin.blackhole;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import io.airlift.units.Duration;
import io.trino.spi.connector.ConnectorOutputTableHandle;
import io.trino.spi.connector.ConnectorTableMetadata;
import io.trino.spi.connector.SchemaTableName;
import io.trino.spi.security.TrinoPrincipal;
import org.testng.annotations.Test;

import java.util.List;
import java.util.Map;
import java.util.Optional;

import static io.trino.spi.StandardErrorCode.NOT_FOUND;
import static io.trino.spi.connector.RetryMode.NO_RETRIES;
import static io.trino.spi.security.PrincipalType.USER;
import static io.trino.testing.TestingConnectorSession.SESSION;
import static io.trino.testing.assertions.TrinoExceptionAssert.assertTrinoExceptionThrownBy;
import static java.util.concurrent.TimeUnit.SECONDS;
import static org.testng.Assert.assertEquals;

public class TestBlackHoleMetadata
{
    private final BlackHoleMetadata metadata = new BlackHoleMetadata();
    private final Map<String, Object> tableProperties = ImmutableMap.of(
            BlackHoleConnector.SPLIT_COUNT_PROPERTY, 0,
            BlackHoleConnector.PAGES_PER_SPLIT_PROPERTY, 0,
            BlackHoleConnector.ROWS_PER_PAGE_PROPERTY, 0,
            BlackHoleConnector.FIELD_LENGTH_PROPERTY, 16,
            BlackHoleConnector.PAGE_PROCESSING_DELAY, new Duration(0, SECONDS));

    @Test
    public void testCreateSchema()
    {
        assertEquals(metadata.listSchemaNames(SESSION), ImmutableList.of("default"));
        metadata.createSchema(SESSION, "test", ImmutableMap.of(), new TrinoPrincipal(USER, SESSION.getUser()));
        assertEquals(metadata.listSchemaNames(SESSION), ImmutableList.of("default", "test"));
    }

    @Test
    public void tableIsCreatedAfterCommits()
    {
        assertThatNoTableIsCreated();

        SchemaTableName schemaTableName = new SchemaTableName("default", "temp_table");

        ConnectorOutputTableHandle table = metadata.beginCreateTable(
                SESSION,
                new ConnectorTableMetadata(schemaTableName, ImmutableList.of(), tableProperties),
                Optional.empty(),
                NO_RETRIES);

        assertThatNoTableIsCreated();

        metadata.finishCreateTable(SESSION, table, ImmutableList.of(), ImmutableList.of());

        List<SchemaTableName> tables = metadata.listTables(SESSION, Optional.empty());
        assertEquals(tables.size(), 1, "Expected only one table.");
        assertEquals(tables.get(0).getTableName(), "temp_table", "Expected table with name 'temp_table'");
    }

    @Test
    public void testCreateTableInNotExistSchema()
    {
        SchemaTableName schemaTableName = new SchemaTableName("schema1", "test_table");
        assertTrinoExceptionThrownBy(() -> metadata.beginCreateTable(SESSION, new ConnectorTableMetadata(schemaTableName, ImmutableList.of(), tableProperties), Optional.empty(), NO_RETRIES))
                .hasErrorCode(NOT_FOUND)
                .hasMessage("Schema schema1 not found");
    }

    private void assertThatNoTableIsCreated()
    {
        assertEquals(metadata.listTables(SESSION, Optional.empty()), ImmutableList.of(), "No table was expected");
    }
}


text:
// Constructor
Spacewar::Spacewar(){}

// Destructor
Spacewar::~Spacewar()
{
	releaseAll();		// call onLostDevice() for every graphics item
}

// Initalises the game
void Spacewar::initialize(HWND hwnd)
{
	Game::initialize(hwnd); // throws GameError
	return;
}

// Update all game items
void Spacewar::update(){}

// Artifical Intelligence
void Spacewar::ai(){}

// Handle collisions
void Spacewar::collisions(){}

// Render game items
void Spacewar::render(){}

// The graphics device was lost
// Release all reserved video memory so graphics device may be reset
void Spacewar::releaseAll()
{
	Game::releaseAll();
	return;
}

// The graphics device has been reset
void Spacewar::resetAll()
{
	Game::resetAll();
	return;
}


text:
// STGLIB/stsockif.h
// Copyright 1999 by StG Net

// sock based inspection of available interfaces

// On instantiation, StSockIfs becomes a box containing a list of StSockIf
// instances, each describing an available interface

/*	EXAMPLE CODE:
	StSockIfs nics;
	if (nics._Error)
	{
		StdOutput<<"Error obtaining interface list: "<<nics._GetErrorString()<<"\n";
		exit(1);
	}

	StBoxRef<StSockIf> nic(nics);
	while (++nic)
	{
		StdOutput<<nic->Name<<"\n";
	}
*/

// original implementation based on winsock
// new implementation using extra capabilities from iphlpapi.lib

#ifndef STGLIB_STSOCKIF
#define STGLIB_STSOCKIF

#pragma message("using stsockif.h")

#include "/src/stglib/stcore.h"
#include "/src/stglib/stsock.h"
#include "/src/stglib/stbox.h"

//win32:
//#ifndef SIO_GET_INTERFACE_LIST
//#include <ws2tcpip.h>
//#endif

class StSockConf:public StSock
{
public:
	StSockConf():StSock(IPPROTO_CONF)
	{
	}
};

class StSockIf
{
public:
	StIpAddr IpAddress;
	StIpAddr Netmask;
	StIpAddr Broadcast;
	StByt4 Flags;
	StString Name;
};

class StSockIfs:public StBox<StSockIf>
{
public:
	StSockIfs()
	{
		StSockConf sock;
		StBuffer buffer;
		buffer._ArrayAllocate(sizeof(struct ifreq)*16);

		struct ifconf ifc;
		ifc.ifc_len=buffer._ArraySize();
		ifc.ifc_buf=(char*)(StByte*)buffer;

		StSize got=sock._SockIoctl(SIOCGIFCONF,(StByte*)&ifc);
		if (sock._Error)
		{
			_Err(sock);
			return;
		}

		int count=ifc.ifc_len/sizeof(struct ifreq);
		int index=0;
		while (index<count)
		{
			struct ifreq *pi=&ifc.ifc_req[index];
			StSockIf &nif=+(*this);
			nif.Name<<pi->ifr_name;
			nif.IpAddress(*((struct sockaddr_in*)&(pi->ifr_addr)));
			++pi;
			++index;
		}
	}
};

#ifdef REST_OF_THIS_IS_BOGUS_WIN32

//#include <iphlpapi.h>
// MSVC6 doesn't have IPTYPES.H (used by IPHLPAPI.H) so yank FIXED_INFO struct manually

// Definitions and structures used by getnetworkparams and getadaptersinfo apis

#define MAX_ADAPTER_DESCRIPTION_LENGTH  128 // arb.
#define MAX_ADAPTER_NAME_LENGTH         256 // arb.
#define MAX_ADAPTER_ADDRESS_LENGTH      8   // arb.
#define DEFAULT_MINIMUM_ENTITIES        32  // arb.
#define MAX_HOSTNAME_LEN                128 // arb.
#define MAX_DOMAIN_NAME_LEN             128 // arb.
#define MAX_SCOPE_ID_LEN                256 // arb.

//
// IP_ADDRESS_STRING - store an IP address as a dotted decimal string
//

typedef struct {
    char String[4 * 4];
} IP_ADDRESS_STRING, *PIP_ADDRESS_STRING, IP_MASK_STRING, *PIP_MASK_STRING;

//
// IP_ADDR_STRING - store an IP address with its corresponding subnet mask,
// both as dotted decimal strings
//

typedef struct _IP_ADDR_STRING {
    struct _IP_ADDR_STRING* Next;
    IP_ADDRESS_STRING IpAddress;
    IP_MASK_STRING IpMask;
    DWORD Context;
} IP_ADDR_STRING, *PIP_ADDR_STRING;

//
// FIXED_INFO - the set of IP-related information which does not depend on DHCP
//

typedef struct {
    char HostName[MAX_HOSTNAME_LEN + 4] ;
    char DomainName[MAX_DOMAIN_NAME_LEN + 4];
    PIP_ADDR_STRING CurrentDnsServer;
    IP_ADDR_STRING DnsServerList;
    UINT NodeType;
    char ScopeId[MAX_SCOPE_ID_LEN + 4];
    UINT EnableRouting;
    UINT EnableProxy;
    UINT EnableDns;
} FIXED_INFO, *PFIXED_INFO;

DWORD
WINAPI
GetNetworkParams(
    PFIXED_INFO pFixedInfo, PULONG pOutBufLen
    );

//
// ADAPTER_INFO - per-adapter information. All IP addresses are stored as
// strings
//

typedef struct _IP_ADAPTER_INFO {
    struct _IP_ADAPTER_INFO* Next;
    DWORD ComboIndex;
    char AdapterName[MAX_ADAPTER_NAME_LENGTH + 4];
    char Description[MAX_ADAPTER_DESCRIPTION_LENGTH + 4];
    UINT AddressLength;
    BYTE Address[MAX_ADAPTER_ADDRESS_LENGTH];
    DWORD Index;
    UINT Type;
    UINT DhcpEnabled;
    PIP_ADDR_STRING CurrentIpAddress;
    IP_ADDR_STRING IpAddressList;
    IP_ADDR_STRING GatewayList;
    IP_ADDR_STRING DhcpServer;
    BOOL HaveWins;
    IP_ADDR_STRING PrimaryWinsServer;
    IP_ADDR_STRING SecondaryWinsServer;
    time_t LeaseObtained;
    time_t LeaseExpires;
} IP_ADAPTER_INFO, *PIP_ADAPTER_INFO;

DWORD
WINAPI
GetAdaptersInfo(
    PIP_ADAPTER_INFO pAdapterInfo, PULONG pOutBufLen
    );

typedef ULONG IPAddr;       // An IP address.

DWORD
WINAPI
SendARP(
    IPAddr DestIP,
    IPAddr SrcIP,
    PULONG pMacAddr,
    PULONG  PhyAddrLen
    );

#pragma comment(linker, "/defaultlib:iphlpapi.lib")

// new implementation gives more data on if
class StSockIf
{
public:
	StString Name;
	StIpAddr IpAddress;
	StIpAddr Netmask;
	StIpAddr Broadcast;
	StIpAddr Gateway;
	StIpAddr DHCP_Server;
	StIpAddr DNS_Primary;
	StIpAddr DNS_Secondary;
	StByt4 Flags;

};

class StSockIfs:public StBox<StSockIf>
{
public:
	StSockIfs()
	{
		// instantiating this class causes it to obtain the list of adapters
		StIpAddr DNS1;
		StIpAddr DNS2;

		// first get "fixed info" to get DNS servers
		ULONG filen=sizeof(FIXED_INFO);
		FIXED_INFO *fi=(FIXED_INFO*)malloc(filen);
		DWORD result=GetNetworkParams(fi,&filen);
		if (result==ERROR_BUFFER_OVERFLOW)
		{
			// resize and re-get
			free(fi);
			fi=(FIXED_INFO*)malloc(filen);
			result=GetNetworkParams(fi,&filen);
		}
		if (result==NO_ERROR)
		{
			// store the DNS entries for later use
			DNS1(fi->DnsServerList.IpAddress.String);
			if (fi->DnsServerList.Next)
				DNS2(fi->DnsServerList.Next->IpAddress.String);
		}

		ULONG ailen=3*sizeof(IP_ADAPTER_INFO);
		IP_ADAPTER_INFO *ai=(IP_ADAPTER_INFO*)malloc(ailen);

		result=GetAdaptersInfo(ai,&ailen);
		if (result==ERROR_BUFFER_OVERFLOW)
		{
			// resize and re-get
			free(ai);
			ai=(IP_ADAPTER_INFO*)malloc(ailen);
			result=GetAdaptersInfo(ai,&ailen);
		}
		if (result!=NO_ERROR)
		{
			// bail
			return;
		}

		IP_ADAPTER_INFO *scan=ai;

		while (scan)
		{
			StSockIf *sif=+(*this);
			sif->Name<<scan->Description;

			sif->IpAddress(scan->IpAddressList.IpAddress.String);
			sif->Netmask(scan->IpAddressList.IpMask.String);
			sif->IpAddress._SetNetmask(sif->Netmask);

			sif->Gateway(scan->GatewayList.IpAddress.String);

			if (scan->DhcpEnabled)
				sif->DHCP_Server(scan->DhcpServer.IpAddress.String);

			// and copy in the DNS servers previously found
			sif->DNS_Primary=DNS1;
			sif->DNS_Secondary=DNS2;

			scan = scan->Next;
		}
	}
};

#endif
#endif


text:
<?php
/**
 * The main template file
 *
 * @package SimpleMag
 * @since   SimpleMag 1.0
**/
get_header();
global $ti_option;
?>

<?php $archive_sidebar = get_field( 'page_sidebar', get_option('page_for_posts') ); ?>

		<?php if ( $ti_option['posts_page_title'] == 'full_width_title' ) : ?>

                    <?php
                    $posts_page_id = get_option( 'page_for_posts' );
                    echo get_the_title( $posts_page_id );
                    ?>

        <?php endif; ?>

		<?php
        // Enable/Disable sidebar based on the field selection
        if ( ! $archive_sidebar || $archive_sidebar == 'page_sidebar_on' ):
        ?>

		<?php endif; ?>

                <?php if ( $ti_option['posts_page_title'] == 'above_content_title' ) : ?>

							<?php
                            $posts_page_id = get_option( 'page_for_posts' );
                            echo get_the_title( $posts_page_id );
                            ?>

                <?php endif; ?>

                <div class="grids <?php echo $ti_option['posts_page_layout']; ?> entries">
					<?php
                    if ( have_posts() ) : while ( have_posts()) : the_post();
                    	get_template_part( 'content', 'post' );
                    endwhile;
                    ?>

                <?php ti_pagination(); ?>

                <?php else : ?>

                	<?php _e( 'Sorry, no posts were found', 'themetext' ); ?>

                <?php endif;?>

                <?php
                // Enable/Disable sidebar based on the field selection
                if ( ! $archive_sidebar || $archive_sidebar == 'page_sidebar_on' ):
                ?>

                <?php get_sidebar(); ?>

    		<?php endif; ?>

<?php get_footer(); ?>


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

using VersionOne.SDK.ObjectModel.List;

namespace VersionOne.SDK.ObjectModel.Filters {
    /// <summary>
    /// Filter for getting themes.
    /// </summary>
    public class ThemeFilter : ProjectAssetFilter {
        internal override Type EntityType {
            get { return typeof(Theme); }
        }

        /// <summary>
        /// Parent theme's
        /// </summary>
        public readonly ICollection<Theme> Parent = new List<Theme>();

        /// <summary>
        /// Filter on Status.
        /// </summary>
        public readonly ICollection<string> Status = new List<string>();

        /// <summary>
        /// Filter on Source.
        /// </summary>
        public readonly ICollection<string> Source = new List<string>();

        /// <summary>
        /// Filter on Theme assigned.
        /// </summary>
        public readonly ICollection<Theme> Theme = new List<Theme>();

        /// <summary>
        /// Filter on Customer.
        /// </summary>
        public readonly ICollection<Member> Customer = new List<Member>();

        /// <summary>
        /// Filter on Risk.
        /// </summary>
        public readonly ICollection<string> Risk = new List<string>();

        /// <summary>
        /// Filter on Type.
        /// </summary>
        public readonly ICollection<string> Type = new List<string>();

        /// <summary>
        /// Filter on Priority.
        /// </summary>
        public readonly ICollection<string> Priority = new List<string>();

        /// <summary>
        /// Filter on Goals.
        /// </summary>
        public readonly ICollection<Goal> Goals = new List<Goal>();

        /// <summary>
        /// Filter on Owners.
        /// </summary>
        public readonly ICollection<Member> Owners = new List<Member>();

        internal override void InternalModifyFilter(FilterBuilder builder) {
            base.InternalModifyFilter(builder);

            builder.Relation("Parent", Parent);
            builder.Relation("Customer", Customer);
            builder.Relation("Theme", Theme);

            builder.MultiRelation("Goals", Goals);
            builder.MultiRelation("Owners", Owners);

            builder.ListRelation<ThemeStatus>("Status", Status);
            builder.ListRelation<ThemeSource>("Source", Source);
            builder.ListRelation<WorkitemRisk>("Risk", Risk);
            builder.ListRelation<ThemeType>("Category", Type);
            builder.ListRelation<WorkitemPriority>("Priority", Priority);
        }
    }
}


text:
import ibis
from ibis.expr.format import ExprFormatter
from ibis.expr.types import Expr

def test_format_custom_expr():
    class CustomExpr(Expr):
        def _type_display(self):
            return 'my-custom'

    op = ibis.literal(5).op()
    expr = CustomExpr(op)

    result = repr(expr)
    expected = 'Literal[my-custom]\n  5'
    assert result == expected

def test_format_table_column(table):
    # GH #507
    result = repr(table.f)
    assert 'Column[float64*]' in result

def test_format_projection(table):
    # This should produce a ref to the projection
    proj = table[['c', 'a', 'f']]
    repr(proj['a'])

def test_table_type_output():
    foo = ibis.table(
        [
            ('job', 'string'),
            ('dept_id', 'string'),
            ('year', 'int32'),
            ('y', 'double'),
        ],
        name='foo',
    )

    expr = foo.dept_id == foo.view().dept_id
    result = repr(expr)

    assert 'SelfReference[table]' in result
    assert 'UnboundTable[table]' in result

def test_memoize_aggregate_correctly(table):
    agg_expr = (table['c'].sum() / table['c'].mean() - 1).name('analysis')
    metrics = [
        table['a'].sum().name('sum(a)'),
        table['b'].mean().name('mean(b)'),
        agg_expr,
    ]

    result = table.aggregate(metrics, by=['g'])

    formatter = ExprFormatter(result)
    formatted = formatter.get_result()

    alias = formatter.memo.get_alias(table)
    assert formatted.count(alias) == 7

def test_aggregate_arg_names(table):
    # Not sure how to test this *well*

    t = table

    by_exprs = [t.g.name('key1'), t.f.round().name('key2')]
    metrics = [t.c.sum().name('c'), t.d.mean().name('d')]

    expr = t.group_by(by_exprs).aggregate(metrics)
    result = repr(expr)
    assert 'metrics' in result
    assert 'by' in result

def test_format_multiple_join_with_projection():
    # Star schema with fact table
    table = ibis.table(
        [
            ('c', 'int32'),
            ('f', 'double'),
            ('foo_id', 'string'),
            ('bar_id', 'string'),
        ],
        'one',
    )

    table2 = ibis.table([('foo_id', 'string'), ('value1', 'double')], 'two')

    table3 = ibis.table([('bar_id', 'string'), ('value2', 'double')], 'three')

    filtered = table[table['f'] > 0]

    pred1 = filtered['foo_id'] == table2['foo_id']
    pred2 = filtered['bar_id'] == table3['bar_id']

    j1 = filtered.left_join(table2, [pred1])
    j2 = j1.inner_join(table3, [pred2])

    # Project out the desired fields
    view = j2[[filtered, table2['value1'], table3['value2']]]

    # it works!
    repr(view)

def test_memoize_database_table(con):
    table = con.table('test1')
    table2 = con.table('test2')

    filter_pred = table['f'] > 0
    table3 = table[filter_pred]
    join_pred = table3['g'] == table2['key']

    joined = table2.inner_join(table3, [join_pred])

    met1 = (table3['f'] - table2['value']).mean().name('foo')
    result = joined.aggregate(
        [met1, table3['f'].sum().name('bar')], by=[table3['g'], table2['key']]
    )

    formatted = repr(result)
    assert formatted.count('test1') == 1
    assert formatted.count('test2') == 1

def test_memoize_filtered_table():
    airlines = ibis.table(
        [('dest', 'string'), ('origin', 'string'), ('arrdelay', 'int32')],
        'airlines',
    )

    dests = ['ORD', 'JFK', 'SFO']
    t = airlines[airlines.dest.isin(dests)]
    delay_filter = t.dest.topk(10, by=t.arrdelay.mean())

    result = repr(delay_filter)
    assert result.count('Selection') == 1

def test_memoize_insert_sort_key(con):
    table = con.table('airlines')

    t = table['arrdelay', 'dest']
    expr = t.group_by('dest').mutate(
        dest_avg=t.arrdelay.mean(), dev=t.arrdelay - t.arrdelay.mean()
    )

    worst = expr[expr.dev.notnull()].sort_by(ibis.desc('dev')).limit(10)

    result = repr(worst)
    assert result.count('airlines') == 1

def test_named_value_expr_show_name(table):
    expr = table.f * 2
    expr2 = expr.name('baz')

    # it works!
    repr(expr)

    result2 = repr(expr2)

    # not really committing to a particular output yet
    assert 'baz' in result2

def test_memoize_filtered_tables_in_join():
    # related: GH #667
    purchases = ibis.table(
        [
            ('region', 'string'),
            ('kind', 'string'),
            ('user', 'int64'),
            ('amount', 'double'),
        ],
        'purchases',
    )

    metric = purchases.amount.sum().name('total')
    agged = purchases.group_by(['region', 'kind']).aggregate(metric)

    left = agged[agged.kind == 'foo']
    right = agged[agged.kind == 'bar']

    cond = left.region == right.region
    joined = left.join(right, cond)[left, right.total.name('right_total')]

    result = repr(joined)

    # Join, and one for each aggregation
    assert result.count('predicates') == 3

def test_argument_repr_shows_name():
    t = ibis.table([('a', 'int64')], name='t')
    expr = t.a.nullif(2)
    result = repr(expr)
    expected = """\
ref_0
UnboundTable[table]
  name: t
  schema:
    a : int64

NullIf[int64*]
  a = Column[int64*] 'a' from table
    ref_0
  null_if_expr:
    Literal[int8]
      2"""
    assert result == expected

def test_scalar_parameter_formatting():
    value = ibis.param('array<date>')
    assert str(value) == 'ScalarParameter[array<date>]'

    value = ibis.param('int64').name('my_param')
    assert str(value) == 'my_param = ScalarParameter[int64]'

def test_same_column_multiple_aliases():
    table = ibis.table([('col', 'int64')], name='t')
    expr = table[table.col.name('alias1'), table.col.name('alias2')]
    result = repr(expr)
    expected = """\
ref_0
UnboundTable[table]
  name: t
  schema:
    col : int64

Selection[table]
  table:
    Table: ref_0
  selections:
    alias1 = Column[int64*] 'col' from table
      ref_0
    alias2 = Column[int64*] 'col' from table
      ref_0"""
    assert result == expected


text:
package main

import "fmt"

var keys = []string{
	"A",
	"B",
	"C",
	"D",
	"E",
	"F",
	"G",
	"H",
	"I",
}

func recursion(index int, rmap *map[string]string) {
	if index == len(keys) {
		fmt.Println()
		fmt.Println("recursion is done")
		fmt.Println()
		return
	}

	fmt.Printf("beginning recursion with index %d / key %s / map %v\n", index, keys[index], (*rmap)[keys[index]])

	recursion(index+1, rmap)

	(*rmap)[keys[index]] = "done"
	fmt.Printf("after     recursion with index %d / key %s / map %v\n", index, keys[index], (*rmap)[keys[index]])
}

func main() {
	executed := make(map[string]string)
	for _, k := range keys {
		executed[k] = "not yet"
	}
	recursion(0, &executed)
}

/*
beginning recursion with index 0 / key A / map not yet
beginning recursion with index 1 / key B / map not yet
beginning recursion with index 2 / key C / map not yet
beginning recursion with index 3 / key D / map not yet
beginning recursion with index 4 / key E / map not yet
beginning recursion with index 5 / key F / map not yet
beginning recursion with index 6 / key G / map not yet
beginning recursion with index 7 / key H / map not yet
beginning recursion with index 8 / key I / map not yet

recursion is done

after     recursion with index 8 / key I / map done
after     recursion with index 7 / key H / map done
after     recursion with index 6 / key G / map done
after     recursion with index 5 / key F / map done
after     recursion with index 4 / key E / map done
after     recursion with index 3 / key D / map done
after     recursion with index 2 / key C / map done
after     recursion with index 1 / key B / map done
after     recursion with index 0 / key A / map done
*/


text:
import Ember from 'ember';
import layout from '../templates/components/techno-table-row';

export default Ember.Component.extend({
  layout: layout,
  tagName: 'tr',
  className: 'table-row',
  editing: false,
  actions: {
    fireAction: function(obj, act) {
      act(obj, this);
    },
    close: function() {
      this.set('editing',false);
    }
  }
});


text:
namespace memory {

// This class is the implementation of a memory ablation study. It artificially
// increases memory usage for different experiment arms.
class MemoryAblationStudy {
 public:
  MemoryAblationStudy();
  MemoryAblationStudy(const MemoryAblationStudy&) = delete;
  MemoryAblationStudy& operator=(const MemoryAblationStudy&) = delete;
  ~MemoryAblationStudy();

 private:
  FRIEND_TEST_ALL_PREFIXES(MemoryAblationStudyTest, Basic);

  using Region = std::vector<uint8_t>;

  // Allocates more memory if necessary. "remaining_allocation_mb_" is
  // guaranteed to be greater than 0.
  void Allocate();

  // Reads from all allocated pages.
  void Read();

  // The remaining amount of memory this class still needs to allocate, in
  // megabytes.
  int32_t remaining_allocation_mb_ = 0;

  // When this timer fires, more memory is allocated. This timer is stopped once
  // the desired allocation amount is reached.
  base::RepeatingTimer allocate_timer_;

  // When this timer fires, the class reads one byte from each allocated page to
  // ensure that the pages are resident.
  base::RepeatingTimer read_timer_;

  // A dummy variable used to help force pages to become resident.
  uint8_t dummy_read_ = 0;

  // The index of the last region that was read/paged-in.
  size_t last_region_read_ = 0;

  // Holds all allocated regions.
  std::vector<Region> regions_;

  // This region is exactly 4096 bytes in size and contains uncompressible data.
  Region uncompressible_region_;
};

}  // namespace memory

#endif  // CHROME_BROWSER_MEMORY_MEMORY_ABLATION_STUDY_H_


text:
package com.milan.inzaghi09.activity;

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

import com.milan.inzaghi09.R;
import com.milan.inzaghi09.db.dao.AppLockDao;
import com.milan.inzaghi09.db.domain.AppInfo;
import com.milan.inzaghi09.engine.AppInfoProvider;

import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.view.animation.TranslateAnimation;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;

public class AppLockActivity extends Activity {
	private Button bt_unlock;
	private Button bt_lock;
	private LinearLayout ll_unlock;
	private LinearLayout ll_lock;
	private TextView tv_unlock_number;
	private TextView tv_lock_number;
	private ListView lv_unlock_app_list;
	private ListView lv_lock_app_list;
	private TranslateAnimation mTranslateAnimation;
	private AppLockDao mAppLockDao;
	private MyAdapter mUnlockAdapter;
	private MyAdapter mLockAdapter;

	private List<AppInfo> mAppLockList;
	private List<AppInfo> mAppUnlockList;
	private Handler mHandler = new Handler(){

		public void handleMessage(android.os.Message msg) {
//			6创建数据适配器,设置给ListView
			mUnlockAdapter = new MyAdapter(false);
			lv_unlock_app_list.setAdapter(mUnlockAdapter);

			mLockAdapter = new MyAdapter(true);
			lv_lock_app_list.setAdapter(mLockAdapter);
		};
	};

	class MyAdapter extends BaseAdapter{
		private boolean islock;
		public MyAdapter(boolean islock){
			this.islock = islock;
		}

		@Override
		public int getCount() {
			if (islock) {
				tv_lock_number.setText("已加锁应用:"+mAppLockList.size());
				return mAppLockList.size();
			} else {
				tv_unlock_number.setText("未加锁应用:"+mAppUnlockList.size());
				return mAppUnlockList.size();
			}
		}

		@Override
		public AppInfo getItem(int position) {
			if (islock) {
				return mAppLockList.get(position);
			} else {
				return mAppUnlockList.get(position);
			}
		}

		@Override
		public long getItemId(int position) {
			return position;
		}

		@Override
		public View getView(int position, View convertView, ViewGroup parent) {

			ViewHolder holder = null;
			if (convertView == null) {
				holder = new ViewHolder();
				convertView = View.inflate(getApplicationContext(), R.layout.listview_app_islock_item, null);
				holder.iv_icon = (ImageView) convertView.findViewById(R.id.iv_icon);
				holder.tv_name = (TextView) convertView.findViewById(R.id.tv_name);
				holder.iv_islock = (ImageView) convertView.findViewById(R.id.iv_islock);
				convertView.setTag(holder);
			} else {
				holder = (ViewHolder) convertView.getTag();
			}
			holder.iv_icon.setBackgroundDrawable(getItem(position).icon);
			holder.tv_name.setText(getItem(position).name);
			if (islock) {
				holder.iv_islock.setBackgroundResource(R.drawable.lock);
			} else {
				holder.iv_islock.setBackgroundResource(R.drawable.unlock);
			}

//			将convertView,以及getItem()赋给第三方临时变量
			final View animationView = convertView;
			final AppInfo appInfo = getItem(position);
			//			设置点击锁图标的事件
			holder.iv_islock.setOnClickListener(new OnClickListener() {

				@Override
				public void onClick(View v) {
					// 1执行动画
					animationView.startAnimation(mTranslateAnimation);
					mTranslateAnimation.setAnimationListener(new AnimationListener() {

								@Override
								public void onAnimationStart(Animation animation) {

								}

								@Override
								public void onAnimationRepeat(
										Animation animation) {

								}

								@Override
								public void onAnimationEnd(Animation animation) {
									// 2根据是否加锁,从相应集合中删除|增加数据
									if (islock) {
										// 2.1从锁到不锁,
										mAppLockList.remove(appInfo);
										mAppUnlockList.add(0, appInfo);
										mAppLockDao.delete(appInfo.packageName);
										mLockAdapter.notifyDataSetChanged();
										mUnlockAdapter.notifyDataSetChanged();
									} else {
										// 2.2从不锁到锁
										mAppUnlockList.remove(appInfo);
										mAppLockList.add(0, appInfo);
										mAppLockDao.insert(appInfo.packageName);
										mLockAdapter.notifyDataSetChanged();
										mUnlockAdapter.notifyDataSetChanged();
									}

								}
							});
				}
			});

			return convertView;
		}
	}

	static class ViewHolder{
		public ImageView iv_icon;
		public TextView tv_name;
		public ImageView iv_islock;
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_app_lock);
		initAnimation();
		initUI();
		initData();
	}

	/**
	 * 平移动画
	 */
	private void initAnimation() {
		mTranslateAnimation = new TranslateAnimation(
				Animation.RELATIVE_TO_SELF, 0,
				Animation.RELATIVE_TO_SELF, 1,
				Animation.RELATIVE_TO_SELF, 0,
				Animation.RELATIVE_TO_SELF, 0);
		mTranslateAnimation.setDuration(300);
	}

	/**
	 * 获取数据
	 */
	private void initData() {
		new Thread() {
			public void run() {
				// 1查找所有应用,icon,name,packageName,islock
				List<AppInfo> appInfoList = AppInfoProvider.getAppInfoList(getApplicationContext());
				// 2查找已加锁应用

				mAppLockDao = AppLockDao.getInstance(getApplicationContext());
				List<String> appLockList = mAppLockDao.queryAll();

//				3按是否加锁,将应用分类
				mAppLockList = new ArrayList<AppInfo>();
				mAppUnlockList = new ArrayList<AppInfo>();

//				4遍历所有应用的集合,根据包名判断应用是否加锁,将应用分类
				for (AppInfo appInfo : appInfoList) {
//
//					根据应用是否加锁,划分到不同的集合
					if (appLockList.contains(appInfo.packageName)) {
						mAppLockList.add(appInfo);
					} else {
						mAppUnlockList.add(appInfo);
					}
				}
				// 5通知主线程,数据已准备好
				mHandler.sendEmptyMessage(0);
			};
		}.start();

	}

	/**
	 * 初始化控件
	 */
	private void initUI() {
		// 切换已加锁未加锁列表按钮
		bt_unlock = (Button) findViewById(R.id.bt_unlock);
		bt_lock = (Button) findViewById(R.id.bt_lock);
		// 未加锁列表控件
		ll_unlock = (LinearLayout) findViewById(R.id.ll_unlock);
		tv_unlock_number = (TextView) findViewById(R.id.tv_unlock_number);
		lv_unlock_app_list = (ListView) findViewById(R.id.lv_unlock_app_list);
		// 已加锁列表控件
		ll_lock = (LinearLayout) findViewById(R.id.ll_lock);
		tv_lock_number = (TextView) findViewById(R.id.tv_lock_number);
		lv_lock_app_list = (ListView) findViewById(R.id.lv_lock_app_list);

		//设置按钮点击事件
		bt_unlock.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// 1切换按钮背景图片
				bt_unlock.setBackgroundResource(R.drawable.tab_left_pressed);
				bt_lock.setBackgroundResource(R.drawable.tab_right_default);
				// 2切换LinearLaout
				ll_unlock.setVisibility(View.VISIBLE);
				ll_lock.setVisibility(View.GONE);
			}
		});
		bt_lock.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// 1切换按钮背景图片
				bt_unlock.setBackgroundResource(R.drawable.tab_left_default);
				bt_lock.setBackgroundResource(R.drawable.tab_right_pressed);
				// 2切换LinearLaout
				ll_unlock.setVisibility(View.GONE);
				ll_lock.setVisibility(View.VISIBLE);
			}
		});
	}
}