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

namespace SamoSsas.Processing.Object
{
    class DimensionObject : ProcessableObject
    {
        public DimensionObject(Database database, string name)
            : base(database, name)
        { }

        protected override void Initialize()
        {
            ItSelf = Database.Dimensions.FindByName(Name);
        }

        public ProcessingState ProcessingState
        {
            get
            {
                if (ItSelf == null)
                    Initialize();
                return (ItSelf as Dimension).ProcessingState;
            }
        }

    }
}

redpajama_set_name: RedPajamaGithub


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

// PortableKnowledge Logging Framework for .NET
// (C) Portable Knowledge, LLC
//
// Released to the public under the Portable Knowledge Open Source Component License
//
// Permission is hereby granted, free of charge, to any person or organization obtaining a
// copy of the software and accompanying documentation covered by this license (the "Software")
// to use, reproduce, display, distribute, execute, and transmit the Software, and to prepare
// derivative works of the Software, and to permit third-parties to whom the Software is
// furnished to do so, all subject to the following:
//
// The copyright notices in the Software and this entire statement, including the above license
// grant, this restriction and the following disclaimer, must be included in all copies of the
// Software, in whole or in part, and all derivative works of the Software, unless such copies
// or derivative works are solely in the form of machine-executable object code generated by
// a source language processor.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE
// DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.  IN NO CASE DOES THE USE OF THIS SOFTWARE EXPRES OR IMPLY
// ANY PARTNERSHIP OR COOPERATION WITH THE AUTHORS OR COPYRIGHT HOLDERS OF THIS SOFTWARE.

namespace PortableKnowledge.Logging
{
    /// <summary>
    /// A "NULL" Log subclass.  Instances of this class do nothing, and any calls to methods of this subclass
    /// should be optimized away by the JIT compiler.  This class just provides empty method implementations
    /// to avoid NullReferenceExecptions being thrown when attempting to access methods of NULL log entries.
    /// </summary>
    class NullLog : Log
    {
        /// <summary>
        /// Initialize a new NullLog instance.
        /// </summary>
        public NullLog()
        {
        }

        /// <summary>
        /// Event raised whenever a new LogItem has been added to the current log
        /// </summary>
        new public event LogEventHandler OnLogMessageReceived
        {
            add
            {
            }
            remove
            {
            }
        }

        /// <summary>
        /// Send a general logging item to all registered log listeners
        /// </summary>
        /// <param name="item">Logging item to send</param>
        new public void Add(LogItem item)
        {
        }

        /// <summary>
        /// Send a Debug message to all registered log listeners
        /// </summary>
        /// <param name="sender">The object sending the debug message (usually "this")</param>
        /// <param name="message">The text of the message</param>
        new public void Debug(Object sender, String message)
        {
        }

        /// <summary>
        /// Send an Informational message to all registered log listeners
        /// </summary>
        /// <param name="sender">The object sending the debug message (usually "this")</param>
        /// <param name="message">The text of the message</param>
        new public void Info(Object sender, String message)
        {
        }

        /// <summary>
        /// Send a Warning message to all registered log listeners
        /// </summary>
        /// <param name="sender">The object sending the debug message (usually "this")</param>
        /// <param name="message">The text of the message</param>
        new public void Warning(Object sender, String message)
        {
        }

        /// <summary>
        /// Send a Recoverable Error message to all registered log listeners
        /// </summary>
        /// <param name="sender">The object sending the debug message (usually "this")</param>
        /// <param name="message">The text of the message</param>
        new public void Error(Object sender, String message)
        {
        }

        /// <summary>
        /// Send a Fatal Error message to all registered log listeners
        /// </summary>
        /// <param name="sender">The object sending the debug message (usually "this")</param>
        /// <param name="message">The text of the message</param>
        new public void FatalError(Object sender, String message)
        {
        }
    }
}


text:
namespace vkExt {
	struct SharedMemory {
		vk::DeviceMemory memory;
		vk::DeviceSize size;
		void* mapped;
		bool isMapped = false;
		bool isAlive = true;

		vk::Result map(vk::Device device, vk::DeviceSize offset, vk::MemoryMapFlags flags) {
			if (isMapped) return vk::Result::eSuccess;
			auto res = device.mapMemory(memory, offset, size, flags, &mapped);
			if (res == vk::Result::eSuccess) isMapped = true;
			return res;
		}
		void unmap(vk::Device device) {
			if (!isMapped) return;
			device.unmapMemory(memory);
			mapped = nullptr;
			isMapped = false;
		}
		void free(vk::Device device) {
			if (!isAlive) return;
			isAlive = false;
			device.freeMemory(memory);
		}
	};

	struct Buffer {
		vk::Device device;
		vk::Buffer buffer;
		vk::DescriptorBufferInfo descriptor;
		uint32_t memoryOffset;
		vkExt::SharedMemory* memory;

		void* mapped() {
			if (!memory->isMapped) {
				auto res = map();
				if (res != vk::Result::eSuccess) return nullptr;
			}
			return (void*)((uint32_t *)(memory->mapped) + memoryOffset);
		}

		// Flags
		vk::BufferUsageFlags usageFlags;

		vk::Result map() {
			return memory->map(device, descriptor.offset, vk::MemoryMapFlags());
		}

		void unmap() {
			memory->unmap(device);
		}

		void bind(vk::DeviceSize offset = 0) {
			device.bindBufferMemory(buffer, memory->memory, offset);
		}

		void setupDescriptor(vk::DeviceSize size = VK_WHOLE_SIZE, vk::DeviceSize offset = 0) {
			descriptor.offset = offset;
			descriptor.buffer = buffer;
			descriptor.range = size;
		}

		void copyTo(void* data, vk::DeviceSize size) {
			assert(memory->mapped);
			memcpy(memory->mapped, data, (size_t)size);
		}

		vk::Result flush() {
			vk::MappedMemoryRange mappedRange = vk::MappedMemoryRange()
				.setMemory(memory->memory)
				.setOffset(descriptor.offset)
				.setSize(descriptor.range);
			return device.flushMappedMemoryRanges(1, &mappedRange);
		}

		vk::Result invalidate() {
			vk::MappedMemoryRange mappedRange = vk::MappedMemoryRange()
				.setMemory(memory->memory)
				.setOffset(descriptor.offset)
				.setSize(descriptor.range);
			return device.invalidateMappedMemoryRanges(1, &mappedRange);
		}

		void destroy(bool freeMem = false) {
			unmap();
			if (buffer) {
				device.destroyBuffer(buffer);
			}
			if (freeMem) {
				memory->free(device);
			}
		}
	};
}

#endif


text:
package net.imagej.legacy.plugin;

import java.io.File;

import org.scijava.ItemIO;
import org.scijava.command.Command;
import org.scijava.command.ContextCommand;
import org.scijava.plugin.Attr;
import org.scijava.plugin.Parameter;
import org.scijava.plugin.Plugin;

/**
 * Simple command to get a {@link File} and return its path.
 *
 * @author Mark Hiner
 */
@Plugin(type = Command.class, label = "Select path", attrs = { @Attr(name = "no-legacy") })
public class GetPath extends ContextCommand {

	@Parameter(type = ItemIO.INPUT, label = "File to open")
	private File inputFile;

	@Parameter(type = ItemIO.INPUT)
	private String[] path;

	@Override
	public void run() {
		if (path.length < 1) throw new IllegalArgumentException(
			"GetPath: Must provide a path array of size at least 1");
		path[0] = inputFile.getAbsolutePath();
	}

}


text:
#ifndef __TCPPRINT_H
#define __TCPPRINT_H

/**
\addtogroup AppTcp
\{
\addtogroup tcpPrint
\{
*/

//=========================== define ==========================================

//=========================== typedef =========================================

//=========================== variables =======================================

//=========================== prototypes ======================================

void tcpprint_init(void);
bool tcpprint_shouldIlisten(void);
void tcpprint_receive(OpenQueueEntry_t* msg);
void tcpprint_connectDone(owerror_t error);
void tcpprint_sendDone(OpenQueueEntry_t* msg, owerror_t error);
bool tcpprint_debugPrint(void);

/**
\}
\}
*/

#endif


text:
package tberg.murphy.ilp;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class IndexingILPWrapper {

	Map<Object,Integer> objectToIndex;
	IntegerLinearProgram ilp;
	boolean locked;

	public IndexingILPWrapper(IntegerLinearProgram ilp) {
		this.ilp = ilp;
		this.objectToIndex = new HashMap<Object,Integer>();
	}

	public boolean containsObject(Object obj) {
		return objectToIndex.containsKey(obj);
	}

	public int numVars() {
		return objectToIndex.keySet().size();
	}

	private int getIndex(Object obj) {
		if (!containsObject(obj)) {
			throw new RuntimeException("Object not in indexer.");
		} else {
			return objectToIndex.get(obj);
		}
	}

	private int[] getIndices(Object[] objs) {
		int[] indices = new int[objs.length];
		for (int i=0; i<indices.length; ++i) {
			indices[i] = getIndex(objs[i]);
		}
		return indices;
	}

	private List<Integer> getIndices(List<Object> objs) {
		List<Integer> indices = new ArrayList<Integer>();
		for (Object obj : objs) {
			indices.add(getIndex(obj));
		}
		return indices;
	}

	public int addBoundedIntVar(Object obj, double lower, double upper) {
		if (containsObject(obj)) {
			throw new RuntimeException("Object already added to indexer.");
		} else {
			int index = ilp.addBoundedIntVar(lower, upper);
			objectToIndex.put(obj, index);
			return index;
		}
	}

	public void lockVariableCount() {
		ilp.lockVariableCount();
	}

	public void optimize() {
		ilp.optimize();
	}

	public int addBoundedVar(Object obj, double lower, double upper) {
		if (containsObject(obj)) {
			throw new RuntimeException("Object already added to indexer.");
		} else {
			int index = ilp.addBoundedVar(lower, upper);
			objectToIndex.put(obj, index);
			return index;
		}
	}

	public void addLessThanConstraint(Object[] objs, double[] weights, double rhs) {
		ilp.addLessThanConstraint(getIndices(objs), weights, rhs);
	}

	public void addObjectiveWeight(Object obj, double val) {
		ilp.addObjectiveWeight(getIndex(obj), val);
	}

	public void setToMaximize() {
		ilp.setToMaximize();
	}

	public double objectiveValue() {
		return ilp.objectiveValue();
	}

	public void clear() {
		ilp.clear();
	}

	public Map<Object,Double> solution() {
		Map<Object,Double> solution = new HashMap<Object, Double>();
		double[] solutionByIndex = ilp.solution();
		for (Object obj : objectToIndex.keySet()) {
			solution.put(obj, solutionByIndex[getIndex(obj)]);
		}
		return solution;
	}

	public void addObjectiveWeights(List<Object> objs, List<Double> weights) {
		ilp.addObjectiveWeights(getIndices(objs), weights);
	}

	public void addObjectiveWeights(Object[] objs, double[] weights) {
		ilp.addObjectiveWeights(getIndices(objs), weights);
	}

	public void addEqualityConstraint(Object obj, double weight, double rhs) {
		ilp.addEqualityConstraint(getIndex(obj), weight, rhs);
	}

	public void addEqualityConstraint(Object[] objs, double[] weights, double rhs) {
		ilp.addEqualityConstraint(getIndices(objs), weights, rhs);
	}

	public void addGreaterThanConstraint(Object[] objs, double[] weights, double rhs) {
		ilp.addGreaterThanConstraint(getIndices(objs), weights, rhs);
	}

	public void addLessThanConstraint(Object obj, double weight, double rhs) {
		ilp.addLessThanConstraint(getIndex(obj), weight, rhs);
	}

	public void addGreaterThanConstraint(Object obj, double weight, double rhs) {
		ilp.addGreaterThanConstraint(getIndex(obj), weight, rhs);
	}

	public void addOrConstraint(Object orObj, Object[] objs) {
		ilp.addOrConstraint(getIndex(orObj), getIndices(objs));
	}

	public void addAndConstraint(Object andObj, Object[] objs) {
		ilp.addAndConstraint(getIndex(andObj), getIndices(objs));
	}

}


text:
import * as CSS from './social-share.css';
import * as Preact from '../../../src/preact';
import {Keys} from '../../../src/utils/key-codes';
import {SocialShareIcon} from '../../../third_party/optimized-svg-icons/social-share-svgs';
import {addParamsToUrl, parseQueryString} from '../../../src/url';
import {dict} from '../../../src/utils/object';
import {getSocialConfig} from './social-share-config';
import {openWindowDialog} from '../../../src/dom';
import {useResourcesNotify} from '../../../src/preact/utils';

const DEFAULT_WIDTH = 60;
const DEFAULT_HEIGHT = 44;
const DEFAULT_TARGET = '_blank';
const NAME = 'SocialShare';

/**
 * @param {!JsonObject} props
 *  type: !string,
 *  endpoint: ?string,
 *  params: ?JsonObject,
 *  target: ?string,
 *  width: ?string,
 *  height: ?string,
 *  color: ?string,
 *  background: ?string,
 *  tabIndex: ?string,
 *  style: ?string,
 * @return {PreactDef.Renderable}
 */
export function SocialShare(props) {
  useResourcesNotify();
  const {
    finalEndpoint,
    checkedWidth,
    checkedHeight,
    checkedTarget,
  } = checkProps(props);

  const size = dict({
    'width': checkedWidth,
    'height': checkedHeight,
  });

  return (
    <div
      role="button"
      tabindex={props['tabIndex'] || '0'}
      onKeyDown={(e) => handleKeyPress(e, finalEndpoint, checkedTarget)}
      onClick={() => handleActivation(finalEndpoint, checkedTarget)}
      style={{...size, ...props['style']}}
    >
      {processChildren(props, size)}
    </div>
  );
}

/**
 * If the specified type 'canCustomize' (see config file), allow children
 * to be rendered and color / background to be passed in via props.  If the
 * specified type cannot be customized (canCustomize = false), children
 * will not be rendered and color / background will always be set to default
 * values.
 * @param {!JsonObject} props
 * @param {JsonObject} size
 * @return {PreactDef.Renderable}
 */
function processChildren(props, size) {
  const {
    'type': type,
    'children': children,
    'color': propsColor,
    'background': propsBackground,
  } = props;
  const typeConfig =
    getSocialConfig(type) ||
    dict({
      'canCustomize': true,
    });

  if (typeConfig['canCustomize'] && children) {
    return children;
  } else {
    const baseStyle = CSS.BASE_STYLE;
    const iconStyle = dict({
      'color':
        typeConfig['canCustomize'] && propsColor
          ? propsColor
          : typeConfig['defaultColor'],
      'backgroundColor':
        typeConfig['canCustomize'] && propsBackground
          ? propsBackground
          : typeConfig['defaultBackgroundColor'],
    });
    return (
      <SocialShareIcon
        style={{...iconStyle, ...baseStyle, ...size}}
        type={type.toUpperCase()}
      />
    );
  }
}

/**
 * @param {!JsonObject} props
 * @return {{
 *   finalEndpoint: string,
 *   checkedWidth: number,
 *   checkedHeight: number,
 *   checkedTarget: string,
 * }}
 */
function checkProps(props) {
  const {
    'type': type,
    'endpoint': endpoint,
    'target': target,
    'width': width,
    'height': height,
    'params': params,
  } = props;

  // Verify type is provided
  if (type === undefined) {
    throw new Error(`The type attribute is required. ${NAME}`);
  }

  // User must provide endpoint if they choose a type that is not
  // pre-configured
  const typeConfig = getSocialConfig(type) || dict();
  let baseEndpoint = endpoint || typeConfig['shareEndpoint'];
  if (baseEndpoint === undefined) {
    throw new Error(
      `An endpoint is required if not using a pre-configured type. ${NAME}`
    );
  }

  // Special case when type is 'email'
  if (type === 'email' && !endpoint) {
    baseEndpoint = `mailto:${params['recipient'] || ''}`;
  }

  // Add params to baseEndpoint
  const finalEndpoint = addParamsToUrl(
    /** @type {string} */ (baseEndpoint),
    /** @type {!JsonObject} */ (params)
  );

  // Defaults
  const checkedWidth = width || DEFAULT_WIDTH;
  const checkedHeight = height || DEFAULT_HEIGHT;
  const checkedTarget = target || DEFAULT_TARGET;

  return {
    finalEndpoint,
    checkedWidth,
    checkedHeight,
    checkedTarget,
  };
}

/**
 * @param {?string} message
 */
function throwWarning(message) {
  console /*OK*/
    .warn(message);
}

/**
 * Opens a new window with the fully processed endpoint
 * @param {?string} finalEndpoint
 * @param {string} target
 */
function handleActivation(finalEndpoint, target) {
  const protocol = finalEndpoint.split(':', 1)[0];
  const windowFeatures = 'resizable,scrollbars,width=640,height=480';
  if (protocol === 'navigator-share') {
    if (window && window.navigator && window.navigator.share) {
      const data = parseQueryString(
        /** @type {string} */ (getQueryString(finalEndpoint))
      );
      window.navigator.share(data).catch((e) => {
        throwWarning(`${e.message}. ${NAME}`);
      });
    } else {
      throwWarning(
        `Could not complete system share.  Navigator unavailable. ${NAME}`
      );
    }
  } else if (protocol === 'sms' || protocol === 'mailto') {
    openWindowDialog(
      window,
      protocol === 'sms' ? finalEndpoint.replace('?', '?&') : finalEndpoint,
      isIos() ? '_top' : target,
      windowFeatures
    );
  } else {
    openWindowDialog(window, finalEndpoint, target, windowFeatures);
  }
}

/**
 * Returns the Query String of a full url, will not include # parameters
 * @param {?string} endpoint
 * @return {?string}
 */
function getQueryString(endpoint) {
  let q = endpoint.indexOf('?');
  let h = endpoint.indexOf('#');
  q = q === -1 ? endpoint.length : q;
  h = h === -1 ? endpoint.length : h;
  return endpoint.slice(q, h);
}

/**
 * Checks whether or not the userAgent of the current device indicates that
 * this is an Ios device.  Checked for 'mailto:' and 'sms:' protocols which
 * break when opened in _blank on iOS Safari.
 * @return {boolean}
 */
function isIos() {
  return /** @type {boolean} */ (window &&
    window.navigator &&
    window.navigator.userAgent &&
    window.navigator.userAgent.search(/iPhone|iPad|iPod/i) >= 0);
}

/**
 * @param {!Event} event
 * @param {?string} finalEndpoint
 * @param {string} target
 */
function handleKeyPress(event, finalEndpoint, target) {
  const {key} = event;
  if (key == Keys.SPACE || key == Keys.ENTER) {
    event.preventDefault();
    handleActivation(finalEndpoint, target);
  }
}


text:
<?php
// DO NOT EDIT! Generated by Protobuf-PHP protoc plugin @package_version@// Source: riak.proto
//   Date: 2015-01-16 03:40:25

namespace Riak\Client\ProtoBuf {

    class RpbListKeysResp extends \DrSlump\Protobuf\Message
    {
        /** @var \DrSlump\Protobuf\Descriptor */
        protected static $__descriptor;
        /** @var \Closure[] */
        protected static $__extensions = array();

        public static function descriptor()
        {
            $descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, '.RpbListKeysResp');

            // repeated bytes keys = 1
            $f = new \DrSlump\Protobuf\Field();
            $f->number = 1;
            $f->name   = "keys";
            $f->rule   = \DrSlump\Protobuf\Protobuf::RULE_REPEATED;
            $f->type   = \DrSlump\Protobuf\Protobuf::TYPE_BYTES;

            $descriptor->addField($f);

            // optional bool done = 2
            $f = new \DrSlump\Protobuf\Field();
            $f->number = 2;
            $f->name   = "done";
            $f->rule   = \DrSlump\Protobuf\Protobuf::RULE_OPTIONAL;
            $f->type   = \DrSlump\Protobuf\Protobuf::TYPE_BOOL;

            $descriptor->addField($f);

            foreach (self::$__extensions as $cb) {
                $descriptor->addField($cb(), true);
            }

            return $descriptor;
        }

        /**
         * Check if "keys" has a value
         *
         * @return boolean
         */
        public function hasKeys()
        {
            return isset($this->keys);
        }

        /**
         * Clear "keys" value
         */
        public function clearKeys()
        {
            unset($this->keys);
        }

        /**
         * Get "keys" value
         *
         * @return \PhpOption\Option of type string[]
         */
        public function getKeys($idx = null)
        {
            if (null == $idx || !array_key_exists($idx, $this->keys)) {
                return  \PhpOption\None::create();
            }

            return new \PhpOption\Some($this->keys[$idx]);
        }

        /**
         * Get "keys" list of values
         *
         * @return string[]
         */
        public function getKeysList()
        {
            return $this->keys;
        }

        /**
         * Set "keys" value
         *
         * @param string[] $value
         */
        public function setKeys($value)
        {
            return $this->keys = $value;
        }

        /**
         * Add a new element to "keys"
         *
         * @param string $value
         */
        public function addKeys($value)
        {
            $this->keys[] = $value;
        }

        /**
         * Check if "done" has a value
         *
         * @return boolean
         */
        public function hasDone()
        {
            return isset($this->done);
        }

        /**
         * Clear "done" value
         */
        public function clearDone()
        {
            unset($this->done);
        }

        /**
         * Get "done" value
         * @return \PhpOption\Option of type (boolean)
         *
         *
         */
        public function getDone()
        {
            return \PhpOption\Option::fromValue($this->done);
        }

        /**
         * Set "done" value
         *
         * @param boolean $value
         */
        public function setDone($value)
        {
            return $this->done = $value;
        }
    }
}


text:
const { asyncMiddleware } = require('../utils/middleware')
const createStandardRoutes = require('./routeWorkers/standard')
const formConfig = require('./config/victim')

module.exports = ({ licenceService }) => (router, audited) => {
  const standard = createStandardRoutes({ formConfig, licenceService, sectionName: 'victim' })

  router.get('/:formName/:bookingId', asyncMiddleware(standard.get))
  router.post('/:formName/:bookingId', audited, asyncMiddleware(standard.post))

  router.get('/:formName/:action/:bookingId', asyncMiddleware(standard.get))
  router.post('/:formName/:action/:bookingId', audited, asyncMiddleware(standard.post))

  return router
}


text:
' Copyright (c) 2015 ZZZ Projects. All rights reserved
' Licensed under MIT License (MIT) (https://github.com/zzzprojects/Z.ExtensionMethods)
' Website: http://www.zzzprojects.com/
' Feedback / Feature Requests / Issues : http://zzzprojects.uservoice.com/forums/283927
' All ZZZ Projects products: Entity Framework Extensions / Bulk Operations / Extension Methods /Icon Library

Public Module Extensions_223

	''' <summary>
	'''     Returns the sine of the specified angle.
	''' </summary>
	''' <param name="a">An angle, measured in radians.</param>
	''' <returns>The sine of . If  is equal to , , or , this method returns .</returns>
	<System.Runtime.CompilerServices.Extension> _
	Public Function Sin(a As [Double]) As [Double]
		Return Math.Sin(a)
	End Function
End Module


text:
package edu.uci.ics.fuzzyjoin.hadoop.ridpairs.ppjoin;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;

import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapred.MapReduceBase;
import org.apache.hadoop.mapred.OutputCollector;
import org.apache.hadoop.mapred.Reducer;
import org.apache.hadoop.mapred.Reporter;

import edu.uci.ics.fuzzyjoin.FuzzyJoinConfig;
import edu.uci.ics.fuzzyjoin.FuzzyJoinMemory;
import edu.uci.ics.fuzzyjoin.ResultSelfJoin;
import edu.uci.ics.fuzzyjoin.hadoop.ridpairs.ValueSelfJoin;

/**
 * @author rares
 *
 *         KEY1: token group, lenght
 *
 *         VALUE1: record info: RID, [tokens]
 *
 *         KEY2: RID pair and similarity
 *
 *         VALUE2: unused
 */
public class ReduceSelfJoin extends MapReduceBase implements
        Reducer<Object, ValueSelfJoin, Text, NullWritable> {

    private float similarityThreshold;
    private final Text outputKey = new Text();
    private final NullWritable outputValue = NullWritable.get();

    @Override
    public void configure(JobConf job) {
        similarityThreshold = job.getFloat(
                FuzzyJoinConfig.SIMILARITY_THRESHOLD_PROPERTY,
                FuzzyJoinConfig.SIMILARITY_THRESHOLD_VALUE);
    }

    public void reduce(Object unused, Iterator<ValueSelfJoin> inputValues,
            OutputCollector<Text, NullWritable> output, Reporter reporter)
            throws IOException {
        HashMap<Integer, Integer> rids = new HashMap<Integer, Integer>();
        FuzzyJoinMemory fuzzyJoinMemory = new FuzzyJoinMemory(
                similarityThreshold);
        int crtRecordId = 0;

        while (inputValues.hasNext()) {
            ValueSelfJoin recordInfo = inputValues.next();
            int[] record = recordInfo.getTokens();

            rids.put(crtRecordId, recordInfo.getRID());
            crtRecordId++;

            ArrayList<ResultSelfJoin> results = fuzzyJoinMemory
                    .selfJoinAndAddRecord(record);
            for (ResultSelfJoin result : results) {
                int rid1 = rids.get(result.indexX);
                int rid2 = rids.get(result.indexY);
                if (rid1 < rid2) {
                    int rid = rid1;
                    rid1 = rid2;
                    rid2 = rid;
                }

                outputKey.set("" + rid1 + FuzzyJoinConfig.RIDPAIRS_SEPARATOR
                        + rid2 + FuzzyJoinConfig.RIDPAIRS_SEPARATOR
                        + result.similarity);
                output.collect(outputKey, outputValue);
            }
        }
    }
}


text:
from flask import current_app, redirect, url_for, request, session, flash, send_file
from flask.ext import restful
from flask.ext.login import login_required, current_user, login_user, logout_user
import twitter
from request_parsers import *
from datetime import datetime
from models import *
from rauth.service import OAuth1Service
from rauth.utils import parse_utf8_qsl
from twitter_helpers import TwitterUser
import controllers
import traceback

class TwitterAuth(restful.Resource):
    def get(self):
        twitter_auth_loader = OAuth1Service(
	    name='twitter',
	    consumer_key=current_app.config['CONSUMER_KEY'],
	    consumer_secret=current_app.config['CONSUMER_SECRET'],
	    request_token_url='https://api.twitter.com/oauth/request_token',
	    access_token_url='https://api.twitter.com/oauth/access_token',
	    authorize_url='https://api.twitter.com/oauth/authorize',
	    base_url='https://api.twitter.com/1.1/'
		)
        oauth_callback = url_for('twittercallback', _external=True)
        params = {'oauth_callback': oauth_callback}
        auth_url = twitter_auth_loader.get_raw_request_token(params=params)
        data = parse_utf8_qsl(auth_url.content)

        session['twitter_oauth'] = (data['oauth_token'],
                                data['oauth_token_secret'])
        return redirect(twitter_auth_loader.get_authorize_url(data['oauth_token'], **params))

class Login(restful.Resource):
    def get(self):
        return send_file('views/index.html')
        #return current_app.send_static_file('views/login.html')
        return {'status':'Welcome'}

class TwitterCallback(restful.Resource):
    def get(self):
        try:
            print session
            request_token, request_token_secret = session.pop('twitter_oauth')
            twitter_auth_loader = OAuth1Service(
		    name='twitter',
		    consumer_key=current_app.config['CONSUMER_KEY'],
		    consumer_secret=current_app.config['CONSUMER_SECRET'],
		    request_token_url='https://api.twitter.com/oauth/request_token',
		    access_token_url='https://api.twitter.com/oauth/access_token',
		    authorize_url='https://api.twitter.com/oauth/authorize',
		    base_url='https://api.twitter.com/1.1/'
			)
            if not 'oauth_token' in request.args:
                print 'You did not authorize the request'
                return redirect(url_for('index'))

            try:
                creds = {'request_token': request_token,
                        'request_token_secret': request_token_secret}
                params = {'oauth_verifier': request.args['oauth_verifier']}
                sess = twitter_auth_loader.get_auth_session(params=params, **creds)
                print sess.access_token
            except Exception, e:
                flash('There was a problem logging into Twitter: ' + str(e))
                return redirect(url_for('index'))
            api = twitter.Api(
                current_app.config['CONSUMER_KEY'],
                current_app.config['CONSUMER_SECRET'],
                sess.access_token,
                sess.access_token_secret
			)
            u = api.VerifyCredentials()
            user = User.objects(twitter_id = u.id).first()
            if not user:
                user = User(twitter_id = u.id, screen_name = u.screen_name, registered_on = datetime.now(), access_token = sess.access_token, access_token_secret = sess.access_token_secret)
                user.save()
            else:
                user.update(set__access_token = sess.access_token, set__access_token_secret = sess.access_token_secret)
            login_user(user)
            # return controllers.get_logged_in_users_list(user)
            return redirect('http://localhost:8000')
        except Exception as e:
            import traceback
            print traceback.format_exc(e)
            restful.abort(500, message = 'Internal Server Error.')

class MyLists(restful.Resource):
    @login_required
    def get(self):
        #args = list_parser.parse_args()
        #TODO also return subscribed lists
        user = current_user
        try:
            return controllers.get_logged_in_users_list(user)
            pass
        except twitter.TwitterError as e:
            if e.message[0]['code'] == 88:
                restful.abort(404, message = 'Limit for your access token has reached. Be patient and see some of the popular timelines')
        except Exception as e:
            import traceback
            print traceback.format_exc(e)
            restful.abort(500, message = 'internal server error.')

class CreateList(restful.Resource):
    @login_required
    def get(self):
        args = create_list_parser.parse_args()
        user = current_user
        try:
            return controllers.create_list(user, args['screen_name'])
            pass
        except twitter.TwitterError as e:
            if e.message[0]['code'] == 34:
                restful.abort(404, message = 'Sorry user not found on twitter.')
            elif e.message[0]['code'] == 88:
                restful.abort(404, message = 'Limit for your access token has reached. You can create more timenlines later. Try some of the popular timelines for now.')
        except Exception as e:
            import traceback
            print traceback.format_exc(e)
            restful.abort(500, message = 'internal server error.')

class SubscribeList(restful.Resource):
    @login_required
    def get(self):
        args = subscribe_list_parser.parse_args()
        user = current_user
        try:
            return controllers.subscribe_list(user, args['list_id'], args['owner_id'])
        except twitter.TwitterError as e:
            if e.message[0]['code'] == 88:
                restful.abort(404, message = 'Limit for your access token has reached. You may subscribe to interesting timelines later. Just enjoy popular timelines for now.')
        except Exception as e:
            import traceback
            print traceback.format_exc(e)
            restful.abort(500, message = 'internal server error.')

class DiscoverList(restful.Resource):
    @login_required
    def get(self):
        args = discover_list_parser.parse_args()
        try:
            list_objs = list(TimelineList._get_collection().find({'exists' : True}).skip(args['skip']).limit(args['limit']))
            map(lambda x:x.pop('_id'),list_objs)
            return list_objs
        except Exception as e:
            import traceback
            print traceback.format_exc(e)
            restful.abort(500, message = 'internal server error.')

class ListTimeline(restful.Resource):
    @login_required
    def get(self):
        args = list_timeline_parser.parse_args()
        user = current_user
        try:
            return controllers.list_timeline(user, args['list_id'], args['owner_id'], args['since_id'], args['count'])
        except twitter.TwitterError as e:
            if e.message[0]['code'] == 34:
                controllers.update_list_status(args['list_id'], exists = False)
                restful.abort(404, message = 'Sorry page not found')
        except Exception as e:
            import traceback
            print traceback.format_exc(e)
            restful.abort(500, message = 'internal server error.')


text:
Crunchy PostgreSQL 9.4.2
==========================

NOTE: The Makefile included creates a Docker container with the proper nomenclature for the registry.
The Dockerfile contains the LABELS metadata as per the future requirements.

gmillard@redhat.com

This project includes a Dockerfile that lets you build
a PostgreSQL 9.4.2 Docker image.  The image by default
is built on a RHEL 7.1 64 bit base, but can also be built
on a centos 7 64 bit base.  NOTICE, to build the RHEL 7
version of this container, you need to build the Docker
container on a licensed RHEL 7 host!

Installation
------------

Builds are done by issuing the make command:
~~~~~~~~~~~~~~~~~~~~~
make
~~~~~~~~~~~~~~~~~~~~~

Running Postgresql
------------

To create the Docker container, you will need to have
PostgreSQL installed on your local machine.  This is
due to the requirement of setting the data directory
ownership to the postgres user and also you will need
the psql command to test the container.

To install PostgreSQL locally, run the following:
~~~~~~~~~~~~~~~~~~~~~
sudo rpm -Uvh http://yum.postgresql.org/9.4/redhat/rhel-7-x86_64/pgdg-redhat94-9.4-1.noarch.rpm
sudo yum -y install postgresql94-server postgresql94
~~~~~~~~~~~~~~~~~~~~~

Run the container with this command:
~~~~~~~~~~~~~~~~~~~~~
./run-pg.sh
~~~~~~~~~~~~~~~~~~~~~

This script will start up a container named crunchy-pg, it will
create a data directory for the database in /tmp/crunchy-pg-data.

It will initialize the database using the passed in environment
variables, building a user, database, schema, and table based
on the environment variable values.

The script also maps the PostgreSQL port of 5432 in the container
to your local host port of 12000.

Connecting to  PostgreSQL
------------

The container creates a default database called 'testdb', a default
user called 'testuser' with a default password of 'testpsw', you can
use this to connect from your local host as follows:
~~~~~~~~~~~~~~~~~~~~~
psql -h localhost -p 12000 -U testuser -W testdb
~~~~~~~~~~~~~~~~~~~~~

Shutting Down
------------

To shut down the instance, run the following commands:

~~~~~~~~~~~~~~~~~~~~~
docker stop crunchy-pg
~~~~~~~~~~~~~~~~~~~~~

To start the instance, run the following commands:

~~~~~~~~~~~~~~~~~~~~~
docker start crunchy-pg
~~~~~~~~~~~~~~~~~~~~~


text:
package clicommand

import (
	"context"
	"fmt"
	"os"
	"time"

	"github.com/buildkite/agent/v3/api"
	"github.com/buildkite/agent/v3/cliconfig"
	"github.com/buildkite/roko"
	"github.com/urfave/cli"
)

var MetaDataExistsHelpDescription = `Usage:

   buildkite-agent meta-data exists <key> [options...]

Description:

   The command exits with a status of 0 if the key has been set, or it will
   exit with a status of 100 if the key doesn't exist.

Example:

   $ buildkite-agent meta-data exists "foo"`

type MetaDataExistsConfig struct {
	Key string `cli:"arg:0" label:"meta-data key" validate:"required"`
	Job string `cli:"job" validate:"required"`

	// Global flags
	Debug       bool     `cli:"debug"`
	LogLevel    string   `cli:"log-level"`
	NoColor     bool     `cli:"no-color"`
	Experiments []string `cli:"experiment" normalize:"list"`
	Profile     string   `cli:"profile"`

	// API config
	DebugHTTP        bool   `cli:"debug-http"`
	AgentAccessToken string `cli:"agent-access-token" validate:"required"`
	Endpoint         string `cli:"endpoint" validate:"required"`
	NoHTTP2          bool   `cli:"no-http2"`
}

var MetaDataExistsCommand = cli.Command{
	Name:        "exists",
	Usage:       "Check to see if the meta data key exists for a build",
	Description: MetaDataExistsHelpDescription,
	Flags: []cli.Flag{
		cli.StringFlag{
			Name:   "job",
			Value:  "",
			Usage:  "Which job's build should the meta-data be checked for",
			EnvVar: "BUILDKITE_JOB_ID",
		},

		// API Flags
		AgentAccessTokenFlag,
		EndpointFlag,
		NoHTTP2Flag,
		DebugHTTPFlag,

		// Global flags
		NoColorFlag,
		DebugFlag,
		LogLevelFlag,
		ExperimentsFlag,
		ProfileFlag,
	},
	Action: func(c *cli.Context) {
		ctx := context.Background()

		// The configuration will be loaded into this struct
		cfg := MetaDataExistsConfig{}

		loader := cliconfig.Loader{CLI: c, Config: &cfg}
		warnings, err := loader.Load()
		if err != nil {
			fmt.Printf("%s", err)
			os.Exit(1)
		}

		l := CreateLogger(&cfg)

		// Now that we have a logger, log out the warnings that loading config generated
		for _, warning := range warnings {
			l.Warn("%s", warning)
		}

		// Setup any global configuration options
		done := HandleGlobalFlags(l, cfg)
		defer done()

		// Create the API client
		client := api.NewClient(l, loadAPIClientConfig(cfg, `AgentAccessToken`))

		// Find the meta data value
		var exists *api.MetaDataExists
		var resp *api.Response

		err = roko.NewRetrier(
			roko.WithMaxAttempts(10),
			roko.WithStrategy(roko.Constant(5*time.Second)),
		).DoWithContext(ctx, func(r *roko.Retrier) error {
			exists, resp, err = client.ExistsMetaData(ctx, cfg.Job, cfg.Key)
			if resp != nil && (resp.StatusCode == 401 || resp.StatusCode == 404) {
				r.Break()
			}
			if err != nil {
				l.Warn("%s (%s)", err, r)
				return err
			}
			return nil
		})

		if err != nil {
			l.Fatal("Failed to see if meta-data exists: %s", err)
		}

		// If the meta data didn't exist, exit with an error.
		if !exists.Exists {
			os.Exit(100)
		}
	},
}


text:
package org.androidtransfuse.analysis.module;

import org.androidtransfuse.adapter.ASTAnnotation;
import org.androidtransfuse.adapter.ASTType;
import org.androidtransfuse.analysis.repository.InjectionNodeBuilderRepository;

import javax.inject.Inject;
import java.util.Arrays;

/**
 * @author John Ericksen
 */
public class InstallProcessor implements TypeProcessor {

    private final ModuleRepository moduleRepository;

    @Inject
    public InstallProcessor(ModuleRepository moduleRepository) {
        this.moduleRepository = moduleRepository;
    }

    @Override
    public ModuleConfiguration process(ASTType moduleType, ASTType moduleScanTarget, ASTAnnotation installAnnotation) {
        ASTType[] types = installAnnotation.getProperty("value", ASTType[].class);

        return new InstallModuleConfiguration(types);
    }

    private final class InstallModuleConfiguration implements ModuleConfiguration{

        private final ASTType[] types;

        private InstallModuleConfiguration(ASTType[] types) {
            this.types = Arrays.copyOf(types, types.length);
        }

        @Override
        public void setConfiguration(InjectionNodeBuilderRepository configurationRepository) {
            if(types != null && types.length > 0){
                moduleRepository.addInstalledComponents(types);
            }
        }
    }

}


text:
'use strict';

var assert = require('assert');
var testExtract = require('./utils').testExtract;

describe('Extracting plurals', function () {
    it('works on HTML', function () {
        var files = [
            'test/fixtures/plural.html'
        ];
        var catalog = testExtract(files);

        var i = catalog.items;
        assert.equal(i.length, 1);

        assert.equal(i[0].msgid, 'Bird');
        assert.equal(i[0].msgid_plural, 'Birds');
        assert.deepEqual(i[0].msgstr, ['', '']);
    });

    it('merges singular and plural strings', function () {
        var files = [
            'test/fixtures/merge.html'
        ];
        var catalog = testExtract(files);

        var i = catalog.items;
        assert.equal(i.length, 1);

        assert.equal(i[0].msgid, 'Bird');
        assert.equal(i[0].msgid_plural, 'Birds');
        assert.deepEqual(i[0].msgstr, ['', '']);
    });

    it('warns for incompatible plurals', function () {
        var files = [
            'test/fixtures/corrupt.html'
        ];
        assert.throws(function () {
            testExtract(files);
        });
    });
});


text:
cask "syncovery" do
  version "9.29d"
  sha256 "b59eb030f0b9ae1a18ba45acb1491cc656a8cea88c2f4d64e91fe689a6951773"

  url "https://www.syncovery.com/release/SyncoveryMac#{version}.dmg"
  name "Syncovery"
  desc "File synchronization and backup software"
  homepage "https://www.syncovery.com/"

  livecheck do
    url "https://www.syncovery.com/download/mac/"
    strategy :page_match
    regex(%r{href=.*?/SyncoveryMac(\d+(?:\.\d+)*[a-z]?)\.dmg}i)
  end

  pkg "SyncoveryMac (double-click to install).pkg"

  uninstall pkgutil: "com.company.Syncovery*"

  zap trash: "~/Library/Preferences/Syncovery.ini",
      rmdir: [
        "~/Library/Application Support/Syncovery",
        "~/Saved Application State/com.company.Syncovery.savedState",
        "~/Library/Preferences/Syncovery",
        "~/Library/Logs/Syncovery",
      ]
end


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
    JBoss, Home of Professional Open Source
    Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual
    contributors by the @authors tag. See the copyright.txt in the
    distribution for a full listing of individual contributors.

    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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

	<modelVersion>4.0.0</modelVersion>

	<parent>
		<groupId>org.jboss.quickstarts.fuse</groupId>
		<artifactId>camel-quickstarts</artifactId>
		<version>6.2.1.redhat-SNAPSHOT</version>
	</parent>

	<artifactId>camel-sap</artifactId>
	<version>6.2.1.redhat-SNAPSHOT</version>
	<packaging>bundle</packaging>

	<name>JBoss Fuse Quickstart: camel-sap</name>
	<description>SAP Camel Components Example</description>
	<url>https://github.com/jboss-fuse/fuse/tree/master/quickstarts/camel/camel-sap</url>

    <scm>
      <connection>scm:git:git@github.com:jboss-fuse/fuse.git</connection>
      <developerConnection>scm:git:git@github.com:jboss-fuse/fuse.git</developerConnection>
      <url>https://github.com/jboss-fuse/fuse/tree/master/quickstarts/camel/camel-sap</url>
    </scm>

	<licenses>
		<license>
			<name>Apache License, Version 2.0</name>
			<distribution>repo</distribution>
			<url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
		</license>
	</licenses>

	<repositories>
		<repository>
			<id>fuse-public-repository</id>
			<name>FuseSource Community Release Repository</name>
			<url>https://repo.fusesource.com/nexus/content/groups/public</url>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
			<releases>
				<enabled>true</enabled>
				<updatePolicy>never</updatePolicy>
			</releases>
		</repository>
	</repositories>

	<pluginRepositories>
		<pluginRepository>
			<id>fuse-public-repository</id>
			<name>FuseSource Community Release Repository</name>
			<url>https://repo.fusesource.com/nexus/content/groups/public</url>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
			<releases>
				<enabled>true</enabled>
				<updatePolicy>never</updatePolicy>
			</releases>
		</pluginRepository>
	</pluginRepositories>

	<properties>
		<!-- the version of the JBoss Fuse BOM, defining all the dependency versions -->
		<jboss.fuse.bom.version>${project.version}</jboss.fuse.bom.version>
		<fuse.osgi.symbolic.name>org.jboss.quickstarts.fuse.camel-sap</fuse.osgi.symbolic.name>
		<fuse.osgi.bundle.name>JBoss Fuse Quickstart: camel-sap</fuse.osgi.bundle.name>
		<fuse.osgi.import>
			*
		</fuse.osgi.import>
		<fuse.osgi.export>
			org.jboss.quickstarts.fuse.sap;version=${project.version},
			org.jboss.quickstarts.fuse.sap.bean;version=${project.version},
			org.jboss.quickstarts.fuse.sap.jaxb;version=${project.version},
			org.jboss.quickstarts.fuse.sap.processor;version=${project.version}
		</fuse.osgi.export>
		<fuse.osgi.private.pkg>
			org.jboss.quickstarts.fuse.sap.*;-split-package:=merge-first
		</fuse.osgi.private.pkg>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
	</properties>

	<dependencies>
		<dependency>
			<groupId>org.apache.camel</groupId>
			<artifactId>camel-core</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.camel</groupId>
			<artifactId>camel-blueprint</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.camel</groupId>
			<artifactId>camel-jaxb</artifactId>
		</dependency>
		<dependency>
			<groupId>org.fusesource</groupId>
			<artifactId>camel-sap</artifactId>
			<version>${project.version}</version>
		</dependency>

		<!-- logging -->
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-log4j12</artifactId>
		</dependency>
		<dependency>
			<groupId>log4j</groupId>
			<artifactId>log4j</artifactId>
		</dependency>
	</dependencies>

	<build>
		<defaultGoal>install</defaultGoal>
		<resources>
			<resource>
				<directory>src/main/resources</directory>
				<filtering>true</filtering>
			</resource>
			<resource>
				<directory>src/main/fabric8</directory>
				<filtering>true</filtering>
			</resource>
		</resources>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
				<configuration>
					<encoding>UTF-8</encoding>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>
				<extensions>true</extensions>
			</plugin>
		</plugins>
	</build>

</project>


text:
class InitialDatabase < ActiveRecord::Migration
  def up
    create_table :people do |t|
      t.string :name
    end

    create_table :memberships, :id => false do |t|
      t.integer :person_id
      t.integer :group_id
    end

    create_table :groups do |t|
      t.string :name
    end

    create_table :assignments do |t|
      t.integer :assignable_id
      t.integer :assignable_type
      t.integer :role_id
    end

    create_table :roles do |t|
      t.string :name
    end

    create_table :tasks do |t|
      t.string  :name
      t.integer :role_id
      t.integer :owner_id
      t.integer :owner_type

      t.integer :depends_on_task_id
      t.integer :parent_task_id
    end
  end

  def down
    drop_table :people
    drop_table :memberships
    drop_table :groups
    drop_table :assignments
    drop_table :roles
    drop_table :tasks
  end
end


text:
export const modules = [
  require("@magnetjs/next.js").default,
  require("@magnetjs/passport").default,
  require("@magnetjs/pino").default,
  "local_modules/*.js"
];

export default modules;


text:
'use strict';

//Setting up route
angular.module('books').config(['$stateProvider',
	function($stateProvider) {
		// Books state routing
		$stateProvider.
		state('listBooks', {
			url: '/',
			templateUrl: 'modules/books/views/list-books.client.view.html'
		}).
		state('createBook', {
			url: '/create',
			templateUrl: 'modules/books/views/create-book.client.view.html'
		}).
		state('viewBook', {
			url: '/:bookId/view',
			templateUrl: 'modules/books/views/view-book.client.view.html'
		}).
		state('editBook', {
			url: '/:bookId/edit',
			templateUrl: 'modules/books/views/edit-book.client.view.html'
		}).
		state('viewComments', {
			url: '/:bookId/comments'
		}).
		state('comment', {
			url: '/:bookId/comments/:commentId'
		}).
		state('search', {
			url: '/search',
			templateUrl: 'modules/books/views/create-book.client.view.html'
		});
	}
]);


text:
Mobile first

Gobstrap es mobile friendly desde el principio. En vez de añadir estilos especiales para dispositivos móviles, estos están incluídos en su núcleo. Gobstrap es mobile first, lo que significa que se pueden encontrar estilos para dispositivos móviles en toda la librería, en vez de separados en un archivo especial.

Para asegurar la correcta visualización e interacciones, añade el meta tag de viewport a tu <head>.

{% highlight html %}
<meta name="viewport" content="width=device-width, initial-scale=1">
{% endhighlight %}

Puedes desabilitar el zoom en dispositivos móviles añadiendo user-scalable=no al meta tag viewport. Esto hará que los usuarios sólo puedan hacer scroll, resultando en un sitio que se parece más a una aplicación nativa. De todas maneras, no recomendamos esto en todos los sitios, así que procura usarlo con prudencia.

{% highlight html %}
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
{% endhighlight %}


text:
// based on Ivy's PomModuleDescriptorWriter, which is Apache Licensed, Version 2.0
// http://www.apache.org/licenses/LICENSE-2.0

package sbt

import java.io.File

import sbt.mavenint.PomExtraDependencyAttributes

// Node needs to be renamed to XNode because the task subproject contains a Node type that will shadow
// scala.xml.Node when generating aggregated API documentation
import scala.xml.{ Elem, Node => XNode, NodeSeq, PrettyPrinter, PrefixedAttribute }
import Configurations.Optional

import org.apache.ivy.Ivy
import org.apache.ivy.core.settings.IvySettings
import org.apache.ivy.core.module.descriptor.{ DependencyArtifactDescriptor, DependencyDescriptor, License, ModuleDescriptor, ExcludeRule }
import org.apache.ivy.plugins.resolver.{ ChainResolver, DependencyResolver, IBiblioResolver }
import ivyint.CustomRemoteMavenResolver
object MakePom {
  /** True if the revision is an ivy-range, not a complete revision. */
  def isDependencyVersionRange(revision: String): Boolean = {
    (revision endsWith "+") ||
      (revision contains "[") ||
      (revision contains "]") ||
      (revision contains "(") ||
      (revision contains ")")
  }

  /** Converts Ivy revision ranges to that of Maven POM */
  def makeDependencyVersion(revision: String): String = {
    def plusRange(s: String, shift: Int = 0) = {
      def pow(i: Int): Int = if (i > 0) 10 * pow(i - 1) else 1
      val (prefixVersion, lastVersion) = (s + "0" * shift).reverse.split("\\.", 2) match {
        case Array(revLast, revRest) =>
          (revRest.reverse + ".", revLast.reverse)
        case Array(revLast) => ("", revLast.reverse)
      }
      val lastVersionInt = lastVersion.toInt
      s"[${prefixVersion}${lastVersion},${prefixVersion}${lastVersionInt + pow(shift)})"
    }
    val startSym = Set(']', '[', '(')
    val stopSym = Set(']', '[', ')')
    val DotPlusPattern = """(.+)\.\+""".r
    val DotNumPlusPattern = """(.+)\.(\d+)\+""".r
    val NumPlusPattern = """(\d+)\+""".r
    val maxDigit = 5
    try {
      revision match {
        case "+"                           => "[0,)"
        case DotPlusPattern(base)          => plusRange(base)
        // This is a heuristic.  Maven just doesn't support Ivy's notions of 1+, so
        // we assume version ranges never go beyond 5 siginificant digits.
        case NumPlusPattern(tail)          => (0 until maxDigit).map(plusRange(tail, _)).mkString(",")
        case DotNumPlusPattern(base, tail) => (0 until maxDigit).map(plusRange(base + "." + tail, _)).mkString(",")
        case rev if rev endsWith "+"       => sys.error(s"dynamic revision '$rev' cannot be translated to POM")
        case rev if startSym(rev(0)) && stopSym(rev(rev.length - 1)) =>
          val start = rev(0)
          val stop = rev(rev.length - 1)
          val mid = rev.substring(1, rev.length - 1)
          (if (start == ']') "(" else start) + mid + (if (stop == '[') ")" else stop)
        case _ => revision
      }
    } catch {
      case e: NumberFormatException =>
        // TODO - if the version doesn't meet our expectations, maybe we just issue a hard
        //        error instead of softly ignoring the attempt to rewrite.
        //sys.error(s"Could not fix version [$revision] into maven style version")
        revision
    }
  }
}
class MakePom(val log: Logger) {
  import MakePom._
  @deprecated("Use `write(Ivy, ModuleDescriptor, ModuleInfo, Option[Iterable[Configuration]], Set[String], NodeSeq, XNode => XNode, MavenRepository => Boolean, Boolean, File)` instead", "0.11.2")
  def write(ivy: Ivy, module: ModuleDescriptor, moduleInfo: ModuleInfo, configurations: Option[Iterable[Configuration]], extra: NodeSeq, process: XNode => XNode, filterRepositories: MavenRepository => Boolean, allRepositories: Boolean, output: File): Unit =
    write(ivy, module, moduleInfo: ModuleInfo, configurations: Option[Iterable[Configuration]], Set(Artifact.DefaultType), extra, process, filterRepositories, allRepositories, output)
  def write(ivy: Ivy, module: ModuleDescriptor, moduleInfo: ModuleInfo, configurations: Option[Iterable[Configuration]], includeTypes: Set[String], extra: NodeSeq, process: XNode => XNode, filterRepositories: MavenRepository => Boolean, allRepositories: Boolean, output: File): Unit =
    write(process(toPom(ivy, module, moduleInfo, configurations, includeTypes, extra, filterRepositories, allRepositories)), output)
  // use \n as newline because toString uses PrettyPrinter, which hard codes line endings to be \n
  def write(node: XNode, output: File): Unit = write(toString(node), output, "\n")
  def write(xmlString: String, output: File, newline: String) {
    IO.write(output, "<?xml version='1.0' encoding='" + IO.utf8.name + "'?>" + newline + xmlString)
  }

  def toString(node: XNode): String = new PrettyPrinter(1000, 4).format(node)
  @deprecated("Use `toPom(Ivy, ModuleDescriptor, ModuleInfo, Option[Iterable[Configuration]], Set[String], NodeSeq, MavenRepository => Boolean, Boolean)` instead", "0.11.2")
  def toPom(ivy: Ivy, module: ModuleDescriptor, moduleInfo: ModuleInfo, configurations: Option[Iterable[Configuration]], extra: NodeSeq, filterRepositories: MavenRepository => Boolean, allRepositories: Boolean): XNode =
    toPom(ivy, module, moduleInfo, configurations, Set(Artifact.DefaultType), extra, filterRepositories, allRepositories)
  def toPom(ivy: Ivy, module: ModuleDescriptor, moduleInfo: ModuleInfo, configurations: Option[Iterable[Configuration]], includeTypes: Set[String], extra: NodeSeq, filterRepositories: MavenRepository => Boolean, allRepositories: Boolean): XNode =
    (<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
       <modelVersion>4.0.0</modelVersion>
       { makeModuleID(module) }
       <name>{ moduleInfo.nameFormal }</name>
       { makeStartYear(moduleInfo) }
       { makeOrganization(moduleInfo) }
       { makeScmInfo(moduleInfo) }
       { makeDeveloperInfo(moduleInfo) }
       { extra }
       {
         val deps = depsInConfs(module, configurations)
         makeProperties(module, deps) ++
           makeDependencies(deps, includeTypes)
       }
       { makeRepositories(ivy.getSettings, allRepositories, filterRepositories) }
     </project>)

  def makeModuleID(module: ModuleDescriptor): NodeSeq =
    {
      val mrid = moduleDescriptor(module)
      val a: NodeSeq =
        (<groupId>{ mrid.getOrganisation }</groupId>
         <artifactId>{ mrid.getName }</artifactId>
         <packaging>{ packaging(module) }</packaging>)
      val b: NodeSeq =
        ((description(module.getDescription) ++
          homePage(module.getHomePage) ++
          revision(mrid.getRevision) ++
          licenses(module.getLicenses)): NodeSeq)
      a ++ b
    }

  def makeStartYear(moduleInfo: ModuleInfo): NodeSeq =
    moduleInfo.startYear match {
      case Some(y) => <inceptionYear>{ y }</inceptionYear>
      case _       => NodeSeq.Empty
    }
  def makeOrganization(moduleInfo: ModuleInfo): NodeSeq =
    {
      <organization>
        <name>{ moduleInfo.organizationName }</name>
        {
          moduleInfo.organizationHomepage match {
            case Some(h)=> <url>{ h }</url>
            case _ => NodeSeq.Empty
          }
        }
      </organization>
    }
  def makeScmInfo(moduleInfo: ModuleInfo): NodeSeq =
    {
      moduleInfo.scmInfo match {
        case Some(s) =>
          <scm>
            <url>{ s.browseUrl }</url>
            <connection>{ s.connection }</connection>
            {
              s.devConnection match {
                case Some(d)=> <developerConnection>{ d }</developerConnection>
                case _=> NodeSeq.Empty
              }
            }
          </scm>
        case _ => NodeSeq.Empty
      }
    }
  def makeDeveloperInfo(moduleInfo: ModuleInfo): NodeSeq =
    {
      if (moduleInfo.developers.nonEmpty) {
        <developers>
          {
            moduleInfo.developers.map { developer: Developer =>
              <developer>
                <id>{ developer.id }</id>
                <name>{ developer.name }</name>
                <email>{ developer.email }</email>
                <url>{ developer.url }</url>
              </developer>
            }
          }
        </developers>
      } else NodeSeq.Empty
    }
  def makeProperties(module: ModuleDescriptor, dependencies: Seq[DependencyDescriptor]): NodeSeq =
    {
      val extra = IvySbt.getExtraAttributes(module)
      val depExtra = PomExtraDependencyAttributes.writeDependencyExtra(dependencies).mkString("\n")
      val allExtra = if (depExtra.isEmpty) extra else extra.updated(PomExtraDependencyAttributes.ExtraAttributesKey, depExtra)
      if (allExtra.isEmpty) NodeSeq.Empty else makeProperties(allExtra)
    }
  def makeProperties(extra: Map[String, String]): NodeSeq = {
    def _extraAttributes(k: String) = if (k == PomExtraDependencyAttributes.ExtraAttributesKey) xmlSpacePreserve else scala.xml.Null
    <properties> {
      for ((key, value) <- extra) yield (<x>{ value }</x>).copy(label = key, attributes = _extraAttributes(key))
    } </properties>
  }

  /**
   * Attribute tag that PrettyPrinter won't ignore, saying "don't mess with my spaces"
   * Without this, PrettyPrinter will flatten multiple entries for ExtraDependencyAttributes and make them
   * unparseable. (e.g. a plugin that depends on multiple plugins will fail)
   */
  def xmlSpacePreserve = new PrefixedAttribute("xml", "space", "preserve", scala.xml.Null)

  def description(d: String) = if ((d eq null) || d.isEmpty) NodeSeq.Empty else <description>{ d }</description>
  def licenses(ls: Array[License]) = if (ls == null || ls.isEmpty) NodeSeq.Empty else <licenses>{ ls.map(license) }</licenses>
  def license(l: License) =
    <license>
      <name>{ l.getName }</name>
      <url>{ l.getUrl }</url>
      <distribution>repo</distribution>
    </license>
  def homePage(homePage: String) = if (homePage eq null) NodeSeq.Empty else <url>{ homePage }</url>
  def revision(version: String) = if (version ne null) <version>{ version }</version> else NodeSeq.Empty
  def packaging(module: ModuleDescriptor) =
    module.getAllArtifacts match {
      case Array()  => "pom"
      case Array(x) => x.getType
      case xs =>
        val types = xs.map(_.getType).toList.filterNot(IgnoreTypes)
        types match {
          case Nil                                     => Artifact.PomType
          case xs if xs.contains(Artifact.DefaultType) => Artifact.DefaultType
          case x :: xs                                 => x
        }
    }
  val IgnoreTypes: Set[String] = Set(Artifact.SourceType, Artifact.DocType, Artifact.PomType)

  def makeDependencies(dependencies: Seq[DependencyDescriptor], includeTypes: Set[String]): NodeSeq =
    if (dependencies.isEmpty)
      NodeSeq.Empty
    else
      <dependencies>
        { dependencies.map(makeDependency(_, includeTypes)) }
      </dependencies>

  def makeDependency(dependency: DependencyDescriptor, includeTypes: Set[String]): NodeSeq =
    {
      val artifacts = dependency.getAllDependencyArtifacts
      val includeArtifacts = artifacts.filter(d => includeTypes(d.getType))
      if (artifacts.isEmpty) {
        val (scope, optional) = getScopeAndOptional(dependency.getModuleConfigurations)
        makeDependencyElem(dependency, scope, optional, None, None)
      } else if (includeArtifacts.isEmpty)
        NodeSeq.Empty
      else
        NodeSeq.fromSeq(artifacts.map(a => makeDependencyElem(dependency, a)))
    }

  def makeDependencyElem(dependency: DependencyDescriptor, artifact: DependencyArtifactDescriptor): Elem =
    {
      val configs = artifact.getConfigurations.toList match {
        case Nil | "*" :: Nil => dependency.getModuleConfigurations
        case x                => x.toArray
      }
      val (scope, optional) = getScopeAndOptional(configs)
      val classifier = artifactClassifier(artifact)
      val baseType = artifactType(artifact)
      val tpe = (classifier, baseType) match {
        case (Some(c), Some(tpe)) if Artifact.classifierType(c) == tpe => None
        case _ => baseType
      }
      makeDependencyElem(dependency, scope, optional, classifier, tpe)
    }
  def makeDependencyElem(dependency: DependencyDescriptor, scope: Option[String], optional: Boolean, classifier: Option[String], tpe: Option[String]): Elem =
    {
      val mrid = dependency.getDependencyRevisionId
      <dependency>
        <groupId>{ mrid.getOrganisation }</groupId>
        <artifactId>{ mrid.getName }</artifactId>
        <version>{ makeDependencyVersion(mrid.getRevision) }</version>
        { scopeElem(scope) }
        { optionalElem(optional) }
        { classifierElem(classifier) }
        { typeElem(tpe) }
        { exclusions(dependency) }
      </dependency>
    }

  @deprecated("No longer used and will be removed.", "0.12.1")
  def classifier(dependency: DependencyDescriptor, includeTypes: Set[String]): NodeSeq =
    {
      val jarDep = dependency.getAllDependencyArtifacts.find(d => includeTypes(d.getType))
      jarDep match {
        case Some(a) => classifierElem(artifactClassifier(a))
        case None    => NodeSeq.Empty
      }
    }
  def artifactType(artifact: DependencyArtifactDescriptor): Option[String] =
    Option(artifact.getType).flatMap { tpe => if (tpe == "jar") None else Some(tpe) }
  def typeElem(tpe: Option[String]): NodeSeq =
    tpe match {
      case Some(t) => <type>{ t }</type>
      case None    => NodeSeq.Empty
    }

  def artifactClassifier(artifact: DependencyArtifactDescriptor): Option[String] =
    Option(artifact.getExtraAttribute("classifier"))
  def classifierElem(classifier: Option[String]): NodeSeq =
    classifier match {
      case Some(c) => <classifier>{ c }</classifier>
      case None    => NodeSeq.Empty
    }

  @deprecated("No longer used and will be removed.", "0.12.1")
  def scopeAndOptional(dependency: DependencyDescriptor): NodeSeq =
    {
      val (scope, opt) = getScopeAndOptional(dependency.getModuleConfigurations)
      scopeElem(scope) ++ optionalElem(opt)
    }
  def scopeElem(scope: Option[String]): NodeSeq = scope match {
    case None | Some(Configurations.Compile.name) => NodeSeq.Empty
    case Some(s)                                  => <scope>{ s }</scope>
  }
  def optionalElem(opt: Boolean) = if (opt) <optional>true</optional> else NodeSeq.Empty
  def moduleDescriptor(module: ModuleDescriptor) = module.getModuleRevisionId

  def getScopeAndOptional(confs: Array[String]): (Option[String], Boolean) =
    {
      val (opt, notOptional) = confs.partition(_ == Optional.name)
      val defaultNotOptional = Configurations.defaultMavenConfigurations.find(notOptional contains _.name)
      val scope = defaultNotOptional.map(_.name)
      (scope, opt.nonEmpty)
    }

  def exclusions(dependency: DependencyDescriptor): NodeSeq =
    {
      val excl = dependency.getExcludeRules(dependency.getModuleConfigurations)
      val (warns, excls) = IvyUtil.separate(excl.map(makeExclusion))
      if (warns.nonEmpty) log.warn(warns.mkString(IO.Newline))
      if (excls.nonEmpty) <exclusions>{ excls }</exclusions>
      else NodeSeq.Empty
    }
  def makeExclusion(exclRule: ExcludeRule): Either[String, NodeSeq] =
    {
      val m = exclRule.getId.getModuleId
      val (g, a) = (m.getOrganisation, m.getName)
      if (g == null || g.isEmpty || g == "*" || a.isEmpty || a == "*")
        Left("Skipped generating '<exclusion/>' for %s. Dependency exclusion should have both 'org' and 'module' to comply with Maven POM's schema.".format(m))
      else
        Right(
          <exclusion>
            <groupId>{ g }</groupId>
            <artifactId>{ a }</artifactId>
          </exclusion>
        )
    }

  def makeRepositories(settings: IvySettings, includeAll: Boolean, filterRepositories: MavenRepository => Boolean) =
    {
      class MavenRepo(name: String, snapshots: Boolean, releases: Boolean)
      val repositories = if (includeAll) allResolvers(settings) else resolvers(settings.getDefaultResolver)
      val mavenRepositories =
        repositories.flatMap {
          // TODO - Would it be ok if bintray were in the pom?   We should avoid it for now.
          case m: CustomRemoteMavenResolver if m.repo.root == JCenterRepository.root         => Nil
          case m: IBiblioResolver if m.isM2compatible && m.getRoot == JCenterRepository.root => Nil
          case m: CustomRemoteMavenResolver if m.repo.root != DefaultMavenRepository.root =>
            MavenRepository(m.repo.name, m.repo.root) :: Nil
          case m: IBiblioResolver if m.isM2compatible && m.getRoot != DefaultMavenRepository.root =>
            MavenRepository(m.getName, m.getRoot) :: Nil
          case _ => Nil
        }
      val repositoryElements = mavenRepositories.filter(filterRepositories).map(mavenRepository)
      if (repositoryElements.isEmpty) repositoryElements else <repositories>{ repositoryElements }</repositories>
    }
  def allResolvers(settings: IvySettings): Seq[DependencyResolver] = flatten(castResolvers(settings.getResolvers)).distinct
  def flatten(rs: Seq[DependencyResolver]): Seq[DependencyResolver] = if (rs eq null) Nil else rs.flatMap(resolvers)
  def resolvers(r: DependencyResolver): Seq[DependencyResolver] =
    r match { case c: ChainResolver => flatten(castResolvers(c.getResolvers)); case _ => r :: Nil }

  // cast the contents of a pre-generics collection
  private def castResolvers(s: java.util.Collection[_]): Seq[DependencyResolver] =
    s.toArray.map(_.asInstanceOf[DependencyResolver])

  def toID(name: String) = checkID(name.filter(isValidIDCharacter).mkString, name)
  def isValidIDCharacter(c: Char) = c.isLetterOrDigit
  private def checkID(id: String, name: String) = if (id.isEmpty) sys.error("Could not convert '" + name + "' to an ID") else id
  def mavenRepository(repo: MavenRepository): XNode =
    mavenRepository(toID(repo.name), repo.name, repo.root)
  def mavenRepository(id: String, name: String, root: String): XNode =
    <repository>
      <id>{ id }</id>
      <name>{ name }</name>
      <url>{ root }</url>
      <layout>{ if (name == JavaNet1Repository.name) "legacy" else "default" }</layout>
    </repository>

  /**
   * Retain dependencies only with the configurations given, or all public configurations of `module` if `configurations` is None.
   * This currently only preserves the information required by makePom
   */
  private def depsInConfs(module: ModuleDescriptor, configurations: Option[Iterable[Configuration]]): Seq[DependencyDescriptor] =
    {
      val keepConfigurations = IvySbt.getConfigurations(module, configurations)
      val keepSet = Set(keepConfigurations.toSeq: _*)
      def translate(dependency: DependencyDescriptor) =
        {
          val keep = dependency.getModuleConfigurations.filter(keepSet.contains)
          if (keep.isEmpty)
            None
          else // TODO: translate the dependency to contain only configurations to keep
            Some(dependency)
        }
      module.getDependencies flatMap translate
    }
}


text:
#ifndef __ASM_ARM_MACH_IRQ_H
#define __ASM_ARM_MACH_IRQ_H

#include <linux/irq.h>

struct seq_file;

/*
 * This is internal.  Do not use it.
 */
extern void (*init_arch_irq)(void);
extern void init_FIQ(void);
extern int show_fiq_list(struct seq_file *, void *);

/*
 * Obsolete inline function for calling irq descriptor handlers.
 */
static inline void desc_handle_irq(unsigned int irq, struct irq_desc *desc)
{
	desc->handle_irq(irq, desc);
}

void set_irq_flags(unsigned int irq, unsigned int flags);

#define IRQF_VALID	(1 << 0)
#define IRQF_PROBE	(1 << 1)
#define IRQF_NOAUTOEN	(1 << 2)

/*
 * This is for easy migration, but should be changed in the source
 */
#define do_bad_IRQ(irq,desc)				\
do {							\
	spin_lock(&desc->lock);				\
	handle_bad_irq(irq, desc);			\
	spin_unlock(&desc->lock);			\
} while(0)

extern unsigned long irq_err_count;
static inline void ack_bad_irq(int irq)
{
	irq_err_count++;
}

#endif


text:
package ru.amenshikov;

import org.junit.Test;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.*;

public class MaxTest {
	@Test
	public void whenFirstGreaterThenSecondThenSecond() {
        Max maximum = new Max();
        assertThat(maximum.max(2,1), is(2));
    }
	@Test
	public void whenFirstLowerThenSecondThenSecond() {
        Max maximum = new Max();
        assertThat(maximum.max(1,2), is(2));
    }
}


text:
//
// The MIT License(MIT)
//
// Copyright(c) 2014 Demonsaw LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

namespace DemonSaw.IO
{
	using DemonSaw.Utility;
	using Microsoft.Win32;
	using System;
	using System.Collections.Generic;
	using System.Drawing;
	using System.IO;
	using System.Reflection;
	using System.Runtime.InteropServices;
	using System.Text;
	using System.Windows.Media.Imaging;

	public static class FileUtil
	{
		#region Natives
		private const int SHGFI_ICON = 0x00100;     // get icon
		private const int SHGFI_DISPLAYNAME = 0x00200;     // get display name
		private const int SHGFI_TYPENAME = 0x00400;     // get type name
		private const int SHGFI_ATTRIBUTES = 0x00800;     // get attributes
		private const int SHGFI_ICONLOCATION = 0x01000;     // get icon location
		private const int SHGFI_EXETYPE = 0x02000;     // return exe type
		private const int SHGFI_SYSICONINDEX = 0x04000;     // get system icon index
		private const int SHGFI_LINKOVERLAY = 0x08000;     // put a link overlay on icon
		private const int SHGFI_SELECTED = 0x10000;     // show icon in selected state
		private const int SHGFI_ATTR_SPECIFIED = 0x20000;     // get only specified attributes
		private const int SHGFI_LARGEICON = 0x00000;     // get large icon
		private const int SHGFI_SMALLICON = 0x00001;     // get small icon
		private const int SHGFI_OPENICON = 0x00002;     // get open icon
		private const int SHGFI_SHELLICONSIZE = 0x00004;     // get shell size icon
		private const int SHGFI_PIDL = 0x00008;     // pszPath is a pidl
		private const int SHGFI_USEFILEATTRIBUTES = 0x00010;     // use passed dwFileAttribute
		//if (_WIN32_IE >= 0x0500)
		private const int SHGFI_ADDOVERLAYS = 0x00020;     // apply the appropriate overlays
		private const int SHGFI_OVERLAYINDEX = 0x00040;     // Get the index of the overlay

		private const int FILE_ATTRIBUTE_NORMAL = 0x00080;     // Normal file
		private const int FILE_ATTRIBUTE_DIRECTORY = 0x00010;     // Directory

		private const int MAX_PATH = 260;

		[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
		private struct SHFILEINFO
		{
			public IntPtr hIcon;
			public int iIcon;
			public int dwAttributes;
			[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MAX_PATH)]
			public string szDisplayName;
			[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 80)]
			public string szTypeName;
		}

		private const int SW_SHOWNORMAL = 1;

		[DllImport("shell32.dll", CharSet = CharSet.Auto)]
		private static extern IntPtr ShellExecute(int hwnd, string lpOperation, string lpFile,
			string lpParameters, string lpDirectory, int nShowCmd);

		[DllImport("shell32.dll", CharSet = CharSet.Auto)]
		private static extern IntPtr SHGetFileInfo(string pszPath, int dwFileAttributes,
			out SHFILEINFO psfi, int cbFileInfo, int uFlags);
		#endregion

		#region variables
		private static Dictionary<string, BitmapImage> _images = new Dictionary<string, BitmapImage>();
		#endregion

		// Utility
		public static void Create(string path, long size = 0)
		{
			using (FileStream stream = new FileStream(path, FileMode.OpenOrCreate, FileAccess.Write, FileShare.ReadWrite))
			{
				stream.SetLength(size);
				stream.Close();
			}
		}

		public static void Delete(string path)
		{
			File.Delete(path);
		}

		public static bool Exists(string path)
		{
			return File.Exists(path);
		}

		public static bool Valid(string path)
		{
			try
			{
				using (FileStream stream = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
				{
					using (BinaryReader reader = new BinaryReader(stream))
					{
						reader.ReadByte();
						reader.Close();
					}

					stream.Close();
					return true;
				}
			}
			catch (System.Exception ex)
			{
				Console.WriteLine(ex.Message);
				return false;
			}
		}

		public static byte[] Read(string path, long size = 0, long offset = 0)
		{
			byte[] data = null;

			using (FileStream stream = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
			{
				if (offset > 0)
					stream.Seek(offset, SeekOrigin.Begin);

				using (BinaryReader reader = new BinaryReader(stream))
				{
					long length = stream.Length;
					size = (size > 0) ? Math.Min(size, length - offset) : length;
					data = reader.ReadBytes((int) size);
					reader.Close();
				}

				stream.Close();
			}

			return data;
		}

		public static Image ReadImage(string path)
		{
			Image image = Default.NoImageEmbedded;

			try
			{
				using (MemoryStream stream = new MemoryStream(File.ReadAllBytes(path)))
				{
					image = Image.FromStream(stream);
					stream.Close();
				}
			}
			catch (Exception ex)
			{
				Console.WriteLine(ex.Message);
			}

			return image;
		}

		public static BitmapImage ReadBitmap(string path)
		{
			try
			{
				if (Exists(path))
				{
					BitmapImage image = new BitmapImage();
					image.BeginInit();
					image.UriSource = new Uri(path);
					image.CacheOption = BitmapCacheOption.OnLoad;
					image.EndInit();
					return image;
				}
			}
			catch (Exception ex)
			{
				Console.WriteLine(ex.Message);
			}

			return null;
		}

		public static void Write(string path, string data, long offset = 0) { Write(path, Encoding.ASCII.GetBytes(data), offset); }
		public static void Write(string path, byte[] data, long offset = 0)
		{
			using (FileStream stream = new FileStream(path, FileMode.OpenOrCreate, FileAccess.Write, FileShare.ReadWrite))
			{
				stream.Seek(offset, SeekOrigin.Begin);

				using (BinaryWriter writer = new BinaryWriter(stream))
				{
					writer.Write(data);
					writer.Close();
				}

				stream.Close();
			}
		}

		public static void Append(string path, string data) { Append(path, Encoding.ASCII.GetBytes(data)); }
		public static void Append(string path, byte[] data)
		{
			using (FileStream stream = new FileStream(path, FileMode.Append, FileAccess.Write, FileShare.ReadWrite))
			{
				using (BinaryWriter writer = new BinaryWriter(stream))
				{
					writer.Write(data);
					writer.Close();
				}

				stream.Close();
			}
		}

		public static void Clear(string path)
		{
			using (FileStream stream = new FileStream(path, FileMode.Open, FileAccess.Write, FileShare.ReadWrite))
			{
				stream.SetLength(0);
				stream.Close();
			}
		}

		// Accessors
		public static string GetSize(long size)
		{
			if (size == Default.Size)
				return null;

			int[] limits = new int[] { 1024 * 1024 * 1024, 1024 * 1024, 1024 };
			string[] units = new string[] { "GB", "MB", "KB" };

			for (int i = 0; i < limits.Length; i++)
			{
				if (size >= limits[i])
					return string.Format("{0:#,##0.00} " + units[i], ((double) size / limits[i]));
			}

			return string.Format("{0} bytes", size);
		}

		public static string GetSpeed(long size)
		{
			if (size == 0)
				return "0 KB/sec";

			int[] limits = new int[] { 1000 * 1000 * 1000, 1000 * 1000, 1000 };
			string[] units = new string[] { "GB/s", "MB/s", "KB/s" };

			for (int i = 0; i < limits.Length; i++)
			{
				if (size >= limits[i])
					return string.Format("{0:#,##0.00} " + units[i], ((double) size / limits[i]));
			}

			return "0 KB/sec";
		}

		public static String GetDescription(string path)
		{
			SHFILEINFO shfi = new SHFILEINFO();
			int flags = SHGFI_TYPENAME | SHGFI_USEFILEATTRIBUTES;
			IntPtr result = SHGetFileInfo(path, 0, out shfi, Marshal.SizeOf(shfi), flags);
			if (result.ToInt32() == 0)
				return String.Empty;
			else
				return shfi.szTypeName;
		}

		public static Image GetAssemblyImage(string name)
		{
			//string[] names = GetType().Assembly.GetManifestResourceNames();
			//foreach (string name in names)
			//	System.Console.WriteLine(name);
			//
			Assembly asm = Assembly.GetExecutingAssembly();
			using (Stream resStream = asm.GetManifestResourceStream(string.Format("DemonSaw.Resources.{0}", name)))
				return new Bitmap(resStream);
		}

		public static BitmapImage GetResourceBitmap(string name, string folder = null)
		{
			string path = (folder != null) ? Path.Combine(folder, name) : name;
			path = string.Format("pack://application:,,/Resources/{0}", path);

			BitmapImage image = new BitmapImage();
			image.BeginInit();
			image.UriSource = new Uri(path);
			image.CacheOption = BitmapCacheOption.OnLoad;
			image.EndInit();
			return image;
		}

		public static Icon GetFolderIcon(string path)
		{
			int flags = SHGFI_ICON | SHGFI_SMALLICON | SHGFI_USEFILEATTRIBUTES;
			int fileAttributes = FILE_ATTRIBUTE_DIRECTORY;

			SHFILEINFO shfi = new SHFILEINFO();
			IntPtr result = SHGetFileInfo(path, fileAttributes, out shfi, Marshal.SizeOf(shfi), flags);
			if (result.ToInt32() == 0)
				return null;
			else
				return Icon.FromHandle(shfi.hIcon);
		}

		public static BitmapImage GetFolderBitmap(string path)
		{
			Icon icon = GetFolderIcon(path);
			return IconToBitmap(icon);
		}

		public static Icon GetFileIcon(string path)
		{
			int flags = SHGFI_ICON | SHGFI_SMALLICON | SHGFI_USEFILEATTRIBUTES;
			int fileAttributes = FILE_ATTRIBUTE_NORMAL;

			SHFILEINFO shfi = new SHFILEINFO();
			IntPtr result = SHGetFileInfo(path, fileAttributes, out shfi, Marshal.SizeOf(shfi), flags);
			if (result.ToInt32() == 0)
				return null;
			else
				return Icon.FromHandle(shfi.hIcon);
		}

		public static BitmapImage GetFileBitmap(string path, string ext = null)
		{
			if (ext == null)
				ext = Path.GetExtension(path);

			BitmapImage image;
			if (!_images.TryGetValue(ext, out image))
			{
				Icon icon = GetFileIcon(path);
				image = IconToBitmap(icon);
				_images.Add(ext, image);
			}

			return image;
		}

		public static Icon GetIcon(string path, bool isSmallImage = true, bool useFileType = true)
		{
			int flags = SHGFI_ICON;
			if (isSmallImage)
				flags |= SHGFI_SMALLICON;

			int fileAttributes = 0;
			if (useFileType)
			{
				flags |= SHGFI_USEFILEATTRIBUTES;

				try
				{
					if (Directory.Exists(path))
						fileAttributes = FILE_ATTRIBUTE_DIRECTORY;
					else
						fileAttributes = FILE_ATTRIBUTE_NORMAL;
				}
				catch (Exception ex)
				{
					Console.WriteLine(ex.Message);
					fileAttributes = FILE_ATTRIBUTE_NORMAL;
				}
			}

			SHFILEINFO shfi = new SHFILEINFO();
			IntPtr result = SHGetFileInfo(path, fileAttributes, out shfi, Marshal.SizeOf(shfi), flags);
			if (result.ToInt32() == 0)
				return null;
			else
				return Icon.FromHandle(shfi.hIcon);
		}

		public static BitmapImage GetIconBitmap(string path, bool isSmallImage = true, bool useFileType = true)
		{
			Icon icon = GetIcon(path, isSmallImage, useFileType);
			return IconToBitmap(icon);
		}

		private static BitmapImage IconToBitmap(Icon icon)
		{
			if (icon == null)
				return null;

			Bitmap bitmap = icon.ToBitmap();
			MemoryStream stream = new MemoryStream();
			bitmap.Save(stream, System.Drawing.Imaging.ImageFormat.Png);

			BitmapImage image = new BitmapImage();
			image.BeginInit();
			image.CacheOption = BitmapCacheOption.OnLoad;
			stream.Seek(0, SeekOrigin.Begin);
			image.StreamSource = stream;
			image.EndInit();

			return image;
		}

		//  Programs
		private static string TryGetRegisteredApplication(string extension)
		{
			string ext = GetClassesRootKeyDefaultValue(extension);
			if (ext == null)
				return null;

			string openCommand = GetClassesRootKeyDefaultValue(Path.Combine(new[] { ext, "shell", "open", "command" }));

			if (openCommand == null)
				return null;

			return openCommand.Replace("%1", string.Empty).Replace("\"", string.Empty).Trim();
		}

		private static string GetClassesRootKeyDefaultValue(string keyPath)
		{
			using (var key = Registry.ClassesRoot.OpenSubKey(keyPath))
			{
				if (key == null)
				{
					return null;
				}

				var defaultValue = key.GetValue(null);
				if (defaultValue == null)
				{
					return null;
				}

				return defaultValue.ToString();
			}
		}

		public static void Execute(string path, string operation = "open")
		{
			Win32.ShellExecute(0, operation, path, "", "", SW_SHOWNORMAL);
		}

		public static void Execute(List<string> items, string operation = "open")
		{
			if (items.Count == 0)
				return;

			foreach (string item in items)
			{
				string ext = Path.GetExtension(item);
				string program = TryGetRegisteredApplication(ext);
				if (program == null)
					continue;

				StringBuilder builder = new StringBuilder();
				List<string> param = new List<string>();
				string path;

				int pos = program.IndexOf('.') + 1;
				pos = program.IndexOf(' ', pos);

				if (pos == -1)
				{
					path = program;
				}
				else
				{
					path = program.Substring(0, pos);
					string suffix = program.Substring(pos + 1);
					builder.Append("\"").Append(suffix).Append("\"");
				}

				builder.Append(" \"").Append(item).Append("\"");

				IntPtr ptr = Win32.ShellExecute(0, operation, path, builder.ToString(), "", SW_SHOWNORMAL);
				if (ptr.ToInt32() < 32)
					Win32.ShellExecute(0, operation, path, "", "", SW_SHOWNORMAL);
			}

			// Determine mapping
			//Dictionary<string, List<string>> map = new Dictionary<string, List<string>>();

			//foreach (string item in items)
			//{
			//	string ext = Path.GetExtension(item);
			//	string program = TryGetRegisteredApplication(ext);
			//	if (program == null)
			//		continue;

			//	List<string> param;
			//	if (!map.TryGetValue(program, out param))
			//	{
			//		param = new List<string>();
			//		map[program] = param;
			//	}

			//	param.Add(item);
			//}

			//// Execute each unique
			//foreach (string program in map.Keys)
			//{
			//	if (program == null)
			//		continue;

			//	StringBuilder builder = new StringBuilder();
			//	List<string> param = map[program];
			//	string path;

			//	int pos = program.IndexOf('.') + 1;
			//	pos = program.IndexOf(' ', pos);

			//	if (pos == -1)
			//	{
			//		path = program;
			//	}
			//	else
			//	{
			//		path = program.Substring(0, pos);
			//		string suffix = program.Substring(pos + 1);
			//		builder.Append("\"").Append(suffix).Append("\"");
			//	}

			//	foreach (string item in param)
			//		builder.Append(" \"").Append(item).Append("\"");

			//	IntPtr ptr = Win32.ShellExecute(0, operation, path, builder.ToString(), "", SW_SHOWNORMAL);
			//	if (ptr.ToInt32() < 32)
			//		Win32.ShellExecute(0, operation, path, "", "", SW_SHOWNORMAL);
			//}
		}

		// Folders
		public static string GetExecutableFolder()
		{
			return Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
		}

		public static string GetDownloadFolder()
		{
			return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Downloads");
		}
	}
}


text:
<?php

class Google_Service_PolyService_Asset extends Google_Collection
{
  protected $collection_key = 'formats';
  public $authorName;
  public $createTime;
  public $description;
  public $displayName;
  protected $formatsType = 'Google_Service_PolyService_Format';
  protected $formatsDataType = 'array';
  public $isCurated;
  public $license;
  public $name;
  protected $presentationParamsType = 'Google_Service_PolyService_PresentationParams';
  protected $presentationParamsDataType = '';
  protected $thumbnailType = 'Google_Service_PolyService_PolyFile';
  protected $thumbnailDataType = '';
  public $updateTime;
  public $visibility;

  public function setAuthorName($authorName)
  {
    $this->authorName = $authorName;
  }
  public function getAuthorName()
  {
    return $this->authorName;
  }
  public function setCreateTime($createTime)
  {
    $this->createTime = $createTime;
  }
  public function getCreateTime()
  {
    return $this->createTime;
  }
  public function setDescription($description)
  {
    $this->description = $description;
  }
  public function getDescription()
  {
    return $this->description;
  }
  public function setDisplayName($displayName)
  {
    $this->displayName = $displayName;
  }
  public function getDisplayName()
  {
    return $this->displayName;
  }
  /**
   * @param Google_Service_PolyService_Format
   */
  public function setFormats($formats)
  {
    $this->formats = $formats;
  }
  /**
   * @return Google_Service_PolyService_Format
   */
  public function getFormats()
  {
    return $this->formats;
  }
  public function setIsCurated($isCurated)
  {
    $this->isCurated = $isCurated;
  }
  public function getIsCurated()
  {
    return $this->isCurated;
  }
  public function setLicense($license)
  {
    $this->license = $license;
  }
  public function getLicense()
  {
    return $this->license;
  }
  public function setName($name)
  {
    $this->name = $name;
  }
  public function getName()
  {
    return $this->name;
  }
  /**
   * @param Google_Service_PolyService_PresentationParams
   */
  public function setPresentationParams(Google_Service_PolyService_PresentationParams $presentationParams)
  {
    $this->presentationParams = $presentationParams;
  }
  /**
   * @return Google_Service_PolyService_PresentationParams
   */
  public function getPresentationParams()
  {
    return $this->presentationParams;
  }
  /**
   * @param Google_Service_PolyService_PolyFile
   */
  public function setThumbnail(Google_Service_PolyService_PolyFile $thumbnail)
  {
    $this->thumbnail = $thumbnail;
  }
  /**
   * @return Google_Service_PolyService_PolyFile
   */
  public function getThumbnail()
  {
    return $this->thumbnail;
  }
  public function setUpdateTime($updateTime)
  {
    $this->updateTime = $updateTime;
  }
  public function getUpdateTime()
  {
    return $this->updateTime;
  }
  public function setVisibility($visibility)
  {
    $this->visibility = $visibility;
  }
  public function getVisibility()
  {
    return $this->visibility;
  }
}


text: I announce an update of the mine field.


text:
package disk

import "syscall"

func Usage(path string) (*UsageStat, error) {
	stat := syscall.Statfs_t{}
	err := syscall.Statfs(path, &stat)
	if err != nil {
		return nil, err
	}
	bsize := stat.Bsize

	ret := &UsageStat{
		Path:        path,
		Fstype:      getFsType(stat),
		Total:       (uint64(stat.Blocks) * uint64(bsize)),
		Free:        (uint64(stat.Bavail) * uint64(bsize)),
		InodesTotal: (uint64(stat.Files)),
		InodesFree:  (uint64(stat.Ffree)),
	}

	// if could not get InodesTotal, return empty
	if ret.InodesTotal < ret.InodesFree {
		return ret, nil
	}

	ret.InodesUsed = (ret.InodesTotal - ret.InodesFree)
	ret.Used = (uint64(stat.Blocks) - uint64(stat.Bfree)) * uint64(bsize)

	if ret.InodesTotal == 0 {
		ret.InodesUsedPercent = 0
	} else {
		ret.InodesUsedPercent = (float64(ret.InodesUsed) / float64(ret.InodesTotal)) * 100.0
	}

	if ret.Total == 0 {
		ret.UsedPercent = 0
	} else {
		ret.UsedPercent = (float64(ret.Used) / float64(ret.Total)) * 100.0
	}

	return ret, nil
}


text:
/*global Quintus:false */

/*global Quintus:false */
/**
Quintus HTML5 Game Engine - TMX Loader module

Module responsible for loading Tiled TMX files

@module Quintus.Input
*/

/**
 * Quintus TMX Loading module
 *
 * @class Quintus.TMX
 */
Quintus.TMX = function(Q) {

 // Add TMX file loading support to Quintus
 Q.assetTypes['tmx'] = 'TMX';

 // Load a TMX file as a parsed XML DOM
 Q.loadAssetTMX =  function(key,src,callback,errorCallback) {

   // Piggyback on loadAssetOther's AJAX call
   Q.loadAssetOther(key,src,function(key,responseText) {
     var parser = new DOMParser();
     var doc = parser.parseFromString(responseText, "application/xml");
     // save the asset as the parsed doc
     callback(key,doc);
   }, errorCallback);

 };

 Q._tmxExtractAssetName = function(result) {
   var source = result.getAttribute("source"),
   sourceParts = source.split("/");
   // only return the last part of the asset string
   return sourceParts[sourceParts.length - 1];
 };

 Q._tmxExtractSources = function(asset) {
   var results = asset.querySelectorAll("[source]");
   return Q._map(results,Q._tmxExtractAssetName);

 };

 Q.loadTMX = function(files,callback,options) {
   if(Q._isString(files)) {
     files = Q._normalizeArg(files);
   }

   var tmxFiles = [];
   Q._each(files,function(file) {
     if(Q._fileExtension(file) === 'tmx') {
        tmxFiles.push(file);
     }
   });

   var additionalAssets = [];

   Q.load(files,function() {
     Q._each(tmxFiles,function(tmxFile) {
       var sources = Q._tmxExtractSources(Q.asset(tmxFile));
       additionalAssets = additionalAssets.concat(sources);
     });

     if(additionalAssets.length > 0) {
       Q.load(additionalAssets,callback,options);
     } else {
       callback();
     }
   });

 };

 function attr(elem,atr) {
   var value = elem.getAttribute(atr);
   return isNaN(value) ? value : +value;
 }

 function parseProperties(elem) {
   var propElems = elem.querySelectorAll("property"),
       props = {};

   for(var i = 0; i < propElems.length; i++) {
     var propElem = propElems[i];
     props[attr(propElem,'name')] = attr(propElem,'value');
   }
   return props;
 }

 Q._tmxLoadTilesets = function(tilesets, tileProperties) {
   var gidMap = [];

   function parsePoint(pt) {
     var pts = pt.split(",");
     return [ parseFloat(pts[0]), parseFloat(pts[1]) ];
   }

   for(var t = 0; t < tilesets.length;t++) {
     var tileset = tilesets[t],
         sheetName = attr(tileset,"name"),
         gid = attr(tileset,"firstgid"),
         assetName = Q._tmxExtractAssetName(tileset.querySelector("image")),
         tilesetTileProps = {},
         tilesetProps = { tileW: attr(tileset,"tilewidth"),
                          tileH: attr(tileset,"tileheight"),
                          spacingX: attr(tileset,"spacing"),
                          spacingY: attr(tileset,"spacing")
                        };

     var tiles = tileset.querySelectorAll("tile");
     for(var i = 0;i < tiles.length;i++) {
       var tile = tiles[i];
       var tileId = attr(tile,"id");
       var tileGid = gid + tileId;

       var properties = parseProperties(tile);

       if(properties.points) {
         properties.points = Q._map(properties.points.split(" "),parsePoint);
       }

       // save the properties indexed by GID for creating objects
       tileProperties[tileGid] = properties;

       // save the properties indexed by tile number for the frame properties
       tilesetTileProps[tileId] = properties;
     }
     tilesetProps.frameProperties = tilesetTileProps;
     gidMap.push([ gid, sheetName ]);
     Q.sheet(sheetName, assetName,  tilesetProps);

   }
   return gidMap;
 };

 Q._tmxProcessImageLayer = function(stage,gidMap,tileProperties,layer) {
   var assetName = Q._tmxExtractAssetName(layer.querySelector("image"));
   var properties = parseProperties(layer);
   properties.asset = assetName;

   stage.insert(new Q.Repeater(properties));
 };

 // get the first entry in the gid map that gives
 // a gid offset
 Q._lookupGid = function(gid,gidMap) {
   var idx = 0;

   while(gidMap[idx+1] && gid >= gidMap[idx+1][0]) {
     idx++;
   }
   return gidMap[idx];
 };

 Q._tmxProcessTileLayer = function(stage,gidMap,tileProperties,layer) {
   var tiles = layer.querySelectorAll("tile"),
       width = attr(layer,'width'),
       height = attr(layer,'height');

   var gidDetails,gidOffset, sheetName;

   var data = [], idx=0;
   for(var y=0;y<height;y++) {
     data[y] = [];
     for(var x=0;x<width;x++) {
       var gid = attr(tiles[idx],"gid");
       if(gid === 0) {
         data[y].push(null);
       } else {
         // If we don't know what tileset this map is associated with
         // figure it out by looking up the gid of the tile w/
         // and match to the tilesef
         if(!gidOffset) {
           gidDetails = Q._lookupGid(attr(tiles[idx],"gid"),gidMap);
           gidOffset = gidDetails[0];
           sheetName = gidDetails[1];
         }
         data[y].push(gid - gidOffset);
       }
       idx++;
     }
   }

   var tileLayerProperties = Q._extend({
     tileW: Q.sheet(sheetName).tileW,
     tileH: Q.sheet(sheetName).tileH,
     sheet: sheetName,
     tiles: data
     },parseProperties(layer));

   var TileLayerClass = tileLayerProperties.Class || 'TileLayer';

   if(tileLayerProperties['collision']) {
     stage.collisionLayer(new Q[TileLayerClass](tileLayerProperties));
   } else {
     stage.insert(new Q[TileLayerClass](tileLayerProperties));
   }
 };

 Q._tmxProcessObjectLayer = function(stage,gidMap,tileProperties,layer) {
   var objects = layer.querySelectorAll("object");
   for(var i=0;i < objects.length;i++) {
     var obj = objects[i],
         gid = attr(obj,"gid"),
         x = attr(obj,'x'),
         y = attr(obj,'y'),
         properties = tileProperties[gid],
         overrideProperties = parseProperties(obj);

     if(!properties) { throw "Invalid TMX Object: missing properties for GID:" + gid; }
     if(!properties['Class']) { throw "Invalid TMX Object: missing Class for GID:" + gid; }

     var className = properties['Class'];
     if(!className) { throw "Invalid TMX Object Class: " + className + " GID:" + gid; }

     var p = Q._extend(Q._extend({ x: x, y: y }, properties), overrideProperties);

     // Offset the sprite
     var sprite = new Q[className](p);
     sprite.p.x += sprite.p.w/2;
     sprite.p.y -= sprite.p.h/2;

     stage.insert(sprite);
   }

 };

 Q._tmxProcessors = { 'objectgroup': Q._tmxProcessObjectLayer,
                      'layer': Q._tmxProcessTileLayer,
                      'imagelayer': Q._tmxProcessImageLayer };

 Q.stageTMX = function(dataAsset,stage) {
    var data = Q._isString(dataAsset) ?  Q.asset(dataAsset) : dataAsset;

    var tileProperties = {};

    // Load Tilesets
    var tilesets = data.getElementsByTagName("tileset");
    var gidMap = Q._tmxLoadTilesets(tilesets,tileProperties);

    // Go through each of the layers
    Q._each(data.documentElement.childNodes,function(layer) {
      var layerType = layer.tagName;
      if(Q._tmxProcessors[layerType]) {
        Q._tmxProcessors[layerType](stage, gidMap, tileProperties, layer);
      }
    });
  };

};


text:
<?php
namespace Application\Entity;
use Doctrine\ORM\Mapping as ORM;
/** @ORM\Entity */
class User {
    /**
    * @ORM\Id
    * @ORM\GeneratedValue(strategy="AUTO")
    * @ORM\Column(type="integer")
    */
    protected $id;

    /** @ORM\Column(type="string") */
    protected $fullName;

    // getters/setters
    public function getId(){
    	return $this->id;
    }

    public function getFullName(){
    	return $this->fullName;
    }

    public function setFullName($name){
    	$this->fullName = $name;
    }
}