text:
<!doctype html>

    <title>Code coverage report for src/emitter.js</title>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="../prettify.css" />
    <link rel="stylesheet" href="../base.css" />
    <meta name="viewport" content="width=device-width, initial-scale=1">

      all files / src/ emitter.js

        100%
        Statements
        60/60

        93.33%
        Branches
        28/30

        100%
        Functions
        12/12

        100%
        Lines
        44/44

        1 branch
        Ignored

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102	3×

14×
14×

14×

13×
13×
1×

12×
1×

11×
11×

11×

11×

5×
1×

4×
1×

3×
1×

2×

2×
2×
2×

2×
2×

2×

2×

14×
14×
1×

13×
13×

13×
9×
8×

8×

8×
1×

13×

1×

1×

1×

59×

const emitter = new WeakMap();

class Emitter {
	constructor(){
		emitter.set(this, {
			events: {}
		});

		this.eventLength = 0;
	}

	on(event, cb, once = false){
		if(typeof cb === 'undefined') {
			throw new Error('You must provide a callback method.');
		}

		if(typeof cb !== 'function') {
			throw new TypeError('Listener must be a function');
		}

		this.events[event] = this.events[event] || [];
		this.events[event].push({
      cb,
      once
    });

		this.eventLength++;

		return this;
	}

	off(event, cb){
		if(typeof cb === 'undefined') {
			throw new Error('You must provide a callback method.');
		}

		if(typeof cb !== 'function') {
			throw new TypeError('Listener must be a function');
		}

		if(typeof this.events[event] === 'undefined'){
			throw new Error(`Event not found - the event you provided is: ${event}`);
		}

		const listeners = this.events[event];

		listeners.forEach((v, i) => {
			Eif(v.cb === cb) {
				listeners.splice(i, 1);
			}
		});

		Eif(listeners.length === 0){
			delete this.events[event];

			this.eventLength--;
		}

		return this;
	}

	trigger(event, ...args){
		if(typeof event === 'undefined'){
			throw new Error('You must provide an event to trigger.');
		}

		const listeners = this.events[event];
    const onceListeners = [];

		if(typeof listeners !== 'undefined') {
			listeners.forEach((v, k) => {
        v.cb.apply(this, args);

        if(v.once) onceListeners.unshift(k);

        onceListeners.forEach((v, k) => {
          listeners.splice(k, 1);
        });
			});
		}

		return this;
	}

  once(event, cb){
    this.on(event, cb, true);
  }

  destroy(){
    emitter.delete(this);

    this.eventLength = 0;
  }

	get events(){
		return emitter.get(this).events;
	}
}

export default Emitter;

  Code coverage
  generated by istanbul at Wed Aug 30 2017 21:15:20 GMT-0400 (EDT)


text:
/// <reference path='fourslash.ts'/>

//// class Foo {
////     constructor([|public [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}publicParam|]: number|]) {
////         let localPublic = [|publicParam|];
////         this.[|{| "isWriteAccess": true |}publicParam|] += 10;
////     }
//// }

const [rDef, ...ranges] = test.ranges();
const [r0, r1, r2] = ranges;
verify.referenceGroups(ranges, [
    { definition: "(property) Foo.publicParam: number", ranges: [r0, r2] },
    { definition: "(parameter) publicParam: number", ranges: [r1] }
]);

redpajama_set_name: RedPajamaGithub


text:
module WhereIn7 where

--A definition can be lifted from a where or let into the surrounding binding group.
--Lifting a definition widens the scope of the definition.

--In this example, lift 'addthree' defined in 'fun'.
--This example aims to test adding parenthese.

fun x y z =inc (addthree x y z)
       where inc a =a +1

addthree x y z=x+y+z


text:
package lab05;
// **************************************************************
// ComparePlayers
//
// Reads in two Player objects and tells whether they represent
// the same player.
// **************************************************************
import java.util.Scanner;
/**
 * This class is used for testing the eqaulity of different players according to the equals() method defined in the player class.
 * Used in lab5.
 *
 * @author Eddie Gurnee
 * @version 10/21/2013
 * @see Player
 *
 */
public class ComparePlayers
{
	public static void main(String[] args)
	{
		Player player1 = new Player();
		Player player2 = new Player();

		Scanner scan = new Scanner(System.in);

		//Prompt for and read in information for player 1
		System.out.println("Enter data for Player 1:");
		player1.readPlayer();

		//Prompt for and read in information for player 2
		System.out.println("Enter data for Player 2:");
		player2.readPlayer();

		//Compare player1 to player 2 and print a message saying
		//whether they are equal
		if (player1.equals(player2)) {
			System.out.println("Player 1 and Player 2 are the same.");
		} else {
			System.out.println("Player 1 and Player 2 are not the same.");
		}

		Player player3 = (Player)player2.clone();

		if (player2.equals(player3)) {
			System.out.println("Player 2 and Player 3 are the same.");
		} else {
			System.out.println("Player 2 and Player 3 are not the same.");
		}

		scan.close();
	}
}


text:
import React, {
  ReactElement,
  useCallback,
  useMemo,
  useRef,
  useState,
} from 'react';
import { EditorState } from 'draft-js';
import Editor from '@draft-js-plugins/editor';
import createMentionPlugin, {
  defaultSuggestionsFilter,
} from '@draft-js-plugins/mention';
import editorStyles from './CustomComponentMentionEditor.module.css';
import mentions from './Mentions';

export default function CustomComponentMentionEditor(): ReactElement {
  const ref = useRef<Editor>(null);
  const [editorState, setEditorState] = useState(() =>
    EditorState.createEmpty()
  );
  const [open, setOpen] = useState(false);
  const [suggestions, setSuggestions] = useState(mentions);

  const { MentionSuggestions, plugins } = useMemo(() => {
    const mentionPlugin = createMentionPlugin({
      mentionComponent(mentionProps) {
        return (
          <span
            className={mentionProps.className}
            // eslint-disable-next-line no-alert
            onClick={() => alert('Clicked on the Mention!')}
          >
            {mentionProps.children}
          </span>
        );
      },
    });
    // eslint-disable-next-line no-shadow
    const { MentionSuggestions } = mentionPlugin;
    // eslint-disable-next-line no-shadow
    const plugins = [mentionPlugin];
    return { plugins, MentionSuggestions };
  }, []);

  const onOpenChange = useCallback((_open: boolean) => {
    setOpen(_open);
  }, []);
  const onSearchChange = useCallback(
    ({ trigger, value }: { trigger: string; value: string }) => {
      setSuggestions(defaultSuggestionsFilter(value, mentions, trigger));
    },
    []
  );

  return (
    <div
      className={editorStyles.editor}
      onClick={() => {
        ref.current!.focus();
      }}
    >
      <Editor
        editorKey={'editor'}
        editorState={editorState}
        onChange={setEditorState}
        plugins={plugins}
        ref={ref}
      />
      <MentionSuggestions
        open={open}
        onOpenChange={onOpenChange}
        suggestions={suggestions}
        onSearchChange={onSearchChange}
        onAddMention={() => {
          // get the mention object selected
        }}
      />
    </div>
  );
}


text:
package models.leagues;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import org.joda.time.Days;
import org.joda.time.DurationFieldType;
import org.joda.time.LocalDate;
import com.avaje.ebean.Ebean;
import com.avaje.ebean.Expr;
import com.avaje.ebean.Page;
import com.avaje.ebean.Query;
import play.db.ebean.Model;
import play.db.ebean.Model.Finder;
import forms.LeagueForm;
import views.formdata.teams.TeamForm;
import models.Court;
import models.teams.Team;

@Entity
public class League extends Model{

  /**
   *
   */
  private static final long serialVersionUID = 1L;

  @Id
  private long id;

  private String leagueName;

  private int numTeams;

  private int numTeamsInLeague;

  private String startDate;

  private String endDate;

  private String description;

  //True for public, false for private
  private String pubOrPrivate;

  private int regStep;

  private int numGames;

  @ManyToMany(mappedBy = "leagues", cascade=CascadeType.ALL)
  private List<Team> teams = new ArrayList<>();

  private String dateList = "";

  @ManyToOne
  private Court court;

  private String schedule = "";

  public League(String name){
    this.leagueName = name;
    this.startDate = "";
    this.endDate = "";
    this.numTeams = 0;
    this.description = "";
    this.pubOrPrivate = "public";
    this.numTeamsInLeague = 0;
    this.regStep = 0;
    this.numGames = 0;
  }

  public League(String name, String startDate, String endDate, String pubOrPrivate){
    this.leagueName = name;
    this.startDate = startDate;
    this.endDate = endDate;
    this.numTeams = 0;
    this.description = "";
    this.pubOrPrivate = pubOrPrivate;
    this.numTeamsInLeague = 0;
    this.regStep = 0;
    this.numGames = 0;
  }

  public League(long id, String name, String startDate, String endDate, String pubOrPrivate, int regStep){
    this.id = id;
    this.leagueName = name;
    this.startDate = startDate;
    this.endDate = endDate;
    this.numTeams = 0;
    this.description = "";
    this.pubOrPrivate = pubOrPrivate;
    this.numTeamsInLeague = 0;
    this.regStep = regStep;
    this.numGames = 0;
  }

  public static List<String> typeOfLeague() {
    String[] types = { "public", "private" };
    return java.util.Arrays.asList(types);
  }

  public static Map<Integer, Boolean> num(){
    Map<Integer, Boolean> nums = new TreeMap<Integer, Boolean>();
    for(int i = 1; i < 21; i++){
      nums.put(i, false);
    }
    return nums;
  }

  public static Map<String, Boolean> getTeamMap(){
    Map<String, Boolean> teamMap = new TreeMap<String, Boolean>();
    List<Team> teamList = Team.getTeams();
    for(int i = 0; i < teamList.size(); i++){
      teamMap.put(teamList.get(i).getTeamName(), false);
    }
    return teamMap;
  }

  public static Map<String, Boolean> getCourtMap(){
    Map<String, Boolean> courtMap = new TreeMap<String, Boolean>();
    List<Court> courtList = Court.getCourts();
    for(int i = 0; i < courtList.size(); i++){
      courtMap.put(courtList.get(i).getName(), false);
    }
    return courtMap;
  }

  public static Map<String, Boolean> getDateMap(String startDate, String endDate){
    List<LocalDate> dates = new ArrayList<LocalDate>();
    Map<String, Boolean> dateMap = new TreeMap<String, Boolean>();
    LocalDate startld = new LocalDate(Integer.parseInt(startDate.substring(6)), Integer.parseInt(startDate.substring(0, 2)),
        Integer.parseInt(startDate.substring(3, 5)));
    LocalDate endld = new LocalDate(Integer.parseInt(endDate.substring(6)), Integer.parseInt(endDate.substring(0, 2)),
        Integer.parseInt(endDate.substring(3, 5)));
    int days = Days.daysBetween(startld, endld).getDays();
    for (int i=0; i < days; i++) {
        LocalDate d = startld.withFieldAdded(DurationFieldType.days(), i);
        dateMap.put(d.toString("MM/dd/yyyy"), false);
    }
    return dateMap;
  }

  public Court getCourt() {
    return court;
  }

  public void setCourt(Court court) {
    this.court = court;
  }

  public List<String> getDateList() {
    List<String> dlList = new ArrayList<>();
    String[] s = dateList.split("~");
    for(int i = 0; i < s.length; i++){
      dlList.add(s[i]);
    }
    return dlList;
  }

  public void setDateList(List<String> dateList) {
    this.dateList = "";
    for(int i = 0; i < dateList.size(); i++){
      this.dateList += dateList.get(i) + "~";
    }
  }

  public String getPubOrPrivate() {
    return pubOrPrivate;
  }

  public String getLeagueName(){
    return leagueName;
  }

  public long getId() {
    return id;
  }

  public void setId(long id) {
    this.id = id;
  }

  public int getNumTeams() {
    return numTeams;
  }

  public void setNumTeams(int numTeams) {
    this.numTeams = numTeams;
  }

  public void addNumTeams(int numTeams) {
    numTeams++;
  }

  public String getStartDate() {
    return startDate;
  }

  public void setStartDate(String startDate) {
    this.startDate = startDate;
  }

  public String getEndDate() {
    return endDate;
  }

  public void setEndDate(String endDate) {
    this.endDate = endDate;
  }

  public String getDescription() {
    return description;
  }

  public void setDescription(String description) {
    this.description = description;
  }

  public String isPubOrPrivate() {
    return pubOrPrivate;
  }

  public void setPubOrPrivate(String pubOrPrivate) {
    this.pubOrPrivate = pubOrPrivate;
  }

  public List<Team> getTeams() {
    return teams;
  }

  public int getNumTeamsInLeague() {
    return numTeamsInLeague;
  }

  public void setTeams(List<Team> teams) {
    this.teams = teams;
  }

  public int getRegStep() {
    return regStep;
  }

  public void setRegStep(int regStep) {
    this.regStep = regStep;
  }

  public void setLeagueName(String leagueName) {
    this.leagueName = leagueName;
  }

  public void addTeam(Team team){
    if(!teams.contains(team)){
      numTeamsInLeague++;
      teams.add(team);
    }
  }

  public int getNumGames() {
    return numGames;
  }

  public void setNumGames(int numGames) {
    this.numGames = numGames;
  }

  /**
  public static void addSchedule(LeagueForm lf) {
    League league;

    long id = lf.id;

    if (!isLeague(id)) {
      league = new League(lf.leagueName, id);
      league.save();
    }
    else {
      league = getLeague(id);
      league.setStartDate(lf.startDate);
      league.setEndDate(lf.endDate);
    }
  }
  */

  /**
  private static boolean isLeague(long id2) {
    // TODO Auto-generated method stub
    return false;
  }

  private static League getLeague(long id2) {
    // TODO Auto-generated method stub
    return null;
  }

  private void setEndDate(int endDate) {
    // TODO Auto-generated method stub

  }

  private void setStartDate(int startDate) {
    // TODO Auto-generated method stub

  }
  */

  public static Finder<Long, League> find() {
    return new Finder<Long, League>(Long.class, League.class);
  }

  public static Page<League> find(String sort, int page) {
    return find().where().orderBy(sort).findPagingList(10).setFetchAhead(false).getPage(page);
  }

  public static Page<League> find(String term, String sort, int page) {
    term = "%" + term + "%";
    Query<League> q = Ebean.createQuery(League.class);
    q.where().disjunction().add(Expr.ilike("leagueName", term)).add(Expr.ilike("pubOrPrivate", term))
        .add(Expr.ilike("id", term));
    return q.orderBy(sort).findPagingList(50).setFetchAhead(false).getPage(page);
  }

  public String getSchedule() {
    return schedule;
  }

  public void addOpponent(String date, String team, String opponent){
    schedule += date + "~" + team + "~" + opponent + "~";
  }

  public boolean containsDateTeam(String date, String team){
    String[] s = schedule.split("~");
    for(int i = 0; i < s.length - 1; i++){
      if(s[i].equals(date)){
        if(s[i+1].equals(team) || s[i+2].equals(team)){
          return true;
        }
      }
    }
    return false;
  }

  public List<String> getScheduleList(){

    List<String> sched = new ArrayList<String>();
    System.out.println(schedule);
    String[] s = schedule.split("~");
    for(int i = 0; i < s.length; i+=3){
      if(s.length >= 3){
      sched.add(s[i] + "-" + s[i+1] + "~" + s[i+2]);
      }
    }
    return sched;
  }

  public void eraseSchedule(){
    schedule = "";
  }
}


text:
function savetimestep(g,t,filethread)

% savetimestep -- saves a file called step_'t' which is the stratigraphic data
% at simulation step t. This data comes from the timestep of gridstrat specified
% by 'g', remembering that g comprises only two timesteps.

% Dr David Stolper dstolper@usgs.gov

% Version of 09-Apr-2003 11:51
% Updated    09-Apr-2003 17:00

global gridstrat;

n = int2str(t); while length(n)<4, n = ['0' n]; end
varname = ['step_' n];

filename = ['../Output' num2str(filethread) '/' varname '.mat'];

eval ([varname ' = gridstrat(g,:,:,:,:);'])
save(filename,varname)


text:
from bluebottle.members.models import Member
from django.utils.translation import gettext_lazy as _
from django.urls.base import reverse

from jet.dashboard.modules import DashboardModule

from jet.dashboard import modules
from jet.dashboard.dashboard import DefaultAppIndexDashboard

class RecentMembersDashboard(DashboardModule):
    title = _('Recently joined users')
    title_url = reverse('admin:members_member_changelist')
    template = 'dashboard/recent_members.html'
    limit = 5

    def init_with_context(self, context):
        projects = Member.objects.order_by('-date_joined')
        self.children = projects[:self.limit]

class AppIndexDashboard(DefaultAppIndexDashboard):

    def init_with_context(self, context):
        self.available_children.append(modules.LinkList)
        self.children.append(RecentMembersDashboard())


text:
ruby-2.1.1
===============

Base Ruby 2.1.1 container for octohost.

To use an already built container:

`docker pull octohost/ruby-2.1.1`

Or you can build it from this source:

`docker build -t your-organization/ruby-2.1.1`

NOTE: You can always get the most current ruby 2.1 container this way:

`docker pull octohost/ruby-2.1`


text:
namespace rf {

#define method_parameters_type_prefix "_method_reflectable_parameters_type_"
#define method_return_type_prefix "_method_reflectable_return_type_"

class method_t {

    friend class class_t;

private:

    std::string name_;
    std::string type_name_;
    void *(*ptr)(void*) = nullptr;

    std::string to_string_ = "";
    std::string return_type_ = "";
    std::string parameters_type_ = "";

    method_t() = delete;
    method_t(std::string name, std::string type_name, void *(*ptr)(void*))
    : name_(name), type_name_(type_name), ptr(ptr) {}

public:

    template<typename R = void, class ...P>
    R invoke(object_t &o, P... params) {
        std::function<R(P...)> (*func)(void*) = (std::function<R(P...)> (*)(void*))this->ptr;
        auto fn = func(o.get_ptr());
        return fn(params...);
    }

    std::string &name() {
        return this->name_;
    }

    std::string &type_name() {
        return this->type_name_;
    }

    std::string &to_string() {
        if (this->to_string_ == "") {
            this->to_string_ += this->return_type();
            this->to_string_ += " ";
            this->to_string_ += this->name_;
            this->to_string_ += "(";
            this->to_string_ += this->parameters_type();
            this->to_string_ += ")";
        }

        return this->to_string_;
    }

    std::string &return_type() {
        if (this->return_type_ == "") {
            const char *(*ptr_method)();
            std::string fn_name = method_return_type_prefix;
            fn_name += this->name_;
            fn_name += "_";
            fn_name += this->type_name_;
            ptr_method = priv::dl::get_instance().get_method_to_string(fn_name);
            this->return_type_ = ptr_method();
        }

        return this->return_type_;
    }

    std::string &parameters_type() {
        if (this->parameters_type_ == "") {
            const char *(*ptr_method)();
            std::string fn_name = method_parameters_type_prefix;
            fn_name += this->name_;
            fn_name += "_";
            fn_name += this->type_name_;
            ptr_method = priv::dl::get_instance().get_method_to_string(fn_name);
            this->parameters_type_ = ptr_method();
        }

        return this->parameters_type_;
    }

    bool operator==(method_t &oth) {
        return this->ptr == oth.ptr;
    }

    bool operator!=(method_t &oth) {
        return this->ptr != oth.ptr;
    }

    friend bool operator==(std::nullptr_t nullp, method_t &c);
    friend bool operator==(method_t &c, std::nullptr_t nullp);
    friend bool operator!=(std::nullptr_t nullp, method_t &c);
    friend bool operator!=(method_t &c, std::nullptr_t nullp);

};

bool
operator==(std::nullptr_t nullp, method_t &c) {
    return c.ptr == nullptr;
}

bool
operator==(method_t &c, std::nullptr_t nullp) {
    return c.ptr == nullptr;
}

bool
operator!=(std::nullptr_t nullp, method_t &c) {
    return c.ptr != nullptr;
}

bool
operator!=(method_t &c, std::nullptr_t nullp) {
    return c.ptr != nullptr;
}

}

#endif


text:
using NMF.Collections.Generic;
using NMF.Collections.ObjectModel;
using NMF.Expressions;
using NMF.Expressions.Linq;
using NMF.Models;
using NMF.Models.Collections;
using NMF.Models.Expressions;
using NMF.Models.Meta;
using NMF.Models.Repository;
using NMF.Serialization;
using NMF.Utilities;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using TTC2017.SmartGrids.CIM.IEC61968.Common;
using TTC2017.SmartGrids.CIM.IEC61968.Metering;
using TTC2017.SmartGrids.CIM.IEC61968.PaymentMetering;
using TTC2017.SmartGrids.CIM.IEC61968.Work;
using TTC2017.SmartGrids.CIM.IEC61970.Core;
using TTC2017.SmartGrids.CIM.IEC61970.Informative.InfCustomers;
using TTC2017.SmartGrids.CIM.IEC61970.Informative.InfERPSupport;
using TTC2017.SmartGrids.CIM.IEC61970.Informative.InfOperations;
using TTC2017.SmartGrids.CIM.IEC61970.Informative.InfPaymentMetering;

namespace TTC2017.SmartGrids.CIM.IEC61968.Customers
{

    /// <summary>
    /// The public interface for Customer
    /// </summary>
    [DefaultImplementationTypeAttribute(typeof(Customer))]
    [XmlDefaultImplementationTypeAttribute(typeof(Customer))]
    public interface ICustomer : IModelElement, IOrganisation
    {

        /// <summary>
        /// The kind property
        /// </summary>
        Nullable<CustomerKind> Kind
        {
            get;
            set;
        }

        /// <summary>
        /// The specialNeed property
        /// </summary>
        string SpecialNeed
        {
            get;
            set;
        }

        /// <summary>
        /// The pucNumber property
        /// </summary>
        string PucNumber
        {
            get;
            set;
        }

        /// <summary>
        /// The vip property
        /// </summary>
        bool Vip
        {
            get;
            set;
        }

        /// <summary>
        /// The PlannedOutage property
        /// </summary>
        IPlannedOutage PlannedOutage
        {
            get;
            set;
        }

        /// <summary>
        /// The EndDeviceAssets property
        /// </summary>
        IOrderedSetExpression<IEndDeviceAsset> EndDeviceAssets
        {
            get;
        }

        /// <summary>
        /// The status property
        /// </summary>
        IStatus Status
        {
            get;
            set;
        }

        /// <summary>
        /// The TroubleTickets property
        /// </summary>
        IOrderedSetExpression<ITroubleTicket> TroubleTickets
        {
            get;
        }

        /// <summary>
        /// The ErpPersons property
        /// </summary>
        IOrderedSetExpression<IErpPerson> ErpPersons
        {
            get;
        }

        /// <summary>
        /// The OutageNotifications property
        /// </summary>
        IOrderedSetExpression<IOutageNotification> OutageNotifications
        {
            get;
        }

        /// <summary>
        /// The Works property
        /// </summary>
        IOrderedSetExpression<IWork> Works
        {
            get;
        }

        /// <summary>
        /// The CustomerAgreements property
        /// </summary>
        IOrderedSetExpression<ICustomerAgreement> CustomerAgreements
        {
            get;
        }

        /// <summary>
        /// Gets fired before the Kind property changes its value
        /// </summary>
        event System.EventHandler<ValueChangedEventArgs> KindChanging;

        /// <summary>
        /// Gets fired when the Kind property changed its value
        /// </summary>
        event System.EventHandler<ValueChangedEventArgs> KindChanged;

        /// <summary>
        /// Gets fired before the SpecialNeed property changes its value
        /// </summary>
        event System.EventHandler<ValueChangedEventArgs> SpecialNeedChanging;

        /// <summary>
        /// Gets fired when the SpecialNeed property changed its value
        /// </summary>
        event System.EventHandler<ValueChangedEventArgs> SpecialNeedChanged;

        /// <summary>
        /// Gets fired before the PucNumber property changes its value
        /// </summary>
        event System.EventHandler<ValueChangedEventArgs> PucNumberChanging;

        /// <summary>
        /// Gets fired when the PucNumber property changed its value
        /// </summary>
        event System.EventHandler<ValueChangedEventArgs> PucNumberChanged;

        /// <summary>
        /// Gets fired before the Vip property changes its value
        /// </summary>
        event System.EventHandler<ValueChangedEventArgs> VipChanging;

        /// <summary>
        /// Gets fired when the Vip property changed its value
        /// </summary>
        event System.EventHandler<ValueChangedEventArgs> VipChanged;

        /// <summary>
        /// Gets fired before the PlannedOutage property changes its value
        /// </summary>
        event System.EventHandler<ValueChangedEventArgs> PlannedOutageChanging;

        /// <summary>
        /// Gets fired when the PlannedOutage property changed its value
        /// </summary>
        event System.EventHandler<ValueChangedEventArgs> PlannedOutageChanged;

        /// <summary>
        /// Gets fired before the Status property changes its value
        /// </summary>
        event System.EventHandler<ValueChangedEventArgs> StatusChanging;

        /// <summary>
        /// Gets fired when the Status property changed its value
        /// </summary>
        event System.EventHandler<ValueChangedEventArgs> StatusChanged;
    }
}


text:
/*
  DO NOT EDIT THIS FILE - the content was created using a source code generator
*/

#include "QAudioInputSlots.h"

QAudioInputSlots::QAudioInputSlots( QObject * parent ) : QObject( parent )
{
}

QAudioInputSlots::~QAudioInputSlots()
{
}

void QAudioInputSlots::stateChanged( QAudio::State state )
{
  QObject * object = qobject_cast< QObject * >( sender() );

  PHB_ITEM cb = Qt4xHb::Signals_return_codeblock( object, "stateChanged(QAudio::State)" );

  if( cb )
  {
    PHB_ITEM pSender = Qt4xHb::Signals_return_qobject( object, "QAUDIOINPUT" );
    PHB_ITEM pState = hb_itemPutNI( NULL, static_cast< int >( state ) );

    hb_vmEvalBlockV( cb, 2, pSender, pState );

    hb_itemRelease( pSender );
    hb_itemRelease( pState );
  }
}

void QAudioInputSlots::notify()
{
  QObject * object = qobject_cast< QObject * >( sender() );

  PHB_ITEM cb = Qt4xHb::Signals_return_codeblock( object, "notify()" );

  if( cb )
  {
    PHB_ITEM pSender = Qt4xHb::Signals_return_qobject( object, "QAUDIOINPUT" );

    hb_vmEvalBlockV( cb, 1, pSender );

    hb_itemRelease( pSender );
  }
}

void QAudioInputSlots_connect_signal( const QString & signal, const QString & slot )
{
  QAudioInput * obj = qobject_cast< QAudioInput * >( Qt4xHb::getQObjectPointerFromSelfItem() );

  if( obj )
  {
    QAudioInputSlots * s = QCoreApplication::instance()->findChild<QAudioInputSlots *>();

    if( s == NULL )
    {
      s = new QAudioInputSlots();
      s->moveToThread( QCoreApplication::instance()->thread() );
      s->setParent( QCoreApplication::instance() );
    }

    hb_retl( Qt4xHb::Signals_connection_disconnection( s, signal, slot ) );
  }
  else
  {
    hb_retl( false );
  }
}


text:
namespace HallOfFame.Common.ExtensionMethods
{
    using System;

    public static class ObjectExtensions
    {
        public static T CastTo<T>(this object obj)
        {
            var result = Activator.CreateInstance(typeof(T));
            foreach (var property in obj.GetType().GetProperties())
            {
                try
                {
                    result.GetType().GetProperty(property.Name).SetValue(result, property.GetValue(obj));
                }
                catch
                {
                    continue;
                }
            }

            return (T)result;
        }
    }
}


text:
package org.apache.oodt.cas.resource.exceptions;

/**
 * Created by bugg on 27/10/15.
 */
public class ResourceException extends Exception{

  public ResourceException(String message){
    super(message);
  }

  public ResourceException(String message, Throwable t){
    super(message, t);
  }
}


text:
#include "org_jitsi_impl_neomedia_quicktime_QTFormatDescription.h"

#import <Foundation/NSAutoreleasePool.h>
#import <Foundation/NSGeometry.h>
#import <Foundation/NSString.h>
#import <Foundation/NSValue.h>
#import <QTKit/QTFormatDescription.h>
#include <stdint.h>

JNIEXPORT jobject JNICALL
Java_org_jitsi_impl_neomedia_quicktime_QTFormatDescription_sizeForKey
    (JNIEnv *jniEnv, jclass clazz, jlong ptr, jstring key)
{
    const char *cKey;
    jobject size = NULL;

    cKey = (const char *) (*jniEnv)->GetStringUTFChars(jniEnv, key, NULL);
    if (cKey)
    {
        QTFormatDescription *formatDescription;
        NSAutoreleasePool *autoreleasePool;
        NSString *oKey;
        NSValue *attribute;

        formatDescription = (QTFormatDescription *) (intptr_t) ptr;
        autoreleasePool = [[NSAutoreleasePool alloc] init];

        oKey = [NSString stringWithUTF8String:cKey];
        (*jniEnv)->ReleaseStringUTFChars(jniEnv, key, cKey);

        attribute = [formatDescription attributeForKey:oKey];
        if (attribute)
        {
            NSSize oSize;
            jclass dimensionClass;

            oSize = [attribute sizeValue];

            dimensionClass = (*jniEnv)->FindClass(jniEnv, "java/awt/Dimension");
            if (dimensionClass)
            {
                jmethodID dimensionCtorMethodID;

                dimensionCtorMethodID
                    = (*jniEnv)
                        ->GetMethodID(
                            jniEnv,
                            dimensionClass,
                            "<init>",
                            "(II)V");
                if (dimensionCtorMethodID)
                    size
                        = (*jniEnv)
                            ->NewObject(
                                jniEnv,
                                dimensionClass,
                                dimensionCtorMethodID,
                                (jint) oSize.width,
                                (jint) oSize.height);
            }
        }

        [autoreleasePool release];
    }
    return size;
}

JNIEXPORT jstring JNICALL
Java_org_jitsi_impl_neomedia_quicktime_QTFormatDescription_VideoEncodedPixelsSizeAttribute
    (JNIEnv *jniEnv, jclass clazz)
{
    NSAutoreleasePool *autoreleasePool;
    jstring jstr;

    autoreleasePool = [[NSAutoreleasePool alloc] init];

    jstr
        = (*jniEnv)
            ->NewStringUTF(
                jniEnv,
                [QTFormatDescriptionVideoEncodedPixelsSizeAttribute
                    UTF8String]);

    [autoreleasePool release];
    return jstr;
}


text:
package org.gridkit.jvmtool.cmd;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

import javax.management.MBeanServerConnection;
import javax.management.ObjectName;

import org.gridkit.jvmtool.JmxConnectionInfo;
import org.gridkit.jvmtool.MBeanHelper;
import org.gridkit.jvmtool.SJK;
import org.gridkit.jvmtool.SJK.CmdRef;

import com.beust.jcommander.Parameter;
import com.beust.jcommander.Parameters;
import com.beust.jcommander.ParametersDelegate;

public class MxCmd implements CmdRef {

	@Override
	public String getCommandName() {
		return "mx";
	}

	@Override
	public Runnable newCommand(SJK host) {
		return new MX(host);
	}

	@Parameters(commandDescription = "[MBean] MBean query and invokation")
	public static class MX implements Runnable {

		@ParametersDelegate
		private SJK host;

		@ParametersDelegate
		private JmxConnectionInfo connInfo = new JmxConnectionInfo();

		@Parameter(names={"-b", "--bean"}, required = true, description="MBean name")
		private String mbean;

		@Parameter(names={"-f", "--field", "--attribute"}, description="MBean attribute")
		String attrib = null;

		@ParametersDelegate
		private CallCmd call = new CallCmd();

        @Parameter(names={"-all", "--allMatched"}, description="Process all matched MBeans")
		private boolean all = false;

		@ParametersDelegate
		private GetCmd get = new GetCmd();

		@ParametersDelegate
		private SetCmd set = new SetCmd();

		@ParametersDelegate
		private InfoCmd info = new InfoCmd();

		public MX(SJK host) {
			this.host = host;
		}

		@Override
		public void run() {
			try {
				List<Runnable> action = new ArrayList<Runnable>();
				if (call.run) {
					action.add(call);
				}
				if (get.run) {
					action.add(get);
				}
				if (set.run) {
					action.add(set);
				}
				if (info.run) {
					action.add(info);
				}
				if (action.isEmpty() || action.size() > 1) {
					SJK.failAndPrintUsage("You should choose one of --info, --get, --set, --call");
				}
				action.get(0).run();
			} catch (Exception e) {
				SJK.fail(e.toString(), e);
			}
		}

		private Set<ObjectName> resolveSingleBean(MBeanServerConnection conn) throws Exception {
			ObjectName name = new ObjectName(mbean);
			Set<ObjectName> beans = conn.queryNames(name, null);
			if (beans.isEmpty()) {
				SJK.fail("MBean not found: " + mbean);
			}
            if (!all && beans.size() > 1) {
                StringBuilder sb = new StringBuilder();
                for(ObjectName n: beans) {
                    sb.append('\n').append(n);
                }
                SJK.fail("Ambiguous MBean selection. Use '-all' param for process all matched MBeans" + sb.toString());
			}
			return beans;
		}

		class CallCmd implements Runnable {

			@Parameter(names={"-mc", "--call"}, description="Invokes MBean method")
			boolean run;

			@Parameter(names={"-op", "--operation"}, description="MBean operation name to be called")
			String operation = null;

			@Parameter(names={"-a", "--arguments"}, variableArity=true, description="Arguments for MBean operation invocation")
			List<String> arguments = new ArrayList<String>();

			@Override
			public void run() {
				try {
					if (operation == null) {
						SJK.failAndPrintUsage("MBean operation name is missing");
					}
					MBeanServerConnection conn = connInfo.getMServer();
                    Set<ObjectName> names = resolveSingleBean(conn);
					MBeanHelper helper = new MBeanHelper(conn);
                    for (ObjectName name : names) {
                        System.out.println(name);
                        System.out.println(helper.invoke(name, operation, arguments.toArray(new String[arguments.size()])));
                    }
				} catch (Exception e) {
					SJK.fail(e.toString(), e);
				}
			}
		}

		class GetCmd implements Runnable {

			@Parameter(names={"-mg", "--get"}, description="Retrieves value of MBean attribute")
			boolean run;

			@Override
			public void run() {
				try {
					if (attrib == null) {
						SJK.failAndPrintUsage("MBean operation name is missing");
					}
					MBeanServerConnection conn = connInfo.getMServer();
                    Set<ObjectName> names = resolveSingleBean(conn);
					MBeanHelper helper = new MBeanHelper(conn);
                    for (ObjectName name : names) {
                        System.out.println(name);
					    System.out.println(helper.get(name, attrib));
                    }
				} catch (Exception e) {
					SJK.fail(e.toString(), e);
				}
			}
		}

		class SetCmd implements Runnable {

			@Parameter(names={"-ms", "--set"}, description="Sets value for MBean attribute")
			boolean run;

			@Parameter(names={"-v", "--value"}, description="Value to set to attribute")
			String value = null;

			@Override
			public void run() {
				try {
					if (attrib == null) {
						SJK.failAndPrintUsage("MBean attribute name is missing");
					}
					if (value == null) {
						SJK.failAndPrintUsage("Value is required");
					}
					MBeanServerConnection conn = connInfo.getMServer();
                    Set<ObjectName> names = resolveSingleBean(conn);
					MBeanHelper helper = new MBeanHelper(conn);
                    for (ObjectName name : names) {
                        System.out.println(name);
                        helper.set(name, attrib, value);
                    }
				} catch (Exception e) {
					SJK.fail(e.toString(), e);
				}
			}
		}

		class InfoCmd implements Runnable {

			@Parameter(names={"-mi", "--info"}, description="Display metadata for MBean")
			boolean run;

			@Override
			public void run() {
				try {
					MBeanServerConnection conn = connInfo.getMServer();
					Set<ObjectName> names = resolveSingleBean(conn);
					MBeanHelper helper = new MBeanHelper(conn);
                    for (ObjectName name : names) {
                        System.out.println(helper.describe(name));
                    }
				} catch (Exception e) {
					SJK.fail(e.toString(), e);
				}
			}
		}
	}
}


text:
package cpu

import (
	"fmt"
	"regexp"
	"strconv"
	"strings"

	common "github.com/toorop/telegraf/plugins/system/ps/common"
)

// sys/resource.h
const (
	CPUser    = 0
	CPNice    = 1
	CPSys     = 2
	CPIntr    = 3
	CPIdle    = 4
	CPUStates = 5
)

// time.h
const (
	ClocksPerSec = 128
)

func CPUTimes(percpu bool) ([]CPUTimesStat, error) {
	var ret []CPUTimesStat

	var sysctlCall string
	var ncpu int
	if percpu {
		sysctlCall = "kern.cp_times"
		ncpu, _ = CPUCounts(true)
	} else {
		sysctlCall = "kern.cp_time"
		ncpu = 1
	}

	cpuTimes, err := common.DoSysctrl(sysctlCall)
	if err != nil {
		return ret, err
	}

	for i := 0; i < ncpu; i++ {
		offset := CPUStates * i
		user, err := strconv.ParseFloat(cpuTimes[CPUser+offset], 64)
		if err != nil {
			return ret, err
		}
		nice, err := strconv.ParseFloat(cpuTimes[CPNice+offset], 64)
		if err != nil {
			return ret, err
		}
		sys, err := strconv.ParseFloat(cpuTimes[CPSys+offset], 64)
		if err != nil {
			return ret, err
		}
		idle, err := strconv.ParseFloat(cpuTimes[CPIdle+offset], 64)
		if err != nil {
			return ret, err
		}
		intr, err := strconv.ParseFloat(cpuTimes[CPIntr+offset], 64)
		if err != nil {
			return ret, err
		}

		c := CPUTimesStat{
			User:   float64(user / ClocksPerSec),
			Nice:   float64(nice / ClocksPerSec),
			System: float64(sys / ClocksPerSec),
			Idle:   float64(idle / ClocksPerSec),
			Irq:    float64(intr / ClocksPerSec),
		}
		if !percpu {
			c.CPU = "cpu-total"
		} else {
			c.CPU = fmt.Sprintf("cpu%d", i)
		}

		ret = append(ret, c)
	}

	return ret, nil
}

// Returns only one CPUInfoStat on FreeBSD
func CPUInfo() ([]CPUInfoStat, error) {
	filename := "/var/run/dmesg.boot"
	lines, _ := common.ReadLines(filename)

	var ret []CPUInfoStat

	c := CPUInfoStat{}
	for _, line := range lines {
		if matches := regexp.MustCompile(`CPU:\s+(.+) \(([\d.]+).+\)`).FindStringSubmatch(line); matches != nil {
			c.ModelName = matches[1]
			t, err := strconv.ParseFloat(matches[2], 64)
			if err != nil {
				return ret, nil
			}
			c.Mhz = t
		} else if matches := regexp.MustCompile(`Origin = "(.+)"  Id = (.+)  Family = (.+)  Model = (.+)  Stepping = (.+)`).FindStringSubmatch(line); matches != nil {
			c.VendorID = matches[1]
			c.Family = matches[3]
			c.Model = matches[4]
			t, err := strconv.ParseInt(matches[5], 10, 32)
			if err != nil {
				return ret, nil
			}
			c.Stepping = int32(t)
		} else if matches := regexp.MustCompile(`Features=.+<(.+)>`).FindStringSubmatch(line); matches != nil {
			for _, v := range strings.Split(matches[1], ",") {
				c.Flags = append(c.Flags, strings.ToLower(v))
			}
		} else if matches := regexp.MustCompile(`Features2=[a-f\dx]+<(.+)>`).FindStringSubmatch(line); matches != nil {
			for _, v := range strings.Split(matches[1], ",") {
				c.Flags = append(c.Flags, strings.ToLower(v))
			}
		} else if matches := regexp.MustCompile(`Logical CPUs per core: (\d+)`).FindStringSubmatch(line); matches != nil {
			// FIXME: no this line?
			t, err := strconv.ParseInt(matches[1], 10, 32)
			if err != nil {
				return ret, nil
			}
			c.Cores = int32(t)
		}

	}

	return append(ret, c), nil
}


text:
require_relative '../lib/jira_issue'
require 'json'

describe JiraIssue do
	it "has a key" do
		issue = JiraIssue.new JSON.parse(File.read('spec/jira_search_test.json'))['issues'][0]
		expect(issue.key).to eq("TEST-21")
	end

	it "has a title containing text + url for issue, separated by a *" do
		Settings.instance.hash = {'jira' => {'weburl' => 'https://jira.com/browse' }}
		issue = JiraIssue.new JSON.parse(File.read('spec/jira_search_test.json'))['issues'][0]
		expect(issue.title).to eq("Om jag sparar apelsiner så lagras päron * https://jira.com/browse/TEST-21")
	end

	it "has a status" do
		issue = JiraIssue.new JSON.parse(File.read('spec/jira_search_test.json'))['issues'][0]
		expect(issue.status).to eq("Closed")
	end

	it "has an issuetype" do
		issue = JiraIssue.new JSON.parse(File.read('spec/jira_search_test.json'))['issues'][0]
		expect(issue.issuetype).to eq("Bug")
	end

	it "has labels" do
		issue = JiraIssue.new JSON.parse(File.read('spec/jira_search_test.json'))['issues'][0]
		expect(issue.labels).to include("fruit")
	end

	it "has versions" do
		issue = JiraIssue.new JSON.parse(File.read('spec/jira_search_test.json'))['issues'][0]
		expect(issue.versions).to include("1.0")
	end

	it "has storypoints" do
		Settings.instance.hash =  { 'jira' => { 'config' => { 'storypoints' => 'customfield_10043' }}}
		issue = JiraIssue.new JSON.parse(File.read('spec/jira_search_test.json'))['issues'][0]
		expect(issue.storypoints).to eq(5)
  end

  it "has epic link" do
		Settings.instance.hash =  { 'jira' => { 'config' => { 'epic_link' => 'customfield_10381' }}}
		issue = JiraIssue.new JSON.parse(File.read('spec/jira_search_test.json'))['issues'][0]
		expect(issue.epic_link).to eq("TEST-100")
  end

	it "tells sprint that issue belongs to" do
		Settings.instance.hash =  { 'jira' => { 'config' => { 'sprint' => 'customfield_10270' }}}
		issue = JiraIssue.new JSON.parse(File.read('spec/jira_search_test.json'))['issues'][0]
		expect(issue.sprints).to include("sprint1")
		expect(issue.sprints).to include("sprint including spaces")
		expect(issue.sprints).to_not include("sprint3")
	end

	it "handle issues that do not belong to any sprints" do
		Settings.instance.hash =  { 'jira' => { 'config' => { 'sprint' => 'customfield_10270' }}}
		json = JSON.parse(File.read('spec/jira_search_test.json'))['issues'][0]
		json['fields'][Settings.instance.hash['jira']['config']['sprint']] = nil
		issue = JiraIssue.new json
		expect(issue.sprints).to eq []
	end

	it "can tell if issue should be included" do
		issue = JiraIssue.new JSON.parse(File.read('spec/jira_search_test.json'))['issues'][0]
		expect(issue.should_be_included?).to eq(true)
	end
end


text:
require_relative "./application_record"

class Feed < ApplicationRecord
  has_many :stories, -> { order "published desc" }, dependent: :delete_all
  belongs_to :group

  validates_uniqueness_of :url

  enum status: { green: 0, yellow: 1, red: 2 }

  def status_bubble
    return "yellow" if status == "red" && stories.any?

    status
  end

  def unread_stories
    stories.where("is_read = ?", false)
  end

  def as_fever_json
    {
      id: id,
      favicon_id: 0,
      title: name,
      url: url,
      site_url: url,
      is_spark: 0,
      last_updated_on_time: last_fetched.to_i
    }
  end
end


text:
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>jsdom root-relative script test</title>
        <link rel="stylesheet" href="jsdom.css">
    </head>
    <body>
        <script src="/external_script.js"></script>
    </body>
</html>


text:
<!DOCTYPE HTML>

    <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1">

    <link href="../bootstrap.min.css" rel="stylesheet">

    <link href="../cornerstone.min.css" rel="stylesheet">

            Save Image Example

            This page contains an example of saving the viewport as a PNG

        Go back to the Examples page

                Save Image

            Save as:
            <input id="filename" type="text" value="cornerstone.png">


text:
class CreateCatalogs < ActiveRecord::Migration
  def change
    create_table :store_catalogs do |t|
      t.string :code, null: false
      t.string :name, null: false
      t.string :url

      t.timestamps null: false
    end
  end
end


text:
#if PORTABLE
namespace MathNet.Numerics
{
    using System;
    using System.Threading;
    using System.Collections.Generic;
    using System.Linq;
    using System.Threading.Tasks;

    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct)]
    public class SerializableAttribute : Attribute
    {
    }

    [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
    public class SpecialNameAttribute : Attribute
    {
    }

    internal static class Partitioner
    {
        public static IEnumerable<Tuple<int, int>> Create(int fromInclusive, int toExclusive)
        {
            var rangeSize = Math.Max(1, (toExclusive - fromInclusive) / Control.MaxDegreeOfParallelism);
            return Create(fromInclusive, toExclusive, rangeSize);
        }

        public static IEnumerable<Tuple<int, int>> Create(int fromInclusive, int toExclusive, int rangeSize)
        {
            if (toExclusive <= fromInclusive) throw new ArgumentOutOfRangeException("toExclusive");
            if (rangeSize <= 0) throw new ArgumentOutOfRangeException("rangeSize");
            return CreateRanges(fromInclusive, toExclusive, rangeSize);
        }

        private static IEnumerable<Tuple<int, int>> CreateRanges(int fromInclusive, int toExclusive, int rangeSize)
        {
            bool flag = false;
            int num = fromInclusive;
            while (num < toExclusive && !flag)
            {
                int item = num;
                int num2;
                try
                {
                    num2 = checked(num + rangeSize);
                }
                catch (OverflowException)
                {
                    num2 = toExclusive;
                    flag = true;
                }
                if (num2 > toExclusive)
                {
                    num2 = toExclusive;
                }
                yield return new Tuple<int, int>(item, num2);
                num += rangeSize;
            }
        }
    }

    internal class ParallelOptions
    {
        public TaskScheduler TaskScheduler { get; set; }
        public int MaxDegreeOfParallelism { get; set; }
        public CancellationToken CancellationToken { get; set; }

        public ParallelOptions()
        {
            TaskScheduler = TaskScheduler.Default;
            MaxDegreeOfParallelism = -1;
            CancellationToken = CancellationToken.None;
        }
    }

    internal class ParallelLoopState
    {
    }

    internal static class Parallel
    {
        public static void ForEach<TSource>(IEnumerable<TSource> source, ParallelOptions parallelOptions, Action<TSource> body)
        {
            var chunks = source.ToArray();
            var tasks = new Task[chunks.Length];

            for (var i = 0; i < tasks.Length; i++)
            {
                var chunk = chunks[i];
                tasks[i] = Task.Factory.StartNew(() => body(chunk), parallelOptions.CancellationToken, TaskCreationOptions.None, parallelOptions.TaskScheduler);
            }

            Task.WaitAll(tasks, parallelOptions.CancellationToken);
        }

        public static void Invoke(ParallelOptions parallelOptions, params Action[] actions)
        {
            var tasks = new Task[actions.Length];

            for (var i = 0; i < tasks.Length; i++)
            {
                var action = actions[i];
                if (action == null)
                {
                    throw new ArgumentException(String.Format(Properties.Resources.ArgumentItemNull, "actions"), "actions");
                }

                tasks[i] = Task.Factory.StartNew(action, parallelOptions.CancellationToken, TaskCreationOptions.None, parallelOptions.TaskScheduler);
            }

            Task.WaitAll(tasks, parallelOptions.CancellationToken);
        }

        public static void ForEach<TSource, TLocal>(
            IEnumerable<TSource> source,
            ParallelOptions parallelOptions,
            Func<TLocal> localInit,
            Func<TSource, ParallelLoopState, TLocal, TLocal> body,
            Action<TLocal> localFinally)
        {
            var chunks = source.ToArray();
            var tasks = new Task[chunks.Length];
            var loopState = new ParallelLoopState();

            for (var i = 0; i < tasks.Length; i++)
            {
                var chunk = chunks[i];
                tasks[i] = Task.Factory.StartNew(() =>
                {
                    var local = localInit();
                    local = body(chunk, loopState, local);
                    localFinally(local);
                }, parallelOptions.CancellationToken, TaskCreationOptions.None, parallelOptions.TaskScheduler);
            }

            Task.WaitAll(tasks, parallelOptions.CancellationToken);
        }
    }
}
#endif

#if (PORTABLE || NET35)
namespace MathNet.Numerics
{
    using System;

    [AttributeUsage(AttributeTargets.Constructor | AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
    public class TargetedPatchingOptOutAttribute : Attribute
    {
        public string Reason { get; private set; }

        public TargetedPatchingOptOutAttribute(string reason)
        {
            Reason = reason;
        }
    }
}
#endif

#if NET35
namespace MathNet.Numerics
{
    using System;
    using System.Collections.Concurrent;
    using System.Collections.Generic;

    internal static class ObjectComparer
    {
        internal static int Compare<T>(T a, T b)
        {
            if (ReferenceEquals(a, null)) return -1;
            if (ReferenceEquals(b, null)) return 1;
            if (Equals(a, b)) return 0;
            return Comparer<T>.Default.Compare(a, b);
        }
    }

    public class Tuple<T1, T2> : IComparable, IComparable<Tuple<T1, T2>>
    {
        public T1 Item1 { get; set; }
        public T2 Item2 { get; set; }

        public Tuple(T1 item1, T2 item2)
        {
            Item1 = item1;
            Item2 = item2;
        }

        public int CompareTo(object obj)
        {
            if (obj == null) return 1;
            var other = obj as Tuple<T1, T2>;
            if (other == null) throw new ArgumentException();
            return CompareTo(other);
        }

        public int CompareTo(Tuple<T1, T2> other)
        {
            if (other == null) return 1;
            int a = ObjectComparer.Compare(Item1, other.Item1);
            return a != 0 ? a : ObjectComparer.Compare(Item2, other.Item2);
        }
    }

    public class Tuple<T1, T2, T3> : IComparable, IComparable<Tuple<T1, T2, T3>>
    {
        public T1 Item1 { get; set; }
        public T2 Item2 { get; set; }
        public T3 Item3 { get; set; }

        public Tuple(T1 item1, T2 item2, T3 item3)
        {
            Item1 = item1;
            Item2 = item2;
            Item3 = item3;
        }

        public int CompareTo(object obj)
        {
            if (obj == null) return 1;
            var other = obj as Tuple<T1, T2, T3>;
            if (other == null) throw new ArgumentException();
            return CompareTo(other);
        }

        public int CompareTo(Tuple<T1, T2, T3> other)
        {
            if (other == null) return 1;
            int a = ObjectComparer.Compare(Item1, other.Item1);
            if (a != 0) return a;
            int b = ObjectComparer.Compare(Item2, other.Item2);
            return b != 0 ? b : ObjectComparer.Compare(Item3, other.Item3);
        }
    }

    public class Tuple<T1, T2, T3, T4> : IComparable, IComparable<Tuple<T1, T2, T3, T4>>
    {
        public T1 Item1 { get; set; }
        public T2 Item2 { get; set; }
        public T3 Item3 { get; set; }
        public T4 Item4 { get; set; }

        public Tuple(T1 item1, T2 item2, T3 item3, T4 item4)
        {
            Item1 = item1;
            Item2 = item2;
            Item3 = item3;
            Item4 = item4;
        }

        public int CompareTo(object obj)
        {
            if (obj == null) return 1;
            var other = obj as Tuple<T1, T2, T3, T4>;
            if (other == null) throw new ArgumentException();
            return CompareTo(other);
        }

        public int CompareTo(Tuple<T1, T2, T3, T4> other)
        {
            if (other == null) return 1;
            int a = ObjectComparer.Compare(Item1, other.Item1);
            if (a != 0) return a;
            int b = ObjectComparer.Compare(Item2, other.Item2);
            if (b != 0) return b;
            int c = ObjectComparer.Compare(Item3, other.Item3);
            return c != 0 ? c : ObjectComparer.Compare(Item4, other.Item4);
        }
    }

    public static class EnumerableExtensions
    {
        public static IEnumerable<T> Zip<TA, TB, T>(this IEnumerable<TA> seqA, IEnumerable<TB> seqB, Func<TA, TB, T> func)
        {
            if (seqA == null) throw new ArgumentNullException("seqA");
            if (seqB == null) throw new ArgumentNullException("seqB");

            return Zip35Deferred(seqA, seqB, func);
        }

        private static IEnumerable<T> Zip35Deferred<A, B, T>(IEnumerable<A> seqA, IEnumerable<B> seqB, Func<A, B, T> func)
        {
            using (var iteratorA = seqA.GetEnumerator())
            using (var iteratorB = seqB.GetEnumerator())
            {
                while (iteratorA.MoveNext() && iteratorB.MoveNext())
                {
                    yield return func(iteratorA.Current, iteratorB.Current);
                }
            }
        }
    }

    internal static class Partitioner
    {
        public static OrderablePartitioner<Tuple<int, int>> Create(int fromInclusive, int toExclusive)
        {
            var rangeSize = Math.Max(1, (toExclusive - fromInclusive) / Control.MaxDegreeOfParallelism);
            return Create(fromInclusive, toExclusive, rangeSize);
        }

        public static OrderablePartitioner<Tuple<int, int>> Create(int fromInclusive, int toExclusive, int rangeSize)
        {
            if (toExclusive <= fromInclusive) throw new ArgumentOutOfRangeException("toExclusive");
            if (rangeSize <= 0) throw new ArgumentOutOfRangeException("rangeSize");
            return System.Collections.Concurrent.Partitioner.Create(CreateRanges(fromInclusive, toExclusive, rangeSize));
        }

        private static IEnumerable<Tuple<int, int>> CreateRanges(int fromInclusive, int toExclusive, int rangeSize)
        {
            bool flag = false;
            int num = fromInclusive;
            while (num < toExclusive && !flag)
            {
                int item = num;
                int num2;
                try
                {
                    num2 = checked(num + rangeSize);
                }
                catch (OverflowException)
                {
                    num2 = toExclusive;
                    flag = true;
                }
                if (num2 > toExclusive)
                {
                    num2 = toExclusive;
                }
                yield return new Tuple<int, int>(item, num2);
                num += rangeSize;
            }
        }
    }
}
#endif


text:
using System;
using Corund.Engine;
using Corund.Geometry;
using Corund.Tools.Helpers;
using Corund.Tools.Render;
using Corund.Visuals.Primitives;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input.Touch;

namespace Corund.Visuals.UI;

/// <summary>
/// Base class for window-like views that allow scrolling the contents.
/// </summary>
public abstract class ScrollViewBase: InteractiveObject, IView
{
    #region Constants

    /// <summary>
    /// Minimum squared distance to drag before activating scroll mode.
    /// </summary>
    protected const float MIN_CAPTURE_DISTANCE = 10;

    #endregion

    #region Constructor

    public ScrollViewBase(int width, int height, ScrollDirection dir)
    {
        if(width <= 0)
            throw new ArgumentOutOfRangeException(nameof(width), "View width must be at least 1");

        if (height <= 0)
            throw new ArgumentOutOfRangeException(nameof(height), "View height must be at least 1");

        ViewSize = new Vector2(width, height);
        _viewRect = new GeometryRect(0, 0, width, height);
        _direction = dir;
    }

    #endregion

    #region Fields

    protected readonly ScrollDirection _direction;
    protected readonly GeometryRect _viewRect;

    protected ObjectBase _content;
    protected bool _isCaptured;
    protected bool _isDisabled;
    protected Vector2 _contentSize;
    protected Vector2? _origPosition;
    protected TouchLocation? _origTouch;
    protected TouchLocation? _prevTouch;

    #endregion

    #region Properties

    /// <summary>
    /// Size of the window.
    /// </summary>
    public readonly Vector2 ViewSize;

    /// <summary>
    /// Geometry.
    /// </summary>
    public override IGeometry Geometry => _viewRect;

    /// <summary>
    /// Size of the content.
    /// </summary>
    public Vector2 ContentSize => _contentSize;

    #endregion

    #region IView implementation

    /// <summary>
    /// Checks if the point in inside the view.
    /// </summary>
    public bool IsPointInView(Vector2 point)
    {
        var transform = GetTransformInfo(true);
        return Geometry.ContainsPoint(point, transform);
    }

    #endregion

    #region Drawing

    protected override void DrawInternal()
    {
        if (_content == null)
            return;

        using (var rt = GameEngine.Render.LeaseRenderTarget())
        {
            using (new RenderContext(rt.RenderTarget, Color.Transparent))
                _content.Draw();

            GameEngine.Render.TryBeginBatch(BlendState.AlphaBlend);
            var z = GameEngine.Current.ZOrderFunction(this);
            var tf = GetTransformInfo(true);
            var box = _viewRect.GetBoundingBox(tf);
            var tint = GetMixedTintColor();
            GameEngine.Render.SpriteBatch.Draw(
                rt.RenderTarget,
                tf.Position,
                box,
                tint,
                0,
                Vector2.Zero,
                tf.ScaleVector,
                SpriteEffects.None,
                z
            );
        }
    }

    #endregion

    #region Scrolling core

    public override void Update()
    {
        if (_content == null)
        {
            base.Update();
            return;
        }

        var t = this.TryGetTouch(true);
        if (t is TouchLocation touch && !_isDisabled)
        {
            if (_origTouch == null)
            {
                OnTouchPressed(touch);

                _origTouch = t;
                _origPosition = _content.Position;
            }
            else
            {
                if (touch.State == TouchLocationState.Moved)
                {
                    OnTouchMoved(touch);
                }
                else if (touch.State == TouchLocationState.Released)
                {
                    OnTouchReleased(touch);

                    _origTouch = null;
                    _origPosition = null;
                    _isCaptured = false;

                    GameEngine.Defer(() => GameEngine.Touch.Release(touch));
                }
            }
        }
        else
        {
            _origTouch = null;
            _origPosition = null;
            _isCaptured = false;
        }

        _prevTouch = t;

        base.Update();
        _content.Update();
    }

    /// <summary>
    /// Handles the first touch to this scroll view.
    /// </summary>
    protected virtual void OnTouchPressed(TouchLocation touch)
    {

    }

    /// <summary>
    /// Handles touch moving.
    /// </summary>
    protected virtual void OnTouchMoved(TouchLocation touch)
    {
        var rawOffset = LimitDirection(touch.Position - _origTouch.Value.Position);
        if (_isCaptured)
        {
            // freely move object with direction limit
            var offset = LimitOffset(_origPosition.Value, rawOffset);
            _content.Position = _origPosition.Value + offset;
        }
        else if (rawOffset.LengthSquared() >= MIN_CAPTURE_DISTANCE)
        {
            _isCaptured = true;
            GameEngine.Touch.Capture(touch, this);
        }
    }

    /// <summary>
    /// Handles the touch release.
    /// </summary>
    protected virtual void OnTouchReleased(TouchLocation touch)
    {

    }

    #endregion

    #region Private helpers

    /// <summary>
    /// Applies the offset with limits to avoid overscrolling.
    /// </summary>
    protected Vector2 LimitOffset(Vector2 orig, Vector2 offset)
    {
        var topLeft = orig + offset;
        var bottomRight = topLeft + _contentSize;

        if (topLeft.X > 0)
            offset.X -= topLeft.X;
        else if (bottomRight.X < ViewSize.X)
            offset.X += (ViewSize.X - bottomRight.X);

        if (topLeft.Y > 0)
            offset.Y -= topLeft.Y;
        else if (bottomRight.Y < ViewSize.Y)
            offset.Y += (ViewSize.Y - bottomRight.Y);

        return offset;
    }

    /// <summary>
    /// Limits the vector according to the allowed scroll direction.
    /// </summary>
    protected Vector2 LimitDirection(Vector2 vector)
    {
        if (_direction == ScrollDirection.Horizontal)
            return new Vector2(vector.X, 0);

        if (_direction == ScrollDirection.Vertical)
            return new Vector2(0, vector.Y);

        return vector;
    }

    /// <summary>
    /// Returns the content size, taking the entire view if it is smaller.
    /// </summary>
    protected Vector2 GetContentSize(ObjectBase obj)
    {
        var objSize = (obj as IGeometryObject)?.Geometry.GetBoundingBox(null).GetSize() ?? Vector2.Zero;

        if (objSize.X < ViewSize.X)
            objSize.X = ViewSize.X;

        if (objSize.Y < ViewSize.Y)
            objSize.Y = ViewSize.Y;

        return objSize;
    }

    #endregion
}


text:
Ti=CONTINUED SUPPLY AND OBSOLESCENCE

1.Ti=Continued availability

1.0.sec=Supplier shall supply to Customer:

1.1.sec=Products until the end of a period of {ten years} after the first delivery to Customer of such Product; and

1.2.sec=Spare Parts until the end of a period of {ten years} after the last delivery to Customer of such Spare Parts.

1.=[Z/ol/s2]

2.Ti=Discontinuation, last-time order, and continued form and fit

2.0.sec=If Supplier anticipates that it cannot meet its obligations pursuant to Section 14.1 or decides after the periods indicated in Section 14.1 to discontinue the sale of a Product or Spare Parts, Supplier shall notify Customer in writing as soon as possible but in no event at less than {12 months} prior notice. During such period:

2.1.sec=Supplier shall (i) enable Customer to make a last time purchase of the Products or Spare Parts and (ii) accept all Purchase Orders, in each case at delivery times and terms and conditions no less favourable to Customer than this Agreement; and

2.2.sec=Supplier shall redesign a form, fit and function compatible alternative at no charge to Customer, unless the Product or Spare Part has been developed by Customer or has been prescribed by Customer, in which case Supplier shall cooperate with Customer in redesigning a form, fit and function compatible alternative for the Product or Spare Parts or manufacture the redesigned Product or Spare Part at the cost of Customer under reasonable conditions.

2.=[Z/ol/s2]

=[Z/ol/2]


text:
$packageName = 'stunnel'
$url = 'https://www.stunnel.org/downloads/archive/5.x/stunnel-5.14-installer.exe'
$checksum = 'c9f5e982663879ac67603d7ad53dd5b27e16bf4b'
$checksumType = 'sha1'
$installerType = 'exe'
$silentArgs = '/S'
$validExitCodes = @(0)

Install-ChocolateyPackage -PackageName "$packageName" `
                          -FileType "$installerType" `
                          -SilentArgs "$silentArgs" `
                          -Url "$url" `
                          -ValidExitCodes $validExitCodes `
                          -Checksum "$checksum" `
                          -ChecksumType "$checksumType"


text:
/**
Code made by Raizunne as a part of Raizunne's Miscellany
Source code found at github.com/Raizunne
 */
package com.raizunne.miscellany.block;

import java.util.Random;

import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;

import com.raizunne.miscellany.MiscItems;
import com.raizunne.miscellany.Miscellany;
import com.raizunne.miscellany.tileentities.TileEntityHeart;

public class Heart extends BlockContainer{

	public Heart(Material material) {
		super(material);
		setBlockName("hearthealer");
		setCreativeTab(Miscellany.miscTab);
		setBlockTextureName("miscellany:heartColor");
		setHarvestLevel("pickaxe", 0);
		setHardness(1.0F);
		setBlockBounds(0.29F, 0F, 0.32F, 0.68F, 0.875F, 0.71F);
	}

	@Override
	public void updateTick(World world, int x, int y, int z, Random random) {

	}

	@Override
	public void randomDisplayTick(World world, int x, int y, int z, Random random) {
		int r = random.nextInt(15);
//		System.out.println(r);
		EntityPlayer player = world.getClosestPlayer((double)x, (double)y, (double)z, 3);
		if(player!=null){
			double i = random.nextDouble();
			double n = random.nextDouble();
			world.spawnParticle("heart", (double)player.posX+i-n, (double)player.posY-1.5+i-n, (double)player.posZ+i-n, 0.0D, 1.0D, 0.0D);
		}
		if((r==4 || r==5) && player!=null){
			if(player.shouldHeal()){
				if(!player.worldObj.isRemote){player.setHealth(player.getHealth()+1);}
				System.out.println("HEALED 1");
				player.playSound("mob.wither.shoot", 1F, 2F);
			}
		}
		if(r==1 && player!=null){
			if(player.shouldHeal()){
				if(!player.worldObj.isRemote){player.setHealth(player.getHealth()+2);}
				System.out.println("HEALED 2");
				player.playSound("mob.wither.shoot", 1F, 2F);
			}
		}
	}

	@Override
	public void onBlockAdded(World world, int x, int y, int z) {
		super.onBlockAdded(world, x, y, z);
	}

	@Override
	public TileEntity createNewTileEntity(World world, int i) {
		return new TileEntityHeart();
	}

	@Override
	public boolean isOpaqueCube(){
		return false;
	}

	@Override
	public boolean renderAsNormalBlock() {
		return false;
	}

	@Override
	public int getRenderType() {
		return -1;
	}

}


text:
using base::kNullThreadHandle;
using base::PlatformThread;
using base::PlatformThreadHandle;
using base::TimeDelta;

namespace rlz_lib {

// Basic test to make sure that Acquire()/Release() don't crash.
class BasicLockTestThread : public PlatformThread::Delegate {
 public:
  BasicLockTestThread(RecursiveLock* lock) : lock_(lock), acquired_(0) {}

  virtual void ThreadMain() OVERRIDE {
    for (int i = 0; i < 10; i++) {
      lock_->Acquire();
      acquired_++;
      lock_->Release();
    }
    for (int i = 0; i < 10; i++) {
      lock_->Acquire();
      acquired_++;
      PlatformThread::Sleep(TimeDelta::FromMilliseconds(rand() % 20));
      lock_->Release();
    }
  }

  int acquired() const { return acquired_; }

 private:
  RecursiveLock* lock_;
  int acquired_;

  DISALLOW_COPY_AND_ASSIGN(BasicLockTestThread);
};

TEST(RecursiveLockTest, Basic) {
  RecursiveLock lock;
  BasicLockTestThread thread(&lock);
  PlatformThreadHandle handle = kNullThreadHandle;

  ASSERT_TRUE(PlatformThread::Create(0, &thread, &handle));

  int acquired = 0;
  for (int i = 0; i < 5; i++) {
    lock.Acquire();
    acquired++;
    lock.Release();
  }
  for (int i = 0; i < 10; i++) {
    lock.Acquire();
    acquired++;
    PlatformThread::Sleep(TimeDelta::FromMilliseconds(rand() % 20));
    lock.Release();
  }
  for (int i = 0; i < 5; i++) {
    lock.Acquire();
    acquired++;
    PlatformThread::Sleep(TimeDelta::FromMilliseconds(rand() % 20));
    lock.Release();
  }

  PlatformThread::Join(handle);

  EXPECT_EQ(acquired, 20);
  EXPECT_EQ(thread.acquired(), 20);
}

// Tests that locks are actually exclusive.
class MutexLockTestThread : public PlatformThread::Delegate {
 public:
  MutexLockTestThread(RecursiveLock* lock, int* value)
      : lock_(lock),
        value_(value) {
  }

  // Static helper which can also be called from the main thread.
  static void DoStuff(RecursiveLock* lock, int* value) {
    for (int i = 0; i < 40; i++) {
      lock->Acquire();
      int v = *value;
      PlatformThread::Sleep(TimeDelta::FromMilliseconds(rand() % 10));
      *value = v + 1;
      lock->Release();
    }
  }

  virtual void ThreadMain() OVERRIDE {
    DoStuff(lock_, value_);
  }

 private:
  RecursiveLock* lock_;
  int* value_;

  DISALLOW_COPY_AND_ASSIGN(MutexLockTestThread);
};

TEST(RecursiveLockTest, MutexTwoThreads) {
  RecursiveLock lock;
  int value = 0;

  MutexLockTestThread thread(&lock, &value);
  PlatformThreadHandle handle = kNullThreadHandle;

  ASSERT_TRUE(PlatformThread::Create(0, &thread, &handle));

  MutexLockTestThread::DoStuff(&lock, &value);

  PlatformThread::Join(handle);

  EXPECT_EQ(2 * 40, value);
}

TEST(RecursiveLockTest, MutexFourThreads) {
  RecursiveLock lock;
  int value = 0;

  MutexLockTestThread thread1(&lock, &value);
  MutexLockTestThread thread2(&lock, &value);
  MutexLockTestThread thread3(&lock, &value);
  PlatformThreadHandle handle1 = kNullThreadHandle;
  PlatformThreadHandle handle2 = kNullThreadHandle;
  PlatformThreadHandle handle3 = kNullThreadHandle;

  ASSERT_TRUE(PlatformThread::Create(0, &thread1, &handle1));
  ASSERT_TRUE(PlatformThread::Create(0, &thread2, &handle2));
  ASSERT_TRUE(PlatformThread::Create(0, &thread3, &handle3));

  MutexLockTestThread::DoStuff(&lock, &value);

  PlatformThread::Join(handle1);
  PlatformThread::Join(handle2);
  PlatformThread::Join(handle3);

  EXPECT_EQ(4 * 40, value);
}

// Tests that locks are recursive.
class MutexRecursiveLockTestThread : public PlatformThread::Delegate {
 public:
  MutexRecursiveLockTestThread(RecursiveLock* lock, int* value)
      : lock_(lock),
        value_(value) {
  }

  // Static helper which can also be called from the main thread.
  static void DoStuff(RecursiveLock* lock, int* value) {
    for (int i = 0; i < 20; i++) {
      // First lock.
      lock->Acquire();
      int v = *value;
      PlatformThread::Sleep(TimeDelta::FromMilliseconds(rand() % 10));
      *value = v + 1;
      {
        // Recursive lock.
        lock->Acquire();
        int v = *value;
        PlatformThread::Sleep(TimeDelta::FromMilliseconds(rand() % 10));
        *value = v + 1;
        lock->Release();
      }
      v = *value;
      PlatformThread::Sleep(TimeDelta::FromMilliseconds(rand() % 10));
      *value = v + 1;
      lock->Release();
    }
  }

  virtual void ThreadMain() OVERRIDE {
    DoStuff(lock_, value_);
  }

 private:
  RecursiveLock* lock_;
  int* value_;

  DISALLOW_COPY_AND_ASSIGN(MutexRecursiveLockTestThread);
};

TEST(RecursiveLockTest, MutexTwoThreadsRecursive) {
  RecursiveLock lock;
  int value = 0;

  MutexRecursiveLockTestThread thread(&lock, &value);
  PlatformThreadHandle handle = kNullThreadHandle;

  ASSERT_TRUE(PlatformThread::Create(0, &thread, &handle));

  MutexRecursiveLockTestThread::DoStuff(&lock, &value);

  PlatformThread::Join(handle);

  EXPECT_EQ(2 * 60, value);
}

TEST(RecursiveLockTest, MutexFourThreadsRecursive) {
  RecursiveLock lock;
  int value = 0;

  MutexRecursiveLockTestThread thread1(&lock, &value);
  MutexRecursiveLockTestThread thread2(&lock, &value);
  MutexRecursiveLockTestThread thread3(&lock, &value);
  PlatformThreadHandle handle1 = kNullThreadHandle;
  PlatformThreadHandle handle2 = kNullThreadHandle;
  PlatformThreadHandle handle3 = kNullThreadHandle;

  ASSERT_TRUE(PlatformThread::Create(0, &thread1, &handle1));
  ASSERT_TRUE(PlatformThread::Create(0, &thread2, &handle2));
  ASSERT_TRUE(PlatformThread::Create(0, &thread3, &handle3));

  MutexRecursiveLockTestThread::DoStuff(&lock, &value);

  PlatformThread::Join(handle1);
  PlatformThread::Join(handle2);
  PlatformThread::Join(handle3);

  EXPECT_EQ(4 * 60, value);
}

}  // namespace rlz_lib


text:
package com.kikijiki.isobako;

import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.view.LayoutInflater;
import android.view.View;

import com.larswerkman.holocolorpicker.ColorPicker;
import com.larswerkman.holocolorpicker.OpacityBar;
import com.larswerkman.holocolorpicker.SVBar;

public class ColorPickerDialog {
    private AlertDialog dialog;
    private ColorPickerListener listener;
    private ColorPicker picker;
    public ColorPickerDialog(Context context, int color, ColorPickerListener listener) {
        this.listener = listener;
        View view = LayoutInflater.from(context).inflate(R.layout.activity_color_picker, null);
        picker = (ColorPicker) view.findViewById(R.id.picker);
        picker.setColor(color);
        picker.setOldCenterColor(color);
        picker.setShowOldCenterColor(true);

        SVBar svBar = (SVBar) view.findViewById(R.id.svbar);
        OpacityBar opacityBar = (OpacityBar) view.findViewById(R.id.opacitybar);
        picker.addSVBar(svBar);
        picker.addOpacityBar(opacityBar);

        dialog = new AlertDialog.Builder(context)
                .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialogInterface, int i) {
                        ColorPickerDialog.this.listener.onOk(ColorPickerDialog.this, picker.getColor());
                    }
                })
                .create();
        dialog.setView(view);
    }

    public void show() {
        dialog.show();
    }

    public interface ColorPickerListener {
        void onCancel(ColorPickerDialog dialog);

        void onOk(ColorPickerDialog dialog, int color);
    }
}


text:
require 'test_helper'

class AgreementsControllerTest < ActionDispatch::IntegrationTest
  setup do
    @agreement = agreements(:one)
  end

  test "should get index" do
    get agreements_url
    assert_response :success
  end

  test "should get new" do
    get new_agreement_url
    assert_response :success
  end

  test "should create agreement" do
    assert_difference('Agreement.count') do
      post agreements_url, params: { agreement: { description: @agreement.description, name: @agreement.name } }
    end

    assert_redirected_to agreement_url(Agreement.last)
  end

  test "should show agreement" do
    get agreement_url(@agreement)
    assert_response :success
  end

  test "should get edit" do
    get edit_agreement_url(@agreement)
    assert_response :success
  end

  test "should update agreement" do
    patch agreement_url(@agreement), params: { agreement: { description: @agreement.description, name: @agreement.name } }
    assert_redirected_to agreement_url(@agreement)
  end

  test "should destroy agreement" do
    assert_difference('Agreement.count', -1) do
      delete agreement_url(@agreement)
    end

    assert_redirected_to agreements_url
  end
end


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

<title>Application (storageroom API)</title>
<meta name="date" content="2013-01-31">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

com.storageroomapp.client

Class Application

java.lang.Object

com.storageroomapp.client.Application

public class Application
extends java.lang.Object

Application is the parent object to all interaction within the Java StorageRoom API.

 To start working with StorageRoom, you must call getInstance() with your application
 name.

Field Summary

Fields

Modifier and Type
Field and Description

protected AccountInfo
accountInfo

protected static java.util.Map<java.lang.String,Application>
apps

protected Collections
collections

Method Summary

Methods

Modifier and Type
Method and Description

boolean
connect(java.lang.String accountId,
       java.lang.String authToken,
       boolean useCache)

Makes a live call to the StorageRoom API.

java.lang.String
getAccountId()

Returns the accountId of this application.

AccountInfo
getAccountInfo(boolean useCache)

Returns the AccountInfo returned during connect()

java.lang.String
getAuthToken()

Returns the authToken used by this application.

Collections
getCollections(boolean useCache)

Retrieves the list of Collections visible to this
 Application for this Account.

static Application
getInstance(java.lang.String name)

Obtains an instance of Application to start working with the API.

java.lang.String
getName()

Returns the name of this application as reported by the StorageRoom
 API.

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

apps

protected static java.util.Map<java.lang.String,Application> apps

accountInfo

protected AccountInfo accountInfo

collections

protected Collections collections

Method Detail

getInstance

public static Application getInstance(java.lang.String name)

Obtains an instance of Application to start working with the API. The
 passed name should match the name you gave your application in the
 StorageRoom UI.

 It is fully supported to use two different StorageRoom application
 keys at the same time using this library. Simply use distinct names
 when calling getInstance().

 Note, if this application has been retrieved previously, and connected,
 the returned object here will be in the connected state.

Parameters:

name - the String name of the application

Returns:

an Application object which may or may not be connected depending
 if the Application has been used before in this JVM

getName

public java.lang.String getName()

Returns the name of this application as reported by the StorageRoom
 API.

Returns:

the String name, or null if this Application has never connected

getAccountId

public java.lang.String getAccountId()

Returns the accountId of this application.

Returns:

the String id, or null if this Application has never connected

getAuthToken

public java.lang.String getAuthToken()

Returns the authToken used by this application.

Returns:

the String token, or null if this Application has never connected

getAccountInfo

public AccountInfo getAccountInfo(boolean useCache)

Returns the AccountInfo returned during connect()

Parameters:

useCache - if false, the call will always trigger a connect() call

Returns:

the AccountInfo object, or null if it cannot be obtained

connect

public boolean connect(java.lang.String accountId,
              java.lang.String authToken,
              boolean useCache)

Makes a live call to the StorageRoom API. This will populate the
 AccountInfo object associated with this Application, but only if
 the passed accountId+authToken pair are valid, and only if the
 StorageRoom API is network accessible.

 SERVER ROUND TRIP: this is a live API call

Parameters:

accountId - the String accountId as provided by the SR GUI

authToken - the String accountToken as provided by the SR GUI

useCache - if false, the SR API call will be made even if already
 connected

Returns:

true if the connect() attempt succeeded, false if not

getCollections

public Collections getCollections(boolean useCache)

Retrieves the list of Collections visible to this
 Application for this Account.

Parameters:

useCache - if false, the SR API call will be made even if the collections
 are already cached

Returns:

the Collections object or null if a failure occurred

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
<?php namespace Illuminate\Database\Migrations;

use Closure;
use Illuminate\Filesystem\Filesystem;

class MigrationCreator {

	/**
	 * The filesystem instance.
	 *
	 * @var \Illuminate\Filesystem\Filesystem
	 */
	protected $files;

	/**
	 * The registered post create hooks.
	 *
	 * @var array
	 */
	protected $postCreate = [];

	/**
	 * Create a new migration creator instance.
	 *
	 * @param  \Illuminate\Filesystem\Filesystem  $files
	 * @return void
	 */
	public function __construct(Filesystem $files)
	{
		$this->files = $files;
	}

	/**
	 * Create a new migration at the given path.
	 *
	 * @param  string  $name
	 * @param  string  $path
	 * @param  string  $table
	 * @param  bool    $create
	 * @return string
	 */
	public function create($name, $path, $table = null, $create = false)
	{
		$path = $this->getPath($name, $path);

		// First we will get the stub file for the migration, which serves as a type
		// of template for the migration. Once we have those we will populate the
		// various place-holders, save the file, and run the post create event.
		$stub = $this->getStub($table, $create);

		$this->files->put($path, $this->populateStub($name, $stub, $table));

		$this->firePostCreateHooks();

		return $path;
	}

	/**
	 * Get the migration stub file.
	 *
	 * @param  string  $table
	 * @param  bool    $create
	 * @return string
	 */
	protected function getStub($table, $create)
	{
		if (is_null($table))
		{
			return $this->files->get($this->getStubPath().'/blank.stub');
		}

		// We also have stubs for creating new tables and modifying existing tables
		// to save the developer some typing when they are creating a new tables
		// or modifying existing tables. We'll grab the appropriate stub here.
		else
		{
			$stub = $create ? 'create.stub' : 'update.stub';

			return $this->files->get($this->getStubPath()."/{$stub}");
		}
	}

	/**
	 * Populate the place-holders in the migration stub.
	 *
	 * @param  string  $name
	 * @param  string  $stub
	 * @param  string  $table
	 * @return string
	 */
	protected function populateStub($name, $stub, $table)
	{
		$stub = str_replace('{{class}}', $this->getClassName($name), $stub);

		// Here we will replace the table place-holders with the table specified by
		// the developer, which is useful for quickly creating a tables creation
		// or update migration from the console instead of typing it manually.
		if ( ! is_null($table))
		{
			$stub = str_replace('{{table}}', $table, $stub);
		}

		return $stub;
	}

	/**
	 * Get the class name of a migration name.
	 *
	 * @param  string  $name
	 * @return string
	 */
	protected function getClassName($name)
	{
		return studly_case($name);
	}

	/**
	 * Fire the registered post create hooks.
	 *
	 * @return void
	 */
	protected function firePostCreateHooks()
	{
		foreach ($this->postCreate as $callback)
		{
			call_user_func($callback);
		}
	}

	/**
	 * Register a post migration create hook.
	 *
	 * @param  \Closure  $callback
	 * @return void
	 */
	public function afterCreate(Closure $callback)
	{
		$this->postCreate[] = $callback;
	}

	/**
	 * Get the full path name to the migration.
	 *
	 * @param  string  $name
	 * @param  string  $path
	 * @return string
	 */
	protected function getPath($name, $path)
	{
		return $path.'/'.$this->getDatePrefix().'_'.$name.'.php';
	}

	/**
	 * Get the date prefix for the migration.
	 *
	 * @return string
	 */
	protected function getDatePrefix()
	{
		return date('Y_m_d_His');
	}

	/**
	 * Get the path to the stubs.
	 *
	 * @return string
	 */
	public function getStubPath()
	{
		return __DIR__.'/stubs';
	}

	/**
	 * Get the filesystem instance.
	 *
	 * @return \Illuminate\Filesystem\Filesystem
	 */
	public function getFilesystem()
	{
		return $this->files;
	}

}


text:
/* ###
 * IP: GHIDRA
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package functioncalls.plugin;

import java.util.*;

import ghidra.program.model.FunctionTestDouble;
import ghidra.program.model.address.Address;
import ghidra.program.model.listing.Function;
import ghidra.util.task.TaskMonitor;

/**
 * A fake function double for use in testing the {@link FunctionCallGraphPlugin}
 */
public class FcgFunction extends FunctionTestDouble {

	private Set<Function> calledFunctions = new HashSet<>();
	private Set<Function> callingFunctions = new HashSet<>();
	private Address entry;

	public FcgFunction(String name, Address entry) {
		super(name);
		this.entry = entry;
	}

	public void addCalledFunction(Function f) {
		calledFunctions.add(f);
	}

	public void addCallerFunction(Function f) {
		callingFunctions.add(f);
	}

	@Override
	public Address getEntryPoint() {
		return entry;
	}

	@Override
	public Set<Function> getCalledFunctions(TaskMonitor monitor) {
		return Collections.unmodifiableSet(calledFunctions);
	}

	@Override
	public Set<Function> getCallingFunctions(TaskMonitor monitor) {
		return Collections.unmodifiableSet(callingFunctions);
	}

	@Override
	public String toString() {
		return super.toString() + " @ " + getEntryPoint().getOffset();
	}
}


text:
Simple issue tracking that incorporates a kanaban board. The hole thing contained in one single html file.

![bugs.html](/doc/bugs-html.png)

### Overview

bugs.html is a simple one file html application that can be used to track issues for your development project.
It has no dependencies since all the required tools are bundled inside this one file. It can easily be dropped into
the doc folder of your repository and then in this way be tracked by your source control tool along with your project's
code.

### Usage

Download the latest version from [here](https://raw.github.com/carlosblanco/bugs.html/master/bugs.html). Open it in your
favorite text editor and prove a title for your project by setting the value for the title variable. You can also
provide a logo image by settting the value of the logo variable to the base64 encoding of your image.

    <script>
     var logo ;//= "Your org's logo image base64 encoded"
     var title;//= "Your project name";
     var tasks;// = []

    </script>

You can then drag tasks around and drop them into one of the available development states. If you want to edit,
add or remove tasks, click on the "Data" button on the top right corner. Then you can:

* Click on the New Task button to clear the input boxes and generate a new ID automatically so you can create a new task.
* Click on a task from the list of tasks and then save it with the same ID to update it.
* Double click on a task from the list of tasks to delete them.
* Group taks into projects and milestones by typing the same value in the Project or Milestone text box.
* Vissually differentiate on the Kanban board between Defects and Improvements.
* Vissually notice the completion of your project/milestone with the progress bar on the top right corner.

### Storing Data

bugs.html has two modes for storing data. The way to select what storage method to use is to set or not the value for
the tasks variable located at the top of the file. If the tasks variable is not defined then Automatic Mode will
be enabled (this mode is still beta but works for simple projects with short durations). Manual Mode will be enabled
if the tasks variable has a value set.

* *Manual Mode* is excelent for tracking your bugs inside your source control system.
Just drop bugs.html file inside your repository and use it. Then once you're done click the "Get Data" button, copy the
content of the dialog by clicking CTRL+C and then replace the data for the tasks variable in the HTML file with the data
you just copied. You bugs will be tracked inside you repo. Excelent for simple projects that don't need a bug trcking software
which is bigger than the project itself.

* *Automatic Mode* saves your changes automatic as you're making changes to the data. This mode is a more user friendly
and behaves more like one of those big bug tracking systems. *This mode is still beta. See the TODO section for more info*

### TODO

* Use PouchDB, once it comes out of alpha, to save data when using automatic save mode.
Right now the storage is done using localStorage, or browser cookies if localStorage is not supported.


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

<title>Tag</title>
<meta name="date" content="2015-04-07">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Package

Class

Use

Tree

Deprecated

Index

Help

PREV CLASS

NEXT CLASS

FRAMES

NO FRAMES

All Classes

SUMMARY:

NESTED |

FIELD |

CONSTR |

METHOD

DETAIL:

FIELD |

CONSTR |

METHOD

ca.ualberta.CMPUT301W15T06

Class Tag

java.lang.Object

ca.ualberta.CMPUT301W15T06.AppModel

ca.ualberta.CMPUT301W15T06.Tag

public class Tag
extends AppModel

This class will create a tag to the item.

Version:

04/07/2015

Author:

CMPUT301W15T06

See Also:

Date

Constructor Summary

Constructors

Constructor and Description

Tag(java.lang.String tagName)

General constructor.

Method Summary

Methods

Modifier and Type
Method and Description

long
getID()

Return the ID number of the tag.

boolean
getMissValue()

return the missValue.

java.lang.String
getName()

return the name of the tag

void
setName(java.lang.String name)

Set a name to the tag.

java.lang.String
toString()

Return the name of the tag.

Methods inherited from class ca.ualberta.CMPUT301W15T06.AppModel

addListener, addModelListener, notifyListeners, removeListener, removeModelListener

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

Tag

public Tag(java.lang.String tagName)

General constructor.

Parameters:

tagName -

Method Detail

getName

public java.lang.String getName()

return the name of the tag

Returns:

the name of the tag

setName

public void setName(java.lang.String name)
             throws NetWorkException

Set a name to the tag.

Parameters:

name -

Throws:

NetWorkException

toString

public java.lang.String toString()

Return the name of the tag.

Overrides:

toString in class java.lang.Object

getID

public long getID()

Return the ID number of the tag.

Returns:

the ID number of the tag

getMissValue

public boolean getMissValue()

Description copied from class: AppModel

return the missValue. This method will be used when user needs to use the value of missValue to justify the AppModel.

Specified by:

getMissValue in class AppModel

Returns:

a boolean variable to check if there is a miss value

Package

Class

Use

Tree

Deprecated

Index

Help

PREV CLASS

NEXT CLASS

FRAMES

NO FRAMES

All Classes

SUMMARY:

NESTED |

FIELD |

CONSTR |

METHOD

DETAIL:

FIELD |

CONSTR |

METHOD


text:
namespace mscorlib
{
	namespace System
	{

		class Type;
		class String;

	}
}
namespace mscorlib
{
	namespace System
	{

		class ThreadStaticAttribute
			: public mscorlib::System::Attribute
			, public virtual mscorlib::System::Runtime::InteropServices::_Attribute
		{
		public:
			ThreadStaticAttribute()
			: mscorlib::System::Attribute(mscorlib::NativeTypeInfo::GetTypeInfo("mscorlib","System.ThreadStaticAttribute"))
			, mscorlib::System::Runtime::InteropServices::_Attribute(NULL)
			{
				__native_object__ = Global::New("mscorlib", "System", "ThreadStaticAttribute");
			};

			ThreadStaticAttribute(mscorlib::NativeTypeInfo *nativeTypeInfo)
			: mscorlib::System::Attribute(nativeTypeInfo)
			, mscorlib::System::Runtime::InteropServices::_Attribute(NULL)
			{
			};

			ThreadStaticAttribute(MonoObject *nativeObject)
			: mscorlib::System::Attribute(nativeObject)
			, mscorlib::System::Runtime::InteropServices::_Attribute(nativeObject)
			{
			};

			~ThreadStaticAttribute()
			{
			};

			ThreadStaticAttribute & operator=(ThreadStaticAttribute &value) { __native_object__ = value.GetNativeObject(); return value; };
			bool operator==(ThreadStaticAttribute &value) { return mscorlib::System::Object::Equals(value); };
			operator MonoObject*() { return __native_object__; };
			MonoObject* operator=(MonoObject* value) { return __native_object__ = value; };

			virtual MonoObject* GetNativeObject()  override  { return __native_object__; };

			//Public Properties
			__declspec(property(get=get_TypeId)) mscorlib::System::Object  TypeId;

			//Get Set Properties Methods
			//	Get:TypeId
			mscorlib::System::Object  get_TypeId() const;

		protected:

		private:

		};

	}
}
#endif