text:
var mongoose = require('mongoose');
var Schema = mongoose.Schema;

var setTag = function(tag) {
  return tag.toLowerCase().trim();
};

var TagSchema = new Schema({
  tag: { type: String, set: setTag, default: '' },
  app_name: { type: String, default: '' }
});

TagSchema.statics = {
  list: function(tagName, cb) {
    this.find({tag: tagName}).exec(cb);
  },
  search: function(string, cb) {
    var regex = new RegExp(string, "i");
    this.distinct('tag', { 'tag': regex }).exec(cb);
  }
};

var tag = mongoose.model("Tag", TagSchema);

module.exports = {
  Tag: tag
};

redpajama_set_name: RedPajamaGithub


text:
template_string = '''
universe                = vanilla
should_transfer_files   = YES
when_to_transfer_output = ON_EXIT_OR_EVICT
Transfer_Executable     = false
transfer_input_files    = ${input_files}
machine_count           = ${nodes}
output                  = ${submit_script_dir}/${job_name}.stdout
error                   = ${submit_script_dir}/${job_name}.stderr
executable              = /bin/bash
arguments               = ${job_script}
requirements            = ${requirements}
+projectname            = ${project}
leave_in_queue          = TRUE
environment             = "${environment}"
${scheduler_options}

queue

'''

# for later,
# if we want to remove on preemption, this might work:
#    PERIODIC_REMOVE = (NumJobstarts > 1)
# or if the pilot can trap signals, then we can send a special exit code on
# sigterm/sigkill and remove that way. but then we still need to be careful in
# cases where the worker dies, for example-- no signal is sent


text:
using System.Linq;
using LibrarySystemLiveDemo.Data.Models;
using System;
namespace LibrarySystemLiveDemo.Services
{
    public interface ICategoryService
    {
        IQueryable<Category> GetAllCategoriesWithBooksIncluded();

        IQueryable<Category> GetAllCategoriesSortedById();

        Category GetById(Guid id);

        int InsertCategory(Category category);

        int DeleteCategory(Guid categoryId);

        int UpdateCategory(Category category);
    }
}


text:
<?php namespace App\Interpreter\Handler\Assert;

use App\Interpreter\AstRepository;
use App\Interpreter\Handler\Invariant;

class Factory
{
    private $ast_repository;
    private $invariant_factory;

    public function __construct(
        AstRepository $ast_repository,
        Invariant\Factory $invariant_factory
    )
    {
        $this->ast_repository = $ast_repository;
        $this->invariant_factory = $invariant_factory;
    }

    public function ast($ast)
    {
        $invariant_ast = $this->ast_repository->fetch($ast->invariant_id);
        $invariant = $this->invariant_factory->ast($invariant_ast);
        $arguments = isset($ast->arguments) ? $ast->arguments : null;
        return new Interpreter($invariant, $ast->comparator, $arguments);
    }
}


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

namespace PiStudio.Win10.Voice.Navigation
{
	/// <summary>
	/// Result of speech recognition. Wrapper to <see cref="Windows.Media.SpeechRecognition.SpeechRecognitionResult"/>.
	/// </summary>
	public class SpeechRecognitionResult
	{
		private Windows.Media.SpeechRecognition.SpeechRecognitionResult m_result;
		private Commands.VoiceCommands m_commands;

		/// <summary>
		/// Creates new instance of <see cref="SpeechRecognitionResult"/>
		/// </summary>
		/// <param name="result"><see cref="Windows.Media.SpeechRecognition.SpeechRecognitionResult"/></param>
		/// <param name="set"><see cref="CommandsLayer.VoiceCommands"/> from which was command recognized</param>
		public SpeechRecognitionResult(Windows.Media.SpeechRecognition.SpeechRecognitionResult result, Commands.VoiceCommands commands)
		{
			m_recognizedPhraseListValues = new Dictionary<string, string>();
			m_recognizedPhraseTopicsValues = new Dictionary<string, string>();
			this.m_result = result;
			if (commands != null)
			{
				this.m_commands = commands;
				RecognizedCommand = null;
				Commands.CommandSet selectedSet = null;

				foreach (var set in m_commands.CommandSets)
				{
					RecognizedCommand = set.Commands.Where(i =>
					{
						string cmd;
						if (result.SemanticInterpretation.Properties.ContainsKey("RecognizedCommand"))
							cmd = result.SemanticInterpretation.Properties["RecognizedCommand"].FirstOrDefault();
						else
						{
							cmd = result.RulePath[0];
						}
						if (cmd != null)
							return i.Name == cmd;
						return false;
					}).FirstOrDefault();

					if (RecognizedCommand != null)
					{
						selectedSet = set;
						break;
					}
				}

				if (selectedSet != null)
				{
					foreach (var key in result.SemanticInterpretation.Properties.Keys)
					{
						if (selectedSet.PhraseLists.Where(i => i.Label == key).Count() != 0)
							m_recognizedPhraseListValues.Add(key, result.SemanticInterpretation.Properties[key][0]);
						else if (selectedSet.PhraseTopics.Where(i => i.Label == key).Count() != 0)
							m_recognizedPhraseTopicsValues.Add(key, result.SemanticInterpretation.Properties[key][0]);
					}
				}
			}

			SpokenText = result.Text;
		}

		/// <summary>
		/// Creates new instance of <see cref="SpeechRecognitionResult"/>
		/// </summary>
		/// <param name="result"><see cref="Windows.Media.SpeechRecognition.SpeechRecognitionResult"/></param>
		public SpeechRecognitionResult(Windows.Media.SpeechRecognition.SpeechRecognitionResult result)
		{
			m_recognizedPhraseListValues = new Dictionary<string, string>();
			m_recognizedPhraseTopicsValues = new Dictionary<string, string>();
			this.m_result = result;
			RecognizedCommand = null;
			SpokenText = result.Text;
		}

		/// <summary>
		/// <see cref="Commands.Command"/> that was recognized in recognition.
		/// </summary>
		public Commands.Command RecognizedCommand { get; private set; }

		/// <summary>
		/// Recognized text by the recognizer.
		/// </summary>
		public string SpokenText { get; private set; }

		/// <summary>
		/// Status of the recognition. The recognition was successful only if the status is Success
		/// </summary>
		public SpeechRecognitionResultStatus Status
		{
			get
			{
				return m_result.Status;
			}
		}

		/// <summary>
		/// Raw confidance of the result.
		/// </summary>
		public double RawConfidance
		{
			get
			{
				return m_result.RawConfidence;
			}
		}

		/// <summary>
		/// Time when user starts saying the phrase
		/// </summary>
		public DateTimeOffset PhraseStartTime
		{
			get
			{
				return m_result.PhraseStartTime;
			}
		}

		/// <summary>
		/// Duration of phrase
		/// </summary>
		public TimeSpan PhraseDuration
		{
			get
			{
				return m_result.PhraseDuration;
			}
		}

		/// <summary>
		/// Confidance of the result. Can be High, Low, Medium or Rejected
		/// </summary>
		public SpeechRecognitionConfidence Confidance
		{
			get
			{
				return m_result.Confidence;
			}
		}

		/// <summary>
		/// Constrain of the <see cref="SpeechRecognizer"/>. Types are: List, Topic, Grammar or VCD
		/// </summary>
		public ISpeechRecognitionConstraint Constraint
		{
			get
			{
				return m_result.Constraint;
			}
		}

		private Dictionary<string, string> m_recognizedPhraseListValues;
		private Dictionary<string, string> m_recognizedPhraseTopicsValues;

		/// <summary>
		/// Dictionary where key is the name of the <see cref="Commands.PhraseList"/> and value is recognized item of the <see cref="Commands.PhraseList"/>
		/// </summary>
		public IReadOnlyDictionary<string, string> ReconizedPhraseListsValues
		{
			get
			{
				return m_recognizedPhraseListValues;
			}
		}

		/// <summary>
		/// Dictionary where key is the name of the <see cref="Commands.PhraseTopic"/> and value is recognized phrase that is beforehand unknown.
		/// </summary>
		public IReadOnlyDictionary<string, string> RecognizedPhraseTopicsValues
		{
			get
			{
				return m_recognizedPhraseTopicsValues;
			}
		}

		/// <summary>
		/// Gets the alternates of this command.
		/// </summary>
		/// <param name="maxAlternates">Max number of alternates.</param>
		/// <returns></returns>
		public IReadOnlyList<SpeechRecognitionResult> GetAlternates(uint maxAlternates)
		{
			List<SpeechRecognitionResult> alternates = new List<SpeechRecognitionResult>();
			foreach (var alternate in m_result.GetAlternates(maxAlternates))
			{
				if (this.m_commands != null)
					alternates.Add(new SpeechRecognitionResult(alternate, this.m_commands));
				else alternates.Add(new SpeechRecognitionResult(alternate));

			}
			return alternates;
		}

        /// <summary>
        /// Indicates whether response will be said after recognizing the command.
        /// </summary>
        public bool PreventFromSayingResponse { get; set; }
	}
}


text:
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Text;

namespace FineUI.Examples.grid
{
    public partial class grid_rowdatabound : PageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindGrid();

            }
        }

        #region BindGrid

        private void BindGrid()
        {
            DataTable table = DataSourceUtil.GetDataTable();

            Grid1.DataSource = table;
            Grid1.DataBind();
        }

        #endregion

        #region Events

        /// <summary>
        /// 这个事件会在渲染每一行后调用,此时 Values 属性保存了每一项渲染后的 HTML 片段
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
        {
            // e.DataItem  -> System.Data.DataRowView 或者自定义类
            // e.RowIndex -> 当前行序号(从 0 开始)
            // e.Values -> 当前行每一列渲染后的 HTML 片段

            //object a = Grid1.DataKeys[e.RowIndex][0];

            DataRowView row = e.DataItem as DataRowView;
            if (row != null)
            {
                e.Values[4] = String.Format("{0} ({1})", e.Values[4], row["EntranceYear"]);
            }
        }

        protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
        {
            if (e.CommandName == "Action1" || e.CommandName == "Action2")
            {
                labResult.Text = String.Format("你点击了第 {0} 行,第 {1} 列,行命令是 {2}", e.RowIndex + 1, e.ColumnIndex + 1, e.CommandName);
            }
        }

        #endregion

    }
}


text:
Ingreso de usuario

        <form class="form-signin" role="form">
            <input type="text" ng-model="login.usuario" class="form-control" placeholder="Usuario" required="" autofocus="">
            <input type="password" ng-model="login.clave" class="form-control" placeholder="Clave" required="">

        <button class="btn btn-lg btn-primary btn-block"  ng-click="login()">Ingresar</button>
      </form>


text:
(function() {
	angular.module('ui.grid').config(['$provide', function($provide) {
		$provide.decorator('i18nService', ['$delegate', function($delegate) {
			$delegate.add('tr', {
				headerCell: {
					aria: {
						defaultFilterLabel: 'Sütun için filtre',
						removeFilter: 'Filtreyi Kaldır',
						columnMenuButtonLabel: 'Sütun Menüsü'
					},
					priority: 'Öncelik:',
					filterLabel: "Sütun için filtre: "
				},
				aggregate: {
					label: 'kayıtlar'
				},
				groupPanel: {
					description: 'Sütuna göre gruplamak için sütun başlığını buraya sürükleyin ve bırakın.'
				},
				search: {
					placeholder: 'Arama...',
					showingItems: 'Gösterilen Kayıt:',
					selectedItems: 'Seçili Kayıt:',
					totalItems: 'Toplam Kayıt:',
					size: 'Sayfa Boyutu:',
					first: 'İlk Sayfa',
					next: 'Sonraki Sayfa',
					previous: 'Önceki Sayfa',
					last: 'Son Sayfa'
				},
				menu: {
					text: 'Sütunları Seç:'
				},
				sort: {
					ascending: 'Artan Sırada Sırala',
					descending: 'Azalan Sırada Sırala',
					none: 'Sıralama Yapma',
					remove: 'Sıralamayı Kaldır'
				},
				column: {
					hide: 'Sütunu Gizle'
				},
				aggregation: {
					count: 'toplam satır: ',
					sum: 'toplam: ',
					avg: 'ort: ',
					min: 'min: ',
					max: 'maks: '
				},
				pinning: {
					pinLeft: 'Sola Sabitle',
					pinRight: 'Sağa Sabitle',
					unpin: 'Sabitlemeyi Kaldır'
				},
				columnMenu: {
					close: 'Kapat'
				},
				gridMenu: {
					aria: {
						buttonLabel: 'Tablo Menü'
					},
					columns: 'Sütunlar:',
					importerTitle: 'Dosya içeri aktar',
					exporterAllAsCsv: 'Bütün veriyi CSV olarak dışarı aktar',
					exporterVisibleAsCsv: 'Görünen veriyi CSV olarak dışarı aktar',
					exporterSelectedAsCsv: 'Seçili veriyi CSV olarak dışarı aktar',
					exporterAllAsPdf: 'Bütün veriyi PDF olarak dışarı aktar',
					exporterVisibleAsPdf: 'Görünen veriyi PDF olarak dışarı aktar',
					exporterSelectedAsPdf: 'Seçili veriyi PDF olarak dışarı aktar',
					clearAllFilters: 'Bütün filtreleri kaldır'
				},
				importer: {
					noHeaders: 'Sütun isimleri üretilemiyor, dosyanın bir başlığı var mı?',
					noObjects: 'Nesneler üretilemiyor, dosyada başlıktan başka bir veri var mı?',
					invalidCsv: 'Dosya işlenemedi, geçerli bir CSV dosyası mı?',
					invalidJson: 'Dosya işlenemedi, geçerli bir Json dosyası mı?',
					jsonNotArray: 'Alınan Json dosyasında bir dizi bulunmalıdır, işlem iptal ediliyor.'
				},
				pagination: {
					aria: {
						pageToFirst: 'İlk sayfaya',
						pageBack: 'Geri git',
						pageSelected: 'Seçili sayfa',
						pageForward: 'İleri git',
						pageToLast: 'Sona git'
					},
					sizes: 'Sayfadaki nesne sayısı',
					totalItems: 'kayıtlar',
					through: '', // note(fsw) : turkish dont have this preposition
					of: '' // note(fsw) : turkish dont have this preposition
				},
				grouping: {
					group: 'Grupla',
					ungroup: 'Gruplama',
					aggregate_count: 'Yekun: Sayı',
					aggregate_sum: 'Yekun: Toplam',
					aggregate_max: 'Yekun: Maks',
					aggregate_min: 'Yekun: Min',
					aggregate_avg: 'Yekun: Ort',
					aggregate_remove: 'Yekun: Sil'
				}
			});
			return $delegate;
		}]);
	}]);
})();


text:
package net.dvt32.todo;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TodoRestController {

	@Autowired
	TodoService todoService;

	@RequestMapping(value="/todos")
	public List<Todo> retrieveAllTodos() {
		return todoService.retrieveTodos("dvt32");
	}

	@RequestMapping(value="/todos/{id}")
	public Todo retrieveTodo(@PathVariable int id) {
		return todoService.retrieveTodo(id);
	}
}


text:
(work in progress)

installation:

	npm install stupid-dom-interface

beta testing:

	DUM = require 'StupidDOMInterface'

	element = document.querySelector('.element')

	# optional init

	props =

		height: 200
		width: 300

		opacity: .8

		top: 100
		left: 120
		bottom: 200
		right: 400

		textShadowH: 5
		textShadowV: 10
		textShadowColor: [255, 100, 50]

		textShadowBlur: 10

		rotateX: 10
		rotateY: 20
		rotateZ: 40

		x: 20
		y: 30
		z: 40

		localX: 100
		localY: 102
		localZ: 103

		scaleX: 1.1
		scaleY: 1.1
		scaleZ: 1.1

		skewX: 20
		skewY: 30

		perspective: 400

	dumElement1 = new DUM(element, props)
	.x(400)
	.y(200)

	console.log dumElement1.getX()

	dumElement2 = DUM('.hello', props)
	.inside(document.body)
	.html('custom html')
	.set('someVar', 'some value')

	console.log dumElement2.get('someVar')
	console.log dumElement2.current('width')

	dumInput3 = DUM('input[type=text, placeholder=x, value=20].cssclass1.classClass2')
	.inside(dumElement2)

	dumInput3.node.addEventListener('change', callbackFunction)


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

<title>Uses of Class java.awt.Image (Java Platform SE 7 )</title>
<meta name="date" content="2014-12-18">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Java™ Platform
Standard Ed. 7

Prev

Next

Frames

No Frames

All Classes

Uses of Class
java.awt.Image

Packages that use Image

Package
Description

java.applet

Provides the classes necessary to create an applet and the classes an applet
uses to communicate with its applet context.

java.awt

Contains all of the classes for creating user
interfaces and for painting graphics and images.

java.awt.dnd

Drag and Drop is a direct manipulation gesture found in many Graphical
User Interface systems that provides a mechanism to transfer
information between two entities logically associated with presentation
elements in the GUI.

java.awt.font

Provides classes and interface relating to fonts.

java.awt.im.spi

Provides interfaces that enable the development of input methods
that can be used with any Java runtime environment.

java.awt.image

Provides classes for creating and modifying images.

java.beans

Contains classes related to developing
beans -- components
based on the JavaBeans™ architecture.

javax.swing

Provides a set of "lightweight"
(all-Java language) components that,
to the maximum degree possible, work the same on all platforms.

javax.swing.text.html

Provides the class HTMLEditorKit and supporting classes
for creating HTML text editors.

Uses of Image in java.applet

Methods in java.applet that return Image

Modifier and Type
Method and Description

Image
AppletContext.getImage(URL url)

Returns an Image object that can then be painted on
 the screen.

Image
Applet.getImage(URL url)

Returns an Image object that can then be painted on
 the screen.

Image
Applet.getImage(URL url,
        String name)

Returns an Image object that can then be painted on
 the screen.

Uses of Image in java.awt

Fields in java.awt declared as Image

Modifier and Type
Field and Description

protected Image
Component.FlipBufferStrategy.drawBuffer

The drawing buffer

Methods in java.awt that return Image

Modifier and Type
Method and Description

Image
Toolkit.createImage(byte[] imagedata)

Creates an image which decodes the image stored in the specified
 byte array.

abstract Image
Toolkit.createImage(byte[] imagedata,
           int imageoffset,
           int imagelength)

Creates an image which decodes the image stored in the specified
 byte array, and at the specified offset and length.

abstract Image
Toolkit.createImage(ImageProducer producer)

Creates an image with the specified image producer.

Image
Component.createImage(ImageProducer producer)

Creates an image from the specified image producer.

Image
Component.createImage(int width,
           int height)

Creates an off-screen drawable image
     to be used for double buffering.

abstract Image
Toolkit.createImage(String filename)

Returns an image which gets pixel data from the specified file.

abstract Image
Toolkit.createImage(URL url)

Returns an image which gets pixel data from the specified URL.

protected Image
Component.FlipBufferStrategy.getBackBuffer()

Image
Frame.getIconImage()

Returns the image to be displayed as the icon for this frame.

Image
TrayIcon.getImage()

Returns the current image used for this TrayIcon.

abstract Image
Toolkit.getImage(String filename)

Returns an image which gets pixel data from the specified file,
 whose format can be either GIF, JPEG or PNG.

abstract Image
Toolkit.getImage(URL url)

Returns an image which gets pixel data from the specified URL.

Image
Image.getScaledInstance(int width,
                 int height,
                 int hints)

Creates a scaled version of this image.

Methods in java.awt that return types with arguments of type Image

Modifier and Type
Method and Description

List<Image>
Window.getIconImages()

Returns the sequence of images to be displayed as the icon for this window.

Methods in java.awt with parameters of type Image

Modifier and Type
Method and Description

void
MediaTracker.addImage(Image image,
        int id)

Adds an image to the list of images being tracked by this media
 tracker.

void
MediaTracker.addImage(Image image,
        int id,
        int w,
        int h)

Adds a scaled image to the list of images being tracked
 by this media tracker.

int
Component.checkImage(Image image,
          ImageObserver observer)

Returns the status of the construction of a screen representation
 of the specified image.

abstract int
Toolkit.checkImage(Image image,
          int width,
          int height,
          ImageObserver observer)

Indicates the construction status of a specified image that is
 being prepared for display.

int
Component.checkImage(Image image,
          int width,
          int height,
          ImageObserver observer)

Returns the status of the construction of a screen representation
 of the specified image.

Cursor
Toolkit.createCustomCursor(Image cursor,
                  Point hotSpot,
                  String name)

Creates a new custom cursor object.

abstract boolean
Graphics2D.drawImage(Image img,
         AffineTransform xform,
         ImageObserver obs)

Renders an image, applying a transform from image space into user space
 before drawing.

abstract boolean
Graphics.drawImage(Image img,
         int x,
         int y,
         Color bgcolor,
         ImageObserver observer)

Draws as much of the specified image as is currently available.

abstract boolean
Graphics.drawImage(Image img,
         int x,
         int y,
         ImageObserver observer)

Draws as much of the specified image as is currently available.

abstract boolean
Graphics.drawImage(Image img,
         int x,
         int y,
         int width,
         int height,
         Color bgcolor,
         ImageObserver observer)

Draws as much of the specified image as has already been scaled
 to fit inside the specified rectangle.

abstract boolean
Graphics.drawImage(Image img,
         int x,
         int y,
         int width,
         int height,
         ImageObserver observer)

Draws as much of the specified image as has already been scaled
 to fit inside the specified rectangle.

abstract boolean
Graphics.drawImage(Image img,
         int dx1,
         int dy1,
         int dx2,
         int dy2,
         int sx1,
         int sy1,
         int sx2,
         int sy2,
         Color bgcolor,
         ImageObserver observer)

Draws as much of the specified area of the specified image as is
 currently available, scaling it on the fly to fit inside the
 specified area of the destination drawable surface.

abstract boolean
Graphics.drawImage(Image img,
         int dx1,
         int dy1,
         int dx2,
         int dy2,
         int sx1,
         int sy1,
         int sx2,
         int sy2,
         ImageObserver observer)

Draws as much of the specified area of the specified image as is
 currently available, scaling it on the fly to fit inside the
 specified area of the destination drawable surface.

boolean
Component.imageUpdate(Image img,
           int infoflags,
           int x,
           int y,
           int w,
           int h)

Repaints the component when the image has changed.

boolean
Component.prepareImage(Image image,
            ImageObserver observer)

Prepares an image for rendering on this component.

abstract boolean
Toolkit.prepareImage(Image image,
            int width,
            int height,
            ImageObserver observer)

Prepares an image for rendering.

boolean
Component.prepareImage(Image image,
            int width,
            int height,
            ImageObserver observer)

Prepares an image for rendering on this component at the
 specified width and height.

void
MediaTracker.removeImage(Image image)

Removes the specified image from this media tracker.

void
MediaTracker.removeImage(Image image,
           int id)

Removes the specified image from the specified tracking
 ID of this media tracker.

void
MediaTracker.removeImage(Image image,
           int id,
           int width,
           int height)

Removes the specified image with the specified
 width, height, and ID from this media tracker.

void
Frame.setIconImage(Image image)

Sets the image to be displayed as the icon for this window.

void
Window.setIconImage(Image image)

Sets the image to be displayed as the icon for this window.

void
TrayIcon.setImage(Image image)

Sets the image for this TrayIcon.

Method parameters in java.awt with type arguments of type Image

Modifier and Type
Method and Description

void
Window.setIconImages(List<? extends Image> icons)

Sets the sequence of images to be displayed as the icon
 for this window.

Constructors in java.awt with parameters of type Image

Constructor and Description

TrayIcon(Image image)

Creates a TrayIcon with the specified image.

TrayIcon(Image image,
        String tooltip)

Creates a TrayIcon with the specified image and
 tooltip text.

TrayIcon(Image image,
        String tooltip,
        PopupMenu popup)

Creates a TrayIcon with the specified image,
 tooltip and popup menu.

Uses of Image in java.awt.dnd

Methods in java.awt.dnd with parameters of type Image

Modifier and Type
Method and Description

protected DragSourceContext
DragSource.createDragSourceContext(java.awt.dnd.peer.DragSourceContextPeer dscp,
                       DragGestureEvent dgl,
                       Cursor dragCursor,
                       Image dragImage,
                       Point imageOffset,
                       Transferable t,
                       DragSourceListener dsl)

Creates the DragSourceContext to handle the current drag
 operation.

void
DragGestureEvent.startDrag(Cursor dragCursor,
         Image dragImage,
         Point imageOffset,
         Transferable transferable,
         DragSourceListener dsl)

Start the drag given the initial Cursor to display,
 a drag Image, the offset of
 the Image,
 the Transferable object, and
 the DragSourceListener to use.

void
DragSource.startDrag(DragGestureEvent trigger,
         Cursor dragCursor,
         Image dragImage,
         Point dragOffset,
         Transferable transferable,
         DragSourceListener dsl)

Start a drag, given the DragGestureEvent
 that initiated the drag, the initial Cursor
 to use,
 the Image to drag,
 the offset of the Image origin
 from the hotspot of the Cursor
 at the instant of the trigger,
 the subject data of the drag, and
 the DragSourceListener.

void
DragSource.startDrag(DragGestureEvent trigger,
         Cursor dragCursor,
         Image dragImage,
         Point imageOffset,
         Transferable transferable,
         DragSourceListener dsl,
         FlavorMap flavorMap)

Start a drag, given the DragGestureEvent
 that initiated the drag, the initial
 Cursor to use,
 the Image to drag,
 the offset of the Image origin
 from the hotspot of the Cursor at
 the instant of the trigger,
 the Transferable subject data
 of the drag, the DragSourceListener,
 and the FlavorMap.

Constructors in java.awt.dnd with parameters of type Image

Constructor and Description

DragSourceContext(java.awt.dnd.peer.DragSourceContextPeer dscp,
                 DragGestureEvent trigger,
                 Cursor dragCursor,
                 Image dragImage,
                 Point offset,
                 Transferable t,
                 DragSourceListener dsl)

Called from DragSource, this constructor creates a new
 DragSourceContext given the
 DragSourceContextPeer for this Drag, the
 DragGestureEvent that triggered the Drag, the initial
 Cursor to use for the Drag, an (optional)
 Image to display while the Drag is taking place, the offset
 of the Image origin from the hotspot at the instant of the
 triggering event, the Transferable subject data, and the
 DragSourceListener to use during the Drag and Drop
 operation.

Uses of Image in java.awt.font

Constructors in java.awt.font with parameters of type Image

Constructor and Description

ImageGraphicAttribute(Image image,
                     int alignment)

Constucts an ImageGraphicAttribute from the specified
 Image.

ImageGraphicAttribute(Image image,
                     int alignment,
                     float originX,
                     float originY)

Constructs an ImageGraphicAttribute from the specified
 Image.

Uses of Image in java.awt.im.spi

Methods in java.awt.im.spi that return Image

Modifier and Type
Method and Description

Image
InputMethodDescriptor.getInputMethodIcon(Locale inputLocale)

Returns an icon for the corresponding input method.

Uses of Image in java.awt.image

Subclasses of Image in java.awt.image

Modifier and Type
Class and Description

class
BufferedImage

The BufferedImage subclass describes an Image with an accessible buffer of image data.

class
VolatileImage

VolatileImage is an image which can lose its
 contents at any time due to circumstances beyond the control of the
 application (e.g., situations caused by the operating system or by
 other applications).

Methods in java.awt.image with parameters of type Image

Modifier and Type
Method and Description

boolean
ImageObserver.imageUpdate(Image img,
           int infoflags,
           int x,
           int y,
           int width,
           int height)

This method is called when information about an image which was
 previously requested using an asynchronous interface becomes
 available.

Constructors in java.awt.image with parameters of type Image

Constructor and Description

PixelGrabber(Image img,
            int x,
            int y,
            int w,
            int h,
            boolean forceRGB)

Create a PixelGrabber object to grab the (x, y, w, h) rectangular
 section of pixels from the specified image.

PixelGrabber(Image img,
            int x,
            int y,
            int w,
            int h,
            int[] pix,
            int off,
            int scansize)

Create a PixelGrabber object to grab the (x, y, w, h) rectangular
 section of pixels from the specified image into the given array.

Uses of Image in java.beans

Methods in java.beans that return Image

Modifier and Type
Method and Description

Image
BeanInfo.getIcon(int iconKind)

This method returns an image object that can be used to
 represent the bean in toolboxes, toolbars, etc.

Image
SimpleBeanInfo.getIcon(int iconKind)

Claim there are no icons available.

Image
SimpleBeanInfo.loadImage(String resourceName)

This is a utility method to help in loading icon images.

Uses of Image in javax.swing

Fields in javax.swing declared as Image

Modifier and Type
Field and Description

protected Image
JViewport.backingStoreImage

The view image used for a backing store.

Methods in javax.swing that return Image

Modifier and Type
Method and Description

static Image
GrayFilter.createDisabledImage(Image i)

Creates a disabled image

Image
TransferHandler.getDragImage()

Returns the drag image.

Image
ImageIcon.getImage()

Returns this icon's Image.

Image
RepaintManager.getOffscreenBuffer(Component c,
                  int proposedWidth,
                  int proposedHeight)

Return the offscreen buffer that should be used as a double buffer with
 the component c.

Image
RepaintManager.getVolatileOffscreenBuffer(Component c,
                          int proposedWidth,
                          int proposedHeight)

Return a volatile offscreen buffer that should be used as a
 double buffer with the specified component c.

Methods in javax.swing with parameters of type Image

Modifier and Type
Method and Description

static Image
GrayFilter.createDisabledImage(Image i)

Creates a disabled image

boolean
DebugGraphics.drawImage(Image img,
         int x,
         int y,
         Color bgcolor,
         ImageObserver observer)

Overrides Graphics.drawImage.

boolean
DebugGraphics.drawImage(Image img,
         int x,
         int y,
         ImageObserver observer)

Overrides Graphics.drawImage.

boolean
DebugGraphics.drawImage(Image img,
         int x,
         int y,
         int width,
         int height,
         Color bgcolor,
         ImageObserver observer)

Overrides Graphics.drawImage.

boolean
DebugGraphics.drawImage(Image img,
         int x,
         int y,
         int width,
         int height,
         ImageObserver observer)

Overrides Graphics.drawImage.

boolean
DebugGraphics.drawImage(Image img,
         int dx1,
         int dy1,
         int dx2,
         int dy2,
         int sx1,
         int sy1,
         int sx2,
         int sy2,
         Color bgcolor,
         ImageObserver observer)

Overrides Graphics.drawImage.

boolean
DebugGraphics.drawImage(Image img,
         int dx1,
         int dy1,
         int dx2,
         int dy2,
         int sx1,
         int sy1,
         int sx2,
         int sy2,
         ImageObserver observer)

Overrides Graphics.drawImage.

boolean
AbstractButton.imageUpdate(Image img,
           int infoflags,
           int x,
           int y,
           int w,
           int h)

This is overridden to return false if the current Icon's
 Image is not equal to the
 passed in Image img.

boolean
JLabel.imageUpdate(Image img,
           int infoflags,
           int x,
           int y,
           int w,
           int h)

This is overridden to return false if the current Icon's Image is
 not equal to the passed in Image img.

boolean
JSlider.imageUpdate(Image img,
           int infoflags,
           int x,
           int y,
           int w,
           int h)

Repaints the component when the image has changed.

protected void
ImageIcon.loadImage(Image image)

Loads the image, returning only when the image is loaded.

void
TransferHandler.setDragImage(Image img)

Sets the drag image parameter.

void
JFrame.setIconImage(Image image)

Sets the image to be displayed as the icon for this window.

void
ImageIcon.setImage(Image image)

Sets the image displayed by this icon.

Constructors in javax.swing with parameters of type Image

Constructor and Description

ImageIcon(Image image)

Creates an ImageIcon from an image object.

ImageIcon(Image image,
         String description)

Creates an ImageIcon from the image.

Uses of Image in javax.swing.text.html

Methods in javax.swing.text.html that return Image

Modifier and Type
Method and Description

Image
ImageView.getImage()

Returns the image to render.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Java™ Platform
Standard Ed. 7

Prev

Next

Frames

No Frames

All Classes

 Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2015, Oracle and/or its affiliates.  All rights reserved.


text:
<!--
  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.
-->
<assembly>
  <id>uber</id>
  <formats>
    <format>jar</format>
  </formats>
  <includeBaseDirectory>false</includeBaseDirectory>
  <dependencySets>
    <dependencySet>
      <outputDirectory>/</outputDirectory>
      <useProjectArtifact>true</useProjectArtifact>
      <unpack>true</unpack>
      <scope>runtime</scope>
    </dependencySet>
  </dependencySets>
  <containerDescriptorHandlers>
    <containerDescriptorHandler>
      <handlerName>metaInf-services</handlerName>
    </containerDescriptorHandler>
  </containerDescriptorHandlers>
</assembly>


text:
module AceSkin
  module AceForm
    module Elements
      class ShopSelect < Base

        def ext_html
          {'data-toggle' => 'shop_select', 'type' => 'text', 'data-max-size' => max_size, }
        end

        def max_size
          options[:max_size] || 100000
        end

      end
    end
  end
end


text:
start = AskAddr(0xFFFFFFFF, "Enter start address.")
end = AskAddr(0xFFFFFFFF, "Enter end address.")
addr_sz = AskLong(4, "Size of offset to each entry in bytes?")

def transform_to_code(start, end):
  while start < end:
	if isCode(start):  return
	l = MakeCode(start)
	if l:
	  print "Converted 0x%08x to code."%start
	  start += l
	elif GetOpType(start, 0) == -1:
	  start+=1
	else:
	  break
  return start

if start >= end:
  print "Please enter a valid start and end address start: 0x%08x end: 0x%08x."%(start,end)

while  start < end:
  if Dfirst(start) != 0xFFFFFFFF:
	transform_to_code(Dfirst(start), Dfirst(start)+1)
  start += addr_sz

print "Finished cleaning up the jump table code."


text:
from datetime import datetime

from django.db.models import Count
from django.core.paginator import Paginator, InvalidPage, EmptyPage
from django.shortcuts import render_to_response, get_object_or_404
from django.template import Context, RequestContext, loader
from django.core.urlresolvers import reverse
from django.http import Http404
from django.conf import settings
from django.utils.translation import ugettext_lazy as _

from posts.models import Post

if settings.DATABASES['default']['ENGINE'].find('postgresql') != -1:
  DB_TYPE = "postgresql"
elif settings.DATABASES['default']['ENGINE'].find('mysql') != -1:
  DB_TYPE = "mysql"
elif settings.DATABASES['default']['ENGINE'].find('sqlite') != -1:
  DB_TYPE = "sqlite"

def recent(request):
  if hasattr(request, 'breadcrumbs'):
    request.breadcrumbs(_("Posts"), reverse("posts-archive"))
    request.breadcrumbs(_("Recent"), reverse("posts-recent"))

  return render_to_response('posts/recent.html',
    { "posts" : Post.objects.filter(is_public=True).order_by("-date")[0:5] },
    context_instance = RequestContext(request)
  )

def archive(request):

  if hasattr(request, 'breadcrumbs'):
    request.breadcrumbs(_("Posts"), reverse("posts-archive"))

  if DB_TYPE == "sqlite":
    year = "django_date_trunc('year', 'posts_post'.'date')"
  elif DB_TYPE == "mysql":
    year = "YEAR(`posts_post`.`date`)"

  yearsraw = list(Post.objects.filter(is_public=True).extra(select={"year" : year}).values('year').order_by('year').annotate(entries=Count('id')))

  if DB_TYPE == "sqlite":
    years = [ {'entries' : o['entries'], 'year' : o['year'][:4]} for o in yearsraw ]
  elif DB_TYPE == "mysql":
    years = [ {'entries' : o['entries'], 'year' : o['year']} for o in yearsraw ]

  return render_to_response('posts/archive.html',
    { "years" : years },
    context_instance = RequestContext(request)
  )

def archiveyear(request, year):
  year = min(int(year), 9999)

  if hasattr(request, 'breadcrumbs'):
    request.breadcrumbs(_("Posts"), reverse("posts-archive"))
    request.breadcrumbs(year, reverse("posts-archive-year", kwargs={"year" : "%04d" % year}))

  if DB_TYPE == "sqlite":
    month = "django_date_trunc('month', 'posts_post'.'date')"
  elif DB_TYPE == "mysql":
    month = "MONTH(`posts_post`.`date`)"

  months = [ {'entries' : 0, 'month' : i, 'name' : datetime(2000, i, 1).strftime("%B")} for i in xrange(1, 13) ]

  monthsraw = list(Post.objects.filter(is_public=True, date__year = year).extra(select={"month" : month}).values('month').order_by().annotate(entries=Count('id')))

  if DB_TYPE == "sqlite":
    for o in monthsraw:
      months[int(o['month'][5:7])-1]['entries'] = o['entries']
  if DB_TYPE == "mysql":
    for o in monthsraw:
      months[o['month']-1]['entries'] = o['entries']

  #months = [ {'entries' : o['entries'], 'month' : o['month'][5:7], 'name' : datetime(2000, int(o['month'][5:7]), 1).strftime("%B")} for o in monthsraw ]

  return render_to_response('posts/archive_year.html',
    { "months" : months, "year" : year },
    context_instance = RequestContext(request)
  )

def archivemonth(request, year, month):
  year = min(int(year), 9999)
  month = max(min(int(month), 12), 1)

  if hasattr(request, 'breadcrumbs'):
    request.breadcrumbs(_("Posts"), reverse("posts-archive"))
    request.breadcrumbs(year, reverse("posts-archive-year", kwargs={"year" : "%04d" % year}))
    request.breadcrumbs(datetime(2000, month, 1).strftime("%B"), reverse("posts-archive-month", kwargs={"year" : "%04d" % year, "month" : "%02d" % month}))

  return render_to_response('posts/archive_month.html',
    { "posts" : Post.objects.filter(is_public=True, date__year = year, date__month = month).order_by("-date"), "year" : year, "month" : datetime(2000, month, 1).strftime("%B") },
    context_instance = RequestContext(request)
  )

def post(request, slug):

  try:
    post = Post.objects.get(is_public = True, title_slug=slug)

    if hasattr(request, 'breadcrumbs'):
      request.breadcrumbs(_("Posts"), reverse("posts-archive"))
      request.breadcrumbs(post.date.strftime("%Y"), reverse("posts-archive-year", kwargs={"year" : "%04d" % post.date.year}))
      request.breadcrumbs(post.date.strftime("%B"), reverse("posts-archive-month", kwargs={"year" : "%04d" % post.date.year, "month" : "%02d" % post.date.month}))
      request.breadcrumbs(post.title, reverse("posts-post", kwargs={"slug" : post.title_slug}))

    try:
      previous = Post.objects.filter(is_public = True, date__lt=post.date).order_by("-date")[0]
    except IndexError:
      previous = None

    try:
      next = Post.objects.filter(is_public = True, date__gt=post.date).order_by("date")[0]
    except IndexError:
      next = None

    return render_to_response('posts/post.html',
      {"post" : post, "next" : next, "previous" : previous },
      context_instance = RequestContext(request)
    )
  except Post.DoesNotExist:
      raise Http404


text:
dss-examples
=============

Sample CloudConnect project using the Agile Data Warehousing Service (ADS)

The _Sample ADS Project_ includes two graph:
- `ADS_Minimal.grf` is a minimal demonstration of using the ADS
in CloudConnect with a ADS connection, DBExecute components
for creating a table and loading data and a DBInputTable
component for querying the database.
- `ADS_Merge.grf` shows a more realistic example of loading data
into DSS using a staging table and the `MERGE` command
- `ADS_Row_Version_History.grf` demonstrates the data structures,
loading processes and export queries for a project that involves
maintaining the full history of changes


text:
import requests
import subprocess
import os
import argparse
import sys
from html import parser

#TODO
# Some (more) ways to refine output?

# config
livestreamerQuality = 'medium, source'

# not config
tHeight = int((int(os.popen('stty size', 'r').read().split()[0]) - 4) / 2)
h = parser.HTMLParser()
gameAliases = {
               'gta': 'grand theft auto',
               'sm64': 'super mario 64',
               'sms': 'super mario sunshine',
               'alttp': 'a link to the past',
               'lttp': 'a link to the past',
               'oot': 'ocarina of time',
               'tww': 'the wind waker',
               'sm': 'super metroid',
               'tes': 'elder scrolls',
               'das': 'dark souls',
               'dk': 'donkey kong',
               'ff': 'final fantasy',
               'smb': 'super mario bros',
               'tyd': 'thousand year door'
               }

cli = argparse.ArgumentParser()
tError = '\033[032mError: \033[0m'
tWarning = '\033[036mWarning: \033[0m'
cli.add_argument('--game', '-g',
                    help='Displays streams with matching string in games',
                    nargs='?', metavar='search', default=None)
cli.add_argument('--race',
                    help='Displays streams currently in a race',
                    nargs='?', metavar='y/n', default=None)
cli.add_argument('--range', '-r',
                    help='Display streams within the specified range of viewers',
                    nargs='?', metavar='min-max', default=None)
cli.add_argument('--streams', '-s',
                    help='Display amount of streams',
                    nargs='?', metavar='n', type=int, default=None)
cli.add_argument('--reverse',
                    help='Sort streams by least to most viewers',
                    action='store_true', default=False)
cli.add_argument('--quality', '-q',
                    help='Sets livestreamer quality. Default: \'medium, source\'',
                    nargs='?', metavar='quality', default=livestreamerQuality)

args = cli.parse_args()

if args.race:
    if args.race.lower() in ['yes', 'y', 'true', '1']:
        args.race = True
    elif args.race.lower() in ['no', 'n', 'false', '0']:
        args.race = False
    else:
        print(tWarning + '\'' + args.race + '\' is not a valid boolean value. Defaulting to None')
        args.race = None

if args.range:
    view_range = args.range.split('-')
    try:
        if int(view_range[1]) < int(view_range[0]):
            maxRange = int(view_range[0])
            minRange = int(view_range[1])
        else:
            maxRange = int(view_range[1])
            minRange = int(view_range[0])
    except:
        print(tError + 'Not a valid range.\nUsage example: srl.py --view-range 3-7')
        sys.exit()

if args.game:
    for alias in gameAliases:
        if args.game == alias:
            args.game = gameAliases[alias]
            break

if args.streams != None:
    if args.streams == 0:
        print(tWarning + 'Defaulting to ' + str(tHeight) + ' streams.')
    else:
        tHeight = args.streams

def getApi():
    try:
        streamJson = requests.get('http://api.speedrunslive.com/frontend/streams', timeout=10).json()
        return streamJson
    except:
        return None

def populateList(apiResponse, args):
    printList = []
    if apiResponse != None:
        for channel in apiResponse['_source']['channels']:
            game = h.unescape(channel['meta_game'])
            title = h.unescape(channel['title'])
            if channel['is_racing'] == 1:
                is_racing = True
            elif channel['is_racing'] == 0:
                is_racing = False
            if channel['api'] == 'twitch':
                url = 'http://twitch.tv/' + channel['name']
            elif channel['api'] == 'hitbox':
                url = 'http://hitbox.tv/' + channel['name']
            name = channel['display_name']
            viewers = int(channel['current_viewers'])
            if args.game == None or args.game.lower() in game.lower():
                if args.race == is_racing or args.race == None:
                    if (args.range and maxRange >= viewers >= minRange) or not args.range:
                        printList.append({'game': game, 'title': title, 'url': url, 'name': name, 'viewers': viewers})
            else:
                pass
            if args.reverse:
                finalList = sorted(printList, key=lambda k: k['viewers'])
            else:
                finalList = sorted(printList, key=lambda k: k['viewers'], reverse=True)
        return finalList

    else:
        return None

def termDisplay(pList, tHeight):
    if pList and len(pList) < tHeight:
        listLength = len(pList)
    else:
        listLength = tHeight
    for channel in range(0,listLength):
        print(str(int(channel) + 1) + ': \033[032m' + pList[channel]['name'] +
              '\033[0m -- '+ pList[channel]['game'] + '\n\t\033[033m' +
              pList[channel]['title'] + '\033[0m -- Viewers: ' + str(pList[channel]['viewers']))
    return listLength

pList = populateList(getApi(), args)
if not pList or len(pList) == 0:
    print(tError + 'No streams to display')
elif pList != None:
    listLength = termDisplay(pList, tHeight)
    streamSelect = input('Select stream to watch [\033[034m1-' + str(listLength) + '\033[0m]: ')
    try:
        streamInt = int(streamSelect)
        if streamInt > listLength or streamInt == 0:
            print(tError + 'Selected stream out of range')
        else:
            selectedStream = pList[streamInt - 1]
            # really not a nice way to open livestreamer but who cares
            subprocess.Popen(['livestreamer', selectedStream['url'], args.quality])
    except ValueError:
        print(tError + 'Input is not a number')


text:
extern crate clap;

use clap::{App, Arg, SubCommand};

fn main() {

    // SubCommands function exactly like sub-Apps, because that's exactly what they are. Each
    // instance of a SubCommand can have it's own version, author(s), Args, and even it's own
    // subcommands.
    //
    // # Help and Version
    // Just like Apps, each subcommand will get it's own "help" and "version" flags automatically
    // generated. Also, like Apps, you can override "-V" or "-h" safely and still get "--help" and
    // "--version" auto generated.
    //
    // NOTE: If you specify a subcommand for your App, clap will also autogenerate a "help"
    // subcommand along with "-h" and "--help" (applies to sub-subcommands as well).
    //
    // Just like arg() and args(), subcommands can be specified one at a time via subcommand() or
    // multiple ones at once with a Vec<SubCommand> provided to subcommands().
    let matches = App::new("MyApp")
                        // Normal App and Arg configuration goes here...

                        // In the following example assume we wanted an application which
                        // supported an "add" subcommand, this "add" subcommand also took
                        // one positional argument of a file to add:
                        .subcommand(SubCommand::with_name("add")                        // The name we call argument with
                                                .about("Adds files to myapp")           // The message displayed in "myapp -h"
                                                                                // or "myapp help"
                                                .version("0.1")                         // Subcommands can have independent version
                                                .author("Kevin K.")                     // And authors
                                                .arg(Arg::with_name("input")            // And their own arguments
                                                            .help("the file to add")
                                                            .index(1)
                                                            .required(true)))
                        .get_matches();

    // You can check if a subcommand was used like normal
    if matches.is_present("add") {
        println!("'myapp add' was run.");
    }

    // You can get the independent subcommand matches (which function exactly like App matches)
    if let Some(matches) = matches.subcommand_matches("add") {
        // Safe to use unwrap() because of the required() option
        println!("Adding file: {}", matches.value_of("input").unwrap());
    }

    // You can also match on a subcommand's name
    match matches.subcommand_name() {
        Some("add") => println!("'myapp add' was used"),
        None        => println!("No subcommand was used"),
        _           => println!("Some other subcommand was used"),
    }

    // Continued program logic goes here...
}


text:
using BusinessObjects.Devices;
using Common.Commands;

namespace PinballClient.ClientComms
{
    public interface IClientCommsController
    {
        IClientCommsController CurrentController { get; set; }
        void SendConfigureMachineMessage(bool useHardware);

        void SendConfigureDeviceMessage(Switch device, bool removeDevice = false);

        void SendConfigureDeviceMessage(Coil device, bool removeDevice = false);

        void SendConfigureDeviceMessage(StepperMotor device, bool removeDevice = false);

        void SendConfigureDeviceMessage(Servo device, bool removeDevice = false);

        void SendConfigureDeviceMessage(Led device, bool removeDevice = false);

        void SendCommandDeviceMessage(Switch device, SwitchCommand command);

        void SendCommandDeviceMessage(Coil device, CoilCommand command);

        void SendCommandDeviceMessage(StepperMotor device, StepperMotorCommand command);

        void SendCommandDeviceMessage(Servo device, ServoCommand command);

        void SendCommandDeviceMessage(Led device, LedCommand command);

        void RequestSettings();

        void RequestFile(string mediaFilename);

    }
}


text:
namespace MassTransit.Util
{
    using System.Threading.Tasks;

    public interface ITaskSupervisor
    {
        /// <summary>
        /// Completed when the supervisor and subordinates are ready
        /// </summary>
        Task Ready { get; }

        /// <summary>
        /// Completed when the signal is complete and ready to exit
        /// </summary>
        Task Completed { get; }

        /// <summary>
        /// Connects a participant to the signal for observation by the signaler
        /// </summary>
        /// <param name="tag"></param>
        /// <returns></returns>
        ITaskParticipant CreateParticipant(string tag);

        /// <summary>
        /// Creates a scope that has it's own participants that can be coordinated
        /// </summary>
        /// <returns></returns>
        ITaskScope CreateScope(string tag);
    }
}


text:
<!DOCTYPE html>

  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1"/>

  <title>A Saga Crepúsculo Eclipse</title>
  <meta name="author" content="" />
  <meta name="description"
        content="Eclipse encontra no eterno drama - protagonizado pelo trio Jacob (Lautner), Edward (Pattinson) e Bella (Stewart) - o combustível para prosseguir com a saga das famílias de vampiros e lobisomems..."/>

  <meta name="yandex-verification" content="48a8210fc043c5e8" />

  <meta name="generator" content="Hugo 0.54.0" />

  <meta itemprop="name" content="A Saga Crepúsculo Eclipse"/>
  <meta itemprop="description"
        content="Eclipse encontra no eterno drama - protagonizado pelo trio Jacob (Lautner), Edward (Pattinson) e Bella (Stewart) - o combustível para prosseguir com a saga das famílias de vampiros e lobisomems..."/>
  <meta itemprop="image"
        content="/img/logo.svg"/>

  <meta property="og:title" content="A Saga Crepúsculo Eclipse"/>
  <meta property="og:type"
        content="article"/>
  <meta property="og:url" content="http://www.cinetenisverde.com.br/eclipse/"/>
  <meta property="og:image"
        content="/img/logo.svg"/>
  <meta property="og:description"
        content="Eclipse encontra no eterno drama - protagonizado pelo trio Jacob (Lautner), Edward (Pattinson) e Bella (Stewart) - o combustível para prosseguir com a saga das famílias de vampiros e lobisomems..."/>
  <meta property="og:site_name" content="Cine Tênis Verde"/>
  <meta property="article:published_time"
        content="2012-10-21T00:00:00+00:00"/>
  <meta property="article:section" content="post"/>

  <meta name="twitter:card" content="summary"/>
  <meta name="twitter:site"
        content=""/>
  <meta name="twitter:title" content="A Saga Crepúsculo Eclipse"/>
  <meta name="twitter:description"
        content="Eclipse encontra no eterno drama - protagonizado pelo trio Jacob (Lautner), Edward (Pattinson) e Bella (Stewart) - o combustível para prosseguir com a saga das famílias de vampiros e lobisomems..."/>
  <meta name="twitter:creator"
        content=""/>
  <meta name="twitter:image:src"
        content="/img/logo.svg"/>

  <link rel="stylesheet" type="text/css" href="/css/capsule.min.css"/>
  <link rel="stylesheet" type="text/css" href="/css/custom.css"/>

  <link rel="apple-touch-icon" href="/img/apple-touch-icon.png"/>
  <link rel="icon" href="/img/favicon.ico"/>

 Cine Tênis Verde

    <input type="checkbox" id="navbar-burger-state"/>

      search

      twitter

      rss

A Saga Crepúsculo Eclipse

    ★★☆☆☆

 Wanderley Caloni, October 21, 2012

Eclipse encontra no eterno drama - protagonizado pelo trio Jacob (Lautner), Edward (Pattinson) e Bella (Stewart) - o combustível para prosseguir com a saga das famílias de vampiros e lobisomems mutantes que povoam o limitado universo da escritora Stephenie Meyer.

O que distingue esse terceiro capítulo dos dois anteriores, além de efeitos digitais aprimorados e uma fotografia que elegantemente dá nome ao filme, são os velhos diálogos envolvendo a transformação (necessária) de Bella em uma vampira brilhante e o amor sufocante que um sente pelo outro inseridos em um clima de guerra, que pode explodir a qualquer momento, e que mais uma vez possui Bella em seu centro.

E quando digo “um pelo outro” incluo aqui também os sentimentos do lobisomem descamisado Jacob, que deixam de ser completamente platônicos, em relação a Bella. O triângulo finalmente se completa em uma inspirada cena em uma barraca gelada, quando Edward finalmente confessa que seria capaz gostar de Jacob. Os diálogos, como sempre, são bem atrapalhados, mas note o olhar dos dois rapazes e entenderá a mensagem muito melhor. Olhe em seus lábios e… bem, deixo o resto das conclusões para um próximo encontro do casal/trio no alto de uma montanha, quando precisarem armar novamente a barraca e se proteger da intolerância e do preconceito lá fora.

Começo a achar agradável a tragicomédia que aqui se configura.

           Imagens e créditos no IMDB.

    ★★☆☆☆

 A Saga Crepúsculo Eclipse ● A Saga Crepúsculo Eclipse. The Twilight Saga: Eclipse (USA, 2010). Dirigido por David Slade. Escrito por Melissa Rosenberg, Stephenie Meyer. Com Xavier Samuel, Kristen Stewart, Robert Pattinson, Billy Burke, Justin Chon, Anna Kendrick, Michael Welch, Christian Serratos, Jackson Rathbone. ● Nota: 2/5. Categoria: movies.  Publicado em 2012-10-21.  Texto escrito por Wanderley Caloni.

Quer comentar?

      Share


text:
module PureAdmin::ButtonHelper
  ##
  # @param options (Hash) all options that can be passed to button_tag are respected here.
  # @return (String) HTML for a save button.
  def save_button(options = {})
    options[:class] = merge_html_classes('pure-button pure-button-primary', options[:class])
    options[:type] ||= :submit
    button_tag(' Save'.html_safe, options)
  end

  ##
  # @param path (String, Array) the path for the edit button
  # @param options (Hash) all options that can be passed to link_to are respected here.
  # @return (String) HTML for the edit button.
  def edit_button(path, options = {})
    options[:class] = merge_html_classes('pure-button pure-button-primary', options[:class])
    link_to(' Edit'.html_safe, path, options)
  end

  ##
  # @param path (String, Array) the path for the back button
  # @param options (Hash) all options that can be passed to link_to are respected here.
  # @return (String) HTML for the back button.
  def back_button(path = nil, options = {})
    options[:class] = merge_html_classes('pure-button', options[:class])
    link_to('Back', (path || :back), options)
  end

  ##
  # @param path (String, Array) the path for the back button
  # @param options (Hash) all options that can be passed to link_to are respected here.
  # @return (String) HTML for the cancel button.
  def cancel_button(path = nil, options = {})
    options[:class] = merge_html_classes('pure-button', options[:class])
    link_to(' Cancel'.html_safe, (path || :back), options)
  end

  ##
  # @param path (String, Array) the path for the delete button
  # @param options (Hash) all options that can be passed to link_to are respected here.
  # @options options :label the label for the delete button
  # @options options :icon the icon for the delete button
  # @return (String) HTML for the delete button.
  def delete_button(path, options = {})
    options[:class] = merge_html_classes('pure-button button-red', options[:class])
    options[:rel] ||= :modal
    options[:modal] ||= :confirm
    options[:data] ||= {}
    options[:data][:modal_request_method] ||= :delete

    label = options.delete(:label) || 'Delete'
    icon = options.delete(:icon) || 'fa-trash-o'

    link_to(" #{label}".html_safe, path, options)
  end
end


text:
const Signals = imports.signals;

import * as Gtk from '@gi-types/gtk3';
import * as GObject from '@gi-types/gobject2';

import { extendGObject } from './gselib/gobjectUtil';
import { SignalEmitter } from './gselib/SignalEmitter';

import { getProvider } from './providers';
import { getSettings } from './settings';

const INDICATORS_KEY = 'indicators';

export const Defaults = {
  api: 'bitstamp',
  base: 'BTC',
  quote: 'USD',
  attribute: 'last',
  show_change: true,
  format: '{v} {qs}',
};

declare interface ConfigModel extends SignalEmitter {}

class ConfigModel {
  private attributes: Record<string, unknown>;

  constructor(attributes: Record<string, unknown>) {
    this.attributes = attributes;
  }

  set(key, value) {
    this.attributes[key] = value;
    this.emit('update', key, value);
  }

  get(key) {
    if (key in this.attributes) {
      return this.attributes[key];
    }
    return Defaults[key];
  }

  toString() {
    return JSON.stringify(this.attributes);
  }

  destroy() {
    this.disconnectAll();
  }
}

Signals.addSignalMethods(ConfigModel.prototype);

export const IndicatorCollectionModel = extendGObject(
  class IndicatorCollectionModel extends Gtk.ListStore {
    private _settings: any;
    private Columns: Record<string, number> = {};

    constructor() {
      super();

      this.Columns = {
        LABEL: 0,
        CONFIG: 1,
      };

      this.set_column_types([GObject.TYPE_STRING, GObject.TYPE_STRING]);

      this._settings = getSettings();

      this._reloadFromSettings();

      let flag;

      const mutex = (func: (...args: any[]) => void) =>
        function (...args: any[]) {
          if (!flag) {
            flag = true;
            func(...args);
            flag = false;
          }
        };

      (this as any).connect('row-changed', mutex(this._onRowChanged.bind(this)));

      (this as any).connect('row-inserted', mutex(this._onRowInserted.bind(this)));

      (this as any).connect('row-deleted', mutex(this._onRowDeleted.bind(this)));
    }

    getConfig(iter) {
      const json = this.get_value(iter, this.Columns.CONFIG);

      if (!json) {
        throw new Error('getConfig() failed for iter=' + iter);
      }

      const config = new ConfigModel(JSON.parse(json as string));

      config.connect('update', () => {
        this.set(iter, [this.Columns.CONFIG], [(config.toString() as unknown) as GObject.Value]);
      });

      return config;
    }

    _getLabel(config) {
      try {
        return getProvider(config.api).getLabel(config);
      } catch (e) {
        logError(e);
        return `[unsupported: ${config.api}]`;
      }
    }

    _reloadFromSettings() {
      this.clear();

      const configs = this._settings.get_strv(INDICATORS_KEY);

      Object.keys(configs).forEach((key) => {
        const json = configs[key];
        try {
          const label = this._getLabel(JSON.parse(json));
          this.set(this.append(), [this.Columns.LABEL, this.Columns.CONFIG], [label, json]);
        } catch (e) {
          log('error loading indicator config');
          logError(e);
        }
      });
    }

    _writeSettings() {
      // eslint-disable-next-line
      let [res, iter] = this.get_iter_first();
      const configs: any[] = [];

      while (res) {
        configs.push(this.get_value(iter, this.Columns.CONFIG));
        res = this.iter_next(iter);
      }

      this._settings.set_strv(INDICATORS_KEY, configs);
    }

    _onRowChanged(self, path, iter) {
      const config = this.get_value(iter, this.Columns.CONFIG);

      this.set(iter, [this.Columns.LABEL, this.Columns.CONFIG], ([
        this._getLabel(JSON.parse(config as any)),
        config,
      ] as unknown) as GObject.Value[]);

      this._writeSettings();
    }

    _onRowInserted(self, path, iter) {
      this.set(iter, [this.Columns.LABEL, this.Columns.CONFIG], ([
        this._getLabel(Defaults),
        JSON.stringify(Defaults),
      ] as unknown) as GObject.Value[]);

      this._writeSettings();
    }

    _onRowDeleted(_self, _path, _iter) {
      this._writeSettings();
    }
  },
  Gtk.ListStore,
);


text:
package org.keycloak.protocol.oidc.mappers;

import org.keycloak.Config;
import org.keycloak.models.KeycloakSession;
import org.keycloak.models.KeycloakSessionFactory;
import org.keycloak.protocol.ProtocolMapper;
import org.keycloak.protocol.oidc.OIDCLoginProtocol;

/**
 * @author Bill Burke
 * @version $Revision: 1 $
 */
public abstract class AbstractOIDCProtocolMapper implements ProtocolMapper {

    public static final String TOKEN_MAPPER_CATEGORY = "Token mapper";

    @Override
    public String getProtocol() {
        return OIDCLoginProtocol.LOGIN_PROTOCOL;
    }

    @Override
    public void close() {

    }

    @Override
    public final ProtocolMapper create(KeycloakSession session) {
        throw new RuntimeException("UNSUPPORTED METHOD");
    }

    @Override
    public void init(Config.Scope config) {
    }

    @Override
    public void postInit(KeycloakSessionFactory factory) {

    }
}


text:
$('#AS4DownloadLink').mouseenter(function() {
	$(this).children('#AS4DownloadImage').stop().animate({left: "278px"}, 150);
	$(this).children('#AS4DownloadText').stop().animate({left: "45px"}, 300);
});
$('#AS4DownloadLink').mouseleave(function() {
	$(this).children('#AS4DownloadImage').stop().animate({left: "243px"}, 300);
	$(this).children('#AS4DownloadText').stop().animate({left: "10px"}, 150);
});
$('#AS4DownloadLinkS').mouseenter(function() {
	$(this).children('#AS4DownloadImage').stop().animate({left: "278px"}, 150);
	$(this).children('#AS4DownloadText').stop().animate({left: "45px"}, 300);
});
$('#AS4DownloadLinkS').mouseleave(function() {
	$(this).children('#AS4DownloadImage').stop().animate({left: "243px"}, 300);
	$(this).children('#AS4DownloadText').stop().animate({left: "10px"}, 150);
});


text:
//
//  NavigationController.m
//  Akorlar
//
//  Created by Can Bülbül on 08/10/14.
//  Copyright (c) 2014 orkestra. All rights reserved.
//

#import "NavigationController.h"

@interface NavigationController ()

@end

@implementation NavigationController

- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end


text:
require_relative "./helper"

class TestBlob < Minitest::Test
  include Linguist

  def setup
    # git blobs are normally loaded as ASCII-8BIT since they may contain data
    # with arbitrary encoding not known ahead of time
    @original_external = Encoding.default_external
    Encoding.default_external = Encoding.find("ASCII-8BIT")
  end

  def teardown
    Encoding.default_external = @original_external
  end

  def script_blob(name)
    blob = sample_blob(name)
    blob.instance_variable_set(:@name, 'script')
    blob
  end

  def test_name
    assert_equal "foo.rb", sample_blob("foo.rb").name
  end

  def test_mime_type
    assert_equal "application/postscript", fixture_blob("Binary/octocat.ai").mime_type
    assert_equal "application/x-ruby", sample_blob("Ruby/grit.rb").mime_type
    assert_equal "application/x-sh", sample_blob("Shell/script.sh").mime_type
    assert_equal "application/xml", sample_blob("XML/bar.xml").mime_type
    assert_equal "audio/ogg", fixture_blob("Binary/foo.ogg").mime_type
    assert_equal "text/plain", fixture_blob("Data/README").mime_type
  end

  def test_content_type
    assert_equal "application/pdf", fixture_blob("Binary/foo.pdf").content_type
    assert_equal "audio/ogg", fixture_blob("Binary/foo.ogg").content_type
    assert_equal "image/png", fixture_blob("Binary/foo.png").content_type
    assert_equal "text/plain; charset=iso-8859-2", fixture_blob("Data/README").content_type
  end

  def test_disposition
    assert_equal "attachment; filename=foo+bar.jar", fixture_blob("Binary/foo bar.jar").disposition
    assert_equal "attachment; filename=foo.bin", fixture_blob("Binary/foo.bin").disposition
    assert_equal "attachment; filename=linguist.gem", fixture_blob("Binary/linguist.gem").disposition
    assert_equal "attachment; filename=octocat.ai", fixture_blob("Binary/octocat.ai").disposition
    assert_equal "inline", fixture_blob("Data/README").disposition
    assert_equal "inline", sample_blob("Text/foo.txt").disposition
    assert_equal "inline", sample_blob("Ruby/grit.rb").disposition
    assert_equal "inline", fixture_blob("Binary/octocat.png").disposition
  end

  def test_data
    assert_equal "module Foo\nend\n", sample_blob("Ruby/foo.rb").data
  end

  def test_lines
    assert_equal ["module Foo", "end", ""], sample_blob("Ruby/foo.rb").lines
    assert_equal ["line 1", "line 2", ""], sample_blob("Text/mac.txt").lines
    assert_equal 475, sample_blob("Emacs Lisp/ess-julia.el").lines.length
  end

  def test_lines_maintains_original_encoding
    # Even if the file's encoding is detected as something like UTF-16LE,
    # earlier versions of the gem made implicit guarantees that the encoding of
    # each `line` is in the same encoding as the file was originally read (in
    # practice, UTF-8 or ASCII-8BIT)
    assert_equal Encoding.default_external, fixture_blob("Data/utf16le").lines.first.encoding
  end

  def test_size
    assert_equal 15, sample_blob("Ruby/foo.rb").size
  end

  def test_loc
    assert_equal 3, sample_blob("Ruby/foo.rb").loc
  end

  def test_sloc
    assert_equal 2, sample_blob("Ruby/foo.rb").sloc
    assert_equal 3, fixture_blob("Data/utf16le-windows").sloc
    assert_equal 1, fixture_blob("Data/iso8859-8-i").sloc
  end

  def test_encoding
    assert_equal "ISO-8859-2", fixture_blob("Data/README").encoding
    assert_equal "ISO-8859-2", fixture_blob("Data/README").ruby_encoding
    assert_equal "UTF-8", sample_blob("Text/foo.txt").encoding
    assert_equal "UTF-8", sample_blob("Text/foo.txt").ruby_encoding
    assert_equal "UTF-16LE", fixture_blob("Data/utf16le").encoding
    assert_equal "UTF-16LE", fixture_blob("Data/utf16le").ruby_encoding
    assert_equal "UTF-16LE", fixture_blob("Data/utf16le-windows").encoding
    assert_equal "UTF-16LE", fixture_blob("Data/utf16le-windows").ruby_encoding
    assert_equal "ISO-2022-KR", sample_blob("Text/ISO-2022-KR.txt").encoding
    assert_equal "binary", sample_blob("Text/ISO-2022-KR.txt").ruby_encoding
    assert_nil fixture_blob("Binary/dog.o").encoding
  end

  def test_binary
    # Large blobs aren't loaded
    large_blob = sample_blob("git.exe")
    large_blob.instance_eval do
      def data; end
    end
    assert large_blob.binary?

    assert fixture_blob("Binary/git.deb").binary?
    assert fixture_blob("Binary/git.exe").binary?
    assert fixture_blob("Binary/hello.pbc").binary?
    assert fixture_blob("Binary/linguist.gem").binary?
    assert fixture_blob("Binary/octocat.ai").binary?
    assert fixture_blob("Binary/octocat.png").binary?
    assert fixture_blob("Binary/zip").binary?
    assert !fixture_blob("Data/README").binary?
    assert !sample_blob("Ruby/foo.rb").binary?
    assert !sample_blob("Perl/script.pl").binary?
  end

  def test_all_binary
    Samples.each do |sample|
      blob = sample_blob(sample[:path])
      assert ! (blob.likely_binary? || blob.binary?), "#{sample[:path]} is a binary file"
    end
  end

  def test_text
    assert fixture_blob("Data/README").text?
    assert fixture_blob("Data/md").text?
    assert sample_blob("Shell/script.sh").text?
    assert fixture_blob("Data/txt").text?
  end

  def test_image
    assert fixture_blob("Binary/octocat.gif").image?
    assert fixture_blob("Binary/octocat.jpeg").image?
    assert fixture_blob("Binary/octocat.jpg").image?
    assert fixture_blob("Binary/octocat.png").image?
    assert !fixture_blob("Binary/octocat.ai").image?
    assert !fixture_blob("Binary/octocat.psd").image?
  end

  def test_solid
    assert fixture_blob("Binary/cube.stl").solid?
    assert fixture_blob("Data/cube.stl").solid?
  end

  def test_csv
    assert fixture_blob("Data/cars.csv").csv?
  end

  def test_pdf
    assert fixture_blob("Binary/foo.pdf").pdf?
  end

  def test_viewable
    assert fixture_blob("Data/README").viewable?
    assert sample_blob("Ruby/foo.rb").viewable?
    assert sample_blob("Perl/script.pl").viewable?
    assert !fixture_blob("Binary/linguist.gem").viewable?
    assert !fixture_blob("Binary/octocat.ai").viewable?
    assert !fixture_blob("Binary/octocat.png").viewable?
  end

  def test_generated
    assert !fixture_blob("Data/README").generated?

    # Xcode project files
    assert !sample_blob("XML/MainMenu.xib").generated?
    assert fixture_blob("Binary/MainMenu.nib").generated?
    assert !sample_blob("XML/project.pbxproj").generated?

    # Gemfile.lock is NOT generated
    assert !sample_blob("Gemfile.lock").generated?

    # Generated .NET Docfiles
    assert sample_blob("XML/net_docfile.xml").generated?

    # Long line
    assert !sample_blob("JavaScript/uglify.js").generated?

    # Inlined JS, but mostly code
    assert !sample_blob("JavaScript/json2_backbone.js").generated?

    # Minified JS
    assert !sample_blob("JavaScript/jquery-1.6.1.js").generated?
    assert sample_blob("JavaScript/jquery-1.6.1.min.js").generated?
    assert sample_blob("JavaScript/jquery-1.4.2.min.js").generated?

    # CoffeeScript-generated JS
    # TODO

    # TypeScript-generated JS
    # TODO

    # Composer generated composer.lock file
    assert sample_blob("JSON/composer.lock").generated?

    # PEG.js-generated parsers
    assert sample_blob("JavaScript/parser.js").generated?

    # Generated PostScript
    assert !sample_blob("PostScript/sierpinski.ps").generated?

    # These examples are too basic to tell
    assert !sample_blob("JavaScript/hello.js").generated?

    assert sample_blob("JavaScript/intro-old.js").generated?
    assert sample_blob("JavaScript/classes-old.js").generated?

    assert sample_blob("JavaScript/intro.js").generated?
    assert sample_blob("JavaScript/classes.js").generated?

    # Protocol Buffer generated code
    assert sample_blob("C++/protocol-buffer.pb.h").generated?
    assert sample_blob("C++/protocol-buffer.pb.cc").generated?
    assert sample_blob("Java/ProtocolBuffer.java").generated?
    assert sample_blob("Python/protocol_buffer_pb2.py").generated?
    assert sample_blob("Go/api.pb.go").generated?
    assert sample_blob("Go/embedded.go").generated?

    # Apache Thrift generated code
    assert sample_blob("Python/gen-py-linguist-thrift.py").generated?
    assert sample_blob("Go/gen-go-linguist-thrift.go").generated?
    assert sample_blob("Java/gen-java-linguist-thrift.java").generated?
    assert sample_blob("JavaScript/gen-js-linguist-thrift.js").generated?
    assert sample_blob("Ruby/gen-rb-linguist-thrift.rb").generated?
    assert sample_blob("Objective-C/gen-cocoa-linguist-thrift.m").generated?

    # Generated JNI
    assert sample_blob("C/jni_layer.h").generated?

    # Minified CSS
    assert !sample_blob("CSS/bootstrap.css").generated?
    assert sample_blob("CSS/bootstrap.min.css").generated?

    # Generated VCR
    assert sample_blob("YAML/vcr_cassette.yml").generated?

    # Generated by Zephir
    assert sample_blob("Zephir/filenames/exception.zep.c").generated?
    assert sample_blob("Zephir/filenames/exception.zep.h").generated?
    assert sample_blob("Zephir/filenames/exception.zep.php").generated?
    assert !sample_blob("Zephir/Router.zep").generated?

    assert sample_blob("node_modules/grunt/lib/grunt.js").generated?

    # Godep saved dependencies
    assert sample_blob("Godeps/Godeps.json").generated?
    assert sample_blob("Godeps/_workspace/src/github.com/kr/s3/sign.go").generated?

    # Cython-generated C/C++
    assert sample_blob("C/sgd_fast.c").generated?
    assert sample_blob("C++/wrapper_inner.cpp").generated?

    # Unity3D-generated metadata
    assert sample_blob("Unity3D Asset/Tiles.meta").generated?
  end

  def test_vendored
    assert !fixture_blob("Data/README").vendored?
    assert !sample_blob("ext/extconf.rb").vendored?

    # Dependencies
    assert sample_blob("dependencies/windows/headers/GL/glext.h").vendored?

    # Node dependencies
    assert sample_blob("node_modules/coffee-script/lib/coffee-script.js").vendored?

    # Bower Components
    assert sample_blob("bower_components/custom/custom.js").vendored?
    assert sample_blob("app/bower_components/custom/custom.js").vendored?
    assert sample_blob("vendor/assets/bower_components/custom/custom.js").vendored?

    # Go dependencies
    assert !sample_blob("Godeps/Godeps.json").vendored?
    assert sample_blob("Godeps/_workspace/src/github.com/kr/s3/sign.go").vendored?

    # Rails vendor/
    assert sample_blob("vendor/plugins/will_paginate/lib/will_paginate.rb").vendored?

    # Vendor/
    assert sample_blob("Vendor/my_great_file.h").vendored?

    # 'thirdparty' directory
    assert sample_blob("thirdparty/lib/main.c").vendored?

    # 'extern(al)' directory
    assert sample_blob("extern/util/__init__.py").vendored?
    assert sample_blob("external/jquery.min.js").vendored?

    # C deps
    assert sample_blob("deps/http_parser/http_parser.c").vendored?
    assert sample_blob("deps/v8/src/v8.h").vendored?

    assert sample_blob("tools/something/else.c").vendored?

    # Chart.js
    assert sample_blob("some/vendored/path/Chart.js").vendored?
    assert !sample_blob("some/vendored/path/chart.js").vendored?

    # Codemirror deps
    assert sample_blob("codemirror/mode/blah.js").vendored?
    assert sample_blob("codemirror/5.0/mode/blah.js").vendored?

    # Debian packaging
    assert sample_blob("debian/cron.d").vendored?

    # Erlang
    assert sample_blob("rebar").vendored?

    # git config files

    assert_predicate fixture_blob("some/path/.gitattributes"), :vendored?
    assert_predicate fixture_blob(".gitignore"), :vendored?
    assert_predicate fixture_blob("special/path/.gitmodules"), :vendored?

    # Minified JavaScript and CSS
    assert sample_blob("foo.min.js").vendored?
    assert sample_blob("foo.min.css").vendored?
    assert sample_blob("foo-min.js").vendored?
    assert sample_blob("foo-min.css").vendored?
    assert !sample_blob("foomin.css").vendored?
    assert !sample_blob("foo.min.txt").vendored?

    #.osx
    assert sample_blob(".osx").vendored?

    # Prototype
    assert !sample_blob("public/javascripts/application.js").vendored?
    assert sample_blob("public/javascripts/prototype.js").vendored?
    assert sample_blob("public/javascripts/effects.js").vendored?
    assert sample_blob("public/javascripts/controls.js").vendored?
    assert sample_blob("public/javascripts/dragdrop.js").vendored?

    # jQuery
    assert sample_blob("jquery.js").vendored?
    assert sample_blob("public/javascripts/jquery.js").vendored?
    assert sample_blob("public/javascripts/jquery.min.js").vendored?
    assert sample_blob("public/javascripts/jquery-1.7.js").vendored?
    assert sample_blob("public/javascripts/jquery-1.7.min.js").vendored?
    assert sample_blob("public/javascripts/jquery-1.5.2.js").vendored?
    assert sample_blob("public/javascripts/jquery-1.6.1.js").vendored?
    assert sample_blob("public/javascripts/jquery-1.6.1.min.js").vendored?
    assert sample_blob("public/javascripts/jquery-1.10.1.js").vendored?
    assert sample_blob("public/javascripts/jquery-1.10.1.min.js").vendored?
    assert !sample_blob("public/javascripts/jquery.github.menu.js").vendored?

    # jQuery UI
    assert sample_blob("themes/ui-lightness/jquery-ui.css").vendored?
    assert sample_blob("themes/ui-lightness/jquery-ui-1.8.22.custom.css").vendored?
    assert sample_blob("themes/ui-lightness/jquery.ui.accordion.css").vendored?
    assert sample_blob("ui/i18n/jquery.ui.datepicker-ar.js").vendored?
    assert sample_blob("ui/i18n/jquery-ui-i18n.js").vendored?
    assert sample_blob("ui/jquery.effects.blind.js").vendored?
    assert sample_blob("ui/jquery-ui-1.8.22.custom.js").vendored?
    assert sample_blob("ui/jquery-ui-1.8.22.custom.min.js").vendored?
    assert sample_blob("ui/jquery-ui-1.8.22.js").vendored?
    assert sample_blob("ui/jquery-ui-1.8.js").vendored?
    assert sample_blob("ui/jquery-ui.min.js").vendored?
    assert sample_blob("ui/jquery.ui.accordion.js").vendored?
    assert sample_blob("ui/minified/jquery.effects.blind.min.js").vendored?
    assert sample_blob("ui/minified/jquery.ui.accordion.min.js").vendored?

    # jQuery Gantt
    assert sample_blob("web-app/jquery-gantt/js/jquery.fn.gantt.js").vendored?

    # jQuery fancyBox
    assert sample_blob("web-app/fancybox/jquery.fancybox.js").vendored?

    # Fuel UX
    assert sample_blob("web-app/fuelux/js/fuelux.js").vendored?

    # jQuery File Upload
    assert sample_blob("fileupload-9.0.0/jquery.fileupload-process.js").vendored?

    # Slick
    assert sample_blob("web-app/slickgrid/controls/slick.columnpicker.js").vendored?

    # Leaflet plugins
    assert sample_blob("leaflet-plugins/Leaflet.Coordinates-0.5.0.src.js").vendored?
    assert sample_blob("leaflet-plugins/leaflet.draw-src.js").vendored?
    assert sample_blob("leaflet-plugins/leaflet.spin.js").vendored?

    # MooTools
    assert sample_blob("public/javascripts/mootools-core-1.3.2-full-compat.js").vendored?
    assert sample_blob("public/javascripts/mootools-core-1.3.2-full-compat-yc.js").vendored?

    # Dojo
    assert sample_blob("public/javascripts/dojo.js").vendored?

    # MochiKit
    assert sample_blob("public/javascripts/MochiKit.js").vendored?

    # YUI
    assert sample_blob("public/javascripts/yahoo-dom-event.js").vendored?
    assert sample_blob("public/javascripts/yahoo-min.js").vendored?
    assert sample_blob("public/javascripts/yuiloader-dom-event.js").vendored?

    # WYS editors
    assert sample_blob("public/javascripts/ckeditor.js").vendored?
    assert sample_blob("public/javascripts/tiny_mce.js").vendored?
    assert sample_blob("public/javascripts/tiny_mce_popup.js").vendored?
    assert sample_blob("public/javascripts/tiny_mce_src.js").vendored?

    # AngularJS
    assert sample_blob("public/javascripts/angular.js").vendored?
    assert sample_blob("public/javascripts/angular.min.js").vendored?

    # D3.js
    assert sample_blob("public/javascripts/d3.v3.js").vendored?
    assert sample_blob("public/javascripts/d3.v3.min.js").vendored?

    # Modernizr
    assert sample_blob("public/javascripts/modernizr-2.7.1.js").vendored?
    assert sample_blob("public/javascripts/modernizr.custom.01009.js").vendored?

    # Fabric
    assert sample_blob("fabfile.py").vendored?

    # WAF
    assert sample_blob("waf").vendored?

    # Visual Studio IntelliSense
    assert sample_blob("Scripts/jquery-1.7-vsdoc.js").vendored?

    # Microsoft Ajax
    assert sample_blob("Scripts/MicrosoftAjax.debug.js").vendored?
    assert sample_blob("Scripts/MicrosoftAjax.js").vendored?
    assert sample_blob("Scripts/MicrosoftMvcAjax.debug.js").vendored?
    assert sample_blob("Scripts/MicrosoftMvcAjax.js").vendored?
    assert sample_blob("Scripts/MicrosoftMvcValidation.debug.js").vendored?
    assert sample_blob("Scripts/MicrosoftMvcValidation.js").vendored?

    # jQuery validation plugin (MS bundles this with asp.net mvc)
    assert sample_blob("Scripts/jquery.validate.js").vendored?
    assert sample_blob("Scripts/jquery.validate.min.js").vendored?
    assert sample_blob("Scripts/jquery.validate.unobtrusive.js").vendored?
    assert sample_blob("Scripts/jquery.validate.unobtrusive.min.js").vendored?
    assert sample_blob("Scripts/jquery.unobtrusive-ajax.js").vendored?
    assert sample_blob("Scripts/jquery.unobtrusive-ajax.min.js").vendored?

    # NuGet Packages
    assert sample_blob("packages/Modernizr.2.0.6/Content/Scripts/modernizr-2.0.6-development-only.js").vendored?

    # Font Awesome
    assert sample_blob("some/asset/path/font-awesome.min.css").vendored?
    assert sample_blob("some/asset/path/font-awesome.css").vendored?

    # Normalize
    assert sample_blob("some/asset/path/normalize.css").vendored?

    # Carthage
    assert sample_blob('Carthage/blah').vendored?

    # Cocoapods
    assert sample_blob('Pods/blah').vendored?

    # Html5shiv
    assert sample_blob("Scripts/html5shiv.js").vendored?
    assert sample_blob("Scripts/html5shiv.min.js").vendored?

    # Test fixtures
    assert sample_blob("test/fixtures/random.rkt").vendored?
    assert sample_blob("Test/fixtures/random.rkt").vendored?
    assert sample_blob("tests/fixtures/random.rkt").vendored?

    # Cordova/PhoneGap
    assert sample_blob("cordova.js").vendored?
    assert sample_blob("cordova.min.js").vendored?
    assert sample_blob("cordova-2.1.0.js").vendored?
    assert sample_blob("cordova-2.1.0.min.js").vendored?

    # Foundation js
    assert sample_blob("foundation.js").vendored?
    assert sample_blob("foundation.min.js").vendored?
    assert sample_blob("foundation.abide.js").vendored?

    # Vagrant
    assert sample_blob("Vagrantfile").vendored?

    # Gradle
    assert sample_blob("gradlew").vendored?
    assert sample_blob("gradlew.bat").vendored?
    assert sample_blob("gradle/wrapper/gradle-wrapper.properties").vendored?
    assert sample_blob("subproject/gradlew").vendored?
    assert sample_blob("subproject/gradlew.bat").vendored?
    assert sample_blob("subproject/gradle/wrapper/gradle-wrapper.properties").vendored?

    # Octicons
    assert sample_blob("octicons.css").vendored?
    assert sample_blob("public/octicons.min.css").vendored?
    assert sample_blob("public/octicons/sprockets-octicons.scss").vendored?

    # Typesafe Activator
    assert sample_blob("activator").vendored?
    assert sample_blob("activator.bat").vendored?
    assert sample_blob("subproject/activator").vendored?
    assert sample_blob("subproject/activator.bat").vendored?

    assert_predicate fixture_blob(".google_apis/bar.jar"), :vendored?
    assert_predicate fixture_blob("foo/.google_apis/bar.jar"), :vendored?

    # Sphinx docs
    assert sample_blob("docs/_build/asset.doc").vendored?
    assert sample_blob("docs/theme/file.css").vendored?

    # Vagrant
    assert sample_blob("puphpet/file.pp").vendored?

    # Fabric.io
    assert sample_blob("Fabric.framework/Fabric.h").vendored?

    # Crashlytics
    assert sample_blob("Crashlytics.framework/Crashlytics.h").vendored?
  end

  def test_documentation
    assert_predicate fixture_blob("doc/foo.html"), :documentation?
    assert_predicate fixture_blob("docs/foo.html"), :documentation?
    refute_predicate fixture_blob("project/doc/foo.html"), :documentation?
    refute_predicate fixture_blob("project/docs/foo.html"), :documentation?

    assert_predicate fixture_blob("Documentation/foo.md"), :documentation?
    assert_predicate fixture_blob("documentation/foo.md"), :documentation?
    assert_predicate fixture_blob("project/Documentation/foo.md"), :documentation?
    assert_predicate fixture_blob("project/documentation/foo.md"), :documentation?

    assert_predicate fixture_blob("javadoc/foo.html"), :documentation?
    assert_predicate fixture_blob("project/javadoc/foo.html"), :documentation?

    assert_predicate fixture_blob("man/foo.html"), :documentation?
    refute_predicate fixture_blob("project/man/foo.html"), :documentation?

    assert_predicate fixture_blob("README"), :documentation?
    assert_predicate fixture_blob("README.md"), :documentation?
    assert_predicate fixture_blob("README.txt"), :documentation?
    assert_predicate fixture_blob("Readme"), :documentation?
    assert_predicate fixture_blob("readme"), :documentation?
    assert_predicate fixture_blob("foo/README"), :documentation?

    assert_predicate fixture_blob("CHANGE"), :documentation?
    assert_predicate fixture_blob("CHANGE.md"), :documentation?
    assert_predicate fixture_blob("CHANGE.txt"), :documentation?
    assert_predicate fixture_blob("foo/CHANGE"), :documentation?

    assert_predicate fixture_blob("CHANGELOG"), :documentation?
    assert_predicate fixture_blob("CHANGELOG.md"), :documentation?
    assert_predicate fixture_blob("CHANGELOG.txt"), :documentation?
    assert_predicate fixture_blob("foo/CHANGELOG"), :documentation?

    assert_predicate fixture_blob("CHANGES"), :documentation?
    assert_predicate fixture_blob("CHANGES.md"), :documentation?
    assert_predicate fixture_blob("CHANGES.txt"), :documentation?
    assert_predicate fixture_blob("foo/CHANGES"), :documentation?

    assert_predicate fixture_blob("CONTRIBUTING"), :documentation?
    assert_predicate fixture_blob("CONTRIBUTING.md"), :documentation?
    assert_predicate fixture_blob("CONTRIBUTING.txt"), :documentation?
    assert_predicate fixture_blob("foo/CONTRIBUTING"), :documentation?

    assert_predicate fixture_blob("examples/some-file.pl"), :documentation?
    assert_predicate fixture_blob("Examples/some-example-file.rb"), :documentation?

    assert_predicate fixture_blob("LICENSE"), :documentation?
    assert_predicate fixture_blob("LICENCE.md"), :documentation?
    assert_predicate fixture_blob("License.txt"), :documentation?
    assert_predicate fixture_blob("LICENSE.txt"), :documentation?
    assert_predicate fixture_blob("foo/LICENSE"), :documentation?

    assert_predicate fixture_blob("COPYING"), :documentation?
    assert_predicate fixture_blob("COPYING.md"), :documentation?
    assert_predicate fixture_blob("COPYING.txt"), :documentation?
    assert_predicate fixture_blob("foo/COPYING"), :documentation?

    assert_predicate fixture_blob("INSTALL"), :documentation?
    assert_predicate fixture_blob("INSTALL.md"), :documentation?
    assert_predicate fixture_blob("INSTALL.txt"), :documentation?
    assert_predicate fixture_blob("foo/INSTALL"), :documentation?

    refute_predicate fixture_blob("foo.md"), :documentation?

    # Samples
    assert sample_blob("Samples/Ruby/foo.rb").documentation?

    assert_predicate fixture_blob("INSTALL.txt"), :documentation?
  end

  def test_language
    Samples.each do |sample|
      blob = sample_blob(sample[:path])
      assert blob.language, "No language for #{sample[:path]}"
      assert_equal sample[:language], blob.language.name, blob.name
    end

    # Test language detection for files which shouldn't be used as samples
    root = File.expand_path('../fixtures', __FILE__)
    Dir.entries(root).each do |language|
      next if language == '.' || language == '..' || language == 'Binary' ||
              File.basename(language) == 'ace_modes.json'

      # Each directory contains test files of a language
      dirname = File.join(root, language)
      Dir.entries(dirname).each do |filename|
        # By default blob search the file in the samples;
        # thus, we need to give it the absolute path
        filepath = File.join(dirname, filename)
        next unless File.file?(filepath)

        blob = fixture_blob(filepath)
        if language == 'Data'
          assert blob.language.nil?, "A language was found for #{filepath}"
        elsif language == 'Generated'
          assert blob.generated?, "#{filepath} is not a generated file"
        else
          assert blob.language, "No language for #{filepath}"
          assert_equal language, blob.language.name, blob.name
        end
      end
    end
  end

  def test_minified_files_not_safe_to_highlight
    assert !sample_blob("JavaScript/jquery-1.6.1.min.js").safe_to_colorize?
  end

  def test_empty
    blob = Struct.new(:data) { include Linguist::BlobHelper }

    assert blob.new("").empty?
    assert blob.new(nil).empty?
    refute blob.new(" ").empty?
    refute blob.new("nope").empty?
  end

  def test_include_in_language_stats
    vendored = sample_blob("bower_components/custom/custom.js")
    assert_predicate vendored, :vendored?
    refute_predicate vendored, :include_in_language_stats?

    documentation = fixture_blob("README")
    assert_predicate documentation, :documentation?
    refute_predicate documentation, :include_in_language_stats?

    generated = sample_blob("CSS/bootstrap.min.css")
    assert_predicate generated, :generated?
    refute_predicate generated, :include_in_language_stats?

    data = sample_blob("Ant Build System/filenames/ant.xml")
    assert_equal :data, data.language.type
    refute_predicate data, :include_in_language_stats?

    prose = sample_blob("Markdown/tender.md")
    assert_equal :prose, prose.language.type
    refute_predicate prose, :include_in_language_stats?

    included = sample_blob("HTML/pages.html")
    assert_predicate included, :include_in_language_stats?
  end
end


text:
clearlog()
require("ak.demo-anlagen.demo-linien.demo-linien-main")

-- Diese Zeile lädt die Modulverwaltung der Lua-Bibliothek
local ModuleRegistry = require("ak.core.ModuleRegistry")

-- Diese Zeilen aktivieren die folgenden Module in der Modulverwaltung
-- * Core (immer benötigt)
-- * Data (Export der Daten für EEP)
-- * Crossing (für die Ampelsteuerung notwendig)
ModuleRegistry.registerModules(require("ak.core.CoreLuaModule"), require("ak.data.DataLuaModule"),
                               require("ak.road.CrossingLuaModul"),
                               require("ak.public-transport.PublicTransportLuaModule"))

-- Die EEPMain Methode wird von EEP genutzt. Sie muss immer 1 zurückgeben.
function EEPMain()
    -- Die Modulverwaltung startet die Aufgaben in allen Modulen bei jedem fünften EEPMain-Aufruf
    ModuleRegistry.runTasks(5)
    return 1
end

-- Nutze einen Speicherslot in EEP um die Einstellungen für Kreuzungen zu laden und zu speichern
-- Crossing.loadSettingsFromSlot(1)


text:
#import "UITableView.h"

@interface UINotesTableView : UITableView
{
}

- (void)setFrame:(struct CGRect)arg1;

@end


text:
package io.dropwizard.metrics.servlet;

import java.util.HashMap;
import java.util.Map;

/**
 * Implementation of the {@link AbstractInstrumentedFilter} which provides a default set of response codes
 * to capture information about.
Use it in your servlet.xml like this:

 *
{@code
 * <filter>
 *     <filter-name>instrumentedFilter</filter-name>
 *     <filter-class>io.dropwizard.metrics.servlet.InstrumentedFilter</filter-class>
 * </filter>
 * <filter-mapping>
 *     <filter-name>instrumentedFilter</filter-name>
 *     <url-pattern>/*</url-pattern>
 * </filter-mapping>
 * }

 */
public class InstrumentedFilter extends AbstractInstrumentedFilter {
    public static final String REGISTRY_ATTRIBUTE = InstrumentedFilter.class.getName() + ".registry";

    private static final String NAME_PREFIX = "responseCodes.";
    private static final int OK = 200;
    private static final int CREATED = 201;
    private static final int NO_CONTENT = 204;
    private static final int BAD_REQUEST = 400;
    private static final int NOT_FOUND = 404;
    private static final int SERVER_ERROR = 500;

    /**
     * Creates a new instance of the filter.
     */
    public InstrumentedFilter() {
        super(REGISTRY_ATTRIBUTE, createMeterNamesByStatusCode(), NAME_PREFIX + "other");
    }

    private static Map<Integer, String> createMeterNamesByStatusCode() {
        final Map<Integer, String> meterNamesByStatusCode = new HashMap<>(6);
        meterNamesByStatusCode.put(OK, NAME_PREFIX + "ok");
        meterNamesByStatusCode.put(CREATED, NAME_PREFIX + "created");
        meterNamesByStatusCode.put(NO_CONTENT, NAME_PREFIX + "noContent");
        meterNamesByStatusCode.put(BAD_REQUEST, NAME_PREFIX + "badRequest");
        meterNamesByStatusCode.put(NOT_FOUND, NAME_PREFIX + "notFound");
        meterNamesByStatusCode.put(SERVER_ERROR, NAME_PREFIX + "serverError");
        return meterNamesByStatusCode;
    }
}


text:
var gitlog = require('./index');
var commits = gitlog.read({
  fields: ['abbrevHash', 'subject', 'body']
});
console.log(commits);


text:
using Carter;
using Carter.Request;
using Carter.Response;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Routing;
using Readinglist.Notes.Logic.Services;

namespace ReadingList.Carter.Modules
{
    public class BookNotesModule : ICarterModule
    {
        private readonly IBookNotesService _bookNotesService;

        private const string BaseUri = "/api/notes";

        public BookNotesModule(IBookNotesService bookNotesService)
        {
            _bookNotesService = bookNotesService;
        }

        public void AddRoutes(IEndpointRouteBuilder app)
        {
            app.MapGet($"{BaseUri}/random", async (HttpRequest req, HttpResponse res) =>
            {
                await res.AsJson(await _bookNotesService.GetRandomBookNote());
            });

            app.MapGet($"{BaseUri}/all", async (HttpRequest req, HttpResponse res) =>
            {
                await res.AsJson(await _bookNotesService.GetAllBookNotes());
            });

            app.MapGet($"{BaseUri}/book", async (HttpRequest req, HttpResponse res) =>
            {
                await res.AsJson(await _bookNotesService.GetBookNotes(req.Query.As<string>("title")));
            });
        }

    }
}