text:
package org.kuali.kra.institutionalproposal.web.struts.action;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.kuali.kra.common.notification.bo.KcNotification;
import org.kuali.kra.common.notification.bo.NotificationTypeRecipient;
import org.kuali.kra.common.notification.rule.event.AddNotificationRecipientEvent;
import org.kuali.kra.common.notification.rule.event.SendNotificationEvent;
import org.kuali.kra.infrastructure.Constants;
import org.kuali.kra.institutionalproposal.document.InstitutionalProposalDocument;
import org.kuali.kra.institutionalproposal.web.struts.form.InstitutionalProposalForm;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

public class InstitutionalProposalNotificationEditorAction extends InstitutionalProposalAction {

    @Override
    public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
        ActionForward actionForward = super.execute(mapping, form, request, response);

        InstitutionalProposalForm institutionalProposalForm = (InstitutionalProposalForm) form;

        institutionalProposalForm.getNotificationHelper().prepareView();

        return actionForward;
    }

    /**
     * Adds a Notification Recipient.
     *
     * @param mapping
     * @param form
     * @param request
     * @param response
     * @return ActionForward
     * @throws Exception
     */
    public ActionForward addNotificationRecipient(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
        throws Exception {

        InstitutionalProposalForm institutionalProposalForm = (InstitutionalProposalForm) form;
        InstitutionalProposalDocument document = institutionalProposalForm.getInstitutionalProposalDocument();
        NotificationTypeRecipient notificationRecipient = institutionalProposalForm.getNotificationHelper().getNewNotificationRecipient();
        List<NotificationTypeRecipient> notificationRecipients = institutionalProposalForm.getNotificationHelper().getNotificationRecipients();

        if (applyRules(new AddNotificationRecipientEvent(document, notificationRecipient, notificationRecipients))) {
            institutionalProposalForm.getNotificationHelper().getNotificationRecipients().add(notificationRecipient);
            institutionalProposalForm.getNotificationHelper().setNewNotificationRecipient(new NotificationTypeRecipient());
            institutionalProposalForm.getNotificationHelper().setNewRoleId(null);
            institutionalProposalForm.getNotificationHelper().setNewPersonId(null);
            institutionalProposalForm.getNotificationHelper().setNewRolodexId(null);
        }

        return mapping.findForward(Constants.MAPPING_BASIC);
    }

    /**
     * Deletes a Notification Recipient.
     *
     * @param mapping the action mapping
     * @param form the action form
     * @param request the request
     * @param response the response
     * @return the action forward
     * @throws Exception
     */
    public ActionForward deleteNotificationRecipient(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
        throws Exception {

        InstitutionalProposalForm institutionalProposalForm = (InstitutionalProposalForm) form;

        institutionalProposalForm.getNotificationHelper().getNotificationRecipients().remove(getLineToDelete(request));

        return mapping.findForward(Constants.MAPPING_BASIC);
    }

    /**
     * Sends a Notification.
     *
     * @param mapping the action mapping
     * @param form the action form
     * @param request the request
     * @param response the response
     * @return the action forward
     * @throws Exception
     */
    public ActionForward sendNotification(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
        ActionForward actionForward = mapping.findForward(Constants.MAPPING_BASIC);

        InstitutionalProposalForm institutionalProposalForm = (InstitutionalProposalForm) form;
        InstitutionalProposalDocument document = institutionalProposalForm.getInstitutionalProposalDocument();
        KcNotification notification = institutionalProposalForm.getNotificationHelper().getNotification();
        List<NotificationTypeRecipient> notificationRecipients = institutionalProposalForm.getNotificationHelper().getNotificationRecipients();

        if (applyRules(new SendNotificationEvent(document, notification, notificationRecipients))) {
            institutionalProposalForm.getNotificationHelper().sendNotification();
            String forwardName = institutionalProposalForm.getNotificationHelper().getNotificationContext().getForwardName();
            if (forwardName == null) {
                forwardName = Constants.MAPPING_INSTITUTIONAL_PROPOSAL_ACTIONS_PAGE;
            }
            actionForward = mapping.findForward(forwardName);
        }
        institutionalProposalForm.getNotificationHelper().setNotificationContext(null);

        return actionForward;
    }

    /**
     * Cancels a Notification.
     *
     * @param mapping the action mapping
     * @param form the action form
     * @param request the request
     * @param response the response
     * @return the action forward
     * @throws Exception
     */
    public ActionForward cancelNotification(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
        InstitutionalProposalForm institutionalProposalForm = (InstitutionalProposalForm) form;

        institutionalProposalForm.getNotificationHelper().setNotificationContext(null);

        return mapping.findForward(Constants.MAPPING_INSTITUTIONAL_PROPOSAL_ACTIONS_PAGE);
    }

}


text:
from unittest import TestCase

import os
import pytest
import torch
import torch.nn as nn
from torch.utils.data import TensorDataset

from zoo.orca import init_orca_context, stop_orca_context
from zoo.orca.learn.pytorch import Estimator
from zoo.orca.learn.optimizers import Adam
from zoo.orca.learn.metrics import *
from zoo.orca.learn.trigger import EveryEpoch

resource_path = os.path.join(os.path.split(__file__)[0], "../../../resources")

class TestEstimatorForSparkDataLoader(TestCase):

    def setUp(self):
        """ setup any state tied to the execution of the given method in a
        class.  setup_method is invoked for every test method of a class.
        """
        self.sc = init_orca_context(cores=4)

    def tearDown(self):
        """ teardown any state that was previously setup with a setup_method
        call.
        """
        stop_orca_context()

    def test_bigdl_pytorch_estimator_dataloader(self):
        class SimpleModel(nn.Module):
            def __init__(self):
                super(SimpleModel, self).__init__()
                self.dense1 = nn.Linear(2, 4)
                self.bn1 = torch.nn.BatchNorm1d(4)
                self.dense2 = nn.Linear(4, 1)

            def forward(self, x):
                x = self.dense1(x)
                x = self.bn1(x)
                x = torch.sigmoid(self.dense2(x))
                return x

        model = SimpleModel()

        estimator = Estimator.from_torch(model=model, loss=nn.BCELoss(),
                                         metrics=[Accuracy()],
                                         optimizer=Adam())

        inputs = torch.Tensor([[1, 2], [1, 3], [3, 2], [5, 6], [8, 9], [1, 9]])
        targets = torch.Tensor([[0], [0], [0], [1], [1], [1]])
        train_loader = torch.utils.data.DataLoader(
            TensorDataset(inputs, targets),
            batch_size=2,
        )
        val_loader = torch.utils.data.DataLoader(
            TensorDataset(inputs, targets),
            batch_size=2,
        )
        estimator.fit(data=train_loader, epochs=2, validation_data=val_loader,
                      checkpoint_trigger=EveryEpoch())
        estimator.evaluate(data=val_loader)

if __name__ == "__main__":
    pytest.main([__file__])

redpajama_set_name: RedPajamaGithub


text:
import { BorderLeft32 } from "../../";

export = BorderLeft32;


text:
time-tracker
============

Assembla based time tracker. It provides a simplified UI for entering time against Assembla tickets. Specifically targeting mobile devices.


text:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Management;
using System.Runtime.InteropServices;
using System.Text;
using Serilog;
using static Cobalt.Engine.Win32;

namespace Cobalt.Engine
{
    public class PathResolver
    {
        public string ResolveWindowPath(IntPtr hwnd)
        {
            if (!IsWindowVisible(hwnd)) return null;

            var pid = GetWindowProcessId(hwnd);
            var fileName = GetMainModuleFilePath(pid);
            //if it isnt a app hosted by ApplicationFrameHost (a UWP/Win10 app)
            if (!string.Equals(fileName, ApplicationFrameHost, StringComparison.OrdinalIgnoreCase))
                return fileName;

            fileName = GetMainModuleFilePath(GetModernAppProcessId(hwnd, pid));

            return fileName;
        }

        public string GetMainModuleFilePath(uint pid)
        {
            if (pid == 0) return null;
            var ret = QueryFullProcessImageNameStrategy(pid);
            //check if this strategy works, else use another
            if (IsValidWindowFilePath(ret)) return ret;
            ret = WmiStrategy(pid);
            if (IsValidWindowFilePath(ret)) return ret;
            return null;
        }

        private string WmiStrategy(uint pid)
        {
            //TODO CACHE IMPLEMENTATION
            var wmiQueryString = $"SELECT ProcessId, ExecutablePath FROM Win32_Process WHERE ProcessId = {pid}";
            var timer = Stopwatch.StartNew();
            timer.Start();
            using (var searcher = new ManagementObjectSearcher(wmiQueryString))
            using (var results = searcher.Get())
            {
                var ret = (string) results.Cast<ManagementBaseObject>().First()["ExecutablePath"];
                timer.Stop();
                Log.Information($"WEW: WMI: {timer.Elapsed}");
                return ret;
            }
        }

        public bool IsValidWindowFilePath(string path)
        {
            return !string.IsNullOrWhiteSpace(path) && File.Exists(path);
        }

        public string QueryFullProcessImageNameStrategy(uint pid)
        {
            var proc = OpenProcess(
                QueryLimitedInformation | ProcessVmRead, false, pid);
            //arbitrary
            var pathLen = 512;
            var path = new StringBuilder(pathLen);
            var finalPath = !QueryFullProcessImageName(proc, 0, path, ref pathLen) ? null : path.ToString();
            CloseHandle(proc);
            return finalPath;
        }

        private uint GetModernAppProcessId(IntPtr hwnd, uint pid)
        {
            //now this is a bit tricky. Modern apps are hosted inside ApplicationFrameHost process, so we need to find
            //child window which does NOT belong to this process.This should be the process we need. (in main checker)

            //But, fuck Win32/Metro, it doesnt allow me to find the app before the Splash finishes loading
            //So, I repeat the process while there are no windows, which is when the app closes, in the case
            //of open app -> immediately close (or atleast b4 the splash finishes)

            List<IntPtr> children;
            while ((children = GetChildWindows(hwnd)).Count != 0)
                foreach (var childHwnd in children)
                {
                    var childPid = GetWindowProcessId(childHwnd);
                    if (childPid != pid)
                        return childPid;
                }

            //error! (technically 0 is an invalid process id for a window)
            return 0;
        }

        private static List<IntPtr> GetChildWindows(IntPtr hwnd)
        {
            var result = new List<IntPtr>();
            var listHandle = GCHandle.Alloc(result);
            try
            {
                EnumWindowProc childProc = EnumChildWindow;
                EnumChildWindows(hwnd, childProc, GCHandle.ToIntPtr(listHandle));
            }
            finally
            {
                if (listHandle.IsAllocated)
                    listHandle.Free();
            }

            return result;
        }

        private static bool EnumChildWindow(IntPtr handle, IntPtr pointer)
        {
            var gch = GCHandle.FromIntPtr(pointer);
            if (!(gch.Target is List<IntPtr> list))
                throw new InvalidCastException("GCHandle Target could not be cast as List<IntPtr>");
            list.Add(handle);

            return true;
        }

        public static uint GetWindowProcessId(IntPtr hwnd)
        {
            uint pid;
            GetWindowThreadProcessId(hwnd, out pid);
            return pid;
        }
    }
}


text:
package org.apache.spark.sql.catalyst.optimizer

import scala.annotation.tailrec

import org.apache.spark.sql.catalyst.expressions._
import org.apache.spark.sql.catalyst.planning.ExtractFiltersAndInnerJoins
import org.apache.spark.sql.catalyst.plans._
import org.apache.spark.sql.catalyst.plans.logical._
import org.apache.spark.sql.catalyst.rules._
import org.apache.spark.sql.catalyst.trees.TreePattern._
import org.apache.spark.sql.errors.QueryCompilationErrors
import org.apache.spark.sql.internal.SQLConf

/**
 * Reorder the joins and push all the conditions into join, so that the bottom ones have at least
 * one condition.
 *
 * The order of joins will not be changed if all of them already have at least one condition.
 *
 * If star schema detection is enabled, reorder the star join plans based on heuristics.
 */
object ReorderJoin extends Rule[LogicalPlan] with PredicateHelper {
  /**
   * Join a list of plans together and push down the conditions into them.
   *
   * The joined plan are picked from left to right, prefer those has at least one join condition.
   *
   * @param input a list of LogicalPlans to inner join and the type of inner join.
   * @param conditions a list of condition for join.
   */
  @tailrec
  final def createOrderedJoin(
      input: Seq[(LogicalPlan, InnerLike)],
      conditions: Seq[Expression]): LogicalPlan = {
    assert(input.size >= 2)
    if (input.size == 2) {
      val (joinConditions, others) = conditions.partition(canEvaluateWithinJoin)
      val ((left, leftJoinType), (right, rightJoinType)) = (input(0), input(1))
      val innerJoinType = (leftJoinType, rightJoinType) match {
        case (Inner, Inner) => Inner
        case (_, _) => Cross
      }
      val join = Join(left, right, innerJoinType,
        joinConditions.reduceLeftOption(And), JoinHint.NONE)
      if (others.nonEmpty) {
        Filter(others.reduceLeft(And), join)
      } else {
        join
      }
    } else {
      val (left, _) :: rest = input.toList
      // find out the first join that have at least one join condition
      val conditionalJoin = rest.find { planJoinPair =>
        val plan = planJoinPair._1
        val refs = left.outputSet ++ plan.outputSet
        conditions
          .filterNot(l => l.references.nonEmpty && canEvaluate(l, left))
          .filterNot(r => r.references.nonEmpty && canEvaluate(r, plan))
          .exists(_.references.subsetOf(refs))
      }
      // pick the next one if no condition left
      val (right, innerJoinType) = conditionalJoin.getOrElse(rest.head)

      val joinedRefs = left.outputSet ++ right.outputSet
      val (joinConditions, others) = conditions.partition(
        e => e.references.subsetOf(joinedRefs) && canEvaluateWithinJoin(e))
      val joined = Join(left, right, innerJoinType,
        joinConditions.reduceLeftOption(And), JoinHint.NONE)

      // should not have reference to same logical plan
      createOrderedJoin(Seq((joined, Inner)) ++ rest.filterNot(_._1 eq right), others)
    }
  }

  def apply(plan: LogicalPlan): LogicalPlan = plan.transformWithPruning(
    _.containsPattern(INNER_LIKE_JOIN), ruleId) {
    case p @ ExtractFiltersAndInnerJoins(input, conditions)
        if input.size > 2 && conditions.nonEmpty =>
      val reordered = if (conf.starSchemaDetection && !conf.cboEnabled) {
        val starJoinPlan = StarSchemaDetection.reorderStarJoins(input, conditions)
        if (starJoinPlan.nonEmpty) {
          val rest = input.filterNot(starJoinPlan.contains(_))
          createOrderedJoin(starJoinPlan ++ rest, conditions)
        } else {
          createOrderedJoin(input, conditions)
        }
      } else {
        createOrderedJoin(input, conditions)
      }

      if (p.sameOutput(reordered)) {
        reordered
      } else {
        // Reordering the joins have changed the order of the columns.
        // Inject a projection to make sure we restore to the expected ordering.
        Project(p.output, reordered)
      }
  }
}

/**
 * 1. Elimination of outer joins, if the predicates can restrict the result sets so that
 * all null-supplying rows are eliminated
 *
 * - full outer -> inner if both sides have such predicates
 * - left outer -> inner if the right side has such predicates
 * - right outer -> inner if the left side has such predicates
 * - full outer -> left outer if only the left side has such predicates
 * - full outer -> right outer if only the right side has such predicates
 *
 * 2. Removes outer join if it only has distinct on streamed side
 * {{{
 *   SELECT DISTINCT f1 FROM t1 LEFT JOIN t2 ON t1.id = t2.id  ==>  SELECT DISTINCT f1 FROM t1
 * }}}
 *
 * This rule should be executed before pushing down the Filter
 */
object EliminateOuterJoin extends Rule[LogicalPlan] with PredicateHelper {

  /**
   * Returns whether the expression returns null or false when all inputs are nulls.
   */
  private def canFilterOutNull(e: Expression): Boolean = {
    if (!e.deterministic || SubqueryExpression.hasCorrelatedSubquery(e)) return false
    val attributes = e.references.toSeq
    val emptyRow = new GenericInternalRow(attributes.length)
    val boundE = BindReferences.bindReference(e, attributes)
    if (boundE.find(_.isInstanceOf[Unevaluable]).isDefined) return false
    val v = boundE.eval(emptyRow)
    v == null || v == false
  }

  private def buildNewJoinType(filter: Filter, join: Join): JoinType = {
    val conditions = splitConjunctivePredicates(filter.condition) ++ filter.constraints
    val leftConditions = conditions.filter(_.references.subsetOf(join.left.outputSet))
    val rightConditions = conditions.filter(_.references.subsetOf(join.right.outputSet))

    lazy val leftHasNonNullPredicate = leftConditions.exists(canFilterOutNull)
    lazy val rightHasNonNullPredicate = rightConditions.exists(canFilterOutNull)

    join.joinType match {
      case RightOuter if leftHasNonNullPredicate => Inner
      case LeftOuter if rightHasNonNullPredicate => Inner
      case FullOuter if leftHasNonNullPredicate && rightHasNonNullPredicate => Inner
      case FullOuter if leftHasNonNullPredicate => LeftOuter
      case FullOuter if rightHasNonNullPredicate => RightOuter
      case o => o
    }
  }

  def apply(plan: LogicalPlan): LogicalPlan = plan.transformWithPruning(
    _.containsPattern(OUTER_JOIN), ruleId) {
    case f @ Filter(condition, j @ Join(_, _, RightOuter | LeftOuter | FullOuter, _, _)) =>
      val newJoinType = buildNewJoinType(f, j)
      if (j.joinType == newJoinType) f else Filter(condition, j.copy(joinType = newJoinType))

    case a @ Aggregate(_, _, Join(left, _, LeftOuter, _, _))
        if a.groupOnly && a.references.subsetOf(AttributeSet(left.output)) =>
      a.copy(child = left)
    case a @ Aggregate(_, _, Join(_, right, RightOuter, _, _))
        if a.groupOnly && a.references.subsetOf(AttributeSet(right.output)) =>
      a.copy(child = right)
    case a @ Aggregate(_, _, p @ Project(_, Join(left, _, LeftOuter, _, _)))
        if a.groupOnly && a.references.subsetOf(AttributeSet(left.output)) =>
      a.copy(child = p.copy(child = left))
    case a @ Aggregate(_, _, p @ Project(_, Join(_, right, RightOuter, _, _)))
        if a.groupOnly && a.references.subsetOf(AttributeSet(right.output)) =>
      a.copy(child = p.copy(child = right))
  }
}

/**
 * PythonUDF in join condition can't be evaluated if it refers to attributes from both join sides.
 * See `ExtractPythonUDFs` for details. This rule will detect un-evaluable PythonUDF and pull them
 * out from join condition.
 */
object ExtractPythonUDFFromJoinCondition extends Rule[LogicalPlan] with PredicateHelper {

  private def hasUnevaluablePythonUDF(expr: Expression, j: Join): Boolean = {
    expr.find { e =>
      PythonUDF.isScalarPythonUDF(e) && !canEvaluate(e, j.left) && !canEvaluate(e, j.right)
    }.isDefined
  }

  override def apply(plan: LogicalPlan): LogicalPlan = plan.transformUpWithPruning(
    _.containsAllPatterns(PYTHON_UDF, JOIN)) {
    case j @ Join(_, _, joinType, Some(cond), _) if hasUnevaluablePythonUDF(cond, j) =>
      if (!joinType.isInstanceOf[InnerLike]) {
        // The current strategy supports only InnerLike join because for other types,
        // it breaks SQL semantic if we run the join condition as a filter after join. If we pass
        // the plan here, it'll still get a an invalid PythonUDF RuntimeException with message
        // `requires attributes from more than one child`, we throw firstly here for better
        // readable information.
        throw QueryCompilationErrors.usePythonUDFInJoinConditionUnsupportedError(joinType)
      }
      // If condition expression contains python udf, it will be moved out from
      // the new join conditions.
      val (udf, rest) = splitConjunctivePredicates(cond).partition(hasUnevaluablePythonUDF(_, j))
      val newCondition = if (rest.isEmpty) {
        logWarning(s"The join condition:$cond of the join plan contains PythonUDF only," +
          s" it will be moved out and the join plan will be turned to cross join.")
        None
      } else {
        Some(rest.reduceLeft(And))
      }
      val newJoin = j.copy(condition = newCondition)
      joinType match {
        case _: InnerLike => Filter(udf.reduceLeft(And), newJoin)
        case _ =>
          throw QueryCompilationErrors.usePythonUDFInJoinConditionUnsupportedError(joinType)
      }
  }
}

sealed abstract class BuildSide

case object BuildRight extends BuildSide

case object BuildLeft extends BuildSide

trait JoinSelectionHelper {

  def getBroadcastBuildSide(
      left: LogicalPlan,
      right: LogicalPlan,
      joinType: JoinType,
      hint: JoinHint,
      hintOnly: Boolean,
      conf: SQLConf): Option[BuildSide] = {
    val buildLeft = if (hintOnly) {
      hintToBroadcastLeft(hint)
    } else {
      canBroadcastBySize(left, conf) && !hintToNotBroadcastLeft(hint)
    }
    val buildRight = if (hintOnly) {
      hintToBroadcastRight(hint)
    } else {
      canBroadcastBySize(right, conf) && !hintToNotBroadcastRight(hint)
    }
    getBuildSide(
      canBuildBroadcastLeft(joinType) && buildLeft,
      canBuildBroadcastRight(joinType) && buildRight,
      left,
      right
    )
  }

  def getShuffleHashJoinBuildSide(
      left: LogicalPlan,
      right: LogicalPlan,
      joinType: JoinType,
      hint: JoinHint,
      hintOnly: Boolean,
      conf: SQLConf): Option[BuildSide] = {
    val buildLeft = if (hintOnly) {
      hintToShuffleHashJoinLeft(hint)
    } else {
      if (hintToPreferShuffleHashJoinLeft(hint)) {
        true
      } else {
        if (!conf.preferSortMergeJoin) {
          canBuildLocalHashMapBySize(left, conf) && muchSmaller(left, right)
        } else {
          false
        }
      }
    }
    val buildRight = if (hintOnly) {
      hintToShuffleHashJoinRight(hint)
    } else {
      if (hintToPreferShuffleHashJoinRight(hint)) {
        true
      } else {
        if (!conf.preferSortMergeJoin) {
          canBuildLocalHashMapBySize(right, conf) && muchSmaller(right, left)
        } else {
          false
        }
      }
    }
    getBuildSide(
      canBuildShuffledHashJoinLeft(joinType) && buildLeft,
      canBuildShuffledHashJoinRight(joinType) && buildRight,
      left,
      right
    )
  }

  def getSmallerSide(left: LogicalPlan, right: LogicalPlan): BuildSide = {
    if (right.stats.sizeInBytes <= left.stats.sizeInBytes) BuildRight else BuildLeft
  }

  /**
   * Matches a plan whose output should be small enough to be used in broadcast join.
   */
  def canBroadcastBySize(plan: LogicalPlan, conf: SQLConf): Boolean = {
    val autoBroadcastJoinThreshold = if (plan.stats.isRuntime) {
      conf.getConf(SQLConf.ADAPTIVE_AUTO_BROADCASTJOIN_THRESHOLD)
        .getOrElse(conf.autoBroadcastJoinThreshold)
    } else {
      conf.autoBroadcastJoinThreshold
    }
    plan.stats.sizeInBytes >= 0 && plan.stats.sizeInBytes <= autoBroadcastJoinThreshold
  }

  def canBuildBroadcastLeft(joinType: JoinType): Boolean = {
    joinType match {
      case _: InnerLike | RightOuter => true
      case _ => false
    }
  }

  def canBuildBroadcastRight(joinType: JoinType): Boolean = {
    joinType match {
      case _: InnerLike | LeftOuter | LeftSemi | LeftAnti | _: ExistenceJoin => true
      case _ => false
    }
  }

  def canBuildShuffledHashJoinLeft(joinType: JoinType): Boolean = {
    joinType match {
      case _: InnerLike | RightOuter | FullOuter => true
      case _ => false
    }
  }

  def canBuildShuffledHashJoinRight(joinType: JoinType): Boolean = {
    joinType match {
      case _: InnerLike | LeftOuter | FullOuter |
           LeftSemi | LeftAnti | _: ExistenceJoin => true
      case _ => false
    }
  }

  def canPlanAsBroadcastHashJoin(join: Join, conf: SQLConf): Boolean = {
    getBroadcastBuildSide(join.left, join.right, join.joinType,
      join.hint, hintOnly = true, conf).isDefined ||
      getBroadcastBuildSide(join.left, join.right, join.joinType,
        join.hint, hintOnly = false, conf).isDefined
  }

  def hintToBroadcastLeft(hint: JoinHint): Boolean = {
    hint.leftHint.exists(_.strategy.contains(BROADCAST))
  }

  def hintToBroadcastRight(hint: JoinHint): Boolean = {
    hint.rightHint.exists(_.strategy.contains(BROADCAST))
  }

  def hintToNotBroadcastLeft(hint: JoinHint): Boolean = {
    hint.leftHint.exists(_.strategy.contains(NO_BROADCAST_HASH))
  }

  def hintToNotBroadcastRight(hint: JoinHint): Boolean = {
    hint.rightHint.exists(_.strategy.contains(NO_BROADCAST_HASH))
  }

  def hintToShuffleHashJoinLeft(hint: JoinHint): Boolean = {
    hint.leftHint.exists(_.strategy.contains(SHUFFLE_HASH))
  }

  def hintToShuffleHashJoinRight(hint: JoinHint): Boolean = {
    hint.rightHint.exists(_.strategy.contains(SHUFFLE_HASH))
  }

  def hintToPreferShuffleHashJoinLeft(hint: JoinHint): Boolean = {
    hint.leftHint.exists(_.strategy.contains(PREFER_SHUFFLE_HASH))
  }

  def hintToPreferShuffleHashJoinRight(hint: JoinHint): Boolean = {
    hint.rightHint.exists(_.strategy.contains(PREFER_SHUFFLE_HASH))
  }

  def hintToSortMergeJoin(hint: JoinHint): Boolean = {
    hint.leftHint.exists(_.strategy.contains(SHUFFLE_MERGE)) ||
      hint.rightHint.exists(_.strategy.contains(SHUFFLE_MERGE))
  }

  def hintToShuffleReplicateNL(hint: JoinHint): Boolean = {
    hint.leftHint.exists(_.strategy.contains(SHUFFLE_REPLICATE_NL)) ||
      hint.rightHint.exists(_.strategy.contains(SHUFFLE_REPLICATE_NL))
  }

  private def getBuildSide(
      canBuildLeft: Boolean,
      canBuildRight: Boolean,
      left: LogicalPlan,
      right: LogicalPlan): Option[BuildSide] = {
    if (canBuildLeft && canBuildRight) {
      // returns the smaller side base on its estimated physical size, if we want to build the
      // both sides.
      Some(getSmallerSide(left, right))
    } else if (canBuildLeft) {
      Some(BuildLeft)
    } else if (canBuildRight) {
      Some(BuildRight)
    } else {
      None
    }
  }

  /**
   * Matches a plan whose single partition should be small enough to build a hash table.
   *
   * Note: this assume that the number of partition is fixed, requires additional work if it's
   * dynamic.
   */
  private def canBuildLocalHashMapBySize(plan: LogicalPlan, conf: SQLConf): Boolean = {
    plan.stats.sizeInBytes < conf.autoBroadcastJoinThreshold * conf.numShufflePartitions
  }

  /**
   * Returns whether plan a is much smaller (3X) than plan b.
   *
   * The cost to build hash map is higher than sorting, we should only build hash map on a table
   * that is much smaller than other one. Since we does not have the statistic for number of rows,
   * use the size of bytes here as estimation.
   */
  private def muchSmaller(a: LogicalPlan, b: LogicalPlan): Boolean = {
    a.stats.sizeInBytes * 3 <= b.stats.sizeInBytes
  }
}


text:
using System;
using Nancy;
using Nancy.Hosting.Self;
using Nancy.Conventions;
using Nancy.ModelBinding;
using PclUnit.Run;
using System.Linq;
using System.Text;
using System.IO;
namespace pclunit_runner
{

	public class PclRunnerModule : NancyModule
	{
		public PclRunnerModule()
		{
			Get["/"] = _ => "PclUnit Aggregating Runner";
			Get["/api/connect/{id}"] = _ => {
				string id = _.id;
				Console.WriteLine("Connecting:{0,15}",id);
				return "OK";
			};
			Post["/api/send_tests"] = _ => {
				var runner = this.Bind<Runner>();

				foreach (var test in runner.Assemblies.SelectMany(it=>it.Fixtures).SelectMany(it=>it.Tests))
				{
					PlatformResults.Instance.AddTest(test, runner.Platform);
				}
				Console.WriteLine("Receiving Test List:{0,15}", runner.Platform);
				PlatformResults.Instance.ReceivedTests(runner.Platform);
				return "OK";
			};
			Post["/api/send_result"] = _ => {
				var result = this.Bind<Result>();
				var dict = PlatformResults.Instance.AddResult(result);
				PrintResults.PrintResult(dict);
				return "OK";
			};
			Get["/api/check_tests"] = _ => {
				var results = PlatformResults.Instance;
				if(results.Go){
					var build = new StringBuilder();
					foreach(var inc in results.Includes){
						build.AppendFormat("++INCLUDE++{0}", inc);
					}
					foreach(var inc in results.Includes){
						build.AppendFormat("++EXCLUDE++{0}", inc);
					}
					build.AppendLine("++READY++");
					return build.ToString();
				}else{
					return "++NOTREADY++";
				}
			};
			Get ["/reshare/{file*}"] = _ => {
				string path = _.file;
				var fullPath = Path.GetFullPath(PlatformResults.Instance.ResharePath);
				var fullFilePath = Path.GetFullPath(Path.Combine(fullPath, path));

				if(!fullFilePath.StartsWith(fullPath)){
					return String.Format("Can't find file {0}" ,path);
				}
				var response = new Response();
				response.ContentType = "application/octet-stream";
				response.Contents = s => {
					File.OpenRead(fullFilePath).CopyTo(s);
				};
				return response;
			};
		}
	}
}


text:
<?php
/**
 * @author oba.ou
 */

namespace app\core\rbac;

use Yii;
use yii\db\Query;
use yii\db\Expression;
use yii\rbac\Assignment;
use yii\rbac\Item;
use yii\rbac\Permission;
use yii\rbac\Role;

/**
 * 1.这个类主要是修改了 DBA要求的 字段值
 * DBA 要求字段默认值为 NOT NULL yii2 该类存储值为 NULL 造成sql 报错
 *
 * 2.yii2默认为 created_at 和 updated_at
 * DBA 要求为 create_time 和 update_time
 *
 *
 *
 *
 */
class DbManager extends \yii\rbac\DbManager
{
    /**
     * @inheritdoc
     */
    protected function addItem($item)
    {
        if ($item->createdAt === null) {
            $item->createdAt = CURRENT_DATETIME;
        }
        if ($item->updatedAt === null) {
            $item->updatedAt = CURRENT_DATETIME;
        }

        $data = [];
        $data['name'] = $item->name;
        $data['type'] = $item->type;
        $data['description'] = $item->description;
        $data['rule_name'] = $item->ruleName;
        $data  = array_filter($data);

        if(isset($data['data']) && $data['data'] !== null){
            $data['data'] = serialize($item->data);
        }
        $data['create_time'] = CURRENT_DATETIME;
        $data['update_time'] = CURRENT_DATETIME;

        $this->db->createCommand()
            ->insert($this->itemTable, $data)->execute();
        $this->invalidateCache();

        return true;
    }

    /**
     * @inheritdoc
     */
    protected function updateItem($name, $item)
    {
        if ($item->name !== $name && !$this->supportsCascadeUpdate()) {
            $this->db->createCommand()
                ->update($this->itemChildTable, ['parent' => $item->name], ['parent' => $name])
                ->execute();
            $this->db->createCommand()
                ->update($this->itemChildTable, ['child' => $item->name], ['child' => $name])
                ->execute();
            $this->db->createCommand()
                ->update($this->assignmentTable, ['item_name' => $item->name], ['item_name' => $name])
                ->execute();
        }

        $data = [];
        $data['name'] = $item->name;
        $data['type'] = $item->type;
        $data['description'] = $item->description;
        $data['rule_name'] = $item->ruleName;
        $data['update_time'] = CURRENT_DATETIME;

        $data  = array_filter($data);

        if(isset($data['data']) && $data['data'] !== null){
            $data['data'] = serialize($item->data);
        }

        $this->db->createCommand()
            ->update($this->itemTable, $data, [
                'name' => $name,
            ])->execute();

        $this->invalidateCache();

        return true;
    }

    /**
     * @inheritdoc
     */
    protected function addRule($rule)
    {
        if ($rule->createdAt === null) {
            $rule->createdAt = CURRENT_DATETIME;
        }
        if ($rule->updatedAt === null) {
            $rule->updatedAt = CURRENT_DATETIME;
        }
        $this->db->createCommand()
            ->insert($this->ruleTable, [
                'name' => $rule->name,
                'data' => serialize($rule),
                'create_time' => $rule->createdAt,
                'update_time' => $rule->updatedAt,
            ])->execute();

        $this->invalidateCache();

        return true;
    }

    /**
     * @inheritdoc
     */
    protected function updateRule($name, $rule)
    {
        if ($rule->name !== $name && !$this->supportsCascadeUpdate()) {
            $this->db->createCommand()
                ->update($this->itemTable, ['rule_name' => $rule->name], ['rule_name' => $name])
                ->execute();
        }

        $rule->updatedAt = CURRENT_DATETIME;

        $this->db->createCommand()
            ->update($this->ruleTable, [
                'name' => $rule->name,
                'data' => serialize($rule),
                'update_at' => $rule->updatedAt,
            ], [
                'name' => $name,
            ])->execute();

        $this->invalidateCache();

        return true;
    }

    /**
     * @inheritdoc
     */
    protected function removeRule($rule)
    {
        if (!$this->supportsCascadeUpdate()) {
            $this->db->createCommand()
                ->update($this->itemTable, ['rule_name' => null], ['rule_name' => $rule->name])
                ->execute();
        }

        $this->db->createCommand()
            ->delete($this->ruleTable, ['name' => $rule->name])
            ->execute();

        $this->invalidateCache();

        return true;
    }

    /**
     * @inheritdoc
     */
    protected function getItems($type)
    {
        $query = (new Query)
            ->from($this->itemTable)
            ->where(['type' => $type]);

        $items = [];
        foreach ($query->all($this->db) as $row) {
            $items[$row['name']] = $this->populateItem($row);
        }

        return $items;
    }

    /**
     * Populates an auth item with the data fetched from database
     * @param array $row the data from the auth item table
     * @return Item the populated auth item instance (either Role or Permission)
     */
    protected function populateItem($row)
    {
        $class = $row['type'] == Item::TYPE_PERMISSION ? Permission::className() : Role::className();

        if (!isset($row['data']) || ($data = @unserialize($row['data'])) === false) {
            $data = null;
        }

        return new $class([
            'name' => $row['name'],
            'type' => $row['type'],
            'description' => $row['description'],
            'ruleName' => $row['rule_name'],
            'data' => $data,
        ]);
    }

    /**
     * Recursively finds all children and grand children of the specified item.
     * @param string $name the name of the item whose children are to be looked for.
     * @param array $childrenList the child list built via [[getChildrenList()]]
     * @param array $result the children and grand children (in array keys)
     */
    protected function getChildrenRecursive($name, $childrenList, &$result)
    {
        if (isset($childrenList[$name])) {
            foreach ($childrenList[$name] as $child) {
                $result[$child] = true;
                $this->getChildrenRecursive($child, $childrenList, $result);
            }
        }
    }

    /**
     * @inheritdoc
     */
    public function getAssignment($roleName, $userId)
    {
        if (empty($userId)) {
            return null;
        }

        $row = (new Query)->from($this->assignmentTable)
            ->where(['user_id' => (string) $userId, 'item_name' => $roleName])
            ->one($this->db);

        if ($row === false) {
            return null;
        }

        return new Assignment([
            'userId' => $row['user_id'],
            'roleName' => $row['item_name'],
            'createdAt' => $row['create_time'],
        ]);
    }

    /**
     * @inheritdoc
     */
    public function getAssignments($userId)
    {
        if (empty($userId)) {
            return [];
        }

        $query = (new Query)
            ->from($this->assignmentTable)
            ->where(['user_id' => (string) $userId]);

        $assignments = [];
        foreach ($query->all($this->db) as $row) {
            $assignments[$row['item_name']] = new Assignment([
                'userId' => $row['user_id'],
                'roleName' => $row['item_name'],
                'createdAt' => $row['create_time'],
            ]);
        }

        return $assignments;
    }

    /**
     * @inheritdoc
     */
    public function getChildren($name)
    {
        $query = (new Query)
            ->select(['name', 'type', 'description', 'rule_name', 'data'])
            ->from([$this->itemTable, $this->itemChildTable])
            ->where(['parent' => $name, 'name' => new Expression('[[child]]')]);

        $children = [];
        foreach ($query->all($this->db) as $row) {
            $children[$row['name']] = $this->populateItem($row);
        }

        return $children;
    }

    /**
     * Checks whether there is a loop in the authorization item hierarchy.
     * @param Item $parent the parent item
     * @param Item $child the child item to be added to the hierarchy
     * @return boolean whether a loop exists
     */
    protected function detectLoop($parent, $child)
    {
        if ($child->name === $parent->name) {
            return true;
        }
        foreach ($this->getChildren($child->name) as $grandchild) {
            if ($this->detectLoop($parent, $grandchild)) {
                return true;
            }
        }
        return false;
    }

    /**
     * @inheritdoc
     */
    public function assign($role, $userId)
    {
        $assignment = new Assignment([
            'userId' => $userId,
            'roleName' => $role->name,
            'createdAt' => CURRENT_DATETIME,
        ]);

        $this->db->createCommand()
            ->insert($this->assignmentTable, [
                'user_id' => $assignment->userId,
                'item_name' => $assignment->roleName,
                'create_time' => $assignment->createdAt,
            ])->execute();

        return $assignment;
    }
}


text:
layout: post
date: '2015-06-09'
title: "PROM DRESSES Sherri Hill 21258 Short Polka Dot Prom Dress"
category: PROM DRESSES
tags: [PROM DRESSES]
---
### PROM DRESSES Sherri Hill 21258 Short Polka Dot Prom Dress
Just **$445.99**
###

Sherri Hill 21258 Short Polka Dot Prom Dress

Available in sizes 0-18.

Buy it: [https://www.eudances.com/en/prom-dresses/1118-sherri-hill-21258-short-polka-dot-prom-dress.html](https://www.eudances.com/en/prom-dresses/1118-sherri-hill-21258-short-polka-dot-prom-dress.html)


text:
copyright:
  years: 2014, 2017
lastupdated: "2017-02-23"

---
{:new_window: target="_blank"}
{:shortdesc: .shortdesc}
{:codeblock: .codeblock}
{:screen: .screen}
{:pre: .pre}

# Working with directories

Swift does not have a true directory structure, but uses naming to represent a directory layout. If you specify a directory name, it is attached to all file names as part of the relative path.
{: shortdesc}

## Adding a directory to a container with the Swift CLI

To add a directory to a container, you must have the directory structure in place on your local device.

1. Locally, create a directory and save your file.
2. Run the following command to upload a directory to your container.

    ```
    swift upload <container_name> <directory_name>
    ```
    {: pre}

## Downloading a directory with the CLI
To download a directory structure, use the `-prefix` parameter to indicate the directory or directory structure that you want to download.

1. Run the following command to download a directory.

    ```
    swift download <container_name> --prefix <directory>
    ```
    {: pre}


text:
'use strict';

angular.module('core').controller('HomeController', ['$scope', 'Authentication', 'Surveys',
	function($scope, Authentication,Surveys) {
		// This provides Authentication context.
		$scope.authentication = Authentication;

		// Find a active Surveys
		$scope.find = function() {
			$scope.surveys = Surveys.query();
		};
	}
]);


text:
using System.Collections.Generic;
using System.Linq;
using System.Reflection.Metadata.Cil.Decoder;
using System.Reflection.Metadata.Cil.Visitor;
using System.Reflection.Metadata.Ecma335;

namespace System.Reflection.Metadata.Cil
{
    /// <summary>
    /// Class representing a type definition within an assembly.
    /// </summary>
    public struct CilTypeDefinition : ICilVisitable
    {
        private CilReaders _readers;
        private TypeDefinition _typeDefinition;
        private CilTypeLayout _layout;
        private string _name;
        private string _fullName;
        private string _namespace;
        private IEnumerable<CilMethodDefinition> _methodDefinitions;
        private Dictionary<int, int> _methodImplementationDictionary;
        private int _token;
        private IEnumerable<string> _genericParameters;
        private IEnumerable<CilField> _fieldDefinitions;
        private IEnumerable<CilTypeDefinition> _nestedTypes;
        private IEnumerable<CilCustomAttribute> _customAttributes;
        private IEnumerable<CilProperty> _properties;
        private IEnumerable<CilEventDefinition> _events;
        private CilEntity _baseType;
        private bool _isBaseTypeInitialized;
        private bool _isLayoutInitialized;
        private string _signature;

        internal static CilTypeDefinition Create(TypeDefinition typeDef, ref CilReaders readers, int token)
        {
            CilTypeDefinition type = new CilTypeDefinition();
            type._typeDefinition = typeDef;
            type._token = token;
            type._readers = readers;
            type._isBaseTypeInitialized = false;
            type._isLayoutInitialized = false;
            return type;
        }

        #region Public APIs

        /// <summary>
        /// Type full name
        /// </summary>
        public string FullName
        {
            get
            {
                if(_fullName == null)
                {
                    _fullName = SignatureDecoder.DecodeType(MetadataTokens.TypeDefinitionHandle(_token), _readers.Provider, null).ToString(false);
                }
                return _fullName;
            }
        }

        /// <summary>
        /// Property that contains the type name.
        /// </summary>
        public string Name
        {
            get
            {
                return CilDecoder.GetCachedValue(_typeDefinition.Name, _readers, ref _name);
            }
        }

        /// <summary>
        /// Property containing the namespace name.
        /// </summary>
        public string Namespace
        {
            get
            {
                return CilDecoder.GetCachedValue(_typeDefinition.Namespace, _readers ,ref _namespace);
            }
        }

        public string Signature
        {
            get
            {
                if(_signature == null)
                {
                    _signature = GetSignature();
                }
                return _signature;
            }
        }

        public bool IsGeneric
        {
            get
            {
                return GenericParameters.Count() != 0;
            }
        }

        public bool IsNested
        {
            get
            {
                return !_typeDefinition.GetDeclaringType().IsNil;
            }
        }

        public bool IsInterface
        {
            get
            {
                return _typeDefinition.BaseType.IsNil;
            }
        }

        public bool HasBaseType
        {
            get
            {
                return !_typeDefinition.BaseType.IsNil;
            }
        }

        public CilEntity BaseType
        {
            get
            {
                if (IsInterface) throw new InvalidOperationException("The type definition is an interface, they don't have a base type");
                if(!_isBaseTypeInitialized)
                {
                    _isBaseTypeInitialized = true;
                    _baseType = CilDecoder.DecodeEntityHandle(_typeDefinition.BaseType, ref _readers);
                }
                return _baseType;
            }
        }

        public TypeAttributes Attributes
        {
            get
            {
                return _typeDefinition.Attributes;
            }
        }

        public CilTypeLayout Layout
        {
            get
            {
                if (!_isLayoutInitialized)
                {
                    _isLayoutInitialized = true;
                    _layout = new CilTypeLayout(_typeDefinition.GetLayout());
                }
                return _layout;
            }
        }

        public IEnumerable<InterfaceImplementation> InterfaceImplementations
        {
            get
            {
                throw new NotImplementedException("not implemented Interface Impl on Type Def");
            }
        }

        public IEnumerable<CilEventDefinition> Events
        {
            get
            {
                if(_events == null)
                {
                    _events = GetEvents();
                }
                return _events;
            }
        }

        public IEnumerable<CilProperty> Properties
        {
            get
            {
                if(_properties == null)
                {
                    _properties = GetProperties();
                }
                return _properties;
            }
        }

        public IEnumerable<CilTypeDefinition> NestedTypes
        {
            get
            {
                if(_nestedTypes == null)
                {
                    _nestedTypes = GetNestedTypes();
                }
                return _nestedTypes;
            }
        }

        public IEnumerable<string> GenericParameters
        {
            get
            {
                if(_genericParameters == null)
                {
                    _genericParameters = GetGenericParameters();
                }
                return _genericParameters;
            }
        }

        /// <summary>
        /// Property containing all the method definitions within a type.
        /// </summary>
        public IEnumerable<CilMethodDefinition> MethodDefinitions
        {
            get
            {
                if (_methodDefinitions == null)
                {
                    _methodDefinitions = GetMethodDefinitions();
                }
                return _methodDefinitions;
            }
        }

        public IEnumerable<CilField> FieldDefinitions
        {
            get
            {
                if (_fieldDefinitions == null)
                {
                    _fieldDefinitions = GetFieldDefinitions();
                }
                return _fieldDefinitions;
            }
        }

        public IEnumerable<CilCustomAttribute> CustomAttributes
        {
            get
            {
                if(_customAttributes == null)
                {
                    _customAttributes = GetCustomAttributes();
                }
                return _customAttributes;
            }
        }

        /// <summary>
        /// Method that returns the token of a method declaration given the method token that overrides it. Returns 0 if the token doesn't represent an overriden method.
        /// </summary>
        /// <param name="methodBodyToken">Token of the method body that overrides a declaration.</param>
        /// <returns>token of the method declaration, 0 if there is no overriding of that method.</returns>
        public int GetOverridenMethodToken(int methodBodyToken)
        {
            MethodImplementationDictionary.TryGetValue(methodBodyToken, out int result);
            return result;
        }

        public void Accept(ICilVisitor visitor)
        {
            visitor.Visit(this);
        }

        #endregion

        #region Private Methods
        private IEnumerable<CilMethodDefinition> GetMethodDefinitions()
        {
            var handles = _typeDefinition.GetMethods();
            foreach (var handle in handles)
            {
                var method = _readers.MdReader.GetMethodDefinition(handle);
                yield return CilMethodDefinition.Create(method, MetadataTokens.GetToken(handle), ref _readers, this);
            }
        }
        private void PopulateMethodImplementationDictionary()
        {
            var implementations = _typeDefinition.GetMethodImplementations();
            Dictionary<int, int> dictionary = new Dictionary<int, int>(implementations.Count);
            foreach (var implementationHandle in implementations)
            {
                var implementation = _readers.MdReader.GetMethodImplementation(implementationHandle);
                int declarationToken = MetadataTokens.GetToken(implementation.MethodDeclaration);
                int bodyToken = MetadataTokens.GetToken(implementation.MethodBody);
                dictionary.Add(bodyToken, declarationToken);
            }
            _methodImplementationDictionary = dictionary;
        }
        private IEnumerable<string> GetGenericParameters()
        {
            foreach(var handle in _typeDefinition.GetGenericParameters())
            {
                var parameter = _readers.MdReader.GetGenericParameter(handle);
                yield return _readers.MdReader.GetString(parameter.Name);
            }
        }
        private IEnumerable<CilField> GetFieldDefinitions()
        {
            foreach(var handle in _typeDefinition.GetFields())
            {
                var field = _readers.MdReader.GetFieldDefinition(handle);
                var token = MetadataTokens.GetToken(handle);
                yield return CilField.Create(field, token, ref _readers, this);
            }
        }
        private IEnumerable<CilTypeDefinition> GetNestedTypes()
        {
            foreach(var handle in _typeDefinition.GetNestedTypes())
            {
                if (handle.IsNil)
                {
                    continue;
                }
                var typeDefinition = _readers.MdReader.GetTypeDefinition(handle);
                yield return Create(typeDefinition, ref _readers, MetadataTokens.GetToken(handle));
            }
        }
        private IEnumerable<CilCustomAttribute> GetCustomAttributes()
        {
            foreach(var handle in _typeDefinition.GetCustomAttributes())
            {
                var attribute = _readers.MdReader.GetCustomAttribute(handle);
                yield return new CilCustomAttribute(attribute, ref _readers);
            }
        }
        private IEnumerable<CilProperty> GetProperties()
        {
            foreach(var handle in _typeDefinition.GetProperties())
            {
                var property = _readers.MdReader.GetPropertyDefinition(handle);
                int token = MetadataTokens.GetToken(handle);
                yield return CilProperty.Create(property, token,ref _readers, this);
            }
        }
        private IEnumerable<CilEventDefinition> GetEvents()
        {
            foreach (var handle in _typeDefinition.GetEvents())
            {
                var eventDef = _readers.MdReader.GetEventDefinition(handle);
                yield return CilEventDefinition.Create(eventDef, MetadataTokens.GetToken(handle), ref _readers, this);
            }
        }
        private string GetSignature()
        {
            return string.Empty;
        }

        #endregion

        #region Internal Members

        internal Dictionary<int, int> MethodImplementationDictionary
        {
            get
            {
                if(_methodImplementationDictionary == null)
                {
                   PopulateMethodImplementationDictionary();
                }
                return _methodImplementationDictionary;
            }
        }

        internal int Token
        {
            get
            {
                return _token;
            }
        }

        #endregion
    }
}


text:
var hyperlog = require('../')
var tape = require('tape')
var memdb = require('memdb')

tape('sign', function (t) {
  t.plan(4)

  var log = hyperlog(memdb(), {
    identity: new Buffer('i-am-a-public-key'),
    sign: function (node, cb) {
      t.same(node.value, new Buffer('hello'), 'sign is called')
      cb(null, new Buffer('i-am-a-signature'))
    }
  })

  log.add(null, 'hello', function (err, node) {
    t.error(err, 'no err')
    t.same(node.signature, new Buffer('i-am-a-signature'), 'has signature')
    t.same(node.identity, new Buffer('i-am-a-public-key'), 'has public key')
    t.end()
  })
})

tape('sign fails', function (t) {
  t.plan(2)

  var log = hyperlog(memdb(), {
    identity: new Buffer('i-am-a-public-key'),
    sign: function (node, cb) {
      cb(new Error('lol'))
    }
  })

  log.on('reject', function (node) {
    t.ok(node)
  })

  log.add(null, 'hello', function (err) {
    t.same(err && err.message, 'lol', 'had error')
  })
})

tape('verify', function (t) {
  t.plan(3)

  var log1 = hyperlog(memdb(), {
    identity: new Buffer('i-am-a-public-key'),
    sign: function (node, cb) {
      cb(null, new Buffer('i-am-a-signature'))
    }
  })

  var log2 = hyperlog(memdb(), {
    verify: function (node, cb) {
      t.same(node.signature, new Buffer('i-am-a-signature'), 'verify called with signature')
      t.same(node.identity, new Buffer('i-am-a-public-key'), 'verify called with public key')
      cb(null, true)
    }
  })

  log1.add(null, 'hello', function (err, node) {
    t.error(err, 'no err')
    var stream = log2.replicate()
    stream.pipe(log1.replicate()).pipe(stream)
  })
})

tape('verify fails', function (t) {
  t.plan(2)

  var log1 = hyperlog(memdb(), {
    identity: new Buffer('i-am-a-public-key'),
    sign: function (node, cb) {
      cb(null, new Buffer('i-am-a-signature'))
    }
  })

  var log2 = hyperlog(memdb(), {
    verify: function (node, cb) {
      cb(null, false)
    }
  })

  log1.add(null, 'hello', function (err, node) {
    t.error(err, 'no err')

    var stream = log2.replicate()

    stream.on('error', function (err) {
      t.same(err.message, 'Invalid signature', 'stream had error')
      t.end()
    })
    stream.pipe(log1.replicate()).pipe(stream)
  })
})

tape('per-document identity (add)', function (t) {
  t.plan(3)

  var log1 = hyperlog(memdb(), {
    sign: function (node, cb) {
      cb(null, new Buffer('i-am-a-signature'))
    }
  })

  var log2 = hyperlog(memdb(), {
    verify: function (node, cb) {
      t.same(node.signature, new Buffer('i-am-a-signature'), 'verify called with signature')
      t.same(node.identity, new Buffer('i-am-a-public-key'), 'verify called with public key')
      cb(null, true)
    }
  })

  var opts = { identity: new Buffer('i-am-a-public-key') }
  log1.add(null, 'hello', opts, function (err, node) {
    t.error(err, 'no err')
    var stream = log2.replicate()
    stream.pipe(log1.replicate()).pipe(stream)
  })
})

tape('per-document identity (batch)', function (t) {
  t.plan(5)

  var log1 = hyperlog(memdb(), {
    sign: function (node, cb) {
      cb(null, new Buffer('i-am-a-signature'))
    }
  })

  var expectedpk = [ Buffer('hello id'), Buffer('whatever id') ]
  var log2 = hyperlog(memdb(), {
    verify: function (node, cb) {
      t.same(node.signature, new Buffer('i-am-a-signature'), 'verify called with signature')
      t.same(node.identity, expectedpk.shift(), 'verify called with public key')
      cb(null, true)
    }
  })

  log1.batch([
    {
      value: 'hello',
      identity: Buffer('hello id')
    },
    {
      value: 'whatever',
      identity: Buffer('whatever id')
    }
  ], function (err, nodes) {
    t.error(err, 'no err')
    var stream = log2.replicate()
    stream.pipe(log1.replicate()).pipe(stream)
  })
})


text:
std::string resourcePath(void)
{
   return "../resources/";
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Class org.apache.taverna.scufl2.api.common.AbstractCloneable.CopyVisitor (Apache Taverna Language APIs (Scufl2, Databundle) 0.15.1-incubating API)</title>
<meta name="date" content="2016-03-14">
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
org.apache.taverna.scufl2.api.common.AbstractCloneable.CopyVisitor

No usage of org.apache.taverna.scufl2.api.common.AbstractCloneable.CopyVisitor

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2015–2016 The Apache Software Foundation. All rights reserved.


text:
:: Hak Cipta ©2018
:: @neon-nyan / codeneon
:: [codeneon123@gmail.com]
::
:: Di bawah Hak Cipta MIT License
:: [https://github.com/neon-nyan/xAutoBatch/raw/master/LICENSE]

:__jumper
    if "%jump%" == "" (
        msg * Sertakan label terlebih dahulu!
        msg * Dan gunakan Classes ini dengan program Encodernya.
        msg * ^(/^^_^^^)/ Makasih! \^(^^_^^\^) ^<-----------^> Oleh: codeneon
        exit
    ) else (
        goto %jump%
    )

:StartJumpAudioCodecDestination
    goto %AudioCodecSelect%

:ProcessAudioCodec
    :ProcessAACAudioCodec
        if exist "%mediaoutputname%.wav" (
            del "%mediaoutputname%.wav"
        )

        echo [INFO]     Sedang memproses...
        echo            %mediainput% -^> %mediaoutputname%.m4a
        echo            --------------------------------------------------
        echo            mode: %audio-codec%
        echo.

        :SETAACCodecParam
            if /I "%audio-codec%" == "lc-aac" (
                set aac-codec=lc
            ) else if /I "%audio-codec%" == "he-aac" (
                set aac-codec=he
            ) else if /I "%audio-codec%" == "he-aacv2" (
                set aac-codec=hev2
            )

        if "%audio-bitrate%" == "" (
            :SETAACDefaultBitrate
                if /I "%audio-codec%" == "lc-aac" (
                    set audio-bitrate=116
                ) else if "%audio-codec%" == "he-aac" (
                    set audio-bitrate=76
                ) else if "%audio-codec%" == "he-aacv2" (
                    set audio-bitrate=48
                )

            echo [WARNING]  Bitrate belum dimasukkan atau parameter belum ditentukan.
            echo            Proses akan dilakukan dengan bitrate default !audio-bitrate!kbp/s.
        )

        :DoAACMethodForEachPass
        if /I "%audio-pass%" == "2pass" (
            "%file.exec.avs.pipe.audio%" "%mediainputaudio%" "%mediaoutputname%.wav" && "%file.exec.encoder.audio.aac%" -br !audio-bitrate!000 -2pass -!aac-codec! -ignorelength -if "%mediaoutputname%.wav" -of "%mediaoutputname%.m4a" || set progpath=%file.exec.encoder.audio.aac% && goto :__error

            del "%mediaoutputname%.wav"
        ) else if /I "%audio-pass%" == "1pass" (
            "%file.exec.avs.pipe.audio%" "%mediainputaudio%" - | "%file.exec.encoder.audio.aac%" -br !audio-bitrate!000 -!aac-codec! -ignorelength -if - -of "%mediaoutputname%.m4a" || set progpath=%file.exec.encoder.audio.aac% && goto :__error
        ) else (
            if "%audio-pass%" == "" (
                echo [WARNING]  Pass/phase-pass belum dimasukkan atau parameter belum ditentukan.
                echo                value: [1pass,2pass]
                echo            Proses akan dilakukan dalam x-2pass.
            ) else (
                echo [WARNING]  Value Pass/phase-pass tidak diketahui.
                echo                value: [1pass,2pass]
                echo            Proses akan dilakukan kedalam x-2pass secara default.
            )

            "%file.exec.avs.pipe.audio%" "%mediainputaudio%" "%mediaoutputname%.wav" && "%file.exec.encoder.audio.aac%" -br !audio-bitrate!000 -2pass -!aac-codec! -ignorelength -if "%mediaoutputname%.wav" -of "%mediaoutputname%.m4a" || set progpath=%file.exec.encoder.audio.aac% && goto :__error

            del "%mediaoutputname%.wav"
        )

        goto :__end

    :ProcessOpusAudioCodec
        echo [INFO]     Sedang memproses...
        echo            %mediainput% -^> %mediaoutputname%.opus
        echo.

        if "%audio-bitrate%" == "" (
            set audio-bitrate=72

            echo [WARNING]  Bitrate belum dimasukkan atau parameter belum ditentukan.
            echo            Proses akan dilakukan dengan bitrate default !audio-bitrate!kbp/s.
        )

        if "%audio-pass%" == "" (
            set audio-pass=1pass

            set passparam=--comp 6 --framesize 40

            echo [WARNING]  Pass/phase-pass belum dimasukkan atau parameter belum ditentukan.
            echo                value: [1pass,2pass]
            echo            Proses akan dilakukan dalam x-1pass.
        ) else (
            if /I "%audio-pass%" == "1pass" (
                set passparam=--comp 6 --framesize 40
            ) else if /I "%audio-pass%" == "2pass" (
                set passparam=--comp 10 --framesize 20
            ) else (
                set passparam=--comp 10 --framesize 20

                echo [WARNING]  Value Pass/phase-pass tidak diketahui.
                echo                value: [1pass,2pass]
                echo            Proses akan dilakukan kedalam x-2pass secara default.
            )
        )

        "%file.exec.avs.pipe.audio%" "%mediainputaudio%" - | "%file.exec.encoder.audio.opus%" --bitrate !audio-bitrate! --vbr !passparam! - "%mediaoutputname%.opus" || set progpath=%file.exec.encoder.audio.opus% && goto :__error

        goto :__end

    :ProcessVorbisAudioCodec
        echo [INFO]     Sedang memproses...
        echo            %mediainput% -^> %mediaoutputname%.ogg
        echo.

        if "%audio-bitrate%" == "" (
            set audio-bitrate=80

            echo [WARNING]  Bitrate belum dimasukkan atau parameter belum ditentukan.
            echo            Proses akan dilakukan dengan bitrate default !audio-bitrate!kbp/s.
        )

        if "%audio-pass%" == "" (
            set audio-pass=1pass

            set passparam=

            echo [WARNING]  Pass/phase-pass belum dimasukkan atau parameter belum ditentukan.
            echo                value: [1pass,2pass]
            echo            Proses akan dilakukan dalam x-1pass.
        ) else (
            if /I "%audio-pass%" == "1pass" (
                set passparam=
            ) else if /I "%audio-pass%" == "2pass" (
                set /a vorbmaxbitrate=!audio-bitrate! * 2
                set passparam=-lb=1 -ub=!vorbmaxbitrate!
            ) else (
                set passparam=

                echo [WARNING]  Value Pass/phase-pass tidak diketahui.
                echo                value: [1pass,2pass]
                echo            Proses akan dilakukan kedalam x-1pass secara default.
            )
        )

        "%file.exec.avs.pipe.audio%" "%mediainputaudio%" - | "%file.exec.encoder.audio.vorbis%" -ignore_length -q10 -b!audio-bitrate! !passparam! - "%mediaoutputname%.ogg" || set progpath=%file.exec.encoder.audio.vorbis% && goto :__error

        goto :__end

    :ProcessFlacAudioCodec
        echo [INFO]     Sedang memproses...
        echo            %mediainput% -^> %mediaoutputname%.flac
        echo.

        if "%audio-pass%" == "" (
            set passparam=-l 6 -b 4096 -r 4
        ) else (
            if /I "%audio-pass%" == "1pass" (
                set passparam=-l 6 -b 4096 -r 4
            ) else if /I "%audio-pass%" == "2pass" (
                set passparam=-l 12 -b 4096 -m -r 6 -A tukey^(0.5^) -A partial_tukey^(2^) -A punchout_tukey^(3^)
            )
        )

        "%file.exec.avs.pipe.audio%" "%mediainputaudio%" - | "%file.exec.encoder.audio.flac%" -s -f !passparam! -o "%mediaoutputname%.flac" - || set progpath=%file.exec.encoder.audio.flac% && goto :__error

        goto :__end

:__error
    echo [ERROR]    Terjadi kesalahan dalam proses encoding.
    echo            Code            : !errorlevel!
    echo            Program Path    : !progpath!

:__end


text:
title: 0.4.1.0
---

#### Beta release
[https://github.com/Asnivor/MedLaunch/releases/tag/0.4.1.0](https://github.com/Asnivor/MedLaunch/releases/tag/0.4.1.0)

#### Important Release Notes
** This MedLaunch release is *ONLY* compatible with version 0.9.42.x of Mednafen (although you *may* get away with running 0.9.41.x as not much has changed between versions). Do *NOT* upgrade if you are not planning to update Mednafen also **

#### Notable Additions
* Added new config controls for mednafen 0.9.42 (snes_faust multitap and additional virtual controller selection)
* Fixed a few small UI bugs
* Modified the update checker to use github's API rather than individually generated json files

#### New Install
* Extract this release to a folder, run the 'MedLaunch.exe' executable and choose your Mednafen directory (must be the Mednafen 0.9.42.x branch - 64-bit version is required if you want to emulate Saturn games).
* You are then prompted to choose whether to import all config settings from your Mednafen folder into the MedLaunch database (this is recommended).
* If you currently use system-specific config files with Mednafen the settings from these will be imported with the above process. However MedLaunch will write to these files when you launch a game - so back them up somewhere if you are not happy with this.

#### Upgrade
##### Preferred Method:
* Automatically download and upgrade using the 'Updates' tab within MedLaunch itself.
* Ensure you have the correct version of Mednafen installed (v0.9.42.x)
* Once MedLaunch has upgraded, go to the 'Configs' tab and click the 'IMPORT ALL CONFIGS FROM DISK' button
* In settings change your mednafen directory if you installed the new version of mednafen somewhere else

##### Manual Method:
* You can safely extract this new release over an existing MedLaunch folder (providing you do not have MedLaunch running at the time)
* Once extracted run the MedLaunch.exe executable and your current database will be upgraded before the application starts proper.
* Once MedLaunch has upgraded, go to the 'Configs' tab and click the 'IMPORT ALL CONFIGS FROM DISK' button
* In settings change your mednafen directory if you installed the new version of mednafen somewhere else


text:
var IS_ARRAY = require("isarray");

exports.createCodec = createCodec;
exports.install = install;
exports.filter = filter;

var Bufferish = require("./bufferish");

function Codec(options) {
  if (!(this instanceof Codec)) return new Codec(options);
  this.options = options;
  this.init();
}

Codec.prototype.init = function() {
  var options = this.options;

  if (options && options.uint8array) {
    this.bufferish = Bufferish.Uint8Array;
  }

  return this;
};

function install(props) {
  for (var key in props) {
    Codec.prototype[key] = add(Codec.prototype[key], props[key]);
  }
}

function add(a, b) {
  return (a && b) ? ab : (a || b);

  function ab() {
    a.apply(this, arguments);
    return b.apply(this, arguments);
  }
}

function join(filters) {
  filters = filters.slice();

  return function(value) {
    return filters.reduce(iterator, value);
  };

  function iterator(value, filter) {
    return filter(value);
  }
}

function filter(filter) {
  return IS_ARRAY(filter) ? join(filter) : filter;
}

// @public
// msgpack.createCodec()

function createCodec(options) {
  return new Codec(options);
}

// default shared codec

exports.preset = createCodec({preset: true});


text:
<?xml version="1.0" encoding="UTF-8"?>
<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.github.eriche39</groupId>
    <artifactId>orchestrator</artifactId>
    <version>1.1-SNAPSHOT</version>
    <name>simpleorchestrator</name>
    <description>Simple Java Orchestrator</description>
    <url>https://github.com/eriche39/simple-orchestrator</url>
    <packaging>pom</packaging>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.2.RELEASE</version>
    </parent>

    <modules>
        <module>core</module>
        <module>meta</module>
        <module>visualization</module>
        <module>samples</module>
    </modules>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>https://opensource.org/licenses/MIT</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Eric He</name>
            <roles>
                <role>Initial developer</role>
            </roles>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git://github.com:eriche39/simple-orchestrator.git</connection>
        <developerConnection>scm:git:git@github.com:eriche39/simple-orchestrator.git</developerConnection>
        <url>https://github.com/eriche39/simple-orchestrator</url>
      <tag>orchestrator-1.0</tag>
  </scm>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.5</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.7</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </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-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>2.9.1</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</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>
                        <configuration>
                            <autoVersionSubmodules>true</autoVersionSubmodules>
                            <useReleaseProfile>false</useReleaseProfile>
                            <releaseProfiles>release</releaseProfiles>
                            <goals>deploy</goals>
                        </configuration>
                    </plugin>
                </plugins>

                <pluginManagement>
                    <plugins>
                        <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-no-fork</goal>
                                    </goals>
                                </execution>
                            </executions>
                        </plugin>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-javadoc-plugin</artifactId>
                            <version>2.9.1</version>
                            <executions>
                                <execution>
                                    <id>attach-javadocs</id>
                                    <goals>
                                        <goal>jar</goal>
                                    </goals>
                                </execution>
                            </executions>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
            <properties>
                <additionalparam>-Xdoclint:none</additionalparam>
            </properties>
        </profile>
    </profiles>

</project>


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.7"/>
<title>MAGMA: single-complex precision</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="navtree.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

MAGMA
    1.6.2

Matrix Algebra for GPU and Multicore Architectures

Main Page

Related Pages

Modules

Classes

Files

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

 All Classes Files Functions Friends Groups Pages

Functions

single-complex precision
Non-symmetric eigenvalue: driver

Functions

magma_int_t 	magma_cgeev (magma_vec_t jobvl, magma_vec_t jobvr, magma_int_t n, magmaFloatComplex *A, magma_int_t lda, magmaFloatComplex *w, magmaFloatComplex *VL, magma_int_t ldvl, magmaFloatComplex *VR, magma_int_t ldvr, magmaFloatComplex *work, magma_int_t lwork, float *rwork, magma_int_t *info)

 	CGEEV computes for an N-by-N complex nonsymmetric matrix A, the eigenvalues and, optionally, the left and/or right eigenvectors.  More...

magma_int_t 	magma_cgeev_m (magma_vec_t jobvl, magma_vec_t jobvr, magma_int_t n, magmaFloatComplex *A, magma_int_t lda, magmaFloatComplex *w, magmaFloatComplex *VL, magma_int_t ldvl, magmaFloatComplex *VR, magma_int_t ldvr, magmaFloatComplex *work, magma_int_t lwork, float *rwork, magma_int_t *info)

 	CGEEV computes for an N-by-N complex nonsymmetric matrix A, the eigenvalues and, optionally, the left and/or right eigenvectors.  More...

Detailed Description

Function Documentation

          magma_int_t magma_cgeev
          (
          magma_vec_t
          jobvl,

          magma_vec_t
          jobvr,

          magma_int_t
          n,

          magmaFloatComplex *
          A,

          magma_int_t
          lda,

          magmaFloatComplex *
          w,

          magmaFloatComplex *
          VL,

          magma_int_t
          ldvl,

          magmaFloatComplex *
          VR,

          magma_int_t
          ldvr,

          magmaFloatComplex *
          work,

          magma_int_t
          lwork,

          float *
          rwork,

          magma_int_t *
          info

          )

CGEEV computes for an N-by-N complex nonsymmetric matrix A, the eigenvalues and, optionally, the left and/or right eigenvectors.

The right eigenvector v(j) of A satisfies A * v(j) = lambda(j) * v(j) where lambda(j) is its eigenvalue. The left eigenvector u(j) of A satisfies u(j)**H * A = lambda(j) * u(j)**H where u(j)**H denotes the conjugate transpose of u(j).

The computed eigenvectors are normalized to have Euclidean norm equal to 1 and largest component real.

Parameters

[in]	jobvl	magma_vec_t

= MagmaNoVec: left eigenvectors of A are not computed;

= MagmaVec: left eigenvectors of are computed.

[in]	jobvr	magma_vec_t

= MagmaNoVec: right eigenvectors of A are not computed;

= MagmaVec: right eigenvectors of A are computed.

[in]	n	INTEGER The order of the matrix A. N >= 0.

[in,out]	A	COMPLEX array, dimension (LDA,N) On entry, the N-by-N matrix A. On exit, A has been overwritten.

[in]	lda	INTEGER The leading dimension of the array A. LDA >= max(1,N).

[out]	w	COMPLEX array, dimension (N) w contains the computed eigenvalues.

[out]	VL	COMPLEX array, dimension (LDVL,N) If JOBVL = MagmaVec, the left eigenvectors u(j) are stored one after another in the columns of VL, in the same order as their eigenvalues. If JOBVL = MagmaNoVec, VL is not referenced. u(j) = VL(:,j), the j-th column of VL.

[in]	ldvl	INTEGER The leading dimension of the array VL. LDVL >= 1; if JOBVL = MagmaVec, LDVL >= N.

[out]	VR	COMPLEX array, dimension (LDVR,N) If JOBVR = MagmaVec, the right eigenvectors v(j) are stored one after another in the columns of VR, in the same order as their eigenvalues. If JOBVR = MagmaNoVec, VR is not referenced. v(j) = VR(:,j), the j-th column of VR.

[in]	ldvr	INTEGER The leading dimension of the array VR. LDVR >= 1; if JOBVR = MagmaVec, LDVR >= N.

[out]	work	(workspace) COMPLEX array, dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK[0] returns the optimal LWORK.

[in]	lwork	INTEGER The dimension of the array WORK. LWORK >= (1+nb)*N. For optimal performance, LWORK >= (1+2*nb)*N.

 If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.

	rwork	(workspace) REAL array, dimension (2*N)

[out]	info	INTEGER

= 0: successful exit

< 0: if INFO = -i, the i-th argument had an illegal value.

> 0: if INFO = i, the QR algorithm failed to compute all the eigenvalues, and no eigenvectors have been computed; elements and i+1:N of w contain eigenvalues which have converged.

          magma_int_t magma_cgeev_m
          (
          magma_vec_t
          jobvl,

          magma_vec_t
          jobvr,

          magma_int_t
          n,

          magmaFloatComplex *
          A,

          magma_int_t
          lda,

          magmaFloatComplex *
          w,

          magmaFloatComplex *
          VL,

          magma_int_t
          ldvl,

          magmaFloatComplex *
          VR,

          magma_int_t
          ldvr,

          magmaFloatComplex *
          work,

          magma_int_t
          lwork,

          float *
          rwork,

          magma_int_t *
          info

          )

CGEEV computes for an N-by-N complex nonsymmetric matrix A, the eigenvalues and, optionally, the left and/or right eigenvectors.

The right eigenvector v(j) of A satisfies A * v(j) = lambda(j) * v(j) where lambda(j) is its eigenvalue. The left eigenvector u(j) of A satisfies u(j)**H * A = lambda(j) * u(j)**H where u(j)**H denotes the conjugate transpose of u(j).

The computed eigenvectors are normalized to have Euclidean norm equal to 1 and largest component real.

Parameters

[in]	jobvl	magma_vec_t

= MagmaNoVec: left eigenvectors of A are not computed;

= MagmaVec: left eigenvectors of are computed.

[in]	jobvr	magma_vec_t

= MagmaNoVec: right eigenvectors of A are not computed;

= MagmaVec: right eigenvectors of A are computed.

[in]	n	INTEGER The order of the matrix A. N >= 0.

[in,out]	A	COMPLEX array, dimension (LDA,N) On entry, the N-by-N matrix A. On exit, A has been overwritten.

[in]	lda	INTEGER The leading dimension of the array A. LDA >= max(1,N).

[out]	w	COMPLEX array, dimension (N) W contains the computed eigenvalues.

[out]	VL	COMPLEX array, dimension (LDVL,N) If JOBVL = MagmaVec, the left eigenvectors u(j) are stored one after another in the columns of VL, in the same order as their eigenvalues. If JOBVL = MagmaNoVec, VL is not referenced. u(j) = VL(:,j), the j-th column of VL.

[in]	ldvl	INTEGER The leading dimension of the array VL. LDVL >= 1; if JOBVL = MagmaVec, LDVL >= N.

[out]	VR	COMPLEX array, dimension (LDVR,N) If JOBVR = MagmaVec, the right eigenvectors v(j) are stored one after another in the columns of VR, in the same order as their eigenvalues. If JOBVR = MagmaNoVec, VR is not referenced. v(j) = VR(:,j), the j-th column of VR.

[in]	ldvr	INTEGER The leading dimension of the array VR. LDVR >= 1; if JOBVR = MagmaVec, LDVR >= N.

[out]	work	(workspace) COMPLEX array, dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK[0] returns the optimal LWORK.

[in]	lwork	INTEGER The dimension of the array WORK. LWORK >= (1+nb)*N.

 If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.

	rwork	(workspace) REAL array, dimension (2*N)

[out]	info	INTEGER

= 0: successful exit

< 0: if INFO = -i, the i-th argument had an illegal value.

> 0: if INFO = i, the QR algorithm failed to compute all the eigenvalues, and no eigenvectors have been computed; elements and i+1:N of W contain eigenvalues which have converged.

Generated on Mon May 11 2015 10:07:13 for MAGMA by

     1.8.7


text:
#include <cerrno>

#ifdef WIN32
#include <windows.h>
#else
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#endif

#include "dirutil.h"
#include "ios_util.h"

//
#ifdef WIN32
void ensuredir (const std::string &path)
{
        // winapi version
        const char *cpath = path.c_str();
        if (!CreateDirectory(cpath,NULL)) {
                if (GetLastError()==ERROR_PATH_NOT_FOUND) {
                        std::string::size_type slashpos = path.find_last_of("/");
                        if (slashpos<path.size()) {
                                std::string prefix = path.substr(0,slashpos);
                                ensuredir(prefix);
                                ensuredir(path); // hopefully this won't loop horribly
                        } else {
                                GRIT_EXCEPT(std::string(
                                    "root dir doesn't exist(?), "
                                    "making: \""+path+"\""));
                        }
                } else if (GetLastError()!=ERROR_ALREADY_EXISTS) {
                        GRIT_EXCEPT(std::string("error while making dir: "
                                               "\""+path+"\""));
                }
        }
}
#else
void ensuredir (const std::string &path)
{
        // posix version
        struct stat stat_results;
        int err = stat(path.c_str(),&stat_results);
        if (!err) return; // dir exists already
        if (err && errno!=ENOENT && errno!=ENOTDIR)
                GRIT_EXCEPT(std::string(strerror(errno))+
                           "while making dir: \""+path+"\"");

        // dir doesn't exist, check prefix exists
        std::string::size_type slashpos = path.find_last_of("/");
        if (slashpos<path.size()) {
                std::string prefix = path.substr(0,slashpos);
                ensuredir(prefix);
        }

        // finally make dir with 755 permissions
        mkdir(path.c_str(), S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
}
#endif

// vim: shiftwidth=8:tabstop=8:expandtab


text:
package stockstats.impl;

import java.util.Date;

import stockstats.StockStats;

/**
 * Defines an interface for classes that can fetch historical stock stats.
 */
public interface StockService {

	StockStats getHistoricalPrices(String stock, Date date) throws InvalidStockSymbol;

}


text:
<root>
  <item name='multiRoot.Test java.lang.String get(java.lang.String) 0'>
    <annotation name='org.jetbrains.annotations.NotNull'>
      <val name="value" val=""foo""/>
    </annotation>
  </item>
</root>


text:
/* Definitions for bytecode */

#ifndef Py_CODE_H
#define Py_CODE_H
#ifdef __cplusplus
extern "C" {
#endif

/* Bytecode object */
typedef struct {
    PyObject_HEAD
    int co_argcount;		/* #arguments, except *args */
    int co_nlocals;		/* #local variables */
    int co_stacksize;		/* #entries needed for evaluation stack */
    int co_flags;		/* CO_..., see below */
    PyObject *co_code;		/* instruction opcodes */
    PyObject *co_consts;	/* list (constants used) */
    PyObject *co_names;		/* list of strings (names used) */
    PyObject *co_varnames;	/* tuple of strings (local variable names) */
    PyObject *co_freevars;	/* tuple of strings (free variable names) */
    PyObject *co_cellvars;      /* tuple of strings (cell variable names) */
    /* The rest doesn't count for hash/cmp */
    PyObject *co_filename;	/* string (where it was loaded from) */
    PyObject *co_name;		/* string (name, for reference) */
    int co_firstlineno;		/* first source line number */
    PyObject *co_lnotab;	/* string (encoding addr<->lineno mapping) See
				   Objects/lnotab_notes.txt for details. */
    void *co_zombieframe;     /* for optimization only (see frameobject.c) */
    PyObject *co_weakreflist;   /* to support weakrefs to code objects */
} PyCodeObject;

/* Masks for co_flags above */
#define CO_OPTIMIZED	0x0001
#define CO_NEWLOCALS	0x0002
#define CO_VARARGS	0x0004
#define CO_VARKEYWORDS	0x0008
#define CO_NESTED       0x0010
#define CO_GENERATOR    0x0020
/* The CO_NOFREE flag is set if there are no free or cell variables.
   This information is redundant, but it allows a single flag test
   to determine whether there is any extra work to be done when the
   call frame it setup.
*/
#define CO_NOFREE       0x0040

#if 0
/* This is no longer used.  Stopped defining in 2.5, do not re-use. */
#define CO_GENERATOR_ALLOWED    0x1000
#endif
#define CO_FUTURE_DIVISION    	0x2000
#define CO_FUTURE_ABSOLUTE_IMPORT 0x4000 /* do absolute imports by default */
#define CO_FUTURE_WITH_STATEMENT  0x8000
#define CO_FUTURE_PRINT_FUNCTION  0x10000
#define CO_FUTURE_UNICODE_LITERALS 0x20000

/* This should be defined if a future statement modifies the syntax.
   For example, when a keyword is added.
*/
#if 1
#define PY_PARSER_REQUIRES_FUTURE_KEYWORD
#endif

#define CO_MAXBLOCKS 20 /* Max static block nesting within a function */

PyAPI_DATA(PyTypeObject) PyCode_Type;

#define PyCode_Check(op) (Py_TYPE(op) == &PyCode_Type)
#define PyCode_GetNumFree(op) (PyTuple_GET_SIZE((op)->co_freevars))

/* Public interface */
PyAPI_FUNC(PyCodeObject *) PyCode_New(
	int, int, int, int, PyObject *, PyObject *, PyObject *, PyObject *,
	PyObject *, PyObject *, PyObject *, PyObject *, int, PyObject *);
        /* same as struct above */

/* Creates a new empty code object with the specified source location. */
PyAPI_FUNC(PyCodeObject *)
PyCode_NewEmpty(const char *filename, const char *funcname, int firstlineno);

/* Return the line number associated with the specified bytecode index
   in this code object.  If you just need the line number of a frame,
   use PyFrame_GetLineNumber() instead. */
PyAPI_FUNC(int) PyCode_Addr2Line(PyCodeObject *, int);

/* for internal use only */
#define _PyCode_GETCODEPTR(co, pp) \
	((*Py_TYPE((co)->co_code)->tp_as_buffer->bf_getreadbuffer) \
	 ((co)->co_code, 0, (void **)(pp)))

typedef struct _addr_pair {
        int ap_lower;
        int ap_upper;
} PyAddrPair;

/* Update *bounds to describe the first and one-past-the-last instructions in the
   same line as lasti.  Return the number of that line.
*/
PyAPI_FUNC(int) _PyCode_CheckLineNumber(PyCodeObject* co,
                                        int lasti, PyAddrPair *bounds);

/* Create a comparable key used to compare constants taking in account the
 * object type. It is used to make sure types are not coerced (e.g., float and
 * complex) _and_ to distinguish 0.0 from -0.0 e.g. on IEEE platforms
 *
 * Return (type(obj), obj, ...): a tuple with variable size (at least 2 items)
 * depending on the type and the value. The type is the first item to not
 * compare bytes and str which can raise a BytesWarning exception. */
PyAPI_FUNC(PyObject*) _PyCode_ConstantKey(PyObject *obj);

PyAPI_FUNC(PyObject*) PyCode_Optimize(PyObject *code, PyObject* consts,
                                      PyObject *names, PyObject *lineno_obj);

#ifdef __cplusplus
}
#endif
#endif /* !Py_CODE_H */


text:
package org.javalite.activeweb.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Mark an action of a controller with this annotation to receive an HTTP OPTIONS request.
 *
 * @author Igor Polevoy
 */

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface OPTIONS {
    String value() default "";
}


text:
<?php

namespace Api;

class ApiPathUser extends Apipath {

    private $_action = NULL;
    private $_userGid = NULL;
    private $_userId = NULL;

    public function pathToAttr($pathParts) {
        $this->_action = isset($pathParts[0]) ? $pathParts[0] : NULL;
        $this->_userGid = isset($pathParts[1]) ? $pathParts[1] : NULL;

        if (ctype_digit(strval($this->_userGid))) {
            // got id, not gid
            $this->_userId = (int) $this->_userGid;
            $this->_userGid = NULL;
        }
    }

    protected function executeCall() {
        $res = new \stdClass();

        $action = $this->_action . 'Action';

        if (method_exists($this, $action)) {
            $res = $this->$action();
        } else {
            throw new \Exception('API Endpoint not found.', \Errorcode::API_ENDPOINT_NOT_FOUND);
        }

        return $res;
    }

    private function loginAction() {
        $this->throwExceptionOnTooLongPath(1);
        $this->hasToBePost();
        $res = new \stdClass();

        try {
            $name = strtolower($this->_paramHandler->getValue('name', TRUE, 3, 40));
            $pwd = $this->_paramHandler->getValue('pwd', TRUE, 8);
        } catch (\Exception $e) {
            $res->error = 'wrong_credentials';
            return $res;
        }

        $idbyname = \Currentuser::getIdByName($name);

        // check against brute force attack
        if ($idbyname !== NULL && \Userinfo::isAccountLocked($idbyname, \Userinfo::MESSAGE_API_LOGIN_FAIL) === TRUE) {
            \Userinfo::log($idbyname, \Userinfo::MESSAGE_API_LOGIN_BLOCKED);
            $res->error = 'blocked';
            return $res;
        }

        $user = \Currentuser::getUserFromLogin($name, $pwd);

        if ($user === NULL || !($user instanceof \Currentuser)) {
            if ($idbyname !== NULL) {
                \Userinfo::log($idbyname, \Userinfo::MESSAGE_API_LOGIN_FAIL);
            }
            $res->error = 'wrong_credentials';
            return $res;
        }

        if ($idbyname !== NULL) {
            \Userinfo::log($idbyname, \Userinfo::MESSAGE_API_LOGIN_SUCCESS);
        }

        $jwt = new Jwt();

        $payload = new \stdClass();
        $payload->uid = $user->getId();

        $res->jwt = $jwt->encode($payload);
        $res->gid = $user->getGid();
        $res->username = $user->getName();
        $res->displayname = $user->getDisplayName();
        $res->email = $user->getEmail();

        return $res;
    }

    private function infoAction() {
        $this->throwExceptionOnTooLongPath(2);
        $user = \Currentuser::getEnsuredLoggedInUserByJwt($this->getBearer());

        if ($this->_userGid !== NULL) {
            $user = \Otheruser::getByGid($this->_userGid, $user->getId());
        }

        if ($this->_userId !== NULL) {
            $user = \Otheruser::getLocalById($this->_userId, $user->getId());
        }

        $res = new \stdClass();

        if ($user === NULL) {
            $res->errorCode = \Errorcode::API_NOT_FOUND;
            $res->error = 'User not found.';
            return $res;
        }

        return $user;
    }

    private function friendsAction() {
        $this->throwExceptionOnTooLongPath(1);
        $user = \Currentuser::getEnsuredLoggedInUserByJwt($this->getBearer());

        $res = new \stdClass();

        $res->friends = array();

        foreach ($user->getMyFriends() as $friend) {
            $friend->addJsonData('connection', $user->getConnectionWith($friend));
            $res->friends[] = $friend;
        }

        $res->count = count($res->friends);

        return $res;
    }

    private function followersAction() {
        $this->throwExceptionOnTooLongPath(1);
        $user = \Currentuser::getEnsuredLoggedInUserByJwt($this->getBearer());

        $res = new \stdClass();

        $res->followers = array();

        foreach ($user->getMyFollowers() as $follower) {
            $follower->addJsonData('connection', $user->getConnectionWith($follower));
            $follower->addJsonData('groups', $follower->groupsImIn($user));
            $res->followers[] = $follower;
        }

        $res->count = count($res->followers);

        return $res;
    }

}


text:
using DotJEM.Json.Storage.Adapter.Materialize.Log;
using Newtonsoft.Json.Linq;

namespace DotJEM.Web.Host.Providers.Concurrency
{
    public class StorageIndexChangeLogWatcherInitializationProgress
    {
        public bool Done { get; }
        public string Area { get; }
        public ChangeCount Count { get; }
        public long Token { get; }
        public long Latest { get; }

        public StorageIndexChangeLogWatcherInitializationProgress(string area, ChangeCount count, long token, long latest, bool done)
        {
            Done = done;
            Area = area;
            Count = count;
            Token = token;
            Latest = latest;
        }
    }
}


text:
Peer::Peer(const uint32_t peerid, tcpconn* handler):peerid_(peerid),streamhandler_(handler) {

}

Peer::~Peer() {

}

void Peer::sendMsg(outmessage* msg) {
	if (streamhandler_) {
		streamhandler_->sendmsg(msg);
	}
}


text:
package opennlp.tools.tokenize;

import opennlp.tools.util.Span;

abstract class AbstractTokenizer implements Tokenizer {

  protected boolean keepNewLines = false;

  public String[] tokenize(String s) {
    return Span.spansToStrings(tokenizePos(s), s);
  }

  public void setKeepNewLines(boolean keepNewLines) {
    this.keepNewLines = keepNewLines;
  }

}