text:
package com.echo.holographlibrarysample;

import android.graphics.Color;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.echo.holographlibrary.Bar;
import com.echo.holographlibrary.BarGraph;
import com.echo.holographlibrary.BarGraph.OnBarClickedListener;

import java.util.ArrayList;

public class BarFragment extends Fragment {

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        final View v = inflater.inflate(R.layout.fragment_bargraph, container, false);
        ArrayList<Bar> points = new ArrayList<Bar>();
        Bar d = new Bar();
        d.setColor(Color.parseColor("#99CC00"));
        d.setName("Test1");
        d.setValue(1000);
        d.setValueString("$1,000");
        Bar d2 = new Bar();
        d2.setColor(Color.parseColor("#FFBB33"));
        d2.setName("Test2");
        d2.setValue(2000);
        d2.setValueString("$2,000");
        points.add(d);
        points.add(d2);

        BarGraph g = (BarGraph) v.findViewById(R.id.bargraph);
        g.setBars(points);

        g.setOnBarClickedListener(new OnBarClickedListener() {

            @Override
            public void onClick(int index) {

            }

        });

        return v;
    }
}


text:
using System;
using TriangleNet;

namespace TriangleNet.Data
{
	internal struct Osub
	{
		public Segment seg;

		public int orient;

		public void Bond(ref Osub o2)
		{
			this.seg.subsegs[this.orient] = o2;
			o2.seg.subsegs[o2.orient] = this;
		}

		public void Copy(ref Osub o2)
		{
			o2.seg = this.seg;
			o2.orient = this.orient;
		}

		public Vertex Dest()
		{
			return this.seg.vertices[1 - this.orient];
		}

		public void Dissolve()
		{
			this.seg.subsegs[this.orient].seg = Mesh.dummysub;
		}

		public bool Equal(Osub o2)
		{
			if (this.seg != o2.seg)
			{
				return false;
			}
			return this.orient == o2.orient;
		}

		public static bool IsDead(Segment sub)
		{
			return sub.subsegs[0].seg == null;
		}

		public static void Kill(Segment sub)
		{
			sub.subsegs[0].seg = null;
			sub.subsegs[1].seg = null;
		}

		public int Mark()
		{
			return this.seg.boundary;
		}

		public void Next(ref Osub o2)
		{
			o2 = this.seg.subsegs[1 - this.orient];
		}

		public void NextSelf()
		{
			this = this.seg.subsegs[1 - this.orient];
		}

		public Vertex Org()
		{
			return this.seg.vertices[this.orient];
		}

		public void Pivot(ref Osub o2)
		{
			o2 = this.seg.subsegs[this.orient];
		}

		public void PivotSelf()
		{
			this = this.seg.subsegs[this.orient];
		}

		public Vertex SegDest()
		{
			return this.seg.vertices[3 - this.orient];
		}

		public Vertex SegOrg()
		{
			return this.seg.vertices[2 + this.orient];
		}

		public void SetDest(Vertex ptr)
		{
			this.seg.vertices[1 - this.orient] = ptr;
		}

		public void SetMark(int value)
		{
			this.seg.boundary = value;
		}

		public void SetOrg(Vertex ptr)
		{
			this.seg.vertices[this.orient] = ptr;
		}

		public void SetSegDest(Vertex ptr)
		{
			this.seg.vertices[3 - this.orient] = ptr;
		}

		public void SetSegOrg(Vertex ptr)
		{
			this.seg.vertices[2 + this.orient] = ptr;
		}

		public void Sym(ref Osub o2)
		{
			o2.seg = this.seg;
			o2.orient = 1 - this.orient;
		}

		public void SymSelf()
		{
			this.orient = 1 - this.orient;
		}

		public override string ToString()
		{
			if (this.seg == null)
			{
				return "O-TID [null]";
			}
			return string.Format("O-SID {0}", this.seg.hash);
		}

		public void TriDissolve()
		{
			this.seg.triangles[this.orient].triangle = Mesh.dummytri;
		}

		public void TriPivot(ref Otri ot)
		{
			ot = this.seg.triangles[this.orient];
		}
	}
}

redpajama_set_name: RedPajamaGithub


text:
var fs = require('fs');
var DOMParser = require('xmldom').DOMParser;
module.exports = {
	parseFromString: function(test) {
		var Handler = function(){};
		Handler.prototype = {
			startDocument : function() {
				console.log('startDocument');
			},
			startElement:function(namespaceURI, localName, qName, attrs) {
				console.log('=====================================');
				console.log('startElement');
				console.log('=====================================');
				console.log('namespaceURI');
				console.log(namespaceURI);
				console.log('localName');
				console.log(localName);
				console.log('qName');
				console.log(qName);
				console.log('attrs');
				console.log(attrs);
			},
			endElement:function(namespaceURI, localName, qName) {
				console.log('=====================================');
				console.log('endElement');
				console.log('=====================================');
				console.log('namespaceURI');
				console.log(namespaceURI);
				console.log('localName');
				console.log(localName);
				console.log('qName');
				console.log(qName);
			},
			startPrefixMapping:function(prefix, uri) {
				console.log('=====================================');
				console.log('startPrefixMapping');
				console.log('=====================================');
				console.log('prefix');
				console.log(prefix);
				console.log('uri');
				console.log(uri);
			},
			endPrefixMapping:function(prefix) {
				console.log('=====================================');
				console.log('endPrefixMapping');
				console.log('=====================================');
				console.log('prefix');
				console.log(prefix);
			},
			processingInstruction:function(target, data) {
				console.log('=====================================');
				console.log('processingInstruction');
				console.log('=====================================');
				console.log('target');
				console.log(target);
				console.log('data');
				console.log(data);
			},
			ignorableWhitespace:function(ch, start, length) {
				console.log('=====================================');
				console.log('ignorableWhitespace');
				console.log('=====================================');
				console.log('ch');
				console.log(ch);
				console.log('start');
				console.log(start);
				console.log('length');
				console.log(length);
			},
			characters:function(chars, start, length) {
				console.log('=====================================');
				console.log('characters');
				console.log('=====================================');
				console.log('chars');
				console.log(chars);
				console.log('start');
				console.log(start);
				console.log('length');
				console.log(length);
			},
			skippedEntity:function(name) {
				console.log('=====================================');
				console.log('skippedEntity');
				console.log('=====================================');
				console.log('name');
				console.log(name);
			},
			endDocument:function() {
				console.log('endDocument');
			},
			comment:function(chars, start, length) {
				console.log('=====================================');
				console.log('comment');
				console.log('=====================================');
				console.log('chars');
				console.log(chars);
				console.log('start');
				console.log(start);
				console.log('length');
				console.log(length);
			},
			startCDATA:function() {
				console.log('=====================================');
				console.log('startCDATA');
				console.log('=====================================');
			},
			endCDATA:function() {
				console.log('=====================================');
				console.log('endCDATA');
				console.log('=====================================');
			},
			startDTD:function(name, publicId, systemId) {
				console.log('=====================================');
				console.log('startDTD');
				console.log('=====================================');
				console.log('name');
				console.log(name);
				console.log('publicId');
				console.log(publicId);
				console.log('systemId');
				console.log(systemId);
			},
		};

		var parser = new DOMParser({
			domBuilder: new Handler()
		});

		console.log('Reading [test1.xml].');
		fs.readFile('tests/test1.xml', {encoding: 'utf8'}, function(err, data) {
			if (err)
			{
				throw err;
			}
			else
			{
				test.notEqual(null, data);

				var dataString = data.toString();
				test.notEqual(null, dataString);
				parser.parseFromString(dataString, 'application/xml');
			}
			test.ifError(err);
			test.done();
		});

	}
};


text:
title: Plot Data with Microsoft Charting
description: Getting Started with Microsoft's Chart control
date: 2020-05-15
lastmod: 2022-03-16
weight: 70
---

**Microsoft's `Chart` control is one of the easiest ways to get started displaying data in .NET Framework WinForms applications** since it is [natively available](https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.datavisualization.charting.chart) and automatically appears in the Windows Forms Toolbox in Visual Studio. To get started just drag a `Chart` from the toolbox and drop it onto your form.

### Disadvantages
* It is not mouse-interactive
* It only supports Windows Forms
* It is only available on .NET Framework
* It is no longer actively developed

## Quickstart

### Sample Data

This code generates random data we can practice plotting

```cs
private Random rand = new Random(0);
private double[] RandomWalk(int points = 5, double start = 100, double mult = 50)
{
    // return an array of difting random numbers
    double[] values = new double[points];
    values[0] = start;
    for (int i = 1; i < points; i++)
        values[i] = values[i - 1] + (rand.NextDouble() - .5) * mult;
    return values;
}
```

### Bar Graph (Column Chart)

Microsoft calls a horizontal bar graph a "bar chart", while a bar graph with vertical bars is called a "column chart". This program can be made with the following code.

```cs
// generate some random Y data
int pointCount = 5;
double[] ys1 = RandomWalk(pointCount);
double[] ys2 = RandomWalk(pointCount);

// create a series for each line
Series series1 = new Series("Group A");
series1.Points.DataBindY(ys1);
series1.ChartType = SeriesChartType.Column;

Series series2 = new Series("Group B");
series2.Points.DataBindY(ys2);
series2.ChartType = SeriesChartType.Column;

// add each series to the chart
chart1.Series.Clear();
chart1.Series.Add(series1);
chart1.Series.Add(series2);

// additional styling
chart1.ResetAutoValues();
chart1.Titles.Clear();
chart1.Titles.Add($"Column Chart ({pointCount} points per series)");
chart1.ChartAreas[0].AxisX.Title = "Horizontal Axis Label";
chart1.ChartAreas[0].AxisY.Title = "Vertical Axis Label";
chart1.ChartAreas[0].AxisY.MajorGrid.LineColor = Color.LightGray;
chart1.ChartAreas[0].AxisX.MajorGrid.LineColor = Color.LightGray;
```

### Scatter Plot (Line Chart)

The look of a scatter plot can be achieved by binding X and Y data.

```cs
// generate some random XY data
int pointCount = 1_000;
double[] xs1 = RandomWalk(pointCount);
double[] ys1 = RandomWalk(pointCount);
double[] xs2 = RandomWalk(pointCount);
double[] ys2 = RandomWalk(pointCount);

// create a series for each line
Series series1 = new Series("Group A");
series1.Points.DataBindXY(xs1, ys1);
series1.ChartType = SeriesChartType.Line;
series1.MarkerStyle = MarkerStyle.Circle;

Series series2 = new Series("Group B");
series2.Points.DataBindXY(xs2, ys2);
series2.ChartType = SeriesChartType.Line;
series2.MarkerStyle = MarkerStyle.Circle;

// add each series to the chart
chart1.Series.Clear();
chart1.Series.Add(series1);
chart1.Series.Add(series2);

// additional styling
chart1.ResetAutoValues();
chart1.Titles.Clear();
chart1.Titles.Add($"Scatter Plot ({pointCount:N0} points per series)");
chart1.ChartAreas[0].AxisX.Title = "Horizontal Axis Label";
chart1.ChartAreas[0].AxisY.Title = "Vertical Axis Label";
chart1.ChartAreas[0].AxisY.MajorGrid.LineColor = Color.LightGray;
chart1.ChartAreas[0].AxisX.MajorGrid.LineColor = Color.LightGray;
```

### Line Plot (Fast Line Chart)

The `FastLine` chart is optimized for speed. On my system I can comfortably display 100,000 points in real time. When I tried to display 1 million points interaction became very sluggish.

> **💡 What makes FastLine fast?** According to Microsoft, "The FastLine chart type is a variation of the Line chart that significantly reduces the drawing time of a series that contains a very large number of data points. Use this chart in situations where very large data sets are used and rendering speed is critical. Some features are omitted (control of point level visual attributes, markers, data point labels, and shadows) to improve performance."

```cs
// generate some random Y data
int pointCount = 100_000;
double[] ys1 = RandomWalk(pointCount);
double[] ys2 = RandomWalk(pointCount);

// create a series for each line
Series series1 = new Series("Group A");
series1.Points.DataBindY(ys1);
series1.ChartType = SeriesChartType.FastLine;

Series series2 = new Series("Group B");
series2.Points.DataBindY(ys2);
series2.ChartType = SeriesChartType.FastLine;

// add each series to the chart
chart1.Series.Clear();
chart1.Series.Add(series1);
chart1.Series.Add(series2);

// additional styling
chart1.ResetAutoValues();
chart1.Titles.Clear();
chart1.Titles.Add($"Fast Line Plot ({pointCount:N0} points per series)");
chart1.ChartAreas[0].AxisX.Title = "Horizontal Axis Label";
chart1.ChartAreas[0].AxisY.Title = "Vertical Axis Label";
chart1.ChartAreas[0].AxisY.MajorGrid.LineColor = Color.LightGray;
chart1.ChartAreas[0].AxisX.MajorGrid.LineColor = Color.LightGray;
```

## Source Code

* [Microsoft Charting Quickstart](https://github.com/swharden/Csharp-Data-Visualization/tree/main/dev/old/plotting/microsoft-charting/ChartingQuickstart)


text:
Meteor.users.schema = Schemas.Users;
Meteor.startup(function () {
    Schemas.Users.i18n("SCHEMAS.UsersSchema");
    Meteor.users.attachSchema(Schemas.Users);
});
Meteor.users.allow({
    update: function (userId, doc) {
        return !!userId;
    }
});


text:
// Copyright 2014 The Bazel Authors. All rights reserved.
//
// 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 com.google.devtools.build.lib.shell;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

/**
 * Provides sinks for input streams.  Continuously read an input stream
 * until the end-of-file is encountered.  The stream may be redirected to
 * an {@link OutputStream}, or discarded.
 *

 * This class is useful for handing the {@code stdout} and {@code stderr}
 * streams from a {@link Process} started with {@link Runtime#exec(String)}.
 * If these streams are not consumed, the Process may block resulting in a
 * deadlock.
 *
 * @see
 *      JavaWorld: When Runtime.exec() won't
 */
public final class InputStreamSink {

  /**
   * Black hole into which bytes are sometimes discarded by {@link NullSink}.
   * It is shared by all threads since the actual contents of the buffer
   * are irrelevant.
   */
  private static final byte[] DISCARD = new byte[4096];

  // Supresses default constructor; ensures non-instantiability
  private InputStreamSink() {
  }

  /**
   * A {@link Thread} which reads and discards data from an
   * {@link InputStream}.
   */
  private static class NullSink implements Runnable {
    private final InputStream in;

    public NullSink(InputStream in) {
      this.in = in;
    }

    @Override
    public void run() {
      try {
        try {
          // Attempt to just skip all input
          do {
            in.skip(Integer.MAX_VALUE);
          } while (in.read() != -1); // Need to test for EOF
        } catch (IOException ioe) {
          // Some streams throw IOException when skip() is called;
          // resort to reading off all input with read():
          while (in.read(DISCARD) != -1) {
            // no loop body
          }
        }
      } catch (IOException e) {
        throw new RuntimeException(e);
      }
    }
  }

  /**
   * A {@link Thread} which reads data from an {@link InputStream},
   * and translates it into an {@link OutputStream}.
   */
  private static class CopySink implements Runnable {

    private final InputStream in;
    private final OutputStream out;

    public CopySink(InputStream in, OutputStream out) {
      this.in = in;
      this.out = out;
    }

    @Override
    public void run() {
      try {
        byte[] buffer = new byte[2048];
        int bytesRead;
        while ((bytesRead = in.read(buffer)) >= 0) {
          out.write(buffer, 0, bytesRead);
          out.flush();
        }
      } catch (IOException e) {
        throw new RuntimeException(e);
      }
    }
  }

  /**
   * Creates a {@link Runnable} which consumes the provided
   * {@link InputStream} 'in', discarding its contents.
   */
  public static Runnable newRunnableSink(InputStream in) {
    if (in == null) {
      throw new NullPointerException("in");
    }
    return new NullSink(in);
  }

  /**
   * Creates a {@link Runnable} which copies everything from 'in'
   * to 'out'. 'out' will be written to and flushed after each
   * read from 'in'. However, 'out' will not be closed.
   */
  public static Runnable newRunnableSink(InputStream in, OutputStream out) {
    if (in == null) {
      throw new NullPointerException("in");
    }
    if (out == null) {
      throw new NullPointerException("out");
    }
    return new CopySink(in, out);
  }
}


text:
<?php

namespace ActiveOracle\Exception;

class StatementException extends \Exception
{
    public function __construct($err = null)
    {
        parent::__construct($err['message'], $err['code']);
    }
}


text:
package net.jforum.view.admin;

import net.jforum.context.RequestContext;
import net.jforum.dao.DataAccessDriver;
import net.jforum.dao.PostDAO;
import net.jforum.dao.TopicDAO;
import net.jforum.dao.UserDAO;
import net.jforum.entities.Post;
import net.jforum.entities.Topic;
import net.jforum.entities.User;
import net.jforum.repository.ForumRepository;
import net.jforum.repository.PostRepository;
import net.jforum.repository.TopicRepository;
import net.jforum.util.preferences.ConfigKeys;
import net.jforum.util.preferences.SystemGlobals;
import net.jforum.util.preferences.TemplateKeys;
import net.jforum.view.forum.common.AttachmentCommon;
import net.jforum.view.forum.common.PostCommon;
import net.jforum.view.forum.common.TopicsCommon;
import freemarker.template.SimpleHash;

/**
 * @author Rafael Steil
 * @version $Id: ModerationAction.java,v 1.27 2007/09/10 23:07:00 rafaelsteil Exp $
 */
public class ModerationAction extends AdminCommand
{
	public ModerationAction() {}

	public ModerationAction(SimpleHash context, RequestContext request)
	{
		this.context = context;
		this.request = request;
	}

	/**
	 * @see net.jforum.Command#list()
	 */
	public void list()
	{
		this.setTemplateName(TemplateKeys.MODERATION_ADMIN_LIST);
		this.context.put("infoList", DataAccessDriver.getInstance().newModerationDAO().categoryPendingModeration());
	}

	public void view()
	{
		int forumId = this.request.getIntParameter("forum_id");

		this.setTemplateName(TemplateKeys.MODERATION_ADMIN_VIEW);
		this.context.put("forum", ForumRepository.getForum(forumId));
		this.context.put("topics", DataAccessDriver.getInstance().newModerationDAO().topicsByForum(
				forumId));
	}

	public void doSave()
	{
		String[] posts = this.request.getParameterValues("post_id");

		if (posts != null) {
			TopicDAO topicDao = DataAccessDriver.getInstance().newTopicDAO();

			for (int i = 0; i < posts.length; i++) {
				int postId = Integer.parseInt(posts[i]);

				String status = this.request.getParameter("status_" + postId);

				if ("defer".startsWith(status)) {
					continue;
				}

				if ("aprove".startsWith(status)) {
					Post p = DataAccessDriver.getInstance().newPostDAO().selectById(postId);

					// Check is the post is in fact waiting for moderation
					if (!p.isModerationNeeded()) {
						continue;
					}

					UserDAO userDao = DataAccessDriver.getInstance().newUserDAO();
					User u = userDao.selectById(p.getUserId());

					boolean first = false;
					Topic t = TopicRepository.getTopic(new Topic(p.getTopicId()));

					if (t == null) {
						t = topicDao.selectById(p.getTopicId());

						if (t.getId() == 0) {
							first = true;
							t = topicDao.selectRaw(p.getTopicId());
						}
					}

					DataAccessDriver.getInstance().newModerationDAO().aprovePost(postId);

					boolean firstPost = (t.getFirstPostId() == postId);

					if (!firstPost) {
						t.setTotalReplies(t.getTotalReplies() + 1);
					}

					t.setLastPostId(postId);
					t.setLastPostBy(u);
					t.setLastPostDate(p.getTime());
					t.setLastPostTime(p.getFormatedTime());

					topicDao.update(t);

					if (first) {
						t = topicDao.selectById(t.getId());
					}

					TopicsCommon.updateBoardStatus(t, postId, firstPost,
						topicDao, DataAccessDriver.getInstance().newForumDAO());

					ForumRepository.updateForumStats(t, u, p);
					TopicsCommon.notifyUsers(t, p);

					userDao.incrementPosts(p.getUserId());

					if (SystemGlobals.getBoolValue(ConfigKeys.POSTS_CACHE_ENABLED)) {
						PostRepository.append(p.getTopicId(), PostCommon.preparePostForDisplay(p));
					}
				}
				else {
					PostDAO pm = DataAccessDriver.getInstance().newPostDAO();
					Post post = pm.selectById(postId);

					if (post == null || !post.isModerationNeeded()) {
						continue;
					}

					pm.delete(post);

					new AttachmentCommon(this.request, post.getForumId()).deleteAttachments(postId, post.getForumId());

					int totalPosts = topicDao.getTotalPosts(post.getTopicId());

					if (totalPosts == 0) {
						TopicsCommon.deleteTopic(post.getTopicId(), post.getForumId(), true);
					}
				}
			}
		}
	}

	public void save()
	{
		this.doSave();
		this.view();
	}
}


text:
FOUNDATION_EXPORT double Pods_YoutubeClientVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_YoutubeClientVersionString[];


text:
"""This example displays all of the available subaccount permissions.

To get a subaccount ID, run get_subaccounts.py.

Tags: subaccounts.get, userRolePermissions.list
"""

__author__ = ('api.jimper@gmail.com (Jonathon Imperiosi)')

import argparse
import sys

from apiclient import sample_tools
from oauth2client import client

# Declare command-line flags.
argparser = argparse.ArgumentParser(add_help=False)
argparser.add_argument(
    'profile_id', type=int,
    help='The ID of the profile to list permissions for')
argparser.add_argument(
    'subaccount_id', type=int,
    help='The ID of the subaccount to list permissions for')

def main(argv):
  # Authenticate and construct service.
  service, flags = sample_tools.init(
      argv, 'dfareporting', 'v2.0', __doc__, __file__, parents=[argparser],
      scope=['https://www.googleapis.com/auth/dfareporting',
             'https://www.googleapis.com/auth/dfatrafficking'])

  profile_id = flags.profile_id
  subaccount_id = flags.subaccount_id

  try:
    # Construct and execute the subaccount request.
    request = service.subaccounts().get(
        profileId=profile_id, id=subaccount_id)

    subaccount = request.execute()

    # Construct the user role permissions request.
    request = service.userRolePermissions().list(
        profileId=profile_id, ids=subaccount['availablePermissionIds'])

    # Execute request and print response.
    result = request.execute()

    for permission in result['userRolePermissions']:
      print ('Found user role permission with ID %s and name "%s".'
             % (permission['id'], permission['name']))

  except client.AccessTokenRefreshError:
    print ('The credentials have been revoked or expired, please re-run the '
           'application to re-authorize')

if __name__ == '__main__':
  main(sys.argv)


text:
package org.gradle.tooling.model.idea;

/**
 * The scope of the IDEA dependency.
 */
public interface IdeaDependencyScope {

    String getScope();
}


text:
const electron  = require('electron');

electron.ipcRenderer.on('notify', (event, title, text, silent, icon, data) => {
  let notification = new Notification(title, {
    body: text,
    silent,
    icon,
  });

  notification.onclick = () => {
    electron.ipcRenderer.send('notificationClicked', data);
  }
})

electron.ipcRenderer.on('setBadge', (event, text) => {
  const win = electron.remote.getCurrentWindow();
  //var NativeImage = electron.nativeImage;
  let mainWindow = win.getParentWindow();
  if ( text === 0 ) {
    mainWindow.setOverlayIcon(null, text);
  } else {
    // Create badge
    let canvas = document.createElement('canvas');
    canvas.height = 140;
    canvas.width = 140;
    let ctx = canvas.getContext('2d');
    ctx.fillStyle = 'red';
    ctx.beginPath();
    ctx.ellipse(70, 70, 70, 70, 0, 0, 2 * Math.PI);
    ctx.fill();
    ctx.textAlign = 'center';
    ctx.fillStyle = 'white';

    if (text.length > 2) {
      ctx.font = '75px sans-serif';
      ctx.fillText('' + text, 70, 98);
    } else if (text.length > 1) {
      ctx.font = '100px sans-serif';
      ctx.fillText('' + text, 70, 105);
    } else {
      ctx.font = '125px sans-serif';
      ctx.fillText('' + text, 70, 112);
    }

    const badgeDataURL = canvas.toDataURL();

    const img = require('electron').remote.nativeImage.createFromDataURL(badgeDataURL);
    mainWindow.setOverlayIcon(img, text);
  }
})


text:
package org.hisp.dhis.android.core.arch.db.access;

public interface Transaction {
    void setSuccessful();

    void end();
}


text:
class Project < ActiveRecord::Base
  belongs_to :creator, class_name: 'User'
  belongs_to :skill

  has_many :criteria, class_name: 'ProjectCriterion', inverse_of: :project
  accepts_nested_attributes_for :criteria, reject_if: :all_blank, allow_destroy: true

  has_many :completions, class_name: 'ProjectCompletion'

  validates_presence_of :title, :description, :criteria, :creator, :skill
  validates_uniqueness_of :title, scope: :skill_id
end


text:
<?php
namespace Pulse\Kernel;

class SessionCookie extends \Pulse\Kernel
{
    /**
     * @var array
     */
    protected $settings;

    /**
     * Constructor
     *
     * @param array $settings
     */
    public function __construct($settings = array())
    {
        $defaults = array(
            'expires' => '20 minutes',
            'path' => '/',
            'domain' => null,
            'secure' => false,
            'httponly' => false,
            'name' => 'slim_session',
        );
        $this->settings = array_merge($defaults, $settings);
        if (is_string($this->settings['expires'])) {
            $this->settings['expires'] = strtotime($this->settings['expires']);
        }

        /**
         * Session
         *
         * We must start a native PHP session to initialize the $_SESSION superglobal.
         * However, we won't be using the native session store for persistence, so we
         * disable the session cookie and cache limiter. We also set the session
         * handler to this class instance to avoid PHP's native session file locking.
         */
        ini_set('session.use_cookies', 0);
        session_cache_limiter(false);
        session_set_save_handler(
            array($this, 'open'),
            array($this, 'close'),
            array($this, 'read'),
            array($this, 'write'),
            array($this, 'destroy'),
            array($this, 'gc')
        );
    }

    /**
     * Call
     */
    public function call()
    {
        $this->loadSession();
        $this->next->call();
        $this->saveSession();
    }

    /**
     * Load session
     */
    protected function loadSession()
    {
        if (session_id() === '') {
            session_start();
        }

        $value = $this->app->getCookie($this->settings['name']);

        if ($value) {
            try {
                $_SESSION = unserialize($value);
            } catch (\Exception $e) {
                $this->app->getLog()->error('Error unserializing session cookie value! ' . $e->getMessage());
            }
        } else {
            $_SESSION = array();
        }
    }

    /**
     * Save session
     */
    protected function saveSession()
    {
        $value = serialize($_SESSION);

        if (strlen($value) > 4096) {
            $this->app->getLog()->error('WARNING! Pulse\Kernel\SessionCookie data size is larger than 4KB. Content save failed.');
        } else {
            $this->app->setCookie(
                $this->settings['name'],
                $value,
                $this->settings['expires'],
                $this->settings['path'],
                $this->settings['domain'],
                $this->settings['secure'],
                $this->settings['httponly']
            );
        }
        // session_destroy();
    }

    /********************************************************************************
    * Session Handler
    *******************************************************************************/

    /**
     * @codeCoverageIgnore
     */
    public function open($savePath, $sessionName)
    {
        return true;
    }

    /**
     * @codeCoverageIgnore
     */
    public function close()
    {
        return true;
    }

    /**
     * @codeCoverageIgnore
     */
    public function read($id)
    {
        return '';
    }

    /**
     * @codeCoverageIgnore
     */
    public function write($id, $data)
    {
        return true;
    }

    /**
     * @codeCoverageIgnore
     */
    public function destroy($id)
    {
        return true;
    }

    /**
     * @codeCoverageIgnore
     */
    public function gc($maxlifetime)
    {
        return true;
    }
}


text:
<?php

declare(strict_types=1);

namespace Emonkak\Orm\Tests\ResultSet;

use Emonkak\Orm\ResultSet\EmptyResultSet;
use PHPUnit\Framework\TestCase;

/**
 * @covers \Emonkak\Orm\ResultSet\EmptyResultSet
 */
class EmptyResultSetTest extends TestCase
{
    public function testGetIterator(): void
    {
        $result = new EmptyResultSet();
        $this->assertEquals([], iterator_to_array($result));
    }
}


text:
<?php

/**
 * This is a helper class for the SS installer.
 *
 * It does all the specific checking for MySQLDatabase
 * to ensure that the configuration is setup correctly.
 *
 * @package framework
 * @subpackage model
 */
class MySQLDatabaseConfigurationHelper implements DatabaseConfigurationHelper {

	/**
	 * Create a connection of the appropriate type
	 *
	 * @param array $databaseConfig
	 * @param string $error Error message passed by value
	 * @return mixed|null Either the connection object, or null if error
	 */
	protected function createConnection($databaseConfig, &$error) {
		$error = null;
		try {
			switch($databaseConfig['type']) {
				case 'MySQLDatabase':
					$conn = @new MySQLi($databaseConfig['server'], $databaseConfig['username'],
										$databaseConfig['password']);
					if($conn && empty($conn->connect_errno)) {
						$conn->query("SET sql_mode = 'ANSI'");
						return $conn;
					} else {
						$error = ($conn->connect_errno)
							? $conn->connect_error
							: 'Unknown connection error';
						return null;
					}
				case 'MySQLPDODatabase':
					// May throw a PDOException if fails
					$conn = @new PDO('mysql:host='.$databaseConfig['server'], $databaseConfig['username'],
									$databaseConfig['password']);
					if($conn) {
						$conn->query("SET sql_mode = 'ANSI'");
						return $conn;
					} else {
						$error = 'Unknown connection error';
						return null;
					}
				default:
					$error = 'Invalid connection type';
					return null;
			}
		} catch(Exception $ex) {
			$error = $ex->getMessage();
			return null;
		}
	}

	/**
	 * Helper function to quickly extract a column from a mysqi_result
	 *
	 * @param mixed $results mysqli_result or enumerable list of rows
	 * @return array Resulting data
	 */
	protected function column($results) {
		$array = array();
		if($results instanceof mysqli_result) {
			while($row = $results->fetch_array()) {
				$array[] = $row[0];
			}
		} else {
			foreach($results as $row) {
				$array[] = $row[0];
			}
		}
		return $array;
	}

	public function requireDatabaseFunctions($databaseConfig) {
		$data = DatabaseAdapterRegistry::get_adapter($databaseConfig['type']);
		return !empty($data['supported']);
	}

	public function requireDatabaseServer($databaseConfig) {
		$connection = $this->createConnection($databaseConfig, $error);
		$success = !empty($connection);

		return array(
			'success' => $success,
			'error' => $error
		);
	}

	public function getDatabaseVersion($databaseConfig) {
		$conn = $this->createConnection($databaseConfig, $error);
		if(!$conn) {
			return false;
		} elseif($conn instanceof MySQLi) {
			return $conn->server_info;
		} elseif($conn instanceof PDO) {
			return $conn->getAttribute(PDO::ATTR_SERVER_VERSION);
		}
		return false;
	}

	/**
	 * Ensure that the MySQL server version is at least 5.0.
	 *
	 * @param array $databaseConfig Associative array of db configuration, e.g. "server", "username" etc
	 * @return array Result - e.g. array('success' => true, 'error' => 'details of error')
	 */
	public function requireDatabaseVersion($databaseConfig) {
		$version = $this->getDatabaseVersion($databaseConfig);
		$success = false;
		$error = '';
		if($version) {
			$success = version_compare($version, '5.0', '>=');
			if(!$success) {
				$error = "Your MySQL server version is $version. It's recommended you use at least MySQL 5.0.";
			}
		} else {
			$error = "Could not determine your MySQL version.";
		}
		return array(
			'success' => $success,
			'error' => $error
		);
	}

	public function requireDatabaseConnection($databaseConfig) {
		$conn = $this->createConnection($databaseConfig, $error);
		$success = !empty($conn);

		// Check database name only uses valid characters
		if($success && !$this->checkValidDatabaseName($databaseConfig['database'])) {
			$success = false;
			$error = 'Invalid characters in database name.';
		}

		return array(
			'success' => $success,
			'error' => $error
		);
	}

	/**
	 * Determines if a given database name is a valid Silverstripe name.
	 *
	 * @param string $database Candidate database name
	 * @return boolean
	 */
	public function checkValidDatabaseName($database) {

		// Reject filename unsafe characters (cross platform)
		if(preg_match('/[\\\\\/\?%\*\:\|"\<\>\.]+/', $database)) return false;

		// Restricted to characters in the ASCII and Extended ASCII range
		// @see http://dev.mysql.com/doc/refman/5.0/en/identifiers.html
		return preg_match('/^[\x{0001}-\x{FFFF}]+$/u', $database);
	}

	/**
	 * Checks if a specified grant proves that the current user has the specified
	 * permission on the specified database
	 *
	 * @param string $database Database name
	 * @param string $permission Permission to check for
	 * @param string $grant MySQL syntax grant to check within
	 * @return boolean
	 */
	public function checkDatabasePermissionGrant($database, $permission, $grant) {
		// Filter out invalid database names
		if(!$this->checkValidDatabaseName($database)) return false;

		// Escape all valid database patterns (permission must exist on all tables)
		$dbPattern = sprintf(
			'((%s)|(%s)|(%s))',
			preg_quote("\"$database\".*"),
			preg_quote('"%".*'),
			preg_quote('*.*')
		);
		$expression = '/GRANT[ ,\w]+((ALL PRIVILEGES)|('.$permission.'(?! ((VIEW)|(ROUTINE)))))[ ,\w]+ON '.
			$dbPattern.'/i';
		return preg_match($expression, $grant);
	}

	/**
	 * Checks if the current user has the specified permission on the specified database
	 *
	 * @param mixed $conn Connection object
	 * @param string $database Database name
	 * @param string $permission Permission to check
	 * @return boolean
	 */
	public function checkDatabasePermission($conn, $database, $permission) {
		$grants = $this->column($conn->query("SHOW GRANTS FOR CURRENT_USER"));
		foreach($grants as $grant) {
			if($this->checkDatabasePermissionGrant($database, $permission, $grant)) {
				return true;
			}
		}
		return false;
	}

	public function requireDatabaseOrCreatePermissions($databaseConfig) {
		$success = false;
		$alreadyExists = false;
		$conn = $this->createConnection($databaseConfig, $error);
		if($conn) {
			$list = $this->column($conn->query("SHOW DATABASES"));
			if(in_array($databaseConfig['database'], $list)) {
				$success = true;
				$alreadyExists = true;
			} else{
				// If no database exists then check DDL permissions
				$alreadyExists = false;
				$success = $this->checkDatabasePermission($conn, $databaseConfig['database'], 'CREATE');
			}
		}

		return array(
			'success' => $success,
			'alreadyExists' => $alreadyExists
		);
	}

	public function requireDatabaseAlterPermissions($databaseConfig) {
		$conn = $this->createConnection($databaseConfig, $error);
		$success = $this->checkDatabasePermission($conn, $databaseConfig['database'], 'ALTER');
		return array(
			'success' => $success,
			'applies' => true
		);
	}
}


text:
<!DOCTYPE html>
		<meta charset="utf-8">

<meta name="viewport" content="width=device-width">

<title>[問卦] 大家這時間都在幹嘛 - 看板 Gossiping - 批踢踢實業坊</title>
<meta name="robots" content="all">
<meta name="keywords" content="Ptt BBS 批踢踢">
<meta name="description" content="
離天亮剩2個小時左右

這時候吃宵夜 早餐就吃不下了

">
<meta property="og:site_name" content="Ptt 批踢踢實業坊">
<meta property="og:title" content="[問卦] 大家這時間都在幹嘛">
<meta property="og:description" content="
離天亮剩2個小時左右

這時候吃宵夜 早餐就吃不下了

">

<link rel="stylesheet" type="text/css" href="//images.ptt.cc/v2.10/bbs-common.css">
<link rel="stylesheet" type="text/css" href="//images.ptt.cc/v2.10/bbs.css" media="screen">
<link rel="stylesheet" type="text/css" href="//images.ptt.cc/v2.10/pushstream.css" media="screen">
<link rel="stylesheet" type="text/css" href="//images.ptt.cc/v2.10/bbs-print.css" media="print">

		批踢踢實業坊
		›
		看板 Gossiping
		關於我們
		聯絡資訊

		返回看板

			分享

作者anthony13015 (nothingonyou)

看板Gossiping

標題[問卦] 大家這時間都在幹嘛

時間Sun Dec 21 04:02:43 2014

離天亮剩2個小時左右

這時候吃宵夜 早餐就吃不下了

睡覺呢 就是睡不著呀~~~

打lol呢 又怕戳隊友

於是只好上來問問大家在幹麻

順便天氣冷來取暖一下

大家應該不介意我這肥宅吧

嘻嘻~~~

>.<

--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.36.165.216
※ 文章網址: http://www.ptt.cc/bbs/Gossiping/M.1419105765.A.36C.html

推 IPO5566: 洗洗睡 12/21 04:03

→ akira00150: 看相聲瓦舍啦! 12/21 04:04

推 linji: 看廢文 12/21 04:06

推 zzz71084482: 看廢文加一 12/21 04:07

推 holyspectral: 看八卦啊不然咧 12/21 04:07

推 s9623452: wash and sleep 12/21 04:07

→ LBJay: 擼管 12/21 04:08

推 paupau0782: 樓上住戶天天都吵到這時候才安靜 老娘肝壞掉他們要負 12/21 04:09

→ paupau0782: 責嗎 12/21 04:09

推 air123: XX 12/21 04:09

推 junki8957: 正在看廢文 12/21 04:10

→ shyowa43: 看你po廢文 12/21 04:10

→ LechiWaky: 打一槍準備睡覺 12/21 04:11

推 BirthdayBoy: 正在推廢文 剛剛按下ENTER 12/21 04:11

推 a26480924: 看廢文 12/21 04:14

→ qqq61004: 睡不著 幹 12/21 04:15

推 ISNAKEI: 看廢文 12/21 04:23

→ scarlet93: 煩惱人生 12/21 04:24

推 MD930: 看廢文 12/21 04:24

推 jay991122: 上班 12/21 04:26

推 kthang: 上班+1 12/21 04:27

推 lidiya0930: 上班 12/21 04:28

→ lidiya0930: 一堆上班的在看ptt                     老闆在你後面 12/21 04:28

推 elqqaapple: 邊讀書邊玩逼透可  然後煩惱人生  嗚嗚嗚 12/21 04:29

→ chris7: 看你發廢文 12/21 04:30

推 SamuelLuo: 看你耍廢 12/21 04:37

噓 ange09: 噓廢文 12/21 04:44

推 ProfessUX: 4:44 12/21 04:45

噓 whow: 看paper  幹 12/21 04:46

推 podon: 打電動 12/21 04:53

→ chris7:      ↖覺得開心 XDDDD 12/21 04:54

→ JizzBurger: 剛看完Lucy@@   還不錯看阿  一堆人說爛片 12/21 04:54

推 DerekMing: 幫女兒泡奶 12/21 05:25

推 Verlander35: 運動 12/21 05:56

→ lidiya0930: 不好看加一 12/21 06:05

推 Big78: 打ps4  爽 12/21 06:06

推 GoOdGaMe: 起床 12/21 06:11

推 bmwx6: 看廢文耍廢 12/21 06:35

→ qd6590: 夜唱啊 12/21 06:38

推 freedomshit: 剛睡醒看了篇廢文 12/21 06:46

推 loloman: 能看到你文章的必是看廢文無誤 12/21 08:06

噓 troy4685: 回你的廢文 12/21 08:17

推 crea0520: 嘻嘻~~~ 12/21 10:23

推 puddinggggg: 打lol~ 12/21 10:26

推 superloser: 看廢文 12/21 11:34

推文自動更新已關閉

本網站已依台灣網站內容分級規定處理。此區域為限制級,未滿十八歲者不得瀏覽。


text:
{% extends "base.html" %}

{% block content %}

Questions for {{campaign.title}}

Add a question

			Question
			Type
			Choices
			Edit
			Delete
			Order up
			Order down
			Order

		{% if enumeratedquestions_list %}
		{% for campaign_question in enumeratedquestions_list %}

			{{campaign_question.question.text}}
			{{campaign_question.question.ui_hint}}
			{% if campaign_question.question.choices %}{{campaign_question.question.choices}}{% else %}N/A{% endif %}
			Edit

				<form method="post" action="{% url 'survey_question_delete' campaign campaign_question.rank %}">
					<input type="submit" value="Delete" />
					{% csrf_token %}
				</form>

				<form method="post" action="{% url 'survey_question_up' campaign campaign_question.rank %}">
					<input type="submit" value="Up" />
					{% csrf_token %}
				</form>

				<form method="post" action="{% url 'survey_question_down' campaign campaign_question.rank %}">
					<input type="submit" value="Down" />
					{% csrf_token %}
				</form>

			{{campaign_question.question.rank}}

		{% endfor %}

	{% else %}
		No question for campaign titled "{{campaign.title}}"
	{% endif %}

{% endblock %}


text:
package com.lambdazen.pixy.pipes;

import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;

import com.lambdazen.pixy.PipeVisitor;
import com.lambdazen.pixy.PixyPipe;
import com.lambdazen.pixy.gremlin.GraphTraversalExt;

public class CutPipe implements PixyPipe {
	// The outStep is mandatory -- so CutPipe doesn't implement NamedOutputStep
	String outStep;

	public CutPipe(String cutVarName) {
		this.outStep = cutVarName;
	}

	public String toString() {
		return "pixyCut() -> as('" + outStep + "')";
	}

	@Override
	public GraphTraversal pixyStep(GraphTraversal inputPipe) {
		return GraphTraversalExt.pixyCut(inputPipe).as(outStep);
	}

	@Override
	public void visit(PipeVisitor visitor) {
		visitor.visit(this);
	}
}


text:
This document lists required steps to start build your own OpenSK.

### Programmers

OpenSK supports different ways to flash your board:

*   [Segger J-Link](https://www.segger.com/products/debug-probes/j-link/)
    (default method).
*   [OpenOCD](http://openocd.org/).
*   [pyOCD](https://pypi.org/project/pyocd/).
*   [nrfutil](https://pypi.org/project/nrfutil/) for the USB dongle boards that
    support it, which allows you to directly flash a working board over USB
    without additional hardware.

### Software requirements

In order to compile and flash a working OpenSK firmware, you will need the
following:

*   rustup (can be installed with [Rustup](https://rustup.rs/))
*   python3 and pip (can be installed with the `python3-pip` package on Debian)
*   the OpenSSL command line tool (can be installed and configured with the
    `libssl-dev` and `pkg-config` packages on Debian)
*   `nrfutil` (can be installed using `pip3 install nrfutil`) if you want to flash
    a device with DFU
*   `uuid-runtime` if you are missing the `uuidgen` command.

The proprietary software to use the default programmer can be found on the
[Segger website](https://www.segger.com/downloads/jlink). Please follow their
instructions to appropriate binaries for your system.

The scripts provided in this project have been tested under Linux and OS X. We
haven't tested them on Windows and other platforms.

### Compiling the firmware

If you are switching branches or used an old version of OpenSK before, we have
tools to help you migrate to our develop branch. You find more information on
how to update your setup or reset your storage in its
[install instructions](https://github.com/google/OpenSK/blob/develop/docs/install.md).

To clone and setup the repository for the stable branch, run the following
commands:

```shell
git clone https://github.com/google/OpenSK.git
cd OpenSK
./setup.sh
```

The setup script performs the following steps:

1.  Make sure that the git submodules are checked out.

1.  Apply our patches that haven't yet been merged upstream to both
    [Tock](https://github.com/tock/tock) and
    [libtock-rs](https://github.com/tock/libtock-rs).

1.  Generate crypto material, see [Customization](customization.md) for details.

1.  Install the correct Rust toolchain for ARM devices.

1.  Install [tockloader](https://github.com/tock/tockloader).

Additionally on Linux, you need to install a `udev` rule file to allow non-root
users to interact with OpenSK devices. To install it, execute:

```shell
sudo cp rules.d/55-opensk.rules /etc/udev/rules.d/
sudo udevadm control --reload
```

Then, you need and replug the device for the rule to trigger.

Last, if you want to use U2F or attestation, configure the certificate. If your
client does not support FIDO2 yet, this step is mandatory for your OpenSK to
work. OpenSK is incompatible with some browsers without a certificate. Please
read the
[certificate section in Customization](customization.md#Certificate-considerations)
for understand privacy tradeoffs.

```shell
./tools/configure.py \
    --certificate=crypto_data/opensk_cert.pem \
    --private-key=crypto_data/opensk.key
```

### Flashing a firmware

From here on, please follow the instructions for your hardware:

*   [Nordic nRF52840-DK](boards/nrf52840dk.md)
*   [Nordic nRF52840 Dongle](boards/nrf52840_dongle.md)
*   [Makerdiary nRF52840-MDK USB dongle](boards/nrf52840_mdk.md)
*   [Feitian OpenSK dongle](boards/nrf52840_feitian.md)

### Advanced installation

We recommend that you flash your development board with JTAG and dongles with
DFU, as described in the [board documentation](#Flashing-a-firmware) linked
above. However, we support other programmers:

*   OpenOCD: `./deploy.py --board=nrf52840_dongle --opensk --programmer=openocd`
*   pyOCD: `./deploy.py --board=nrf52840_dongle --opensk --programmer=pyocd`
*   Custom: `./deploy.py --board=nrf52840_dongle --opensk --programmer=none`.
    In this case, an IntelHex file will be created and how to program a board is
    left to the user.

If your board is already flashed with Tock OS, you may skip installing it:
`./deploy.py --board=nrf52840dk --opensk --no-tockos`

For more options, we invite you to read the help of our `deploy.py` script by
running `./deploy.py --help`.


text:
<!doctype html>

		<meta charset="utf-8">
		<title>New RF Platform – Scalable and Distributed Platform for Synapse RF Integration.</title>
		<meta name="description" content="Modern platform for integration RF devices to Synapse WMS.">
		<meta name="author" content="Shibu K. Raj">

		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">

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

		<link rel="stylesheet" href="css/reveal.css">
		<link rel="stylesheet" href="css/theme/white.css" id="theme">

		<link rel="stylesheet" href="lib/css/zenburn.css">

New RF

Scalable, resiliant and distributed architecture for RF Device integration with Synapse WMS.

						Developed by CL Application Development Team

Accessibility

						Select the theme that suit your environment:

						Solarized (default) -
						Black -
						White -
						League -
						Sky

						Beige -
						Simple
						Serif -
						Blood -
						Night -
						Moon

Current Architecture

Architecture (Proposed)

Sub System Topology (Proposed)

Future Technology Stack

Why Node.JS?

Node.Js Architecture

Node.Js Internals

Node.js Frameworks and Libraries.

Blessed  - A high-level terminal interface library.

node-telnet2 - Telnet Server Implementation.

Middle Teir - Frameworks and Libraries.

 .NET Core - Cross platform framework for server apps.

 ASP.NET Core - Cross platform library for Restful Services.

Why these frameworks & libs?

Cloud Friendly - especially Microsoft Azure

Maximization of OHL & local talent pool.

Test driven development friendly.

Plan and Approach

Technology Prototype - {Complete}

Analysis - Current application. {Ongoing. 4 use cases completed.}

Design, Development & Testing- {Started application framework.}

Implementation Approach -  Data Access

New Schema

All DB Objects will stay under this schema.

Stored procedures, Prepared Statements etc.

Implementation Approach -  Data Access

Reuse vs Recreate

It depends. Not 100% nor 50-50

Evaluate by each RF option

Will recreate 100% logic in pro*C files and modules

Most of zrf.* packages will be reused.

Node.Js Architecture


text:
#ifndef DatabaseTask_h
#define DatabaseTask_h

#include "modules/webdatabase/Database.h"
#include "modules/webdatabase/DatabaseBasicTypes.h"
#include "modules/webdatabase/DatabaseError.h"
#include "modules/webdatabase/SQLTransactionBackend.h"
#include "platform/WaitableEvent.h"
#include "platform/heap/Handle.h"
#include "wtf/PtrUtil.h"
#include "wtf/Threading.h"
#include "wtf/Vector.h"
#include "wtf/text/WTFString.h"
#include <memory>

namespace blink {

class DatabaseTask {
  WTF_MAKE_NONCOPYABLE(DatabaseTask);
  USING_FAST_MALLOC(DatabaseTask);

 public:
  virtual ~DatabaseTask();

  void run();

  Database* database() const { return m_database.get(); }

 protected:
  DatabaseTask(Database*, WaitableEvent* completeEvent);

 private:
  virtual void doPerformTask() = 0;
  virtual void taskCancelled() {}

  CrossThreadPersistent<Database> m_database;
  WaitableEvent* m_completeEvent;

#if DCHECK_IS_ON()
  virtual const char* debugTaskName() const = 0;
  bool m_complete;
#endif
};

class Database::DatabaseOpenTask final : public DatabaseTask {
 public:
  static std::unique_ptr<DatabaseOpenTask> create(Database* db,
                                                  bool setVersionInNewDatabase,
                                                  WaitableEvent* completeEvent,
                                                  DatabaseError& error,
                                                  String& errorMessage,
                                                  bool& success) {
    return WTF::wrapUnique(new DatabaseOpenTask(db, setVersionInNewDatabase,
                                                completeEvent, error,
                                                errorMessage, success));
  }

 private:
  DatabaseOpenTask(Database*,
                   bool setVersionInNewDatabase,
                   WaitableEvent*,
                   DatabaseError&,
                   String& errorMessage,
                   bool& success);

  void doPerformTask() override;
#if DCHECK_IS_ON()
  const char* debugTaskName() const override;
#endif

  bool m_setVersionInNewDatabase;
  DatabaseError& m_error;
  String& m_errorMessage;
  bool& m_success;
};

class Database::DatabaseCloseTask final : public DatabaseTask {
 public:
  static std::unique_ptr<DatabaseCloseTask> create(
      Database* db,
      WaitableEvent* synchronizer) {
    return WTF::wrapUnique(new DatabaseCloseTask(db, synchronizer));
  }

 private:
  DatabaseCloseTask(Database*, WaitableEvent*);

  void doPerformTask() override;
#if DCHECK_IS_ON()
  const char* debugTaskName() const override;
#endif
};

class Database::DatabaseTransactionTask final : public DatabaseTask {
 public:
  ~DatabaseTransactionTask() override;

  // Transaction task is never synchronous, so no 'synchronizer' parameter.
  static std::unique_ptr<DatabaseTransactionTask> create(
      SQLTransactionBackend* transaction) {
    return WTF::wrapUnique(new DatabaseTransactionTask(transaction));
  }

  SQLTransactionBackend* transaction() const { return m_transaction.get(); }

 private:
  explicit DatabaseTransactionTask(SQLTransactionBackend*);

  void doPerformTask() override;
  void taskCancelled() override;
#if DCHECK_IS_ON()
  const char* debugTaskName() const override;
#endif

  CrossThreadPersistent<SQLTransactionBackend> m_transaction;
};

class Database::DatabaseTableNamesTask final : public DatabaseTask {
 public:
  static std::unique_ptr<DatabaseTableNamesTask>
  create(Database* db, WaitableEvent* synchronizer, Vector<String>& names) {
    return WTF::wrapUnique(new DatabaseTableNamesTask(db, synchronizer, names));
  }

 private:
  DatabaseTableNamesTask(Database*, WaitableEvent*, Vector<String>& names);

  void doPerformTask() override;
#if DCHECK_IS_ON()
  const char* debugTaskName() const override;
#endif

  Vector<String>& m_tableNames;
};

}  // namespace blink

#endif  // DatabaseTask_h


text:
"""Provide a way to work with panda data frames in Spark"""
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
#

from sparklingpandas.utils import add_pyspark_path
from sparklingpandas.pstats import PStats
from itertools import chain, imap

add_pyspark_path()
from pyspark.join import python_join, python_left_outer_join, \
    python_right_outer_join, python_cogroup
from pyspark.rdd import RDD
import pyspark
import pandas as pd

class DataFrame:
    """A Panda Resilient Distributed Dataset (DataFrame), is based on
    Spark SQL's DataFrame (previously known as SchemaRDD). DataFrames aim to
    provide, as close as reasonable, Panda's compatable inferface.
    Note: RDDs are lazy, so you operations are not performed until required."""

    def __init__(self, schema_rdd, sql_ctx, index_names=None):
        self._schema_rdd = schema_rdd
        self.sql_ctx = sql_ctx
        # Keep track of what our index is called. If none no index information.
        self._index_names = index_names

    def _rdd(self):
        """Return an RDD of Panda DataFrame objects. This can be expensive
        especially if we don't do a narrow transformation after and get it back
        to Spark SQL land quickly."""
        columns = self._schema_rdd.columns
        index_names = self._index_names

        def fromRecords(records):
            if not records:
                return []
            else:
                loaded_df = pd.DataFrame.from_records([records],
                                                      columns=columns)
                indexed_df = _update_index_on_df(loaded_df, index_names)
                return [indexed_df]

        return self._schema_rdd.rdd.flatMap(fromRecords)

    def _column_names(self):
        """Return the column names"""
        index_names = set(_normalize_index_names(self._index_names))
        column_names = [col_name for col_name in self._schema_rdd.columns if
                        col_name not in index_names]
        return column_names

    def _evil_apply_with_dataframes(self, func, preserves_cols=False):
        """Convert the underlying SchmeaRDD to an RDD of DataFrames.
        apply the provide function and convert the result back.
        This is hella slow."""
        source_rdd = self._rdd()
        result_rdd = func(source_rdd)
        # By default we don't know what the columns & indexes are so we let
        # from_rdd_of_dataframes look at the first partition to determine them.
        column_idxs = None
        if preserves_cols:
            index_names = self._index_names
            # Remove indexes from the columns
            columns = self._schema_rdd.columns[len(self._index_names):]
            column_idxs = (columns, index_names)
        return self.from_rdd_of_dataframes(
            result_rdd, column_idxs=column_idxs)

    def _first_as_df(self):
        """Gets the first row as a Panda's DataFrame. Useful for functions like
        dtypes & ftypes"""
        columns = self._schema_rdd.columns
        df = pd.DataFrame.from_records(
            [self._schema_rdd.first()],
            columns=self._schema_rdd.columns)
        df = _update_index_on_df(df, self._index_names)
        return df

    def from_rdd_of_dataframes(self, rdd, column_idxs=None):
        """Take an RDD of Panda's DataFrames and return a Dataframe.
        If the columns and indexes are already known (e.g. applyMap)
        then supplying them with columnsIndexes will skip eveluating
        the first partition to determine index info."""
        def frame_to_spark_sql(frame):
            """Convert a Panda's DataFrame into Spark SQL Rows"""
            return [r.tolist() for r in frame.to_records()]

        def frame_to_schema_and_idx_names(frames):
            """Returns the schema and index names of the frames. Useful
            if the frame is large and we wish to avoid transfering
            the entire frame. Only bothers to apply once per partiton"""
            try:
                frame = frames.next()
                return [(list(frame.columns), list(frame.index.names))]
            except StopIteration:
                return []

        # Store if the RDD was persisted so we don't uncache an
        # explicitly cached input.
        was_persisted = rdd.is_cached
        # If we haven't been supplied with the schema info cache the RDD
        # since we are going to eveluate the first partition and then eveluate
        # the entire RDD as part of creating a Spark DataFrame.
        (schema, index_names) = ([], [])
        if not column_idxs:
            rdd.cache()
            (schema, index_names) = rdd.mapPartitions(
                frame_to_schema_and_idx_names).first()
        else:
            (schema, index_names) = column_idxs
        # Add the index_names to the schema.
        index_names = _normalize_index_names(index_names)
        schema = index_names + schema
        ddf = DataFrame.from_schema_rdd(
            self.sql_ctx.createDataFrame(rdd.flatMap(frame_to_spark_sql),
                                         schema=schema))
        ddf._index_names = index_names
        if not was_persisted:
            rdd.unpersist()
        return ddf

    @classmethod
    def from_schema_rdd(cls, schema_rdd, index_names=None):
        """Construct a DataFrame from an SchemaRDD.
        No checking or validation occurs."""
        return DataFrame(schema_rdd, schema_rdd.sql_ctx, index_names)

    @classmethod
    def fromDataFrameRDD(cls, rdd, sql_ctx):
        """Construct a DataFrame from an RDD of DataFrames.
        No checking or validation occurs."""
        result = DataFrame(None, sql_ctx)
        return result.from_rdd_of_dataframes(rdd)

    @classmethod
    def from_spark_rdd(cls, spark_rdd, sql_ctx):
        """Construct a DataFrame from an RDD.
        No checking or validation occurs."""
        return DataFrame(spark_rdd, sql_ctx)

    def to_spark_sql(self):
        """A Sparkling Pandas specific function to turn a DDF into
        something that Spark SQL can query. To use the result you will
        need to call sqlCtx.inferSchema(rdd) and then register the result
        as a table. Once Spark 1.1 is released this function may be deprecated
        and replacted with to_spark_sql_schema_rdd."""
        return self._schema_rdd

    def applymap(self, f, **kwargs):
        """Return a new DataFrame by applying a function to each element of each
        Panda DataFrame."""
        def transform_rdd(rdd):
            return rdd.map(lambda data: data.applymap(f), **kwargs)
        return self._evil_apply_with_dataframes(transform_rdd,
                                                preserves_cols=True)

    def __getitem__(self, key):
        """Returns a new DataFrame of elements from those keys.
        Note: this differs from Pandas DataFrames in that when selecting
        a single key it returns a series, however we don't have good
        support for series just yet so we always returns DataFrames.
        """
        return self.from_spark_rdd(self._schema_rdd.select(key), self.sql_ctx)

    def groupby(self, by=None, axis=0, level=None, as_index=True, sort=True,
                group_keys=True, squeeze=False):
        """Returns a groupby on the schema rdd. This returns a GroupBy object.
        Note that grouping by a column name will be faster than most other
        options due to implementation."""
        from sparklingpandas.groupby import GroupBy
        return GroupBy(self, by=by, axis=axis, level=level, as_index=as_index,
                       sort=sort, group_keys=group_keys, squeeze=squeeze)

    @property
    def dtypes(self):
        """
        Return the dtypes associated with this object
        Uses the types from the first frame.
        """
        return self._first_as_df().dtypes

    @property
    def ftypes(self):
        """
        Return the ftypes associated with this object
        Uses the types from the first frame.
        """
        return self._first_as_df().ftypes

    def get_dtype_counts(self):
        """
        Return the counts of dtypes in this object
        Uses the information from the first frame
        """
        return self._first_as_df().get_dtype_counts()

    def get_ftype_counts(self):
        """
        Return the counts of ftypes in this object
        Uses the information from the first frame
        """
        return self._first_as_df().get_ftype_counts()

    @property
    def axes(self):
        """
        Returns the axes. Note that the row indexes are junk (TODO fix this)
        """
        return (self._rdd().map(lambda frame: frame.axes)
                .reduce(lambda xy, ab: [xy[0].append(ab[0]), xy[1]]))

    @property
    def shape(self):
        return (self._rdd().map(lambda frame: frame.shape)
                .reduce(lambda xy, ab: (xy[0] + ab[0], xy[1])))

    def collect(self):
        """Collect the elements in an DataFrame
        and concatenate the partition."""
        local_df = self._schema_rdd.toPandas()
        correct_idx_df = _update_index_on_df(local_df, self._index_names)
        return correct_idx_df

    def stats(self, columns):
        """Compute the stats for each column provided in columns.
        Parameters
        ----------
        columns : list of str, contains all columns to compute stats on.
        """
        assert (not isinstance(columns, basestring)), "columns should be a " \
                                                      "list of strs,  " \
                                                      "not a str!"
        assert isinstance(columns, list), "columns should be a list!"

        from pyspark.sql import functions as F
        functions = [F.min, F.max, F.avg, F.count]
        aggs = list(
            self._flatmap(lambda column: map(lambda f: f(column), functions),
                          columns))
        return PStats(self.from_schema_rdd(self._schema_rdd.agg(*aggs)))

    def min(self):
        return self.from_spark_rdd(self._schema_rdd.min(), self.sql_ctx)

    def max(self):
        return self.from_spark_rdd(self._schema_rdd.max(), self.sql_ctx)

    def avg(self):
        return self.from_spark_rdd(self._schema_rdd.avg(), self.sql_ctx)

    def _flatmap(self, f, items):
        return chain.from_iterable(imap(f, items))

# DataFrame helper functions that don't depend on the class
def _update_index_on_df(df, index_names):
    """Helper function to restore index information after collection. Doesn't
    use self so we can serialize this."""
    if index_names:
        df = df.set_index(index_names)
        # Remove names from unnamed indexes
        index_names = _denormalize_index_names(index_names)
        df.index.names = index_names
    return df

def _denormalize_index_names(index_names):
    z = 0
    index_names = list(index_names)
    while z < len(index_names):
        if index_names[z].startswith("index_") or index_names[z] == "index":
            index_names[z] = None
        z = z + 1
    return index_names

def _normalize_index_names(index_names):
    z = 0
    index_names = list(index_names)
    while z < len(index_names):
        if not index_names[z]:
            if z > 0:
                index_names[z] = "index_" + str(z)
            else:
                index_names[z] = "index"
        z = z + 1
    return index_names


text:
desc "Clear done todos"
command :clear do |c|
  c.action do |global_options, options, args|
    committing_tasks { tasks.reject!(&:done?) }
    puts "Done tasks cleared"
  end
end


text:
#include "debug.h"

namespace libcellml {

void printStack(const IndexStack &stack)
{
    bool first = true;
    Debug(false) << "[";
    for (const auto &iter : stack) {
        if (!first) {
            Debug(false) << ", ";
        }
        Debug(false) << iter;
        first = false;
    }
    Debug() << "]";
}

void printEquivalenceMap(const EquivalenceMap &map)
{
    Debug() << "Print out of equivalence map";
    for (const auto &iter : map) {
        auto key = iter.first;
        Debug(false) << "key: ";
        printStack(key);
        auto vector = iter.second;
        for (const auto &vectorIt : vector) {
            Debug(false) << "value: ";
            printStack(vectorIt);
        }
    }
}

void printStringStringMap(const StringStringMap &map)
{
    Debug() << "Print out of string -> string map";
    for (const auto &iter : map) {
        Debug() << iter.first << ": " << iter.second;
    }
}

} // namespace libcellml


text:
#pragma once

#include "geode_defs.hpp"
#include "IGeodeSerializable.hpp"
#include "GeodeClassIds.hpp"

using namespace System;
using namespace System::Collections::Generic;

namespace Apache
{
  namespace Geode
  {
    namespace Client
    {

      /// <summary>
      /// A mutable <c>IGeodeSerializable</c> vector wrapper that can serve as
      /// a distributable object for caching. This class extends .NET generic
      /// <c>List</c> class.
      /// </summary>
      ref class CacheableVector
        : public IGeodeSerializable
      {
      public:
        /// <summary>
        /// Allocates a new empty instance.
        /// </summary>
        inline CacheableVector(System::Collections::IList^ arrayList)
        {
          m_arrayList = arrayList;
        }

        /// <summary>
        /// Static function to create a new empty instance.
        /// </summary>
        inline static CacheableVector^ Create()
        {
          return gcnew CacheableVector(gcnew System::Collections::ArrayList());
        }

        /// <summary>
        /// Static function to create a new empty instance.
        /// </summary>
        inline static CacheableVector^ Create(System::Collections::IList^ list)
        {
          return gcnew CacheableVector(list);
        }

        // Region: IGeodeSerializable Members

        /// <summary>
        /// Serializes this object.
        /// </summary>
        /// <param name="output">
        /// the DataOutput object to use for serializing the object
        /// </param>
        virtual void ToData(DataOutput^ output);

        /// <summary>
        /// Deserialize this object, typical implementation should return
        /// the 'this' pointer.
        /// </summary>
        /// <param name="input">
        /// the DataInput stream to use for reading the object data
        /// </param>
        /// <returns>the deserialized object</returns>
        virtual IGeodeSerializable^ FromData(DataInput^ input);

        /// <summary>
        /// return the size of this object in bytes
        /// </summary>
        virtual property System::UInt32 ObjectSize
        {
          virtual System::UInt32 get();
        }

        /// <summary>
        /// Returns the classId of the instance being serialized.
        /// This is used by deserialization to determine what instance
        /// type to create and deserialize into.
        /// </summary>
        /// <returns>the classId</returns>
        virtual property System::UInt32 ClassId
        {
          virtual System::UInt32 get()
          {
            return GeodeClassIds::CacheableVector;
          }
        }

        virtual property System::Collections::IList^ Value
        {
          virtual System::Collections::IList^ get()
          {
            return m_arrayList;
          }
        }

        // End Region: IGeodeSerializable Members

        /// <summary>
        /// Factory function to register this class.
        /// </summary>
        static IGeodeSerializable^ CreateDeserializable()
        {
          return gcnew CacheableVector(gcnew System::Collections::ArrayList());
        }

      private:
        System::Collections::IList^ m_arrayList;
      };
    }  // namespace Client
  }  // namespace Geode
}  // namespace Apache


text:
package org.olat.presentation.course.nodes.iq;

import java.util.List;
import java.util.Locale;

import org.olat.lms.course.nodes.CourseNode;
import org.olat.lms.course.nodes.IQSURVCourseNode;
import org.olat.presentation.course.nodes.AbstractCourseNodeConfiguration;
import org.olat.presentation.course.nodes.CourseNodeConfiguration;
import org.olat.presentation.framework.core.translator.PackageUtil;
import org.olat.presentation.framework.core.translator.Translator;
import org.olat.presentation.framework.extensions.ExtensionResource;

/**
 * Description:<br>
 * TODO: guido Class Description for IQSURVCourseNodeConfiguration
 */
public class IQSURVCourseNodeConfiguration extends AbstractCourseNodeConfiguration implements CourseNodeConfiguration {

    private IQSURVCourseNodeConfiguration() {
        super();
    }

    @Override
    public CourseNode getInstance() {
        return new IQSURVCourseNode();
    }

    /**
	 */
    @Override
    public String getLinkText(final Locale locale) {
        final Translator fallback = PackageUtil.createPackageTranslator(CourseNodeConfiguration.class, locale);
        final Translator translator = PackageUtil.createPackageTranslator(this.getClass(), locale, fallback);
        return translator.translate("title_iqsurv");
    }

    /**
	 */
    @Override
    public String getIconCSSClass() {
        return "o_iqsurv_icon";
    }

    /**
	 */
    @Override
    public String getLinkCSSClass() {
        return null;
    }

    @Override
    public String getAlias() {
        return "iqsurv";
    }

    //
    // OLATExtension interface implementations.
    //

    public String getName() {
        return getAlias();
    }

    /**
	 */
    public List getExtensionResources() {
        // no ressources, part of main css
        return null;
    }

    /**
	 */
    public ExtensionResource getExtensionCSS() {
        // no ressources, part of main css
        return null;
    }

    /**
	 */
    public void setExtensionResourcesBaseURI(final String ubi) {
        // no need for the URLBuilder
    }

}


text:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using GraphQL.Language.AST;
using GraphQL.Types;
using GraphQL.Utilities;
using GraphQL.Validation;
using AstField = GraphQL.Language.AST.Field;

namespace GraphQL.Instrumentation
{
    [DebuggerDisplay("Type={Category} Subject={Subject} Duration={Duration}")]
    public class PerfRecord
    {
        public PerfRecord()
        {
        }

        public PerfRecord(string category, string subject, long start, Dictionary<string, object> metadata = null)
        {
            Category = category;
            Subject = subject;
            Start = start;
            Metadata = metadata;
        }

        public void MarkEnd(long end)
        {
            End = end;
        }

        public string Category { get; set; }

        public string Subject { get; set; }

        public Dictionary<string, object> Metadata { get; set; }

        public long Start { get; set; }

        public long End { get; set; }

        public long Duration => End - Start;

        public T MetaField<T>(string key)
        {
            object value;

            if (Metadata.TryGetValue(key, out value))
            {
                return (T)value;
            }

            return default(T);
        }
    }

    public class FieldStat
    {
        public string Name { get; set; }
        public string ReturnType { get; set; }

        // TODO: switch this to a histogram
        public long Latency { get; set; }

        public void AddLatency(long duration)
        {
            Latency += duration;
        }
    }

    public class TypeStat
    {
        private readonly LightweightCache<string, FieldStat> _fields =
            new LightweightCache<string, FieldStat>(fieldName => new FieldStat {Name = fieldName});

        public string Name { get; set; }

        public FieldStat[] Fields
        {
            get { return _fields.GetAll(); }
            set
            {
                _fields.Clear();

                value.Apply(f =>
                {
                    _fields[f.Name] = f;
                });
            }
        }

        public FieldStat this[string fieldName] => _fields[fieldName];
    }

    public class StatsPerSignature
    {
        public TypeStat[] PerType { get; set; }
    }

    public class Field
    {
        public string Name { get; set; }
        public string ReturnType { get; set; }
    }

    public class Type
    {
        public string Name { get; set; }
        public Field[] Fields { get; set; }
    }

    public class StatsReport
    {
        public StatsReport()
        {
            PerSignature = new Dictionary<string, StatsPerSignature>();
        }

        public DateTime Start { get; set; }
        public DateTime End { get; set; }
        public long Duration { get; set; }

        public Dictionary<string, StatsPerSignature> PerSignature { get; set; }
        public Type[] Types { get; set; }

        public static StatsReport From(ISchema schema, Operation operation, PerfRecord[] records, DateTime start)
        {
            var operationStat = records.Single(x => string.Equals(x.Category, "operation"));

            var report = new StatsReport();
            report.Start = start;
            report.End = start.AddMilliseconds(operationStat.Duration);
            report.Duration = operationStat.Duration;
            report.Types = TypesFromSchema(schema);

            var perField = new LightweightCache<string, TypeStat>(type => new TypeStat {Name = type});

            var typeInfo = new TypeInfo(schema);

            var fieldVisitor = new EnterLeaveListener(_ =>
            {
                _.Match<AstField>(f =>
                {
                    var parent = typeInfo.GetParentType().GetNamedType();
                    var parentType = parent.Name;
                    var fieldName = f.Name;

                    perField[parentType][fieldName].ReturnType = SchemaPrinter.ResolveName(typeInfo.GetLastType());
                });
            });

            new BasicVisitor(typeInfo, fieldVisitor).Visit(operation);

            var queryResolvers = records.Where(x => string.Equals(x.Category, "field")).ToList();

            queryResolvers.Apply(resolver =>
            {
                var typeName = resolver.MetaField<string>("typeName");
                var fieldName = resolver.MetaField<string>("fieldName");

                perField[typeName][fieldName].AddLatency(resolver.Duration);
            });

            var operationName = operation.Name ?? "Anonymous";

            report.PerSignature[operationName] = new StatsPerSignature {PerType = perField.GetAll()};

            return report;
        }

        public static Type[] TypesFromSchema(ISchema schema)
        {
            return null;
        }
    }
}


text:
package com.jenny.github.Utils;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.Rect;

/**
 * Created by Jenny on 10/19/17.
 */

public class ProfilePhotoUtils {
    public static Bitmap getCroppedBitmap(Bitmap bitmap) {
        Bitmap output = Bitmap.createBitmap(bitmap.getWidth(),
                bitmap.getHeight(), Bitmap.Config.ARGB_8888);
        Canvas canvas = new Canvas(output);

        final int color = 0xff424242;
        final Paint paint = new Paint();
        final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());

        paint.setAntiAlias(true);
        canvas.drawARGB(0, 0, 0, 0);
        paint.setColor(color);
        canvas.drawCircle(bitmap.getWidth() / 2, bitmap.getHeight() / 2,
                bitmap.getWidth() / 2, paint);
        paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
        canvas.drawBitmap(bitmap, rect, rect, paint);
        return output;
    }

}


text:
@class DREvent;

@interface DRInputSource : NSObject {
@private
    NSString * _source;
    NSString * _name;
}

- (id) initWithEvent:(DREvent *)event;
- (id) initWithSource:(NSString *)aSource andName:(NSString *)aName;

@property (nonatomic, copy, readonly) NSString * source;
@property (nonatomic, copy, readonly) NSString * name;
@end