text:
{-# LANGUAGE ExistentialQuantification #-}

module Control.Concurrent.STM.TMVar.WriteOnly
  ( WriteOnlyTMVar
  , toWriteOnlyTMVar
  ) where

import Control.Concurrent.STM.TMVar (TMVar)
import Control.Concurrent.STM.TMVar.Class
import Data.Functor.Contravariant

data WriteOnlyTMVar a = forall b . WriteOnlyTMVar (a -> b) (TMVar b)

instance Contravariant WriteOnlyTMVar where
  contramap f (WriteOnlyTMVar f' var) = WriteOnlyTMVar (f' . f) var

toWriteOnlyTMVar :: TMVar a -> WriteOnlyTMVar a
toWriteOnlyTMVar = WriteOnlyTMVar id

instance TMVarWrite WriteOnlyTMVar where
    putTMVar (WriteOnlyTMVar f var) = putTMVar var . f
    {-# INLINE putTMVar #-}

    tryPutTMVar (WriteOnlyTMVar f var) = tryPutTMVar var . f
    {-# INLINE tryPutTMVar #-}


text:
//~ This file is part of zedtux Tutorial
//~
//~ This is free software: you can redistribute it and/or modify
//~ it under the terms of the GNU General Public License as published by
//~ the Free Software Foundation, either version 3 of the License, or
//~ (at your option) any later version.

//~ This is distributed in the hope that it will be useful,
//~ but WITHOUT ANY WARRANTY; without even the implied warranty of
//~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//~ GNU General Public License for more details.
//~
//~ You should have received a copy of the GNU General Public License
//~ along with this tutorial.  If not, see <http://www.gnu.org/licenses/>.
//~
//~ --------------------------------------------------------------------
//~
//~
//~ Copyright 2009 zedtux
//~

#include "emiter_noarg.h"

/**
 *  \brief Constructeur par défaut
 */
EmiterNoArgs::EmiterNoArgs()
{
}

/**
 *  \brief Destructeur
 */
EmiterNoArgs::~EmiterNoArgs()
{
}

/**
 *  \brief Connect
 *
 *  Fonction pour connecter un demandeur à un signal
 *
 *  \param subscriber Adresse de la fonction à connecter
 *
 *  \return une instance boost::signals::connection, connecté au 'subscriber'
 */
boost::signals::connection EmiterNoArgs::connect(mySignalEmit::slot_function_type subscriber)
{
	//~ Connecte le 'subscriber' au signal 'signalEmit'
	return signalEmit.connect(subscriber);
}

/**
 *  \brief Start Job
 *
 *  Démarre le travail: Emet le signal
 */
void EmiterNoArgs::startJob()
{
	//~ Exécute le signal 'signalEmit'
	signalEmit();
}

redpajama_set_name: RedPajamaGithub


text:
var sampleTemplate = {
	"id": "standard",
	"name": "Standard",
	"properties": {
		"sap.viz.ext.capacityplanning": {

		}
	}
};
sap.viz.extapi.env.Template.register(sampleTemplate);


text:
/* this file is generated by RelaxNGCC */
package com.sun.xml.xsom.impl.parser.state;

import org.xml.sax.SAXException;
import org.xml.sax.Attributes;
import com.sun.xml.xsom.impl.parser.NGCCRuntimeEx;

class qname extends NGCCHandler {
    private String qvalue;
    protected final NGCCRuntimeEx $runtime;
    private int $_ngcc_current_state;
    protected String $uri;
    protected String $localName;
    protected String $qname;

    public final NGCCRuntime getRuntime() {
        return($runtime);
    }

    public qname(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie) {
        super(source, parent, cookie);
        $runtime = runtime;
        $_ngcc_current_state = 1;
    }

    public qname(NGCCRuntimeEx runtime) {
        this(null, runtime, runtime, -1);
    }

    public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
        int $ai;
        $uri = $__uri;
        $localName = $__local;
        $qname = $__qname;
        switch($_ngcc_current_state) {
        case 0:
            {
                revertToParentFromEnterElement($runtime.parseUName(qvalue), super._cookie, $__uri, $__local, $__qname, $attrs);
            }
            break;
        default:
            {
                unexpectedEnterElement($__qname);
            }
            break;
        }
    }

    public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException {
        int $ai;
        $uri = $__uri;
        $localName = $__local;
        $qname = $__qname;
        switch($_ngcc_current_state) {
        case 0:
            {
                revertToParentFromLeaveElement($runtime.parseUName(qvalue), super._cookie, $__uri, $__local, $__qname);
            }
            break;
        default:
            {
                unexpectedLeaveElement($__qname);
            }
            break;
        }
    }

    public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
        int $ai;
        $uri = $__uri;
        $localName = $__local;
        $qname = $__qname;
        switch($_ngcc_current_state) {
        case 0:
            {
                revertToParentFromEnterAttribute($runtime.parseUName(qvalue), super._cookie, $__uri, $__local, $__qname);
            }
            break;
        default:
            {
                unexpectedEnterAttribute($__qname);
            }
            break;
        }
    }

    public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
        int $ai;
        $uri = $__uri;
        $localName = $__local;
        $qname = $__qname;
        switch($_ngcc_current_state) {
        case 0:
            {
                revertToParentFromLeaveAttribute($runtime.parseUName(qvalue), super._cookie, $__uri, $__local, $__qname);
            }
            break;
        default:
            {
                unexpectedLeaveAttribute($__qname);
            }
            break;
        }
    }

    public void text(String $value) throws SAXException {
        int $ai;
        switch($_ngcc_current_state) {
        case 0:
            {
                revertToParentFromText($runtime.parseUName(qvalue), super._cookie, $value);
            }
            break;
        case 1:
            {
                qvalue = $runtime.collapse($value);
                $_ngcc_current_state = 0;
            }
            break;
        }
    }

    public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
        switch($__cookie__) {
        }
    }

    public boolean accepted() {
        return(($_ngcc_current_state == 0));
    }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="1000"
    android:interpolator="@android:interpolator/accelerate_cubic"
    android:propertyName="translateX"
    android:repeatMode="reverse"
    android:repeatCount="infinite"
    android:valueFrom="0"
    android:valueTo="10"
    android:valueType="floatType"
    >

</objectAnimator>


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<feed><tipo>Rua</tipo><logradouro>Santa Mônica</logradouro><bairro>Jarí</bairro><cidade>Maracanaú</cidade><uf>CE</uf><cep>61916285</cep></feed>


text:
package astilectron

import (
	"context"

	"github.com/asticode/go-astitools/context"
)

// Menu item event names
const (
	EventNameMenuItemCmdSetChecked   = "menu.item.cmd.set.checked"
	EventNameMenuItemCmdSetEnabled   = "menu.item.cmd.set.enabled"
	EventNameMenuItemCmdSetLabel     = "menu.item.cmd.set.label"
	EventNameMenuItemCmdSetVisible   = "menu.item.cmd.set.visible"
	EventNameMenuItemEventCheckedSet = "menu.item.event.checked.set"
	EventNameMenuItemEventClicked    = "menu.item.event.clicked"
	EventNameMenuItemEventEnabledSet = "menu.item.event.enabled.set"
	EventNameMenuItemEventLabelSet   = "menu.item.event.label.set"
	EventNameMenuItemEventVisibleSet = "menu.item.event.visible.set"
)

// Menu item roles
var (
	// All
	MenuItemRoleClose              = PtrStr("close")
	MenuItemRoleCopy               = PtrStr("copy")
	MenuItemRoleCut                = PtrStr("cut")
	MenuItemRoleDelete             = PtrStr("delete")
	MenuItemRoleEditMenu           = PtrStr("editMenu")
	MenuItemRoleForceReload        = PtrStr("forcereload")
	MenuItemRoleMinimize           = PtrStr("minimize")
	MenuItemRolePaste              = PtrStr("paste")
	MenuItemRolePasteAndMatchStyle = PtrStr("pasteandmatchstyle")
	MenuItemRoleQuit               = PtrStr("quit")
	MenuItemRoleRedo               = PtrStr("redo")
	MenuItemRoleReload             = PtrStr("reload")
	MenuItemRoleResetZoom          = PtrStr("resetzoom")
	MenuItemRoleSelectAll          = PtrStr("selectall")
	MenuItemRoleToggleDevTools     = PtrStr("toggledevtools")
	MenuItemRoleToggleFullScreen   = PtrStr("togglefullscreen")
	MenuItemRoleUndo               = PtrStr("undo")
	MenuItemRoleWindowMenu         = PtrStr("windowMenu")
	MenuItemRoleZoomOut            = PtrStr("zoomout")
	MenuItemRoleZoomIn             = PtrStr("zoomin")

	// MacOSX
	MenuItemRoleAbout         = PtrStr("about")
	MenuItemRoleHide          = PtrStr("hide")
	MenuItemRoleHideOthers    = PtrStr("hideothers")
	MenuItemRoleUnhide        = PtrStr("unhide")
	MenuItemRoleStartSpeaking = PtrStr("startspeaking")
	MenuItemRoleStopSpeaking  = PtrStr("stopspeaking")
	MenuItemRoleFront         = PtrStr("front")
	MenuItemRoleZoom          = PtrStr("zoom")
	MenuItemRoleWindow        = PtrStr("window")
	MenuItemRoleHelp          = PtrStr("help")
	MenuItemRoleServices      = PtrStr("services")
)

// Menu item types
var (
	MenuItemTypeNormal    = PtrStr("normal")
	MenuItemTypeSeparator = PtrStr("separator")
	MenuItemTypeCheckbox  = PtrStr("checkbox")
	MenuItemTypeRadio     = PtrStr("radio")
)

// MenuItem represents a menu item
type MenuItem struct {
	*object
	o *MenuItemOptions
	// We must store the root ID since everytime we update a sub menu we need to set the root menu all over again in electron
	rootID string
	s      *SubMenu
}

// MenuItemOptions represents menu item options
// We must use pointers since GO doesn't handle optional fields whereas NodeJS does. Use PtrBool, PtrInt or PtrStr
// to fill the struct
// https://github.com/electron/electron/blob/v1.8.1/docs/api/menu-item.md
type MenuItemOptions struct {
	Accelerator *Accelerator       `json:"accelerator,omitempty"`
	Checked     *bool              `json:"checked,omitempty"`
	Enabled     *bool              `json:"enabled,omitempty"`
	Icon        *string            `json:"icon,omitempty"`
	Label       *string            `json:"label,omitempty"`
	OnClick     Listener           `json:"-"`
	Position    *string            `json:"position,omitempty"`
	Role        *string            `json:"role,omitempty"`
	SubLabel    *string            `json:"sublabel,omitempty"`
	SubMenu     []*MenuItemOptions `json:"-"`
	Type        *string            `json:"type,omitempty"`
	Visible     *bool              `json:"visible,omitempty"`
}

// newMenu creates a new menu item
func newMenuItem(parentCtx context.Context, rootID string, o *MenuItemOptions, c *asticontext.Canceller, d *dispatcher, i *identifier, w *writer) (m *MenuItem) {
	m = &MenuItem{
		o:      o,
		object: newObject(parentCtx, c, d, i, w, i.new()),
		rootID: rootID,
	}
	if o.OnClick != nil {
		m.On(EventNameMenuItemEventClicked, o.OnClick)
	}
	if len(o.SubMenu) > 0 {
		m.s = &SubMenu{newSubMenu(parentCtx, rootID, o.SubMenu, c, d, i, w)}
	}
	return
}

// toEvent returns the menu item in the proper event format
func (i *MenuItem) toEvent() (e *EventMenuItem) {
	e = &EventMenuItem{
		ID:      i.id,
		Options: i.o,
		RootID:  i.rootID,
	}
	if i.s != nil {
		e.SubMenu = i.s.toEvent()
	}
	return
}

// SubMenu returns the menu item sub menu
func (i *MenuItem) SubMenu() *SubMenu {
	return i.s
}

// SetChecked sets the checked attribute
func (i *MenuItem) SetChecked(checked bool) (err error) {
	if err = i.isActionable(); err != nil {
		return
	}
	i.o.Checked = PtrBool(checked)
	_, err = synchronousEvent(i.c, i, i.w, Event{Name: EventNameMenuItemCmdSetChecked, TargetID: i.id, MenuItemOptions: &MenuItemOptions{Checked: i.o.Checked}}, EventNameMenuItemEventCheckedSet)
	return
}

// SetEnabled sets the enabled attribute
func (i *MenuItem) SetEnabled(enabled bool) (err error) {
	if err = i.isActionable(); err != nil {
		return
	}
	i.o.Enabled = PtrBool(enabled)
	_, err = synchronousEvent(i.c, i, i.w, Event{Name: EventNameMenuItemCmdSetEnabled, TargetID: i.id, MenuItemOptions: &MenuItemOptions{Enabled: i.o.Enabled}}, EventNameMenuItemEventEnabledSet)
	return
}

// SetLabel sets the label attribute
func (i *MenuItem) SetLabel(label string) (err error) {
	if err = i.isActionable(); err != nil {
		return
	}
	i.o.Label = PtrStr(label)
	_, err = synchronousEvent(i.c, i, i.w, Event{Name: EventNameMenuItemCmdSetLabel, TargetID: i.id, MenuItemOptions: &MenuItemOptions{Label: i.o.Label}}, EventNameMenuItemEventLabelSet)
	return
}

// SetVisible sets the visible attribute
func (i *MenuItem) SetVisible(visible bool) (err error) {
	if err = i.isActionable(); err != nil {
		return
	}
	i.o.Visible = PtrBool(visible)
	_, err = synchronousEvent(i.c, i, i.w, Event{Name: EventNameMenuItemCmdSetVisible, TargetID: i.id, MenuItemOptions: &MenuItemOptions{Visible: i.o.Visible}}, EventNameMenuItemEventVisibleSet)
	return
}


text:
//
//  CNMHelperProtocol.h
//  YunMaiDriver
//
//  Created by 高爽 on 2017/9/20.
//  Copyright © 2017年 YunMai. All rights reserved.
//

#import <Foundation/Foundation.h>

#define HELPER_SHARED(CLASS) +(instancetype)shared{ \
static CLASS *sharedHelper = nil;\
static dispatch_once_t predicate;\
dispatch_once(&predicate, ^{\
sharedHelper = [[CLASS alloc] init];\
});\
return sharedHelper;}

/**
 * 单例统一接口协议
 */
@protocol CNMHelperProtocol <NSObject>
+(instancetype)shared;
@end


text:
import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export const constantRouterMap = [
  {
    path: '*',
    redirect: '/registry-center'
  },
  {
    path: '/config-center',
    component: () => import('@/views/config-center'),
    hidden: true,
    name: 'Config center'
  },
  {
    path: '/registry-center',
    component: () => import('@/views/registry-center'),
    hidden: true,
    name: 'Registry center'
  },
  {
    path: '/login',
    component: () => import('@/views/login'),
    hidden: true
  },
  {
    path: '/rule-config',
    component: () => import('@/views/rule-config'),
    hidden: true,
    name: 'Rule config'
  },
  {
    path: '/runtime-status',
    component: () => import('@/views/runtime-status'),
    hidden: true,
    name: 'Runtime status'
  },
  {
    path: '/data-scaling',
    component: () => import('@/views/data-scaling'),
    hidden: true,
    name: 'Data scaling'
  }
]

export default new Router({
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRouterMap
})


text:
declare namespace Jymfony.Component.Security.Authentication.Provider {
    import TokenInterface = Jymfony.Component.Security.Authentication.Token.TokenInterface;
    import AnonymousToken = Jymfony.Component.Security.Authentication.Token.AnonymousToken;

    export class AnonymousAuthenticationProvider extends implementationOf(AuthenticationProviderInterface) {
        /**
         * Used to determine if the token is created by the application
         * instead of a malicious client.
         */
        private _secret: string;

        /**
         * Constructor.
         */
        __construct(secret: string): void;
        constructor(secret: string);

        /**
         * @inheritdoc
         */
        authenticate(token: TokenInterface): Promise<TokenInterface>;

        /**
         * @inheritdoc
         */
        supports(token: TokenInterface): token is AnonymousToken;
    }
}


text:
require 'spec_helper'
require 'valuefirst.rb'

describe "TextMessage" do

  describe "::textmessage" do
    it "it return a dtd compliant xml document" do
      payload = XmlPayload::TextMessage.textmessage(vfirst_config, "This a test message", "phone_number", "sender_id")
      expect(payload.class).to be XML::Document
      expect(payload.validate(load_dtd_from_file("messagev12"))).to eq true
    end
  end
end


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>com.github.thorbenkuck.netcom2.network.shared.clients (NetCom2 1.1-SNAPSHOT API)</title>
<meta name="date" content="2018-05-29">
<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 Package

Next Package

Frames

No Frames

All Classes

Package com.github.thorbenkuck.netcom2.network.shared.clients

This is the core package for Communication.

See: Description

Interface Summary

Interface
Description

Client

An Client is an Object-Representation of a physical Computer, connected via one or multiple Socket.

Connection

A Connection is an object-representation of an physical connection between the ClientStart
 and the ServerStart.

ConnectionFactory

DeSerializationAdapter<F,T>

This Adapter will deserialize the F into a T.

ReceiveOrSendSynchronization

This interface allows you, to wait for a certain Object to be send or received over the previously requested Connection.

SerializationAdapter<F,T>

This Adapter will serialize a F into a T.

Class Summary

Class
Description

AbstractConnection

This Abstract Connection makes it easier for you, to create a custom Connection

ClientID

This Class is the Identification of any Client.

DefaultConnection

This class is the identifier for the Connection, which is established by default.

JavaDeSerializationAdapter

This Adapter utilizes the Java-Serialization to deserialize an String into an Object.

JavaSerializationAdapter

This SerializationAdapter utilizes the Java-Serialization, to serialize a Object into a String.

PingDeSerializationAdapter

This DeSerializationAdapter will deserialize an Ping, serialized with the PingSerializationAdapter.

PingSerializationAdapter

This DeSerializationAdapter will deserialize an Ping, serialized with the PingSerializationAdapter

TCPDefaultConnection

This ConnectionImplementation attempts to create an TCP Connection.

UDPDefaultConnection

UDPDefaultConnection.

Package com.github.thorbenkuck.netcom2.network.shared.clients Description

This is the core package for Communication. It contains Connections, Clients and stuff.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes

Copyright © 2018. All rights reserved.


text:
from collections.abc import Sequence
from typing import Callable, Optional, Tuple, Union

import numpy as np
import torch
import torch.nn as nn

from monai.data.meta_tensor import MetaTensor
from monai.networks.utils import eval_mode
from monai.transforms import Compose, GaussianSmooth, Lambda, ScaleIntensity, SpatialCrop
from monai.utils import deprecated_arg, ensure_tuple_rep
from monai.visualize.visualizer import default_upsampler

class OcclusionSensitivity:
    """
    This class computes the occlusion sensitivity for a model's prediction of a given image. By occlusion sensitivity,
    we mean how the probability of a given prediction changes as the occluded section of an image changes. This can be
    useful to understand why a network is making certain decisions.

    As important parts of the image are occluded, the probability of classifying the image correctly will decrease.
    Hence, more negative values imply the corresponding occluded volume was more important in the decision process.

    Two ``torch.Tensor`` will be returned by the ``__call__`` method: an occlusion map and an image of the most probable
    class. Both images will be cropped if a bounding box used, but voxel sizes will always match the input.

    The occlusion map shows the inference probabilities when the corresponding part of the image is occluded. Hence,
    more -ve values imply that region was important in the decision process. The map will have shape ``BCHW(D)N``,
    where ``N`` is the number of classes to be inferred by the network. Hence, the occlusion for class ``i`` can
    be seen with ``map[...,i]``.

    The most probable class is an image of the probable class when the corresponding part of the image is occluded
    (equivalent to ``occ_map.argmax(dim=-1)``).

    See: R. R. Selvaraju et al. Grad-CAM: Visual Explanations from Deep Networks via
    Gradient-based Localization. https://doi.org/10.1109/ICCV.2017.74.

    Examples:

    .. code-block:: python

        # densenet 2d
        from monai.networks.nets import DenseNet121
        from monai.visualize import OcclusionSensitivity
        import torch

        model_2d = DenseNet121(spatial_dims=2, in_channels=1, out_channels=3)
        occ_sens = OcclusionSensitivity(nn_module=model_2d)
        occ_map, most_probable_class = occ_sens(x=torch.rand((1, 1, 48, 64)), b_box=[2, 40, 1, 62])

        # densenet 3d
        from monai.networks.nets import DenseNet
        from monai.visualize import OcclusionSensitivity

        model_3d = DenseNet(spatial_dims=3, in_channels=1, out_channels=3, init_features=2, growth_rate=2, block_config=(6,))
        occ_sens = OcclusionSensitivity(nn_module=model_3d, n_batch=10)
        occ_map, most_probable_class = occ_sens(torch.rand(1, 1, 6, 6, 6), b_box=[1, 3, -1, -1, -1, -1])

    See Also:

        - :py:class:`monai.visualize.occlusion_sensitivity.OcclusionSensitivity.`
    """

    @deprecated_arg(
        name="pad_val",
        since="1.0",
        removed="1.2",
        msg_suffix="Please use `mode`. For backwards compatibility, use `mode=mean_img`.",
    )
    @deprecated_arg(name="stride", since="1.0", removed="1.2", msg_suffix="Please use `overlap`.")
    @deprecated_arg(name="per_channel", since="1.0", removed="1.2")
    @deprecated_arg(name="upsampler", since="1.0", removed="1.2")
    def __init__(
        self,
        nn_module: nn.Module,
        pad_val: Optional[float] = None,
        mask_size: Union[int, Sequence] = 16,
        n_batch: int = 16,
        stride: Union[int, Sequence] = 1,
        per_channel: bool = True,
        upsampler: Optional[Callable] = default_upsampler,
        verbose: bool = True,
        mode: Union[str, float, Callable] = "gaussian",
        overlap: float = 0.25,
        activate: Union[bool, Callable] = True,
    ) -> None:
        """
        Occlusion sensitivity constructor.

        Args:
            nn_module: Classification model to use for inference
            mask_size: Size of box to be occluded, centred on the central voxel. If a single number
                is given, this is used for all dimensions. If a sequence is given, this is used for each dimension
                individually.
            n_batch: Number of images in a batch for inference.
            verbose: Use progress bar (if ``tqdm`` available).
            mode: what should the occluded region be replaced with? If a float is given, that value will be used
                throughout the occlusion. Else, ``gaussian``, ``mean_img`` and ``mean_patch`` can be supplied:

                * ``gaussian``: occluded region is multiplied by 1 - gaussian kernel. In this fashion, the occlusion
                  will be 0 at the center and will be unchanged towards the edges, varying smoothly between. When
                  gaussian is used, a weighted average will be used to combine overlapping regions. This will be
                  done using the gaussian (not 1-gaussian) as occluded regions count more.
                * ``mean_patch``: occluded region will be replaced with the mean of occluded region.
                * ``mean_img``: occluded region will be replaced with the mean of the whole image.

            overlap: overlap between inferred regions. Should be in range 0<=x<1.
            activate: if ``True``, do softmax activation if num_channels > 1 else do ``sigmoid``. If ``False``, don't do any
                activation. If ``callable``, use callable on inferred outputs.

        """
        self.nn_module = nn_module
        self.mask_size = mask_size
        self.n_batch = n_batch
        self.verbose = verbose
        self.overlap = overlap
        self.activate = activate
        # mode
        if isinstance(mode, str) and mode not in ("gaussian", "mean_patch", "mean_img"):
            raise NotImplementedError
        self.mode = mode

    @staticmethod
    def constant_occlusion(x: torch.Tensor, val: float, mask_size: Sequence) -> Tuple[float, torch.Tensor]:
        """Occlude with a constant occlusion. Multiplicative is zero, additive is constant value."""
        ones = torch.ones((*x.shape[:2], *mask_size), device=x.device, dtype=x.dtype)
        return 0, ones * val

    @staticmethod
    def gaussian_occlusion(x: torch.Tensor, mask_size, sigma=0.25) -> Tuple[torch.Tensor, float]:
        """
        For Gaussian occlusion, Multiplicative is 1-Gaussian, additive is zero.
        Default sigma of 0.25 empirically shown to give reasonable kernel, see here:
        https://github.com/Project-MONAI/MONAI/pull/5230#discussion_r984520714.
        """
        kernel = torch.zeros((x.shape[1], *mask_size), device=x.device, dtype=x.dtype)
        spatial_shape = kernel.shape[1:]
        # all channels (as occluded shape already takes into account per_channel), center in spatial dimensions
        center = [slice(None)] + [slice(s // 2, s // 2 + 1) for s in spatial_shape]
        # place value of 1 at center
        kernel[center] = 1.0
        # Smooth with sigma equal to quarter of image, flip +ve/-ve so largest values are at edge
        # and smallest at center. Scale to [0, 1].
        gaussian = Compose(
            [GaussianSmooth(sigma=[b * sigma for b in spatial_shape]), Lambda(lambda x: -x), ScaleIntensity()]
        )
        # transform and add batch
        mul: torch.Tensor = gaussian(kernel)[None]

        return mul, 0

    @staticmethod
    def predictor(
        cropped_grid: torch.Tensor,
        nn_module: nn.Module,
        x: torch.Tensor,
        mul: Union[torch.Tensor, float],
        add: Union[torch.Tensor, float],
        mask_size: Sequence,
        occ_mode: str,
        activate: Union[bool, Callable],
        module_kwargs,
    ) -> torch.Tensor:
        """
        Predictor function to be passed to the sliding window inferer. Takes a cropped meshgrid,
        referring to the coordinates in the input image. We use the index of the top-left corner
        in combination ``mask_size`` to figure out which region of the image is to be occluded. The
        occlusion is performed on the original image, ``x``, using ``cropped_region * mul + add``. ``mul``
        and ``add`` are sometimes pre-computed (e.g., a constant Gaussian blur), or they are
        sometimes calculated on the fly (e.g., the mean of the occluded patch). For this reason
        ``occ_mode`` is given. Lastly, ``activate`` is used to activate after each call of the model.

        Args:
            cropped_grid: subsection of the meshgrid, where each voxel refers to the coordinate of
                the input image. The meshgrid is created by the ``OcclusionSensitivity`` class, and
                the generation of the subset is determined by ``sliding_window_inference``.
            nn_module: module to call on data.
            x: the image that was originally passed into ``OcclusionSensitivity.__call__``.
            mul: occluded region will be multiplied by this. Can be ``torch.Tensor`` or ``float``.
            add: after multiplication, this is added to the occluded region. Can be ``torch.Tensor`` or ``float``.
            mask_size: Size of box to be occluded, centred on the central voxel. Should be
                a sequence, one value for each spatial dimension.
            occ_mode: might be used to calculate ``mul`` and ``add`` on the fly.
            activate: if ``True``, do softmax activation if num_channels > 1 else do ``sigmoid``. If ``False``, don't do any
                activation. If ``callable``, use callable on inferred outputs.
            module_kwargs: kwargs to be passed onto module when inferring
        """
        n_batch = cropped_grid.shape[0]
        sd = cropped_grid.ndim - 2
        # start with copies of x to infer
        im = torch.repeat_interleave(x, n_batch, 0)
        # get coordinates of top left corner of occluded region (possible because we use meshgrid)
        corner_coord_slices = [slice(None)] * 2 + [slice(1)] * sd
        top_corners = cropped_grid[corner_coord_slices]

        # replace occluded regions
        for b, t in enumerate(top_corners):
            # starting from corner, get the slices to extract the occluded region from the image
            slices = [slice(b, b + 1), slice(None)] + [slice(int(j), int(j) + m) for j, m in zip(t, mask_size)]
            to_occlude = im[slices]
            if occ_mode == "mean_patch":
                add, mul = OcclusionSensitivity.constant_occlusion(x, to_occlude.mean().item(), mask_size)

            if callable(occ_mode):
                to_occlude = occ_mode(x, to_occlude)
            else:
                to_occlude = to_occlude * mul + add
            if add is None or mul is None:
                raise RuntimeError("Shouldn't be here, something's gone wrong...")
            im[slices] = to_occlude
        # infer
        out: torch.Tensor = nn_module(im, **module_kwargs)

        # if activation is callable, call it
        if callable(activate):
            out = activate(out)
        # else if True (should be boolean), sigmoid if n_chan == 1 else softmax
        elif activate:
            out = out.sigmoid() if x.shape[1] == 1 else out.softmax(1)

        # the output will have shape [B,C] where C is number of channels output by model (inference classes)
        # we need to return it to sliding window inference with shape [B,C,H,W,[D]], so add dims and repeat values
        for m in mask_size:
            out = torch.repeat_interleave(out.unsqueeze(-1), m, dim=-1)

        return out

    @staticmethod
    def crop_meshgrid(
        grid: MetaTensor, b_box: Sequence, mask_size: Sequence
    ) -> Tuple[MetaTensor, SpatialCrop, Sequence]:
        """Crop the meshgrid so we only perform occlusion sensitivity on a subsection of the image."""
        # distance from center of mask to edge is -1 // 2.
        mask_edge = [(m - 1) // 2 for m in mask_size]
        bbox_min = [max(b - m, 0) for b, m in zip(b_box[::2], mask_edge)]
        bbox_max = []
        for b, m, s in zip(b_box[1::2], mask_edge, grid.shape[2:]):
            # if bbox is -ve for that dimension, no cropping so use current image size
            if b == -1:
                bbox_max.append(s)
            # else bounding box plus distance to mask edge. Make sure it's not bigger than the size of the image
            else:
                bbox_max.append(min(b + m, s))
        # bbox_max = [min(b + m, s) if b >= 0 else s for b, m, s in zip(b_box[1::2], mask_edge, grid.shape[2:])]
        # No need for batch and channel slices. Batch will be removed and added back in, and
        # SpatialCrop doesn't act on the first dimension anyway.
        slices = [slice(s, e) for s, e in zip(bbox_min, bbox_max)]
        cropper = SpatialCrop(roi_slices=slices)
        cropped: MetaTensor = cropper(grid[0])[None]  # type: ignore
        mask_size = list(mask_size)
        for i, s in enumerate(cropped.shape[2:]):
            mask_size[i] = min(s, mask_size[i])
        return cropped, cropper, mask_size

    def __call__(
        self, x: torch.Tensor, b_box: Optional[Sequence] = None, **kwargs
    ) -> Tuple[torch.Tensor, torch.Tensor]:
        """
        Args:
            x: Image to use for inference. Should be a tensor consisting of 1 batch.
            b_box: Bounding box on which to perform the analysis. The output image will be limited to this size.
                There should be a minimum and maximum for all spatial dimensions: ``[min1, max1, min2, max2,...]``.
                * By default, the whole image will be used. Decreasing the size will speed the analysis up, which might
                    be useful for larger images.
                * Min and max are inclusive, so ``[0, 63, ...]`` will have size ``(64, ...)``.
                * Use -ve to use ``min=0`` and ``max=im.shape[x]-1`` for xth dimension.
                * N.B.: we add half of the mask size to the bounding box to ensure that the region of interest has a
                    sufficiently large area surrounding it.
            kwargs: any extra arguments to be passed on to the module as part of its `__call__`.

        Returns:
            * Occlusion map:
                * Shows the inference probabilities when the corresponding part of the image is occluded.
                    Hence, more -ve values imply that region was important in the decision process.
                * The map will have shape ``BCHW(D)N``, where N is the number of classes to be inferred by the
                    network. Hence, the occlusion for class ``i`` can be seen with ``map[...,i]``.
                * If `per_channel==False`, output ``C`` will equal 1: ``B1HW(D)N``
            * Most probable class:
                * The most probable class when the corresponding part of the image is occluded (``argmax(dim=-1)``).
            Both images will be cropped if a bounding box used, but voxel sizes will always match the input.
        """
        if x.shape[0] > 1:
            raise ValueError("Expected batch size of 1.")

        sd = x.ndim - 2
        mask_size: Sequence = ensure_tuple_rep(self.mask_size, sd)

        # get the meshgrid (so that sliding_window_inference can tell us which bit to occlude)
        grid: MetaTensor = MetaTensor(
            np.stack(np.meshgrid(*[np.arange(0, i) for i in x.shape[2:]], indexing="ij"))[None],
            device=x.device,
            dtype=x.dtype,
        )
        # if bounding box given, crop the grid to only infer subsections of the image
        if b_box is not None:
            grid, cropper, mask_size = self.crop_meshgrid(grid, b_box, mask_size)

        # check that the grid is bigger than the mask size
        if any(m > g for g, m in zip(grid.shape[2:], mask_size)):
            raise ValueError(f"Image (spatial shape) {grid.shape[2:]} should be bigger than mask {mask_size}.")

        # get additive and multiplicative factors if they are unchanged for all patches (i.e., not mean_patch)
        add: Optional[Union[float, torch.Tensor]]
        mul: Optional[Union[float, torch.Tensor]]
        # multiply by 0, add value
        if isinstance(self.mode, float):
            mul, add = self.constant_occlusion(x, self.mode, mask_size)
        # multiply by 0, add mean of image
        elif self.mode == "mean_img":
            mul, add = self.constant_occlusion(x, x.mean().item(), mask_size)
        # for gaussian, additive = 0, multiplicative = gaussian
        elif self.mode == "gaussian":
            mul, add = self.gaussian_occlusion(x, mask_size)
        # else will be determined on each patch individually so calculated later
        else:
            add, mul = None, None

        with eval_mode(self.nn_module):
            # needs to go here to avoid cirular import
            from monai.inferers import sliding_window_inference

            sensitivity_im: MetaTensor = sliding_window_inference(  # type: ignore
                grid,
                roi_size=mask_size,
                sw_batch_size=self.n_batch,
                predictor=OcclusionSensitivity.predictor,
                overlap=self.overlap,
                mode="gaussian" if self.mode == "gaussian" else "constant",
                progress=self.verbose,
                nn_module=self.nn_module,
                x=x,
                add=add,
                mul=mul,
                mask_size=mask_size,
                occ_mode=self.mode,
                activate=self.activate,
                module_kwargs=kwargs,
            )

        if b_box is not None:
            # undo the cropping that was applied to the meshgrid
            sensitivity_im = cropper.inverse(sensitivity_im[0])[None]  # type: ignore
            # crop using the bounding box (ignoring the mask size this time)
            bbox_min = [max(b, 0) for b in b_box[::2]]
            bbox_max = [b if b > 0 else s for b, s in zip(b_box[1::2], x.shape[2:])]
            cropper = SpatialCrop(roi_start=bbox_min, roi_end=bbox_max)
            sensitivity_im = cropper(sensitivity_im[0])[None]  # type: ignore

        # The most probable class is the max in the classification dimension (1)
        most_probable_class = sensitivity_im.argmax(dim=1, keepdim=True)
        return sensitivity_im, most_probable_class


text:
<?xml version="1.0" encoding="UTF-8"?>

<recipeml version="0.5">
  <recipe>
    <head>
      <title>Barbecue Sauce</title>
      <categories>
        <cat>Sauce</cat></categories>
      <yield>1</yield></head>
    <ingredients>
      <ing>
        <amt>
          <qty>1/2</qty>
          <unit>pounds</unit></amt>
        <item>Butter; two sticks</item></ing>
      <ing>
        <amt>
          <qty>1 1/2</qty>
          <unit>cups</unit></amt>
        <item>Sugar</item></ing>
      <ing>
        <amt>
          <qty>2</qty>
          <unit>cups</unit></amt>
        <item>Mustard</item></ing>
      <ing>
        <amt>
          <qty>32</qty>
          <unit>ounces</unit></amt>
        <item>Ketchup</item></ing>
      <ing>
        <amt>
          <qty>1</qty>
          <unit>cup</unit></amt>
        <item>Worcestershire sauce</item></ing>
      <ing>
        <amt>
          <qty>1</qty>
          <unit>pint</unit></amt>
        <item>Vinegar</item></ing>
      <ing>
        <amt>
          <qty>4</qty>
          <unit>tablespoons</unit></amt>
        <item>Red pepper</item></ing>
      <ing>
        <amt>
          <qty>2</qty>
          <unit>tablespoons</unit></amt>
        <item>Black pepper</item></ing></ingredients>
    <directions>
      <step>  Melt butter and mix in sugar, then mix all other ingredients together.
  Bring to a boil, cut back heat and simmer, stirring constantly, for 8-10
  minutes, or until desired consistency is reached.

  Source "Nothing makes a soup moment like a rainy day" By ANN BURGER, Post
  and Courier Food Editor, Sun, 08-Feb-1998.
  http://www.charleston.net/pub/entertain/cookin/soup0208.htm

  Notes: Linda says she has a great barbecue sauce recipe that her
  father-in-law shared. If you want a milder sauce, you can cut the amounts
  of red and black pepper in half.

  Recipe by: Linda Mercer's father in law

  Posted to MC-Recipe Digest by KitPATh <phannema@wizard.ucr.edu> on Feb 08,
  1998

</step></directions></recipe></recipeml>


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<meta name="generator" content="ApiGen 2.8.0">
	<meta name="robots" content="noindex">

	<title>File Mandrill/Whitelists.php</title>

	<link rel="stylesheet" href="resources/style.css?3901564645">

		Overview

Namespaces

None

PHP

Classes

Mandrill

Mandrill_Exports

Mandrill_Inbound

Mandrill_Internal

Mandrill_Ips

Mandrill_Messages

Mandrill_Metadata

Mandrill_Rejects

Mandrill_Senders

Mandrill_Subaccounts

Mandrill_Tags

Mandrill_Templates

Mandrill_Urls

Mandrill_Users

Mandrill_Webhooks

Mandrill_Whitelists

Exceptions

Mandrill_Error

Mandrill_HttpError

Mandrill_Invalid_CustomDNS

Mandrill_Invalid_CustomDNSPending

Mandrill_Invalid_DeleteDefaultPool

Mandrill_Invalid_DeleteNonEmptyPool

Mandrill_Invalid_EmptyDefaultPool

Mandrill_Invalid_Key

Mandrill_Invalid_Reject

Mandrill_Invalid_Tag_Name

Mandrill_Invalid_Template

Mandrill_IP_ProvisionLimit

Mandrill_Metadata_FieldLimit

Mandrill_NoSendingHistory

Mandrill_PaymentRequired

Mandrill_PoorReputation

Mandrill_ServiceUnavailable

Mandrill_Unknown_Export

Mandrill_Unknown_InboundDomain

Mandrill_Unknown_InboundRoute

Mandrill_Unknown_IP

Mandrill_Unknown_Message

Mandrill_Unknown_MetadataField

Mandrill_Unknown_Pool

Mandrill_Unknown_Sender

Mandrill_Unknown_Subaccount

Mandrill_Unknown_Template

Mandrill_Unknown_TrackingDomain

Mandrill_Unknown_Url

Mandrill_Unknown_Webhook

Mandrill_ValidationError

	<form id="search">
		<input type="hidden" name="cx" value="">
		<input type="hidden" name="ie" value="UTF-8">
		<input type="text" name="q" class="text">
		<input type="submit" value="Search">
	</form>

				Overview

				Namespace

				Class

				Tree

 1: <?php
 2:
 3: class Mandrill_Whitelists {
 4:     public function __construct(Mandrill $master) {
 5:         $this->master = $master;
 6:     }
 7:
 8:     /**
 9:      * Adds an email to your email rejection whitelist. If the address is
10: currently on your blacklist, that blacklist entry will be removed
11: automatically.
12:      * @param string $email an email address to add to the whitelist
13:      * @param string $comment an optional description of why the email was whitelisted
14:      * @return struct a status object containing the address and the result of the operation
15:      *     - email string the email address you provided
16:      *     - added boolean whether the operation succeeded
17:      */
18:     public function add($email, $comment=null) {
19:         $_params = array("email" => $email, "comment" => $comment);
20:         return $this->master->call('whitelists/add', $_params);
21:     }
22:
23:     /**
24:      * Retrieves your email rejection whitelist. You can provide an email
25: address or search prefix to limit the results. Returns up to 1000 results.
26:      * @param string $email an optional email address or prefix to search by
27:      * @return array up to 1000 whitelist entries
28:      *     - return[] struct the information for each whitelist entry
29:      *         - email string the email that is whitelisted
30:      *         - detail string a description of why the email was whitelisted
31:      *         - created_at string when the email was added to the whitelist
32:      */
33:     public function getList($email=null) {
34:         $_params = array("email" => $email);
35:         return $this->master->call('whitelists/list', $_params);
36:     }
37:
38:     /**
39:      * Removes an email address from the whitelist.
40:      * @param string $email the email address to remove from the whitelist
41:      * @return struct a status object containing the address and whether the deletion succeeded
42:      *     - email string the email address that was removed from the blacklist
43:      *     - deleted boolean whether the address was deleted successfully
44:      */
45:     public function delete($email) {
46:         $_params = array("email" => $email);
47:         return $this->master->call('whitelists/delete', $_params);
48:     }
49:
50: }
51:
52:
53:

		 API documentation generated by ApiGen 2.8.0


text:
package com.cldfire.forumnotifier.util.animations;

import javafx.animation.FadeTransition;
import javafx.animation.Interpolator;
import javafx.animation.PathTransition;
import javafx.animation.ScaleTransition;
import javafx.application.Platform;
import javafx.scene.CacheHint;
import javafx.scene.Node;
import javafx.scene.SnapshotParameters;
import javafx.scene.effect.GaussianBlur;
import javafx.scene.image.Image;
import javafx.scene.image.WritableImage;
import javafx.scene.layout.Pane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
import javafx.scene.shape.CubicCurveTo;
import javafx.scene.shape.MoveTo;
import javafx.scene.shape.Path;
import javafx.util.Duration;

import java.util.Random;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ParticleAnimation {
    private final ExecutorService executor = Executors.newSingleThreadExecutor();

    public ParticleAnimation(Pane layer) {
        executor.submit(() -> {
            Random randGen = new Random();

            for (int i = randGen.nextInt(30) * 10 + 20; i > 0; i--) {
                Circle test = createParticle(randGen.nextDouble(), Color.AQUAMARINE);
                Platform.runLater(() -> {
                    layer.getChildren().add(test);
                });
                animate(test, generateRandomPath(layer));
                try {
                    Thread.sleep(randGen.nextInt(5));
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
       });
    }

    private Circle createParticle(Double radius, Color color) {
        Random randGen = new Random();

        Circle returnCircle = new Circle(radius, color);
        returnCircle.setOpacity(0.0);
        returnCircle.setTranslateX(randGen.nextInt(800));
        returnCircle.setTranslateY(randGen.nextInt(500));
        returnCircle.setEffect(new GaussianBlur(randGen.nextInt(10) + 1));

        returnCircle.setCache(true);
        returnCircle.setCacheHint(CacheHint.QUALITY);
        return returnCircle;
    }

    private void animate(Circle particle, Path path) {
        Random randGen = new Random();

        PathTransition pathTransition = new PathTransition(Duration.seconds(path.getElements().size() * (randGen.nextInt(30) + 30)), path, particle);
        pathTransition.setInterpolator(Interpolator.EASE_OUT);

        ScaleTransition scaleTransition = new ScaleTransition(Duration.seconds(3f), particle);
        scaleTransition.setToX(10f);
        scaleTransition.setToY(10f);
        scaleTransition.setInterpolator(Interpolator.EASE_OUT);

        FadeTransition fadeTransition = new FadeTransition(Duration.seconds(6f), particle);
        fadeTransition.setToValue(0.7);
        fadeTransition.setInterpolator(Interpolator.EASE_OUT);

        pathTransition.play();
        scaleTransition.play();
        fadeTransition.play();
    }

    private Path generateRandomPath(Pane layer) {
        Random randGen = new Random();

        int dimensionX = (int) layer.getPrefWidth(); // TODO: Have this not use prefWidth / Height
        int dimensionY = (int) layer.getPrefHeight();
        int pathPointNum = randGen.nextInt(50) + randGen.nextInt(20) + 5;
        Path particlePath = new Path();
        particlePath.getElements().add(new MoveTo(randGen.nextInt(dimensionX), randGen.nextInt(dimensionY)));

        for (int i = pathPointNum; i > 0; i--) {
            particlePath.getElements().add(new CubicCurveTo(randGen.nextInt(500), randGen.nextInt(500), randGen.nextInt(500), randGen.nextInt(500), randGen.nextInt(dimensionX), randGen.nextInt(dimensionY)));
        }
        return particlePath;
    }

    private Image createImage(Node node) {
        WritableImage wi;

        SnapshotParameters parameters = new SnapshotParameters();
        parameters.setFill(Color.TRANSPARENT);

        int imageWidth = (int) node.getBoundsInLocal().getWidth();
        int imageHeight = (int) node.getBoundsInLocal().getHeight();

        wi = new WritableImage(imageWidth, imageHeight);
        node.snapshot(parameters, wi);

        return wi;
    }
}


text: export { default } from 'ember-handoff/routes/catch-all';


text:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Oktay Şen</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="theme-color" content="#a8d0ef">
    <meta name="Description" content="Oktay Şen's personal website.">
    <link rel="stylesheet" type="text/css" media="screen" href="styles.css" />

Oktay Şen

Software Engineer


text:
include(CheckCXXCompilerFlag)
include(CheckCSourceCompiles)
include(CheckFileOffsetBits)
include(CheckFunctionExists)
include(CheckLibraryExists)
include(CheckSymbolExists)
include(CheckIncludeFiles)
include(DefineExportMacro)

include_directories("${PROJECT_SOURCE_DIR}/include")
include_directories("${PROJECT_BINARY_DIR}/include")

list(APPEND NO_DEFINITIONS "-D_MODDIR_=\"${NO_MODDIR}\"")
list(APPEND NO_DEFINITIONS "-D_DATADIR_=\"${NO_DATADIR}\"")

add_definitions(${NO_DEFINITIONS})

check_cxx_compiler_flag("-std=c++11" COMPILER_SUPPORTS_CXX11)
if(COMPILER_SUPPORTS_CXX11)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
else()
    check_cxx_compiler_flag("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
    if(COMPILER_SUPPORTS_CXX0X)
        check_cxx_source_compiles("struct Base { virtual void f() {} };
                                   struct Child : public Base { virtual void f() override {} };
                                   int main() {}" COMPILER_SUPPORTS_CXX0X)
    endif()
    if(COMPILER_SUPPORTS_CXX0X)
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
    else()
        message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
    endif()
endif()

check_file_offset_bits()

check_function_exists(getopt_long HAVE_GETOPT_LONG)
check_function_exists(getphassphrase HAVE_GETPHASSPHRASE)
check_function_exists(lstat HAVE_LSTAT)

check_library_exists(gnugetopt getopt_long "" HAVE_LIBGNUGETOPT)

if(HAVE_PTHREAD)
    check_symbol_exists(PTHREAD_CREATE_JOINABLE pthread.h HAVE_PTHREAD_CREATE_JOINABLE)
    if(NOT HAVE_PTHREAD_CREATE_JOINABLE)
        check_symbol_exists(PTHREAD_CREATE_DETACHED pthread.h HAVE_PTHREAD_CREATE_DETACHED)
        if(HAVE_PTHREAD_CREATE_DETACHED)
            set(PTHREAD_CREATE_JOINABLE "PTHREAD_CREATE_DETACHED")
        endif()
    endif()
    check_symbol_exists(PTHREAD_PRIO_INHERIT pthread.h HAVE_PTHREAD_PRIO_INHERIT)
    check_c_source_compiles("#include <sys/types.h>
                            #include <sys/socket.h>
                            #include <netdb.h>
                            int main() { int x = AI_ADDRCONFIG; (void) x; }" HAVE_THREADED_DNS)
endif()

if(CYGWIN)
    # We don't want to use -std=gnu++11 instead of -std=c++11, but among other things,
    # -std=c++11 defines __STRICT_ANSI__ which makes cygwin not to compile: undefined references to
    # strerror_r, fdopen and strcasecmp etc. (their declarations in system headers are between ifdef)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -U__STRICT_ANSI__")
elseif(CMAKE_COMPILER_IS_GNUCXX)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -W -Wno-unused-parameter -Woverloaded-virtual")
    if(CMAKE_BUILD_TYPE STREQUAL "Debug")
        # These enable some debug options in g++'s STL, e.g. invalid use of iterators
        # But they cause crashes on cygwin while loading modules
        set(_GLIBCXX_DEBUG ON)
        set(_GLIBCXX_DEBUG_PEDANTIC ON)
    endif()
endif()

if(NOT DEFINED CMAKE_MACOSX_RPATH)
    set(CMAKE_MACOSX_RPATH ON)
endif()
SET(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib)

macro(process_definitions _DEFINITIONS _OUTPUT)
    foreach(_def ${_DEFINITIONS})
        if(${_def} MATCHES "^-.*")
            list(APPEND _defs ${_def})
        else()
            list(APPEND _defs "-D${_def}")
        endif()
    endforeach()
    if(_defs)
        list(REMOVE_DUPLICATES _defs)
        string(REPLACE ";" " " ${_OUTPUT} "${_defs}")
    endif()
endmacro()

macro(process_includedirs _INCLUDEDIRS _OUTPUT)
    foreach(_dir ${_INCLUDEDIRS})
        if(${_dir} MATCHES "^-.*")
            list(APPEND _dirs ${_dir})
        else()
            list(APPEND _dirs "-I${_dir}")
        endif()
    endforeach()
    if(_dirs)
        list(REMOVE_DUPLICATES _dirs)
        string(REPLACE ";" " " ${_OUTPUT} "${_dirs}")
    endif()
endmacro()

macro(process_link_libraries _LIBRARIES _OUTPUT)
    foreach(_lib ${_LIBRARIES})
        if(${_lib} MATCHES "^-.*")
            list(APPEND _ldflags ${_lib})
        else()
            get_filename_component(_dir ${_lib} PATH)
            if(_dir)
                list(APPEND _ldflags "-L${_dir}")
            endif()
            get_filename_component(_name ${_lib} NAME_WE)
            string(REGEX REPLACE "^lib" "" _name ${_name})
            if(_name)
                list(APPEND _ldflags "-l${_name}")
            endif()
        endif()
    endforeach()
    if(_ldflags)
        list(REMOVE_DUPLICATES _ldflags)
        string(REPLACE ";" " " ${_OUTPUT} "${_ldflags}")
    endif()
endmacro()


text:
Notes about the demo app<!--more-->. The name should be "Stash.app"

<img width="456" alt="img" src="https://raw.githubusercontent.com/stylekit/img/master/demo_app_30_fps_1x.gif">

[vimeo](https://vimeo.com/158515887)
[css files used in the demo](https://github.com/stylekit/stash)
[the swift source code for the app](https://github.com/stylekit/stash)

## Ideas:
- left sidebar in translucent with open-source iconography
- Add this demo app to the stylekit Org account "Stash.app"
- Main content view should have a white background
- The list in the mainView needs to a custom list that extends List and then later RBSlider list
- The custom list should override the mergeAt method and implement its own lable-Items
- the custom Label item should have a header, date on the right side. and content
- when you click the label item you should go to the itemView. A back icon in the top left corner should take you back
- The app should read from a xml document with nodes for articles. article should have meta data and text content

## Links:
- ==vibrancy layer:== https://www.cocoanetics.com/2013/10/blurring-views-on-mac/
- nice animation inspiration: http://alternoteapp.com/

## Tasks:
- [x] Start by creating the black translucent window again. It should not have a titleBar or title buttons.
- [x] Add your own title buttons: as you need custom locations for these
- [x] Try to add the white background for the mainView
- [x] Try to add semi transparent boxes in the left sidebar to test if this works
- [x] Find open-source icons Use helveticons for the first test, then find replacements later.
- [ ] Maybe add gesture to get back to main content
- [ ] Add translucent window support from css. See tips on this here: http://stylekit.org/blog/2016/01/23/Chromeless-window/
- [ ] ==Try the custom vibrancy layer tutorial==


text:
var fs = require('fs');
var fsextra = require('fs.extra');

var genBenchmarksCommand = exports.genBenchmarksCommand = {};

genBenchmarksCommand.GenBenchmarksCommand = function(execTestsObject, testcase) {
    this.testcase = testcase;
    this.context = execTestsObject;
}

// this validator only push the sub-checkers.
genBenchmarksCommand.GenBenchmarksCommand.prototype.checks = function(callback) {

}


text:
title: Careers Outside Academia Discussion
text: Discussion about opportunities outside academia
location: MP408
link: https://github.com/UofTCoders/Events/issues/72
date: 2016-11-16
startTime: '18:10'
endTime: '19:30'
---


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Mitt. bot. StSamml. , Münch. 14: 116 (1978)

#### Original name
Thyronectria inconspicua Döbbeler

### Remarks
null


text:
package de.zib.scalaris.operations;

import com.ericsson.otp.erlang.OtpErlangObject;
import com.ericsson.otp.erlang.OtpErlangString;

import de.zib.scalaris.AbortException;
import de.zib.scalaris.EmptyListException;
import de.zib.scalaris.KeyChangedException;
import de.zib.scalaris.NotAListException;
import de.zib.scalaris.NotANumberException;
import de.zib.scalaris.NotFoundException;
import de.zib.scalaris.UnknownException;

/**
 * Generic interface for operations which can be added to a request list.
 *
 * @author Nico Kruber, kruber@zib.de
 * @version 3.18
 * @since 3.14
 */
public interface Operation {
    /**
     * Gets the erlang representation of the operation.
     *
     * @param compressed
     *            whether the value part in the term should be encoded, i.e.
     *            compressed into an Erlang binary, or not
     *
     * @return erlang representation for api_tx:req_list
     */
    abstract public OtpErlangObject getErlang(final boolean compressed);
     /**
      * Gets the key the operation is working on (if available)
      *
      * @return the key or <tt>null</tt>
      */
    abstract public OtpErlangString getKey();

    /**
     * Sets the raw erlang result value. It can be processed using
     * {@link #processResult()}.
     *
     * @param resultRaw
     *            the result
     * @param compressed
     *            whether the value inside the result is compressed or not
     *
     * @since 3.18
     */
    public abstract void setResult(final OtpErlangObject resultRaw,
            final boolean compressed);

    /**
     * Gets the (raw Erlang) result set via
     * {@link #setResult(OtpErlangObject, boolean)}.
     *
     * @return the result object or <tt>null</tt> if not set
     *
     * @since 3.18
     */
    public abstract OtpErlangObject getResult();

    /**
     * Determines if the result set via
     * {@link #setResult(OtpErlangObject, boolean)} is compressed or not.
     *
     * @return <tt>true</tt> if compressed, <tt>false</tt> otherwise, undefined
     *         if no result was set
     *
     * @since 3.18
     */
    public abstract boolean getResultCompressed();

    /**
     * Processes the result set by {@link #setResult(OtpErlangObject, boolean)}.
     *
     * Note: the created value is not cached!
     *
     * @return a (potentially) read value (may be <tt>null</tt>)
     *
     * @throws NotFoundException
     *             if the requested key does not exist
     * @throws KeyChangedException
     *             if the key did not match <tt>old_value</tt>
     * @throws NotANumberException
     *             if the previously stored value was not a number
     * @throws NotAListException
     *             if the previously stored value was no list
     * @throws EmptyListException
     *             if the stored value is an empty list but the op requires a
     *             non-empty list
     * @throws AbortException
     *             if a commit failed
     * @throws UnknownException
     *             if any other error occurs
     *
     * @since 3.18
     */
    public abstract Object processResult() throws NotFoundException,
            KeyChangedException, NotANumberException, NotAListException,
            AbortException, EmptyListException, UnknownException;
}


text:
import random
import sys
import traceback
import os
import math
import argparse
import time
import random_connected_graph

# Parses Arguments
parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter,
                                 description='Simulates a P2P network with random dynamic connectivity in order to examines runtime \
and space complexity of search algorithms.',
                                 epilog="Examples:\n\
\n\
python SimulateP2PNetwork.py 30 randomwalk -o output\n\
This will simulate a network of 30 vertices and use the random walk algorithm, outputs in output.csv\n\
\n\
python SimulateP2PNetwork.py 500 bfs -e 20\n\
This will simulate a network of 500 verticies, using the BFS algorithm, and run a \
new experiment (assign new start and end nodes) on each graph 20 times.\n\
\n\
python SimulateP2PNetwork.py 350 randomwalk -e 30 -t 200\n\
This will simulate a network of 500 verticies, using the randomwalk algorithm, run a \
new trial (assign new start and end nodes) on each graph 30 times and re-build (assign new edges) the graph 200 times.\n\
\n\
Output: a csv in the following form (one line per experiment);\n\
num vertices, num edges, algorithm used, average length of path found, if file NEVER found, average data per hop (bytes), runningtime (seconds)\n\
Ex:\n\
250,10898,randomwalk,32373,False,32,3.237650\n\
250,10898,randomwalk,25520,False,32,2.553203\n\
250,10898,randomwalk,28501,False,32,2.851121\n\
.\n\
.\n\
.")
parser.add_argument('vertices', type=int,
                    help='Number of vertices in the simulated network (Recommend <= 1000)')
parser.add_argument('algorithm', choices=['randomwalk', 'bfs', 'lazyrandomwalk', 'rw', 'lrw'],
                    help='Choose an algorithm to use in the simulation')
parser.add_argument('-r', type=int,
                    help='(Default 10) Number of RUNS per EXPERIMENTS (exact same start and end nodes, on network with same edges)')
parser.add_argument('-e', type=int,
                    help='(Default 50) Number of EXPERIMENTS per TRIAL (new start and end nodes, on network with same edges)')
parser.add_argument('-t', type=int,
                    help='(Default 100) Number of TRIALS (times graph will be re-built with new edges)')
parser.add_argument('-o',
                    help='Specify output filename')
args = parser.parse_args()
numberOfVertices = args.vertices
algorithm = args.algorithm
numberOfFailiures = 0
pofEdgeFail = 0.001
maxPathLength = 4 * (math.pow(numberOfVertices, 3))
if args.t:
    numberOfTrails = args.t
else:
    numberOfTrails = 100
if (algorithm == "rw"):
    algorithm = "randomwalk";
if (algorithm == "lrw"):
    algorithm = "lazyrandomwalk";

if args.o:
    outfileName = "./Data/" + args.o
else:
    if (algorithm == "randomwalk"):
        outfileName = "./Data/RandomWalkSimulation.csv"
    if (algorithm == "bfs"):
        outfileName = "./Data/BFSSimulation.csv"
    if (algorithm == "lazyrandomwalk"):
        outfileName = "./Data/LazyRandomWalkSimulation.csv"

if args.e:
    numberOfExperiments = args.e
else:
    numberOfExperiments = 50

if args.r:
    numberOfRuns = args.r
else:
    numberOfRuns = 10

# Code Starts Here!

# Returns the maximum possible number of edges of an undirected graph with
# n verticies

def maxEdges(n):
    return (n * (n - 1)) / 2

# Runs the algorithm and collects data

def runAlgorithm(graph, startHost, endHost):
    # Algorithm sends a constant ammount of data per hop. 8 bytes of data.
    if (algorithm == "randomwalk"):
        hops = []
        currHost = random.choice(graph.neighborSet[startHost])
        start_Per_Host_Computation_Time = time.time()*1000
        while (len(hops) <= maxPathLength and currHost != endHost):
            deadset = []
            for neighbor in graph.neighborSet[currHost]: # Calculates random edge failiure
                if (pofEdgeFail > random.random()):
                    deadset.append(neighbor)
            activeneighbors = list(set(graph.neighborSet[currHost])-set(deadset));
            if not activeneighbors: # if every edge dies
                currHost = random.choice(graph.neighborSet[currHost]);
            else:
                currHost = random.choice(activeneighbors)
            hops.append(currHost)
        finish_Per_Host_Computation_Time = time.time()*1000
        return hops, (finish_Per_Host_Computation_Time - start_Per_Host_Computation_Time)

    if (algorithm == "bfs"):
     # maintain a queue of paths
        queue = []
        # push the first path into the queue
        queue.append([startHost])
        starttime = time.time()*1000
        while queue:
            # get the first path from the queue
            path = queue.pop(0)
            # get the last node from the path
            currHost = path[-1]
            # path found
            if currHost == endHost:
                finishtime = time.time()*1000
                return path, (finishtime - starttime)
            # enumerate all adjacent nodes, construct a new path and push it
            # into the queue
            for adjacent in graph.neighborSet[currHost]:
                if (pofEdgeFail > random.random()):
                    continue;
                new_path = list(path)
                new_path.append(adjacent)
                queue.append(new_path)
        finishtime = time.time()*1000
        return path, (finishtime - starttime);

    if (algorithm == "lazyrandomwalk"):
        hops = []
        currHost = random.choice(graph.neighborSet[startHost])
        start_Per_Host_Computation_Time = time.time()*1000
        while (len(hops) <= maxPathLength and currHost != endHost):
            takeSelfLoop = random.random();
            deadset = []
            for neighbor in graph.neighborSet[currHost]: # Calculates random edge failiure
                if (pofEdgeFail > random.random()):
                    deadset.append(neighbor)
            activeneighbors = list(set(graph.neighborSet[currHost])-set(deadset));
            if not activeneighbors:
                currHost = random.choice(graph.neighborSet[currHost]);
            else:
                if (takeSelfLoop < .5): # If we do NOT take a self-loop
                    currHost = random.choice(activeneighbors)
                    hops.append(currHost)
        finish_Per_Host_Computation_Time = time.time()*1000
        return hops, (finish_Per_Host_Computation_Time - start_Per_Host_Computation_Time)

# Returns a connected graph with randomized edges.
# This simulates the reality of real p2p networks,
# as hosts very often come online and go offline.

def shuffleConnections():
    edges = random.randrange(numberOfVertices - 1, maxEdges(numberOfVertices))
    verts = [x for x in xrange(int(numberOfVertices))]
    network = random_connected_graph.random_walk(verts, edges)
    network.sort_edges()
    # print "Generated network containing:\n\
    #%d hosts (vertices)\n\
    #%d connections (edges)" % (len(network.nodes), len(network.edges));
    return network

# Shuffles node looking for the file, and node which has the file

def shuffleHostsOfInterest():
    startNode = random.randrange(0, numberOfVertices - 1)
    endNode = random.randrange(0, numberOfVertices - 1)
    if (startNode == endNode):
        return shuffleHostsOfInterest()
    else:
        return startNode, endNode

# setup loading bar
print "\n\nRunning Simulations..."
trialRatio = math.ceil(numberOfTrails * 2 / 100)
# sys.stdout.write("[%s]" % (" " * 50))
# sys.stdout.flush()
# sys.stdout.write("\b" * (50 + 1))  # return to start of line, after '['

# Run the expirement
outputCSV = open(outfileName, 'w')
sys.stdout.write("\033[92m0\033[0m")
for currentTrial in range(numberOfTrails):
    network = shuffleConnections()
    for currentExeriment in range(numberOfExperiments):
        startHost, endHost = shuffleHostsOfInterest()
        hops = []
        runtime = []
        spacePerHost = 32  # Estimated 32 bytes of data for the base request.
        for currentRun in range(numberOfRuns):
            numhops, searchtime = runAlgorithm(network, startHost, endHost)
            runtime.append(searchtime)
            hops.append(sum(numhops))
        averageRunTime = sum(runtime) / len(runtime)
        averageHopLength = sum(hops) / len(hops)

        # Adds link latency into computation, estimating 0.0001 second
        # transmission delay/hop
        averageRunTime += (averageHopLength * 0.1)
        if algorithm == "bfs":
            spacePerHost += averageHopLength * 32 # Each new host IP needs to be enqueued into the datastructure
        includedFailiure = False
        # Allows for a 10Mbs (average) upload speed bottleneck on all hosts
        averageRunTime += (spacePerHost / 1250)
        # Processing Time For Algorithm
        averageRunTime += (spacePerHost / 100)
        if maxPathLength in hops:
            includedFailiure = True
        outputCSV.write("%d,%d,%s,%d,%r,%d,%.6f\n" % (numberOfVertices, len(
            network.edges), algorithm, averageHopLength, includedFailiure, spacePerHost, averageRunTime))

    # Progress
    number_of_chars_to_erase = len(str(currentTrial)) + 11 + len(str(numberOfTrails))
    print("\033[92mTrial:\t%d/%d\033[0m " % (currentTrial+1,numberOfTrails))

sys.stdout.write('\n')


text:
require_relative './../../spec_helper'

describe Arango::Server do
  context "#general" do
    it "address" do
      expect(@server.base_uri).to eq "http://localhost:8529"
    end

    it "username" do
      expect(@server.username).to eq "root"
    end
  end

  context "#user" do
    it "setup an user" do
      user = @server.user name: "MyUser2"
      expect(user.name).to eq "MyUser2"
    end
  end

  context "#monitoring" do
    it "log" do
      expect(@server.log[:totalAmount]).to be >= 0
    end

    it "reload" do
      expect(@server.reload).to be true
    end

    it "statistics" do
      expect(@server.statistics[:enabled]).to be true
    end

    it "statisticsDescription" do
      expect(@server.statisticsDescription[:groups][0].nil?).to be false
    end

    it "role" do
      expect(@server.role).to eq "SINGLE"
    end

    # it "server" do # BUGGED
    #   expect(@server.serverData.class).to eq String
    # end

    # it "clusterStatistics" do
    #   expect(@server.clusterStatistics.class).to eq String
    # end
  end

  context "#lists" do
    # it "endpoints" do
    #   expect(@server.endpoints[0].keys[0]).to eq "endpoint"
    # end

    it "users" do
      expect(@server.users[0].class).to be Arango::User
    end

    it "databases" do
      expect(@server.databases[0].class).to be Arango::Database
    end
  end

  context "#async" do
    it "create async" do
      @server.async = :store
      expect(@server.async).to eq :store
    end

    it "pendingAsync" do
      @server.async = :store
      @myAQL.execute
      val = @server.retrievePendingAsync
      expect(val.to_i.to_s).to eq val
    end

    it "fetchAsync" do
      @server.async = :store
      id = @myAQL.execute
      @server.async = false
      val = @server.fetchAsync(id: id)
      expect(val[:result]).to eq [1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 2, 5, 2, 1, 1, 2]
    end

    it "cancelAsync" do
      @server.async = :store
      id = @myAQL.execute
      @server.async = false
      val = @server.cancelAsync(id: id)
      expect(val).to eq true
    end

    it "destroyAsync" do
      @server.async = :store
      id = @myAQL.execute
      @server.async = false
      val = @server.destroyAsync id: id
      expect(val).to be true
    end
  end

  context "#batch" do
    it "batch" do
      @server.async = false
      queries = [{
        "method": "POST",
        "address": "/_db/MyDatabase/_api/collection",
        "body": {"name": "newCOLLECTION"},
        "id": "1"
      },
      {
        "method": "GET",
        "address": "/_api/database",
        "id": "2"
      }]
      val = @server.batch queries: queries
      expect(val.class).to be Arango::Batch
      response = val.execute
      expect(response.class).to be String
    end

    it "createDumpBatch" do
      expect((@server.createDumpBatch ttl: 100).to_i).to be > 1
    end

    it "prolongDumpBatch" do
      dumpBatchID = @server.createDumpBatch ttl: 100
      val = @server.prolongDumpBatch ttl: 100, id: dumpBatchID
      expect(val).to be true
    end

    it "destroyDumpBatch" do
      dumpBatchID = @server.createDumpBatch ttl: 100
      expect(@server.destroyDumpBatch id: dumpBatchID).to be true
    end
  end

  context "#task" do
    it "tasks" do
      result = @server.tasks
      expect(result[0].id.class).to be String
    end
  end

  context "#miscellaneous" do
    it "version" do
      expect(@server.version[:server]).to eq "arango"
    end

    # it "propertyWAL" do
    #   @server.changePropertyWAL historicLogfiles: 14
    #   val = @server.propertyWAL[:historicLogfiles]
    #   expect(val).to eq 14
    # end

    it "flushWAL" do
      expect(@server.flushWAL).to be true
    end

    it "transactions" do
      expect(@server.transactions[:runningTransactions]).to be >= 0
    end

    it "time" do
      expect([BigDecimal, Float].include?(@server.time.class)).to eq true
    end

    it "echo" do
      expect(@server.echo[:user]).to eq "root"
    end

    it "databaseVersion" do
      expect(@server.databaseVersion.to_i).to be >= 1
    end

    # it "sleep" do
    #   expect(@server.sleep duration: 10).to be >= 1
    # end

    # it "shutdown" do
    #   result = ArangoServer.shutdown
    #   `sudo service arangodb restart`
    #   expect(result).to eq "OK"
    # end
  end

end


text:
package de.espend.idea.shopware.navigation;

import com.intellij.codeInsight.daemon.LineMarkerInfo;
import com.intellij.codeInsight.daemon.LineMarkerProvider;
import com.intellij.codeInsight.navigation.NavigationGutterIconBuilder;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiRecursiveElementWalkingVisitor;
import com.jetbrains.php.lang.psi.elements.Method;
import com.jetbrains.php.lang.psi.elements.MethodReference;
import com.jetbrains.php.lang.psi.elements.StringLiteralExpression;
import de.espend.idea.shopware.ShopwarePluginIcons;
import de.espend.idea.shopware.ShopwareProjectComponent;
import de.espend.idea.shopware.util.HookSubscriberUtil;
import org.apache.commons.lang.StringUtils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

public class PhpLineMarkerProvider implements LineMarkerProvider {
    @Nullable
    @Override
    public LineMarkerInfo getLineMarkerInfo(@NotNull PsiElement psiElement) {
        return null;
    }

    @Override
    public void collectSlowLineMarkers(@NotNull List<PsiElement> psiElements, final @NotNull Collection<LineMarkerInfo> lineMarkerInfos) {

        if(psiElements.size() == 0 || !ShopwareProjectComponent.isValidForProject(psiElements.get(0))) {
            return;
        }

        PsiFile containingFile = psiElements.get(0).getContainingFile();
        if(!containingFile.getName().contains("Bootstrap")) {
            return;
        }

        final Map<String, Method> methods = new HashMap<String, Method>();

        // we dont want multiple line markers, so wrap all into one here
        final Map<String, Set<PsiElement>> methodTargets = new HashMap<String, Set<PsiElement>>();

        for(PsiElement psiElement: psiElements) {
            if(psiElement instanceof Method && ((Method) psiElement).getModifier().isPublic()) {
                methods.put(((Method) psiElement).getName(), (Method) psiElement);
            }
        }

        if(methods.size() == 0) {
            return;
        }

        final Project project = containingFile.getProject();
        containingFile.accept(new PsiRecursiveElementWalkingVisitor() {
            @Override
            public void visitElement(PsiElement element) {

                if(!(element instanceof MethodReference)) {
                    super.visitElement(element);
                    return;
                }

                MethodReference methodReference = (MethodReference) element;
                String name = methodReference.getName();
                if(name != null && (name.equals("subscribeEvent") || name.equals("createEvent"))) {
                    PsiElement[] parameters = methodReference.getParameters();
                    if(parameters.length >= 2 && parameters[0] instanceof StringLiteralExpression && parameters[1] instanceof StringLiteralExpression) {
                        String subscriberName = ((StringLiteralExpression) parameters[0]).getContents();
                        String methodName = ((StringLiteralExpression) parameters[1]).getContents();

                        if(StringUtils.isNotBlank(subscriberName) && StringUtils.isNotBlank(methodName)) {

                            if(methods.containsKey(methodName)) {

                                if(!methodTargets.containsKey(methodName)) {
                                    methodTargets.put(methodName, new HashSet<PsiElement>());
                                }

                                methodTargets.get(methodName).add(parameters[1]);
                                methodTargets.get(methodName).addAll(HookSubscriberUtil.getAllHookTargets(project, subscriberName));

                            }

                        }

                    }
                }

                super.visitElement(element);
            }
        });

        // we allow multiple events
        for(Map.Entry<String, Set<PsiElement>> method: methodTargets.entrySet()) {
            if(methods.containsKey(method.getKey())) {

                NavigationGutterIconBuilder<PsiElement> builder = NavigationGutterIconBuilder.create(ShopwarePluginIcons.SHOPWARE_LINEMARKER).
                    setTargets(method.getValue()).
                    setTooltipText("Related Targets");

                lineMarkerInfos.add(builder.createLineMarkerInfo(methods.get(method.getKey())));
            }
        }

    }
}


text:
package org.apache.ignite.internal.binary;

import org.apache.ignite.binary.BinaryObject;
import org.apache.ignite.binary.BinaryObjectException;
import org.apache.ignite.binary.BinaryType;
import org.jetbrains.annotations.Nullable;

/**
 * Extended binary object interface.
 */
public interface BinaryObjectEx extends BinaryObject {
    /**
     * @return Type ID.
     */
    public int typeId();

    /**
     * Get raw type.
     *
     * @return Raw type
     * @throws BinaryObjectException If failed.
     */
    @Nullable public BinaryType rawType() throws BinaryObjectException;
}


text:
function play_out(board::Board, num_rounds::Integer)
    forced_pass = false
    for i = 1:num_rounds
        candidates = legal_moves(board)
        if length(candidates) == 1
            # Forced pass for both players
            if forced_pass
                return board
            end
            forced_pass = true
        else
            forced_pass = false
        end
        move = rand(candidates)
        play_move(board, move)
    end
    board
end


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

namespace Barsik.Client
{
    public interface IResponseReceiver
    {
        Task<object> ReceiveResponseAsync(IServerAddress serveAddress, object request, Type responseType);
    }
}


text:
package com.linkedin.pinot.controller.helix;

import com.linkedin.pinot.common.config.TableConfig;
import com.linkedin.pinot.common.segment.SegmentMetadata;
import com.linkedin.pinot.common.utils.CommonConstants;
import com.linkedin.pinot.common.utils.ControllerTenantNameBuilder;
import com.linkedin.pinot.common.utils.ZkStarter;
import com.linkedin.pinot.core.query.utils.SimpleSegmentMetadata;
import java.io.IOException;
import org.json.JSONException;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

public class ControllerSentinelTestV2 extends ControllerTest {
  private final String _helixClusterName = getHelixClusterName();

  @BeforeClass
  public void setup() throws Exception {
    startZk();
    startController();
    ControllerRequestBuilderUtil.addFakeBrokerInstancesToAutoJoinHelixCluster(_helixClusterName,
        ZkStarter.DEFAULT_ZK_STR, 20, true);
    ControllerRequestBuilderUtil.addFakeDataInstancesToAutoJoinHelixCluster(_helixClusterName, ZkStarter.DEFAULT_ZK_STR,
        20, true);
  }

  @AfterClass
  public void tearDown() {
    stopController();
    stopZk();
  }

  @Test
  public void testOfflineTableLifeCycle() throws IOException, JSONException {
    // Create offline table creation request
    String tableName = "testTable";
    String tableJSONConfigString =
        new TableConfig.Builder(CommonConstants.Helix.TableType.OFFLINE).setTableName(tableName)
            .setNumReplicas(3)
            .build()
            .toJSONConfigString();
    sendPostRequest(_controllerRequestURLBuilder.forTableCreate(), tableJSONConfigString);
    Assert.assertEquals(
        _helixAdmin.getResourceIdealState(_helixClusterName, CommonConstants.Helix.BROKER_RESOURCE_INSTANCE)
            .getPartitionSet()
            .size(), 1);
    Assert.assertEquals(
        _helixAdmin.getResourceIdealState(_helixClusterName, CommonConstants.Helix.BROKER_RESOURCE_INSTANCE)
            .getInstanceSet(tableName + "_OFFLINE")
            .size(), 20);

    // Adding segments
    for (int i = 0; i < 10; ++i) {
      Assert.assertEquals(
          _helixAdmin.getResourceIdealState(_helixClusterName, tableName + "_OFFLINE").getNumPartitions(), i);
      addOneOfflineSegment(tableName);
      Assert.assertEquals(
          _helixAdmin.getResourceIdealState(_helixClusterName, tableName + "_OFFLINE").getNumPartitions(), i + 1);
    }

    // Delete table
    sendDeleteRequest(_controllerRequestURLBuilder.forTableDelete(tableName));
    Assert.assertEquals(
        _helixAdmin.getResourceIdealState(_helixClusterName, CommonConstants.Helix.BROKER_RESOURCE_INSTANCE)
            .getPartitionSet()
            .size(), 0);

    Assert.assertEquals(_helixAdmin.getInstancesInClusterWithTag(_helixClusterName,
        ControllerTenantNameBuilder.getBrokerTenantNameForTenant(ControllerTenantNameBuilder.DEFAULT_TENANT_NAME))
        .size(), 20);
    Assert.assertEquals(_helixAdmin.getInstancesInClusterWithTag(_helixClusterName,
        ControllerTenantNameBuilder.getRealtimeTenantNameForTenant(ControllerTenantNameBuilder.DEFAULT_TENANT_NAME))
        .size(), 20);
    Assert.assertEquals(_helixAdmin.getInstancesInClusterWithTag(_helixClusterName,
        ControllerTenantNameBuilder.getOfflineTenantNameForTenant(ControllerTenantNameBuilder.DEFAULT_TENANT_NAME))
        .size(), 20);
  }

  private void addOneOfflineSegment(String resourceName) {
    final SegmentMetadata segmentMetadata = new SimpleSegmentMetadata(resourceName);
    _helixResourceManager.addSegment(segmentMetadata, "downloadUrl");
  }
}


text:
<?php

namespace App\Controller\Component;

use Cake\Controller\Component;
use Cake\Http\ServerRequest;

use function array_keys;
use function count;
use function intval;

/**
 * Github api component handling comunication with github.
 */
class OrderSearchComponent extends Component
{
    /**
     * Indexes are +1'ed because first column is of checkboxes
     * and hence it should be ignored.
     *
     * @param string[] $aColumns The columns
     *
     * @return array
     */
    public function getSearchConditions(array $aColumns, ServerRequest $request): array
    {
        $searchConditions = ['OR' => []];
        $keys = array_keys($aColumns);
        $columnsCount = count($aColumns);

        $sSearch = $request->getQuery('sSearch');
        if ($sSearch !== '' && $sSearch !== null) {
            for ($i = 0; $i < $columnsCount; ++$i) {
                if ($request->getQuery('bSearchable_' . ($i + 1)) !== 'true') {
                    continue;
                }

                $searchConditions['OR'][] = [$aColumns[$keys[$i]] . ' LIKE' => '%' . $sSearch . '%'];
            }
        }

        /* Individual column filtering */
        for ($i = 0; $i < $columnsCount; ++$i) {
            $searchTerm = $request->getQuery('sSearch_' . ($i + 1));
            if ($searchTerm === '' || $searchTerm === null) {
                continue;
            }

            $searchConditions[] = [$aColumns[$keys[$i]] . ' LIKE' => $searchTerm];
        }

        return $searchConditions;
    }

    /**
     * @param string[] $aColumns The columns
     *
     * @return array|null
     */
    public function getOrder(array $aColumns, ServerRequest $request): ?array
    {
        if ($request->getQuery('iSortCol_0') !== null) {
            $order = [];
            //Seems like we need to sort with only one column each time, so no need to loop
            $sort_column_index = intval($request->getQuery('iSortCol_0'));

            $keys = array_keys($aColumns);

            if (
                $sort_column_index > 0
                && $request->getQuery('bSortable_' . $sort_column_index) === 'true'
            ) {
                $order[$aColumns[$keys[$sort_column_index - 1]]] = $request->getQuery('sSortDir_0');
            }

            return $order;
        }

        return null;
    }
}