text:
package com.siyeh.ig.bugs;

import com.intellij.codeInsight.daemon.impl.analysis.JavaGenericsUtil;
import com.intellij.codeInspection.CommonQuickFixBundle;
import com.intellij.codeInspection.ProblemDescriptor;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.*;
import com.intellij.psi.util.InheritanceUtil;
import com.intellij.psi.util.PsiUtil;
import com.intellij.util.ObjectUtils;
import com.siyeh.InspectionGadgetsBundle;
import com.siyeh.ig.BaseInspection;
import com.siyeh.ig.BaseInspectionVisitor;
import com.siyeh.ig.InspectionGadgetsFix;
import com.siyeh.ig.callMatcher.CallMatcher;
import com.siyeh.ig.psiutils.*;
import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public class SuspiciousToArrayCallInspection extends BaseInspection {

  @Override
  @NotNull
  protected String buildErrorString(Object... infos) {
    final PsiType type = (PsiType)infos[0];
    final PsiType foundType = (PsiType)infos[1];
    return InspectionGadgetsBundle.message("suspicious.to.array.call.problem.descriptor", type.getCanonicalText(), foundType.getCanonicalText());
  }

  @Nullable
  @Override
  protected InspectionGadgetsFix buildFix(Object... infos) {
    return new SuspiciousToArrayCallFix((PsiType)infos[0], (boolean)infos[2]);
  }

  @Override
  public boolean isEnabledByDefault() {
    return true;
  }

  @Override
  public BaseInspectionVisitor buildVisitor() {
    return new SuspiciousToArrayCallVisitor();
  }

  private static class SuspiciousToArrayCallVisitor extends BaseInspectionVisitor {

    @Override
    public void visitMethodCallExpression(@NotNull PsiMethodCallExpression expression) {
      super.visitMethodCallExpression(expression);
      final PsiReferenceExpression methodExpression = expression.getMethodExpression();
      @NonNls final String methodName = methodExpression.getReferenceName();
      if (!"toArray".equals(methodName)) {
        return;
      }
      final PsiExpression qualifierExpression = methodExpression.getQualifierExpression();
      if (qualifierExpression == null) {
        return;
      }
      final PsiClassType classType = ObjectUtils.tryCast(qualifierExpression.getType(), PsiClassType.class);
      if (classType == null || classType.isRaw()) return;
      final PsiExpressionList argumentList = expression.getArgumentList();
      final PsiExpression[] arguments = argumentList.getExpressions();
      if (arguments.length != 1) {
        return;
      }
      final PsiExpression argument = PsiUtil.skipParenthesizedExprDown(arguments[0]);
      if (argument == null) return;

      final PsiClass aClass = classType.resolve();
      if (aClass == null) {
        return;
      }
      if (InheritanceUtil.isInheritor(aClass, CommonClassNames.JAVA_UTIL_COLLECTION)) {
        PsiType itemType = JavaGenericsUtil.getCollectionItemType(classType, expression.getResolveScope());
        PsiType argumentType = argument.getType();
        if (!(argumentType instanceof PsiArrayType)) {
          argumentType = getIntFunctionParameterType(argument);
        }
        checkArrayTypes(argument, expression, argumentType, itemType);
      }
      else if (InheritanceUtil.isInheritor(aClass, CommonClassNames.JAVA_UTIL_STREAM_STREAM)) {
        PsiType argumentType = getIntFunctionParameterType(argument);
        if (argumentType != null) {
          checkArrayTypes(argument, expression, argumentType, getStreamElementType(qualifierExpression));
        }
      }
    }

    private static final CallMatcher STREAM_FILTER = CallMatcher.instanceCall(CommonClassNames.JAVA_UTIL_STREAM_STREAM, "filter")
      .parameterTypes(CommonClassNames.JAVA_UTIL_FUNCTION_PREDICATE);
    private static final CallMatcher CLASS_INSTANCEOF = CallMatcher.instanceCall(CommonClassNames.JAVA_LANG_CLASS, "isInstance")
      .parameterCount(1);

    /**
     * @param expression stream expression
     * @return type of elements inside the stream. Tries to take into account previous filters by element type
     */
    private static @Nullable PsiType getStreamElementType(PsiExpression expression) {
      PsiMethodCallExpression call =
        ObjectUtils.tryCast(PsiUtil.skipParenthesizedExprDown(expression), PsiMethodCallExpression.class);
      while (STREAM_FILTER.test(call)) {
        PsiExpression predicate = PsiUtil.skipParenthesizedExprDown(call.getArgumentList().getExpressions()[0]);
        if (predicate instanceof PsiMethodReferenceExpression) {
          if (CLASS_INSTANCEOF.methodReferenceMatches((PsiMethodReferenceExpression)predicate)) {
            PsiExpression qualifier = PsiUtil.skipParenthesizedExprDown(((PsiMethodReferenceExpression)predicate).getQualifierExpression());
            if (qualifier instanceof PsiClassObjectAccessExpression) {
              return ((PsiClassObjectAccessExpression)qualifier).getOperand().getType();
            }
          }
        }
        else if (predicate instanceof PsiLambdaExpression) {
          PsiParameter[] parameters = ((PsiLambdaExpression)predicate).getParameterList().getParameters();
          if (parameters.length == 1) {
            PsiExpression lambdaBody =
              PsiUtil.skipParenthesizedExprDown(LambdaUtil.extractSingleExpressionFromBody(((PsiLambdaExpression)predicate).getBody()));
            if (lambdaBody instanceof PsiInstanceOfExpression &&
                ExpressionUtils.isReferenceTo(((PsiInstanceOfExpression)lambdaBody).getOperand(), parameters[0])) {
              PsiTypeElement checkType = ((PsiInstanceOfExpression)lambdaBody).getCheckType();
              if (checkType != null) {
                return checkType.getType();
              }
            }
          }
        }
        call = MethodCallUtils.getQualifierMethodCall(call);
      }
      return StreamApiUtil.getStreamElementType(expression.getType(), false);
    }

    private static PsiType getIntFunctionParameterType(PsiExpression argument) {
      PsiType argumentType = FunctionalExpressionUtils.getFunctionalExpressionType(argument);
      return PsiUtil.substituteTypeParameter(argumentType, "java.util.function.IntFunction", 0, false);
    }

    private void checkArrayTypes(@NotNull PsiExpression argument,
                                 @NotNull PsiMethodCallExpression expression,
                                 PsiType argumentType,
                                 PsiType itemType) {
      if (!(argumentType instanceof PsiArrayType)) {
        return;
      }
      final PsiArrayType arrayType = (PsiArrayType)argumentType;
      final PsiType componentType = arrayType.getComponentType();
      PsiType actualType = getActualItemTypeIfMismatch(arrayType, expression, itemType);
      if (actualType != null) {
        registerError(argument, actualType, componentType, !(argument.getType() instanceof PsiArrayType));
      }
    }

    @Nullable
    private static PsiType getActualItemTypeIfMismatch(@NotNull PsiArrayType arrayType,
                                                       @NotNull PsiMethodCallExpression expression,
                                                       PsiType itemType) {
      itemType = GenericsUtil.getVariableTypeByExpressionType(itemType);
      final PsiType componentType = arrayType.getComponentType();
      if (itemType == null || componentType.isAssignableFrom(itemType)) return null;
      if (itemType instanceof PsiClassType) {
        final PsiClass aClass = ((PsiClassType)itemType).resolve();
        if (aClass instanceof PsiTypeParameter) {
          final PsiReferenceList extendsList = ((PsiTypeParameter)aClass).getExtendsList();
          final PsiClassType[] types = extendsList.getReferencedTypes();
          if (types.length == 0) {
            return TypeUtils.getObjectType(expression);
          }
          if (types.length == 1) {
            return types[0];
          }
          return null;
        }
      }
      return itemType;
    }
  }

  private static class SuspiciousToArrayCallFix extends InspectionGadgetsFix {
    @NonNls private final String myReplacement;
    @NonNls private final String myPresented;

    SuspiciousToArrayCallFix(PsiType wantedType, boolean isFunction) {
      if (isFunction) {
        myReplacement = wantedType.getCanonicalText() + "[]::new";
        myPresented = wantedType.getPresentableText() + "[]::new";
      } else {
        final String index = StringUtil.repeat("[0]", wantedType.getArrayDimensions() + 1);
        final PsiType componentType = wantedType.getDeepComponentType();
        myReplacement = "new " + componentType.getCanonicalText() + index;
        myPresented = "new " + componentType.getPresentableText() + index;
      }
    }

    @Override
    protected void doFix(Project project, ProblemDescriptor descriptor) {
      PsiExpression expression = ObjectUtils.tryCast(descriptor.getStartElement(), PsiExpression.class);
      if (expression == null) return;
      new CommentTracker().replaceAndRestoreComments(expression, myReplacement);
    }

    @Nls(capitalization = Nls.Capitalization.Sentence)
    @NotNull
    @Override
    public String getName() {
      return CommonQuickFixBundle.message("fix.replace.with.x", myPresented);
    }

    @Nls(capitalization = Nls.Capitalization.Sentence)
    @NotNull
    @Override
    public String getFamilyName() {
      return InspectionGadgetsBundle.message("suspicious.to.array.call.fix.family.name");
    }
  }
}


text:
namespace base {
class ListValue;
}

namespace content {
class RenderProcessHost;
class Shell;
}

namespace nwapi {

class App {
 public:
  static void Call(const std::string& method,
                   const base::ListValue& arguments);

  static void Call(content::Shell* shell,
                   const std::string& method,
                   const base::ListValue& arguments,
                   base::ListValue* result);

  // Try to close all windows (then will cause whole app to quit).
  static void CloseAllWindows(bool force = false);

  // Quit the whole app.
  static void Quit(content::RenderProcessHost* rph = NULL);

  // Post "open" event.
  static void EmitOpenEvent(const std::string& path);

  // Post "reopen" event.
  // (This event is received when the user clicked the icon in the Dock).
  static void EmitReopenEvent();

  static void ClearCache(content::RenderProcessHost* render_view_host);

 private:
  App();
  DISALLOW_COPY_AND_ASSIGN(App);
};

}  // namespace nwapi

#endif  // CONTENT_NW_SRC_API_APP_APP_H_

redpajama_set_name: RedPajamaGithub


text:
/* jshint node: true */
'use strict';

var _                = require('lodash');
var http             = require('http');
var humanizeString   = require('humanize-string');
var EventEmitter     = require('events').EventEmitter;
var HttpStatusCodes  = require('http-status-codes');

var format        = require('./utils/format');
var statusCodes   = require('./utils/http-status-codes');
var ResponseError = require('./response-error');

var __listeners = new EventEmitter();

var apply = function (v) {
  return function (f) {
    return f(v);
  };
};

var __isNullable = function (raw) {
  return [_.isNull, _.isNaN, _.isUndefined].some(apply(raw));
};

var __isError = function (raw) {
  return raw instanceof Error;
};

var __isJsonable = function (raw) {
  return [_.isArray, _.isPlainObject, _.isObject].some(apply(raw));
};

var __toJSON = function (raw) {
  if (__isNullable(raw)) {
    return {};
  } else if (__isError(raw)) {
    return { error: _.pick(raw, ['name', 'message']) };
  } else if (__isJsonable(raw)) {
    return raw;
  } else {
    return { data: raw };
  }
};

var __emit = function (key, data) {
  __listeners.emit(key, {
    statusCode: key,
    body: data
  });
};

var __send = function (response, statusCode, json) {
  var body = JSON.stringify(json);
  response.statusCode = statusCode;
  response.setHeader('Content-Type', 'application/json');
  response.write(body);
  response.end();
};

var __getName = function (name) {
  return humanizeString(name)
    .split(' ')
    .filter(function(s) {
      return !new RegExp('Error|Exception', 'i').test(s);
    })
    .map(function(s) {
      return s.trim().toUpperCase();
    })
    .join('_');
};

var response = http.ServerResponse.prototype;

response.sendError = function (error) {
  if (!__isError(error)) {
    throw new Error("#sendError argument is not an Error's instance");
  }
  if (error instanceof ResponseError) {
    this[format.exceptionToMethod(error.name)](error);
  } else {
    var statusCode = HttpStatusCodes[__getName(error.name)] || HttpStatusCodes.INTERNAL_SERVER_ERROR;
    __send(this, statusCode, __toJSON(error));
    __emit(statusCode, error);
    __emit('response_error', error);
  }
};

statusCodes(format.method).forEach(function (status) {

  var key   = status.key;
  var value = status.value;

  response[key] = function (raw) {
    __send(this, value, __toJSON(raw));
    __emit(value, raw);

    if (value >= 400) {
      __emit('response_error', raw);
    }
  };

});

statusCodes(format.listenerMethod).forEach(function (status) {
  var key = status.key;
  var value = status.value;

  http.ServerResponse[key] = function (callback) {
    __listeners.on(value, callback);
  };

});

http.ServerResponse.onResponseError = function (callback) {
  __listeners.on('response_error', callback);
};

http.ServerResponse.removeAllListeners = function (keys) {
  _.forEach(keys, function (key) {
    __listeners.removeAllListeners(key);
  });
};

module.exports = http.ServerResponse;


text:
@interface FLFileDropTableViewController : NSViewController {
@private
    IBOutlet __unsafe_unretained NSTableView* _tableView;

    NSMutableArray* _urls;
}

@property (readonly, assign, nonatomic) NSTableView* tableView;
@property (readonly, strong, nonatomic) NSArray* utis;
@property (readonly, strong, nonatomic) NSArray* urls;

- (void) addURL:(NSURL*) url;
- (NSURL*) urlForRow:(NSUInteger) row;
- (void) receiveDroppedURL:(NSURL*) url;

+ (NSArray*) imageUTIs;

@end


text:
<?php

namespace Eddmash\PowerOrm\Model\Field;

use Eddmash\PowerOrm\ContributorInterface;
use Eddmash\PowerOrm\DeConstructableInterface;
use Eddmash\PowerOrm\Model\Model;

/**
 * Interface FieldInterface.
 *
 * @since 1.1.0
 *
 * @author Eddilbert Macharia (http://eddmash.com) <edd.cowan@gmail.com>
 */
interface FieldInterface extends DeConstructableInterface, ContributorInterface
{
    /**
     * Returns the database column data type for the Field, taking into account the connection.
     *
     * @return string
     *
     * @since 1.1.0
     *
     * @author Eddilbert Macharia (http://eddmash.com) <edd.cowan@gmail.com>
     */
    public function dbType($connection);

    /**
     * Convert the value to a php value.
     *
     * @param $value
     *
     * @return mixed
     *
     * @since 1.1.0
     *
     * @author Eddilbert Macharia (http://eddmash.com) <edd.cowan@gmail.com>
     */
    public function toPhp($value);

    /**
     * Returns a powerorm.form.Field instance for this database Field.
     *
     * @return string
     *
     * @since 1.1.0
     *
     * @author Eddilbert Macharia (http://eddmash.com) <edd.cowan@gmail.com>
     */
    public function formField($kwargs = []);

    /**
     * Method called prior to prepare_value_for_db() to prepare the value before being saved
     * (e.g. for DateField.auto_now).
     *
     * model is the instance this field belongs to and add is whether the instance is being saved to the
     * database for the first time.
     *
     * It should return the value of the appropriate attribute from model for this field.
     *
     * The attribute name is in $this->getAttrName() (this is set up by Field).
     *
     * @param Model $model
     * @param bool  $add   is whether the instance is being saved to the database for the first time
     *
     * @return mixed
     *
     * @since 1.1.0
     *
     * @author Eddilbert Macharia (http://eddmash.com) <edd.cowan@gmail.com>
     */
    public function preSave(Model $model, $add);

    /**
     * value is the current value of the model's attribute, and the method should return data in a format that has been
     * prepared for use as a parameter in a query.ie. in the database.
     *
     * @param $value
     *
     * @return mixed
     *
     * @since 1.1.0
     *
     * @author Eddilbert Macharia (http://eddmash.com) <edd.cowan@gmail.com>
     */
    public function prepareValue($value);

    /**
     * Converts value to a backend-specific value.
     * By default it returns value if prepared=True and prepare_value() if is False.
     *
     * @param $value
     * @param $connection
     *
     * @return mixed
     *
     * @since 1.1.0
     *
     * @author Eddilbert Macharia (http://eddmash.com) <edd.cowan@gmail.com>
     */
    public function prepareValueForDb($value, $connection, $prepared = false);

    /**
     * Same as the prepare_value_for_db(), but called when the field value must be saved to the database.
     *
     * By default returns prepare_value_for_db().
     *
     * @param $value
     * @param $connection
     *
     * @return mixed
     *
     * @since 1.1.0
     *
     * @author Eddilbert Macharia (http://eddmash.com) <edd.cowan@gmail.com>
     */
    public function prepareValueBeforeSave($value, $connection);

    /**
     * Converts a value as returned by the database to a PHP object. It is the reverse of prepare_value().
     *
     * This method is not used for most built-in fields as the database backend already returns the correct PHP type,
     * or the backend itself does the conversion.
     *
     * @return mixed
     *
     * @since 1.1.0
     *
     * @author Eddilbert Macharia (http://eddmash.com) <edd.cowan@gmail.com>
     */
    public function fromDbValue();

    /**
     * Returns the value of this field in the given model instance.
     *
     * @param $obj
     *
     * @return mixed
     *
     * @since 1.1.0
     *
     * @author Eddilbert Macharia (http://eddmash.com) <edd.cowan@gmail.com>
     */
    public function valueFromObject($obj);
}


text:
<model>
    <mount>//OPNsense/ntopng/general</mount>
    <description>ntopng configuration</description>
    <version>0.0.1</version>
    <items>
        <enabled type="BooleanField">
            <default>0</default>
            <Required>Y</Required>
        </enabled>
        <interface type="InterfaceField">
            <Required>N</Required>
            <Multiple>N</Multiple>
        </interface>
        <httpport type="PortField">
            <Required>Y</Required>
            <default>3000</default>
        </httpport>
        <httpsport type="PortField">
            <Required>N</Required>
            <Constraints>
                <check001>
                    <ValidationMessage>Please select a HTTPS port and a valid certificate</ValidationMessage>
                    <type>AllOrNoneConstraint</type>
                    <addFields>
                        <field1>cert</field1>
                    </addFields>
                </check001>
            </Constraints>
        </httpsport>
        <cert type="CertificateField">
            <Type>cert</Type>
            <Required>N</Required>
            <Constraints>
                <check001>
                    <reference>httpsport.check001</reference>
                </check001>
            </Constraints>
        </cert>
        <dnsmode type="OptionField">
            <Required>N</Required>
            <OptionValues>
                <Option0 value="0">Decode DNS responses and resolve only local numeric IPs</Option0>
                <Option1 value="1">Decode DNS responses and resolve all numeric IPs</Option1>
                <Option2 value="2">Decode DNS responses and do not resolve numeric IPs</Option2>
                <Option3 value="3">Do not decode DNS responses and do not resolve numeric IPs</Option3>
            </OptionValues>
        </dnsmode>
    </items>
</model>


text:
require 'thumbkit'
require 'fileutils'

module Helpers

  def path_to_fixture(fixture_name)
    Pathname.new("spec/fixtures").join(fixture_name).expand_path
  end

  def tmp_path
    Pathname.new("spec/tmp")
  end

  def path_for_output(outfile = '')
    tmp_path.join(outfile).expand_path
  end
end

module ImageMacros
  def its_size_should_be(size)
    it "its size should be #{ size }" do
      r = `identify -ping -quiet -format "%wx%h" "#{subject}"`.chomp
      r.should == size
    end
  end

  def its_mimetype_should_be(mime)
    it "its mime type should be #{ mime }" do
      m = `file --mime-type -n -N "#{ subject }"`.split(/\s/).last
      m.should == mime
    end
  end
end

RSpec.configure do |config|
  config.extend ImageMacros
  config.include Helpers

  def mkdir_safe(dir)
    Dir.mkdir(dir)
  rescue Errno::EEXIST
    # Great, it's already there.
  end

  config.around(:each) do |example|
    mkdir_safe tmp_path.to_s
    example.run
    FileUtils.rm_rf(tmp_path.to_s) unless File.exist?(tmp_path.join('.keep').to_s)
  end
end


text:
//
//  PLVPaymentResultAdditionalData.h
//  PaylevenSDK
//
//  Created by Alexei Kuznetsov on 04.12.14.
//  Copyright (c) 2014 payleven Holding GmbH. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "PLVPaymentResult.h"

/** Payment result additional data. */
@interface PLVPaymentResultAdditionalData : NSObject

/** Primary account number (PAN), also known as card number. Truncated for security reasons. */
@property(nonatomic, readonly, copy) NSString *primaryAccountNumber;

/** Maximum length of the untruncated primary account number for the card brand specified in cardBrandIdentifier. */
@property(nonatomic, readonly, assign) NSUInteger maximumPrimaryAccountNumberLength;

/** Primary account number sequence number. Identifies and differentiates cards with the same PAN. */
@property(nonatomic, readonly, copy) NSString *primaryAccountNumberSequenceNumber;

/** POS entry mode. */
@property(nonatomic, readonly, assign) PLVPointOfSaleEntryMode pointOfSaleEntryMode;

/** Cardholder verification method. */
@property(nonatomic, readonly, assign) PLVCardholderVerificationMethod cardholderVerificationMethod;

/** Card application identifier (AID). */
@property(nonatomic, readonly, copy) NSString *applicationIdentifier;

/** Card authorization code. */
@property(nonatomic, readonly, copy) NSString *authorizationCode;

/** Card brand identifier. */
@property(nonatomic, readonly, copy) NSString *cardBrandIdentifier;

/** Card brand name. */
@property(nonatomic, readonly, copy) NSString *cardBrandName;

@end


text:
set -e

PATH=$PATH:./node_modules/.bin

mkdir -p build
rm build/* || true

# Build lib

browserify index.js --debug -s Planktos \
 | exorcist build/planktos.js.map \
 > build/planktos.js

uglifyjs build/planktos.js --mangle --compress warnings=false \
  --in-source-map build/planktos.js.map \
  --source-map build/planktos.min.js.map \
  --source-map-url /base/build/planktos.min.js.map \
 > build/planktos.min.js

# Build tests

browserify test/test.js --debug \
 > build/test.js


text:
exports.power = {
  name: "Cross Slash 2",
  archetype: "Ranger",
  discipline: false,
  bar: "Melee",
  type: "Attack",
  cast_time: "Instant",
  duration: false,
  lifetime: false,
  target: "Cone",
  velocity: false,
  range: "5 Meters",
  cost: "35 Energy",
  tooltip: "Slash in front of you for 862 - 1166 + 101% Weapon Damage. Applies a Moderate Bleed effect.",
  icon: false
};


text:
<?php

namespace Google\Service\Contentwarehouse;

class QualityQrewriteCandidateIdField extends \Google\Model
{
  /**
   * @var int
   */
  public $index;
  /**
   * @var string
   */
  public $type;

  /**
   * @param int
   */
  public function setIndex($index)
  {
    $this->index = $index;
  }
  /**
   * @return int
   */
  public function getIndex()
  {
    return $this->index;
  }
  /**
   * @param string
   */
  public function setType($type)
  {
    $this->type = $type;
  }
  /**
   * @return string
   */
  public function getType()
  {
    return $this->type;
  }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(QualityQrewriteCandidateIdField::class, 'Google_Service_Contentwarehouse_QualityQrewriteCandidateIdField');


text:
/* @flow */
export { default } from './Table';
export { defaultSortComparator } from './Sortable';
export { default as TableCell } from './TableCell';
export { default as TableHeaderCell } from './TableHeaderCell';
export { default as TableRow } from './TableRow';
export { default as TableSortableHeaderCell } from './TableSortableHeaderCell';

export * from './themes';


text:
import colors from 'themes/colors';
export default {
  overlay: {
    backgroundColor: colors.modalOverlay,
  },
  content: {
    position: 'relative',
    bottom: 0,
    left: 0,
    right: 0,
    margin: 'auto',
    width: '400px',
    borderRadius: '0px',
    padding: '40px',
    maxHeight: '90%',
  },
};


text:
export * from './validation-level';
export * from './validation-state';
//# sourceMappingURL=index.js.map


text:
System.register('wiseclock/flarum-ext-post-copyright/main', ['flarum/extend', 'flarum/app', 'flarum/models/Post', 'flarum/Model', 'flarum/components/HeaderPrimary', 'flarum/components/DiscussionPage', 'flarum/components/CommentPost', 'flarum/components/DiscussionComposer', 'flarum/components/EditPostComposer', 'flarum/components/ReplyComposer', 'flarum/components/TextEditor', 'flarum/components/Select'], function (_export) {
    'use strict';

    var extend, override, app, Post, Model, HeaderPrimary, DiscussionPage, CommentPost, DiscussionComposer, EditPostComposer, ReplyComposer, TextEditor, Select;
    return {
        setters: [function (_flarumExtend) {
            extend = _flarumExtend.extend;
            override = _flarumExtend.override;
        }, function (_flarumApp) {
            app = _flarumApp['default'];
        }, function (_flarumModelsPost) {
            Post = _flarumModelsPost['default'];
        }, function (_flarumModel) {
            Model = _flarumModel['default'];
        }, function (_flarumComponentsHeaderPrimary) {
            HeaderPrimary = _flarumComponentsHeaderPrimary['default'];
        }, function (_flarumComponentsDiscussionPage) {
            DiscussionPage = _flarumComponentsDiscussionPage['default'];
        }, function (_flarumComponentsCommentPost) {
            CommentPost = _flarumComponentsCommentPost['default'];
        }, function (_flarumComponentsDiscussionComposer) {
            DiscussionComposer = _flarumComponentsDiscussionComposer['default'];
        }, function (_flarumComponentsEditPostComposer) {
            EditPostComposer = _flarumComponentsEditPostComposer['default'];
        }, function (_flarumComponentsReplyComposer) {
            ReplyComposer = _flarumComponentsReplyComposer['default'];
        }, function (_flarumComponentsTextEditor) {
            TextEditor = _flarumComponentsTextEditor['default'];
        }, function (_flarumComponentsSelect) {
            Select = _flarumComponentsSelect['default'];
        }],
        execute: function () {

            app.initializers.add('wiseclock-post-copyright', function () {
                Post.prototype.copyright = Model.attribute('copyright');

                function getDefaults(index) {
                    var dbValString = app.forum.attribute('wiseclock.post-copyright.defaults');
                    var dbVal;
                    if (dbValString === null) dbVal = [true, true, true, true];else dbVal = JSON.parse(dbValString);
                    return dbVal[index];
                }

                var wiseclockCopyrightOptions = {
                    'sourced': app.translator.trans('wiseclock-post-copyright.forum.composer.sourced'),
                    'authorized': app.translator.trans('wiseclock-post-copyright.forum.composer.authorized'),
                    'paid': app.translator.trans('wiseclock-post-copyright.forum.composer.paid'),
                    'prohibited': app.translator.trans('wiseclock-post-copyright.forum.composer.prohibited'),
                    'none': app.translator.trans('wiseclock-post-copyright.forum.composer.none')
                };
                var wiseclockCopyrightShown = {
                    'sourced': app.translator.trans('wiseclock-post-copyright.forum.post.sourced'),
                    'authorized': app.translator.trans('wiseclock-post-copyright.forum.post.authorized'),
                    'paid': app.translator.trans('wiseclock-post-copyright.forum.post.paid'),
                    'prohibited': app.translator.trans('wiseclock-post-copyright.forum.post.prohibited')
                };

                var wiseclockCopyrightAvailableOptions = {};
                var wiseclockCopyrightAvailableShown = {};
                var wiseclockCopyrightPrimaryColor = false;
                var wiseclockCopyrightAlignRight = false;
                var wiseclockCopyrightDiscussionsOnly = false;
                var wiseclockCopyrightAllowTrespass = false;
                var wiseclockCopyrightIcon = '© ';

                extend(HeaderPrimary.prototype, 'init', function () {
                    if (app.forum.attribute('wiseclock.post-copyright.primary_color') !== null) wiseclockCopyrightPrimaryColor = JSON.parse(app.forum.attribute('wiseclock.post-copyright.primary_color'));

                    if (app.forum.attribute('wiseclock.post-copyright.discussions_only') !== null) wiseclockCopyrightDiscussionsOnly = JSON.parse(app.forum.attribute('wiseclock.post-copyright.discussions_only'));

                    if (app.forum.attribute('wiseclock.post-copyright.align_right') !== null) wiseclockCopyrightAlignRight = JSON.parse(app.forum.attribute('wiseclock.post-copyright.align_right'));

                    if (app.forum.attribute('wiseclock.post-copyright.icon') !== null) wiseclockCopyrightIcon = app.forum.attribute('wiseclock.post-copyright.icon');

                    if (app.forum.attribute('wiseclock.post-copyright.allow_trespass') !== null) wiseclockCopyrightAllowTrespass = JSON.parse(app.forum.attribute('wiseclock.post-copyright.allow_trespass'));

                    if (app.forum.attribute('wiseclock.post-copyright.addition') !== null) {
                        var additions = app.forum.attribute('wiseclock.post-copyright.addition');
                        var additionLines = additions.match(/[^\r\n]+/g);
                        additionLines.forEach(function (element, index) {
                            var optionComponents = element.match(/([^\\\][^,]|\\,)+/g);
                            if (optionComponents.length == 3) {
                                var optionKey = optionComponents[0];
                                var optionMenu = optionComponents[1];
                                var optionUI = optionComponents[2];
                                wiseclockCopyrightAvailableOptions[optionKey] = optionMenu;
                                wiseclockCopyrightAvailableShown[optionKey] = optionUI;
                            }
                        });
                    }

                    var optionKeys = Object.keys(wiseclockCopyrightOptions);
                    optionKeys.forEach(function (key, index) {
                        if ((index >= 4 || getDefaults(index)) && !wiseclockCopyrightAvailableOptions.hasOwnProperty(key)) {
                            wiseclockCopyrightAvailableOptions[key] = wiseclockCopyrightOptions[key];
                            if (key != 'none') wiseclockCopyrightAvailableShown[key] = wiseclockCopyrightShown[key];
                        }
                    });
                });

                extend(DiscussionComposer.prototype, 'init', function (items) {
                    var _editor = this.editor;
                    _editor.props.copyright = {};
                    _editor.props.copyright.options = wiseclockCopyrightAvailableOptions;
                    _editor.props.copyright.value = m.prop(Object.keys(wiseclockCopyrightAvailableOptions)[0]);
                });
                extend(EditPostComposer.prototype, 'init', function (items) {
                    var _editor = this.editor;
                    _editor.props.copyright = {};
                    _editor.props.copyright.options = wiseclockCopyrightAvailableOptions;
                    var copyrightKey = this.props.post.data.attributes.copyright;
                    if (!wiseclockCopyrightAvailableOptions.hasOwnProperty(copyrightKey)) copyrightKey = Object.keys(wiseclockCopyrightAvailableOptions)[0];
                    _editor.props.copyright.value = m.prop(copyrightKey);

                    if (app.current instanceof DiscussionPage) {
                        var discussionStartPost = app.current.stream.discussion.data.relationships.posts.data[0];
                        if (discussionStartPost.type == 'posts') {
                            var startPostId = discussionStartPost.id;
                            var currentPostId = this.props.post.id();
                            var isEditingStartPost = startPostId === currentPostId;
                            if (wiseclockCopyrightDiscussionsOnly && !isEditingStartPost) _editor.props.copyright.hidden = true;
                        }
                    }

                    var currentUserId = app.session.user.id();
                    var currentPostUserId = this.props.post.data.relationships.user.data.id;
                    if (!wiseclockCopyrightAllowTrespass && currentUserId != currentPostUserId) _editor.props.copyright.hidden = true;
                });

                extend(EditPostComposer.prototype, 'data', function (data) {
                    if (this.editor.props.copyright.value()) data.copyright = this.editor.props.copyright.value();
                });
                extend(ReplyComposer.prototype, 'data', function (data) {
                    if (this.editor.props.copyright.value()) data.copyright = this.editor.props.copyright.value();
                });
                extend(DiscussionComposer.prototype, 'data', function (data) {
                    if (this.editor.props.copyright.value()) data.copyright = this.editor.props.copyright.value();
                });

                extend(CommentPost.prototype, 'content', function (list) {
                    if (!this.isEditing()) {
                        var copyrightKey = this.props.post.data.attributes.copyright;

                        var hidden = false;
                        if (app.current instanceof DiscussionPage) {
                            var discussionStartPost = app.current.stream.discussion.data.relationships.posts.data[0];
                            if (discussionStartPost.type == 'posts') {
                                var startPostId = discussionStartPost.id;
                                var currentPostId = this.props.post.id();
                                var isEditingStartPost = startPostId === currentPostId;
                                if (wiseclockCopyrightDiscussionsOnly && !isEditingStartPost) hidden = true;
                            }
                        }

                        if (hidden || copyrightKey == 'none' || !wiseclockCopyrightAvailableShown.hasOwnProperty(copyrightKey)) return;
                        var copyrightString = wiseclockCopyrightAvailableShown[copyrightKey];
                        var extraClass = '';
                        if (wiseclockCopyrightAlignRight) extraClass = ' Copyright-wrapper-right';
                        list.push(m('div.Copyright-wrapper' + extraClass, m.trust(wiseclockCopyrightIcon + copyrightString)));
                    }
                });

                extend(TextEditor.prototype, 'controlItems', function (items) {
                    var _editor = this;
                    var addDropdown = true;

                    if (!_editor.props.copyright) {
                        _editor.props.copyright = {};
                        _editor.props.copyright.options = wiseclockCopyrightAvailableOptions;
                        _editor.props.copyright.value = m.prop('none');

                        if (wiseclockCopyrightDiscussionsOnly) _editor.props.copyright.hidden = true;
                    }

                    if (_editor.props.copyright.hidden) return;

                    var dropdown = Select.component({
                        options: _editor.props.copyright.options,
                        onchange: _editor.props.copyright.value,
                        value: _editor.props.copyright.value() || Object.keys(wiseclockCopyrightAvailableOptions)[0]
                    });

                    var extraClass = wiseclockCopyrightPrimaryColor ? ' Dropdown-primary' : '';
                    items.add('wiseclock-post-copyright-selector' + extraClass, dropdown, 0);
                });
            });
        }
    };
});


text:
import os
from setuptools import setup

setup(
    name='freelan-configurator',
    version='0.1.2',
    description='Generating freelan config files for you.',
    license='MIT',
    author='Christoph Russ',
    author_email='chruss@gmx.de',
    url='https://github.com/privacee/freelan-configurator',
    download_url='https://github.com/privacee/freelan-configurator/tarball/v0.1.2',
    keywords = ['freelan', 'vpn', 'config', 'file'],
    zip_safe=False,
    packages=['freelan_configurator'],
    #scripts=['freelan_cmd.py'],
    #entry_points={'console_scripts': ['freelan_cfg = freelan_cfg:main']},
    install_requires=['appdirs'],
    classifiers=[
        'Environment :: Console',
        'License :: OSI Approved :: MIT License',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 3',
        'Development Status :: 3 - Alpha'
    ]
)


text:
import System.Environment (getArgs)
import Data.Ord
import Data.List
import Data.Maybe
import Data.Array

type Problem = (Int, Int, Int)
type Result  = Int

main :: IO ()
main = do
  [file]  <- getArgs
  ip <- readFile file
  writeFile ((takeWhile (/= '.') file) ++ ".out" ) (processInput ip)

writeOutput :: [(Int, Result)] -> [String]
writeOutput = map (\(i, r) -> ("Case #" ++ (show i) ++ ": " ++ (writeResult r)))

processInput :: String -> String
processInput = unlines . writeOutput . zip [1..] . map solveProblem . parseProblem . tail . lines

writeResult :: Result -> String
writeResult = show

parseProblem :: [String] -> [Problem]
parseProblem [] = []
parseProblem (ns:ss) = (r, c, w) : parseProblem ss
  where (r, c, w) = (\[r, c, w]->(r, c, w)). map read. words $ ns

solveProblem :: Problem -> Result
solveProblem (r, c, w) =
  let fullCalls = (r-1) * (c `div` w)
      partCalls = (c `div` w) - 1
      remCalls  = if c `mod` w == 0 then w else 3 + w - 2
      lastRowCalls = partCalls + remCalls
  in  fullCalls + lastRowCalls


text:
import json
import math

from django.test import TestCase

from corehq.util.es.elasticsearch import ConnectionError

from pillowtop.es_utils import initialize_index_and_mapping

from corehq.apps.callcenter.views import CallCenterOwnerOptionsView
from corehq.apps.domain.shortcuts import create_domain
from corehq.apps.es.tests.utils import es_test
from corehq.apps.groups.models import Group
from corehq.apps.locations.models import LocationType
from corehq.apps.locations.tests.util import make_loc
from corehq.apps.users.models import CommCareUser, WebUser
from corehq.elastic import get_es_new, send_to_elasticsearch
from corehq.pillows.mappings.group_mapping import GROUP_INDEX_INFO
from corehq.pillows.mappings.user_mapping import USER_INDEX_INFO
from corehq.toggles import CALL_CENTER_LOCATION_OWNERS, NAMESPACE_DOMAIN
from corehq.util import reverse
from corehq.util.elastic import ensure_index_deleted
from corehq.util.test_utils import trap_extra_setup
from django_digest.test import Client

TEST_DOMAIN = "cc-location-owner-test-domain"
CASE_TYPE = "cc-case-type"
LOCATION_TYPE = "my-location"

@es_test
class CallCenterLocationOwnerOptionsViewTest(TestCase):

    @classmethod
    def setUpClass(cls):
        super(CallCenterLocationOwnerOptionsViewTest, cls).setUpClass()

        with trap_extra_setup(ConnectionError, msg="cannot connect to elasicsearch"):
            es = get_es_new()
            ensure_index_deleted(USER_INDEX_INFO.index)
            ensure_index_deleted(GROUP_INDEX_INFO.index)
            initialize_index_and_mapping(es, USER_INDEX_INFO)
            initialize_index_and_mapping(es, GROUP_INDEX_INFO)

        # Create domain
        cls.domain = create_domain(TEST_DOMAIN)
        cls.domain.save()

        CALL_CENTER_LOCATION_OWNERS.set(cls.domain.name, True, NAMESPACE_DOMAIN)

        cls.username = "foo"
        cls.password = "bar"
        cls.web_user = WebUser.create(cls.domain.name, cls.username, cls.password, None, None)
        cls.web_user.save()

        # Create case sharing groups
        cls.groups = []
        for i in range(2):
            group = Group(domain=TEST_DOMAIN, name="group{}".format(i), case_sharing=True)
            group.save()
            send_to_elasticsearch('groups', group.to_json())
            cls.groups.append(group)
        es.indices.refresh(GROUP_INDEX_INFO.index)
        cls.group_ids = {g._id for g in cls.groups}

        # Create locations
        LocationType.objects.get_or_create(
            domain=cls.domain.name,
            name=LOCATION_TYPE,
            shares_cases=True,
        )
        cls.locations = [
            make_loc('loc{}'.format(i), type=LOCATION_TYPE, domain=TEST_DOMAIN) for i in range(4)
        ]
        cls.location_ids = {l._id for l in cls.locations}

        # Create users
        cls.users = [CommCareUser.create(TEST_DOMAIN, 'user{}'.format(i), '***', None, None) for i in range(3)]
        for user in cls.users:
            send_to_elasticsearch('users', user.to_json())
        es.indices.refresh(USER_INDEX_INFO.index)
        cls.user_ids = {u._id for u in cls.users}

    @classmethod
    def tearDownClass(cls):
        super(CallCenterLocationOwnerOptionsViewTest, cls).tearDownClass()
        for user in cls.users:
            user.delete(cls.domain.name, deleted_by=None)
        CALL_CENTER_LOCATION_OWNERS.set(cls.domain.name, False, NAMESPACE_DOMAIN)
        cls.domain.delete()
        ensure_index_deleted(USER_INDEX_INFO.index)
        ensure_index_deleted(GROUP_INDEX_INFO.index)

    def test_pages(self):
        """
        Confirm that all the groups/locations/users appear on the correct pages
        """
        client = Client()
        client.login(username=self.username, password=self.password)

        # expected_id_sets is a list of sets.
        # expected_id_sets is constructed such that
        # For option with index x yielded by the view:
        #   the option's id should be in expected_ids[x]
        expected_id_sets = [{"user_location"}, {"user_parent_location"}]

        for i in self.groups:
            expected_id_sets.append(self.group_ids)
        for i in self.locations:
            expected_id_sets.append(self.location_ids)
        for i in self.users:
            expected_id_sets.append(self.user_ids)

        page_size = 3  # using a small number because more pages will hopefully be more likely to reveal bugs
        expected_num_pages = int(math.ceil(len(expected_id_sets) / float(page_size)))
        for i in range(expected_num_pages):
            page = i + 1
            response = client.get(reverse(
                CallCenterOwnerOptionsView.url_name, args=[self.domain.name]),
                data={"page": page, "page_limit": page_size, "q": ""}
            )
            response_json = json.loads(response.content)
            self.assertEqual(response_json['total'], len(expected_id_sets))

            for item_index, item in enumerate(response_json['results']):
                id_ = item['id']
                option_index = ((page - 1) * page_size) + item_index
                self.assertTrue(
                    id_ in expected_id_sets[option_index],
                    "Unexpected item {} at index {}.".format(item, option_index)
                )


text:
Haste
================

Everyone has made block NSTimer categories for `NSTimer` in Objective-C. But who has done it in Swift? Well, probably lots of people, but the point is that it is not as straightforward as you might think.

Usage
----------------

1. Add `pod 'Haste'` to your Podfile.
2. Add `import Haste` whevever you want to time things with closures.
3. Call the following function.

	```swift
	NSTimer.scheduledTimerWithTimeInterval(1, block: { () -> () in
	    println("Why does anyone do the things they do?")
	}, repeats: true)

	```

4. That function returns the `NSTimer` instance, so you can call `invalidate()` on it when you want things to stop.


text:
package com.amazonaws.services.inspector2.model.transform;

import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.services.inspector2.model.*;

import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;

/**
 * PackageAggregationResponseMarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class PackageAggregationResponseMarshaller {

    private static final MarshallingInfo<String> ACCOUNTID_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("accountId").build();
    private static final MarshallingInfo<String> PACKAGENAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("packageName").build();
    private static final MarshallingInfo<StructuredPojo> SEVERITYCOUNTS_BINDING = MarshallingInfo.builder(MarshallingType.STRUCTURED)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("severityCounts").build();

    private static final PackageAggregationResponseMarshaller instance = new PackageAggregationResponseMarshaller();

    public static PackageAggregationResponseMarshaller getInstance() {
        return instance;
    }

    /**
     * Marshall the given parameter object.
     */
    public void marshall(PackageAggregationResponse packageAggregationResponse, ProtocolMarshaller protocolMarshaller) {

        if (packageAggregationResponse == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        try {
            protocolMarshaller.marshall(packageAggregationResponse.getAccountId(), ACCOUNTID_BINDING);
            protocolMarshaller.marshall(packageAggregationResponse.getPackageName(), PACKAGENAME_BINDING);
            protocolMarshaller.marshall(packageAggregationResponse.getSeverityCounts(), SEVERITYCOUNTS_BINDING);
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}


text:
@API
package org.terasology.rendering.opengl;

import org.terasology.module.sandbox.API;


text:
<?php

return array(
    'default.add' => 'Add',
    'default.areYouSure' => 'Are you sure?',
    'default.autoCompletePlaceholder' => 'Please, start typing',
    'default.back' => 'Back',
    'default.browse' => 'Browse',
    'default.calculate' => 'Calculate',
    'default.cancel' => 'Cancel',
    'default.checkAll' => 'Check all',
    'default.clone' => 'Clone',
    'default.cloned' => 'cloned',
    'default.close' => 'Close',
    'default.closeAll' => 'Close all',
    'default.copy' => 'Copy',
    'default.created' => 'Created',
    'default.createNew' => 'Create new',
    'default.delete' => 'Delete',
    'default.disable' => 'Disable',
    'default.disabled' => 'Disabled',
    'default.done' => 'Done',
    'default.edit' => 'Edit',
    'default.empty' => 'Empty',
    'default.enable' => 'Enable',
    'default.enabled' => 'Enabled',
    'default.error' => 'Error',
    'default.error.403.description' => 'Looks like you don\'t have the rights to get the page you requested.
But don\'t worry, instead take a stroll around on the homepage.',
    'default.error.403.message' => 'You haven\'t got enough rights',
    'default.error.403.occurred' => 'Take a deep breath',
    'default.error.403.title' => '403 error',
    'default.error.404.cannot-determine-reason' => 'Cannot determine the reason',
    'default.error.404.controller-cannot-dispatch' => 'The controller cannot dispatch this action',
    'default.error.404.controller-invalid' => 'The controller is invalid',
    'default.error.404.controller-name' => 'The controller\'s name',
    'default.error.404.controller-not-found' => 'The controller is not found',
    'default.error.404.controller-resolves-to.%s' => 'The controller resolves to \'%s\'',
    'default.error.404.description' => 'Looks like the page you requested has been moved or removed.
But don\'t worry, instead take a stroll around on the homepage.',
    'default.error.404.message' => 'We can\'t find that page',
    'default.error.404.router-no-match' => 'The router has no matches',
    'default.error.404.occurred' => 'Take a deep breath',
    'default.error.404.title' => '404 error',
    'default.error.exception' => 'Exception',
    'default.error.file' => 'File',
    'default.error.mesage' => 'Message',
    'default.error.no-exception' => 'There is no exception available',
    'default.error.occurred' => 'Error occured',
    'default.error.previous' => 'Previous error(s)',
    'default.error.stack' => 'Stack trace',
    'default.export' => 'Export',
    'default.failed' => 'Failed',
    'default.find' => 'Find',
    'default.findNext' => 'Find next',
    'default.findPrevious' => 'Find previous',
    'default.finish' => 'Finish',
    'default.form.module.modules.facebookLogin' => 'Facebook login',
    'default.form.module.modules.googleAnalytics' => 'Google analytics',
    'default.form.module.modules.googleSiteVerification' => 'Google site-verification',
    'default.form.module.modules.googleMap' => 'Google maps',
    'default.form.module.modules.vote' => 'Vote',
    'default.form.module.modules.openId' => 'OpenID',
    'default.form.module.modules.domainManager' => 'Domain manager',
    'default.form.module.modules.multisiteCentral' => 'Multisite: central',
    'default.form.module.modules.share' => 'Share',
    'default.form.module.modules.embed' => 'Embed content',
    'default.form.module.submit' => 'Save',
    'default.form.module.success' => 'Saved successfully',
    'default.fullscreen' => 'Fullscreen',
    'default.import' => 'Import',
    'default.insert' => 'Insert',
    'default.info' => 'Information',
    'default.link.target.blank' => 'New tab / window',
    'default.link.target.default' => 'Default',
    'default.link.target.parent' => 'Parent frame',
    'default.link.target.self' => 'Self frame',
    'default.link.target.top' => 'Top frame',
    'default.lastmodified' => 'Last modified',
    'default.loading' => 'Loading ...',
    'default.move' => 'Move',
    'default.new' => 'New',
    'default.next' => 'Next',
    'default.no' => 'No',
    'default.noData' => 'No data',
    'default.notSet' => 'Not set',
    'default.ok' => 'Ok',
    'default.paginator.first' => 'First',
    'default.paginator.last' => 'Last',
    'default.paginator.next' => 'Next',
    'default.paginator.previous' => 'Previous',
    'default.pick' => 'Pick',
    'default.pleaseWait' => 'Please wait ...',
    'default.preview' => 'Preview',
    'default.previous' => 'Previous',
    'default.readMore' => 'Read more ...',
    'default.redo' => 'Redo',
    'default.rename' => 'Rename',
    'default.replace' => 'Replace',
    'default.replaceAll' => 'Replace all',
    'default.reset' => 'Reset',
    'default.robots.all' => 'All action allowed',
    'default.robots.default' => '- Default -',
    'default.robots.nofollow' => 'Follow disabled',
    'default.robots.noindex' => 'Indexing disabled',
    'default.robots.none' => 'No action allowed',
    'default.rowSet.columns.submit' => 'Set columns',
    'default.rowSet.columns.title' => 'Columns',
    'default.rowSet.empty' => 'Empty',
    'default.rowSet.export.sendHeaders' => 'Export column-names',
    'default.rowSet.export.submit' => 'Export',
    'default.rowSet.export.type' => 'File format',
    'default.rowSet.export.type.csv' => 'Comma-Separated Values (CSV)',
    'default.rowSet.export.type.csv.eol' => 'Line-endings',
    'default.rowSet.export.type.csv.eol.windows' => 'Windows-style (CR+LF)',
    'default.rowSet.export.type.csv.eol.linux' => 'Linux-style (Mac OS 10+; LF)',
    'default.rowSet.export.type.csv.eol.macos' => 'Mac-style (up to Mac OS 9; CR)',
    'default.rowSet.export.type.csv.separator' => 'Value-separator',
    'default.rowSet.export.type.csv.separator.comma' => 'Comma ","',
    'default.rowSet.export.type.csv.separator.semicolon' => 'Semicolon ";"',
    'default.rowSet.export.type.csv.separator.tab' => "Tab \"\t\"",
    'default.rowSet.export.type.xlsx' => 'Microsoft Excel Spreadsheet (XLSX)',
    'default.rowSet.export.type.xlsx.creator' => 'Creator (of the document)',
    'default.rowSet.freeWord.submit' => 'Search',
    'default.rowSet.freeWord.title' => 'Free-word search',
    'default.rowSet.more' => 'More',
    'default.rowSet.noData' => 'There is no displayable data',
    'default.rowSet.notSet' => 'Not set',
    'default.rowSet.search.bool.all' => 'All',
    'default.rowSet.search.bool.not.%s' => 'Not %s',
    'default.rowSet.search.bool.only.%s' => 'Only %s',
    'default.rowSet.search.currency' => 'Currency',
    'default.rowSet.search.date.from' => 'Date from',
    'default.rowSet.search.date.to' => 'Date to',
    'default.rowSet.search.locale.all' => 'All languages',
    'default.rowSet.search.number.max' => 'Maximum',
    'default.rowSet.search.number.min' => 'Minimum',
    'default.rowSet.search.string.like' => 'Like',
    'default.rowSet.search.submit' => 'Search',
    'default.rowSet.search.title' => 'Advanced search',
    'default.save' => 'Save',
    'default.saveAndExit' => 'Save and exit',
    'default.saveAs' => 'Save as ...',
    'default.saved' => 'Saved',
    'default.select' => 'Select',
    'default.setDefault' => 'Set default',
    'default.start' => 'Start',
    'default.success' => 'Success',
    'default.undo' => 'Undo',
    'default.upload' => 'Upload',
    'default.upload.failed' => 'Upload failed',
    'default.upload.success' => 'Upload success',
    'default.uploaded' => 'Uploaded',
    'default.view' => 'View',
    'default.warning' => 'Warning',
    'default.workInProgress' => 'Work in progress ...',
    'default.yes' => 'Yes',
    'default.years.%d.ago' => '%d years ago',
    'default.years.%d.fromNow' => '%d years from now',
    'default.months.%d.ago' => '%d months ago',
    'default.months.%d.fromNow' => '%d months from now',
    'default.days.%d.ago' => '%d days ago',
    'default.days.%d.fromNow' => '%d days from now',
    'default.hours.%d.ago' => '%d hours ago',
    'default.hours.%d.fromNow' => '%d hours from now',
    'default.minutes.%d.ago' => '%d minutes ago',
    'default.minutes.%d.fromNow' => '%d minutes from now',
    'default.seconds.%d.ago' => '%d seconds ago',
    'default.seconds.%d.fromNow' => '%d seconds from now',
    'default.justNow' => 'just now',
);


text:
'use strict';
var fixtures = require('hoist-core/test/fixtures/entities'),
    MongoClient = require('mongodb').MongoClient,
    redis = require('redis'),
    redisClient = redis.createClient(),
    app = require("../../app"),
    _ = require('lodash'),
    request = require('supertest'),
    http = require('http'),
    hoist = require('hoist-core'),
    config = hoist.defaults,
    q = require('hoist-core').q;

describe('get documents', function() {
    var db;
    before(function(done) {
        var saveEntities = [
            new hoist.models.Organisation(fixtures.organisation).saveQ(),
            new hoist.models.Application(fixtures.application).saveQ()
        ];

        q.allSettled(saveEntities).then(function() {
            MongoClient.connect(config.mongo.db, function(err, connection) {
                if (err) {
                    throw err;
                }
                db = connection.db('test-db');
                done();
            });
        }).done();
    });
    after(function(done) {
        hoist.models.Application.remove({}, function() {
            hoist.models.Organisation.remove({}, function() {
                db.dropDatabase(function() {
                    db.close(done);
                });
            });
        });
    });
    describe('getting an existing document based on key in url', function() {
        var responseReceived;
        var existing_document = {
            _type: 'model',
            _id: 'key',
            name: 'document name',
            bool: true
        };
        before(function() {
            responseReceived =
                q.ninvoke(db, 'collection', 'default:default:models')
                .then(function(collection) {
                    return q.ninvoke(collection, 'insert', existing_document);
                })
                .then(function() {
                    var r = request(http.createServer(app))
                        .get('/model/key')
                        .set("Authorization", "Hoist api_key");
                    return q.ninvoke(r, 'end');
                });
        });
        after(function(done) {
            db.collection('default:default:models', function(err, collection) {
                collection.remove(done);
            });
        });
        it('will return a response', function() {
            return responseReceived;
        });
        it('will return the correct document', function() {
            return responseReceived.then(function(response) {
                response.body._id.should.eql('key');
                response.body._type.should.eql('model');
                response.body.name.should.eql('document name');
                response.body.bool.should.eql(true);
            });
        });
        it('will return status code to 200', function() {
            return responseReceived.then(function(response) {
                response.statusCode.should.eql(200);
            });
        });
    });
    describe('getting an existing document based on key in url scoped to document by origin header', function() {
        var responseReceived;
        var existing_document = {
            _type: 'model',
            _id: 'key',
            name: 'document name in other store',
            bool: true
        };
        before(function() {
            responseReceived =
                q.ninvoke(db, 'collection', 'dev:default:models')
                .then(function(collection) {
                    return q.ninvoke(collection, 'insert', existing_document);
                }).then(function() {
                    var r = request(http.createServer(app))
                        .get('/model/key')
                        .set("Authorization", "Hoist api_key")
                        .set('origin', 'http://sparkle-motion-dev.app.hoi.io');
                    return q.ninvoke(r, 'end');
                });
        });
        after(function(done) {
            db.collection('dev:default:models', function(err, collection) {
                collection.remove(done);
            });
        });
        it('will return a response', function() {
            return responseReceived;
        });
        it('will return the correct document', function() {
            return responseReceived.then(function(response) {
                response.body._id.should.eql('key');
                response.body._type.should.eql('model');
                response.body.name.should.eql('document name in other store');
                response.body.bool.should.eql(true);
            });
        });
        it('will set status code to 200', function() {
            return responseReceived.then(function(response) {
                response.statusCode.should.eql(200);
            });
        });
    });

    describe('getting an existing document based on key in url scoped to environment by query string', function() {
        var responseReceived;
        var existing_document = {
            _type: 'model',
            _id: 'key',
            name: 'document name in other store',
            bool: true
        };
        before(function() {
            responseReceived =
                q.ninvoke(db, 'collection', 'other:default:models')
                .then(function(collection) {
                    return q.ninvoke(collection, 'insert', existing_document);
                }).then(function() {
                    var r = request(http.createServer(app))
                        .get('/model/key?overrideEnvironment=other')
                        .set("Authorization", "Hoist api_key");
                    return q.ninvoke(r, 'end');
                });
        });
        after(function(done) {
            db.collection('other:default:models', function(err, collection) {
                collection.remove(done);
            });
        });
        it('will return a response', function() {
            return responseReceived;
        });
        it('will return the correct document', function() {
            return responseReceived.then(function(response) {
                response.body._id.should.eql('key');
                response.body._type.should.eql('model');
                response.body.name.should.eql('document name in other store');
                response.body.bool.should.eql(true);
            });
        });
        it('will set status code to 200', function() {
            return responseReceived.then(function(response) {
                response.statusCode.should.eql(200);
            });
        });
    });
    describe('attempting to get a document that doesn\'t exist', function() {
        var responseReceived;
        before(function() {
            var r = request(http.createServer(app))
                .get('/model/key')
                .set("Authorization", "Hoist api_key");
            responseReceived = q.ninvoke(r, 'end');
        });
        it('will return a response', function() {
            return responseReceived;
        });
        it('will return a 404 status code', function() {
            return responseReceived.then(function(response) {
                response.statusCode.should.equal(404);
            });
        });
    });

    describe('getting root model collection', function() {
        var existing_document = {
            x_type: 'model',
            x_id: 'key',
            name: 'document name'
        };
        var existing_document2 = {
            x_type: 'model',
            x_id: 'key2',
            name: 'document name 2'
        };
        var responseReceived;
        before(function() {
            responseReceived = q.ninvoke(db, 'collection', 'default:default:models')
                .then(function(collection) {
                    return q.ninvoke(collection, 'insert', [existing_document, existing_document2]);
                }).then(function() {
                    var r = request(http.createServer(app))
                        .get('/model')
                        .set("Authorization", "Hoist api_key");
                    return q.ninvoke(r, 'end');
                });

        });
        after(function(done) {
            db.collection('default:default:models', function(err, collection) {
                collection.remove(done);
            });
        });
        it('should return ok', function() {
            return responseReceived.then(function(response) {
                response.statusCode.should.equal(200);
            });
        });
        it('should return a collection of all items', function() {
            return responseReceived.then(function(response) {
                response.body.length.should.equal(2);
            });
        });
    });

    describe('getting root model collection with no items', function() {
        var responseReceived;
        before(function() {
            var r = request(http.createServer(app))
                .get('/model')
                .set("Authorization", "Hoist api_key");
            responseReceived = q.ninvoke(r, 'end');

        });
        it('should return a 200 status code', function() {
            return responseReceived.then(function(response) {
                response.statusCode.should.equal(200);
            });
        });
        it('should return an empty collection of items', function() {
            return responseReceived.then(function(response) {
                response.body.should.be.an.instanceof(Array);
                response.body.length.should.equal(0);
            });
        });
    });
    describe('getting an existing document scoped to bucket by header', function() {
        var responseReceived;
        var existing_document = {
            _type: 'model',
            _id: 'key',
            name: 'document name in other store',
            bool: true
        };
        before(function() {
            responseReceived =
                hoist.models.Application.findOneQ({
                    apiKey: 'api_key'
                }).then(function(application) {
                    var environment = application.environments[0];
                    environment.buckets.push({
                        meta: {

                        },
                        members: [{
                            memberId: environment.members[0]._id,
                            role: 'User'
                        }],
                        owner: environment.members[0]._id,
                        key: 'bucket_key'
                    });
                    return application.saveQ();
                }).then(function() {
                    redisClient.select(10);
                    var sessionValue = JSON.stringify({
                        cookie: {
                            originalMaxAge: null,
                            expires: null,
                            httpOnly: true,
                            domain: "",
                            path: ""
                        },
                        passport: {
                            user: fixtures.application._id,
                            member: fixtures.application.environments[0].members[0]
                        }
                    });
                    return q.ninvoke(redisClient, 'set', 'sess:71jm6psbhcDjtitn8lvXlZWA', sessionValue);
                }).then(function() {
                    return q.ninvoke(db, 'collection', 'default:bucket_key:models')
                        .then(function(collection) {
                            return q.ninvoke(collection, 'insert', existing_document);
                        }).then(function() {
                            var r = request(http.createServer(app))
                                .get('/model/key')
                                .set('x-bucket-key', 'bucket_key')
                                .set('cookie', 'hoist-session-api_key=s%3A71jm6psbhcDjtitn8lvXlZWA.LY4Iz1TG7ih66%2BF7D30FYLsXcQPaFldgDGDXq2Q7yTY')
                                .set("Authorization", "Hoist api_key");
                            return q.ninvoke(r, 'end');
                        });
                });

        });
        after(function(done) {
            db.collection('other:default:models', function(err, collection) {
                collection.remove(done);
            });
        });
        it('will return a response', function() {
            return responseReceived;
        });
        it('will return the correct document', function() {
            return responseReceived.then(function(response) {
                response.body._id.should.eql('key');
                response.body._type.should.eql('model');
                response.body.name.should.eql('document name in other store');
                response.body.bool.should.eql(true);
            });
        });
        it('will set status code to 200', function() {
            return responseReceived.then(function(response) {
                response.statusCode.should.eql(200);
            });
        });
    });
    describe('getting model collection with limit', function() {
        var existing_document = {
            x_type: 'model',
            x_id: 'key',
            name: 'document name'
        };
        var existing_document2 = {
            x_type: 'model',
            x_id: 'key2',
            name: 'document name 2'
        };
        var existing_document3 = {
            x_type: 'model',
            x_id: 'key3',
            name: 'document name 3'
        };
        var responseReceived;
        before(function() {
            responseReceived = q.ninvoke(db, 'collection', 'default:default:models')
                .then(function(collection) {
                    return q.ninvoke(collection, 'insert', [existing_document, existing_document2, existing_document3]);
                }).then(function() {
                    var r = request(http.createServer(app))
                        .get('/model')
                        .query({
                            limit: 2
                        })
                        .set("Authorization", "Hoist api_key");
                    return q.ninvoke(r, 'end');
                });

        });
        after(function(done) {
            db.collection('default:default:models', function(err, collection) {
                collection.remove(done);
            });
        });
        it('should return ok', function() {
            return responseReceived.then(function(response) {
                response.statusCode.should.equal(200);
            });
        });
        it('should return a collection of all items', function() {
            return responseReceived.then(function(response) {
                response.body.length.should.equal(2);
            });
        });
    });
    describe('getting model collection with skip', function() {
        var existing_document = {
            x_type: 'model',
            x_id: 'key',
            name: 'document name'
        };
        var existing_document2 = {
            x_type: 'model',
            x_id: 'key2',
            name: 'document name 2'
        };
        var existing_document3 = {
            x_type: 'model',
            x_id: 'key3',
            name: 'document name 3'
        };
        var responseReceived;
        before(function() {
            responseReceived = q.ninvoke(db, 'collection', 'default:default:models')
                .then(function(collection) {
                    return q.ninvoke(collection, 'insert', [existing_document, existing_document2, existing_document3]);
                }).then(function() {
                    var r = request(http.createServer(app))
                        .get('/model')
                        .query({
                            skip: 2
                        })
                        .set("Authorization", "Hoist api_key");
                    return q.ninvoke(r, 'end');
                });

        });
        after(function(done) {
            db.collection('default:default:models', function(err, collection) {
                collection.remove(done);
            });
        });
        it('should return ok', function() {
            return responseReceived.then(function(response) {
                response.statusCode.should.equal(200);
            });
        });
        it('should return a collection of all items', function() {
            return responseReceived.then(function(response) {
                response.body.length.should.equal(1);
            });
        });
    });
    describe('getting model collection with sort', function() {
        var existing_document = {
            x_type: 'model',
            x_id: 'key',
            name: 'document name'
        };
        var existing_document2 = {
            x_type: 'model',
            x_id: 'key2',
            name: 'document name 2'
        };
        var existing_document3 = {
            x_type: 'model',
            x_id: 'key3',
            name: 'document name 3'
        };
        var responseReceived;
        before(function() {
            responseReceived = q.ninvoke(db, 'collection', 'default:default:models')
                .then(function(collection) {
                    return q.ninvoke(collection, 'insert', [existing_document, existing_document2, existing_document3]);
                }).then(function() {
                    var r = request(http.createServer(app))
                        .get('/model')
                        .query({
                            sort: JSON.stringify([
                                ['name', -1]
                            ])
                        })
                        .set("Authorization", "Hoist api_key");
                    return q.ninvoke(r, 'end');
                });

        });
        after(function(done) {
            db.collection('default:default:models', function(err, collection) {
                collection.remove(done);
            });
        });
        it('should return ok', function() {
            return responseReceived.then(function(response) {
                response.statusCode.should.equal(200);
            });
        });
        it('should return a collection of all items in correct order', function() {
            return responseReceived.then(function(response) {
                response.body.length.should.equal(3);
                _.pluck(response.body, 'name').should.eql(["document name 3",
                    "document name 2",
                    "document name"
                ]);
            });
        });
    });
});


text:
package joshie.harvest.api.cooking;

import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import java.util.LinkedHashMap;
import java.util.Map;

public class Utensil {
    public static final Map<ResourceLocation, Utensil> REGISTRY = new LinkedHashMap<>();
    private final ResourceLocation resource;
    private final String unlocalized;
    private final String burntName;
    private ItemStack burntItem;

    public Utensil(ResourceLocation resource) {
        this.resource = resource;
        this.unlocalized = resource.getResourceDomain() + ".cookware." + resource.getResourcePath().replace("_", ".");
        this.burntName = resource.getResourceDomain() + ".meal.burnt." + resource.getResourcePath().replace("_", ".");
        REGISTRY.put(resource, this);
    }

    public Utensil setBurntItem(ItemStack burntItem) {
        this.burntItem = burntItem;
        return this;
    }

    public ItemStack getBurntItem() {
        return burntItem;
    }

    public ResourceLocation getResource() {
        return resource;
    }

    /** Return the resource location to use for this utensil
     *  when a recipe is burnt */
    @SideOnly(Side.CLIENT)
    public ModelResourceLocation getModelForMeal() {
        return new ModelResourceLocation(getResource().getResourceDomain() + ":meal", "burnt_" + getResource().getResourcePath());
    }

    public String getLocalizedName() {
        return I18n.translateToLocal(unlocalized);
    }

    /** Return the unlocalized name for this utensil when it's burnt **/
    public String getBurntName() {
        return I18n.translateToLocal(burntName);
    }
}


text:
    Staff Manager

        Please review all of the current staff in the Site.

          Total staff:

        <form class="form-inline">

              <input class="form-control" type="text" placeholder="Add new Staff by VHUR..." id="searchVHUR">

                <button class="btn btn-default test2" type="button" data-toggle="modal" data-target="#modalForm"id="search">

                </button>

        </form>

        <button class="btn btn-info pull-right" type="button" onclick="fnExcelReport();">

 Export to Excel</button>

        VHUR
        Inconcert
        Name
        Position
        Supervisor
        Language
        Hire Date
        Edit
        Delete

      <?php foreach ($result as $key): ?>

          <?php echo $key['vhur']; ?>
          <?php echo $key['inconcert']; ?>
          <?php echo $key['Name']; ?>
          <?php echo $key['Cargo']; ?>
          <?php echo $key['Supervisor']; ?>
          <?php echo $key['lang']; ?>
          <?php echo $key['h_dt']; ?>

            <button class="btn btn-success btn-xs editStaff"
                    type="button"
                    name="edit"
                    data-toggle="modal"
                    data-target="#modalForm"
                    data-vhur="<?php echo $key['vhur']; ?>"
                    data-name="<?php echo $key['Name']; ?>"
                    data-cargo="<?php echo $key['Cargo']; ?>"
                    data-superior="<?php echo $key['Supervisor']; ?>">

            </button>

            <button class="btn btn-danger btn-xs removeStaff"
                    type="button"
                    name="remove"
                    data-toggle="modal"
                    data-target="#modalForm"
                    data-vhur="<?php echo $key['vhur']; ?>"
                    data-name="<?php echo $key['Name']; ?>"
                    data-cargo="<?php echo $key['Cargo']; ?>"
                    data-superior="<?php echo $key['Supervisor']; ?>">

            </button>

      <?php endforeach; ?>

        <button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>

Edit Staff

Remove Staff

      <form>

            <button type="button" class="close" data-dismiss="alert" aria-label="Close">×</button>

            <button type="button" class="close" data-dismiss="alert" aria-label="Close">×</button>

            Name
            <input class="form-control" type="hidden" name="vhur" id="vhur" value="">
            <input class="form-control" type="text" name="name" id="name" disabled>

            Supervisor
            <select class="form-control" name="sup" id="sup">
              <?php foreach ($suplist as $key): ?>
                <option value="<?php echo $key['vhur']; ?>"><?php echo $key['Name']; ?></option>
              <?php endforeach; ?>
            </select>

            Position
            <select class="form-control" name="position" id="position">
              <?php foreach ($cargos as $key): ?>
                <option value="<?php echo $key['id_cargo']; ?>"><?php echo $key['nombre_cargo']; ?></option>
              <?php endforeach; ?>
            </select>

          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
          <input class="btn btn-primary" type="submit" name="submit" value="Save" id="save">
          <input class="btn btn-danger" type="submit" name="search" value="Process" id="delete">

      </form>


text:
function gitInfo=getGitInfo(varargin)
% Get information about the Git repository in the current directory, including:
%          - branch name of the current Git Repo
%          -Git SHA1 HASH of the most recent commit
%          -url of corresponding remote repository, if one exists
%
% The function first checks to see if a .git/ directory is present. If so it
% reads the .git/HEAD file to identify the branch name and then it looks up
% the corresponding commit.
%
% It then reads the .git/config file to find out the url of the
% corresponding remote repository. This is all stored in a gitInfo struct.
%
% Note this uses only file information, it makes no external program
% calls at all.
%
% This function must be in the base directory of the git repository
%
% Released under a BSD open source license. Based on a concept by Marc
% Gershow.
%
% Andrew Leifer
% Harvard University
% Program in Biophysics, Center for Brain Science,
% and Department of Physics
% leifer@fas.harvard.edu
% http://www.andrewleifer.com
% 12 September 2011
%
%
%

% Copyright 2011 Andrew Leifer. All rights reserved.
%
% Redistribution and use in source and binary forms, with or without modification, are
% permitted provided that the following conditions are met:
%
%    1. Redistributions of source code must retain the above copyright notice, this list of
%       conditions and the following disclaimer.
%
%    2. Redistributions in binary form must reproduce the above copyright notice, this list
%       of conditions and the following disclaimer in the documentation and/or other materials
%       provided with the distribution.
%
% THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY EXPRESS OR IMPLIED
% WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
% FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
% CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
% CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
% SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
% ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
% NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
% ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
%
% The views and conclusions contained in the software and documentation are those of the
% authors and should not be interpreted as representing official policies, either expressed
% or implied, of <copyright holder>.

 gitInfo=[];
if ~isempty(varargin) && length(varargin) ==1
    repoPath = fullfile(varargin{1},'.git');
else
    repoPath = '.git';
end

if ~exist(repoPath,'file') || ~exist([repoPath '/HEAD'],'file')
    %Git is not present
    return
end

%Read in the HEAD information, this will tell us the location of the file
%containing the SHA1
text=fileread([repoPath '/HEAD']);
parsed=textscan(text,'%s');

if ~strcmp(parsed{1}{1},'ref:') || ~length(parsed{1})>1
        %the HEAD is not in the expected format.
        %give up
        return
end

path=parsed{1}{2};
[pathstr, name, ext]=fileparts(path);
branchName=name;

%save branchname
gitInfo.branch=branchName;

%Read in SHA1
SHA1text=fileread(fullfile(repoPath, pathstr,[name ext]));
SHA1=textscan(SHA1text,'%s');
gitInfo.hash=SHA1{1}{1};

%Read in config file
config=fileread([repoPath '/config']);
%Find everything space delimited
temp=textscan(config,'%s','delimiter','\n');
lines=temp{1};

remote='';
%Lets find the name of the remote corresponding to our branchName
for k=1:length(lines)

    %Are we at the section describing our branch?
    if strcmp(lines{k},['[branch "' branchName '"]'])
        m=k+1;
        %While we haven't run out of lines
        %And while we haven't run into another section (which starts with
        % an open bracket)
        while (m<=length(lines) && ~strcmp(lines{m}(1),'[') )
            temp=textscan(lines{m},'%s');
            if length(temp{1})>=3
                if strcmp(temp{1}{1},'remote') && strcmp(temp{1}{2},'=')
                    %This is the line that tells us the name of the remote
                    remote=temp{1}{3};
                end
            end

            m=m+1;
        end

    end
end
gitInfo.remote=remote;

url='';
%Find the remote's url
for k=1:length(lines)

    %Are we at the section describing our branch?
    if strcmp(lines{k},['[remote "' remote '"]'])
        m=k+1;
        %While we haven't run out of lines
        %And while we haven't run into another section (which starts with
        % an open bracket)
        while (m<=length(lines) && ~strcmp(lines{m}(1),'[') )
            temp=textscan(lines{m},'%s');
            if length(temp{1})>=3
                if strcmp(temp{1}{1},'url') && strcmp(temp{1}{2},'=')
                    %This is the line that tells us the name of the remote
                    url=temp{1}{3};
                end
            end

            m=m+1;
        end

    end
end

gitInfo.url=url;


text:
import React from 'react';
import { shallow } from 'enzyme';

import { HomeComponent as Home } from '../../src/components/Home';

function setup() {
  const props = {
    number: 1,
    onTick: jest.fn(),
    onIncreaseClick: jest.fn(),
    onDecreaseClick: jest.fn(),
  };

  const homeComponent = shallow(<Home {...props} />);

  return {
    props,
    homeComponent,
  };
}

test('Home should have a class "home"', () => {
  const { homeComponent } = setup();
  expect(homeComponent.is('.home')).toBe(true);
});

test('Home.onIncreaseClick should be called with 2', () => {
  const { props, homeComponent } = setup();
  const increaseBtn = homeComponent.find('.btn--increase');
  expect(increaseBtn).toBeTruthy();
  increaseBtn.simulate('click');
  expect(props.onIncreaseClick).toBeCalledWith(2);
});

test('Home.onDecreaseClick should be called with 2', () => {
  const { props, homeComponent } = setup();
  const decreaseBtn = homeComponent.find('.btn--decrease');
  expect(decreaseBtn).toBeTruthy();
  decreaseBtn.simulate('click');
  expect(props.onDecreaseClick).toBeCalledWith(2);
});