text:
package com.google.template.soy.passes;

import static com.google.common.base.Preconditions.checkState;

import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import com.google.template.soy.base.SourceLocation;
import com.google.template.soy.error.ErrorReporter;
import com.google.template.soy.error.SoyErrorKind;
import com.google.template.soy.exprtree.AbstractExprNodeVisitor;
import com.google.template.soy.exprtree.ExprNode;
import com.google.template.soy.exprtree.ExprNode.ParentExprNode;
import com.google.template.soy.exprtree.ExprRootNode;
import com.google.template.soy.exprtree.GlobalNode;
import com.google.template.soy.exprtree.VarDefn;
import com.google.template.soy.exprtree.VarRefNode;
import com.google.template.soy.soytree.AbstractSoyNodeVisitor;
import com.google.template.soy.soytree.ForNode;
import com.google.template.soy.soytree.ForeachNonemptyNode;
import com.google.template.soy.soytree.LetContentNode;
import com.google.template.soy.soytree.LetValueNode;
import com.google.template.soy.soytree.PrintNode;
import com.google.template.soy.soytree.SoyNode;
import com.google.template.soy.soytree.SoyNode.BlockNode;
import com.google.template.soy.soytree.SoyNode.ExprHolderNode;
import com.google.template.soy.soytree.SoyNode.ParentSoyNode;
import com.google.template.soy.soytree.TemplateNode;
import com.google.template.soy.soytree.defn.InjectedParam;
import com.google.template.soy.soytree.defn.LocalVar;
import com.google.template.soy.soytree.defn.LoopVar;
import com.google.template.soy.soytree.defn.TemplateParam;
import com.google.template.soy.soytree.defn.UndeclaredVar;
import java.util.ArrayDeque;
import java.util.BitSet;
import java.util.Deque;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * Visitor which resolves all variable and parameter references to point to the corresponding
 * declaration object.
 *
 */
final class ResolveNamesVisitor extends AbstractSoyNodeVisitor<Void> {
  private static final SoyErrorKind GLOBAL_MATCHES_VARIABLE =
      SoyErrorKind.of(
          "Found global reference aliasing a local variable ''{0}'', did you mean " + "''${0}''?");

  private static final SoyErrorKind VARIABLE_ALREADY_DEFINED =
      SoyErrorKind.of("variable ''${0}'' already defined{1}");

  /**
   * A data structure that assigns a unique (small) integer to all local variable definitions that
   * are active within a given lexical scope.
   *
   *
A 'slot' is a small integer that is assigned to a {@link VarDefn} such that at any given
   * point of execution while that variable could be referenced there is only one variable with that
   * index.
   */
  private final class LocalVariables {
    private final BitSet availableSlots = new BitSet();
    private final Deque<Map<String, VarDefn>> currentScope = new ArrayDeque<>();
    private final BitSet slotsToRelease = new BitSet();

    /** Tracks the next unused slot to claim. */
    private int nextSlotToClaim = 0;

    /**
     * A counter that tracks when to release the {@link #slotsToRelease} set.
     *
     *
We add {@link #slotsToRelease} to {@link #availableSlots} only when exiting a scope if
     * this value == 0.
     */
    private int delayReleaseClaims = 0;

    /**
     * Enters a new scope. Variables {@link #define defined} will have a lifetime that extends until
     * a matching call to {@link #exitScope()}.
     */
    void enterScope() {
      currentScope.push(new LinkedHashMap<String, VarDefn>());
    }

    /**
     * Enters a new scope.
     *
     *
Variables defined in a lazy scope have a lifetime that extends to the matching {@link
     * #exitLazyScope()} call, but the variable slots reserved have their lifetimes extended until
     * the parent scope closes.
     */
    void enterLazyScope() {
      delayReleaseClaims++;
      enterScope();
    }

    /** Exits the current scope. */
    void exitLazyScope() {
      checkState(delayReleaseClaims > 0, "Exiting a lazy scope when we aren't in one");
      exitScope();
      delayReleaseClaims--;
    }

    /**
     * Exits the current lazy scope.
     *
     *
This releases all the variable indices associated with the variables defined in this frame
     * so that they can be reused.
     */
    void exitScope() {
      Map<String, VarDefn> variablesGoingOutOfScope = currentScope.pop();
      for (VarDefn var : variablesGoingOutOfScope.values()) {
        if (var instanceof LoopVar) {
          LoopVar loopVar = (LoopVar) var;
          slotsToRelease.set(loopVar.currentLoopIndexIndex());
          slotsToRelease.set(loopVar.isLastIteratorIndex());
        }
        slotsToRelease.set(var.localVariableIndex());
      }
      if (delayReleaseClaims == 0) {
        availableSlots.or(slotsToRelease);
        slotsToRelease.clear();
      }
    }

    /**
     * Returns the {@link VarDefn} associated with the given name by searching through the current
     * scope and all parent scopes.
     */
    VarDefn lookup(String name) {
      for (Map<String, VarDefn> scope : currentScope) {
        VarDefn defn = scope.get(name);
        if (defn != null) {
          return defn;
        }
      }
      return null;
    }

    /**
     * Defines a {@link LoopVar}. Unlike normal local variables and params loop variables get 2
     * extra implicit local variables for tracking the current index and whether or not we are at
     * the last index.
     */
    boolean define(LoopVar defn, SoyNode definingNode) {
      if (!define((VarDefn) defn, definingNode)) {
        return false;
      }
      // only allocate the extra slots if definition succeeded
      defn.setExtraLoopIndices(claimSlot(), claimSlot());
      return true;
    }

    /** Defines a variable. */
    boolean define(VarDefn defn, SoyNode definingNode) {
      // Search for the name to see if it is being redefined.
      VarDefn preexisting = lookup(defn.name());
      if (preexisting != null) {
        Optional<SourceLocation> sourceLocation = forVarDefn(preexisting);
        String location =
            sourceLocation.isPresent() ? " at line " + sourceLocation.get().getBeginLine() : "";
        errorReporter.report(
            definingNode.getSourceLocation(), VARIABLE_ALREADY_DEFINED, defn.name(), location);
        return false;
      }
      currentScope.peek().put(defn.name(), defn);
      defn.setLocalVariableIndex(claimSlot());
      return true;
    }

    /**
     * Returns the smallest available local variable slot or claims a new one if there is none
     * available.
     */
    private int claimSlot() {
      int nextSetBit = availableSlots.nextSetBit(0);
      int slotToUse;
      if (nextSetBit != -1) {
        slotToUse = nextSetBit;
        availableSlots.clear(nextSetBit);
      } else {
        slotToUse = nextSlotToClaim;
        nextSlotToClaim++;
      }
      return slotToUse;
    }

    void verify() {
      checkState(delayReleaseClaims == 0, "%s lazy scope(s) are still active", delayReleaseClaims);
      checkState(slotsToRelease.isEmpty(), "%s slots are waiting to be released", slotsToRelease);
      BitSet unavailableSlots = new BitSet(nextSlotToClaim);
      unavailableSlots.set(0, nextSlotToClaim);
      // now the only bits on will be the ones where available slots has '0'.
      unavailableSlots.xor(availableSlots);
      checkState(
          unavailableSlots.isEmpty(), "Expected all slots to be available: %s", unavailableSlots);
    }
  }

  /** Scope for injected params. */
  private LocalVariables localVariables;

  private Map<String, InjectedParam> ijParams;

  private final ErrorReporter errorReporter;

  ResolveNamesVisitor(ErrorReporter errorReporter) {
    this.errorReporter = errorReporter;
  }

  @Override
  protected void visitTemplateNode(TemplateNode node) {
    // Create a scope for all parameters.
    localVariables = new LocalVariables();
    localVariables.enterScope();
    ijParams = new HashMap<>();

    // Add both injected and regular params to the param scope.
    for (TemplateParam param : node.getAllParams()) {
      localVariables.define(param, node);
    }

    visitSoyNode(node);
    localVariables.exitScope();
    localVariables.verify();
    node.setMaxLocalVariableTableSize(localVariables.nextSlotToClaim);

    localVariables = null;
    ijParams = null;
  }

  @Override
  protected void visitPrintNode(PrintNode node) {
    visitSoyNode(node);
  }

  @Override
  protected void visitLetValueNode(LetValueNode node) {
    visitExpressions(node);
    // Now after the let-block is complete, define the new variable
    // in the current scope.
    localVariables.define(node.getVar(), node);
  }

  @Override
  protected void visitLetContentNode(LetContentNode node) {
    // LetContent nodes may reserve slots in their sub expressions, but due to lazy evaluation will
    // not use them immediately, so we can't release the slots until the parent scope is gone.
    // however the variable lifetime should be limited
    localVariables.enterLazyScope();
    visitChildren(node);
    localVariables.exitLazyScope();
    localVariables.define(node.getVar(), node);
  }

  @Override
  protected void visitForNode(ForNode node) {
    // Visit the range expressions.
    visitExpressions(node);

    localVariables.enterScope();
    localVariables.define(node.getVar(), node);

    // Visit the node body
    visitChildren(node);
    localVariables.exitScope();
  }

  @Override
  protected void visitForeachNonemptyNode(ForeachNonemptyNode node) {
    // Visit the foreach iterator expression
    visitExpressions(node.getParent());

    // Create a scope to hold the iteration variable
    localVariables.enterScope();
    localVariables.define(node.getVar(), node);

    // Visit the node body
    visitChildren(node);
    localVariables.exitScope();
  }

  @Override
  protected void visitSoyNode(SoyNode node) {
    if (node instanceof ExprHolderNode) {
      visitExpressions((ExprHolderNode) node);
    }

    if (node instanceof ParentSoyNode<?>) {
      if (node instanceof BlockNode) {
        localVariables.enterScope();
        visitChildren((BlockNode) node);
        localVariables.exitScope();
      } else {
        visitChildren((ParentSoyNode<?>) node);
      }
    }
  }

  private void visitExpressions(ExprHolderNode node) {
    ResolveNamesExprVisitor exprVisitor = new ResolveNamesExprVisitor();
    for (ExprRootNode expr : node.getExprList()) {
      exprVisitor.exec(expr);
    }
  }

  private static Optional<SourceLocation> forVarDefn(VarDefn varDefn) {
    if (varDefn instanceof LocalVar) {
      return Optional.of(((LocalVar) varDefn).declaringNode().getSourceLocation());
    } else {
      // TODO(user): plumb source locations through to other VarDefn impls.
      return Optional.absent();
    }
  }

  // -----------------------------------------------------------------------------------------------
  // Expr visitor.

  /**
   * Visitor which resolves all variable and parameter references in expressions to point to the
   * corresponding declaration object.
   */
  private final class ResolveNamesExprVisitor extends AbstractExprNodeVisitor<Void> {

    @Override
    public Void exec(ExprNode node) {
      Preconditions.checkArgument(node instanceof ExprRootNode);
      visit(node);
      return null;
    }

    @Override
    protected void visitExprRootNode(ExprRootNode node) {
      visitChildren(node);
    }

    @Override
    protected void visitExprNode(ExprNode node) {
      if (node instanceof ParentExprNode) {
        visitChildren((ParentExprNode) node);
      }
    }

    @Override
    protected void visitGlobalNode(GlobalNode node) {
      // Check for a typo involving a global reference.  If the author forgets the leading '$' on a
      // variable reference then it will get parsed as a global.  In some compiler configurations
      // unknown globals are not an error.  To ensure that typos are caught we check for this case
      // here.  Making 'unknown globals' an error consistently would be a better solution, though
      // even then we would probably want some typo checking like this.
      // Note.  This also makes it impossible for a global to share the same name as a local.  This
      // should be fine since global names are typically qualified strings.
      String globalName = node.getName();
      VarDefn varDefn = localVariables.lookup(globalName);
      if (varDefn != null) {
        node.suppressUnknownGlobalErrors();
        // This means that this global has the same name as an in-scope local or param.  It is
        // likely that they just forgot the leading '$'
        errorReporter.report(node.getSourceLocation(), GLOBAL_MATCHES_VARIABLE, globalName);
      }
    }

    @Override
    protected void visitVarRefNode(VarRefNode varRef) {
      if (varRef.isDollarSignIjParameter()) {
        InjectedParam ijParam = ijParams.get(varRef.getName());
        if (ijParam == null) {
          ijParam = new InjectedParam(varRef.getName());
          ijParams.put(varRef.getName(), ijParam);
        }
        varRef.setDefn(ijParam);
        return;
      }
      VarDefn varDefn = localVariables.lookup(varRef.getName());
      if (varDefn == null) {
        // this case is mostly about supporting v1 templates.  Undeclared vars for v2 templates are
        // flagged as errors in the CheckTemplateParamsVisitor
        varDefn = new UndeclaredVar(varRef.getName());
      }
      varRef.setDefn(varDefn);
    }
  }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!-- IMPORTANT: This is an internal file that has been generated
     by the Xilinx ISE software.  Any direct editing or
     changes made to this file may result in unpredictable
     behavior or data corruption.  It is strongly advised that
     users do not edit the contents of this file. -->
<DeviceUsageSummary rev="4">
<DesignStatistics TimeStamp="Tue Sep 08 16:27:17 2015"><group name="NetStatistics">
<item name="NumNets_Active" rev="4">
<attrib name="value" value="21"/></item>
<item name="NumNodesOfType_Active_DOUBLE" rev="4">
<attrib name="value" value="16"/></item>
<item name="NumNodesOfType_Active_GENERIC" rev="4">
<attrib name="value" value="17"/></item>
<item name="NumNodesOfType_Active_IOBIN2OUT" rev="4">
<attrib name="value" value="10"/></item>
<item name="NumNodesOfType_Active_IOBOUTPUT" rev="4">
<attrib name="value" value="10"/></item>
<item name="NumNodesOfType_Active_LUTINPUT" rev="4">
<attrib name="value" value="18"/></item>
<item name="NumNodesOfType_Active_OUTBOUND" rev="4">
<attrib name="value" value="18"/></item>
<item name="NumNodesOfType_Active_OUTPUT" rev="4">
<attrib name="value" value="4"/></item>
<item name="NumNodesOfType_Active_PADINPUT" rev="4">
<attrib name="value" value="3"/></item>
<item name="NumNodesOfType_Active_PADOUTPUT" rev="4">
<attrib name="value" value="7"/></item>
<item name="NumNodesOfType_Active_PINBOUNCE" rev="4">
<attrib name="value" value="1"/></item>
<item name="NumNodesOfType_Active_PINFEED" rev="4">
<attrib name="value" value="21"/></item>
<item name="NumNodesOfType_Active_QUAD" rev="4">
<attrib name="value" value="8"/></item>
<item name="NumNodesOfType_Active_SINGLE" rev="4">
<attrib name="value" value="13"/></item>
</group>
<group name="SiteStatistics">
<item name="IOB-IOBM" rev="4">
<attrib name="value" value="5"/></item>
<item name="IOB-IOBS" rev="4">
<attrib name="value" value="5"/></item>
<item name="SLICEX-SLICEM" rev="4">
<attrib name="value" value="1"/></item>
</group>
<group name="MiscellaneousStatistics">
<item name="AGG_BONDED_IO" rev="3">
<attrib name="value" value="10"/></item>
<item name="AGG_IO" rev="3">
<attrib name="value" value="10"/></item>
<item name="AGG_LOCED_IO" rev="3">
<attrib name="value" value="10"/></item>
<item name="AGG_SLICE" rev="3">
<attrib name="value" value="2"/></item>
<item name="NUM_BONDED_IOB" rev="3">
<attrib name="value" value="10"/></item>
<item name="NUM_BSLUTONLY" rev="3">
<attrib name="value" value="4"/></item>
<item name="NUM_BSUSED" rev="3">
<attrib name="value" value="4"/></item>
<item name="NUM_LOCED_IOB" rev="3">
<attrib name="value" value="10"/></item>
<item name="NUM_LOGIC_O6ONLY" rev="3">
<attrib name="value" value="4"/></item>
<item name="NUM_SLICEX" rev="3">
<attrib name="value" value="2"/></item>
<item name="NUM_SLICE_CYINIT" rev="3">
<attrib name="value" value="4"/></item>
<item name="NUM_SLICE_UNUSEDCTRL" rev="3">
<attrib name="value" value="2"/></item>
</group>
</DesignStatistics>
<DeviceUsage TimeStamp="Tue Sep 08 16:27:17 2015"><group name="SiteSummary">
<item name="IOB" rev="4">
<attrib name="total" value="1000000"/><attrib name="used" value="10"/></item>
<item name="IOB_IMUX" rev="4">
<attrib name="total" value="1000000"/><attrib name="used" value="7"/></item>
<item name="IOB_INBUF" rev="4">
<attrib name="total" value="1000000"/><attrib name="used" value="7"/></item>
<item name="IOB_OUTBUF" rev="4">
<attrib name="total" value="1000000"/><attrib name="used" value="3"/></item>
<item name="LUT6" rev="4">
<attrib name="total" value="1000000"/><attrib name="used" value="4"/></item>
<item name="PAD" rev="4">
<attrib name="total" value="1000000"/><attrib name="used" value="10"/></item>
<item name="SLICEX" rev="4">
<attrib name="total" value="1000000"/><attrib name="used" value="2"/></item>
</group>
</DeviceUsage>
<ReportConfigData TimeStamp="Tue Sep 08 16:27:17 2015"><group name="IOB_OUTBUF">
<item name="DRIVEATTRBOX" rev="4">
<attrib name="12" value="3"/></item>
<item name="SLEW" rev="4">
<attrib name="SLOW" value="3"/></item>
<item name="SUSPEND" rev="4">
<attrib name="3STATE" value="3"/></item>
</group>
</ReportConfigData>
<ReportPinData TimeStamp="Tue Sep 08 16:27:17 2015"><group name="IOB_OUTBUF">
<item name="IN" rev="4">
<attrib name="value" value="3"/></item>
<item name="OUT" rev="4">
<attrib name="value" value="3"/></item>
</group>
<group name="SLICEX">
<item name="A" rev="4">
<attrib name="value" value="2"/></item>
<item name="A1" rev="4">
<attrib name="value" value="1"/></item>
<item name="A2" rev="4">
<attrib name="value" value="1"/></item>
<item name="A3" rev="4">
<attrib name="value" value="2"/></item>
<item name="A4" rev="4">
<attrib name="value" value="2"/></item>
<item name="A5" rev="4">
<attrib name="value" value="2"/></item>
<item name="A6" rev="4">
<attrib name="value" value="2"/></item>
<item name="C" rev="4">
<attrib name="value" value="1"/></item>
<item name="C1" rev="4">
<attrib name="value" value="1"/></item>
<item name="C2" rev="4">
<attrib name="value" value="1"/></item>
<item name="C3" rev="4">
<attrib name="value" value="1"/></item>
<item name="C4" rev="4">
<attrib name="value" value="1"/></item>
<item name="C5" rev="4">
<attrib name="value" value="1"/></item>
<item name="C6" rev="4">
<attrib name="value" value="1"/></item>
<item name="D" rev="4">
<attrib name="value" value="1"/></item>
<item name="D5" rev="4">
<attrib name="value" value="1"/></item>
<item name="D6" rev="4">
<attrib name="value" value="1"/></item>
</group>
<group name="PAD">
<item name="PAD" rev="4">
<attrib name="value" value="10"/></item>
</group>
<group name="IOB_INBUF">
<item name="OUT" rev="4">
<attrib name="value" value="7"/></item>
<item name="PAD" rev="4">
<attrib name="value" value="7"/></item>
</group>
<group name="LUT6">
<item name="A1" rev="4">
<attrib name="value" value="2"/></item>
<item name="A2" rev="4">
<attrib name="value" value="2"/></item>
<item name="A3" rev="4">
<attrib name="value" value="3"/></item>
<item name="A4" rev="4">
<attrib name="value" value="3"/></item>
<item name="A5" rev="4">
<attrib name="value" value="4"/></item>
<item name="A6" rev="4">
<attrib name="value" value="4"/></item>
<item name="O6" rev="4">
<attrib name="value" value="4"/></item>
</group>
<group name="IOB_IMUX">
<item name="I" rev="4">
<attrib name="value" value="7"/></item>
<item name="OUT" rev="4">
<attrib name="value" value="7"/></item>
</group>
<group name="IOB">
<item name="I" rev="4">
<attrib name="value" value="7"/></item>
<item name="O" rev="4">
<attrib name="value" value="3"/></item>
<item name="PAD" rev="4">
<attrib name="value" value="10"/></item>
</group>
</ReportPinData>
<CmdHistory>
</CmdHistory>
</DeviceUsageSummary>

redpajama_set_name: RedPajamaGithub


text:
local suspectPlayers = {}
function ping()
	setElementData(client, 'lastping', getRealTime().timestamp)
end
addEvent('ping', true)
addEventHandler('ping', root, ping)

setTimer(function()
	for k, v in ipairs(getElementsByType'player') do
		local lastping = getElementData(v,'lastping')
		if lastping and getRealTime().timestamp - lastping > 15 and not suspectPlayers[v] then

			if not suspectPlayers[v] then
				local p = getPlayerPing(v)
				suspectPlayers[v] = {}
				table.insert(suspectPlayers[v],{ping = p})
			end

		end
	end
end, 20000, 0)

function checkSuspectPlayers() -- Check if FPS and Ping are constant before real kick, this should eliminate all false positives

	for player, t in pairs(suspectPlayers) do
		if isElement(player) then --to prevent warnings
			if #t < 4 then -- only record 4 times

				local p = getPlayerPing(player)
				table.insert(suspectPlayers[player],{ping = p})
			elseif #t >= 4 then -- if recorded 4 times then compare
				local isTimedOut = true

				for i=1,3 do
					if t[i][ping] ~= t[i+1][ping] then -- If ping/fps has changed in the meantime, it means the player is not timed out
						isTimedOut = false

						break
					end
				end

				if isTimedOut then
					suspectPlayers[player] = nil
					kickPlayer(player, 'Timed out (timeout detection)')
					return
				end

				suspectPlayers[player] = nil -- Player is not timed out
			end
		end
	end

end
-- setTimer(checkSuspectPlayers,2000,0)


text:
import unittest
from .disable_checks import DisableChecks
class DisableChecksTest(unittest.TestCase):
    def test_as_string(self):
        self.assertEquals("SET FOREIGN_KEY_CHECKS=0;", str(DisableChecks()))


text:
// Type: ClrTest.Reflection.InlineBrTargetInstruction
// Assembly: Depender.Parser, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 7BFB306E-D2F0-493B-8C2F-5C3CEA04F731
// Assembly location: D:\temp\NSplit\Depender\Depender.Parser.dll

using System.Reflection.Emit;

namespace ClrTest.Reflection
{
  public class InlineBrTargetInstruction : ILInstruction
  {
    private int m_delta;

    public int Delta
    {
      get
      {
        return this.m_delta;
      }
    }

    public int TargetOffset
    {
      get
      {
        return this.m_offset + this.m_delta + 1 + 4;
      }
    }

    internal InlineBrTargetInstruction(int offset, OpCode opCode, int delta)
      : base(offset, opCode)
    {
      this.m_delta = delta;
    }

    public override void Accept(ILInstructionVisitor vistor)
    {
      vistor.VisitInlineBrTargetInstruction(this);
    }
  }
}


text:
shareability
============

Shareability test suite.

**This is still a work in progress**


text:
<!DOCTYPE html>
<html ng-app="app">
<head lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title ng-bind="$root.pageTitle"></title>

    <!-- new bower components css files should be add just like below -->
    <!-- build:css styles/libs.css -->
    <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css">
    <link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.css">
    <!-- endbuild -->

    <!-- build:css styles/main.css -->
    <link rel="stylesheet" href="styles/css/main.css"/>
    <!-- endbuild -->

    <!-- Favicon -->
    <link href="http://www.codenvoi.com/wp-content/uploads/2015/12/favicon-16x16.png" rel="shortcut icon" type="image/x-icon" />

</head>

<body class="">

    <div ui-view></div>

    <!-- ngInclude Modals here to avoid build issues -->

</body>

<!-- new bower components js files should be add just like below -->
<!-- build:js scripts/libs.js -->
<script src="bower_components/jquery/dist/jquery.min.js"></script>
<script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="bower_components/lodash/dist/lodash.min.js"></script>
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/angular-sanitize/angular-sanitize.min.js"></script>
<script src="bower_components/angular-ui-router/release/angular-ui-router.min.js"></script>
<script src="bower_components/restangular/src/restangular.js"></script>
<script src="bower_components/angular-aria/angular-aria.min.js"></script>
<script src="bower_components/angular-messages/angular-messages.js"></script>
<script src="bower_components/ngstorage/ngStorage.min.js"></script>
<!-- endbuild -->

<!-- new angular components should be add just like below -->
<!-- build:js scripts/app.js -->
<!-- Modules -->
<script src="src/common/common.module.js"></script>
<script src="src/components/components.module.js"></script>
<script src="src/core/core.module.js"></script>
<script src="src/layouts/layouts.module.js"></script>
<script src="src/app.module.js"></script>
<!-- Configs, Runs, Constants -->
<script src="src/core/restangular.config.js"></script>
<script src="src/core/router.config.js"></script>
<script src="src/core/httpStatus.constant.js"></script>
<script src="src/core/core.constant.js"></script>
<!-- Factories -->
<!-- Directives -->
<!-- Controllers -->
<script src="src/layouts/layouts.controller.js"></script>
<!-- endbuild -->

</html>


text:
package com.google.debugging.sourcemap;

import java.io.IOException;

/**
 * We encode our variable length numbers as base64 encoded strings with
 * the least significant digit coming first.  Each base64 digit encodes
 * a 5-bit value (0-31) and a continuation bit.  Signed values can be
 * represented by using the least significant bit of the value as the
 * sign bit.
 *
 * @author johnlenz@google.com (John Lenz)
 */
final class Base64VLQ {
  // Utility class.
  private Base64VLQ() {}

  // A Base64 VLQ digit can represent 5 bits, so it is base-32.
  private static final int VLQ_BASE_SHIFT = 5;
  private static final int VLQ_BASE = 1 << VLQ_BASE_SHIFT;

  // A mask of bits for a VLQ digit (11111), 31 decimal.
  private static final int VLQ_BASE_MASK = VLQ_BASE-1;

  // The continuation bit is the 6th bit.
  private static final int VLQ_CONTINUATION_BIT = VLQ_BASE;

  /**
   * Converts from a two-complement value to a value where the sign bit is
   * is placed in the least significant bit.  For example, as decimals:
   *   1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
   *   2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
   */
  private static int toVLQSigned(int value) {
    if (value < 0) {
      return ((-value) << 1) + 1;
    } else {
      return (value << 1) + 0;
    }
  }

  /**
   * Converts to a two-complement value from a value where the sign bit is
   * is placed in the least significant bit.  For example, as decimals:
   *   2 (10 binary) becomes 1, 3 (11 binary) becomes -1
   *   4 (100 binary) becomes 2, 5 (101 binary) becomes -2
   */
  private static int fromVLQSigned(int value) {
    boolean negate = (value & 1) == 1;
    value = value >> 1;
    return negate ? -value : value;
  }

  /**
   * Writes a VLQ encoded value to the provide appendable.
   * @throws IOException
   */
  public static void encode(Appendable out, int value)
      throws IOException {
    value = toVLQSigned(value);
    do {
      int digit = value & VLQ_BASE_MASK;
      value >>>= VLQ_BASE_SHIFT;
      if (value > 0) {
        digit |= VLQ_CONTINUATION_BIT;
      }
      out.append(Base64.toBase64(digit));
    } while (value > 0);
  }

  /**
   * A simple interface for advancing through a sequence of characters, that
   * communicates that advance back to the source.
   */
  interface CharIterator {
    boolean hasNext();
    char next();
  }

  /**
   * Decodes the next VLQValue from the provided CharIterator.
   */
  public static int decode(CharIterator in) {
    int result = 0;
    boolean continuation;
    int shift = 0;
    do {
      char c = in.next();
      int digit = Base64.fromBase64(c);
      continuation = (digit & VLQ_CONTINUATION_BIT) != 0;
      digit &= VLQ_BASE_MASK;
      result = result + (digit << shift);
      shift = shift + VLQ_BASE_SHIFT;
    } while (continuation);

    return fromVLQSigned(result);
  }
}


text:
import styled from 'styled-components/native';

export const StyledSection = styled.View`
  marginBottom: 20;
`;

export const StyledSectionTitle = styled.Text`
  color: #586c7c;
  fontSize: 16;
  marginBottom: 5;
  paddingTop: 10;
  paddingRight: 10;
  paddingLeft: 10;
`;

export const StyledSectionBody = styled.View`
  borderTopWidth: 0.5;
  borderTopColor: #ccd6dd;
`;


text:
package cn.osworks.aos;

import cn.osworks.aos.core.server.AOSServer;

/**
 * 以内置Jetty模式启动Web应用
 *
 * <p>
 * 提示:请以debug as java application的方式启动
 *
 * @author OSWorks-XC
 */
public class OIFP {

	/**
	 * 启动内置服务器
	 *
	 * @param args
	 * @throws Exception
	 */
	public static void main(String[] args) throws Exception {
		AOSServer aosServer = new AOSServer();
		aosServer.setWebContext("/oifp");
		aosServer.setPort(10010);
		aosServer.start();

	}
}


text:
define(function(require,exports,modules){

   var data = {

        init:function(){

        }

   };

   return data;

});


text:
/**
 * angular-strap
 * @version v2.0.2 - 2014-04-27
 * @link http://mgcrea.github.io/angular-strap
 * @author Olivier Louvignes (olivier@mg-crea.com)
 * @license MIT License, http://www.opensource.org/licenses/MIT
 */
'use strict';
angular.version.minor < 3 && angular.version.dot < 14 && angular.module('ng').factory('$$rAF', [
  '$window',
  '$timeout',
  function ($window, $timeout) {
    var requestAnimationFrame = $window.requestAnimationFrame || $window.webkitRequestAnimationFrame || $window.mozRequestAnimationFrame;
    var cancelAnimationFrame = $window.cancelAnimationFrame || $window.webkitCancelAnimationFrame || $window.mozCancelAnimationFrame || $window.webkitCancelRequestAnimationFrame;
    var rafSupported = !!requestAnimationFrame;
    var raf = rafSupported ? function (fn) {
        var id = requestAnimationFrame(fn);
        return function () {
          cancelAnimationFrame(id);
        };
      } : function (fn) {
        var timer = $timeout(fn, 16.66, false);
        // 1000 / 60 = 16.666
        return function () {
          $timeout.cancel(timer);
        };
      };
    raf.supported = rafSupported;
    return raf;
  }
]);  // .factory('$$animateReflow', function($$rAF, $document) {
     //   var bodyEl = $document[0].body;
     //   return function(fn) {
     //     //the returned function acts as the cancellation function
     //     return $$rAF(function() {
     //       //the line below will force the browser to perform a repaint
     //       //so that all the animated elements within the animation frame
     //       //will be properly updated and drawn on screen. This is
     //       //required to perform multi-class CSS based animations with
     //       //Firefox. DO NOT REMOVE THIS LINE.
     //       var a = bodyEl.offsetWidth + 1;
     //       fn();
     //     });
     //   };
     // });


text:
<?xml version='1.0' encoding='UTF-8'?>
<org.jenkinsci.plugins.coordinator.model.CoordinatorProject>
  <actions/>
  <description></description>
  <keepDependencies>false</keepDependencies>
  <properties/>
  <scm class="hudson.scm.NullSCM"/>
  <canRoam>true</canRoam>
  <disabled>false</disabled>
  <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
  <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
  <triggers/>
  <concurrentBuild>false</concurrentBuild>
  <builders>
    <org.jenkinsci.plugins.coordinator.model.CoordinatorBuilder>
      <executionPlan>
        <id>j1_1</id>
        <text>Root</text>
        <type>serial</type>
        <children>
          <org.jenkinsci.plugins.coordinator.model.TreeNode>
            <id>j1_2</id>
            <text>1_P</text>
            <type>parallel</type>
            <children>
              <org.jenkinsci.plugins.coordinator.model.TreeNode>
                <id>j1_5</id>
                <text>11_L_4s</text>
                <type>leaf</type>
                <children/>
                <state>
                  <opened>false</opened>
                  <disabled>false</disabled>
                  <selected>false</selected>
                  <checked>true</checked>
                  <undetermined>false</undetermined>
                </state>
                <buildNumber>0</buildNumber>
              </org.jenkinsci.plugins.coordinator.model.TreeNode>
              <org.jenkinsci.plugins.coordinator.model.TreeNode>
                <id>j1_6</id>
                <text>12_L_2s</text>
                <type>leaf</type>
                <children/>
                <state>
                  <opened>false</opened>
                  <disabled>false</disabled>
                  <selected>false</selected>
                  <checked>true</checked>
                  <undetermined>false</undetermined>
                </state>
                <buildNumber>0</buildNumber>
              </org.jenkinsci.plugins.coordinator.model.TreeNode>
            </children>
            <state>
              <opened>true</opened>
              <disabled>false</disabled>
              <selected>false</selected>
              <checked>true</checked>
              <undetermined>false</undetermined>
            </state>
            <buildNumber>0</buildNumber>
          </org.jenkinsci.plugins.coordinator.model.TreeNode>
          <org.jenkinsci.plugins.coordinator.model.TreeNode>
            <id>j1_3</id>
            <text>2_S_non_breaking</text>
            <type>serial</type>
            <children>
              <org.jenkinsci.plugins.coordinator.model.TreeNode>
                <id>j1_7</id>
                <text>21_L_2s</text>
                <type>leaf</type>
                <children/>
                <state>
                  <opened>false</opened>
                  <disabled>false</disabled>
                  <selected>false</selected>
                  <checked>true</checked>
                  <undetermined>false</undetermined>
                </state>
                <buildNumber>0</buildNumber>
              </org.jenkinsci.plugins.coordinator.model.TreeNode>
              <org.jenkinsci.plugins.coordinator.model.TreeNode>
                <id>j1_8</id>
                <text>22_P</text>
                <type>parallel</type>
                <children>
                  <org.jenkinsci.plugins.coordinator.model.TreeNode>
                    <id>j1_10</id>
                    <text>211_L_2s</text>
                    <type>leaf</type>
                    <children/>
                    <state>
                      <opened>false</opened>
                      <disabled>false</disabled>
                      <selected>false</selected>
                      <checked>true</checked>
                      <undetermined>false</undetermined>
                    </state>
                    <buildNumber>0</buildNumber>
                  </org.jenkinsci.plugins.coordinator.model.TreeNode>
                  <org.jenkinsci.plugins.coordinator.model.TreeNode>
                    <id>j1_11</id>
                    <text>212_L_4s</text>
                    <type>leaf</type>
                    <children/>
                    <state>
                      <opened>false</opened>
                      <disabled>false</disabled>
                      <selected>false</selected>
                      <checked>true</checked>
                      <undetermined>false</undetermined>
                    </state>
                    <buildNumber>0</buildNumber>
                  </org.jenkinsci.plugins.coordinator.model.TreeNode>
                  <org.jenkinsci.plugins.coordinator.model.TreeNode>
                    <id>j1_12</id>
                    <text>213_L_2s</text>
                    <type>leaf</type>
                    <children/>
                    <state>
                      <opened>false</opened>
                      <disabled>false</disabled>
                      <selected>false</selected>
                      <checked>true</checked>
                      <undetermined>false</undetermined>
                    </state>
                    <buildNumber>0</buildNumber>
                  </org.jenkinsci.plugins.coordinator.model.TreeNode>
                </children>
                <state>
                  <opened>true</opened>
                  <disabled>false</disabled>
                  <selected>true</selected>
                  <checked>true</checked>
                  <undetermined>false</undetermined>
                </state>
                <buildNumber>0</buildNumber>
              </org.jenkinsci.plugins.coordinator.model.TreeNode>
              <org.jenkinsci.plugins.coordinator.model.TreeNode>
                <id>j1_9</id>
                <text>23_L_2s</text>
                <type>leaf</type>
                <children/>
                <state>
                  <opened>false</opened>
                  <disabled>false</disabled>
                  <selected>false</selected>
                  <checked>true</checked>
                  <undetermined>false</undetermined>
                </state>
                <buildNumber>0</buildNumber>
              </org.jenkinsci.plugins.coordinator.model.TreeNode>
            </children>
            <state>
              <opened>true</opened>
              <disabled>false</disabled>
              <selected>false</selected>
              <checked>true</checked>
              <undetermined>false</undetermined>
            </state>
            <buildNumber>0</buildNumber>
          </org.jenkinsci.plugins.coordinator.model.TreeNode>
          <org.jenkinsci.plugins.coordinator.model.TreeNode>
            <id>j1_4</id>
            <text>3_L_2s</text>
            <type>leaf</type>
            <children/>
            <state>
              <opened>false</opened>
              <disabled>false</disabled>
              <selected>false</selected>
              <checked>true</checked>
              <undetermined>false</undetermined>
            </state>
            <buildNumber>0</buildNumber>
          </org.jenkinsci.plugins.coordinator.model.TreeNode>
        </children>
        <state>
          <opened>true</opened>
          <disabled>false</disabled>
          <selected>false</selected>
          <checked>true</checked>
          <undetermined>false</undetermined>
        </state>
        <buildNumber>0</buildNumber>
      </executionPlan>
    </org.jenkinsci.plugins.coordinator.model.CoordinatorBuilder>
  </builders>
  <publishers/>
  <buildWrappers/>
</org.jenkinsci.plugins.coordinator.model.CoordinatorProject>


text:
require "active_support/execution_wrapper"

module ActiveSupport
  class Executor < ExecutionWrapper
  end
end


text:
ucasFL translating
Installation of Devuan Linux (Fork of Debian)
============================================================

Devuan Linux, the most recent fork of Debian, is a version of Debian that is designed to be completely free of systemd.

Devuan was announced towards the end of 2014 and has been actively developed over that time. The most recently release is the beta2 release of codenamed: Jessie (Yes the same name as the current stable version of Debian).

The final release for the current stable release is said to be ready in early 2017\. To read more about the project please visit the community's home page: [https://devuan.org/][1].

This article will walk through the installation of Devuan's current release. Most of the packages available in Debian are available in Devuan allowing for a fairly seamless transition for Debian users to Devuan should they prefer the freedom to choose their initialization system.

#### System Requirements

Devuan, like Debian. Is very light on system requirements. The biggest determining factor is the desktop environment the user wishes to use. This guide will assume that the user would like a 'flashier' desktop environment and will suggest the following minimums:

1.  At least 15GB of disk space; strongly encouraged to have more
2.  At least 2GB of ram; more is encouraged
3.  USB or CD/DVD boot support
4.  Internet connection; installer will download files from the Internet

### Devuan Linux Installation

As with all of the author's guides, this guide will be assuming that a USB drive is available to use as the installation media. Take note that the USB drive should be as close to 4/8GB as possible and ALL DATA WILL BE REMOVED!

The author has had issues with larger USB drives but some may still work. Regardless, following the next few steps WILL RESULT IN DATA LOSS ON THE USB DRIVE.

Please be sure to backup all data before proceeding. This bootable Kali Linux USB drive is going to be created from another Linux machine.

1. First obtain the latest release of Devuan installation ISO from [https://devuan.org/][2] or you can obtain from a Linux station, type the following commands:

```
$ cd ~/Downloads
$ wget -c https://files.devuan.org/devuan_jessie_beta/devuan_jessie_1.0.0-beta2_amd64_CD.iso
```

2. The commands above will download the installer ISO file to the user's 'Downloads' folder. The next process is to write the ISO to a USB drive to boot the installer.

To accomplish this we can use the `'dd'` tool within Linux. First, the disk name needs to be located with [lsblk command][3] though.

```
$ lsblk
```
[
 ![Find Device Name in Linux](http://www.tecmint.com/wp-content/uploads/2017/03/Find-Device-Name-in-Linux.png)
][4]

Find Device Name in Linux

With the name of the USB drive determined as `/dev/sdc`, the Devuan ISO can be written to the drive with the `dd` tool.

```
$ sudo dd if=~/Downloads/devuan_jessie_1.0.0-beta2_amd64_CD.iso of=/dev/sdc
```

Important: The above command requires root privileges so utilize 'sudo' or login as the root user to run the command. Also this command will REMOVE EVERYTHING on the USB drive. Be sure to backup needed data.

3. Once the ISO is copied over to the USB drive, plug the USB drive into the respective computer that Devuan should be installed upon and proceed to boot to the USB drive.

Upon successful booting to the USB drive, the user will be presented with the following screen and should proceed with the 'Install' or 'Graphical Install' options.

This guide will be using the 'Graphical Install' method.

[
 ![Devuan Graphic Installation](http://www.tecmint.com/wp-content/uploads/2017/03/Devuan-Graphic-Installation.png)
][5]

Devuan Graphic Installation

4. Allow the installer to boot to the localization menus. Once here the user will be prompted with a string of windows asking about the user's keyboard layout and language. Simply select the desired options to continue.

[
 ![Devuan Language Selection](http://www.tecmint.com/wp-content/uploads/2017/03/Devuan-Language-Selection.png)
][6]

Devuan Language Selection

[
 ![Devuan Location Selection](http://www.tecmint.com/wp-content/uploads/2017/03/Devuan-Location-Selection.png)
][7]

Devuan Location Selection

[
 ![Devuan Keyboard Configuration](http://www.tecmint.com/wp-content/uploads/2017/03/Devuan-Keyboard-Configuration.png)
][8]

Devuan Keyboard Configuration

5. The next step is to provide the installer with the hostname and domain name that this machine will be a member.

The hostname should be something unique but the domain can be left blank if the computer won't be part of a domain.

[
 ![Set Devuan Linux Hostname](http://www.tecmint.com/wp-content/uploads/2017/03/Set-Devuan-Linux-Hostname.png)
][9]

Set Devuan Linux Hostname

[
 ![Set Devuan Linux Domain Name](http://www.tecmint.com/wp-content/uploads/2017/03/Set-Devuan-Linux-Domain-Name.png)
][10]

Set Devuan Linux Domain Name

6. Once the hostname and domain name information have been provided the installer will want the user to provide a 'root' user password.

Take note to remember this password as it will be required to do administrative tasks on this Devuan machine! Devuan doesn't install the sudo package by default so the admin user will be 'root' when this installation finishes.

[
 ![Setup Devuan Linux Root User](http://www.tecmint.com/wp-content/uploads/2017/03/Setup-Devuan-Linux-Root-User.png)
][11]

Setup Devuan Linux Root User

7. The next series of questions will be for the creation of a non-root user. It is always a good to avoid using your system as the root user whenever possible. The installer will prompt for the creation of a non-root user at this point.

[
 ![Setup Devuan Linux User Account](http://www.tecmint.com/wp-content/uploads/2017/03/Setup-Devuan-Linux-User-Account.png)
][12]

Setup Devuan Linux User Account

8. Once the root user password and user creation prompts have completed, the installer will request that the clock be [set up with NTP][13].

Again a connection to the internet will be required in order for this to work for most systems!

[
 ![Devuan Linux Timezone Setup](http://www.tecmint.com/wp-content/uploads/2017/03/Configure-Clock-on-Devuan-Linux.png)
][14]

Devuan Linux Timezone Setup

9. The next step will be the act of partitioning the system. For most user's 'Guided – use entire disk' is typically sufficient. However, if advanced partitioning is desired, this would be the time to set them up.

[
 ![Devuan Linux Partitioning](http://www.tecmint.com/wp-content/uploads/2017/03/Devuan-Linux-Partitioning.png)
][15]

Devuan Linux Partitioning

Be sure to confirm the partition changes after clicking continue above in order to write the partitions to the disk!

10. Once the partitioning is completed, the installer will begin to install the base files for Devuan. This process will take a few minutes but will stop when the system is ready to configure a network mirror (software repository). Most users will want to click 'yes' when prompted to use a network mirror.

[
 ![Devuan Linux Configure Package Manager](http://www.tecmint.com/wp-content/uploads/2017/03/Devuan-Linux-Configure-Package-Manager.png)
][16]

Devuan Linux Configure Package Manager

Clicking `yes` here will present the user with a list of network mirrors by country. It is typically best to pick the mirror that is geographically closest to the machines location.

[
 ![Devuan Linux Mirror Selection](http://www.tecmint.com/wp-content/uploads/2017/03/Devuan-Linux-Mirror-Selection.png)
][17]

Devuan Linux Mirror Selection

[
 ![Devuan Linux Mirrors](http://www.tecmint.com/wp-content/uploads/2017/03/Devuan-Linux-Mirrors.png)
][18]

Devuan Linux Mirrors

11. The next screen is the traditional Debian 'popularity contest' all this does is track what packages are downloaded for statistics on package usage.

This can be enabled or disabled to the administrator's preference during the installation process.

[
 ![Configure Devuan Linux Popularity Contest](http://www.tecmint.com/wp-content/uploads/2017/03/Configure-Devuan-Linux-Popularity-Contest.png)
][19]

Configure Devuan Linux Popularity Contest

12. After a brief scan of the repositories and a couple of package updates, the installer will present the user with a list of software packages that can be installed to provide a Desktop Environment, SSH access, and other system tools.

While Devuan has some of the major Desktop Environments listed, it should be noted that not all of them are ready for use in Devuan yet. The author has had good luck with Xfce, LXDE, and Mate in Devuan (Future articles will walk the user through how to install Enlightenment from source in Devuan as well).

If interested in installing a different Desktop Environment, un-check the 'Devuan Desktop Environment' check box.

[
 ![Devuan Linux Software Selection](http://www.tecmint.com/wp-content/uploads/2017/03/Devuan-Linux-Software-Selection.png)
][20]

Devuan Linux Software Selection

Depending on the number of items selected in the above installer screen, there may be a couple of minutes of downloads and installations taking place.

When all the software installation is completed, the installer will prompt the user for the location to install 'grub'. This is typically done on '/dev/sda' as well.

[
 ![Devuan Linux Grub Install](http://www.tecmint.com/wp-content/uploads/2017/03/Devuan-Linux-Grub-Install.png)
][21]

Devuan Linux Grub Install

[
 ![Devuan Linux Grub Install Disk](http://www.tecmint.com/wp-content/uploads/2017/03/Devuan-Linux-Grub-Install-Disk.png)
][22]

Devuan Linux Grub Install Disk

13. After GRUB successfully installs to the boot drive, the installer will alert the user that the installation is complete and to reboot the system.

[
 ![Devuan Linux Installation Completes](http://www.tecmint.com/wp-content/uploads/2017/03/Devuan-Linux-Installation-Completes.png)
][23]

Devuan Linux Installation Completes

14. Assuming that the installation was indeed successful, the system should either boot into the chosen Desktop Environment or if no Desktop Environment was selected, the machine will boot to a text based console.

[
 ![Devuan Linux Console](http://www.tecmint.com/wp-content/uploads/2017/03/Devuan-Linux-Console.png)
][24]

Devuan Linux Console

This concludes the installation of the latest version of Devuan Linux. The next article in this short series will cover the [installation of the Enlightenment Desktop Environment][25] from source code on a Devuan system. Please let Tecmint know if you have any issues or questions and thanks for reading!

--------------------------------------------------------------------------------

作者简介:

He is an Instructor of Computer Technology with Ball State University where he currently teaches all of the departments Linux courses and co-teaches Cisco networking courses. He is an avid Debian user as well as many of the derivatives of Debian such as Mint, Ubuntu, and Kali. Rob holds a Masters in Information and Communication Sciences as well as several industry certifications from Cisco, EC-Council, and Linux Foundation.

-----------------------------

via: http://www.tecmint.com/installation-of-devuan-linux/

作者:[Rob Turner ][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)

本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

[a]:http://www.tecmint.com/author/robturner/
[1]:https://devuan.org/
[2]:https://devuan.org/
[3]:http://www.tecmint.com/find-usb-device-name-in-linux/
[4]:http://www.tecmint.com/wp-content/uploads/2017/03/Find-Device-Name-in-Linux.png
[5]:http://www.tecmint.com/wp-content/uploads/2017/03/Devuan-Graphic-Installation.png
[6]:http://www.tecmint.com/wp-content/uploads/2017/03/Devuan-Language-Selection.png
[7]:http://www.tecmint.com/wp-content/uploads/2017/03/Devuan-Location-Selection.png
[8]:http://www.tecmint.com/wp-content/uploads/2017/03/Devuan-Keyboard-Configuration.png
[9]:http://www.tecmint.com/wp-content/uploads/2017/03/Set-Devuan-Linux-Hostname.png
[10]:http://www.tecmint.com/wp-content/uploads/2017/03/Set-Devuan-Linux-Domain-Name.png
[11]:http://www.tecmint.com/wp-content/uploads/2017/03/Setup-Devuan-Linux-Root-User.png
[12]:http://www.tecmint.com/wp-content/uploads/2017/03/Setup-Devuan-Linux-User-Account.png
[13]:http://www.tecmint.com/install-and-configure-ntp-server-client-in-debian/
[14]:http://www.tecmint.com/wp-content/uploads/2017/03/Configure-Clock-on-Devuan-Linux.png
[15]:http://www.tecmint.com/wp-content/uploads/2017/03/Devuan-Linux-Partitioning.png
[16]:http://www.tecmint.com/wp-content/uploads/2017/03/Devuan-Linux-Configure-Package-Manager.png
[17]:http://www.tecmint.com/wp-content/uploads/2017/03/Devuan-Linux-Mirror-Selection.png
[18]:http://www.tecmint.com/wp-content/uploads/2017/03/Devuan-Linux-Mirrors.png
[19]:http://www.tecmint.com/wp-content/uploads/2017/03/Configure-Devuan-Linux-Popularity-Contest.png
[20]:http://www.tecmint.com/wp-content/uploads/2017/03/Devuan-Linux-Software-Selection.png
[21]:http://www.tecmint.com/wp-content/uploads/2017/03/Devuan-Linux-Grub-Install.png
[22]:http://www.tecmint.com/wp-content/uploads/2017/03/Devuan-Linux-Grub-Install-Disk.png
[23]:http://www.tecmint.com/wp-content/uploads/2017/03/Devuan-Linux-Installation-Completes.png
[24]:http://www.tecmint.com/wp-content/uploads/2017/03/Devuan-Linux-Console.png
[25]:http://www.tecmint.com/install-enlightenment-on-devuan-linux/
[26]:http://www.tecmint.com/author/robturner/
[27]:http://www.tecmint.com/10-useful-free-linux-ebooks-for-newbies-and-administrators/
[28]:http://www.tecmint.com/free-linux-shell-scripting-books/


text:
package com.blockwithme.time.internal;

import com.blockwithme.time.Time;
import com.blockwithme.time.Timeline;
import com.blockwithme.time.TimelineBuilder;
import com.blockwithme.time.implapi._Scheduler;
import com.blockwithme.time.implapi._Timeline;

/**
 * TimelineBuilderImpl2 allows the creation of a new derived timeline.
 *
 * @author monster
 */
public class TimelineBuilderImpl2 implements TimelineBuilder {

    private final Timeline source;

    private final _Timeline parent;

    private final _Scheduler scheduler;

    private boolean paused;

    private Long startTimePoint;

    private double localTickStep;

    private long fixedDurationTicks;

    private boolean loopWhenReachingEnd;

    private double localTickScaling;

    private double timeOffset;

    /** Creates a TimelineBuilderImpl2. */
    public TimelineBuilderImpl2(final Timeline theSource,
            final _Timeline theParent, final boolean cloneState,
            final _Scheduler theScheduler) {
        source = theSource;
        parent = theParent;
        scheduler = theScheduler;
        if (cloneState) {
            paused = source.pausedLocally();
            startTimePoint = source.startTimePoint();
            localTickStep = source.localTickStep();
            fixedDurationTicks = source.fixedDurationTicks();
            loopWhenReachingEnd = source.loopWhenReachingEnd();
            localTickScaling = source.localTickScaling();
            timeOffset = source.timeOffset();
        } else {
            localTickStep = 1;
            localTickScaling = 1;
        }
    }

    /* (non-Javadoc)
     * @see com.blockwithme.time.TimelineBuilder2#create(java.lang.String)
     */
    @Override
    public Timeline create(final String name) {
        final long start = (startTimePoint == null) ? source.clockService()
                .currentTimeMicros() : startTimePoint;
        final DerivedTimeline result = new DerivedTimeline(name, start,
                timeOffset, loopWhenReachingEnd, localTickScaling,
                fixedDurationTicks, localTickStep, parent, scheduler);
        if (paused) {
            result.pause();
        }
        parent.registerListener(result);
        return result;
    }

    /* (non-Javadoc)
     * @see com.blockwithme.time.TimelineBuilder2#paused()
     */
    @Override
    public TimelineBuilder paused() {
        paused = true;
        return this;
    }

    /* (non-Javadoc)
     * @see com.blockwithme.time.TimelineBuilder2#running()
     */
    @Override
    public TimelineBuilder running() {
        paused = false;
        return this;
    }

    /* (non-Javadoc)
     * @see com.blockwithme.time.TimelineBuilder2#setStartTimePoint(Long)
     */
    @Override
    public TimelineBuilder setStartTimePoint(final Long theStartTimePoint) {
        startTimePoint = theStartTimePoint;
        return this;
    }

    /* (non-Javadoc)
     * @see com.blockwithme.time.TimelineBuilder2#setLocalTickStep(double)
     */
    @Override
    public TimelineBuilder setLocalTickStep(final double theLocalTickStep) {
        if (theLocalTickStep <= 0.0001) {
            throw new IllegalArgumentException(
                    "theLocalTickStep must be greater then 0: "
                            + theLocalTickStep);
        }
        localTickStep = theLocalTickStep;
        return this;
    }

    /* (non-Javadoc)
     * @see com.blockwithme.time.TimelineBuilder2#setFixedDurationTicks(long)
     */
    @Override
    public TimelineBuilder setFixedDurationTicks(
            final long theFixedDurationTicks) {
        if (theFixedDurationTicks < 0) {
            throw new IllegalArgumentException(
                    "theFixedDurationTicks cannot be negative: "
                            + theFixedDurationTicks);
        }
        fixedDurationTicks = theFixedDurationTicks;
        return this;
    }

    /* (non-Javadoc)
     * @see com.blockwithme.time.TimelineBuilder2#setLoopWhenReachingEnd(boolean)
     */
    @Override
    public TimelineBuilder setLoopWhenReachingEnd(
            final boolean theLoopWhenReachingEnd) {
        loopWhenReachingEnd = theLoopWhenReachingEnd;
        return this;
    }

    /* (non-Javadoc)
     * @see com.blockwithme.time.TimelineBuilder2#setLocalTickScaling(double)
     */
    @Override
    public TimelineBuilder setLocalTickScaling(final double theLocalTickScaling) {
        if ((-0.0001 < theLocalTickScaling) && (theLocalTickScaling < 0.0001)) {
            throw new IllegalArgumentException(
                    "theLocalTickScaling cannot be 0: " + theLocalTickScaling);
        }
        localTickScaling = theLocalTickScaling;
        return this;
    }

    /* (non-Javadoc)
     * @see com.blockwithme.time.TimelineBuilder2#setTimeOffset(double)
     */
    @Override
    public TimelineBuilder setTimeOffset(final double theTimeOffset) {
        timeOffset = theTimeOffset;
        return this;
    }

    /* (non-Javadoc)
     * @see com.blockwithme.time.TimelineBuilder2#setTicksPerSecond(double)
     */
    @Override
    public TimelineBuilder setTicksPerSecond(final double ticksPerSecond) {
        if (ticksPerSecond <= 1.0 / Time.DAY_SECONDS) {
            throw new IllegalArgumentException(
                    "ticksPerSecond must be more then 0: " + ticksPerSecond);
        }
        return setLocalTickStep(parent.ticksPerSecond() / ticksPerSecond);
    }
}


text:
const hasOwn = Object.prototype.hasOwnProperty;

function inherit (Child, Parent) {
  function Intermediate () {
    this.constructor = Child;
    this.constructor$ = Parent;
    for (const prop in Parent.prototype) {
      if (hasOwn.call(Parent.prototype, prop) && prop.slice(-1) !== "$") {
        this[`${prop}$`] = Parent.prototype[prop];
      }
    }
  }
  Intermediate.prototype = Parent.prototype;
  Child.prototype = new Intermediate();
  return Child.prototype;
}

export function errorFactory (name) {
  function ErrorType (message) {
    this.name = name;
    this.message = message;
    this.cause = message;

    if (message instanceof Error) {
      this.message = message.message;
      this.stack = message.stack;
    } else if (Error.captureStackTrace) {
      Error.captureStackTrace(this, this.constructor);
    }
  }
  inherit(ErrorType, Error);
  return ErrorType;
}

export const ObjectNotFoundError = errorFactory("ObjectNotFoundError");
export const IndexedDbNotFound = errorFactory("IndexedDbNotFound");
export const ConnectionError = errorFactory("ConnectionError");
export const CursorError = errorFactory("CursorError");
export const InvalidArgumentError = errorFactory("InvalidArgumentError");
export const TransactionError = errorFactory("TransactionError");
export const InitializationError = errorFactory("InitializationError");


text:
export function findClosestLink(element) {
  do {
    if (element.tagName == 'A') {
      return element;
    }
  } while (element = element.parentElement);

  return null;
}


text:
#include "policy/policy_table.h"

#include "policy/sql_pt_representation.h"

#include "utils/logger.h"

namespace policy {

SDL_CREATE_LOG_VARIABLE("Policy")

PolicyTable::PolicyTable() : pt_data_(new SQLPTRepresentation()) {}

PolicyTable::PolicyTable(std::shared_ptr<PTRepresentation> pt_data)
    : pt_data_(pt_data) {}

PolicyTable::~PolicyTable() {
  SDL_LOG_INFO("Destroying policy table.");
}

}  // namespace policy


text:
var Backbone = require('./index.js');
var _ = require("underscore");
var assert = require('assert');

describe('Model', function () {
  describe('#get() and #set()', function () {
    var model = new Backbone.Model();
    it('should return undefined on getting an empty attribute', function () {
      assert(typeof model.get("someundefinedattribute") === "undefined", 'undefined attribute');
    });

    it('should have the same get and set behavior as before', function () {
      model.set("test", "abc");
      model.set("green", 1);
      model.set({
        more: "attributes",
        array: [
          "test"
        ]
      });

      assert(model.get("test") === "abc");
      assert(model.get("green") === 1);
      assert(model.get("more") === "attributes");
      assert(_.isEqual(model.get("array"), [ "test" ]));
    });

    it('should support nested sets', function () {
      model.set("test.attribute", "abc");
      assert(_.isEqual(model.get("test"), { attribute: "abc" }));

      model.set("empty.attribute.array", [ "abc" ]);
      assert(_.isEqual(model.get("empty"), { attribute: { array: [ "abc" ] } }));
    });

    it('should support nested gets', function () {
      model.set("test.attribute.again", "abc");
      assert(_.isEqual(model.get("test.attribute.again"), "abc"));

      model.set("get.this.attribute", [ 'me' ]);
      assert(_.isEqual(model.get("get.this.attribute"), [ 'me' ]));
    });

    it('should not reuse objects when setting nested fields', function () {
      model.set('abc.my.fake.attribute', 'a');
      var obj = model.get('abc.my.fake');
      assert(obj.attribute === 'a');

      model.set('abc.my.fake.attribute', 'b');
      assert(obj.attribute === 'a');
      assert(model.get('abc.my.fake.attribute') === 'b');
    });

    it('should emit events for setting nested fields', function (done) {
      var eventName = 'change:my.nested.field';

      var lfn = function(){
        Backbone.stopListening(model, eventName, lfn);
        done();
      };

      Backbone.listenTo(model, eventName, lfn);

      model.set('my.nested.field', 'changed');
    });

  });
});

describe("#parse()", function () {
  it('should use JSOG to parse models and collections', function () {
    // a model with two attributes that are of the same type
    var m = new Backbone.Model({
      one: {
        "@id": "1",
        name: "hello"
      },
      two: {
        "@ref": "1"
      }
    }, { parse: true });

    assert(m.get("two.name") === "hello");

    // a circular collection
    var santas = new Backbone.Collection([
      {
        "@id": "1",
        "id": 1,
        "name": "Sally",
        "secretSanta": {
          "@id": "2",
          "id": 2,
          "name": "Bob",
          "secretSanta": {
            "@id": "3",
            "id": 3,
            "name": "Fred",
            "secretSanta": { "@ref": "1" }
          }
        }
      },
      { "@ref": "2" },
      { "@ref": "3" }
    ], { parse: true });

    assert(santas.get(2).get("secretSanta.secretSanta.name") === "Sally");
  });
});

describe('#save() invalid model', function () {
  it('should return a promise', function () {
    var m = new (Backbone.Model.extend({
      validate: function (attributes, option) {
        if (attributes.name === "Sally") {
          return "Sally is a reserved name.";
        }
      }
    }))({
      name: 'Sally'
    });

    var p = m.save();
    assert(typeof p.then === "function");
  });
});


text:
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("SecureAuth.Sdk")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SecureAuth.Sdk")]
[assembly: AssemblyCopyright("Copyright ©  2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components.  If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(true)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("9dc7fc73-a9df-43e5-bd06-3fb34c245081")]

// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.1")]
[assembly: AssemblyFileVersion("1.0.0.1")]
#if DEBUG
[assembly: InternalsVisibleTo("SecureAuth.Sdk.UnitTests,PublicKey=00240000048000009400000006020000002400005253413100040000010001002be4b68c1434d2b9447a4a469bfc6bc66dbd7255114b35e78b06c7ec3a5597bed942f217b73e3f90162b3104430eb25bf35c9ad8d04c743b67732e4267b433ccb2917202116d96a49a47ef1cde3fd0eb178a6eac09a0b50327feef5ebe0e8016734fbca9adc33522971d656af91f0e782721411d1948f73ef349dffd0d1b13b3")]
#endif


text:
package org.springframework.boot.maven;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.util.jar.JarOutputStream;

import org.junit.Test;

import static org.assertj.core.api.Assertions.assertThat;

/**
 * Tests for {@link PropertiesMergingResourceTransformer}.
 *
 * @author Dave Syer
 */
public class PropertiesMergingResourceTransformerTests {

	private final PropertiesMergingResourceTransformer transformer = new PropertiesMergingResourceTransformer();

	@Test
	public void testProcess() throws Exception {
		assertThat(this.transformer.hasTransformedResource()).isFalse();
		this.transformer.processResource("foo",
				new ByteArrayInputStream("foo=bar".getBytes()), null);
		assertThat(this.transformer.hasTransformedResource()).isTrue();
	}

	@Test
	public void testMerge() throws Exception {
		this.transformer.processResource("foo",
				new ByteArrayInputStream("foo=bar".getBytes()), null);
		this.transformer.processResource("bar",
				new ByteArrayInputStream("foo=spam".getBytes()), null);
		assertThat(this.transformer.getData().getProperty("foo")).isEqualTo("bar,spam");
	}

	@Test
	public void testOutput() throws Exception {
		this.transformer.setResource("foo");
		this.transformer.processResource("foo",
				new ByteArrayInputStream("foo=bar".getBytes()), null);
		ByteArrayOutputStream out = new ByteArrayOutputStream();
		JarOutputStream os = new JarOutputStream(out);
		this.transformer.modifyOutputStream(os);
		os.flush();
		os.close();
		assertThat(out.toByteArray()).isNotNull();
		assertThat(out.toByteArray().length > 0).isTrue();
	}

}


text: {% assign url = page.url | prepend: site.baseurl | prepend: site.url %}


text:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              xmlns:tools="http://schemas.android.com/tools"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:background="#f7f7f7"
              android:gravity="center_horizontal"
              android:orientation="vertical">

    <RelativeLayout
            android:id="@+id/topLayout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/title_bg">

        <ImageButton
                android:id="@+id/backBtn"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentLeft="true"
                android:layout_centerVertical="true"
                android:background="@drawable/icon_back2"/>

        <LinearLayout
                android:id="@+id/headerMidLayout"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:layout_centerVertical="true"
                android:orientation="horizontal">

            <TextView
                    android:id="@+id/titleNameTV"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/alarm_title"
                    android:textColor="#ffffff"
                    android:textSize="20sp"
                    android:textStyle="bold"/>
        </LinearLayout>

        <ImageButton
                android:id="@+id/addBtn"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:layout_centerVertical="true"
                android:layout_marginRight="10dp"
                android:background="@drawable/icon_add_alarm"/>
    </RelativeLayout>

    <ListView
            android:id="@+id/listView1"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@null"
            android:visibility="gone"
            >
    </ListView>
    <TextView
            android:id="@+id/alarm_prompt"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/alarm_prompt"
            android:layout_marginTop="20dp"
            android:textSize="18sp"
            />

</LinearLayout>


text:
<!DOCTYPE HTML>

  <title>making culture</title>
	<meta charset="utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1" />

	<link rel="stylesheet" href="/css/main.css" />

making culture

		  	Menu

About

Articles

Byera Hadley

Archive

Making Movements

                  <time class="published" datetime="2016-02-01">February, 2016</time>

                    bhts

The case studies visited in this study were identified to provide different community motivations each providing catalysts for personal fabrication spaces to form. This chapter interrogates these motivations, the resulting communities and explores the spatial implications.

In Neil Gershenfeld's article "How to Make Almost Anything" he identifies that the real strength of Fab Labs are not technical; it is social.In this study I visited two Fab Labs, one in Australia and one in the US. The SETC Fab Lab in Boston was the first and illustrated just how much can be achieved from limited but efficiently utilised space for digital fabrication equipment and space to collaborate.

The two Fab Labs in this study cannot be compared in terms of their social or economic contexts, but they both share an ambition to provide a space to explore and share personal making projects to citizens of all ages. Where as the SETC Fab Lab holds a corner of a basement of an old town house in Boston, the Adelaide Fab Lab utilises teaching space donated to them by the Adelaide Collage of Arts. Both make desk space to sit and talk a priority and use clusters of desks to make sure users can sit and face one another.

Social Education

It is stated in the Fab Foundations guide to setting up a Fab Lab that "90% of a student or user's time is spent designing on the computer" so it is not surprising that this has such a significant spatial impact.

In order to be part of the Fab Foundation a Fab Lab must be free and inclusive to all members of society. Funds can be generated by a variety of methods but a percentage of time must be devoted for free access and drop in sessions.

Initially Fab Labs were conceived as a way to extend the educational outreach of Gershenfeld's MIT class and have consequently spread across the world. The Fab Academy now provide remote teaching via video link to all these affiliated spaces. The class seeks to educate how to use the digital fabrication tools at hand, but on personal and meaningful projects.

At the Boston Fab Lab the teaching of the Fab Academy is taken a stage further where young students of the programme are employed to go into schools and teach younger children and generate a sustainable cycle of learning and teaching. The programme has proved so successful that Fab Labs have been set up in the  schools involved meaning legacy of influence can hopefully be established.

Here in Australia the Makers Place take as much of a social focus as the Fab Labs, but are not part of the foundation. Makers Place and its parent company Three Farm use design and making across multiple communities to help gain autonomy and strength through self-identity.

If Fab Lab represents a laboratory of digital fabrication, then maker spaces are the factories. Artisan Asylum and Lowell Makes both emerged out of the Hackerspace movement, but have gravitated towards a focus on creativity and entrepreneurism, rather than activism.

Creative

As such the maker spaces visited had generally longer standing projects and highly personalised additions to the interior of their space. Users of these facilities were typically more inwardly focussed, concentrating on individual pursuits and creative endeavours. In these two cases it resulted in a compartmentalisation of space allowing personal storage and ownership over a particular space.

Hackerspaces, despite the negative image produced by the media relating to cyber crime, provided the most enthralling of spaces  I visited due to their open and subversive atmospheres.

Subversive

Although neither of the two hackerspaces I visited knowingly promoted criminal activities, they had a freedom and a shared connection in making (or breaking) that stood out. Although Noisebridge provided the more extreme example, both had few rules and instead relied on self regulation and honesty to maximise freedom in movement, interaction and open sharing.

Entrepreneur

Techshop, the surprisingly unfordable "democratiser" of fabrication, sits rigidly within the entrepreneurial camp. However where it gains in making technology it lacks in the spatial identity seen in maker spaces. Users in these spaces were serious, generally working on projects for capital gain, and reflecting the motivations of the service they were using.

In contrast to Noisebridge, it is clear at Tech Shop who owns and manages the space. Limited time on machinery and a highly regulated environment remind the users who the space belongs to and who you are paying for access to technology.
The two libraries I visited, Boston and Adelaide, introduced digital fabrication facilities due to a conscious engagement with production as a cultural generator, and recent capital investments through refurbishment. Boston library, the larger and more established of the two, combined rapid prototyping within a larger computer lab. This space contained CAD software providing young people a complete design to production fabrication workflow to learn from and experiment.

Adelaide

Adelaide Library's community base means it is not able to provide equivalent facilities or space, but it is still able to engage users in designing and prototyping their own artefacts. Through the design and making of 3d models users are given the free knowledge to progress and are introduced to an alternative to consumerism.

In both cases knowledge is facilitated through computers, enabling those who engage and learn the opportunity to generate personally and potentially culturally significant artefacts.

Fabrication Services

Danger Awesome proved to be the most surprising case study , and perhaps for the wrong reasons. What I expected to be a community led digital making space turned out to be a more retail focussed fabrication shop comparable to a print or copy shop. While I was a little disappointed that making skills and community was not as prioritiesed I appreciated the type of fabrication it provided, and the economic context it operated. In the future not all spaces with digital fabrication machines will be open to feely use, someone who has a digital file will in many cases just want to go and get it produced rather than hanging around waiting for it to be created.

The aspect I found disappointing was that through making for others it disengages with the overall ambition of personal fabrication where users can gain autonomy through their making activity. Nadeem, one of the directors at Danger Awesome is critical of the Fab Lab concept explaining that it was completely unsustainable as a business. While this is most likely true as Fab Labs need funding to survive, he misses that Danger Awesome operate as custodians for a culture rather than purely a business model. If free or low cost access to digital fabrication is not provided then the "democratisation" of making that Danger Awesome promote is just marketing speak.

Corporate

During my study I spoke to many people who felt that maker spaces within corporate companies will become a more common occurrence in the next few years as business leaders seek to provide creative outlets for their employees. The two examples I visited are slightly different in that the companies, Bolt and Autodesk, are directly involved with the maker movement. They are both examples however, where corporate money provides the highest level funding and produce the greatest innovation.

The interesting aspect for maker spaces within companies is the possibility for employers to engage with disruptive consumption patterns. Potentially, if employees can make their own things and not have to rely on consumption of mass produced goods, then why will they work to pay for them?

A more likely outcome, however, is that a maker space, and allocated usage times, will provide incentives to work. If companies allow time and space for making they could find themselves the beneficiary of new and unexpected ideas that could feed into the economic success of the business.

Previous Post

Next Post

Byera Hadley Travelling Scholarship

An study of maker communities and their associated spaces in Boston, San Fransisco, Adelaide and Sydney.

Sydney Makers Place

MIT Hobby Shop

Adelaide Innovation Lab

Techshop

Noisebridge

Make Media Lab

Lowell Makes

Hatch Makerspace

Danger Awesome

Cambridge Hack Space

Boston Public Library

Boston Fab Lab

Boston Bolt

Autodesk Pier 9

Artisans Asylum

Adelaide Fab Lab

Types

Tools of personal fabrication

Making Outcomes

Making Movements

Maker Con & Faire

Context and Connectivity

Conclusions & Toolkit

Acknowledgements

Byera Hadley Project Introduction

Twitter

GitHub

RSS

Email

 Copyright © 2015 Chris Bamborough

 Website Based on Sierra by  Kazuma Sato


text:
#include "memorycell.h"

class AttributedMemory
{
public:
    AttributedMemory(quint16 expectedBottom = 0x0000,
                     quint16 expectedTop = 0xffff);

    void setExpectedRange(quint16 bottom, quint16 top);

    quint16 getExpectedBottom() const { return m_expected_bottom; }
    quint16 getExpectedTop() const;
    quint16 getExpectedSize() const { return m_expected_top-m_expected_bottom; }

    bool setValueAt(quint16 address, quint8 withValue, MemRole *andRole = nullptr);
    quint8 valueAt(quint16 address) const { return m_cells[address].value(); };
    bool setRoleAt(quint16 address, MemRole *withRole);
    bool hasRoleAt(quint16 address, int withId);
    MemRole *getRoleAt(quint16 address, int withId);
    QList<MemRole *> getAllRolesAt(quint16 address);
    bool removeRoleAt(quint16 address, int withId);
    bool replaceRoleAt(quint16 address, MemRole *withRole);

    QByteArray getAllValues() const;
    QByteArray getAllValuesInExpectedRange() const;
    QByteArray getAllValuesInRange(quint16 bottom, quint16 top) const;

    quint8 at(quint16 address) const { return m_cells[address].value(); }

    bool addFile(QByteArray data, quint16 start);  // From Memory.h.  Should be replaced?

protected:

    quint16 m_expected_bottom;
    quint16 m_expected_top;

    QList<MemoryCell> m_cells;
};

#endif // ATTRIBUTEDMEMORY_H


text:
<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>
    <groupId>com.lifeonwalden</groupId>
    <artifactId>DDLGenerator</artifactId>
    <version>2.2.3-SNAPSHOT</version>
    <name>DDLGenerator</name>
    <description>A tool to auto generate MyBatis mapping/DAO interface, DTO, and DDL based on the table definition
    </description>
    <url>https://github.com/cmanlh/DDLGenerator</url>
    <licenses>
        <license>
            <name>The Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0</url>
        </license>
    </licenses>
    <developers>
        <developer>
            <name>cmanlh</name>
            <email>cmanlh@163.com</email>
        </developer>
    </developers>
    <properties>
        <java.version>1.8</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.target>1.8</maven.compiler.target>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.repository>${user.home}/.m2/repository</maven.repository>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.thoughtworks.xstream</groupId>
            <artifactId>xstream</artifactId>
            <version>1.4.8</version>
        </dependency>
        <dependency>
            <groupId>com.squareup</groupId>
            <artifactId>javapoet</artifactId>
            <version>1.2.0</version>
        </dependency>
        <dependency>
            <groupId>com.lifeonwalden</groupId>
            <artifactId>forestbatis</artifactId>
            <version>0.0.6</version>
        </dependency>
        <dependency>
            <groupId>org.hsqldb</groupId>
            <artifactId>hsqldb</artifactId>
            <version>2.3.3</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.microsoft.sqlserver</groupId>
            <artifactId>sqljdbc42</artifactId>
            <version>4.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.ibm</groupId>
            <artifactId>db2jcc4</artifactId>
            <version>4.0.4</version>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>8.0.11</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.oracle</groupId>
            <artifactId>ojdbc6</artifactId>
            <version>11.2.0.4.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis</artifactId>
            <version>3.4.3</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.4</version>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>
                                ${project.build.directory}/dependencies
                            </outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.2.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.20</version>
                <configuration>
                    <skipTests>true</skipTests>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>1.6</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <scm>
        <url>https://gitee.com/lifeonwalden/DDLGenerator</url>
        <connection>scm:git:git@gitee.com:lifeonwalden/DDLGenerator.git</connection>
        <developerConnection>scm:git:git@gitee.com:lifeonwalden/DDLGenerator.git</developerConnection>
        <tag>HEAD</tag>
    </scm>

    <distributionManagement>
        <repository>
            <id>bintray-cmanlh-maven</id>
            <name>cmanlh-maven</name>
            <url>https://api.bintray.com/maven/cmanlh/maven/DDLGenerator/;publish=1</url>
        </repository>
    </distributionManagement>
</project>


text:
using System;
using System.Collections;
using Microsoft.Build.Framework;

namespace GitVersionTask.Tests.Mocks
{
    class MockTaskItem : ITaskItem
    {
        public string ItemSpec { get; set; }

        public int MetadataCount { get; private set; }

        public ICollection MetadataNames { get; private set; }

        public IDictionary CloneCustomMetadata()
        {
            throw new NotImplementedException();
        }

        public void CopyMetadataTo(ITaskItem destinationItem)
        {
            throw new NotImplementedException();
        }

        public string GetMetadata(string metadataName)
        {
            throw new NotImplementedException();
        }

        public void RemoveMetadata(string metadataName)
        {
            throw new NotImplementedException();
        }

        public void SetMetadata(string metadataName, string metadataValue)
        {
            throw new NotImplementedException();
        }
    }
}


text:
#include <benchmark/benchmark.h>

#include "BakedOpState.h"
#include "BakedOpDispatcher.h"
#include "BakedOpRenderer.h"
#include "FrameBuilder.h"
#include "LayerUpdateQueue.h"
#include "RecordedOp.h"
#include "RecordingCanvas.h"
#include "tests/common/TestContext.h"
#include "tests/common/TestScene.h"
#include "tests/common/TestUtils.h"
#include "Vector.h"

#include <vector>

using namespace android;
using namespace android::uirenderer;
using namespace android::uirenderer::renderthread;
using namespace android::uirenderer::test;

const FrameBuilder::LightGeometry sLightGeometry = { {100, 100, 100}, 50};
const BakedOpRenderer::LightInfo sLightInfo = { 128, 128 };

static sp<RenderNode> createTestNode() {
    auto node = TestUtils::createNode(0, 0, 200, 200,
            [](RenderProperties& props, RecordingCanvas& canvas) {
        SkBitmap bitmap = TestUtils::createSkBitmap(10, 10);
        SkPaint paint;

        // Alternate between drawing rects and bitmaps, with bitmaps overlapping rects.
        // Rects don't overlap bitmaps, so bitmaps should be brought to front as a group.
        canvas.save(SaveFlags::MatrixClip);
        for (int i = 0; i < 30; i++) {
            canvas.translate(0, 10);
            canvas.drawRect(0, 0, 10, 10, paint);
            canvas.drawBitmap(bitmap, 5, 0, nullptr);
        }
        canvas.restore();
    });
    TestUtils::syncHierarchyPropertiesAndDisplayList(node);
    return node;
}

void BM_FrameBuilder_defer(benchmark::State& state) {
    TestUtils::runOnRenderThread([&state](RenderThread& thread) {
        auto node = createTestNode();
        while (state.KeepRunning()) {
            FrameBuilder frameBuilder(SkRect::MakeWH(100, 200), 100, 200,
                    sLightGeometry, Caches::getInstance());
            frameBuilder.deferRenderNode(*node);
            benchmark::DoNotOptimize(&frameBuilder);
        }
    });
}
BENCHMARK(BM_FrameBuilder_defer);

void BM_FrameBuilder_deferAndRender(benchmark::State& state) {
    TestUtils::runOnRenderThread([&state](RenderThread& thread) {
        auto node = createTestNode();

        RenderState& renderState = thread.renderState();
        Caches& caches = Caches::getInstance();

        while (state.KeepRunning()) {
            FrameBuilder frameBuilder(SkRect::MakeWH(100, 200), 100, 200,
                    sLightGeometry, caches);
            frameBuilder.deferRenderNode(*node);

            BakedOpRenderer renderer(caches, renderState, true, sLightInfo);
            frameBuilder.replayBakedOps<BakedOpDispatcher>(renderer);
            benchmark::DoNotOptimize(&renderer);
        }
    });
}
BENCHMARK(BM_FrameBuilder_deferAndRender);

static sp<RenderNode> getSyncedSceneNode(const char* sceneName) {
    gDisplay = getBuiltInDisplay(); // switch to real display if present

    TestContext testContext;
    TestScene::Options opts;
    std::unique_ptr<TestScene> scene(TestScene::testMap()[sceneName].createScene(opts));

    sp<RenderNode> rootNode = TestUtils::createNode(0, 0, gDisplay.w, gDisplay.h,
                [&scene](RenderProperties& props, TestCanvas& canvas) {
            scene->createContent(gDisplay.w, gDisplay.h, canvas);
    });

    TestUtils::syncHierarchyPropertiesAndDisplayList(rootNode);
    return rootNode;
}

static auto SCENES = {
        "listview",
};

void BM_FrameBuilder_defer_scene(benchmark::State& state) {
    TestUtils::runOnRenderThread([&state](RenderThread& thread) {
        const char* sceneName = *(SCENES.begin() + state.range_x());
        state.SetLabel(sceneName);
        auto node = getSyncedSceneNode(sceneName);
        while (state.KeepRunning()) {
            FrameBuilder frameBuilder(SkRect::MakeWH(gDisplay.w, gDisplay.h),
                    gDisplay.w, gDisplay.h,
                    sLightGeometry, Caches::getInstance());
            frameBuilder.deferRenderNode(*node);
            benchmark::DoNotOptimize(&frameBuilder);
        }
    });
}
BENCHMARK(BM_FrameBuilder_defer_scene)->DenseRange(0, SCENES.size() - 1);

void BM_FrameBuilder_deferAndRender_scene(benchmark::State& state) {
    TestUtils::runOnRenderThread([&state](RenderThread& thread) {
        const char* sceneName = *(SCENES.begin() + state.range_x());
        state.SetLabel(sceneName);
        auto node = getSyncedSceneNode(sceneName);

        RenderState& renderState = thread.renderState();
        Caches& caches = Caches::getInstance();

        while (state.KeepRunning()) {
            FrameBuilder frameBuilder(SkRect::MakeWH(gDisplay.w, gDisplay.h),
                    gDisplay.w, gDisplay.h,
                    sLightGeometry, Caches::getInstance());
            frameBuilder.deferRenderNode(*node);

            BakedOpRenderer renderer(caches, renderState, true, sLightInfo);
            frameBuilder.replayBakedOps<BakedOpDispatcher>(renderer);
            benchmark::DoNotOptimize(&renderer);
        }
    });
}
BENCHMARK(BM_FrameBuilder_deferAndRender_scene)->DenseRange(0, SCENES.size() - 1);


text:
InputFlat::InputFlat(const Options& iOptions) :
      Input(iOptions) {

   //! What offsets do each row in the text file represent?
   std::vector<float> offsets;
   iOptions.getRequiredValues("offsets", offsets);

   // Set caching settings
   if(iOptions.hasValue("cacheOtherMembers") || iOptions.hasValue("cacheOtherOffsets") ||
      iOptions.hasValue("cacheOtherLocations") || iOptions.hasValue("cacheOtherVariables")) {
      std::stringstream ss;
      ss << "Caching options for dataset '" << getName()
         << "' are ignored as InputFlat decides its own caching";
      Global::logger->write(ss.str(), Logger::warning);

   }
   mCacheOtherMembers   = true;
   mCacheOtherOffsets   = true;
   mCacheOtherVariables = false;
   mCacheOtherLocations = false;

   iOptions.check();
   init();
}

float InputFlat::getValueCore(const Key::Input& iKey) const {
   float returnValue = Global::MV;

   std::string filename = getFilename(iKey);
   std::vector<float> values;

   std::vector<float> offsets = getOffsets();
   std::vector<Member> members = getMembers();

   std::ifstream ifs(filename.c_str(), std::ifstream::in);
   if(!ifs.good()) {
      // Missing file
      std::vector<float> values;
      Key::Input key = iKey;
      for(int i = 0; i < offsets.size(); i++) {
         key.offset = offsets[i];
         for(key.member = 0; key.member < members.size(); key.member++) {
            Input::addToCache(key, Global::MV);
         }
      }
      std::stringstream ss;
      ss << "InputFlat: File " << filename << " missing";
      Global::logger->write(ss.str(), Logger::message);
   }
   else {
      // Loop over each line
      Key::Input key = iKey;
      int offsetId = 0;
      while(ifs.good()) {
         char line[10000];
         ifs.getline(line, 10000, '\n');
         if(ifs.good() && line[0] != '#') {
            if(offsetId >= offsets.size()) {
               std::stringstream ss;
               ss << "InputFlat: File '" << filename << "' has too many lines" << std::endl;
               Global::logger->write(ss.str(), Logger::warning);
               break;
            }
            assert(offsetId < offsets.size());
            key.offset = offsets[offsetId];
            std::stringstream ss(line);
            // Loop over each value
            key.member = 0;
            while(ss.good()) {
               float value;
               if(ss >> value) {
                  Input::addToCache(key, value);
               }
               if(key.offset == iKey.offset && key.member == iKey.member) {
                  returnValue = value;
               }
               key.member++;
            }
         }
         offsetId++;
      }
      offsetId--;
      // Deal with truncated files
      if(offsetId < offsets.size()-1) {
         std::stringstream ss;
         ss << "InputFlat: File '" << filename << "' has too few rows. Assume last rows are missing values";
         Global::logger->write(ss.str(), Logger::warning);
         while(offsetId < offsets.size()) {
            key.offset = offsets[offsetId];
            for(key.member = 0; key.member < getNumMembers(); key.member++) {
               Input::addToCache(key, Global::MV);
            }
            offsetId++;
         }
      }
   }
   return returnValue;
}

void InputFlat::writeCore(const Data& iData, int iDate, int iInit, const std::vector<float>& iOffsets, const std::vector<Location>& iLocations, const std::vector<Member>& iMembers, const std::vector<std::string>& iVariables) const {
   // Write each variable
   for(int v = 0; v < (int) iVariables.size(); v++) {
      std::string variable = iVariables[v];
      std::string localVariable;
      bool found = getLocalVariableName(variable, localVariable);
      if(!found) {
         std::stringstream ss;
         ss << "InputNetcdf::write: Do not know what to map " << variable << " to. Skipping.";
         Global::logger->write(ss.str(), Logger::message);
      }
      else {
         int variableId = Global::MV;
         bool found = getVariableIdFromVariable(variable, variableId);
         // Populate values;
         for(int l = 0; l < (int) iLocations.size(); l++) {
            // Set up file
            Key::Input key;
            key.date = iDate;
            key.init = iInit;
            key.location = l;
            key.variable = variableId;
            std::string filename = getFilename(key);
            Global::createDirectory(Global::getDirectory(filename));
            std::ofstream ofs(filename.c_str(), std::ios_base::out);

            for(int o = 0; o < (int) iOffsets.size(); o++) {
               float offset = iOffsets[o];
               for(int m = 0; m < (int) iMembers.size(); m++) {
                  float value = iData.getValue(iDate, iInit, offset, iLocations[l], iMembers[m], variable);
                  ofs << value << " ";
               }
               ofs << std::endl;
            }
         }
      }
   }
}


text:
package io.reactivex.internal.operators.observable;

import java.util.concurrent.TimeUnit;

import org.junit.Test;

import io.reactivex.*;
import io.reactivex.schedulers.TestScheduler;

public class ObservableIntervalTest {

    @Test
    public void dispose() {
        TestHelper.checkDisposed(Observable.interval(1, TimeUnit.MILLISECONDS, new TestScheduler()));
    }
}


text:
package org.kiji.mapreduce.output;

import java.io.IOException;
import java.util.Map;

import org.apache.hadoop.fs.Path;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;

import org.kiji.annotations.ApiAudience;
import org.kiji.annotations.ApiStability;
import org.kiji.annotations.Inheritance;
import org.kiji.mapreduce.MapReduceJobOutput;
import org.kiji.mapreduce.tools.framework.JobIOConfKeys;

/** Base class for MapReduce job output types that write to files. */
@ApiAudience.Public
@ApiStability.Stable
@Inheritance.Sealed
public abstract class FileMapReduceJobOutput extends MapReduceJobOutput {

  /** The file system path for the output files. */
  private Path mFilePath;
  /** The number of output file splits. */
  private int mNumSplits;

  /** Default constructor. Do not use directly. */
  FileMapReduceJobOutput() {
  }

  /** {@inheritDoc} */
  @Override
  public void initialize(Map<String, String> params) throws IOException {
    mFilePath = new Path(params.get(JobIOConfKeys.FILE_PATH_KEY));
    mNumSplits = Integer.parseInt(params.get(JobIOConfKeys.NSPLITS_KEY));
  }

  /**
   * Creates a new FileMapReduceJobOutput instance.
   *
   * @param filePath The file system path for the output files.
   * @param numSplits The number of output file splits.
   */
  FileMapReduceJobOutput(Path filePath, int numSplits) {
    mFilePath = filePath;
    mNumSplits = numSplits;
  }

  /** {@inheritDoc} */
  @Override
  public void configure(Job job) throws IOException {
    super.configure(job);
    FileOutputFormat.setOutputPath(job, mFilePath);
    job.setNumReduceTasks(mNumSplits);
  }
}