text:
// Author: matterbury@google.com (Matt Atterbury)

#ifndef NET_INSTAWEB_REWRITER_PUBLIC_CSS_INLINE_IMPORT_TO_LINK_FILTER_H_
#define NET_INSTAWEB_REWRITER_PUBLIC_CSS_INLINE_IMPORT_TO_LINK_FILTER_H_

#include "pagespeed/kernel/base/basictypes.h"
#include "pagespeed/kernel/html/empty_html_filter.h"

namespace net_instaweb {

class HtmlCharactersNode;
class HtmlElement;
class RewriteDriver;
class Statistics;
class Variable;

// Filter to rewrite style tags of the form:
//   <style type="text/css" ...>
//     @import url(URL1);
//     @import url(URL2);
//     foobar
//   </style>
// to
//   <link type="text/css" ... rel="stylesheet" href="URL1"/>
//   <link type="text/css" ... rel="stylesheet" href="URL2"/>
//   <style type="text/css" ...>
//     foobar
//   </style>
class CssInlineImportToLinkFilter : public EmptyHtmlFilter {
 public:
  explicit CssInlineImportToLinkFilter(RewriteDriver* driver,
                                       Statistics* statistics);
  virtual ~CssInlineImportToLinkFilter();

  static void InitStats(Statistics* statistics);

  virtual void StartDocument();
  virtual void EndDocument();

  virtual void StartElement(HtmlElement* element);
  virtual void EndElement(HtmlElement* element);

  virtual void Flush();

  // HTML Events we expect to be in a <style> element.
  virtual void Characters(HtmlCharactersNode* characters);

  virtual const char* Name() const { return "InlineImportToLinkCss"; }

 private:
  void ResetState();
  void InlineImportToLinkStyle();

  RewriteDriver* driver_;
  // The style element we are in (if it hasn't been flushed).
  // If we are not in a style element, style_element_ == NULL.
  HtmlElement* style_element_;
  // The characters inside the style element we are in.
  HtmlCharactersNode* style_characters_;
  // Statistics count of the number of times we rewrite a style element.
  Variable* counter_;

  DISALLOW_COPY_AND_ASSIGN(CssInlineImportToLinkFilter);
};

}  // namespace net_instaweb

#endif  // NET_INSTAWEB_REWRITER_PUBLIC_CSS_INLINE_IMPORT_TO_LINK_FILTER_H_

redpajama_set_name: RedPajamaGithub


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

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>tesseract: /home/stefan/src/github/tesseract-ocr/tesseract/ccutil/params.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

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

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

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

tesseract
    4.00.00dev

Namespaces |
Macros |
Functions

params.cpp File Reference

#include <stdio.h>

#include <string.h>

#include <stdlib.h>

#include "genericvector.h"

#include "scanutils.h"

#include "tprintf.h"

#include "params.h"

Go to the source code of this file.

Namespaces

  	tesseract

Macros

#define 	PLUS   '+'

#define 	MINUS   '-'

#define 	EQUAL   '='

Functions

tesseract::ParamsVectors * 	GlobalParams ()

Macro Definition Documentation

◆ EQUAL

          #define EQUAL   '='

Definition at line 31 of file params.cpp.

◆ MINUS

          #define MINUS   '-'

Definition at line 30 of file params.cpp.

◆ PLUS

          #define PLUS   '+'

Definition at line 29 of file params.cpp.

Function Documentation

◆ GlobalParams()

          tesseract::ParamsVectors* GlobalParams
          (
          	)

Definition at line 33 of file params.cpp.

   33                                        {

   34   static tesseract::ParamsVectors global_params = tesseract::ParamsVectors();

   35   return &global_params;

   36 }

tesseract::ParamsVectors

Definition: params.h:43

ccutil

params.cpp

Generated on Sat May 20 2017 22:15:24 for tesseract by

     1.8.13


text:
local _, Engine = ...
local Module = Engine:NewModule("Blizzard: GameMenu")

-- Lua API
local ipairs = ipairs
local tinsert = table.insert

local BLANK_TEXTURE = [[Interface\ChatFrame\ChatFrameBackground]]

-- to avoid potential taint, we safewrap the layout method
Module.UpdateButtonLayout = Module:Wrap(function(self)
	local config = self.config
	local UICenter = Engine:GetFrame()

	local previous, bottom_previous
	local first, last
	for i,v in ipairs(self.buttons) do
		local button = v.button
		if button and button:IsShown() then
			button:ClearAllPoints()
			if previous then
				button:SetPoint("TOPLEFT", previous, "BOTTOMLEFT", 0, -config.button_spacing)
			else
				button:SetPoint("TOP", UICenter, "TOP", 0, -300) -- we'll change this later
				first = button
			end
			previous = button
			last = button
		end
	end

	-- re-align first button so that the menu will be vertically centered
	local top = first:GetTop()
	local bottom = last:GetBottom()
	local screen_height = UICenter:GetHeight()
	local height = top - bottom
	local y_position = (screen_height - height)/2

	first:ClearAllPoints()
	first:SetPoint("TOP", UICenter, "TOP", 0, -y_position)

end)

Module.StyleButtons = function(self)
	local config = self.config
	local uiconfig = self.uiconfig
	local UICenter = Engine:GetFrame()

	local need_addon_watch
	for i,v in ipairs(self.buttons) do
		-- figure out the real frame handle of the button
		local button
		if type(v.content) == "string" then
			button = _G[v.content]
		else
			button = v.content
		end

		-- style it unless we've already done it
		if not v.styled then

			if button then
				-- Ignore hidden buttons, because that means Blizzard aren't using them.
				-- An example of this is the mac options button which is hidden on windows/linux.
				--if button:IsShown() then
					local label
					if type(v.label) == "function" then
						label = v.label()
					else
						label = v.label
					end
					local anchor = v.anchor

					-- run custom scripts on the button, if any
					if v.run then
						v.run(button)
					end

					-- Hide some textures added in Legion that cause flickering
					if button.Left then
						button.Left:SetAlpha(0)
					end
					if button.Right then
						button.Right:SetAlpha(0)
					end
					if button.Middle then
						button.Middle:SetAlpha(0)
					end

					-- Clear away blizzard artwork
					button:SetNormalTexture("")
					button:SetHighlightTexture("")
					button:SetPushedTexture("")

					--button:SetText(" ") -- this is not enough, blizzard adds it back in some cases

					local fontstring = button:GetFontString()
					if fontstring then
						fontstring:SetAlpha(0) -- this is compatible with the Shop button
					end

					-- We can NOT modify the :SetText function durictly, as it sometimes is called by secure code,
					-- and we would end up with a tainted GameMenuFrame!
					--hooksecurefunc(button, "SetText", function(self, msg)
					--	if not msg or msg == "" then
					--		return
					--	end
						--self:SetText(" ")
					--end)

					-- create our own artwork
					button.normal = button:CreateTexture(nil, "ARTWORK")
					button.normal:SetPoint("CENTER")

					button.highlight = button:CreateTexture(nil, "ARTWORK")
					button.highlight:SetPoint("CENTER")

					button.pushed = button:CreateTexture(nil, "ARTWORK")
					button.pushed:SetPoint("CENTER")

					button.text = {
						normal = button:CreateFontString(nil, "OVERLAY"),
						highlight = button:CreateFontString(nil, "OVERLAY"),
						pushed = button:CreateFontString(nil, "OVERLAY"),

						SetPoint = function(self, ...)
							self.normal:SetPoint(...)
							self.highlight:SetPoint(...)
							self.pushed:SetPoint(...)
						end,

						ClearAllPoints = function(self)
							self.normal:ClearAllPoints()
							self.highlight:ClearAllPoints()
							self.pushed:ClearAllPoints()
						end,

						SetText = function(self, ...)
							self.normal:SetText(...)
							self.highlight:SetText(...)
							self.pushed:SetText(...)
						end

					}
					button.text:SetPoint("CENTER")

					button:HookScript("OnEnter", function(self) self:UpdateLayers() end)
					button:HookScript("OnLeave", function(self) self:UpdateLayers() end)
					button:HookScript("OnMouseDown", function(self)
						self.isDown = true
						self:UpdateLayers()
					end)
					button:HookScript("OnMouseUp", function(self)
						self.isDown = false
						self:UpdateLayers()
					end)
					button:HookScript("OnShow", function(self)
						self.isDown = false
						self:UpdateLayers()
					end)
					button:HookScript("OnHide", function(self)
						self.isDown = false
						self:UpdateLayers()
					end)
					button.UpdateLayers = function(self)
						if self.isDown then
							if self:IsMouseOver() then
								self.pushed:SetAlpha(1)
								self.text.pushed:SetAlpha(1)
								self.text:ClearAllPoints()
								self.text:SetPoint("CENTER", 0, -4)
								self.highlight:SetAlpha(0)
								self.text.normal:SetAlpha(0)
								self.text.highlight:SetAlpha(0)
							else
								self.highlight:SetAlpha(1)
								self.text.highlight:SetAlpha(1)
								self.text:ClearAllPoints()
								self.text:SetPoint("CENTER", 0, 0)
								self.pushed:SetAlpha(0)
								self.normal:SetAlpha(0)
								self.text.pushed:SetAlpha(0)
								self.text.normal:SetAlpha(0)
							end
							self.normal:SetAlpha(0)
						else
							self.text:ClearAllPoints()
							self.text:SetPoint("CENTER", 0, 0)
							if self:IsMouseOver() then
								self.highlight:SetAlpha(1)
								self.text.highlight:SetAlpha(1)
								self.pushed:SetAlpha(0)
								self.normal:SetAlpha(0)
								self.text.pushed:SetAlpha(0)
								self.text.normal:SetAlpha(0)
							else
								self.normal:SetAlpha(1)
								self.text.normal:SetAlpha(1)
								self.highlight:SetAlpha(0)
								self.pushed:SetAlpha(0)
								self.text.pushed:SetAlpha(0)
								self.text.highlight:SetAlpha(0)
							end
						end
					end

					button:SetSize(unpack(uiconfig.menubutton.size))

					button.normal:SetTexture(uiconfig.menubutton.texture.normal)
					button.normal:SetSize(unpack(uiconfig.menubutton.texture_size))
					button.normal:ClearAllPoints()
					button.normal:SetPoint("CENTER")

					button.highlight:SetTexture(uiconfig.menubutton.texture.highlight)
					button.highlight:SetSize(unpack(uiconfig.menubutton.texture_size))
					button.highlight:ClearAllPoints()
					button.highlight:SetPoint("CENTER")

					button.pushed:SetTexture(uiconfig.menubutton.texture.pushed)
					button.pushed:SetSize(unpack(uiconfig.menubutton.texture_size))
					button.pushed:ClearAllPoints()
					button.pushed:SetPoint("CENTER")

					button.text.normal:SetFontObject(uiconfig.menubutton.normalFont)
					button.text.highlight:SetFontObject(uiconfig.menubutton.highlightFont)
					button.text.pushed:SetFontObject(uiconfig.menubutton.pushedFont)

					button.text:SetText(label)

					button:UpdateLayers() -- update colors and layers

					v.button = button -- add a reference to the frame handle for the layout function
					v.styled = true -- avoid double styling

				--end
			else
				-- If the button doesn't exist, it could be something added by an addon later.
				if v.addon then
					need_addon_watch = true
				end
			end

		end
	end

	-- Add this as a callback if a button from an addon wasn't loaded.
	-- *Could add in specific addons to look for here, but I'm not going to bother with it.
	if need_addon_watch then
		if not self.looking_for_addons then
			self:RegisterEvent("ADDON_LOADED", "StyleButtons")
			self.looking_for_addons = true
		end
	else
		if self.looking_for_addons then
			self:UnregisterEvent("ADDON_LOADED", "StyleButtons")
			self.looking_for_addons = nil
		end
	end

	self:UpdateButtonLayout()
end

Module.StyleWindow = function(self, frame)
	local config = self.config

	self.frame:EnableMouse(false) -- only need the mouse on the actual buttons
	self.frame:SetBackdrop(nil)

	self.frame:SetFrameStrata("DIALOG")
	self.frame:SetFrameLevel(120)

	if not self.objects then
		self.objects = {} -- registry of objects we won't strip
	end

	for i = 1, self.frame:GetNumRegions() do
		local region = select(i, self.frame:GetRegions())
		if region and not self.objects[region] then
			local object_type = region.GetObjectType and region:GetObjectType()
			local hide
			if object_type == "Texture" then
				region:SetTexture("")
				region:SetAlpha(0)
			elseif object_type == "FontString" then
				region:SetText("")
			end
		end
	end

	-- kill off mouse input?
	if config.capture_mouse then
		if not self.mouse then
			self.mouse = CreateFrame("Frame", nil, self.frame)
			self.mouse:SetFrameLevel(0)
			self.mouse:SetAllPoints(UIParent)
			self.mouse:EnableMouse(true)
		end
		self.mouse:Show()
	else
		if self.mouse then
			self.mouse:Hide()
		end
	end

	if config.dim then
		if not self.dimmer then
			self.dimmerframe = CreateFrame("Frame", nil, self.frame)
			self.dimmerframe:SetFrameLevel(0)

			self.dimmer = self.dimmerframe:CreateTexture(nil, "BACKGROUND")
			self.dimmer:SetPoint("TOP", UIParent, 0, 10)
			self.dimmer:SetPoint("BOTTOM", UIParent, 0, -10)
			self.dimmer:SetPoint("RIGHT", UIParent, 10, 0)
			self.dimmer:SetPoint("LEFT", UIParent, -10, 0)
			self.dimmer:SetTexture(BLANK_TEXTURE)

			self.objects[self.dimmer] = true
		end
		self.dimmer:SetVertexColor(unpack(config.dim_color))
		self.dimmer:Show()
	else
		if self.dimmer then
			self.dimmer:Hide()
		end
	end

	if config.show_logo then
		if not self.logo then
			self.logo = self.frame:CreateTexture(nil, "ARTWORK")
			self.logo:SetSize(unpack(config.logo.size))
			self.logo:SetTexture(config.logo.texture)
			local p = config.logo.position
			self.logo:SetPoint(p.point, Engine:GetFrame(), p.rpoint, p.xoffset, p.yoffset)
			self.objects[self.logo] = true
		end
		self.logo:Show()
	else
		if self.logo then
			self.logo:Hide()
		end
	end
end

Module.OnInit = function(self)
	self.config = self:GetDB("Blizzard").gamemenu
	self.uiconfig = self:GetDB("UI")
	self.frame = GameMenuFrame

	-- does this taint? :/
	local UICenter = Engine:GetFrame()
	self.frame:SetParent(UICenter)

	if Engine:IsBuild("WoD") then
		self.buttons = {
			{ content = GameMenuButtonHelp, label = GAMEMENU_HELP },
			{ content = GameMenuButtonStore, label = BLIZZARD_STORE },
			{ content = GameMenuButtonWhatsNew, label = GAMEMENU_NEW_BUTTON },
			{ content = GameMenuButtonOptions, label = SYSTEMOPTIONS_MENU },
			{ content = GameMenuButtonUIOptions, label = UIOPTIONS_MENU },
			{ content = GameMenuButtonKeybindings, label = KEY_BINDINGS },
			{ content = "GameMenuButtonMoveAnything", label = function() return GameMenuButtonMoveAnything:GetText() end, addon = true }, -- MoveAnything
			{ content = GameMenuButtonMacros, label = MACROS },
			{ content = GameMenuButtonAddons, label = ADDONS },
			{ content = GameMenuButtonRatings, label = RATINGS_MENU },
			{ content = GameMenuButtonLogout, label = LOGOUT },
			{ content = GameMenuButtonQuit, label = EXIT_GAME },
			{ content = GameMenuButtonContinue, label = RETURN_TO_GAME, anchor = "BOTTOM" }
		}

	elseif Engine:IsBuild("MoP") then
		local Fix_ACP = function(self)
			self:SetScript("OnLoad", nil)
			self:SetScript("OnShow", nil)
			self:SetScript("OnHide", nil)
		end

		self.buttons = {
			{ content = GameMenuButtonHelp, label = GAMEMENU_HELP },
			{ content = GameMenuButtonStore, label = BLIZZARD_STORE },
			{ content = GameMenuButtonOptions, label = SYSTEMOPTIONS_MENU },
			{ content = GameMenuButtonUIOptions, label = UIOPTIONS_MENU },
			{ content = GameMenuButtonMacOptions, label = MAC_OPTIONS },
			{ content = GameMenuButtonKeybindings, label = KEY_BINDINGS },
			{ content = "GameMenuButtonMoveAnything", label = function() return GameMenuButtonMoveAnything:GetText() end, addon = true }, -- MoveAnything
			{ content = GameMenuButtonMacros, label = MACROS },
			{ content = "GameMenuButtonAddOns", label = function() return GameMenuButtonAddOns:GetText() end, run = Fix_ACP, addon = true }, -- ACP (Addon Control Panel)
			{ content = GameMenuButtonRatings, label = RATINGS_MENU },
			{ content = GameMenuButtonLogout, label = LOGOUT },
			{ content = GameMenuButtonQuit, label = EXIT_GAME },
			{ content = GameMenuButtonContinue, label = RETURN_TO_GAME, anchor = "BOTTOM" }
		}
	elseif Engine:IsBuild("Cata") then
		local Fix_ACP = function(self)
			self:SetScript("OnShow", nil)
			self:SetScript("OnHide", nil)
		end

		self.buttons = {
			{ content = GameMenuButtonHelp, label = GAMEMENU_HELP },
			{ content = GameMenuButtonOptions, label = SYSTEMOPTIONS_MENU },
			{ content = GameMenuButtonUIOptions, label = UIOPTIONS_MENU },
			{ content = GameMenuButtonMacOptions, label = MAC_OPTIONS },
			{ content = GameMenuButtonKeybindings, label = KEY_BINDINGS },
			{ content = "GameMenuButtonMoveAnything", label = function() return GameMenuButtonMoveAnything:GetText() end, addon = true }, -- MoveAnything
			{ content = GameMenuButtonMacros, label = MACROS },
			{ content = "GameMenuButtonAddOns", label = function() return GameMenuButtonAddOns:GetText() end, run = Fix_ACP, addon = true }, -- ACP (Addon Control Panel)
			{ content = GameMenuButtonRatings, label = RATINGS_MENU },
			{ content = GameMenuButtonLogout, label = LOGOUT },
			{ content = GameMenuButtonQuit, label = EXIT_GAME },
			{ content = GameMenuButtonContinue, label = RETURN_TO_GAME, anchor = "BOTTOM" }
		}

	elseif Engine:IsBuild("WotLK") then
		local Fix_ACP = function(self)
			self:SetScript("OnShow", nil)
			self:SetScript("OnHide", nil)
		end

		self.buttons = {
			{ content = GameMenuButtonOptions, label = VIDEOOPTIONS_MENU },
			{ content = GameMenuButtonSoundOptions, label = VOICE_SOUND }, -- SOUNDOPTIONS_MENU
			{ content = GameMenuButtonUIOptions, label = UIOPTIONS_MENU },
			{ content = GameMenuButtonMacOptions, label = MAC_OPTIONS },
			{ content = GameMenuButtonKeybindings, label = KEY_BINDINGS },
			{ content = "GameMenuButtonMoveAnything", label = function() return GameMenuButtonMoveAnything:GetText() end, addon = true }, -- MoveAnything
			{ content = GameMenuButtonMacros, label = MACROS },
			{ content = "GameMenuButtonAddOns", label = function() return GameMenuButtonAddOns:GetText() end, run = Fix_ACP, addon = true }, -- ACP (Addon Control Panel)
			{ content = GameMenuButtonRatings, label = RATINGS_MENU },
			{ content = GameMenuButtonLogout, label = LOGOUT },
			{ content = GameMenuButtonQuit, label = EXIT_GAME },
			{ content = GameMenuButtonContinue, label = RETURN_TO_GAME, anchor = "BOTTOM" }
		}

	end

	local UIHider = CreateFrame("Frame")
	UIHider:Hide()

	-- kill mac options button if not a mac client
	if GameMenuButtonMacOptions and (not IsMacClient()) then
		for i,v in ipairs(self.buttons) do
			if v.content == GameMenuButtonMacOptions then
				GameMenuButtonMacOptions:UnregisterAllEvents()
				GameMenuButtonMacOptions:SetParent(UIHider)
				GameMenuButtonMacOptions.SetParent = function() end
				tremove(self.buttons, i)
				break
			end
		end
	end

	-- Remove store button if there's no store available,
	-- if we're currently using a trial account,
	-- or if the account is in limited (no paid gametime) mode.
	if GameMenuButtonStore
	and ((C_StorePublic and not C_StorePublic.IsEnabled())
	or (IsTrialAccount and IsTrialAccount())
	or (GameLimitedMode_IsActive and GameLimitedMode_IsActive())) then
		for i,v in ipairs(self.buttons) do
			if v.content == GameMenuButtonStore then
				GameMenuButtonStore:UnregisterAllEvents()
				GameMenuButtonStore:SetParent(UIHider)
				GameMenuButtonStore.SetParent = function() end
				tremove(self.buttons, i)
				break
			end
		end
	end

	-- add a hook to blizzard's button visibility function to properly re-align the buttons when needed
	if GameMenuFrame_UpdateVisibleButtons then
		hooksecurefunc("GameMenuFrame_UpdateVisibleButtons", function() self:UpdateButtonLayout() end)
	end

	self:RegisterEvent("UI_SCALE_CHANGED", "UpdateButtonLayout")
	self:RegisterEvent("DISPLAY_SIZE_CHANGED", "UpdateButtonLayout")

	if VideoOptionsFrameApply then
		VideoOptionsFrameApply:HookScript("OnClick", function() self:UpdateButtonLayout() end)
	end

	if VideoOptionsFrameOkay then
		VideoOptionsFrameOkay:HookScript("OnClick", function() self:UpdateButtonLayout() end)
	end

end

Module.OnEnable = function(self)
	self:StyleWindow()
	self:StyleButtons()
end


text:
const timeHandler = (time) => {
  const minutes = Math.floor(time / 60);
  const seconds = time - minutes * 60;

  return {
    minutes,
    seconds
  };
};

export default timeHandler;


text:
layout: bidder
title: SmileWanted
description: SmileWanted Bidder Adaptor
media_types: banner, video
hide: true
biddercode: smilewanted
gdpr_supported: true

---

### Note

To use us as a bidder you must have an account and an active "zoneId" on our SmileWanted platform.

### Test zoneId

zoneId: 1

This zoneId will always deliver an ad, a SmileWanted creation with a price of requested CPM, which offer you to test and to win every auctions.
(Please note that impressions and revenues of this test zone this will not be recorded and not be paid)

### Bid params

{: .table .table-bordered .table-striped }
| Name     | Scope    | Description           | Example  | Type      |
|----------|----------|-----------------------|----------|-----------|
| `zoneId` | required | The placement zone ID | `350975` | `integer` |


text:
var Checker = require('../../../lib/checker');
var expect = require('chai').expect;

describe('rules/disallow-keywords', function() {
    var checker;
    beforeEach(function() {
        checker = new Checker();
        checker.registerDefaultRules();
    });
    it('should report illegal keyword', function() {
        checker.configure({ disallowKeywords: ['with'] });
        expect(checker.checkString('with (x) { y++; }')).to.have.one.validation.error.from('disallowKeywords');
    });
    it('should not report legal keywords', function() {
        checker.configure({ disallowKeywords: ['with'] });
        expect(checker.checkString('if(x) { x++; }')).to.have.no.errors();
    });
});


text:
<resources>
    <string name="app_name">MiLift Workout Tracker</string>

    <string name="instructions">Press Start to start Classifying</string>
    <string name="action_settings">Settings</string>
    <string name="start_button_text">Start</string>
    <string name="stop_button_text">Stop</string>

    <string name="calendar_button_text">Calendar</string>
    <string name="undo">Undo</string>
</resources>


text:
/**
 * Module dependencies
 */

var util = require('util');
var _ = require('@sailshq/lodash');
var flaverr = require('flaverr');
var normalizePkValue = require('./normalize-pk-value');

/**
 * normalizePkValueOrValues()
 *
 * Validate and normalize an array of pk values, OR a single pk value, into a consistent format.
 *
 * > Internally, this uses the `normalizePkValue()` utility to check/normalize each
 * > primary key value before returning them.  If an array is provided, and if it contains
 * > _more than one pk value that is exactly the same_, then the duplicates will be stripped
 * > out.
 *
 * ------------------------------------------------------------------------------------------
 * @param  {Array|String|Number} pkValueOrPkValues
 * @param  {String} expectedPkType   [either "number" or "string"]
 * ------------------------------------------------------------------------------------------
 * @returns {Array}
 *          A valid, homogeneous array of primary key values that are guaranteed
 *          to match the specified `expectedPkType`.
 *          > WE should NEVER rely on this array coming back in a particular order.
 *          > (Could change at any time.)
 * ------------------------------------------------------------------------------------------
 * @throws {Error} if invalid
 *         @property {String} code (=== "E_INVALID_PK_VALUE")
 */

module.exports = function normalizePkValueOrValues (pkValueOrPkValues, expectedPkType){

  // Check usage
  if (expectedPkType !== 'string' && expectedPkType !== 'number') {
    throw new Error('Consistency violation: The internal normalizePkValueOrValues() utility must always be called with a valid second argument ("string" or "number").  But instead, got: '+util.inspect(expectedPkType, {depth:5})+'');
  }

  // Our normalized result.
  var pkValues;

  // If a singular string or number was provided, convert it into an array.
  if (_.isString(pkValueOrPkValues) || _.isNumber(pkValueOrPkValues)) {
    pkValues = [ pkValueOrPkValues ];
  }
  // Otherwise, we'll assume it must already be an array.
  // (Don't worry, we'll validate it momentarily.)
  else {
    pkValues = pkValueOrPkValues;
  }
  //>-

  // Now, handle the case where something completely invalid was provided.
  if (!_.isArray(pkValues)) {
    throw flaverr('E_INVALID_PK_VALUE', new Error('Expecting either an individual primary key value (a '+expectedPkType+') or a homogeneous array of primary key values ('+expectedPkType+'s).  But instead got a '+(typeof pkValues)+': '+util.inspect(pkValues,{depth:5})+''));
  }//-•

  // Now that we most definitely have an array, ensure that it doesn't contain anything
  // strange, curious, or malevolent by looping through and calling `normalizePkValue()`
  // on each item.
  pkValues = _.map(pkValues, function (thisPkValue){

    // Return this primary key value, which might have been coerced.
    try {
      return normalizePkValue(thisPkValue, expectedPkType);
    } catch (e) {
      switch (e.code) {
        case 'E_INVALID_PK_VALUE':
          throw flaverr('E_INVALID_PK_VALUE', new Error(
            (
              _.isArray(pkValueOrPkValues) ?
              'One of the values in the provided array' :
              'The provided value'
            )+' is not valid primary key value.  '+e.message
          ));
        default: throw e;
      }
    }

  });//</_.map()>

  // Ensure uniqueness.
  // (Strip out any duplicate pk values.)
  pkValues = _.uniq(pkValues);

  // Return the normalized array of pk values.
  return pkValues;

};


text:
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// 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.
// ----------------------------------------------------------------------------------

namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets
{
    /// <summary>
    /// Class enclosing the cmdlet parameter help messages
    /// </summary>
    internal static class ParamHelpMsgs
    {
        internal static class Container
        {
            public const string Name = "The name of the resource being managed by the Azure Backup service (for example: resource name of the VM).";
            public const string ResourceGroupName = "The ResourceGroup of the resource being managed by the Azure Backup service" +
                " (for example: ResourceGroup name of the VM).";
            public const string Status = "The registration status of the Azure Backup container.";
            public const string ContainerType = "The type of the Azure Backup container (for example:  Windows Server or Azure IaaS VM).";
            public const string BackupManagementType = "The backup management type of the Azure Backup container";
            public const string RegisteredContainer = "The recovery services backup container.";
            public const string FriendlyName = "The name of the resource being managed by the" +
                " Azure Backup service (for example: resource name of the VM).";
        }

        internal static class Common
        {
            public const string Vault = "The Azure Backup vault object which is the parent resource.";
            public const string VaultId = "Resource ID of the Recovery Services Vault.";
            public const string WorkloadType = "Workload type of the resource (for example: AzureVM, WindowsServer, AzureFiles).";
            public const string BackupManagementType = "Backup Management type of the resource (for example: MAB, DPM).";
            public const string ConfirmationMessage = "Don't ask for confirmation.";
        }

        internal static class Policy
        {
            public const string Name = "Name of the Policy that is being managed.";
            public const string RetentionPolicy = "Retention Policy object for the policy.";
            public const string SchedulePolicy = "Schedule Policy object for the policy.";
            public const string ProtectionPolicy = "Protection policy object.";
        }

        internal static class Job
        {
            public const string FromFilter = "Beginning value of time range for which jobs have to be fetched.";
            public const string ToFilter = "Ending value of time range for which jobs have to be fetched.";
            public const string OperationFilter = "Filter value for type of job.";
            public const string StatusFilter = "Filter value for status of job.";
            public const string BackupManagementTypeFilter = "Filter value for Backup Management Type of job.";
            public const string JobIdFilter = "Filter value for Id of job.";
            public const string JobFilter = "Job whose latest object has to be fetched.";
            public const string WaitJobOrListFilter = "Job or List of jobs until end of which the cmdlet should wait.";
            public const string WaitJobTimeoutFilter = "Maximum time to wait before aborting wait in seconds.";
            public const string StopJobJobIdFilter = "Id of Job to be stopped.";
            public const string StopJobJobFilter = "Job to be stopped.";
        }

        internal static class Item
        {
            public const string ItemName = "Name of the item.";
            public const string AzureVMServiceName = "Cloud Service Name for Azure Classic Compute VM.";
            public const string AzureVMResourceGroupName = "Resource Group Name for Azure Compute VM .";
            public const string ProtectedItem = "Filter value for status of job.";
            public const string ProtectionStatus = "Protection status of Item";
            public const string Status = "Status of the data source";
            public const string Container = "Container where the item resides";
            public const string RemoveProtectionOption = "If this option is used, all the backup data for this item will " +
                "also be deleted and restoring data will not be possible.";
            public const string ExpiryDate = "Retention period for the recovery points created by this backup operaiton";
            public const string ForceOption = "Force disables backup protection (prevents confirmation dialog). This parameter is optional.";
            public const string ExpiryDateTimeUTC = "Date and time specified in UTC after which" +
                " the recovery points created by this backup will no longer be available for restore";
            public const string ProtectionPolicy = "The id of the backup policy which is used to protect the backup items";
            public const string AzureFileShareName = "Azure FileShare Name.";
            public const string AzureFileStorageAccountName = "Azure file share storage account name";
            public const string AzureFileStorageAccountResourceGroupName = "Azure file share storage account resource group name";
        }

        internal static class RecoveryPoint
        {
            public const string StartDate = "Start time of Time range for which recovery point need to be fetched";
            public const string EndDate = "End time of Time range for which recovery point need to be fetched";
            public const string Item = "Protected Item object for which recovery point need to be fetched";
            public const string RecoveryPointId = "Recovery point Id for which detail is needed";
            public const string ILRRecoveryPoint =
                "Recovery point to be explored for file folder restore";
            public const string ILRConnect =
                "Initiate an iCSCI connection for file folder restore";
            public const string ILRExtend =
                "Extend the existing iCSCI connection for file folder restore";
            public const string ILRTerminate =
                "Terminate the existing iCSCI connection for file folder restore";
            public const string KeyFileDownloadLocation =
                "Location where the key file should be downloaded in the case of encrypted VMs.";
            public const string FileDownloadLocation =
                "Location where the file should be downloaded in the case of file recovery. If -Path is not provided, the script file will be downloaded in the current directory.";
        }

        internal static class RestoreDisk
        {
            public const string RecoveryPoint = "Recovery point object to be restored";
            public const string StorageAccountName = "Storage account name where the disks need to be recovered";
            public const string StorageAccountResourceGroupName = "Resource group name of Storage account name where the disks need to be recovered";
        }

        internal static class RestoreVM
        {
            public const string TargetResourceGroupName = "The resource group to which the managed disks are restored. Applicable to backup of VM with managed disks";
            public const string OsaOption = "Use this switch if the disks from the recovery point are to be restored to their original storage accounts";
        }

        internal static class RestoreFS
        {
            public const string SourceFilePath = "Used for a particular item restore from a file share. The path of the item to be restored within the file share.";
            public const string SourceFileType = "Whether the item to be restored is a file or a folder";
            public const string ResolveConflict = "In case the restored item also exists in the destination, use this to indicate whether to overwrite or not.";
            public const string TargetStorageAccountName = "The storage account to which the file share has to be restored to.";
            public const string TargetFileShareName = "The File Share to which the file share has to be restored to.";
            public const string TargetFolder = "The folder under which the file share has to be restored to within the targetFileShareName.Leave the variable empty to restore under root folder.";

        }

        internal static class ProtectionCheck
        {
            public const string Name = "Name of the Azure Resource whose representative item needs to be checked if it is already protected by some Recovery Services Vault in the subscription.";
            public const string ResourceGroupName = "Name of the resource group of the Azure Resource whose representative item needs to be checked if it is already protected by some RecoveryServices Vault in the subscription.";
            public const string Type = "Name of the Azure Resource whose representative item needs to be checked if it is already protected by some Recovery Services Vault in the subscription.";
            public const string ResourceId = "ID of the Azure Resource whose representative item needs to be checked if it is already protected by some RecoveryServices Vault in the subscription.";
        }
    }
}


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

<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>U-Index</title>
<meta name="date" content="2015-01-10">
<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

Prev Letter

Next Letter

Frames

No Frames

All Classes

A B C D E F G H I K L M N O P R S T U V W Z

U

update(Observable, Object) - Method in class com.haw.projecthorse.audiomanager.AudioManagerImpl

update(float) - Method in class com.haw.projecthorse.level.game.applerun.Gamestate

update.

update(float) - Method in class com.haw.projecthorse.level.game.parcours.GameObjectLogic

Updated die Positionen der GameObjects, prüft Neigungswinkel des Devices,
 prüft ob das Pferd außerhalb des Spielfeldes sein würde wenn es sich bewegt und
 ermittelt, ob eine Kollision mit einem GameObject stattgefunden hat.

update(float) - Method in class com.haw.projecthorse.level.game.parcours.GameOperator

update(float) - Method in interface com.haw.projecthorse.level.game.parcours.IGameObjectLogicFuerGameOperator

Updated den GameOperator.

update(float) - Method in interface com.haw.projecthorse.level.game.parcours.IGameOperator

Prüft ob die GameLogic mitteilt, dass ein Erfolg oder Misserfolg
 eingetreten ist.

update(float) - Method in interface com.haw.projecthorse.level.game.parcours.IGameOperatorFuerParcours

update = Level.render().

update(Observable, Object) - Method in class com.haw.projecthorse.level.util.overlay.popup.GamePausePopup

update(Observable, Object) - Method in class com.haw.projecthorse.level.util.overlay.popup.SettingsPopup

updateGameObjects(float) - Method in class com.haw.projecthorse.level.game.parcours.GameObjectLogic

Setzt GameObjects die vollständig außerhalb des Spielfelds sind auf
 unvisible, setzt GameObjects die unvisible und vollständig außerhalb des
 Spielfelds sind auf eine neue, freie Position und veranlasst genau das
 GameObject, welches das letzte - also am weitesten rechts befindliche-
 GameObject ist, die freePosition auf seine neue Position anzupassen.

A B C D E F G H I K L M N O P R S T U V W Z

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes


text:
class Octave < Formula
  desc "High-level interpreted language for numerical computing"
  homepage "https://www.gnu.org/software/octave/index.html"
  url "https://ftpmirror.gnu.org/octave/octave-4.2.0.tar.lz"
  mirror "https://ftp.gnu.org/gnu/octave/octave-4.2.0.tar.lz"
  sha256 "119d45c21d567c02eb0042987da4676aa25c7c2fde6e119053e0c6d779a47ba7"

  bottle do
    sha256 "192097cc562b2033a5af222762e353413f904c4bdc2870d90e3e63142867397f" => :sierra
    sha256 "f7a97d8ddb6429020e91fc1cbbd320d73bb7b843d7f2092742e7c1a0bd14bb2c" => :el_capitan
    sha256 "a5eb24ecc98327d33445d2cc9e9f0bebdf43f8f1f7663a8ff0c0e94226e3c0ff" => :yosemite
  end

  if OS.mac? && DevelopmentTools.clang_version < "7.0"
    # Fix the build error with LLVM 3.5svn (-3.6svn?) and libc++ (bug #43298)
    # See: http://savannah.gnu.org/bugs/?43298
    patch do
      url "http://savannah.gnu.org/bugs/download.php?file_id=32255"
      sha256 "ef83b32384a37cca13ecdd30d98dacac314b7c23f2c1df3d1113074bd1169c0f"
    end
    # Fixes includes "base-list.h" and "config.h" in comment-list.h and "oct.h" (bug #41027)
    # Core developers don't like this fix, see: http://savannah.gnu.org/bugs/?41027
    patch do
      url "http://savannah.gnu.org/bugs/download.php?file_id=31400"
      sha256 "efdf91390210a64e4732da15dcac576fb1fade7b85f9bacf4010d102c1974729"
    end
  end

  # Fix bug #46723: retina scaling of buttons
  # see https://savannah.gnu.org/bugs/?46723
  patch :p1 do
    url "https://savannah.gnu.org/bugs/download.php?file_id=38206"
    sha256 "8307cec2b84fe546c8f490329b488ecf1da628ce823301b6765ffa7e6e292eed"
  end

  # dependencies needed for head
  head do
    url "http://www.octave.org/hg/octave", :branch => "default", :using => :hg
    depends_on :hg             => :build
    depends_on "autoconf"      => :build
    depends_on "automake"      => :build
    depends_on "icoutils"      => :build
  end

  # build the pdf docs
  if build.with? "docs"
    depends_on :tex             => :build
    depends_on "librsvg"        => :build
  end

  skip_clean "share/info" # Keep the docs

  # deprecated options
  deprecated_option "with-jit"      => "with-llvm"
  deprecated_option "with-audio"    => "with-sndfile"
  deprecated_option "without-check" => "without-test"
  deprecated_option "without-gui"   => "without-qt5"

  # options, enabled by default
  option "without-curl",           "Do not use cURL (urlread/urlwrite/@ftp)"
  option "without-fftw",           "Do not use FFTW (fft,ifft,fft2,etc.)"
  option "without-fltk",           "Do not use FLTK graphics backend"
  option "without-glpk",           "Do not use GLPK"
  option "without-gnuplot",        "Do not use gnuplot graphics"
  option "without-hdf5",           "Do not use HDF5 (hdf5 data file support)"
  option "without-opengl",         "Do not use opengl"
  option "without-qhull",          "Do not use the Qhull library (delaunay,voronoi,etc.)"
  option "without-qrupdate",       "Do not use the QRupdate package (qrdelete,qrinsert,qrshift,qrupdate)"
  option "without-qt5",            "Do not compile with qt-based graphical user interface"
  option "without-suite-sparse",   "Do not use SuiteSparse (sparse matrix operations)"
  option "without-test",           "Do not perform build-time tests (not recommended)"
  option "without-zlib",           "Do not use zlib (compressed MATLAB file formats)"

  # options, disabled by default
  option "with-docs",              "Compile and install documentation"
  option "with-java",              "Use Java, requires Java 6 from https://support.apple.com/kb/DL1572"
  option "with-llvm",              "Use the experimental just-in-time compiler (not recommended)"
  option "with-openblas",          "Use OpenBLAS instead of native LAPACK/BLAS"
  option "with-osmesa",            "Use the OSmesa library (incompatible with opengl)"
  option "with-portaudio",         "Use portaudio for audio playback and recording"
  option "with-sndfile",           "Use sndfile libraries for audio file operations"

  # build dependencies
  depends_on "gnu-sed"             => :build # http://lists.gnu.org/archive/html/octave-maintainers/2016-09/msg00193.html
  depends_on "pkg-config"          => :build

  # essential dependencies
  depends_on :fortran
  depends_on :x11
  depends_on "bison"               => :build
  depends_on "fontconfig"
  depends_on "freetype"
  depends_on "gawk"                => :build
  depends_on "texinfo"             => :build # we need >4.8
  depends_on "pcre"

  # recommended dependencies (implicit options)
  depends_on "arpack"              => :recommended
  depends_on "curl"                => :recommended
  depends_on "epstool"             => :recommended
  depends_on "fftw"                => :recommended
  depends_on "fltk"                => :recommended
  depends_on "gl2ps"               => :recommended
  depends_on "glpk"                => :recommended
  depends_on "graphicsmagick"      => :recommended # imread/imwrite
  depends_on "hdf5"                => :recommended
  depends_on "qhull"               => :recommended
  depends_on "qrupdate"            => :recommended
  depends_on "readline"            => :recommended
  depends_on "suite-sparse"        => :recommended
  depends_on "transfig"            => :recommended

  # recommended blas dependencies
  depends_on "openblas"            => (OS.mac? ? :optional : :recommended)
  depends_on "veclibfort"          if build.without?("openblas") && OS.mac?

  # recommended ghostscript dependencies
  depends_on "ghostscript"         => :recommended # ps/pdf image output
  depends_on "pstoedit"            if build.with? "ghostscript"

  # recommended qt5 dependencies
  depends_on "qt5"                 => :recommended
  if build.with? "qt5"
    depends_on "qscintilla2"
    depends_on "gnuplot" => [:recommended, "with-qt5"]
  else
    depends_on "gnuplot" => :recommended
  end

  # other optional dependencies
  depends_on "libsndfile"          => :optional
  depends_on "llvm"                => :optional
  depends_on "portaudio"           => :optional
  depends_on :java                 => ["1.6+", :optional]

  # Fix bug #49053: retina scaling of figures
  # see https://savannah.gnu.org/bugs/?49053
  resource "retina-scaling-patch" do
    url "https://savannah.gnu.org/support/download.php?file_id=38902"
    sha256 "d56eff94f9f811845ba3b0897b70cba43c0715a0102b1c79852b72ab10d24e6c"
  end

  # If GraphicsMagick was built from source, it is possible that it was
  # done to change quantum depth. If so, our Octave bottles are no good.
  # https://github.com/Homebrew/homebrew-science/issues/2737
  if build.with? "graphicsmagick"
    def pour_bottle?
      Tab.for_name("graphicsmagick").bottle?
    end
  end

  def install
    ENV.m64 if MacOS.prefer_64_bit?
    ENV.append_to_cflags "-D_REENTRANT"
    ENV.append "LDFLAGS", "-L#{Formula["readline"].opt_lib} -lreadline" if build.with? "readline"
    ENV.prepend_path "PATH", Formula["texinfo"].bin
    ENV["FONTCONFIG_PATH"] = "/opt/X11/lib/X11/fontconfig"

    resource("retina-scaling-patch").stage do
      inreplace "download.php" do |s|
        s.gsub! "#include <QApplication.h>", "#include <QApplication>"
        s.gsub! "__fontsize_points__", "fontsize_points" if build.stable?
      end
      system "patch", "-p1", "-i", Pathname.pwd/"download.php", "-d", buildpath
    end

    # basic arguments
    args = ["--prefix=#{prefix}"]
    args << "--enable-dependency-tracking"
    args << "--enable-link-all-dependencies"
    args << "--enable-shared"
    args << "--disable-static"
    args << "--with-x=no" if OS.mac? # We don't need X11 for Mac at all

    # arguments for options enabled by default
    args << "--without-curl"             if build.without? "curl"
    args << "--disable-docs"             if build.without? "docs"
    args << "--without-fftw3"            if build.without? "fftw"
    args << "--with-fltk-prefix=#{Formula["fltk"].opt_prefix}" if build.with? "fltk"
    args << "--without-glpk"             if build.without? "glpk"
    args << "--without-qt"               if build.without? "qt5"
    args << "--without-opengl"           if build.without? "opengl"
    args << "--without-framework-opengl" if build.without? "opengl"
    args << "--without-OSMesa"           if build.without? "osmesa"
    args << "--without-qhull"            if build.without? "qhull"
    args << "--without-qrupdate"         if build.without? "qrupdate"
    args << "--disable-readline"         if build.without? "readline"
    args << "--without-zlib"             if build.without? "zlib"

    # arguments for options disabled by default
    args << "--with-portaudio"           if build.with? "portaudio"
    args << "--with-sndfile"             if build.with? "sndfile"
    args << "--disable-java"             if build.without? "java"
    args << "--enable-jit"               if build.with? "jit"

    # ensure that the right hdf5 library is used
    if build.with? "hdf5"
      args << "--with-hdf5-includedir=#{Formula["hdf5"].opt_include}"
      args << "--with-hdf5-libdir=#{Formula["hdf5"].opt_lib}"
    else
      args << "--without-hdf5"
    end

    # arguments if building without suite-sparse
    if build.without? "suite-sparse"
      args << "--without-amd"
      args << "--without-camd"
      args << "--without-colamd"
      args << "--without-ccolamd"
      args << "--without-cxsparse"
      args << "--without-camd"
      args << "--without-cholmod"
      args << "--without-umfpack"
    else
      ENV.append "LDFLAGS", "-L#{Formula["suite-sparse"].opt_lib} -lsuitesparseconfig"
      ENV.append "LDFLAGS", "-L#{Formula["metis"].opt_lib} -lmetis"
    end

    # check if openblas settings are compatible
    if build.with? "openblas"
      if ["arpack", "qrupdate", "suite-sparse"].any? { |n| Tab.for_name(n).without? "openblas" }
        odie "Octave is compiled --with-openblas but arpack, qrupdate or suite-sparse are not."
      else
        args << "--with-blas=-L#{Formula["openblas"].opt_lib} -lopenblas"
      end
    elsif OS.mac? # without "openblas"
      if ["arpack", "qrupdate", "suite-sparse"].any? { |n| Tab.for_name(n).with? "openblas" }
        odie "Arpack, qrupdate or suite-sparse are compiled --with-openblas but Octave is not."
      else
        args << "--with-blas=-L#{Formula["veclibfort"].opt_lib} -lvecLibFort"
      end
    else # OS.linux? and without "openblas"
      args << "--with-blas=-lblas -llapack"
    end

    system "./bootstrap" if build.head?

    # the Mac build configuration passes all linker flags to mkoctfile to
    # be inserted into every oct/mex build. This is actually unnecessary and
    # can cause linking problems.
    inreplace "src/mkoctfile.in.cc", /%OCTAVE_CONF_OCT(AVE)?_LINK_(DEPS|OPTS)%/, '""'

    # Octave does strict assumptions on the name of qscintilla2
    # see http://savannah.gnu.org/bugs/?48773
    inreplace "configure", "qscintilla2-qt5 qt5scintilla2", "qscintilla2-qt5 qt5scintilla2 qscintilla2"

    system "./configure", *args
    system "make", "all"
    system "make", "check" if build.with? "test"
    system "make", "install"

    prefix.install "test/fntests.log" if File.exist? "test/fntests.log"
  end

  def caveats
    s = ""

    if build.with?("qt5")
      s += <<-EOS.undent

      Octave is compiled with a graphical user interface. The start-up option --no-gui
      will run the familiar command line interface. The option --no-gui-libs runs a
      minimalistic command line interface that does not link with the Qt libraries and
      uses the fltk toolkit for plotting if available.

      EOS

    else

      s += <<-EOS.undent

      Octave's graphical user interface is disabled; compile Octave with the option
      --with-qt5 to enable it.

      EOS

    end

    if build.with?("gnuplot") || build.with?("fltk")
      s += <<-EOS.undent

        Several graphics toolkit are available. You can select them by using the command
        'graphics_toolkit' in Octave.  Individual Gnuplot terminals can be chosen by setting
        the environment variable GNUTERM and building gnuplot with the following options:

          setenv('GNUTERM','qt')    # Requires QT; install gnuplot --with-qt5
          setenv('GNUTERM','x11')   # Requires XQuartz; install gnuplot --with-x11
          setenv('GNUTERM','wxt')   # Requires wxmac; install gnuplot --with-wxmac
          setenv('GNUTERM','aqua')  # Requires AquaTerm; install gnuplot --with-aquaterm

        You may also set this variable from within Octave. For printing the cairo backend
        is recommended, i.e., install gnuplot with --with-cairo, and use

          print -dpdfcairo figure.pdf

      EOS
    end

    if build.without?("osmesa") || (build.with?("osmesa") && build.with?("opengl"))
      s += <<-EOS.undent

      When using the native Qt or fltk toolkits then invisible figures do not work because
      osmesa is incompatible with Mac's OpenGL. The usage of gnuplot is recommended.

      EOS
    end

    s += "\n" unless s.empty?
    s
  end

  test do
    system bin/"octave", "--eval", "(22/7 - pi)/pi"
    # this is supposed to crash octave if there is a problem with veclibfort
    system bin/"octave", "--eval", "single ([1+i 2+i 3+i]) * single ([ 4+i ; 5+i ; 6+i])"
  end
end


text:
package com.suscipio_solutions.consecro_mud.Abilities.Songs;
import java.util.Enumeration;
import java.util.Vector;

import com.suscipio_solutions.consecro_mud.Abilities.interfaces.Ability;
import com.suscipio_solutions.consecro_mud.Areas.interfaces.Area;
import com.suscipio_solutions.consecro_mud.Behaviors.interfaces.LegalBehavior;
import com.suscipio_solutions.consecro_mud.Common.interfaces.CMMsg;
import com.suscipio_solutions.consecro_mud.MOBS.interfaces.MOB;
import com.suscipio_solutions.consecro_mud.core.CMClass;
import com.suscipio_solutions.consecro_mud.core.CMLib;
import com.suscipio_solutions.consecro_mud.core.interfaces.Physical;

@SuppressWarnings("rawtypes")
public class Skill_FalseArrest extends BardSkill
{
	@Override public String ID() { return "Skill_FalseArrest"; }
	private final static String localizedName = CMLib.lang().L("False Arrest");
	@Override public String name() { return localizedName; }
	@Override protected int canAffectCode(){return Ability.CAN_MOBS;}
	@Override protected int canTargetCode(){return Ability.CAN_MOBS;}
	@Override public int abstractQuality(){return Ability.QUALITY_INDIFFERENT;}
	private static final String[] triggerStrings =I(new String[] {"FALSEARREST"});
	@Override public String[] triggerStrings(){return triggerStrings;}
	@Override protected int overrideMana(){return 50;}
	@Override public int classificationCode(){return Ability.ACODE_SKILL|Ability.DOMAIN_DECEPTIVE;}

	@Override
	public boolean invoke(MOB mob, Vector commands, Physical givenTarget, boolean auto, int asLevel)
	{
		final MOB target=getTarget(mob,commands,givenTarget);
		if(target==null) return false;
		if(mob==target)
		{
			mob.tell(L("Arrest whom?!"));
			return false;
		}
		if(mob.isInCombat())
		{
			mob.tell(L("Not while you are fighting!"));
			return false;
		}

		LegalBehavior B=null;
		Area A2=null;
		if(mob.location()!=null)
		{
			B=CMLib.law().getLegalBehavior(mob.location());
			if((B==null)||(!B.hasWarrant(CMLib.law().getLegalObject(mob.location()),target)))
				B=null;
			else
				A2=CMLib.law().getLegalObject(mob.location());
		}

		if(B==null)
		for(final Enumeration e=CMLib.map().areas();e.hasMoreElements();)
		{
			final Area A=(Area)e.nextElement();
			if(CMLib.flags().canAccess(mob,A))
			{
				B=CMLib.law().getLegalBehavior(A);
				if((B!=null)
				&&(B.hasWarrant(CMLib.law().getLegalObject(A),target)))
				{
					A2=CMLib.law().getLegalObject(A);
					break;
				}
			}
			B=null;
			A2=null;
		}

		if(B==null)
		{
			mob.tell(L("@x1 is not wanted for anything, anywhere.",target.name(mob)));
			return false;
		}

		if(!super.invoke(mob,commands,givenTarget,auto,asLevel))
			return false;

		int levelDiff=target.phyStats().level()-(mob.phyStats().level()+abilityCode()+(2*super.getXLEVELLevel(mob)));
		if(levelDiff>0)
			levelDiff=levelDiff*5;
		else
			levelDiff=0;

		final boolean success=proficiencyCheck(mob,-levelDiff,auto);

		if(!success)
		{
			beneficialWordsFizzle(mob,target,L("<S-NAME> frown(s) at <T-NAMESELF>, but lose(s) the nerve."));
			return false;
		}
		final CMMsg msg=CMClass.getMsg(mob,target,this,CMMsg.MSG_DELICATE_HANDS_ACT,L("<S-NAME> frown(s) at <T-NAMESELF>."),CMMsg.NO_EFFECT,null,CMMsg.NO_EFFECT,null);
		if(mob.location().okMessage(mob,msg))
		{
			mob.location().send(mob,msg);
			if(!B.arrest(A2,mob,target))
			{
				mob.tell(L("You are not able to arrest @x1 at this time.",target.name(mob)));
				return false;
			}
		}
		return success;
	}

}


text:
var bowling = _.merge(bowling || {}, (function (window, _, undefined) {
    "use strict";

    var core = (function (window, _, undefined) {

        var isStrikeFrame = function (acc, item) {
            return item.length === 1 && sum(item) === 10;
        };

        var scoreThusFar = function (acc) {
            return acc.frameTotals[acc.frameTotals.length-1] || 0;
        };

        var processPendingStrikes = function (acc, item) {
            if(acc.strikes.length === 2)
            {
                acc.frameTotals.push(scoreThusFar(acc) + item[0] + sum(acc.strikes));
                acc.strikes = _.rest(acc.strikes);
            } else if(acc.strikes.length === 1) {
                if(!isStrikeFrame(acc, item))
                {
                    acc.frameTotals.push(scoreThusFar(acc) + sum(item) + sum(acc.strikes));
                    acc.strikes = _.rest(acc.strikes);
                }
            }
            return acc;
        };

        var processPendingSpare = function (acc, item) {
            if(acc.spare) {
                acc.frameTotals.push(scoreThusFar(acc) + item[0] + acc.spare);
                acc.spare = 0;
            }

            return acc;
        };

        var processPendingThrows = function (acc, item) {
            acc = processPendingStrikes(acc, item);
            acc = processPendingSpare(acc, item);
            return acc;
        };

        var throwTotaler = multimethod(function (acc, item) {
            var currentItemTotal = sum(item),
                spareFrame = item.length === 2 && currentItemTotal === 10;

            if(item.length > 2) { return "irregular"; }
            if(isStrikeFrame(acc, item)) { return "strike"; }
            if(spareFrame) { return "spare"; }

        },{
            irregular: function (acc, item) {
                _.forEach(acc.strikes, function (strike, index, strikes) {
                    var valueToAdd = 10*(strikes.length - index);

                    acc.frameTotals.push(scoreThusFar(acc) + valueToAdd + sum(_.take(item,index+1)));
                });
                acc = processPendingSpare(acc, item);
                acc.frameTotals.push(scoreThusFar(acc) + sum(item));
                return acc;
            },
            strike: function (acc, item) {
                acc = processPendingThrows(acc, item);
                acc.strikes.push(10);
                return acc;
            },
            spare: function (acc, item) {
                acc = processPendingThrows(acc, item);
                acc.spare = 10;
                return acc;
            },
            default: function (acc, item) {
                acc = processPendingThrows(acc, item);
                acc.frameTotals.push(scoreThusFar(acc) + sum(item));
                return acc;
            }
        });

        var sum = function(array) {
            return _.reduce(array, function(acc, item) {
                return acc + item;
            }, 0);
        };

        var convertThrowsToTotals = function (incoming) {
            var initialAccumulator = {
                frameTotals: [],
                spare: 0,
                strikes: []
            };

            incoming = groupThrows(incoming);

            return _.reduce(incoming, throwTotaler, initialAccumulator).frameTotals;
        };

        var throwGrouper = multimethod(function (acc) {
            if(acc.grouped.length === 9) { return "lastFrame"; }
            if(acc.partial.length === 2) { return "doublet"; }
            if(acc.partial.length === 1) { return "singlet"; }

        },{
            lastFrame: function (acc, item, index, coll) {
                acc.partial.push(item);
                if(index === coll.length - 1) {
                    acc = pushPartialIntoGrouped(acc);
                }
                return acc;
            },
            doublet: function (acc, item, index, coll) {
                acc = pushPartialIntoGrouped(acc);
                acc.partial.push(item);
                return checkEndOfLine(acc, item, index, coll);
            },
            singlet: function (acc, item, index, coll) {
                if (acc.partial[0] === 10) {
                    acc = pushPartialIntoGrouped(acc);
                }
                acc.partial.push(item);
                return checkEndOfLine(acc, item, index, coll);
            },
            default: function (acc, item, index, coll) {
                acc.partial.push(item);
                return checkEndOfLine(acc, item, index, coll);
            }
        });

        var pushPartialIntoGrouped = function (acc) {
            acc.grouped.push(acc.partial);
            acc.partial = [];
            return acc;
        };

        var checkEndOfLine = function (acc, item, index, coll) {
            if(index === coll.length - 1)
            {
                acc = pushPartialIntoGrouped(acc);
            }
            return acc;
        };

        var groupThrows = function(incoming) {
            var initialAccumulator = {
                grouped: [],
                partial: []
            };

            return _.reduce(incoming, throwGrouper, initialAccumulator).grouped;
        };

        return {
            convertThrowsToTotals: convertThrowsToTotals,
            groupThrows: groupThrows
        };

    })(window, _);

    return { core: core };

})(window, _));


text:
/* globals FileUpload, UploadFS */
import stream from 'stream';
import zlib from 'zlib';
import util from 'util';

import { FileUploadClass } from '../lib/FileUpload';

const logger = new Logger('FileUpload');

function ExtractRange(options) {
	if (!(this instanceof ExtractRange)) {
		return new ExtractRange(options);
	}

	this.start = options.start;
	this.stop = options.stop;
	this.bytes_read = 0;

	stream.Transform.call(this, options);
}
util.inherits(ExtractRange, stream.Transform);

ExtractRange.prototype._transform = function(chunk, enc, cb) {
	if (this.bytes_read > this.stop) {
		// done reading
		this.end();
	} else if (this.bytes_read + chunk.length < this.start) {
		// this chunk is still before the start byte
	} else {
		let start;
		let stop;

		if (this.start <= this.bytes_read) {
			start = 0;
		} else {
			start = this.start - this.bytes_read;
		}
		if ((this.stop - this.bytes_read + 1) < chunk.length) {
			stop = this.stop - this.bytes_read + 1;
		} else {
			stop = chunk.length;
		}
		const newchunk = chunk.slice(start, stop);
		this.push(newchunk);
	}
	this.bytes_read += chunk.length;
	cb();
};

const getByteRange = function(header) {
	if (header) {
		const matches = header.match(/(\d+)-(\d+)/);
		if (matches) {
			return {
				start: parseInt(matches[1], 10),
				stop: parseInt(matches[2], 10)
			};
		}
	}
	return null;
};

// code from: https://github.com/jalik/jalik-ufs/blob/master/ufs-server.js#L310
const readFromGridFS = function(storeName, fileId, file, headers, req, res) {
	const store = UploadFS.getStore(storeName);
	const rs = store.getReadStream(fileId, file);
	const ws = new stream.PassThrough();

	[rs, ws].forEach(stream => stream.on('error', function(err) {
		store.onReadError.call(store, err, fileId, file);
		res.end();
	}));

	ws.on('close', function() {
		// Close output stream at the end
		ws.emit('end');
	});

	const accept = req.headers['accept-encoding'] || '';

	// Transform stream
	store.transformRead(rs, ws, fileId, file, req, headers);
	const range = getByteRange(req.headers.range);
	let out_of_range = false;
	if (range) {
		out_of_range = (range.start > file.size) || (range.stop <= range.start) || (range.stop > file.size);
	}

	// Compress data using gzip
	if (accept.match(/\bgzip\b/) && range === null) {
		headers['Content-Encoding'] = 'gzip';
		delete headers['Content-Length'];
		res.writeHead(200, headers);
		ws.pipe(zlib.createGzip()).pipe(res);
	} else if (accept.match(/\bdeflate\b/) && range === null) {
		// Compress data using deflate
		headers['Content-Encoding'] = 'deflate';
		delete headers['Content-Length'];
		res.writeHead(200, headers);
		ws.pipe(zlib.createDeflate()).pipe(res);
	} else if (range && out_of_range) {
		// out of range request, return 416
		delete headers['Content-Length'];
		delete headers['Content-Type'];
		delete headers['Content-Disposition'];
		delete headers['Last-Modified'];
		headers['Content-Range'] = `bytes */${ file.size }`;
		res.writeHead(416, headers);
		res.end();
	} else if (range) {
		headers['Content-Range'] = `bytes ${ range.start }-${ range.stop }/${ file.size }`;
		delete headers['Content-Length'];
		headers['Content-Length'] = range.stop - range.start + 1;
		res.writeHead(206, headers);
		logger.debug('File upload extracting range');
		ws.pipe(new ExtractRange({ start: range.start, stop: range.stop })).pipe(res);
	} else {
		res.writeHead(200, headers);
		ws.pipe(res);
	}
};

FileUpload.configureUploadsStore('GridFS', 'GridFS:Uploads', {
	collectionName: 'rocketchat_uploads'
});

// DEPRECATED: backwards compatibility (remove)
UploadFS.getStores()['rocketchat_uploads'] = UploadFS.getStores()['GridFS:Uploads'];

FileUpload.configureUploadsStore('GridFS', 'GridFS:Avatars', {
	collectionName: 'rocketchat_avatars'
});

new FileUploadClass({
	name: 'GridFS:Uploads',

	get(file, req, res) {
		file = FileUpload.addExtensionTo(file);
		const headers = {
			'Content-Disposition': `attachment; filename*=UTF-8''${ encodeURIComponent(file.name) }`,
			'Last-Modified': file.uploadedAt.toUTCString(),
			'Content-Type': file.type,
			'Content-Length': file.size
		};
		return readFromGridFS(file.store, file._id, file, headers, req, res);
	}
});

new FileUploadClass({
	name: 'GridFS:Avatars',

	get(file, req, res) {
		const reqModifiedHeader = req.headers['if-modified-since'];
		if (reqModifiedHeader && reqModifiedHeader === (file.uploadedAt && file.uploadedAt.toUTCString())) {
			res.setHeader('Last-Modified', reqModifiedHeader);
			res.writeHead(304);
			res.end();
			return;
		}
		file = FileUpload.addExtensionTo(file);
		const headers = {
			'Cache-Control': 'public, max-age=0',
			'Expires': '-1',
			'Content-Disposition': 'inline',
			'Last-Modified': file.uploadedAt.toUTCString(),
			'Content-Type': file.type,
			'Content-Length': file.size
		};
		return readFromGridFS(file.store, file._id, file, headers, req, res);
	}
});


text:
Development Philosophy
======================

Requests is an open but opinionated library, created by an open but opinionated developer.

Benevolent Dictator
~~~~~~~~~~~~~~~~~~~

`Kenneth Reitz <http://kennethreitz.org>`_ is the BDFL. He has final say in any decision related to Requests.

Values
~~~~~~

- Simplicity is always better than functionality.
- Listen to everyone, then disregard it.
- The API is all that matters. Everything else is secondary.
- Fit the 90% use-case. Ignore the nay-sayers.

Semantic Versioning
~~~~~~~~~~~~~~~~~~~

For many years, the open source community has been plagued with version number dystonia. Numbers vary so greatly from project to project, they are practically meaningless.

Requests uses `Semantic Versioning <http://semver.org>`_. This specification seeks to put an end to this madness with a small set of practical guidelines for you and your colleagues to use in your next project.

Standard Library?
~~~~~~~~~~~~~~~~~

Requests has no *active* plans to be included in the standard library. This decision has been discussed at length with Guido as well as numerous core developers.

Essentially, the standard library is where a library goes to die. It is appropriate for a module to be included when active development is no longer necessary.

Requests just reached v1.0.0. This huge milestone marks a major step in the right direction.

Linux Distro Packages
~~~~~~~~~~~~~~~~~~~~~

Distributions have been made for many Linux repositories, including: Ubuntu, Debian, RHEL, and Arch.

These distributions are sometimes divergent forks, or are otherwise not kept up-to-date with the latest code and bugfixes. PyPI (and its mirrors) and GitHub are the official distribution sources; alternatives are not supported by the Requests project.


text:
package groundwork

import (
	"encoding/json"
	"fmt"
	"io/ioutil"
	"net/http"
	"net/http/httptest"
	"testing"

	"github.com/gwos/tcg/sdk/clients"
	"github.com/stretchr/testify/require"

	"github.com/influxdata/telegraf"
	"github.com/influxdata/telegraf/testutil"
)

const (
	defaultTestAgentID = "ec1676cc-583d-48ee-b035-7fb5ed0fcf88"
	defaultHost        = "telegraf"
)

func TestWriteWithDefaults(t *testing.T) {
	// Generate test metric with default name to test Write logic
	intMetric := testutil.TestMetric(42, "IntMetric")

	// Simulate Groundwork server that should receive custom metrics
	server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		body, err := ioutil.ReadAll(r.Body)
		require.NoError(t, err)

		// Decode body to use in assertions below
		var obj groundworkObject
		err = json.Unmarshal(body, &obj)
		require.NoError(t, err)

		// Check if server gets valid metrics object
		require.Equal(t, defaultTestAgentID, obj.Context.AgentID)
		require.Equal(t, defaultHost, obj.Resources[0].Name)
		require.Equal(t, "IntMetric", obj.Resources[0].Services[0].Name)
		require.Equal(t, int64(42), obj.Resources[0].Services[0].Metrics[0].Value.IntegerValue)
		require.Equal(t, 0, len(obj.Groups))

		_, err = fmt.Fprintln(w, `OK`)
		require.NoError(t, err)
	}))

	i := Groundwork{
		Server:      server.URL,
		AgentID:     defaultTestAgentID,
		DefaultHost: defaultHost,
		client: clients.GWClient{
			AppName: "telegraf",
			AppType: "TELEGRAF",
			GWConnection: &clients.GWConnection{
				HostName: server.URL,
			},
		},
	}

	err := i.Write([]telegraf.Metric{intMetric})
	require.NoError(t, err)

	defer server.Close()
}

func TestWriteWithTags(t *testing.T) {
	// Generate test metric with tags to test Write logic
	floatMetric := testutil.TestMetric(1.0, "FloatMetric")
	floatMetric.AddTag("host", "Host01")
	floatMetric.AddTag("group", "Group01")

	// Simulate Groundwork server that should receive custom metrics
	server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		body, err := ioutil.ReadAll(r.Body)
		require.NoError(t, err)

		// Decode body to use in assertions below
		var obj groundworkObject
		err = json.Unmarshal(body, &obj)
		require.NoError(t, err)

		// Check if server gets valid metrics object
		require.Equal(t, defaultTestAgentID, obj.Context.AgentID)
		require.Equal(t, "Host01", obj.Resources[0].Name)
		require.Equal(t, "FloatMetric", obj.Resources[0].Services[0].Name)
		require.Equal(t, 1.0, obj.Resources[0].Services[0].Metrics[0].Value.DoubleValue)
		require.Equal(t, "Group01", obj.Groups[0].GroupName)
		require.Equal(t, "Host01", obj.Groups[0].Resources[0].Name)

		_, err = fmt.Fprintln(w, `OK`)
		require.NoError(t, err)
	}))

	i := Groundwork{
		Server:      server.URL,
		AgentID:     defaultTestAgentID,
		DefaultHost: defaultHost,
		GroupTag:    "group",
		ResourceTag: "host",
		client: clients.GWClient{
			AppName: "telegraf",
			AppType: "TELEGRAF",
			GWConnection: &clients.GWConnection{
				HostName: server.URL,
			},
		},
	}

	err := i.Write([]telegraf.Metric{floatMetric})
	require.NoError(t, err)

	defer server.Close()
}

type groundworkObject struct {
	Context struct {
		AgentID string `json:"agentId"`
	} `json:"context"`
	Resources []struct {
		Name     string `json:"name"`
		Services []struct {
			Name    string `json:"name"`
			Metrics []struct {
				Value struct {
					DoubleValue  float64 `json:"doubleValue"`
					IntegerValue int64   `json:"integerValue"`
				} `json:"value"`
			}
		} `json:"services"`
	} `json:"resources"`
	Groups []struct {
		Type      string `json:"type"`
		GroupName string `json:"groupName"`
		Resources []struct {
			Name string `json:"name"`
			Type string `json:"type"`
		} `json:"resources"`
	} `json:"groups"`
}


text:
package org.apache.harmony.javax.security.auth.login;

import java.security.AccessController;
import org.apache.harmony.javax.security.auth.AuthPermission;

public abstract class Configuration {

    // the current configuration
    private static Configuration configuration;

    // creates a AuthPermission object with a specify property
    private static final AuthPermission GET_LOGIN_CONFIGURATION = new AuthPermission(
            "getLoginConfiguration"); //$NON-NLS-1$

    // creates a AuthPermission object with a specify property
    private static final AuthPermission SET_LOGIN_CONFIGURATION = new AuthPermission(
            "setLoginConfiguration"); //$NON-NLS-1$

    // Key to security properties, defining default configuration provider.
    private static final String LOGIN_CONFIGURATION_PROVIDER = "login.configuration.provider"; //$NON-NLS-1$

    protected Configuration() {
        super();
    }

    public static Configuration getConfiguration() {
        SecurityManager sm = System.getSecurityManager();
        if (sm != null) {
            sm.checkPermission(GET_LOGIN_CONFIGURATION);
        }
        return getAccessibleConfiguration();
    }

    /**
     * Reads name of default configuration provider from security.properties,
     * loads the class and instantiates the provider.
 In case of any
     * exception, wraps it with SecurityException and throws further.
     */
    private static final Configuration getDefaultProvider() {
        return new Configuration() {

			@Override
			public void refresh() {
			}

			@Override
			public AppConfigurationEntry[] getAppConfigurationEntry(
					String applicationName) {
				return new AppConfigurationEntry[0];
			}
		};
    }

    /**
     * Shortcut accessor for friendly classes, to skip security checks.
     * If active configuration was set to null, tries to load a default
     * provider, so this method never returns null.

     * This method is synchronized with setConfiguration()
     */
    static Configuration getAccessibleConfiguration() {
        Configuration current = configuration;
        if (current == null) {
            synchronized (Configuration.class) {
                if (configuration == null) {
                    configuration = getDefaultProvider();
                }
                return configuration;
            }
        }
        return current;
    }

    public static void setConfiguration(Configuration configuration) {
        SecurityManager sm = System.getSecurityManager();
        if (sm != null) {
            sm.checkPermission(SET_LOGIN_CONFIGURATION);
        }
        Configuration.configuration = configuration;
    }

    public abstract AppConfigurationEntry[] getAppConfigurationEntry(String applicationName);

    public abstract void refresh();

}


text:
import pygame

from scenes import scenery
from utils import aitools
from utils.settings import *

class RockyScene(object):
    def __init__(self):
        self.actor_group1 = pygame.sprite.Group()
        self.actor_group2 = pygame.sprite.Group()
        self.actor_group3 = pygame.sprite.Group()
        self.cloud_timer = 0
        scenery.load_data()
        self.do_once = True
        self.screen = None

    def render(self):
        self.actor_group3.draw(self.screen)
        self.actor_group2.draw(self.screen)
        self.actor_group1.draw(self.screen)

    def update(self):
        if self.do_once:
            clouds_to_create = 11

            while clouds_to_create:
                temp_cloud = scenery.CloudSmall()
                aitools.spawn_on_screen(temp_cloud)
                self.actor_group2.add(temp_cloud)
                clouds_to_create -= 1

            islands_to_create = 3
            while islands_to_create:
                temp_island = scenery.IslandBig()
                aitools.spawn_on_screen(temp_island)
                self.actor_group2.add(temp_island)
                islands_to_create -= 1

            clouds_to_create = 7

            while clouds_to_create:
                temp_cloud = scenery.Cloud()
                aitools.spawn_on_screen(temp_cloud)
                self.actor_group1.add(temp_cloud)
                clouds_to_create -= 1

            self.do_once = False

            islands_to_create = 9

            while islands_to_create:
                temp_island = scenery.IslandSmall()
                aitools.spawn_on_screen(temp_island)
                self.actor_group3.add(temp_island)
                islands_to_create -= 1

        self.actor_group3.update()
        self.actor_group2.update()
        self.actor_group1.update()

    def draw(self, screen):
        self.screen = screen
        self.screen.fill(FILL_COLOR)
        self.update()
        self.render()

class ForestScene(object):
    def __init__(self):
        self.actor_group1 = pygame.sprite.Group()
        self.actor_group2 = pygame.sprite.Group()
        self.actor_group3 = pygame.sprite.Group()
        self.cloud_timer = 0
        scenery.load_data()
        self.do_once = True
        self.screen = None

    def render(self):
        self.actor_group3.draw(self.screen)
        self.actor_group2.draw(self.screen)
        self.actor_group1.draw(self.screen)

    def update(self):
        if self.do_once:
            clouds_to_create = 3

            while clouds_to_create:
                temp_island = scenery.WhiteCloud()
                aitools.spawn_on_screen(temp_island)
                self.actor_group1.add(temp_island)
                clouds_to_create -= 1

            trees_to_create = 3

            while trees_to_create:
                temp_tree = scenery.TreeBig()
                aitools.spawn_on_screen(temp_tree)
                self.actor_group1.add(temp_tree)
                trees_to_create -= 1

            clouds_to_create = 4

            while clouds_to_create:
                temp_island = scenery.WhiteCloudSmall()
                aitools.spawn_on_screen(temp_island)
                self.actor_group2.add(temp_island)
                clouds_to_create -= 1

            trees_to_create = 4

            while trees_to_create:
                temp_tree = scenery.TreeSmall()
                aitools.spawn_on_screen(temp_tree)
                self.actor_group2.add(temp_tree)
                trees_to_create -= 1

            clouds_to_create = 6

            while clouds_to_create:
                temp_island = scenery.WhiteCloudTiny()
                aitools.spawn_on_screen(temp_island)
                self.actor_group3.add(temp_island)
                clouds_to_create -= 1

            self.do_once = False

        self.actor_group3.update()
        self.actor_group2.update()
        self.actor_group1.update()

    def draw(self, screen):
        self.screen = screen
        self.screen.fill((200, 200, 234))
        self.update()
        self.render()

class PinkScene(object):
    def __init__(self):
        self.actor_group1 = pygame.sprite.Group()
        self.actor_group2 = pygame.sprite.Group()
        self.actor_group3 = pygame.sprite.Group()
        scenery.load_data()
        self.do_once = True
        self.screen = None

    def render(self):
        self.actor_group3.draw(self.screen)
        self.actor_group2.draw(self.screen)
        self.actor_group1.draw(self.screen)

    def update(self):
        if self.do_once:
            clouds_to_create = 6

            while clouds_to_create:
                temp_cloud = scenery.BlueCloud()
                aitools.spawn_on_screen(temp_cloud)
                self.actor_group1.add(temp_cloud)
                clouds_to_create -= 1

            clouds_to_create = 6

            while clouds_to_create:
                temp_cloud = scenery.BlueCloudSmall()
                aitools.spawn_on_screen(temp_cloud)
                self.actor_group2.add(temp_cloud)
                clouds_to_create -= 1

            stars_to_create = 12

            while stars_to_create:
                temp_star = scenery.SmallStar()
                aitools.spawn_on_screen(temp_star)
                self.actor_group3.add(temp_star)
                stars_to_create -= 1

            self.do_once = False

        self.actor_group1.update()
        self.actor_group2.update()
        self.actor_group3.update()

    def draw(self, screen):
        self.screen = screen
        self.screen.fill((234, 203, 200))
        self.update()
        self.render()

class TutorialScene(object):
    def __init__(self):
        self.actor_group1 = pygame.sprite.Group()
        scenery.load_data()
        self.do_once = True
        self.screen = None

    def render(self):
        self.actor_group1.draw(self.screen)

    def update(self):
        if self.do_once:
            self.do_once = False

        self.actor_group1.update()

    def draw(self, screen):
        self.screen = screen
        self.screen.fill(FILL_COLOR)
        self.update()
        self.render()


text:
require 'bundler/setup'
require 'byebug'
require 'minitest/autorun'
require 'minitest/mock'
require 'minitest/reporters'
require 'selene'

Minitest::Reporters.use! Minitest::Reporters::DefaultReporter.new

module Selene
  module Stubbable

    # Allowed syntax options:
    #
    # stub :method => 'value'
    # stub :method, 'value'
    # stub :method { 'value' }

    def stub(hash_or_method, value_or_block = nil)
      if hash_or_method.is_a?(Hash)
        hash_or_method.each { |method, value| stub method, Proc.new { value } }
      elsif !value_or_block.is_a?(Proc)
        stub hash_or_method, Proc.new { value_or_block }
      else
        define_singleton_method hash_or_method, value_or_block
      end
    end

  end

  module FixtureHelper
    def fixture(filename)
      File.read(File.join(File.dirname(__FILE__), 'fixtures', filename))
    end
  end

  module BuilderTestHelper
    def assert_required builder, property
      assert_error builder, property, "missing required property '#{property}'"
    end

    def assert_single builder, property
      builder.parse(Line.new(property, 'First Value'))
      original_value = builder.component[property]
      builder.parse(Line.new(property, 'Second Value'))
      assert_error builder, property, "property '#{property}' must not occur more than once"
      assert_equal original_value, builder.component[property]
    end

    def assert_error builder, property, message
      builder.valid?
      assert builder.errors[property].any? { |e| e =~ /#{message}/ }, "#{builder.class.name}: #{message}"
    end
  end
end


text:
package com.asakusafw.modelgen.source;

/**
 * MySQLに関する定数を定義するクラス。
 */
public final class MySQLConstants {

    /**
     * PKを表す文字列。
     */
    public static final String STR_IS_PK = "PRI";

    /**
     * NOT NULLを表す文字列。
     */
    public static final String STR_NOT_NULL = "NO";

    private MySQLConstants() {
        return;
    }
}


text:
python3 setup.py sdist bdist_wheel
twine upload dist/*


text:
<?php
/**
 * CArrayDataProvider implements a data provider based on a raw data array.
 *
 * The {@link rawData} property contains all data that may be sorted and/or paginated.
 * CArrayDataProvider will supply the data after sorting and/or pagination.
 * You may configure the {@link sort} and {@link pagination} properties to
 * customize sorting and pagination behaviors.
 *
 * Elements in the raw data array may be either objects (e.g. model objects)
 * or associative arrays (e.g. query results of DAO).
 *
 * CArrayDataProvider may be used in the following way:
 * <pre>
 * $rawData=Yii::app()->db->createCommand('SELECT * FROM tbl_user')->queryAll();
 * // or using: $rawData=User::model()->findAll();
 * $dataProvider=new CArrayDataProvider($rawData, array(
 *     'id'=>'user',
 *     'sort'=>array(
 *         'attributes'=>array(
 *              'id', 'username', 'email',
 *         ),
 *     ),
 *     'pagination'=>array(
 *         'pageSize'=>10,
 *     ),
 * ));
 * // $dataProvider->getData() will return a list of arrays.
 * </pre>
 *
 * Note: if you want to use the sorting feature, you must configure {@link sort} property
 * so that the provider knows which columns can be sorted.
 *
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @version $Id: CArrayDataProvider.php 2583 2010-10-29 20:17:12Z qiang.xue $
 * @package system.web
 * @since 1.1.4
 */
class CArrayDataProvider extends CDataProvider
{
	/**
	 * @var string the name of key field. Defaults to 'id'.
	 */
	public $keyField='id';
	/**
	 * @var array the data that is not paginated or sorted. When pagination is enabled,
	 * this property usually contains more elements than {@link data}.
	 */
	public $rawData=array();

	/**
	 * Constructor.
	 * @param array $rawData the data that is not paginated or sorted.
	 * @param array $config configuration (name=>value) to be applied as the initial property values of this class.
	 */
	public function __construct($rawData,$config=array())
	{
		$this->rawData=$rawData;
		foreach($config as $key=>$value)
			$this->$key=$value;
	}

	/**
	 * Fetches the data from the persistent data storage.
	 * @return array list of data items
	 */
	protected function fetchData()
	{
		if(($sort=$this->getSort())!==false && ($order=$sort->getOrderBy())!='')
			$this->sortData($this->getSortDirections($order));

		if(($pagination=$this->getPagination())!==false)
		{
			$pagination->setItemCount($this->getTotalItemCount());
			return array_slice($this->rawData, $pagination->getOffset(), $pagination->getLimit());
		}
		else
			return $this->rawData;
	}

	/**
	 * Fetches the data item keys from the persistent data storage.
	 * @return array list of data item keys.
	 */
	protected function fetchKeys()
	{
		$keys=array();
		foreach($this->getData() as $i=>$data)
			$keys[$i]=is_object($data) ? $data->{$this->keyField} : $data[$this->keyField];
		return $keys;
	}

	/**
	 * Calculates the total number of data items.
	 * This method simply returns the number of elements in {@link rawData}.
	 * @return integer the total number of data items.
	 */
	protected function calculateTotalItemCount()
	{
		return count($this->rawData);
	}

	/**
	 * Sorts the raw data according to the specified sorting instructions.
	 * After calling this method, {@link rawData} will be modified.
	 * @param array $directions the sorting directions (field name => whether it is descending sort)
	 */
	protected function sortData($directions)
	{
		if(empty($directions))
			return;
		$args=array();
		$dummy=array();
		foreach($directions as $name=>$descending)
		{
			$column=array();
			foreach($this->rawData as $index=>$data)
				$column[$index]=is_object($data) ? $data->$name : $data[$name];
			$args[]=&$column;
			$dummy[]=&$column;
			unset($column);
			$direction=$descending ? SORT_DESC : SORT_ASC;
			$args[]=&$direction;
			$dummy[]=&$direction;
			unset($direction);
		}
		$args[]=&$this->rawData;
		call_user_func_array('array_multisort', $args);
	}

	/**
	 * Converts the "ORDER BY" clause into an array representing the sorting directions.
	 * @param string $order the "ORDER BY" clause.
	 * @return array the sorting directions (field name => whether it is descending sort)
	 */
	protected function getSortDirections($order)
	{
		$segs=explode(',',$order);
		$directions=array();
		foreach($segs as $seg)
		{
			if(preg_match('/(.*?)(\s+(desc|asc))?$/i',trim($seg),$matches))
				$directions[$matches[1]]=isset($matches[3]) && !strcasecmp($matches[3],'desc');
			else
				$directions[trim($seg)]=false;
		}
		return $directions;
	}
}


text:
class Api::V1::RubygemsController < Api::BaseController
  skip_before_action :verify_authenticity_token, only: [:create]

  before_action :authenticate_with_api_key, only: [:index, :create]
  before_action :verify_authenticated_user, only: [:index, :create]
  before_action :find_rubygem,              only: [:show]

  def index
    @rubygems = current_user.rubygems.with_versions
    respond_to do |format|
      format.json { render json: @rubygems }
      format.yaml { render yaml: @rubygems }
    end
  end

  def show
    if @rubygem.hosted? && @rubygem.public_versions.indexed.count.nonzero?
      respond_to do |format|
        format.json { render json: @rubygem }
        format.yaml { render yaml: @rubygem }
      end
    else
      render text: "This gem does not exist.", status: :not_found
    end
  end

  def create
    gemcutter = Pusher.new(current_user, request.body, request.host_with_port)
    gemcutter.process
    render text: gemcutter.message, status: gemcutter.code
  end

  def reverse_dependencies
    names = Rubygem.reverse_dependencies(params[:id]).pluck(:name)

    respond_to do |format|
      format.json { render json: names }
      format.yaml { render yaml: names }
    end
  end
end


text:
import os
import sys

import PyFBA
import argparse
__author__ = 'Rob Edwards'

if __name__ == '__main__':
    parser = argparse.ArgumentParser(description='from a list of reactions, find those with a specific compound')
    parser.add_argument('-r', help='file with a list of reactions (optional. Otherwise use all reactions)')
    parser.add_argument('-c', help='compound name', required=True)
    parser.add_argument('-l', help='compound location (if known/desired)', default='')
    args = parser.parse_args()

    compounds, reactions, enzymes = PyFBA.parse.compounds_reactions_enzymes('gramnegative')

    test_compound = PyFBA.metabolism.Compound(args.c, args.l)

    rcts = set()
    if args.r:
        with open(args.r, 'r') as fin:
            for l in fin:
                l = l.strip()
                if l in reactions:
                    if test_compound in reactions[l].all_compounds():
                        print("{}\t{}".format(l, reactions[l].equation))
    else:
        for l in reactions:
            if test_compound in reactions[l].all_compounds():
                print("{}\t{}".format(l, reactions[l].equation))


text:
FactoryGirl.define do
  factory :admin_user do
    email 'admin@example.com'
    password 'password'
  end
end


text:
using ClosedXML.Excel;
using System;

namespace ClosedXML.Examples.Styles
{
    public class StyleFill : IXLExample
    {
        public void Create(String filePath)
        {
            var workbook = new XLWorkbook();
            var ws = workbook.Worksheets.Add("Style Fill");

            var co = 2;
            var ro = 1;

            ws.Cell(++ro, co + 1).Value = "BackgroundColor = Red";
            ws.Cell(ro, co).Style.Fill.BackgroundColor = XLColor.Red;

            ws.Cell(++ro, co + 1).Value = "PatternType = DarkTrellis; PatternColor = Orange; BackgroundColor = Blue";
            ws.Cell(ro, co).Style.Fill.PatternType = XLFillPatternValues.DarkTrellis;
            ws.Cell(ro, co).Style.Fill.PatternColor = XLColor.Orange;
            ws.Cell(ro, co).Style.Fill.BackgroundColor = XLColor.Blue;

            workbook.SaveAs(filePath);
        }
    }
}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Acta bot. neerl. 10: 65 (1961)

#### Original name
Echinostelium fragile Nann.-Bremek., 1961

### Remarks
null


text:
<?php

declare(strict_types=1);

namespace Eelly\SDK\Log\Api;

use Eelly\SDK\EellyClient;
use Eelly\SDK\Log\Service\GoodsHistory1Interface;
use Eelly\DTO\GoodsHistory1DTO;

/**
 *
 * @author shadonTools<localhost.shell@gmail.com>
 */
class GoodsHistory1
{
    /**
     * @author eellytools<localhost.shell@gmail.com>
     */
    public function getGoodsHistory1(int $GoodsHistory1Id): GoodsHistory1DTO
    {
        return EellyClient::request('log/goodsHistory1', __FUNCTION__, true, $GoodsHistory1Id);
    }

    /**
     * @author eellytools<localhost.shell@gmail.com>
     */
    public function getGoodsHistory1Async(int $GoodsHistory1Id)
    {
        return EellyClient::request('log/goodsHistory1', __FUNCTION__, false, $GoodsHistory1Id);
    }

    /**
     * @author eellytools<localhost.shell@gmail.com>
     */
    public function addGoodsHistory1(array $data): bool
    {
        return EellyClient::request('log/goodsHistory1', __FUNCTION__, true, $data);
    }

    /**
     * @author eellytools<localhost.shell@gmail.com>
     */
    public function addGoodsHistory1Async(array $data)
    {
        return EellyClient::request('log/goodsHistory1', __FUNCTION__, false, $data);
    }

    /**
     * @author eellytools<localhost.shell@gmail.com>
     */
    public function updateGoodsHistory1(int $GoodsHistory1Id, array $data): bool
    {
        return EellyClient::request('log/goodsHistory1', __FUNCTION__, true, $GoodsHistory1Id, $data);
    }

    /**
     * @author eellytools<localhost.shell@gmail.com>
     */
    public function updateGoodsHistory1Async(int $GoodsHistory1Id, array $data)
    {
        return EellyClient::request('log/goodsHistory1', __FUNCTION__, false, $GoodsHistory1Id, $data);
    }

    /**
     * @author eellytools<localhost.shell@gmail.com>
     */
    public function deleteGoodsHistory1(int $GoodsHistory1Id): bool
    {
        return EellyClient::request('log/goodsHistory1', __FUNCTION__, true, $GoodsHistory1Id);
    }

    /**
     * @author eellytools<localhost.shell@gmail.com>
     */
    public function deleteGoodsHistory1Async(int $GoodsHistory1Id)
    {
        return EellyClient::request('log/goodsHistory1', __FUNCTION__, false, $GoodsHistory1Id);
    }

    /**
     * @author eellytools<localhost.shell@gmail.com>
     */
    public function listGoodsHistory1Page(array $condition = [], int $limit = 10, int $currentPage = 1): array
    {
        return EellyClient::request('log/goodsHistory1', __FUNCTION__, true, $condition, $limit, $currentPage);
    }

    /**
     * @author eellytools<localhost.shell@gmail.com>
     */
    public function listGoodsHistory1PageAsync(array $condition = [], int $limit = 10, int $currentPage = 1)
    {
        return EellyClient::request('log/goodsHistory1', __FUNCTION__, false, $condition, $limit, $currentPage);
    }

    /**
     * @return self
     */
    public static function getInstance(): self
    {
        static $instance;
        if (null === $instance) {
            $instance = new self();
        }

        return $instance;
    }
}


text:
package org.apache.logging.log4j.core.jmx;

import java.util.List;

import javax.management.ObjectName;

import org.apache.logging.log4j.status.StatusData;

/**
 * The MBean interface for monitoring and managing the {@code StatusLogger}.
 */
public interface StatusLoggerAdminMBean {
    /**
     * ObjectName pattern ({@value}) for StatusLoggerAdmin MBeans.
     * This pattern contains a variable, which is the name of the logger context.
     *

     * You can find all registered StatusLoggerAdmin MBeans like this:
     *

     *

     * MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
     * String pattern = String.format(StatusLoggerAdminMBean.PATTERN, "*");
     * Set<ObjectName> statusLoggerNames = mbs.queryNames(new ObjectName(pattern), null);
     *

     *

     * Some characters are not allowed in ObjectNames. The logger context name
     * may be quoted. When StatusLoggerAdmin MBeans are
     * registered, their ObjectNames are created using this pattern as follows:
     *

     *

     * String ctxName = Server.escape(loggerContext.getName());
     * String name = String.format(PATTERN, ctxName);
     * ObjectName objectName = new ObjectName(name);
     *

     * @see Server#escape(String)
     */
    String PATTERN = Server.DOMAIN + ":type=%s,component=StatusLogger";

    /**
     * Notifications with this type have a {@code StatusData} userData object
     * and a {@code null} message.
     */
    String NOTIF_TYPE_DATA = "com.apache.logging.log4j.core.jmx.statuslogger.data";

    /**
     * Notifications with this type have a formatted status data message string
     * but no {@code StatusData} in their userData field.
     */
    String NOTIF_TYPE_MESSAGE = "com.apache.logging.log4j.core.jmx.statuslogger.message";

    /**
     * Returns the {@code ObjectName} that this status logger mbean is registered with.
     * @return the ObjectName of this StatusLogger MBean
     */
    ObjectName getObjectName();

    /**
     * Returns a list with the most recent {@code StatusData} objects in the
     * status history. The list has up to 200 entries by default but the length
     * can be configured with system property {@code "log4j2.status.entries"}.
     *

     * Note that the returned objects may contain {@code Throwable}s from
     * external libraries.
     *

     *

     * JMX clients calling this method must be prepared to deal with the errors
     * that occur if they do not have the class definition for such
     * {@code Throwable}s in their classpath.
     *

     *
     * @return the most recent messages logged by the {@code StatusLogger}.
     */
    List<StatusData> getStatusData();

    /**
     * Returns a string array with the most recent messages in the status
     * history. The list has up to 200 entries by default but the length can be
     * configured with system property {@code "log4j2.status.entries"}.
     *
     * @return the most recent messages logged by the {@code StatusLogger}.
     */
    String[] getStatusDataHistory();

    /**
     * Returns the {@code StatusLogger} level as a String.
     *
     * @return the {@code StatusLogger} level.
     */
    String getLevel();

    /**
     * Sets the {@code StatusLogger} level to the specified value.
     *
     * @param level the new {@code StatusLogger} level.
     * @throws IllegalArgumentException if the specified level is not one of
     *             "OFF", "FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE",
     *             "ALL"
     */
    void setLevel(String level);

    /**
     * Returns the name of the LoggerContext that the {@code StatusLogger} is associated with.
     * @return logger context name
     */
    String getContextName();
}


text:
require "formula"

class Minidlna < Formula
  desc "Media server software, compliant with DLNA/UPnP-AV clients"
  homepage "http://sourceforge.net/projects/minidlna/"
  url "https://downloads.sourceforge.net/project/minidlna/minidlna/1.1.4/minidlna-1.1.4.tar.gz"
  sha1 "56f333f8af91105ce5f0861d1f1918ebf5b0a028"
  revision 1

  bottle do
    cellar :any
    sha1 "f49443165618a73072821cdc481902d676791502" => :mavericks
    sha1 "88bf53f515ddcd48ce3cbee067717ef1f0b4d5f6" => :mountain_lion
    sha1 "00a4fbe01ab17fb3c09c68cccf4fc902a1d9a859" => :lion
  end

  head do
    url "git://git.code.sf.net/p/minidlna/git"
    depends_on "autoconf" => :build
    depends_on "automake" => :build
    depends_on "libtool" => :build
    depends_on "gettext" => :build
  end

  depends_on "libexif"
  depends_on "jpeg"
  depends_on "libid3tag"
  depends_on "flac"
  depends_on "libogg"
  depends_on "libvorbis"
  depends_on "sqlite"
  depends_on "ffmpeg"

  def install
    ENV.append_to_cflags "-std=gnu89"
    system "./autogen.sh" if build.head?
    system "./configure", "--exec-prefix=#{prefix}"
    system "make", "install"
    sample_config_path.write sample_config
  end

  def caveats; <<-EOS.undent
      Simple single-user configuration:

      mkdir -p ~/.config/minidlna
      cp #{sample_config_path} ~/.config/minidlna/minidlna.conf
      ln -s YOUR_MEDIA_DIR ~/.config/minidlna/media
      minidlnad -f ~/.config/minidlna/minidlna.conf -P ~/.config/minidlna/minidlna.pid
    EOS
  end

  def sample_config_path
    share + "minidlna/minidlna.conf"
  end

  def sample_config; <<-EOS.undent
    friendly_name=Mac DLNA Server
    media_dir=#{ENV['HOME']}/.config/minidlna/media
    db_dir=#{ENV['HOME']}/.config/minidlna/cache
    log_dir=#{ENV['HOME']}/.config/minidlna
    EOS
  end

  test do
    system "#{sbin}/minidlnad", "-V"
  end
end