answer
stringlengths
15
1.25M
#include "stdafx.h" #include "BipartiteBoxPruning.h" #include "RenderingHelpers.h" #include "GLFontRenderer.h" <API key>::<API key>() : mBar (null), mNbBoxes (0), mBoxes (null), mBoxPtrs (null), mBoxTime (null), mSpeed (0.0f), mAmplitude (100.0f) { } <API key>::~<API key>() { DELETEARRAY(mBoxTime); DELETEARRAY(mBoxPtrs); DELETEARRAY(mBoxes); } void <API key>::Init() { mNbBoxes = 1024; mBoxes = new AABB[mNbBoxes]; mBoxPtrs = new const AABB*[mNbBoxes]; mBoxTime = new float[mNbBoxes]; for(udword i=0;i<mNbBoxes;i++) { Point Center, Extents; Center.x = (UnitRandomFloat()-0.5f) * 100.0f; Center.y = (UnitRandomFloat()-0.5f) * 10.0f; Center.z = (UnitRandomFloat()-0.5f) * 100.0f; Extents.x = 2.0f + UnitRandomFloat() * 2.0f; Extents.y = 2.0f + UnitRandomFloat() * 2.0f; Extents.z = 2.0f + UnitRandomFloat() * 2.0f; mBoxes[i].SetCenterExtents(Center, Extents); mBoxPtrs[i] = &mBoxes[i]; mBoxTime[i] = 2000.0f*UnitRandomFloat(); } } void <API key>::Release() { DELETEARRAY(mBoxTime); DELETEARRAY(mBoxes); } void <API key>::Select() { // Create a tweak bar { mBar = TwNewBar("BipartiteBoxPruning"); TwAddVarRW(mBar, "Speed", TW_TYPE_FLOAT, &mSpeed, " min=0.0 max=0.01 step=0.00001"); TwAddVarRW(mBar, "Amplitude", TW_TYPE_FLOAT, &mAmplitude, " min=10.0 max=200.0 step=0.1"); } } void <API key>::Deselect() { if(mBar) { TwDeleteBar(mBar); mBar = null; } } bool <API key>::UpdateBoxes() { for(udword i=0;i<mNbBoxes;i++) { mBoxTime[i] += mSpeed; Point Center,Extents; mBoxes[i].GetExtents(Extents); Center.x = cosf(mBoxTime[i]*2.17f)*mAmplitude + sinf(mBoxTime[i])*mAmplitude*0.5f; Center.y = cosf(mBoxTime[i]*1.38f)*mAmplitude + sinf(mBoxTime[i]*mAmplitude); Center.z = sinf(mBoxTime[i]*0.777f)*mAmplitude; mBoxes[i].SetCenterExtents(Center, Extents); } return true; } void <API key>::PerformTest() { UpdateBoxes(); // We pretend that half the boxes belong to first group, and the other half to the second group. udword Nb0 = mNbBoxes/2; udword Nb1 = mNbBoxes - Nb0; mPairs.ResetPairs(); mProfiler.Start(); BipartiteBoxPruning(Nb0, mBoxPtrs, Nb1, mBoxPtrs+Nb0, mPairs, Axes(AXES_XZY)); mProfiler.End(); mProfiler.Accum(); // printf("%d pairs colliding\r ", mPairs.GetNbPairs()); bool* Flags = (bool*)_alloca(sizeof(bool)*mNbBoxes); ZeroMemory(Flags, sizeof(bool)*mNbBoxes); const Pair* P = mPairs.GetPairs(); for(udword i=0;i<mPairs.GetNbPairs();i++) { // A colliding pair is (i,j) where 0 <= i < Nb0 and 0 <= j < Nb1 Flags[P[i].id0] = true; Flags[P[i].id1+Nb0] = true; } // Render boxes OBB CurrentBox; CurrentBox.mRot.Identity(); for(udword i=0;i<mNbBoxes;i++) { if(Flags[i]) glColor3f(1.0f, 0.0f, 0.0f); else { if(i<Nb0) glColor3f(0.0f, 1.0f, 0.0f); else glColor3f(0.0f, 0.0f, 1.0f); } mBoxes[i].GetCenter(CurrentBox.mCenter); mBoxes[i].GetExtents(CurrentBox.mExtents); DrawOBB(CurrentBox); } char Buffer[4096]; sprintf(Buffer, "BipartiteBoxPruning - %5.1f us (%d cycles) - %d pairs\n", mProfiler.mMsTime, mProfiler.mCycles, mPairs.GetNbPairs()); GLFontRenderer::print(10.0f, 10.0f, 0.02f, Buffer); } void <API key>::KeyboardCallback(unsigned char key, int x, int y) { } void <API key>::MouseCallback(int button, int state, int x, int y) { } void <API key>::MotionCallback(int x, int y) { }
webpackJsonp([2,4],{ 292: (function(module, exports, __webpack_require__) { // style-loader: Adds some css to the DOM by adding a <style> tag // load the styles var content = __webpack_require__(454); if(typeof content === 'string') content = [[module.i, content, '']]; // add the styles to the DOM var update = __webpack_require__(469)(content, {}); if(content.locals) module.exports = content.locals; // Hot Module Replacement if(false) { // When the styles change, update the <style> tags if(!content.locals) { module.hot.accept("!!../node_modules/css-loader/index.js?{\"sourceMap\":false,\"importLoaders\":1}!../node_modules/postcss-loader/index.js!./styles.css", function() { var newContent = require("!!../node_modules/css-loader/index.js?{\"sourceMap\":false,\"importLoaders\":1}!../node_modules/postcss-loader/index.js!./styles.css"); if(typeof newContent === 'string') newContent = [[module.id, newContent, '']]; update(newContent); }); } // When the module is disposed, remove the <style> tags module.hot.dispose(function() { update(); }); } }), 454: (function(module, exports, __webpack_require__) { exports = module.exports = __webpack_require__(455)(); // imports // module exports.push([module.i, "/* You can add global styles to this file, and also import other style files */\n", ""]); // exports }), 455: (function(module, exports) { // css base code, injected by the css-loader module.exports = function() { var list = []; // return the list of modules as css string list.toString = function toString() { var result = []; for(var i = 0; i < this.length; i++) { var item = this[i]; if(item[2]) { result.push("@media " + item[2] + "{" + item[1] + "}"); } else { result.push(item[1]); } } return result.join(""); }; // import a list of modules into the list list.i = function(modules, mediaQuery) { if(typeof modules === "string") modules = [[null, modules, ""]]; var <API key> = {}; for(var i = 0; i < this.length; i++) { var id = this[i][0]; if(typeof id === "number") <API key>[id] = true; } for(i = 0; i < modules.length; i++) { var item = modules[i]; // skip already imported module // this implementation is not 100% perfect for weird media query combinations // when a module is imported multiple times with different media queries. // I hope this will never occur (Hey this way we have smaller bundles) if(typeof item[0] !== "number" || !<API key>[item[0]]) { if(mediaQuery && !item[2]) { item[2] = mediaQuery; } else if(mediaQuery) { item[2] = "(" + item[2] + ") and (" + mediaQuery + ")"; } list.push(item); } } }; return list; }; }), 469: (function(module, exports) { var stylesInDom = {}, memoize = function(fn) { var memo; return function () { if (typeof memo === "undefined") memo = fn.apply(this, arguments); return memo; }; }, isOldIE = memoize(function() { return /msie [6-9]\b/.test(self.navigator.userAgent.toLowerCase()); }), getHeadElement = memoize(function () { return document.head || document.<API key>("head")[0]; }), singletonElement = null, singletonCounter = 0, <API key> = []; module.exports = function(list, options) { if(typeof DEBUG !== "undefined" && DEBUG) { if(typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment"); } options = options || {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of <style> // tags it will allow on a page if (typeof options.singleton === "undefined") options.singleton = isOldIE(); // By default, add <style> tags to the bottom of <head>. if (typeof options.insertAt === "undefined") options.insertAt = "bottom"; var styles = listToStyles(list); addStylesToDom(styles, options); return function update(newList) { var mayRemove = []; for(var i = 0; i < styles.length; i++) { var item = styles[i]; var domStyle = stylesInDom[item.id]; domStyle.refs mayRemove.push(domStyle); } if(newList) { var newStyles = listToStyles(newList); addStylesToDom(newStyles, options); } for(var i = 0; i < mayRemove.length; i++) { var domStyle = mayRemove[i]; if(domStyle.refs === 0) { for(var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j](); delete stylesInDom[domStyle.id]; } } }; } function addStylesToDom(styles, options) { for(var i = 0; i < styles.length; i++) { var item = styles[i]; var domStyle = stylesInDom[item.id]; if(domStyle) { domStyle.refs++; for(var j = 0; j < domStyle.parts.length; j++) { domStyle.parts[j](item.parts[j]); } for(; j < item.parts.length; j++) { domStyle.parts.push(addStyle(item.parts[j], options)); } } else { var parts = []; for(var j = 0; j < item.parts.length; j++) { parts.push(addStyle(item.parts[j], options)); } stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts}; } } } function listToStyles(list) { var styles = []; var newStyles = {}; for(var i = 0; i < list.length; i++) { var item = list[i]; var id = item[0]; var css = item[1]; var media = item[2]; var sourceMap = item[3]; var part = {css: css, media: media, sourceMap: sourceMap}; if(!newStyles[id]) styles.push(newStyles[id] = {id: id, parts: [part]}); else newStyles[id].parts.push(part); } return styles; } function insertStyleElement(options, styleElement) { var head = getHeadElement(); var <API key> = <API key>[<API key>.length - 1]; if (options.insertAt === "top") { if(!<API key>) { head.insertBefore(styleElement, head.firstChild); } else if(<API key>.nextSibling) { head.insertBefore(styleElement, <API key>.nextSibling); } else { head.appendChild(styleElement); } <API key>.push(styleElement); } else if (options.insertAt === "bottom") { head.appendChild(styleElement); } else { throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'."); } } function removeStyleElement(styleElement) { styleElement.parentNode.removeChild(styleElement); var idx = <API key>.indexOf(styleElement); if(idx >= 0) { <API key>.splice(idx, 1); } } function createStyleElement(options) { var styleElement = document.createElement("style"); styleElement.type = "text/css"; insertStyleElement(options, styleElement); return styleElement; } function createLinkElement(options) { var linkElement = document.createElement("link"); linkElement.rel = "stylesheet"; insertStyleElement(options, linkElement); return linkElement; } function addStyle(obj, options) { var styleElement, update, remove; if (options.singleton) { var styleIndex = singletonCounter++; styleElement = singletonElement || (singletonElement = createStyleElement(options)); update = applyToSingletonTag.bind(null, styleElement, styleIndex, false); remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true); } else if(obj.sourceMap && typeof URL === "function" && typeof URL.createObjectURL === "function" && typeof URL.revokeObjectURL === "function" && typeof Blob === "function" && typeof btoa === "function") { styleElement = createLinkElement(options); update = updateLink.bind(null, styleElement); remove = function() { removeStyleElement(styleElement); if(styleElement.href) URL.revokeObjectURL(styleElement.href); }; } else { styleElement = createStyleElement(options); update = applyToTag.bind(null, styleElement); remove = function() { removeStyleElement(styleElement); }; } update(obj); return function updateStyle(newObj) { if(newObj) { if(newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) return; update(obj = newObj); } else { remove(); } }; } var replaceText = (function () { var textStore = []; return function (index, replacement) { textStore[index] = replacement; return textStore.filter(Boolean).join('\n'); }; })(); function applyToSingletonTag(styleElement, index, remove, obj) { var css = remove ? "" : obj.css; if (styleElement.styleSheet) { styleElement.styleSheet.cssText = replaceText(index, css); } else { var cssNode = document.createTextNode(css); var childNodes = styleElement.childNodes; if (childNodes[index]) styleElement.removeChild(childNodes[index]); if (childNodes.length) { styleElement.insertBefore(cssNode, childNodes[index]); } else { styleElement.appendChild(cssNode); } } } function applyToTag(styleElement, obj) { var css = obj.css; var media = obj.media; if(media) { styleElement.setAttribute("media", media) } if(styleElement.styleSheet) { styleElement.styleSheet.cssText = css; } else { while(styleElement.firstChild) { styleElement.removeChild(styleElement.firstChild); } styleElement.appendChild(document.createTextNode(css)); } } function updateLink(linkElement, obj) { var css = obj.css; var sourceMap = obj.sourceMap; if(sourceMap) { css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */"; } var blob = new Blob([css], { type: "text/css" }); var oldSrc = linkElement.href; linkElement.href = URL.createObjectURL(blob); if(oldSrc) URL.revokeObjectURL(oldSrc); } }), 473: (function(module, exports, __webpack_require__) { module.exports = __webpack_require__(292); }) },[473]); //# sourceMappingURL=styles.bundle.js.map
// <auto-generated/> #nullable disable using System.Collections.Generic; using System.Text.Json; using Azure.Core; using Azure.ResourceManager.Network; namespace Azure.ResourceManager.Network.Models { internal partial class <API key> { internal static <API key> <API key>(JsonElement element) { Optional<IReadOnlyList<<API key>>> value = default; Optional<string> nextLink = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.<API key>(); continue; } List<<API key>> array = new List<<API key>>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(<API key>.<API key>(item)); } value = array; continue; } if (property.NameEquals("nextLink")) { nextLink = property.Value.GetString(); continue; } } return new <API key>(Optional.ToList(value), nextLink.Value); } } }
module SmartAnswer::Calculators class <API key> attr_reader :matrix_data, :<API key> attr_accessor :milk_protein_weight def initialize(weights) @matrix_data = self.class.<API key> @<API key> = self.class.<API key> @<API key> = weights[:<API key>].to_i @sucrose_weight = weights[:sucrose_weight].to_i @milk_fat_weight = weights[:milk_fat_weight].to_i @milk_protein_weight = weights[:milk_protein_weight].to_i end def commodity_code @<API key>[<API key>][<API key>] end def <API key> <API key>[@<API key>][@sucrose_weight] end def <API key> <API key>[@milk_fat_weight][@milk_protein_weight] end def <API key> @matrix_data[:<API key>] end def <API key> @matrix_data[:<API key>] end def self.<API key> unless @<API key> @<API key> = [] <API key>[:<API key>].each_line { |l| @<API key> << l.split } end @<API key> end def self.<API key> @<API key> ||= YAML.load(File.open("lib/data/<API key>.yml").read) end end end
<? defined('C5_EXECUTE') or die("Access Denied."); class PackageArchive extends <API key> {}
// <API key>.h // DriveTestHelper #import <UIKit/UIKit.h> @interface <API key> : UITableViewCell @property (weak, nonatomic) IBOutlet UIImageView *titleImageView; @property (weak, nonatomic) IBOutlet UILabel *theTitleLabel; @end
<template> <import from="./plugins/character-search"></import> <button type="button" class="btn btn-default navbar-btn" click.delegate="auth()" show.bind="!loggedIn">Sign in with Google</button> <button type="button" class="btn btn-default navbar-btn" click.delegate="logout()" show.bind="loggedIn">Sign out</button> <button type="button" class="btn btn-default navbar-btn" click.delegate="getUserData()" show.bind="loggedIn">My characters</button> <search /> </template>
package summea.kanjoto.activity; import java.io.File; import java.math.BigDecimal; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Locale; import java.util.Random; import java.util.TimeZone; import summea.kanjoto.data.<API key>; import summea.kanjoto.data.<API key>; import summea.kanjoto.data.<API key>; import summea.kanjoto.data.EdgesDataSource; import summea.kanjoto.data.EmotionsDataSource; import summea.kanjoto.data.VerticesDataSource; import summea.kanjoto.model.Achievement; import summea.kanjoto.model.ApprenticeScore; import summea.kanjoto.model.ApprenticeScorecard; import summea.kanjoto.model.Edge; import summea.kanjoto.model.Emotion; import summea.kanjoto.model.Note; import summea.kanjoto.model.Vertex; import summea.kanjoto.R; import android.app.Activity; import android.content.Context; import android.content.SharedPreferences; import android.media.MediaPlayer; import android.media.MediaPlayer.<API key>; import android.net.Uri; import android.os.Bundle; import android.os.Environment; import android.preference.PreferenceManager; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; /** * The <API key> class provides a specific test for the Apprentice with test * results noted as judged by the User. * <p> * The Transition test attempts to provide a way for the Apprentice to learn about what notes go * well in sequence based on a given emotion. This is different than the Emotion test in that the * Emotion test focuses on individual notesets while the Transition test focuses on how entire * notesets fit together with each other. For example, does the ending note of Noteset A fit well * together with the beginning note of Noteset B for this particular emotion? * </p> */ public class <API key> extends Activity implements OnClickListener { private File path = Environment.<API key>(); private String externalDirectory = path.toString() + "/kanjoto/"; private File musicSource = new File(externalDirectory + "kanjoto_preview.mid"); private static MediaPlayer mediaPlayer; private List<Note> focusNotes = new ArrayList<Note>(); private Emotion chosenEmotion = new Emotion(); private Button buttonYes = null; private Button buttonNo = null; private Button buttonPlayNoteset = null; private SharedPreferences sharedPref; private long transitionGraphId; private long emotionId; private int guessesCorrect = 0; private int guessesIncorrect = 0; private double <API key> = 0.0; private int totalGuesses = 0; private long scorecardId = 0; private long apprenticeId = 0; private int programMode; private List<Edge> currentEdges = new ArrayList<Edge>(); private float <API key> = 0.4f; private long emotionFocusId = 0; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // get specific layout for content view setContentView(R.layout.<API key>); buttonNo = (Button) findViewById(R.id.button_yes); buttonYes = (Button) findViewById(R.id.button_no); // get emotion graph id for Apprentice's note relationships graph sharedPref = PreferenceManager.<API key>(this); programMode = Integer.parseInt(sharedPref.getString( "pref_program_mode", "1")); transitionGraphId = Long.parseLong(sharedPref.getString( "<API key>", "2")); apprenticeId = Long.parseLong(sharedPref.getString( "<API key>", "1")); // get data from bundle Bundle bundle = getIntent().getExtras(); emotionFocusId = bundle.getLong("emotion_focus_id"); try { // add listeners to buttons buttonNo.setOnClickListener(this); buttonYes.setOnClickListener(this); Button buttonPlayNoteset = (Button) findViewById(R.id.button_play_noteset); buttonPlayNoteset.setOnClickListener(this); } catch (Exception e) { Log.d("MYLOG", e.getStackTrace().toString()); } // disable buttons while playing buttonYes.setClickable(false); buttonNo.setClickable(false); buttonPlayNoteset = (Button) findViewById(R.id.button_play_noteset); buttonPlayNoteset.setClickable(false); // get random emotion EmotionsDataSource eds = new EmotionsDataSource(this); int emotionCount = eds.getEmotionCount(apprenticeId); eds.close(); // make sure there's at least one emotion for the spinner list if (emotionCount <= 0) { Context context = <API key>(); int duration = Toast.LENGTH_SHORT; Toast toast = Toast.makeText(context, context.getResources().getString(R.string.need_emotions), duration); toast.show(); finish(); } else { <API key>(); mediaPlayer.<API key>(new <API key>() { @Override public void onCompletion(MediaPlayer aMediaPlayer) { // enable play button again buttonYes.setClickable(true); buttonNo.setClickable(true); buttonPlayNoteset.setClickable(true); } }); } } public Note generateNote(int fromIndex, int toIndex) { String[] noteValuesArray = getResources().getStringArray(R.array.note_values_array); Note note = new Note(); int randomNoteIndex = 0; String randomNote = ""; float randomLength = 0.0f; int randomVelocity = 100; float lengthValues[] = { 0.25f, 0.5f, 0.75f, 1.0f }; randomNoteIndex = new Random().nextInt((toIndex - fromIndex) + 1) + fromIndex; randomNote = noteValuesArray[randomNoteIndex]; int randomLengthIndex = new Random().nextInt(lengthValues.length); randomLength = lengthValues[randomLengthIndex]; randomVelocity = new Random().nextInt(120 - 60 + 1) + 60; note.setNotevalue(Integer.valueOf((randomNote))); note.setLength(randomLength); note.setVelocity(randomVelocity); note.setPosition(1); return note; } public List<Note> generateNotes(int fromIndex, int toIndex) { String[] noteValuesArray = getResources().getStringArray(R.array.note_values_array); List<Note> notes = new ArrayList<Note>(); int randomNoteIndex = 0; String randomNote = ""; float randomLength = 0.0f; int randomVelocity = 100; float lengthValues[] = { 0.25f, 0.5f, 0.75f, 1.0f }; for (int i = 0; i < 4; i++) { randomNoteIndex = new Random().nextInt((toIndex - fromIndex) + 1) + fromIndex; randomNote = noteValuesArray[randomNoteIndex]; int randomLengthIndex = new Random().nextInt(lengthValues.length); randomLength = lengthValues[randomLengthIndex]; randomVelocity = new Random().nextInt(120 - 60 + 1) + 60; Note note = new Note(); note.setNotevalue(Integer.valueOf((randomNote))); note.setLength(randomLength); note.setVelocity(randomVelocity); note.setPosition(i + 1); notes.add(note); } return notes; } public void askQuestion() { TextView apprenticeText = (TextView) findViewById(R.id.apprentice_text); apprenticeText.setText("Is this a " + chosenEmotion.getName() + " transition?"); } public void playMusic(File musicSource) { // get media player ready if (mediaPlayer == null) { mediaPlayer = MediaPlayer.create(this, Uri.fromFile(musicSource)); } else { mediaPlayer.release(); mediaPlayer = MediaPlayer.create(this, Uri.fromFile(musicSource)); } // play music mediaPlayer.start(); } // TODO: keep track of correct edge to update... don't insert every edge like in the Emotion // Test @Override public void onClick(View v) { VerticesDataSource vds = new VerticesDataSource(this); EdgesDataSource edds = new EdgesDataSource(this); // long notevalue = 0; // Examine note1 + note2 Note noteA = focusNotes.get(0); Note noteB = focusNotes.get(1); // Do nodes exist? Vertex nodeA = vds.getVertex(noteA.getNotevalue()); Vertex nodeB = vds.getVertex(noteB.getNotevalue()); switch (v.getId()) { case R.id.button_no: guessesIncorrect++; totalGuesses = guessesCorrect + guessesIncorrect; if (totalGuesses > 0) { <API key> = ((double) guessesCorrect / (double) totalGuesses) * 100.0; } // examine notes for graph purposes // If nodes don't exist, create new nodes in graph if (nodeA.getNode() <= 0) { // nodeA doesn't exist... creating new vertex Vertex newNodeA = new Vertex(); newNodeA.setNode(noteA.getNotevalue()); vds.createVertex(newNodeA); nodeA.setNode(noteA.getNotevalue()); } if (nodeB.getNode() <= 0) { // nodeB doesn't exist... creating new vertex Vertex newNodeB = new Vertex(); newNodeB.setNode(noteB.getNotevalue()); vds.createVertex(newNodeB); nodeB.setNode(noteB.getNotevalue()); } // Does an edge exist between these two nodes? Edge edge = edds.getEdge(transitionGraphId, emotionId, nodeA.getNode(), nodeB.getNode()); if (edge.getWeight() < 0.0f || edge.getWeight() > 1.0f) { // edge doesn't exist... creating new edge between nodeA and nodeB // If edge doesn't exist, create new edge in graph (and set weight at 0.5) // [note: 0.0 = stronger edge / more likely to be chosen than a 1.0 edge] Edge newEdge = new Edge(); newEdge.setGraphId(transitionGraphId); newEdge.setEmotionId(emotionId); newEdge.setFromNodeId(nodeA.getNode()); newEdge.setToNodeId(nodeB.getNode()); newEdge.setWeight(0.5f); newEdge.setPosition(1); newEdge.setApprenticeId(apprenticeId); newEdge = edds.createEdge(newEdge); // notevalue = newEdge.getId(); } else { // edge exists between nodeA and nodeB, just update weight // If edge does exist, update weight (weight + 0.1) if ((edge.getWeight() + 0.1f) <= 1.0f) { // adding 0.1f to weight... (lower weight is stronger) // round float addition in order to avoid awkward zeros BigDecimal bd = new BigDecimal(Float.toString(edge.getWeight() + 0.1f)); bd = bd.setScale(2, BigDecimal.ROUND_HALF_UP); edge.setWeight(bd.floatValue()); edds.updateEdge(edge); // notevalue = edge.getId(); } } // save score saveScore(0, noteA.getNotevalue()); saveScore(0, noteB.getNotevalue()); // disable buttons while playing buttonYes = (Button) findViewById(R.id.button_yes); buttonYes.setClickable(false); buttonNo = (Button) findViewById(R.id.button_no); buttonNo.setClickable(false); buttonPlayNoteset = (Button) findViewById(R.id.button_play_noteset); buttonPlayNoteset.setClickable(false); // try another noteset <API key>(); mediaPlayer.<API key>(new <API key>() { @Override public void onCompletion(MediaPlayer aMediaPlayer) { // enable play button again buttonYes.setClickable(true); buttonNo.setClickable(true); buttonPlayNoteset.setClickable(true); } }); break; case R.id.button_yes: guessesCorrect++; totalGuesses = guessesCorrect + guessesIncorrect; if (totalGuesses > 0) { <API key> = ((double) guessesCorrect / (double) totalGuesses) * 100.0; } // disable buttons while playing buttonYes = (Button) findViewById(R.id.button_yes); buttonYes.setClickable(false); buttonNo = (Button) findViewById(R.id.button_no); buttonNo.setClickable(false); buttonPlayNoteset = (Button) findViewById(R.id.button_play_noteset); buttonPlayNoteset.setClickable(false); // examine notes for graph purposes // If nodes don't exist, create new nodes in graph if (nodeA.getNode() <= 0) { // nodeA doesn't exist... creating new vertex Vertex newNodeA = new Vertex(); newNodeA.setNode(noteA.getNotevalue()); vds.createVertex(newNodeA); nodeA.setNode(noteA.getNotevalue()); } if (nodeB.getNode() <= 0) { // nodeB doesn't exist... creating new vertex Vertex newNodeB = new Vertex(); newNodeB.setNode(noteB.getNotevalue()); vds.createVertex(newNodeB); nodeB.setNode(noteB.getNotevalue()); } // Does an edge exist between these two nodes? edge = edds.getEdge(transitionGraphId, emotionId, nodeA.getNode(), nodeB.getNode()); if (edge.getWeight() < 0.0f || edge.getWeight() > 1.0f) { // edge doesn't exist... creating new edge between nodeA and nodeB // If edge doesn't exist, create new edge in graph (and set weight at 0.5) // [note: 0.0 = stronger edge / more likely to be chosen than a 1.0 edge] Edge newEdge = new Edge(); newEdge.setGraphId(transitionGraphId); newEdge.setEmotionId(emotionId); newEdge.setFromNodeId(nodeA.getNode()); newEdge.setToNodeId(nodeB.getNode()); newEdge.setWeight(0.5f); newEdge.setPosition(1); newEdge.setApprenticeId(apprenticeId); newEdge = edds.createEdge(newEdge); // notevalue = newEdge.getId(); currentEdges.add(newEdge); } else { // edge exists between nodeA and nodeB, just update weight // If edge does exist, update weight (weight - 0.1) if ((edge.getWeight() - 0.1f) >= 0.0f) { // subtracting 0.1f from weight... (lower weight is stronger) // round float addition in order to avoid awkward zeros BigDecimal bd = new BigDecimal(Float.toString(edge.getWeight() - 0.1f)); bd = bd.setScale(2, BigDecimal.ROUND_HALF_UP); edge.setWeight(bd.floatValue()); edds.updateEdge(edge); // notevalue = edge.getId(); } currentEdges.add(edge); } // save score saveScore(1, noteA.getNotevalue()); saveScore(1, noteB.getNotevalue()); // check if achievement was earned in play mode if (programMode == 2) { // check if this is a strong noteset String currentEdgesKey = ""; boolean <API key> = true; for (int i = 0; i < currentEdges.size(); i++) { if (i == (currentEdges.size() - 1)) { currentEdgesKey += currentEdges.get(i).getFromNodeId() + "_"; currentEdgesKey += currentEdges.get(i).getToNodeId(); } else { currentEdgesKey += currentEdges.get(i).getFromNodeId() + "_"; } if (currentEdges.get(i).getWeight() > <API key>) { <API key> = false; } } if (<API key>) { String key = String.valueOf(currentEdgesKey); // check if achievement key for this already exists <API key> ads = new <API key>(this); Achievement achievement = ads.getAchievementByKey(key); if (achievement.getId() > 0) { // pass } else { TimeZone timezone = TimeZone.getTimeZone("UTC"); DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'", Locale.getDefault()); dateFormat.setTimeZone(timezone); String earnedOnISO = dateFormat.format(new Date()); // save achievement if this is a new key achievement = new Achievement(); achievement.setName("<API key>"); achievement.setApprenticeId(apprenticeId); achievement.setEarnedOn(earnedOnISO); achievement.setKey(key); ads.createAchievement(achievement); Context context = <API key>(); int duration = Toast.LENGTH_SHORT; Toast toast = Toast.makeText( context, context.getResources().getString( R.string.<API key>), duration); toast.show(); } ads.close(); } } // try another noteset <API key>(); mediaPlayer.<API key>(new <API key>() { @Override public void onCompletion(MediaPlayer aMediaPlayer) { // enable play button again buttonYes.setClickable(true); buttonNo.setClickable(true); buttonPlayNoteset.setClickable(true); } }); break; case R.id.button_play_noteset: // disable buttons while playing buttonYes = (Button) findViewById(R.id.button_yes); buttonYes.setClickable(false); buttonNo = (Button) findViewById(R.id.button_no); buttonNo.setClickable(false); buttonPlayNoteset = (Button) findViewById(R.id.button_play_noteset); buttonPlayNoteset.setClickable(false); // play generated notes for user playMusic(musicSource); mediaPlayer.<API key>(new <API key>() { @Override public void onCompletion(MediaPlayer aMediaPlayer) { // enable play button again buttonYes.setClickable(true); buttonNo.setClickable(true); buttonPlayNoteset.setClickable(true); } }); break; } } public void <API key>() { EmotionsDataSource eds = new EmotionsDataSource(this); // are we focusing on a specific emotion? if (emotionFocusId > 0) { chosenEmotion = eds.getEmotion(emotionFocusId); } else { chosenEmotion = eds.getRandomEmotion(apprenticeId); } eds.close(); emotionId = chosenEmotion.getId(); // clear old generated notes focusNotes.clear(); Note noteOne = new Note(); Note noteTwo = new Note(); List<Note> totalNotes = new ArrayList<Note>(); EdgesDataSource edds = new EdgesDataSource(this); String approach = ""; try { // Using Learned Data Approach (<API key> transition) Random rnd = new Random(); int randomOption = rnd.nextInt((2 - 1) + 1) + 1; int randomNotevalue = rnd.nextInt((71 - 60) + 1) + 60; approach = "Learned Data"; Edge foundEdge = edds.getRandomEdge(apprenticeId, transitionGraphId, emotionId, 0, 0, 1, 0); // if edge is already pretty certain (0.0f == strongest weight) // choose/create a random edge to test if (foundEdge.getWeight() <= 0.0f) { // Using Random Approach approach = "Random"; // stay within 39..50 for now (C4..B4) noteOne = generateNote(39, 50); noteTwo = generateNote(39, 50); } else { if (randomOption == 1) { approach = "Learned Data +"; foundEdge.setToNodeId(randomNotevalue); } noteOne = new Note(); noteTwo = new Note(); noteOne.setNotevalue(foundEdge.getFromNodeId()); noteTwo.setNotevalue(foundEdge.getToNodeId()); } } catch (Exception e) { // Using Random Approach approach = "Random"; // stay within 39..50 for now (C4..B4) noteOne = generateNote(39, 50); noteTwo = generateNote(39, 50); } if ((noteOne.getNotevalue() == 0) || (noteTwo.getNotevalue() == 0)) { // Using Random Approach approach = "Random"; // stay within 39..50 for now (C4..B4) noteOne = generateNote(39, 50); noteTwo = generateNote(39, 50); } totalNotes.add(noteOne); totalNotes.add(noteTwo); try { // last noteset of first noteset focusNotes.add(noteOne); // first noteset of last noteset focusNotes.add(noteTwo); } catch (Exception e) { Log.d("MYLOG", e.getStackTrace().toString()); } // get default instrument for playback SharedPreferences sharedPref = PreferenceManager.<API key>(this); String defaultInstrument = sharedPref.getString("<API key>", ""); int playbackSpeed = Integer.valueOf(sharedPref.getString("<API key>", "120")); <API key> generateMusic = new <API key>(); generateMusic.generateMusic(totalNotes, musicSource, defaultInstrument, playbackSpeed); // does generated noteset sounds like chosen emotion? askQuestion(); TextView <API key> = (TextView) findViewById(R.id.<API key>); <API key>.setText(approach); String <API key> = String.format(Locale.getDefault(), "%.02f", <API key>); TextView <API key> = (TextView) findViewById(R.id.<API key>); <API key>.setText(guessesCorrect + "/" + totalGuesses + " (" + <API key> + "%)"); // disable play button while playing buttonPlayNoteset = (Button) findViewById(R.id.button_play_noteset); buttonPlayNoteset.setClickable(false); // play generated notes for user playMusic(musicSource); // return to previous activity when done playing mediaPlayer.<API key>(new <API key>() { @Override public void onCompletion(MediaPlayer aMediaPlayer) { // enable play button again buttonPlayNoteset.setClickable(true); } }); } /** * onBackPressed override used to stop playing music when done with activity */ @Override public void onBackPressed() { if (mediaPlayer != null) { if (mediaPlayer.isPlaying()) { // stop playing music mediaPlayer.stop(); } mediaPlayer.release(); } super.onBackPressed(); } public void saveScore(int isCorrect, long notevalue) { boolean autoSaveScorecard = sharedPref.getBoolean( "<API key>", false); if (autoSaveScorecard) { // check if scorecard already exists if (scorecardId <= 0) { TimeZone timezone = TimeZone.getTimeZone("UTC"); DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'", Locale.getDefault()); dateFormat.setTimeZone(timezone); String takenAtISO = dateFormat.format(new Date()); // String takenAtISO = new Date().toString(); // if scorecard doesn't yet exist, create it <API key> asds = new <API key>(this); ApprenticeScorecard aScorecard = new ApprenticeScorecard(); aScorecard.setTakenAt(takenAtISO); aScorecard.setApprenticeId(apprenticeId); aScorecard.setGraphId(transitionGraphId); aScorecard = asds.<API key>(aScorecard); asds.close(); // then get scorecard_id for the score to save scorecardId = aScorecard.getId(); } // also, update scorecard question totals <API key> ascds = new <API key>(this); ApprenticeScorecard scorecard = new ApprenticeScorecard(); scorecard = ascds.<API key>(scorecardId); if (isCorrect == 1) { scorecard.setCorrect(guessesCorrect); } scorecard.setTotal(totalGuesses); ascds.<API key>(scorecard); ascds.close(); // save Apprentice's score results to database ApprenticeScore aScore = new ApprenticeScore(); aScore.setScorecardId(scorecardId); aScore.setQuestionNumber(totalGuesses); aScore.setCorrect(isCorrect); aScore.setNotevalue(notevalue); <API key> asds = new <API key>(this); asds.<API key>(aScore); asds.close(); } } }
func pushDominoes(dominoes string) string { current := []rune(dominoes) next := []rune(dominoes) changed := true for changed { changed = false for i, r := range current { switch r { case 'L', 'R': next[i] = r default: if 0 < i && i < len(current)-1 && current[i-1] == 'R' && current[i+1] == 'L' { next[i] = r } else if 0 < i && current[i-1] == 'R' { next[i] = 'R' changed = true } else if i < len(current)-1 && current[i+1] == 'L' { next[i] = 'L' changed = true } else { next[i] = r } } } current, next = next, current } return string(current) }
<?php /** * Sample layout. */ use Helpers\Assets; use Helpers\Hooks; use Helpers\Url; //initialise hooks $hooks = Hooks::get(); ?> </div> <?php //Assets::js([ // Url::templatePath().'js/jquery.js', // '//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js', //hook for plugging in javascript //$hooks->run('js'); //hook for plugging in code into the footer $hooks->run('footer'); ?> </body> </html>
<?php namespace TwigGenerator\Builder; class Generator { const TEMP_DIR_PREFIX = 'TwigGenerator'; /** * @var string The temporary dir. */ protected $tempDir; /** * @var array List of builders. */ protected $builders = array(); /** * @var Boolean */ protected $<API key> = false; /** * @var array */ protected $templateDirectories = array(); /** * @var array Variables to pass to the builder. */ protected $variables = array(); /** * @var boolean Activate remove temp dir after generation */ protected $autoRemoveTempDir = true; /** * Init a new generator and automatically define the base of temp directory. * * @param string $baseTempDir Existing base directory for temporary template files */ public function __construct($baseTempDir = null) { if (null === $baseTempDir) { $baseTempDir = sys_get_temp_dir(); } $this->tempDir = realpath($baseTempDir).DIRECTORY_SEPARATOR.self::TEMP_DIR_PREFIX; if (!is_dir($this->tempDir)) { mkdir($this->tempDir, 0777, true); } } public function <API key>($autoRemoveTempDir = true) { $this->autoRemoveTempDir = $autoRemoveTempDir; } public function <API key>($status = true) { $this-><API key> = $status; } public function setTemplateDirs(array $templateDirs) { $this->templateDirectories = $templateDirs; } /** * Ensure to remove the temp directory. */ public function __destruct() { if ($this->tempDir && is_dir($this->tempDir) && $this->autoRemoveTempDir) { $this->removeDir($this->tempDir); } } /** * @param string The temporary directory path */ public function setTempDir($tempDir) { $this->tempDir = $tempDir; } /** * @return string The temporary directory. */ public function getTempDir() { return $this->tempDir; } /** * @return array The list of builders. */ public function getBuilders() { return $this->builders; } /** * Add a builder. * * @param \TwigGenerator\Builder\BuilderInterface $builder A builder. * * @return \TwigGenerator\Builder\BuilderInterface The builder */ public function addBuilder(BuilderInterface $builder) { $builder->setGenerator($this); $builder->setTemplateDirs($this->templateDirectories); $builder-><API key>($this-><API key>); $builder->setVariables(array_merge($this->variables, $builder->getVariables())); $this->builders[$builder->getSimpleClassName()] = $builder; return $builder; } /** * Add an array of variables to pass to builders. * * @param array $variables A set of variables. */ public function setVariables(array $variables = array()) { $this->variables = $variables; } /** * Generate and write classes to disk. * * @param string $outputDirectory An output directory. */ public function writeOnDisk($outputDirectory) { foreach ($this->getBuilders() as $builder) { $builder->writeOnDisk($outputDirectory); } } /** * Remove a directory. * * @param string $target A directory. */ private function removeDir($target) { $fp = opendir($target); while (false !== $file = readdir($fp)) { if (in_array($file, array('.', '..'))) { continue; } if (is_dir($target.'/'.$file)) { self::removeDir($target.'/'.$file); } else { unlink($target.'/'.$file); } } closedir($fp); rmdir($target); } }
package org.openprovenance.prov.xml.builder; import org.apache.commons.lang.builder.HashCodeBuilder; public interface HashCode { public void hashCode(HashCodeBuilder hashCodeBuilder); }
namespace osu.Game.Rulesets.Taiko.Objects { public class RimHit : Hit { } }
<html> <META HTTP-EQUIV=Content-Type Content="text/html; charset=big5"> <!-- Mirrored from lis.ly.gov.tw/lghtml/lawstat/version2/01930/0193056122200.htm by HTTrack Website Copier/3.x [XR&CO'2010], Sun, 24 Mar 2013 09:16:38 GMT --> <head><title>ªk½s¸¹:01930 ª©¥»:056122200</title> <link rel="stylesheet" type="text/css" href="../../version.css" > </HEAD> <body><left> <table><tr><td><FONT COLOR=blue SIZE=5>¥~°ê¤H§ë¸ê±ø¨Ò(01930)</font> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td> <table><tr><td>&nbsp;&nbsp;&nbsp;</td> <tr><td align=left valign=top> <a href=0193043070600.html target=law01930><nobr><font size=2>¤¤µØ¥Á°ê 43 ¦~ 7 ¤ë 6 ¤é</font></nobr></a> </td> <td valign=top><font size=2>¨î©w23±ø</font></td> <tr><td align=left valign=top><nobr><font size=2>¤¤µØ¥Á°ê 43 ¦~ 7 ¤ë 14 ¤é¤½¥¬</font></nobr></td> <tr><td align=left valign=top> <a href=0193048120800.html target=law01930><nobr><font size=2>¤¤µØ¥Á°ê 48 ¦~ 12 ¤ë 8 ¤é</font></nobr></a> </td> <td valign=top><font size=2>­×¥¿¥þ¤å22±ø</font></td> <tr><td align=left valign=top><nobr><font size=2>¤¤µØ¥Á°ê 48 ¦~ 12 ¤ë 14 ¤é¤½¥¬</font></nobr></td> <tr><td align=left valign=top> <a href=0193056122200.html target=law01930><nobr><font size=2>¤¤µØ¥Á°ê 56 ¦~ 12 ¤ë 22 ¤é</font></nobr></a> </td> <td valign=top><font size=2>­×¥¿²Ä17, 18±ø</font></td> <tr><td align=left valign=top><nobr><font size=2>¤¤µØ¥Á°ê 57 ¦~ 1 ¤ë 8 ¤é¤½¥¬</font></nobr></td> <tr><td align=left valign=top> <a href=0193057061400.html target=law01930><nobr><font size=2>¤¤µØ¥Á°ê 57 ¦~ 6 ¤ë 14 ¤é</font></nobr></a> </td> <td valign=top><font size=2>­×¥¿²Ä21±ø</font></td> <tr><td align=left valign=top><nobr><font size=2>¤¤µØ¥Á°ê 57 ¦~ 6 ¤ë 22 ¤é¤½¥¬</font></nobr></td> <tr><td align=left valign=top> <a href=0193068071700.html target=law01930><nobr><font size=2>¤¤µØ¥Á°ê 68 ¦~ 7 ¤ë 17 ¤é</font></nobr></a> </td> <td valign=top><font size=2>­×¥¿¥þ¤å24±ø</font></td> <tr><td align=left valign=top><nobr><font size=2>¤¤µØ¥Á°ê 68 ¦~ 7 ¤ë 27 ¤é¤½¥¬</font></nobr></td> <tr><td align=left valign=top> <a href=0193069032500.html target=law01930><nobr><font size=2>¤¤µØ¥Á°ê 69 ¦~ 3 ¤ë 25 ¤é</font></nobr></a> </td> <td valign=top><font size=2>­×¥¿²Ä4±ø</font></td> <tr><td align=left valign=top><nobr><font size=2>¤¤µØ¥Á°ê 69 ¦~ 4 ¤ë 3 ¤é¤½¥¬</font></nobr></td> <tr><td align=left valign=top> <a href=0193069041500.html target=law01930><nobr><font size=2>¤¤µØ¥Á°ê 69 ¦~ 4 ¤ë 15 ¤é</font></nobr></a> </td> <td valign=top><font size=2>­×¥¿²Ä18±ø</font></td> <tr><td align=left valign=top><nobr><font size=2>¤¤µØ¥Á°ê 69 ¦~ 5 ¤ë 9 ¤é¤½¥¬</font></nobr></td> <tr><td align=left valign=top> <a href=0193072042900.html target=law01930><nobr><font size=2>¤¤µØ¥Á°ê 72 ¦~ 4 ¤ë 29 ¤é</font></nobr></a> </td> <td valign=top><font size=2>­×¥¿²Ä16, 18±ø</font></td> <tr><td align=left valign=top><nobr><font size=2>¤¤µØ¥Á°ê 72 ¦~ 5 ¤ë 11 ¤é¤½¥¬</font></nobr></td> <tr><td align=left valign=top> <a href=0193075050200.html target=law01930><nobr><font size=2>¤¤µØ¥Á°ê 75 ¦~ 5 ¤ë 2 ¤é</font></nobr></a> </td> <td valign=top><font size=2>­×¥¿²Ä3, 5, 6, 13, 14, 17, 18±ø</font></td> <tr><td align=left valign=top><nobr><font size=2>¤¤µØ¥Á°ê 75 ¦~ 5 ¤ë 14 ¤é¤½¥¬</font></nobr></td> <tr><td align=left valign=top> <a href=0193078050900.html target=law01930><nobr><font size=2>¤¤µØ¥Á°ê 78 ¦~ 5 ¤ë 9 ¤é</font></nobr></a> </td> <td valign=top><font size=2>­×¥¿²Ä3, 5, 8, 10, 11, 14, 15±ø<br> §R°£²Ä17±ø</font></td> <tr><td align=left valign=top><nobr><font size=2>¤¤µØ¥Á°ê 78 ¦~ 5 ¤ë 26 ¤é¤½¥¬</font></nobr></td> <tr><td align=left valign=top> <a href=0193086103000.html target=law01930><nobr><font size=2>¤¤µØ¥Á°ê 86 ¦~ 10 ¤ë 30 ¤é</font></nobr></a> </td> <td valign=top><font size=2>­×¥¿¥þ¤å20±ø</font></td> <tr><td align=left valign=top><nobr><font size=2>¤¤µØ¥Á°ê 86 ¦~ 11 ¤ë 19 ¤é¤½¥¬</font></nobr></td> </table></table></table></table> <p><table><tr><td><font color=blue size=4>¥Á°ê56¦~12¤ë22¤é(«D²{¦æ±ø¤å)</font></td> <td><a href=http: </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤@±ø</font> </font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@¥~°ê¤H¦b¤¤µØ¥Á°ê»â°ì¤º§ë¸ê¤§«O»Ù¤Î³B²z¡A¨Ì¥»±ø¨Ò¤§³W©w¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤G±ø</font> </font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@¥»±ø¨Ò©ÒºÙ¥~°ê¤H¡A¥]¬A¥~°êªk¤H¡C<br> ¡@¡@¥~°êªk¤H¨Ì¨ä©Ò¾Ú¥H¦¨¥ß¤§ªk«ß¡A©w¨ä°êÄy¡C<br> ¡@¡@¥~°ê¤H¨Ì·Ó¥»±ø¨Ò¤§³W©w¡A¦b¤¤µØ¥Á°ê»â°ì¤º§ë¸êªÌ¡AºÙ§ë¸ê¤H¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤T±ø</font> </font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@¥»±ø¨Ò©ÒºÙ§ë¸ê¡A¨ä¥X¸ê¤§ºØÃþ¦p¥ª¡G<br> ¡@¡@¤@¡B¿é¤J¤§¥~°ê³f¹ô©Î¥~¶×ºc¦¨¤§²{ª÷¡C<br> ¡@¡@¤G¡B¦Û³Æ¥~¶×¿é¤J°ê¤º©Ò»Ý¤§¦Û¥Î¾÷¾¹³]³Æ¡B­ì®Æ©Î«Ø¼t¤Î¶gÂà»Ý­n­ã³\¶i¤fÃþ¥X°âª«¸ê¡C<br> ¡@¡@¤T¡B±Mªù§Þ³N©Î±M§QÅv¡C<br> ¡@¡@¥|¡B¸g®Ö­ãµ²¥I¥~¶×¤§§ë¸ê¥»ª÷¡B²b§Q¡B´F®§©Î¨ä¥L¦¬¯q¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¥|±ø</font> </font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@¥»±ø¨Ò©ÒºÙ§ë¸ê¡A¨ä¤è¦¡¦p¥ª¡G<br> ¡@¡@¤@¡B³æ¿W©ÎÁp¦X¥X¸ê¡A©Î»P¤¤µØ¥Á°ê¬F©²¡B°ê¥Á©Îªk¤H¦@¦P¥X¸êÁ|¿ì¨Æ·~¡A©Î¼W¥[¸ê¥»ÂX®i­ì¦³¨Æ·~¡C<br> ¡@¡@¤G¡B¹ï©ó­ì¦³¨Æ·~¤§ªÑ¥÷©Î¤½¥q¶Å¤§ÁʶR¡A©Î¬°²{ª÷¡B¾÷¾¹³]³Æ©Î­ì®Æ¤§­É¶U¡C<br> ¡@¡@¤T¡B¥H±Mªù§Þ³N©Î±M§QÅv§@¬°ªÑ¥»¡C<br> ¡@¡@±Mªù§Þ³N©Î±M§QÅv¤£§@¬°ªÑ¥»¦Ó¦X§@ªÌ¡A¥t¥Hªk«ß©w¤§¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤­±ø</font> </font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@¥»±ø¨Ò©ÒºÙ§ë¸ê¡A¥H¦X©ó¥ª¦C³W©w¤§¤@ªÌ¬°­­¡G<br> ¡@¡@¤@¡B°ê¤º©Ò»Ý­n¤§¥Í²£©Î»s³y¨Æ·~¡C<br> ¡@¡@¤G¡B¦³¥~¾P¤§¥«³õªÌ¡C<br> ¡@¡@¤T¡B¦³§U©ó­«­n¤u¡BÄq¡B¥æ³q¨Æ·~¤§µo®i»P§ï¶iªÌ¡C<br> ¡@¡@¥|¡B¨ä¥L¦³§U©ó°ê¤º¸gÀ٩ΪÀ·|µo®i¤§¨Æ·~ªÌ¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤»±ø</font> </font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@¥~°ê¤H¨Ì¥»±ø¨Ò©Ò¬°¤§§ë¸ê®×¥ó¡A¥H¸gÀÙ³¡¬°¥DºÞ¾÷Ãö¡C<br> ¡@¡@¸gÀÙ³¡¬°¼fij¥~°ê¤H§ë¸ê®×¥ó¡A±o³]¼fij©e­û·|¡A¨ä²Õ´³Wµ{¥Ñ¦æ¬F°|©w¤§¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤C±ø</font> </font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@¥~°ê¤H¨Ì¥»±ø¨Ò§ë¸êªÌ¡AÀ³¶ñ¨ã¥Ó½Ð®Ñ¡AÀ˪þ§ë¸ê­pµe¤Î¦³ÃöÃÒ¥ó¡A¦V¸gÀÙ³¡¥Ó½Ð®Ö­ã¡C¥Ó½Ð®Ñ®æ¦¡¥Ñ¸gÀÙ³¡©w¤§¡C<br> ¡@¡@§ë¸ê¤§¨Æ·~¡A¨Ì¨ä¥Lªk«ß¶·¥t¦V¦³Ãö¥DºÞ¾÷Ãö¿ì²z³W©w¤âÄòªÌ¡A±o¥Ñ¸gÀÙ³¡®ÖÂà¦U¸Ó¥DºÞ¾÷Ãö®Ö¿ì¤§¡C<br> ¡@¡@¸gÀÙ³¡¹ï¥Ó½Ð§ë¸ê®×¥ó¡AÀ³©ó¨ä¥Ó½Ð¤âÄò§¹³Æ«á¥|­Ó¤ë¤º®Ö©w¤§¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤K±ø</font> </font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@§ë¸ê¤H¨Ì®Ö­ã¤§§ë¸ê­pµe¶}©l¹ê¦æ§ë¸ê«á¡AÀ³±N¹ê¦æ§ë¸ê±¡§Î¡A³ø½Ð¸gÀÙ³¡¬d®Ö¡C<br> ¡@¡@§ë¸ê¸g®Ö­ã«á¡A¹O¤»­Ó¤ë©|¥¼¨Ì¨ä§ë¸ê­pµe¶}©l¹ê¦æ§ë¸êªÌ¡A±oºM¾P¨ä®Ö­ã¡C<br> ¡@¡@«e¶µ©Ò©w´Á­­¡A¦p¦³¥¿·í¨Æ¥Ñ¡A§ë¸ê¤H±o¥Ó½Ð¸gÀÙ³¡®Ö­ã¤©¥H©µ®i¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤E±ø</font> </font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@§ë¸ê¤H¨Ì®Ö­ã§ë¸ê¤§­pµe¡A¤w¶}©l¹ê¦æ§ë¸ê«á¡A¦p¦]µo¥Í§xÃøµLªk§¹¦¨®É¡A¨ä¤w¿é¤J¤§¥X¸ê¡AÀ³¥Ñ§ë¸ê¤H¥Ó½Ð¸gÀÙ³¡®Ö­ã¡A¨Ì¥ª¦C¤è¦¡³B²z¤§¡G<br> ¡@¡@¤@¡B±N¥X¸ê²¾Âà§ë¸ê©ó¥»±ø¨Ò²Ä¤­±ø©Ò³W©w¤§¨ä¥L¨Æ·~¡C<br> ¡@¡@¤G¡B±N¥X¸ê¨Ì­ì¨Ó¤§ºØÃþ¿é¥X°ê¥~¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤Q±ø</font> </font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@§ë¸ê¤H²¾Âà¨ä§ë¸ê©ó¥»±ø¨Ò²Ä¤­±ø©Ò³W©w¤§¨ä¥L¨Æ·~®É¡AÀ³¥Ñ§ë¸ê¤H¦V¸gÀÙ³¡¬°ºM¾P­ì§ë¸ê¤Î®Ö­ã·s§ë¸ê¤§¥Ó½Ð¡C<br> ¡@¡@§ë¸ê¤HÂàÅý¨ä§ë¸ê®É¡AÀ³¥ÑÂàÅý¤H¤Î¨üÅý¤H·|¦P¦V¸gÀÙ³¡¥Ó½Ð¬°ÂàÅý¤Î¨üÅý¤§µn°O¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤Q¤@±ø</font> </font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@§ë¸ê¤H¦³¨Ì¥»±ø¨Ò¥Ó½Ðµ²¶×¤§Åv§Q¡A¦¹¶µÅv§Q¤£±oÂàÅý¡C¦ý§ë¸ê¤H¤§¦XªkÄ~©Ó¤H©Î¨üÅý¨ä§ë¸ê¤§¨ä¥L¥~°ê¤H©ÎµØ¹´¡A¤£¦b¦¹­­¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤Q¤G±ø</font> </font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@§ë¸ê¤H±o¥H¨ä§ë¸ê¨C¦~©Ò±o¤§²b§Q©Î´F®§¡A¥Ó½Ðµ²¶×¡C<br> ¡@¡@§ë¸ê¤H©ó®Ö­ã¤§§ë¸ê­pµe§¹¦¨º¡¨â¦~«á¡A¨C¦~±o¥H¨ä§ë¸ê¥»ª÷Á`ÃB¦Ê¤À¤§¤Q¤­¥Ó½Ðµ²¶×¡C<br> ¡@¡@«e¶µ©Ò©wµ²¶×¤§¦Ê¤À¤ñ¡A±o¥Ñ¥DºÞ¾÷Ãö·r°u¨C¦~¥Ó½Ðµ²¶×®É¤§±¡§Î¡A§e³ø¦æ¬F°|®Ö­ã´£°ª¤§¡C<br> ¡@¡@§ë¸ê¤H¥H¨ä¤½¥q¶Å¤Î­É¶U¥»ª÷¥Ó½Ðµ²¶×®É¡A±q¨ä®Ö­ã¤§¬ù©w¡C<br> ¡@¡@¨Ì²Ä¤T±ø²Ä¤G´Ú§ë¸êªÌ¡A¨ä§ë¸êÁ`ÃB¥Ñ§ë¸ê¤H©ó¸Ó¶µ¾÷¾¹³]³Æ¡B­ì®Æ©Î¥X°âª«¸ê¶i¤f«á¡A¥Ó½Ð¸gÀÙ³¡¼f©w¤§¡C<br> ¡@¡@¨Ì²Ä¤T±ø²Ä¤T´Ú§ë¸êªÌ¡A¨ä§ë¸êÁ`ÃB¥Ñ¸gÀÙ³¡©ó¥Ó½Ð§ë¸ê®É¼f©w¤§¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤Q¤T±ø</font> </font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@§ë¸ê¤H¥H²b§Q¥Ó½Ðµ²¶×®É¡AÀ³©óµ|°È¾÷Ãö®Ö©wµ|ÃB«á¤»­Ó¤ë¤º¡AÀ˦Pµ|°È¾÷Ãö®Ö©w¤§µ|³æ¡B¸ê²£­t¶Åªí¡B·l¯q­pºâ®Ñ¡A°e½Ð¥~¶×¥DºÞ¾÷Ãö¼f©w¤§¡C¨ä©Ò§ë¸ê¤§¨Æ·~¦p¬°¤½¥q®É¡A¨ÃÀ³¥[°eªÑªF·|¤À°t¬Õ¾l¤§¨Mij°O¿ý¡C<br> ¡@¡@§ë¸ê¤H¥H´F®§©Î§ë¸ê¥»ª÷¥Ó½Ðµ²¶×®É¡AÀ³©ó¦¸¦~¤»¤ë©³«e¡AÀ˦PÃÒ¥ó¡A°e½Ð¥~¶×¥DºÞ¾÷Ãö¼f®Ö¤§¡C<br> ¡@¡@§ë¸ê¤H¬°·~°È»Ý­n¡AÄ@±N¨Ì«e±ø©Ò±o¥Ó½Ðµ²¶×¤§¸êª÷¯d¨Ñ¶gÂà®É¡A±o©ó¥»±ø²Ä¤@¶µ¤Î²Ä¤G¶µ³W©w¤§´Á­­¤º¡AÀ˦P¥Ó½Ðµ²¶×À³¦³¤§ÃÒ¥ó¡A¦V¥~¶×¥DºÞ¾÷Ãö¥Ó½Ð®Ö­ã®i´Á¡A¦Ü¦¸¦~«×²Ö¿nµ²¶×¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤Q¥|±ø</font> </font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@§ë¸ê¤H¹ï©Ò§ë¸ê¤§¨Æ·~«O«ù¤§§ë¸êÃB¡A§C©ó¸Ó¨Æ·~¸ê¥»Á`ÃB¦Ê¤À¤§¤­¤Q¤@®É¡A¦p¬F©²°ò©ó°ê¨¾»Ý­n¡A¹ï¸Ó¨Æ·~¼x¥Î©Î¦¬Áʪ̡AÀ³µ¹¤©¦X²z¤§¸ÉÀv¡C<br> ¡@¡@«e¶µ¸ÉÀv©Ò±o¤§»ù´Ú¡A­ã¤©ÀH®É¦V¥~¶×¥DºÞ¾÷Ãö¥Ó½Ðµ²¶×¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤Q¤­±ø</font> </font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@§ë¸ê¤H¹ï©Ò§ë¸ê¤§¨Æ·~¡A¨ä§ë¸ê¦û¸Ó¨Æ·~¸ê¥»Á`ÃB¦Ê¤À¤§¤­¤Q¤@¥H¤W®É¡A¦b¶}·~¤G¤Q¦~¤º¡A©ó§ë¸ê¤HÄ~Äò«O«ù¨ä§ë¸êÃB¤£§C©ó¦Ê¤À¤§¤­¤Q¤@¤§®É´Á¤¤¡A¤£¤©¼x¥Î©Î¦¬ÁÊ¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤Q¤»±ø</font> </font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@¨Ì¥»±ø¨Ò¤§³W©w¥Ó½Ðµ²¶×®É¡A¨Ì¥ª¦C¿ìªk³B²z¤§¡G<br> ¡@¡@¤@¡B¥H§ë¸ê¥»ª÷¥Ó½Ðµ²¶×®É¡AÀ³¥H­ì§ë¸ê®É¶×¤J¤§³f¹ô¬°­­¡A¨ä¥H¦Û¥Î¾÷¾¹³]³Æ¡B­ì®Æ¡B±Mªù§Þ³N¡B±M§QÅv©Î¥X°âª«¸ê§éºâªÌ¡A¥H­ì¿é¤J¦a°Ï¤§³q¥Î³f¹ô¬°·Ç¡C¦ý­ì§ë¸ê®É¶×¤J¤§³f¹ô¬°¬üª÷ªÌ¡A±o¥Ó½Ðµ²¶×¨ä¥L³f¹ô¡F¥H²b§Q©Î´F®§¥Ó½Ðµ²¶×®É¡A¨ä¹ô§O¤£¤©­­¨î¡C<br> ¡@¡@¤G¡B¥Ó½Ðµ²¶×®É¡AÀ³¨Ì·í®É¶×²v®Ö­ãµ²¶×¡A¨ä¾A¥Î¤§¶×²vºØÃþ¡A¨Ì§ë¸ê®É¾A¥Î¤§¶×²vºØÃþ¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤Q¤C±ø</font> </font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@§ë¸ê¤H¨Ì¤½¥qªk¤Î¨ä¥L¦³Ãöªk«ß²Õ³]¤½¥qªÌ¡A±o¤£¨ü¥ª¦C¦U´Ú¤§­­¨î¡G<br> ¡@¡@¤@¡B¤½¥qªk²Ä¤E¤Q¤K±ø²Ä¤@¶µ¡B²Ä¤@¦Ê¤G¤Q¤K±ø²Ä¤@¶µ¡B²Ä¤G¦Ê¹s¤K±ø²Ä¤­¶µ¤Î²Ä¤G¦Ê¤@¤Q¤»±ø²Ä¤@¶µÃö©ó°ê¤º¦í©Ò¤§­­¨î¡C<br> ¡@¡@¤G¡B¤½¥qªk²Ä¤G¦Ê¹s¤K±ø²Ä¤­¶µÃö©ó¤¤µØ¥Á°ê°êÄy¤§­­¨î¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤Q¤K±ø</font> </font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@§ë¸ê¤H©Î¨ä©Ò§ë¸ê¤§¨Æ·~¡A¸g¦æ¬F°|±M®×®Ö­ã«á¡A¤£¨ü¥ª¦C¦U¶µªk«ß±ø´Ú¤§­­¨î¡G<br> ¡@¡@¤@¡BÄq·~ªk²Ä¤­±ø²Ä¤@¶µ¡B²Ä¤T¶µ¦ý®Ñ¡A²Ä¤K±ø²Ä¤@¶µÃö©ó¤¤µØ¥Á°ê¤H¥Á¤§³W©w¤Î²Ä¥|¤Q¤T±ø²Ä¤G´Ú¡C<br> ¡@¡@¤G¡B¤g¦aªk²Ä¤Q¤C±ø²Ä¤C´Ú¡C<br> ¡@¡@¤T¡B²î²íªk²Ä¤G±ø²Ä¤T´Ú¥Ò¡B¤A¡B¤þ¡B¤B¦U¥Ø¤Î²Ä¥|´Ú¡C¦ý¹ï©ó¸gÀ示ªe¤Îªu®ü¯è¦æ¤§½ü²î¨Æ·~¡A©Î¤£¦X©ó¥»±ø¨Ò²Ä¥|±ø²Ä¤@´Ú¦@¦P¥X¸ê¤§¤è¦¡ªÌ¡A¤´¨ü­­¨î¡C<br> ¡@¡@¥|¡B¥Á¥Î¯èªÅªk²Ä¤G¤Q¤@±ø²Ä¤@¶µ²Ä¤T´Ú¥Ò¡B¤A¡B¤þ¡B¤B¥|¥Ø¤Î²Ä¤»¤Q¤G±ø¡A°£ªÑ¥÷¦³­­¤½¥q¡A¨äªÑ²¼§¡À³°O¦W¥~¤§¨ä¾l³W©w¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤Q¤E±ø</font> </font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@§ë¸ê¤H©Ò§ë¸ê¤§¨Æ·~¡A°£¥»±ø¨Ò©Ò³W©wªÌ¥~¡A»P¤¤µØ¥Á°ê°ê¥Á©Ò¸gÀ礧¦PÃþ¨Æ·~¡A¨ü¦Pµ¥«Ý¹J¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤G¤Q±ø</font> </font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@§ë¸ê¤H¹ï©ó¥»±ø¨Ò²Ä¤C±ø¡B²Ä¤Q±ø¡B²Ä¤Q¤T±ø©Î²Ä¤Q¥|±ø©Ò³W©w¤§¤å¥ó¡A¦³µê°°¤§±¡¨ÆªÌ¡A¨Ìªk³B»@¤§¡C<br> ¡@¡@§ë¸ê¤H¬°ªk¤H®É¡A«e¶µ³W©w©ó¨ä­t³d¤H¾A¥Î¤§¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤G¤Q¤@±ø</font> </font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@¥»±ø¨Ò¤§¬I¦æ°Ï°ì¡A¼È¥H»OÆW¬Ù¬°­­¡AÂX¼W®É¥Ñ¥ßªk°|¨Mij©w¤§¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤G¤Q¤G±ø</font> </font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@¥»±ø¨Ò¦Û¤½¥¬¤é¬I¦æ¡C<br> </td> </table> </table> </table> </left> </body> <!-- Mirrored from lis.ly.gov.tw/lghtml/lawstat/version2/01930/0193056122200.htm by HTTrack Website Copier/3.x [XR&CO'2010], Sun, 24 Mar 2013 09:16:38 GMT --> </html>
<?php namespace Lightworx\Component\Validator; class RangeValidator extends Validator { public $range; public $strict = false; public $allowEmpty = true; public $caseSensitive = true; public $matchInRange = true; public function validateAttribute($object,$attribute) { $value = $object->$attribute; if($this->allowEmpty && $this->isEmpty($value)) { return; } $function = 'in_array'; if($this->caseSensitive===false) { $function = "\Lightworx\Helper\ArrayHelper\iin_array"; } if(is_array($this->range) && $function($value,$this->range,$this->strict)!==$this->matchInRange) { $message = $this->message!==null?$this->message:'{attribute} is not in the list.'; $this->addError($object,$attribute,$message); } } }
<?php namespace Poirot\Std\Type; if (!class_exists('SplEnum', false)) { require_once __DIR__.'/fixes/NSplEnum.php'; class_alias('\Poirot\Std\Type\NSplEnum', 'SplEnum'); } class StdEnum extends \SplEnum { }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http: <html xmlns="http: <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Get-CaasRealServer &mdash; CaaS PowerShell 3.1 documentation</title> <link rel="stylesheet" href="_static/alabaster.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <script type="text/javascript"> var <API key> = { URL_ROOT: './', VERSION: '3.1', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </script> <script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/doctools.js"></script> <link rel="top" title="CaaS PowerShell 3.1 documentation" href="index.html" /> <link rel="stylesheet" href="_static/custom.css" type="text/css" /> <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" /> </head> <body role="document"> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body" role="main"> <div class="section" id="get-caasrealserver"> <h1>Get-CaasRealServer<a class="headerlink" href=" <div class="section" id="synopsis"> <h2>Synopsis<a class="headerlink" href=" <p>Get-CaasRealServer -Network &lt;<API key>&gt; [-Name &lt;string&gt;] [-Connection &lt;<API key>&gt;] [&lt;CommonParameters&gt;]</p> </div> <div class="section" id="syntax"> <h2>Syntax<a class="headerlink" href=" <div class="<API key>"><div class="highlight"><pre><span></span><span class="n">syntaxItem</span> </pre></div> </div> <hr class="docutils" /> <p><a class="reference external" href="mailto:{&#37;&#52;&#48;{name=Get-CaasRealServer">{<span>&#64;</span>{name=Get-CaasRealServer</a>; CommonParameters=True; <API key>=False; parameter=System.Object[]}}</p> </div> <div class="section" id="description"> <h2>Description<a class="headerlink" href=" </div> <div class="section" id="parameters"> <h2>Parameters<a class="headerlink" href=" <div class="section" id="<API key>"> <h3>-Connection &lt;<API key>&gt;<a class="headerlink" href=" <p>The CaaS Connection created by New-CaasConnection</p> <div class="<API key>"><div class="highlight"><pre><span></span><span class="k">Position</span><span class="p">?</span> <span class="n">Named</span> </pre></div> </div> <p>Accept pipeline input? true (ByPropertyName) Parameter set name (All) Aliases None Dynamic? false</p> </div> <div class="section" id="name-string"> <h3>-Name &lt;string&gt;<a class="headerlink" href=" <p>The name for the real server</p> <div class="<API key>"><div class="highlight"><pre><span></span><span class="k">Position</span><span class="p">?</span> <span class="n">Named</span> </pre></div> </div> <p>Accept pipeline input? false Parameter set name (All) Aliases None Dynamic? false</p> </div> <div class="section" id="netwo<API key>"> <h3>-Network &lt;<API key>&gt;<a class="headerlink" href=" <p>The network to manage the VIP settings</p> <div class="<API key>"><div class="highlight"><pre><span></span><span class="k">Position</span><span class="p">?</span> <span class="n">Named</span> </pre></div> </div> <p>Accept pipeline input? true (ByValue) Parameter set name (All) Aliases None Dynamic? false</p> </div> </div> <div class="section" id="inputs"> <h2>INPUTS<a class="headerlink" href=" <p>DD.CBU.Compute.Api.Contracts.Network.<API key> DD.CBU.Compute.Powershell.<API key></p> </div> <div class="section" id="outputs"> <h2>OUTPUTS<a class="headerlink" href=" <p>DD.CBU.Compute.Api.Contracts.Vip.RealServer</p> </div> <div class="section" id="notes"> <h2>NOTES<a class="headerlink" href=" </div> <div class="section" id="examples"> <h2>EXAMPLES<a class="headerlink" href=" </div> </div> </div> </div> </div> <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> <div class="<API key>"> <h3><a href="index.html">Table Of Contents</a></h3> <ul> <li><a class="reference internal" href="#">Get-CaasRealServer</a><ul> <li><a class="reference internal" href="#synopsis">Synopsis</a></li> <li><a class="reference internal" href="#syntax">Syntax</a></li> <li><a class="reference internal" href="#description">Description</a></li> <li><a class="reference internal" href="#parameters">Parameters</a><ul> <li><a class="reference internal" href="#<API key>">-Connection &lt;<API key>&gt;</a></li> <li><a class="reference internal" href="#name-string">-Name &lt;string&gt;</a></li> <li><a class="reference internal" href="#netwo<API key>">-Network &lt;<API key>&gt;</a></li> </ul> </li> <li><a class="reference internal" href="#inputs">INPUTS</a></li> <li><a class="reference internal" href="#outputs">OUTPUTS</a></li> <li><a class="reference internal" href="#notes">NOTES</a></li> <li><a class="reference internal" href="#examples">EXAMPLES</a></li> </ul> </li> </ul> <div class="relations"> <h3>Related Topics</h3> <ul> <li><a href="index.html">Documentation overview</a><ul> </ul></li> </ul> </div> <div role="note" aria-label="source link"> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="_sources/Get-CaasRealServer.txt" rel="nofollow">Show Source</a></li> </ul> </div> <div id="searchbox" style="display: none" role="search"> <h3>Quick search</h3> <form class="search" action="search.html" method="get"> <input type="text" name="q" /> <input type="submit" value="Go" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> <p class="searchtip" style="font-size: 90%"> Enter search terms or a module, class or function name. </p> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <div class="clearer"></div> </div> <div class="footer"> &copy;2016, Dimension Data. | Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a> &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a> | <a href="_sources/Get-CaasRealServer.txt" rel="nofollow">Page source</a> </div> </body> </html>
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = markEvents; var _events = require('./events'); var _events2 = <API key>(_events); function <API key>(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * Cleans up events' reindexing helper properties. * * @param {number} streamId */ function markEvents(streamId) { for (var topicName in _events2.default) { if (_events2.default.hasOwnProperty(topicName)) { for (var i = 0; i < _events2.default[topicName].length; i++) { if (streamId === _events2.default[topicName][i].streamId) { _events2.default[topicName][i].isNewlyInserted = false; _events2.default[topicName][i].isReindexed = {}; } } } } }
<?php /** * Base class for Spools (implements time and message limits). * * @author Fabien Potencier */ abstract class <API key> implements Swift_Spool{ /** The maximum number of messages to send per flush */ private $_message_limit; /** The time limit per flush */ private $_time_limit; /** * Sets the maximum number of messages to send per flush. * * @param int $limit */ public function setMessageLimit($limit) { $this->_message_limit = (int) $limit; } /** * Gets the maximum number of messages to send per flush. * * @return int The limit */ public function getMessageLimit() { return $this->_message_limit; } /** * Sets the time limit (in seconds) per flush. * * @param int $limit The limit */ public function setTimeLimit($limit) { $this->_time_limit = (int) $limit; } /** * Gets the time limit (in seconds) per flush. * * @return int The limit */ public function getTimeLimit() { return $this->_time_limit; } }
#ifndef <API key> #define <API key> #include <consensus/consensus.h> #include <policy/feerate.h> #include <script/interpreter.h> #include <script/standard.h> #include <string> class CCoinsViewCache; class CTxOut; /** Default for -blockmaxsize, which controls the maximum size of block the mining code will create **/ static const unsigned int <API key> = 1000000; /** Default for -blockmaxweight, which controls the range of block weights the mining code will create **/ static const unsigned int <API key> = MAX_BLOCK_WEIGHT - 4000; static const unsigned int <API key> = 1000; /** The maximum weight for transactions we're willing to relay/mine */ static const unsigned int <API key> = 400000; /** The minimum non-witness size for transactions we're willing to relay/mine (1 segwit input + 1 P2WPKH output = 82 bytes) */ static const unsigned int <API key> = 82; static const unsigned int <API key> = 81; /** Maximum number of signature check operations in an IsStandard() P2SH script */ static const unsigned int MAX_P2SH_SIGOPS = 15; /** The maximum number of sigops we're willing to relay/mine in a single tx */ static const unsigned int <API key> = <API key>/5; /** Default for -maxmempool, maximum megabytes of mempool memory usage */ static const unsigned int <API key> = 300; /** Default for -incrementalrelayfee, which sets the minimum feerate increase for mempool limiting or BIP 125 replacement **/ static const unsigned int <API key> = 1000; /** Default for -bytespersigop */ static const unsigned int <API key> = 20; /** Default for -permitbaremultisig */ static const bool <API key> = true; /** The maximum number of witness stack items in a standard P2WSH script */ static const unsigned int <API key> = 100; /** The maximum size in bytes of each witness stack item in a standard P2WSH script */ static const unsigned int <API key> = 80; /** The maximum size in bytes of each witness stack item in a standard BIP 342 script (Taproot, leaf version 0xc0) */ static const unsigned int <API key> = 80; /** The maximum size in bytes of a standard witnessScript */ static const unsigned int <API key> = 3600; /** The maximum size of a standard ScriptSig */ static const unsigned int <API key> = 1650; /** Min feerate for defining dust. Historically this has been based on the * minRelayTxFee, however changing the dust limit changes which transactions are * standard and should be done with care and ideally rarely. It makes sense to * only increase the dust limit after prior releases were already not creating * outputs below the new threshold */ static const unsigned int DUST_RELAY_TX_FEE = 3000; /** * Standard script verification flags that standard transactions will comply * with. However scripts violating these flags may still be present in valid * blocks and we must accept those blocks. */ static constexpr unsigned int <API key> = <API key> | <API key> | <API key> | <API key> | <API key> | <API key> | <API key> | <API key> | <API key> | <API key> | <API key> | SCRIPT_VERIFY_LOW_S | <API key> | <API key> | <API key> | <API key> | <API key> | <API key> | <API key> | <API key>; /** For convenience, standard but not mandatory verify flags. */ static constexpr unsigned int <API key> = <API key> & ~<API key>; /** Used as the flags parameter to sequence and nLocktime checks in non-consensus code. */ static constexpr unsigned int <API key> = <API key> | <API key>; CAmount GetDustThreshold(const CTxOut& txout, const CFeeRate& dustRelayFee); bool IsDust(const CTxOut& txout, const CFeeRate& dustRelayFee); CAmount GetDustThreshold(const CTxOutStandard *txout, const CFeeRate& dustRelayFeeIn); bool IsDust(const CTxOutBase *txout, const CFeeRate& dustRelayFee); bool IsStandard(const CScript& scriptPubKey, TxoutType& whichType, int64_t time=0); // Changing the default transaction version requires a two step process: first // adapting relay policy by bumping <API key>, and then later // allowing the new transaction version in the wallet/RPC. static constexpr decltype(CTransaction::nVersion) <API key>{2}; static constexpr decltype(CTransaction::nVersion) <API key>{0xA1}; /** * Check for standard transaction types * @return True if all outputs (scriptPubKeys) use only standard transaction forms */ bool IsStandardTx(const CTransaction& tx, bool <API key>, const CFeeRate& dust_relay_fee, std::string& reason, int64_t time=0); /** * Check for standard transaction types * @param[in] mapInputs Map of previous transactions that have outputs we're spending * @param[in] taproot_active Whether or taproot consensus rules are active (used to decide whether spends of them are permitted) * @return True if all inputs (scriptSigs) use only standard transaction forms */ bool AreInputsStandard(const CTransaction& tx, const CCoinsViewCache& mapInputs, bool taproot_active, int64_t time=0); /** * Check if the transaction is over standard P2WSH resources limit: * 3600bytes witnessScript size, 80bytes per witness stack element, 100 witness stack elements * These limits are adequate for multisignatures up to n-of-100 using OP_CHECKSIG, OP_ADD, and OP_EQUAL. * * Also enforce a maximum stack item size limit and no annexes for tapscript spends. */ bool IsWitnessStandard(const CTransaction& tx, const CCoinsViewCache& mapInputs); /** Compute the virtual transaction size (weight reinterpreted as bytes). */ int64_t <API key>(int64_t nWeight, int64_t nSigOpCost, unsigned int bytes_per_sigop); int64_t <API key>(const CTransaction& tx, int64_t nSigOpCost, unsigned int bytes_per_sigop); int64_t <API key>(const CTxIn& tx, int64_t nSigOpCost, unsigned int bytes_per_sigop); static inline int64_t <API key>(const CTransaction& tx) { return <API key>(tx, 0, 0); } static inline int64_t <API key>(const CTxIn& tx) { return <API key>(tx, 0, 0); } #endif // <API key>
module MigrationsSpecData <API key> = {:domain_status=>{:<API key>=>0, :search_service=>{:arn=>"arn:aws:cs:us-east-1:888167492042:search/beavis"}, :num_searchable_docs=>0, :created=>true, :domain_id=>"888167492042/beavis", :processing=>false, :<API key>=>0, :domain_name=>"beavis", :<API key>=>false, :deleted=>false, :doc_service=>{:arn=>"arn:aws:cs:us-east-1:888167492042:doc/beavis"}}, :response_metadata=>{:request_id=>"<API key>"}} <API key> = {:index_field=>{:status=>{:creation_date=>'2013-07-30 20:47:55 UTC', :pending_deletion=>"false", :update_version=>20, :state=>"<API key>", :update_date=>'2013-07-30 20:47:55 UTC'}, :options=>{:source_attributes=>[], :literal_options=>{:search_enabled=>false}, :index_field_type=>"literal", :index_field_name=>"test"}}, :response_metadata=>{:request_id=>"<API key>"}} <API key> = {:index_field=>{:status=>{:creation_date=>'2013-07-30 20:47:55 UTC', :pending_deletion=>"false", :update_version=>20, :state=>"<API key>", :update_date=>'2013-07-30 20:47:55 UTC'}, :options=>{:source_attributes=>[], :text_options=>{:result_enabled=>true}, :index_field_type=>"text", :index_field_name=>"test"}}, :response_metadata=>{:request_id=>"<API key>"}} <API key> = {:index_field=>{:status=>{:creation_date=>'2013-07-30 20:47:55 UTC', :pending_deletion=>"false", :update_version=>20, :state=>"<API key>", :update_date=>'2013-07-30 20:47:55 UTC'}, :options=>{:source_attributes=>[], :index_field_type=>"uint", :index_field_name=>"num_tvs"}}, :response_metadata=>{:request_id=>"<API key>"}} end
<!DOCTYPE html> <html> <head lang="de"> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link href="google-fonts.css" rel="stylesheet"> <link rel="stylesheet" href="normalize.css"> <link href="lib/nv.d3.css" rel="stylesheet" type="text/css"> <link rel="stylesheet" href="styles.css"> <title>mobx</title> </head> <body> <div id="mount"></div> </body> <script src="dist/main.js"></script> </html>
const GameAction = require('./GameAction'); class PlaceToken extends GameAction { constructor() { super('placeToken'); } canChangeGameState({ card, amount = 1 }) { return ['active plot', 'agenda', 'play area', 'shadows', 'title'].includes(card.location) && amount > 0; } createEvent({ card, token, amount = 1 }) { return this.event('onTokenPlaced', { card, token, amount, desiredAmount: amount }, event => { event.card.modifyToken(event.token, event.amount); }); } } module.exports = new PlaceToken();
require_relative 'smell_detector' require_relative 'smell_warning' module Reek module Smells # Excerpt from: # since this sums it up really well: # The ! in method names that end with ! means, "This method is dangerous" # -- or, more precisely, this method is the "dangerous" version of an # equivalent method, with the same name minus the !. "Danger" is # relative; the ! doesn't mean anything at all unless the method name # it's in corresponds to a similar but bang-less method name. # Don't add ! to your destructive (receiver-changing) methods' names, # unless you consider the changing to be "dangerous" and you have a # "non-dangerous" equivalent method without the !. If some arbitrary # subset of destructive methods end with !, then the whole point of ! # gets distorted and diluted, and ! ceases to convey any information # whatsoever. # Such a method is called PrimaDonnaMethod and is reported as a smell. # See {file:docs/Prima-Donna-Method.md} for details. class PrimaDonnaMethod < SmellDetector def self.contexts # :nodoc: [:class] end def inspect(ctx) ctx.<API key>.map do |method_sexp| check_for_smells(method_sexp, ctx) end.compact end private # :reek:FeatureEnvy def check_for_smells(method_sexp, ctx) return unless method_sexp.ends_with_bang? <API key> = ctx.<API key>.find do |sexp_item| sexp_item.name.to_s == method_sexp.name_without_bang end return if <API key> smell_warning( context: ctx, lines: [ctx.exp.line], message: "has prima donna method `#{method_sexp.name}`") end end end end
<?php namespace LibreEHR\FHIR\Http\Controllers\Auth\Traits; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Lang; trait AuthenticatesUsers { use RedirectsUsers, ThrottlesLogins; /** * Show the application's login form. * * @return \Illuminate\Http\Response */ public function showLoginForm() { return view('auth.login'); } /** * Handle a login request to the application. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function login(Request $request) { $this->validateLogin($request); // If the class is using the ThrottlesLogins trait, we can automatically throttle // the login attempts for this application. We'll key this by the username and // the IP address of the client making these requests into this application. if ($lockedOut = $this-><API key>($request)) { $this->fireLockoutEvent($request); return $this->sendLockoutResponse($request); } $credentials = $this->credentials($request); if ($this->guard()->attempt($credentials, $request->has('remember'))) { return $this->sendLoginResponse($request); } // If the login attempt was unsuccessful we will increment the number of attempts // to login and redirect the user back to the login form. Of course, when this // user surpasses their maximum number of attempts they will get locked out. if (! $lockedOut) { $this-><API key>($request); } return $this-><API key>($request); } /** * Validate the user login request. * * @param \Illuminate\Http\Request $request * @return void */ protected function validateLogin(Request $request) { $this->validate($request, [ $this->username() => 'required', 'password' => 'required', ]); } /** * Get the needed authorization credentials from the request. * * @param \Illuminate\Http\Request $request * @return array */ protected function credentials(Request $request) { return $request->only($this->username(), 'password'); } /** * Send the response after the user was authenticated. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ protected function sendLoginResponse(Request $request) { $request->session()->regenerate(); $this->clearLoginAttempts($request); return $this->authenticated($request, $this->guard()->user()) ?: redirect()->intended($this->redirectPath()); } /** * The user has been authenticated. * * @param \Illuminate\Http\Request $request * @param mixed $user * @return mixed */ protected function authenticated(Request $request, $user) { } /** * Get the failed login response instance. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ protected function <API key>(Request $request) { return redirect()->back() ->withInput($request->only($this->username(), 'remember')) ->withErrors([ $this->username() => Lang::get('auth.failed'), ]); } /** * Get the login username to be used by the controller. * * @return string */ public function username() { return 'email'; } /** * Log the user out of the application. * * @param Request $request * @return \Illuminate\Http\Response */ public function logout(Request $request) { $this->guard()->logout(); $request->session()->flush(); $request->session()->regenerate(); return redirect('/'); } /** * Get the guard to be used during authentication. * * @return \Illuminate\Contracts\Auth\StatefulGuard */ protected function guard() { return Auth::guard(); } }
// ViewController.h // <API key> #import <UIKit/UIKit.h> @interface ViewController : UIViewController @end
import pymel.core as pm def <API key>(face): cur_sel = pm.select(face,r=1) if cur_sel and len(cur_sel) == 1 and cur_sel.split(: pm.mel.eval("setToolTo Move;") piv = pm.manipMoveContext("Move",q=1,p=1) mesh = pm.listRelatives(pm.listRelatives(face,p=1)[0],p=1) vtx = pm.ls(pm.<API key>(face,tv=1),fl=1) if len(vtx)>=3: planeA = pm.polyPlane(w=1,h=1,sx=1,sy=1,ax=[0,1,0],cuv=2,ch=1,n="rotationPlaneA")[0] pm.select("{0}.vtx[0:2]".format(planeA),vtx[0:3],r=1) pm.mel.eval("<API key>(0);") pm.parent(mesh,planeA) pm.xform(planeA,ws=1,piv=(piv[0],piv[1],piv[2])) cur_plane_pos = pm.xform(planeA,q=True,ws=True,piv=True)[0:3] cur_plane_rot = pm.xform(planeA,q=True,ws=True,ro=True) pm.parent(mesh,w=1) pm.select(mesh,planeA,r=1) pm.makeIdentity(a=1,t=1,r=0,s=0,n=0) pm.parent(mesh,planeA) pm.xform(planeA,ws=True,t=(-cur_plane_pos[0],-cur_plane_pos[1],-cur_plane_pos[2]),ro=(0,0,0)) pm.parent(mesh,w=1) pm.select(mesh,planeA,r=1) pm.makeIdentity(a=1,t=1,r=1,s=0,n=0) pm.parent(mesh,planeA) pm.xform(planeA,ws=True,t=(cur_plane_pos[0],cur_plane_pos[1],cur_plane_pos[2]),ro=(cur_plane_rot[0],cur_plane_rot[1],cur_plane_rot[2])) pm.xform(mesh,ws=1,piv=(piv[0],piv[1],piv[2])) pm.parent(mesh,w=1) pm.delete(planeA) def get_selection(): get_sel = pm.ls(sl=1) <API key>(get_sel) for x in pm.ls(os=1,fl=1): face="{0}.f[154]".format(x) <API key>(face)
package org.trifort.rootbeer.testcases.rootbeertest.baseconversion; import java.util.ArrayList; import java.util.List; import org.trifort.rootbeer.runtime.Kernel; import org.trifort.rootbeer.test.TestSerialization; public class BaseConversionTest implements TestSerialization { @Override public List<Kernel> create() { List<Kernel> jobs = new ArrayList<Kernel>(); int job_size = 5000000; int count = 1221; for(int i = 0; i < job_size; i += count){ <API key> curr = new <API key>(i, count); jobs.add(curr); } return jobs; } @Override public boolean compare(Kernel lhs, Kernel rhs) { <API key> blhs = (<API key>) lhs; <API key> brhs = (<API key>) rhs; if(blhs.getRet() == null){ System.out.println("blhs.getRet() == nill"); return false; } if(brhs.getRet() == null){ System.out.println("brhs.getRet() == nill"); return false; } for(int j = 0; j < blhs.getRet().size(); ++j){ IntList lhs_list = (IntList) blhs.getRet().get(j); IntList rhs_list = (IntList) brhs.getRet().get(j); for(int i = 0; i < lhs_list.size(); ++i){ int lhs_value = lhs_list.get(i); int rhs_value = rhs_list.get(i); if(lhs_value != rhs_value){ System.out.println("i: "+i+" lhs: "+lhs_value+" rhs: "+rhs_value); return false; } } } return true; } }
package de.uni_koeln.phil_fak.spinfo.javamobile.picman.activity.util; import android.content.Context; import android.os.Environment; import java.io.File; public class StorageManager { private static StorageManager instance; private StorageManager() { // Utility class. } public static StorageManager getInstance() { if(instance == null) instance = new StorageManager(); return instance; } public File <API key>(){ File dir = new File(Environment.<API key>( Environment.DIRECTORY_PICTURES), "PicMan"); if (!dir.exists()) dir.mkdirs(); return dir; } public File <API key>(Context context ){ File dir = new File(context.getExternalFilesDir(null), "PicMan"); if (!dir.exists()) dir.mkdirs(); return dir; } public boolean isStorageAvailable(){ if (Environment.<API key>().equals(Environment.MEDIA_MOUNTED)){ return true; } return false; } }
// by DotNetNuke Corporation // documentation files (the "Software"), to deal in the Software without restriction, including without limitation // to permit persons to whom the Software is furnished to do so, subject to the following conditions: // of the Software. // TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings using Telerik.Web.UI; #endregion namespace DotNetNuke.Web.UI.WebControls { public class DnnTickerItem : RadTickerItem { public DnnTickerItem() { } public DnnTickerItem(string text) : base(text) { } public DnnTickerItem(string text, string navigateUrl) : base(text, navigateUrl) { } } }
'use strict'; /** * Module dependencies. */ var _ = require('lodash'), defaultAssets = require('./config/assets/default'), testAssets = require('./config/assets/test'); // Karma configuration module.exports = function(karmaConfig) { karmaConfig.set({ // Frameworks to use frameworks: ['jasmine'], // List of files / patterns to load in the browser files: _.union(defaultAssets.client.lib.js, defaultAssets.client.lib.tests, defaultAssets.client.js, testAssets.tests.client), // Test results reporter to use // Possible values: 'dots', 'progress', 'junit', 'growl', 'coverage' reporters: ['progress'], // Web server port port: 9876, // Enable / disable colors in the output (reporters and logs) colors: true, // Level of logging // Possible values: karmaConfig.LOG_DISABLE || karmaConfig.LOG_ERROR || karmaConfig.LOG_WARN || karmaConfig.LOG_INFO || karmaConfig.LOG_DEBUG logLevel: karmaConfig.LOG_INFO, // Enable / disable watching file and executing tests whenever any file changes autoWatch: true, // Start these browsers, currently available: // - Chrome // - ChromeCanary // - Firefox // - Opera // - Safari (only Mac) // - PhantomJS // - IE (only Windows) browsers: ['PhantomJS'], // If browser does not capture in given timeout [ms], kill it captureTimeout: 60000, // Continuous Integration mode // If true, it capture browsers, run tests and exit singleRun: true }); };
# Next - [FEATURE] Geometry support for postgres - [BUG] Fix wrong count for `findAndCountAll` with required includes [ - [BUG] Fix problems related to parsing of unique constraint errors [ - [BUG] Fix postgres path variable being surrounded by quotes to often in unique constraint errors [ - [BUG] Fix `removeAttributes(id)` not setting `this.primaryKeys` to null - [BUG] Run validations on the through model during add, set and create for `belongsToMany` # 3.3.2 - [FIXED] upsert no longer updates with default values each time [ # 3.3.1 - [FIXED] regression in `attributes` support for 'reload' [ # 3.3.0 - [FIXED] Fix `Promise#nodeify()` and `Promise#done()` not passing CLS context - [FIXED] Creating and dropping enums in transaction, only for PostgreSQL [ - [FIXED] $or/$and inside a where clause always expects the input to be an array [ - [ADDED] Unique constraints may now include custom error messages - [ADDED] It's possible now to remove a hook by name - [ADDED] Hook name can be passed via the direct method [ # 3.2.0 - [FEATURE] Add support for new option `targetKey` in a belongs-to relationship for situations where the target key is not the id field. - [FEATURE] Add support for keyword `after` in options of a field (useful for migrations), only for MySQL. [ - [FEATURE] There's a new sequelize.truncate function to truncate all tables defined through the sequelize models [ - [FEATURE] Add support for MySQLs TINYTEXT, MEDIUMTEXT and LONGTEXT. [ - [FEATURE] Provide warnings if you misuse data types. [ - [FIXED] Fix a case where Postgres arrays containing JSONB type was being generated as JSON type. - [FIXED] Fix a case where `type` in `sequelize.query` was not being set to raw. [ - [FIXED] Fix an issue where include all was not being properly expanded for self-references [ - [FIXED] Fix instance.changed regression to not return false negatives for not changed null values [ - [FIXED] Fix isEmail validator to allow args: true [ - [FIXED] Fix all occasions where `options.logging` was not used correctly [ - [FIXED] Fix `Model#destroy()` to correctly use `options.transaction` - [FIXED] Fix `QueryInterface#showIndex()` to correctly pass on `options.transaction` # 3.1.1 - [FIXED] Always quote aliases, even when quoteIdentifiers is false [ - [FIXED] No longer clones Instances in model finder options - [FIXED] Fix regression in util.toDefaultValue not returning the data types [ # 3.1.0 - [ADDED] It is now possible to defer constraints in PostgreSQL by added a property `deferrable` to the `references` object of a field. - [FIXED] Fix an issue with the build in isIP validator returning false negatives [ # 3.0.1 - [FIXED] `include.attributes = []` will no longer force the inclusion of the primary key, making it possible to write aggregates with includes. - [CHANGED] The `references` property of model attributes has been transformed to an object: `{type: Sequelize.INTEGER, references: { model: SomeModel, key: 'some_key' }}`. The former format (`references` and `referecesKey`) still exists but is deprecated and will be removed in 4.0. # 3.0.0 3.0.0 cleans up a lot of deprecated code, making it easier for us to develop and maintain features in the future. - [ADDED] findById / findByPrimary takes a single value as argument representing the primary key to find. - [CHANGED] belongsToMany relations MUST now be given a `through` argument. - [CHANGED] findOne / findAll / findAndCount / findOrCreate now only takes a single options argument instead of a options and queryOptions argument. So set transaction, raw, etc on the first options argument. - [CHANGED] The accessor for belongsToMany relationships is now either the `as` argument or the target model name pluralized. - [REMOVED] N:M relationships can no longer be represented by 2 x hasMany - [REMOVED] Model.create / Model.bulkCreate / Instance.save no longer takes an array of fields as its second argument, use `options.fields` instead. - [REMOVED] Query Chainer has been removed - [REMOVED] Migrations have been removed, use umzug instead - [REMOVED] Model.findAllJoin has been removed - [REMOVED] sequelize.query now only takes `sql and options` as arguments, the second and fourth argument `callee` and `replacements` have been removed and should be set via `options.instance` / `options.model` and `options.replacements` instead. - [REMOVED] `instance.isDirty` has been removed, use `instance.changed()` instead - [REMOVED] `instance.values` has been removed, use `instance.get()` instead - [REMOVED] `instance.primaryKeyValues` has been removed. - [REMOVED] `instance.identifiers` has been removed, use `instance.where()` instead - [REMOVED] `instance.isDeleted` has been removed, simply check the timestamp with `get('deletedAt')` instead - [REMOVED] `instance.increment/decrement` now longer takes a number as it's second argument. - [REMOVED/SECURITY] findOne no longer takes a string / integer / binary argument to represent a primaryKey. Use findById instead - [REMOVED/SECURITY] `where: "raw query"` is no longer legal, you must now explicitely use `where: ["raw query", [replacements]]` - [BUG] Fix showIndexQuery so appropriate indexes are returned when a schema is used - [BUG] Fix addIndexQuery error when the model has a schema - [BUG] Fix app crash in sqlite while running in special unique constraint errors [ - [BUG] Fix bulkCreate: do not insert NULL for undefined values [ - [BUG] Fix trying to roll back a comitted transaction if an error occured while comitting resulting in an unhandled rejection [ - [BUG] Fix regression in beforeUpdate hook where `instance.changed()` would always be false [ - [BUG] Fix trying to roll back a comitted transaction if an error occured while comitting # Backwards compatibility changes - Most of the changes in 3.0.0 are BC breaking, read the changelog for 3.0.0 carefully. - The error that is thrown when a column is declared to be an enum but without any values used to "Values for ENUM haven't been defined" and is now "Values for ENUM have not been defined". # 2.1.3 - [BUG] Fix regression introduced in 2.1.2: updatedAt not set anymore [ - [BUG] Fix managed transactions not rolling back if no thenable was provided in the transaction block [ # 2.1.2 - [BUG] `Model.create()/update()` no longer attempts to save undefined fields. # 2.1.1 - [BUG] .get() now passes along options correctly when using a custom getter - [BUG] Fix managed transactions not rolling back if an error occured the transaction block [ - [BUG] Fix a node-webkit issue [ - [FEATURE] Lock modes in Postgres now support `OF table` - [FEATURE] New transaction lock modes `FOR KEY SHARE` and `NO KEY UPDATE` for Postgres 9.3+ - [FEATURE/REFACTOR] Rewritten scopes with complete support for includes and scopes across associations # 2.1.0 - [BUG] Enable standards conforming strings on connection in postgres. Adresses [ - [BUG] instance.removeAssociation(s) do not fire the select query twice anymore - [BUG] Error messages thrown by the db in languages other than english do not crash the app anymore (mysql, mariadb and postgres only) [ - [FEATURE] [JSONB](https://github.com/sequelize/sequelize/issues/3471) - [FEATURE] All querys can be logged individually by inserting `logging: fn` in the query option. - [FEATURE] Partial index support for Postgres with `index.where` - [REFACTOR] `.changed()` now works proactively by setting a flag on `set` instead of matching reactively. Note that objects and arrays will not be checked for equality on set and will always result in a change if they are `set`. - [DEPRECATED] The query-chainer is deprecated and will be removed in version 2.2. Please use promises instead. - [REMOVED] Events are no longer supported. - [INTERNALS] Updated dependencies. + bluebird@2.9.24 # Backwards compatibility changes - Events support have been removed so using `.on('success')` or `.success()` is no longer supported. Try using `.then()` instead. - Trying to apply a scope that does not exist will always throw an error # 2.0.6 - [BUG] Don't update virtual attributes in Model.update. Fixes [ - [BUG] Fix for newlines in hstore [ - [BUG] Fix unique key handling in Model.update [ - [BUG] Fix issue with Model.create() using fields not specifying and non-incremental primary key [ - [FEATURE] `field` support for Model.update [ - [INTERNALS] Updated dependencies. Most notably we are moving up one major version on lodash. If you are using `sequelize.Utils._`, notice that the semantics for many matching functions have changed to include a check for `hasOwnProperty` + dottie@0.3.1 + inflection@1.6.0 + lodash@3.5.0 + validator@3.34 + generic-pool@2.2.0 - [INTERNALS] Updated devDependencies. + coffee-script@1.9.1 + dox@0.7.1 + mysql@2.6.2 # 2.0.5 - [FEATURE] Highly experimental support for nested creation [ # 2.0.4 - [BUG] Fixed support for 2 x belongsToMany without foreignKey defined and association getter/adder [ - [BUG] No longer throws on `Model.hasHook()` if no hooks are defiend [ - [BUG] Fixed issue with `{$and: []}` - [BUG] Fixed issue with N:M relations with primary keys with field defined # 2.0.3 - [BUG] Support for plain strings, ints and bools on JSON insert - [BUG] Fixed regression where `{$in: []}` would result in `IN ()` rather than `IN (NULL)` [ - [BUG] Fixed bug where 2 x `belongsToMany` with `foreignKey` but no `otherKey` defined would result in 3 keys instead of 2. [ - [BUG] Fixed regression with `where: sequelize.json()` [ - [BUG] Fixed support for `field` with `$or`/`$and` [ # 2.0.2 - [BUG] Fixed regression with `DataTypes.ARRAY(DataTypes.STRING(length))` [ - [BUG] Fixed regression where `.or([{key: value}, {key: value, key2: value}])` would result in 3 `A OR B OR C` rather than `A OR (B AND C)` [ - [BUG] Fixed regression with `DataTypes.DECIMAL(10)` resulting in `10, undefined` [ - [BUG] Fixed issue with dangling `WHERE ` query on `Model.update(values, {where: {}})` [ # 2.0.1 - [BUG] Fixed issue with empty `include.where` - [BUG] Fixed issue with otherKey generation for self-association N:M # 2.0.0 - [BUG] Fixed `field` support for `increment` and `decrement`. - [FEATURE/BUG] Raw queries always return all results (including affected rows etc). This means you should change all promise listeners on `sequelize.query` to use `.spread` instead of `.then`, unless you are passing a query type. - [BUG] Support for composite primary keys in upsert [ - [BUG] Support for `field` in upsert - [FEATURE] Support for setting an initial autoincrement option in mysql [ - [FEATURE] Test coverage for Node.js 0.12 and io.js 1.x # Backwards compatibility changes - The default query type for `sequelize.query` is now `RAW` - this means that two arguments (results and metadata) will be returned by default and you should use `.spread` - The 4th argument to `sequelize.query` has been deprecated in favor of `options.replacements` # 2.0.0-rc8 - [FEATURE] CLS Support. CLS is also used to automatically pass the transaction to any calls within the callback chain when using `sequelize.transaction(function() ...`. - [BUG] Fixed issue with paranoid deletes and `deletedAt` with a custom field. - [BUG] No longer crahes on `where: []` - [FEATURE] Validations are now enabled by default for upsert. - [FEATURE] Preliminary support for `include.through.where` - [SECURITY/BUG] Fixed injection issue in direction param for order # 2.0.0-rc7 - [FEATURE] Throw an error if no where clause is given to `Model.destroy()`. - [BUG] Fixed issue with `order: sequelize.literal('string')` - [FEATURE] add `clone: true` support to `.get()`. Is needed when using `delete` on values from a `.get()` (`toJSON()`, `this.values`). (.get() is just a reference to the values for performance reasons when there's no custom getters or includes) - [FEATURE] add `sequelize.escape(value)` convenience method - [BUG] Fixes crash with `findAll({include: [Model], order: sequelize.literal()})` - [FEATURE] Now possible to pass `createdAt` and `updatedAt` values to `Model.create`/`Model.bulkCreate` when using silent: true (when importing datasets with existing timestamps) - [FEATURE] `instance.update()` using default fields will now automatically also save and validate values provided via `beforeUpdate` hooks - [BUG] Fixed bad SQL when updating a JSON attribute with a different `field` - [BUG] Fixed issue with creating and updating values of a `DataTypes.ARRAY(DataTypes.JSON)` attribute - [BUG] `Model.bulkCreate([{}], {returning: true})` will now correctly result in instances with primary key values. - [BUG] `instance.save()` with `fields: []` (as a result of `.changed()` being `[]`) will no result in a noop instead of an empty update query. - [BUG] Fixed case where `findOrCreate` could return `[null, true]` when given a `defaults` value that triggered a unique constraint error. # Backwards compatibility changes - `instance.update()` using default fields will now automatically also save and validate values provided via `beforeUpdate` hooks - Sequelize no longer supports case insensitive mysql enums - `pg-hstore` has been moved to a devDependency, Postgres users will have to install `pg-hstore` manually alongside `pg`: `$ npm install pg pg-hstore` # 2.0.0-rc6 - [BUG] Fixed issue with including by association reference and where # 2.0.0-rc5 - [BUG] Fixed issue with subquery creating `include.where` and a paranoid main model.#2749/#2769 - <API key> will now extend from ValidationError making it possible to catch both with `.catch(ValidationError)` - [FEATURE] Adds `{save: false}` for belongsTo relationship setters. `user.setOrganization(organization, {save: false})` will then only set the foreign key value, but not trigger a save on `user`. - [FEATURE] When updating an instance `_previousDataValues` will now be updated after `afterUpdate` hooks have been run rather than before allowing you to use `changed` in `afterUpdate` - [BUG] Sequelize will no longer fail on a postgres constraint error not defined by Sequelize - [FEATURE] It's now possible to pass an association reference to include. `var Owner = Company.belongsTo(User, {as: 'owner'}; Company.findOne({include: [Owner]});` # Backwards compatibility changes - When updating an instance `_previousDataValues` will now be updated after `afterUpdate` hooks have been run rather than before allowing you to use `changed` in `afterUpdate` # 2.0.0-rc4 - [INTERNALS] Update `inflection` dependency to v1.5.3 - [FEATURE] Replaced string error messages for connection errors with error objects. [ - [FEATURE] Support for updating fields on duplicate key in bulk update (mysql only) [ - [FEATURE] Basic support for Microsoft SQL Server - [INTERNALS] Deprecate migration logic. This is now implemented in [umzug](https: - [BUG] Fixed various inconsistencies with `Instance.update` and how it behaves together with `create`, `fields` and more. - [BUG] Fixed crash/bug when using `include.where` together with `association.scope` - [BUG] Fixed support for `Instance.destroy()` and `field` for postgres. # Backwards compatibility changes - Some of the string error messages for connection errors have been replaced with actual error instances. Checking for connection errors should now be more consistent. # 2.0.0-rc3 - [FEATURE] Added the possibility of removing multiple associations in 1 call [ - [FEATURE] Undestroy method for paranoid models [ - [FEATURE] Support for UPSERT - [BUG] Add support for `field` named the same as the attribute in `reload`, `bulkCreate` and `save` [ - [BUG] Copy the options object in association getters. [ - [BUG] `Model#destroy()` now supports `field`, this also fixes an issue with `N:M#removeAssociation` and `field` - [BUG] Customized error message can now be set for unique constraint that was created manually (not with sync, but e.g. with migrations) or that has fields with underscore naming. This was problem at least with postgres before. - [BUG] Fixed a bug where plain objects like `{ in: [...] }` were not properly converted to SQL when combined with a sequelize method (`fn`, `where` etc.). Closes [ - [BUG] Made the default for array search in postgres exact comparison instead of overlap - [BUG] Allow logging from individual functions even though the global logging setting is false. Closes [ - [BUG] Allow increment/decrement operations when using schemata - [BUG] Allow createTable with schema - [BUG] Fix some issues with findAndCount and include - [INTERNALS] Update `inflection` dependency to v1.5.2 - [REMOVED] Remove query generation syntactic sugar provided by `node-sql`, as well as the dependency on that module # Backwards compatibility changes - When eager-loading a many-to-many association, the attributes of the through table are now accessible through an attribute named after the through model rather than the through table name singularized. i.e. `Task.find({include: Worker})` where the table name for through model `TaskWorker` is `TableTaskWorkers` used to produce `{ Worker: { ..., TableTaskWorker: {...} } }`. It now produces `{ Worker: { ..., TaskWorker: {...} } }`. Does not affect models where table name is auto-defined by Sequelize, or where table name is model name pluralized. - When using `Model#find()` with an `order` clause, the table name is prepended to the `ORDER BY` SQL. e.g. `ORDER BY Task.id` rather than `ORDER BY id`. The change is to avoid ambiguous column names where there are eager-loaded associations with the same column names. A side effect is that code like `Task.findAll( { include: [ User ], order: [ [ 'Users.id', 'ASC' ] ] } )` will now throw an error. This should be achieved with `Task.findAll( { include: [ User ], order: [ [ User, 'id', 'ASC' ] ] } )` instead. - Nested HSTORE objects are no longer supported. Use DataTypes.JSON instead. - In PG `where: { arr: [1, 2] }` where the `arr` column is an array will now use strict comparison (`=`) instead of the overlap operator (`&&`). To obtain the old behaviour, use ` where: { arr: { overlap: [1, 2] }}` - The default `fields` for `Instance#save` (when not a new record) is now an intersection of the model attributes and the changed attributes making saves more atomic while still allowing only defined attributes. - Syntactic sugar for query generation was removed. You will no longer be able to call Model.dataset() to generate raw sql queries # 2.0.0-rc2 - [FEATURE] Added to posibility of using a sequelize object as key in `sequelize.where`. Also added the option of specifying a comparator - [FEATURE] Added countercache functionality to hasMany associations [ - [FEATURE] Basic JSON support [ - [BUG] Fixes regression bug with multiple hasMany between the same models with different join tables. Closes [ - [BUG] Don't set autocommit in nested transactions [ - [BUG] Improved `field` support # 2.0.0-rc1 - [BUG] Fixed an issue with foreign key object syntax for hasOne and belongsTo - [FEATURE] Added `field` and `name` to the object form of foreign key definitions - [FEATURE] Added support for calling `Promise.done`, thus explicitly ending the promise chain by calling done with no arguments. Done with a function argument still continues the promise chain, to maintain BC. - [FEATURE] Added `scope` to hasMany association definitions, provides default values to association setters/finders [ - [FEATURE] We now support transactions that automatically commit/rollback based on the result of the promise chain returned to the callback. - [BUG] Only try to create indexes which don't already exist. Closes [ - [FEATURE] Hooks are passed options - [FEATURE] Hooks need not return a result - undefined return is interpreted as a resolved promise - [FEATURE] Added `find()` hooks # Backwards compatibility changes - The `fieldName` property, used in associations with a foreign key object `(A.hasMany(B, { foreignKey: { ... }})`, has been renamed to `name` to avoid confusion with `field`. - The naming of the join table entry for N:M association getters is now singular (like includes) - Signature of hooks has changed to pass options to all hooks. Any hooks previously defined like `Model.beforeCreate(values)` now need to be `Model.beforeCreate(values, options)` etc. - Results returned by hooks are ignored - changes to results by hooks should be made by reference - `Model.destroy()` signature has been changed from `(where, options)` to `(options)`, options now take a where parameter. - `Model.update()` signature has been changed from `(values, where, options)` to `(values, options)`, options now take a where parameter. - The syntax for `Model.findOrBuild` has changed, to be more in line with the rest of the library. `Model.findOrBuild(where, defaults);` becomes `Model.findOrBuild({ where: where, defaults: defaults });`. # v2.0.0-dev13 We are working our way to the first 2.0.0 release candidate. - [FEATURE] Added to option of setting a timezone offset in the sequelize constructor (`timezone` option). This timezone is used when initializing a connection (using `SET TIME ZONE` or equivalent), and when converting a timestamp string from the DB to a JS date with mysql (postgres stores the timezone, so for postgres we rely on what's in the DB). - [FEATURE] Allow setting plural and singular name on the model (`options.name` in `sequelize.define`) and in associations (`options.as`) to circumvent issues with weird pluralization. - [FEATURE] Added support for passing an `indexes` array in options to `sequelize.define`. [ - [FEATURE/INTERNALS] Standardized the output from `QueryInterface.showIndex`. - [FEATURE] Include deleted rows in find [ - [FEATURE] Make addSingular and addPlural for n:m associations (fx `addUser` and `addUsers` now both accept an array or an instance. - [BUG] Hid `dottie.transform` on raw queries behind a flag (`nest`) [ - [BUG] Fixed problems with transaction parameter being removed / not passed on in associations [ - [BUG] Fix problem with minConnections. [ - [BUG] Fix default scope being overwritten [ - [BUG] Fixed updatedAt timestamp not being set in bulk create when validate = true. [ - [INTERNALS] Replaced lingo with inflection - [INTERNALS] Removed underscore.string dependency and moved a couple of helper functions from `Utils._` to `Utils` - [INTERNALS] Update dependencies + validator 3.2.0 -> 3.16.1 + moment 2.5.0 -> 2.7.0 + generic-pool 2.0.4 -> 2.1.1 + sql 0.35.0 -> 0.39.0 - [INTERNALS] Use a transaction inside `findOrCreate`, and handle unique constraint errors if multiple calls are issues concurrently on the same transaction # Backwards compatibility changes - We are using a new inflection library, which should make pluralization and singularization in general more robust. However, a couple of pluralizations have changed as a result: + Person is now pluralized as people instead of persons - Accesors for models with underscored names are no longer camel cased automatically. For example, if you have a model with name `my_model`, and `my_other_model.hasMany(my_model)`, the getter will now be `<API key>.getMy_model` instead of `.getMyModel`. - Removed support for setting sequelize.language. If your model names are not in english, use the name option provided by `sequelize.name` to defined singular and plural forms for your model. - Model names are now used more verbatim in associations. This means that if you have a model named `Task` (plural T), or an association specifying `{ as: 'Task' }`, the tasks will be returned as `relatedModel.Tasks` instead of `relatedModel.tasks`. For more information and how to mitigate this, see https://github.com/sequelize/sequelize/wiki/Upgrading-to-2.0#<API key> - Removed the freezeAssociations option - use model and assocation names instead to provide the plural form yourself - Removed sequelize.language option (not supported by inflection) - Error handling has been refactored. Code that listens for : + All Error classes properly inherit from Error and a common SequelizeBaseError base + Instance Validator returns a single instance of a ValidationError which contains an errors array property. This property contains individual error items for each failed validation. + ValidationError includes a `get(path)` method to find all broken validations for a path on an instance. To migrate existing error handling, switch from array indexing to using the get method: Old: `err.validateCustom[0]` New: `err.get('validateCustom')[0]` - The syntax for findOrCreate has changed, to be more in line with the rest of the library. `Model.findOrCreate(where, defaults);` becomes `Model.findOrCreate({ where: where, defaults: defaults });`. # v2.0.0-dev12 - [FEATURE] You can now return a promise to a hook rather than use a callback - [FEATURE] There is now basic support for assigning a field name to an attribute `name: {type: DataTypes.STRING, field: 'full_name'}` - [FEATURE] It's now possible to add multiple relations to a hasMany association, modelInstance.addRelations([otherInstanceA, otherInstanceB]) - [FEATURE] `define()` stores models in `sequelize.models` Object e.g. `sequelize.models.MyModel` - [FEATURE] The `set` / `add` / `has` methods for associations now allow you to pass the value of a primary key, instead of a full Instance object, like so: `user.addTask(15);`. - [FEATURE] Support for FOR UPDATE and FOR SHARE statements [ - [FEATURE] n:m createAssocation now returns the target model instance instead of the join model instance - [FEATURE] Extend the `foreignKey` option for associations to support a full data type definition, and not just a string - [FEATURE] Extract CLI into [separate projects](https://github.com/sequelize/cli). - [FEATURE] Sqlite now inserts dates with millisecond precision - [FEATURE] Sequelize.VIRTUAL datatype which provides regular attribute functionality (set, get, etc) but never persists to database. - [BUG] An error is now thrown if an association would create a naming conflict between the association and the foreign key when doing eager loading. Closes [ - [BUG] Fix logging options for sequelize.sync - [BUG] find no longer applies limit: 1 if querying on a primary key, should fix a lot of subquery issues. - [BUG] Transactions now use the pool so you will never go over your pool defined connection limit - [BUG] Fix use of Sequelize.literal in eager loading and when renaming attributes [ - [BUG] Use the provided name for a unique index if one is given, instead of concating the column names together [ - [BUG] Create a composite primary key for doubled linked self reference [ - [INTERNALS] `bulkDeleteQuery` was removed from the MySQL / abstract query generator, since it was never used internally. Please use `deleteQuery` instead. # Backwards compatibility changes - Sequelize now returns promises instead of its custom event emitter from most calls. This affects methods that return multiple values (like `findOrCreate` or `findOrInitialize`). If your current callbacks do not accept the 2nd success parameter you might be seeing an array as the first param. Either use `.spread()` for these methods or add another argument to your callback: `.success(instance)` -> `.success(instance, created)`. - `.success()`/`.done()` and any other non promise methods are now deprecated (we will keep the codebase around for a few versions though). on('sql') persists for debugging purposes. - Model association calls (belongsTo/hasOne/hasMany) are no longer chainable. (this is to support being able to pass association references to include rather than model/as combinations) - `QueryInterface` no longer emits global events. This means you can no longer do things like `QueryInterface.on('showAllSchemas', function ... ` - `sequelize.showAllSchemas` now returns an array of schemas, instead of an array containinig an array of schemas - `sequelize.transaction()` now returns a promise rather than a instance of Sequelize.Transaction - `bulkCreate`, `bulkUpdate` and `bulkDestroy` (and aliases) now take both a `hooks` and an `individualHooks` option, `hooks` defines whether or not to run the main hooks, and `individualHooks` defines whether to run hooks for each instance affected. - It is no longer possible to disable pooling, disable pooling will just result in a 1/1 pool. # v2.0.0-dev11 Caution: This release contains many changes and is highly experimental - [PERFORMANCE] increased build performance when using include, which speeds up findAll etc. - [BUG] Made it possible to use HSTORE both in attribute: HSTORE and attribute: { type: HSTORE } form. Thanks to @tomchentw [ - [FEATURE] n:m now marks the columns of the through table as foreign keys and cascades them on delete and update by default. - [FEATURE] 1:1 and 1:m marks columns as foreign keys, and sets them to cascade on update and set null on delete. If you are working with an existing DB which does not allow null values, be sure to override those options, or disable them completely by passing constraints: false to your assocation call (`M1.belongsTo(M2, { constraints: false})`). - [BUG] Removed the hard dependency on pg, allowing users to use pg.js - [BUG] Fixed a bug with foreign keys pointing to attributes that were not integers. Now your primaryKey can be a string, and associations will still work. Thanks to @fixe [ - [BUG] Fix a case where createdAt timestamp would not be set when updatedAt was disabled Thanks to @fixe [ - [BUG] Fix a case where timestamps were not being write protected in `set` when underscored=true. janmeier [ - [FEATURE/BUG] Prefetching/includes now fully support schemas - [FEATURE] Centralize logging. [ - [FEATURE/BUG] hstore values are now parsed on find/findAll. Thanks to @nunofgs [ - [FEATURE] Read cli options from a file. Thanks to @codeinvain [ # Backwards compatibility changes - The `notNull` validator has been removed, use the Schema's `allowNull` property. - All Validation errors now return a sequelize.ValidationError which inherits from Error. - selectedValues has been removed for performance reasons, if you depend on this, please open an issue and we will help you work around it. - foreign keys will now correctly be based on the alias of the model - if you have any 1:1 relations where both sides use an alias, you'll need to set the foreign key, or they'll each use a different foreign key based on their alias. - foreign keys for non-id primary keys will now be named for the foreign key, i.e. pub_name rather than pub_id - if you have non-id primary keys you should go through your associations and set the foreignKey option if relying on a incorrect _id foreign key - syncOnAssocation has been removed. It only worked for n:m, and having a synchronous function (hasMany) that invokes an asynchronous function (sync) without returning an emitter does not make a lot of sense. If you (implicitly) depended on this feature, sequelize.sync is your friend. If you do not want to do a full sync, use custom through models for n:m (`M1.hasMany(M2, { through: M3})`) and sync the through model explicitly. - Join tables will be no longer be paranoid (have a deletedAt timestamp added), even though other models are. - All tables in select queries will now be aliased with the model names to be support schemas. This will affect people stuff like `where: {'table.attribute': value} # v1.7.10 - [FEATURE] ilike support for postgres [ - [FEATURE] distinct option for count [ - [BUG] various fixes # v1.7.9 - [BUG] fixes issue with custom primary keys and N:M join tables [ # v1.7.8 - [FEATURE] adds rlike support for mysql # v1.7.7 - [BUG] fixes issue where count/findAndCountAll would throw on empty rows [ # v1.7.6 - [BUG] fixes issue where primary key is also foreign key [ # v1.7.5 - [BUG] fixes bug with some methods relying on table information throwing strange errors [ # v1.7.3 - [BUG] fixes foreign key types for hasMany # v1.7.2 - [BUG] fixes transactions support for 1-to-1 association setters. # v1.7.1 - [BUG] fixes issue where relations would not use transactions probably in adders/setters. # v1.7.0 - [FEATURE] covers more advanced include cases with limiting and filtering (specifically cases where a include would be in the subquery but its child include wouldnt be, for cases where a 1:1 association had a 1:M association as a nested include) - [BUG] fixes issue where connection would timeout before calling COMMIT resulting in data never reaching the database [ # v1.7.0-rc9 - [PERFORMANCE] fixes performance regression introduced in rc7 - [FEATURE] include all relations for a model [ - [BUG] N:M adder/getter with through model and custom primary keys now work # v1.7.0-rc8 - [BUG] fixes bug with required includes without wheres with subqueries # v1.7.0-rc7 - [BUG] ORDER BY statements when using includes should now be places in the appropriate sub/main query more intelligently. - [BUG] using include.attributes with primary key attributes specified should no longer result in multiple primary key attributes being selected [ - [DEPENDENCIES] all dependencies, including Validator have been updated to the latest versions. # Backwards compatability changes - .set() will no longer set values that are not a dynamic setter or defined in the model. This only breaks BC since .set() was introduced but restores original .updateAttributes functionality where it was possible to 'trust' user input. # v1.7.0-rc6 - [BUG] Encode binary strings as bytea in postgres, and fix a case where using a binary as key in an association would produce an error [1364](https://github.com/sequelize/sequelize/pull/1364). Thanks to @SohumB # v1.7.0-rc5 - [FEATURE] sync() now correctly returns with an error when foreign key constraints reference unknown tables - [BUG] sync() no longer fails with foreign key constraints references own table (toposort self-dependency error) - [FEATURE] makes it possible to specify exactly what timestamp attributes you want to utilize [ - [FEATURE] Support coffee script files in migrations. [ - [FEATURE] include.where now supports Sequelize.and()/.or(). [ # v1.7.0-rc4 - [BUG] fixes issue with postgres sync and enums [ - [BUG] fixes various issues with limit and includes [ - [BUG] fixes issues with migrations/queryInterface createTable and enums - [BUG] migration/queryInterface.addIndex() no longer fails on reserved keywords like 'from' - [FEATURE] bulkCreate now supports a `ignoreDuplicates` option for MySQL, SQLite and MariaDB that will use `INSERT IGNORE` - [BUG] fixes regression bug with 1:M self associations - [FEATURE] significant performance improvements for 1:1 and single primary key includes for 500+ rows [ # Backwards compatability changes - find/findAll will now always return primary keys regardless of `attributes` settings. (Motivation was to fix various issues with eager loading) # v1.7.0-rc3 - [FEATURE] dropAllTables now takes an option parameter with `skip` as an option [ - [FEATURE] implements .spread for eventemitters [ - [BUG] fixes some of the mysql connection error bugs [ - [Feature] Support for OR queries. - [Feature] Support for HAVING queries. [ - [FEATURE] bulkUpdate and bulkDestroy now returns affected rows. [ - [BUG] fixes transaction memory leak issue - [BUG] fixes security issue where it was possible to overwrite the id attribute when defined by sequelize (screwup - and fix - by mickhansen) # v1.7.0-rc2 - [BUG] fixes unixSocket connections for mariadb [ - [BUG] fixes a hangup issue for mysql [ - [BUG] improves handling of uncaught errors in eventemitter [ - [BUG] fixes bug with mysql replication and pool settings [ - [BUG] fixes bug where through models created by N:M associations would inherit hooks [ - [FEATURE] .col()/.literal()/etc now works with findAll [ - [BUG] now currectly handles connection timeouts as errors [ # v2.0.0 (alpha1) # - [FEATURE] async validations. [ # v1.7.0-rc1 - [FEATURE] instance.<API key> functionality added [ - [BUG] fixes a few bugs with transactions in regards to associations - [FEATURE] add error handling for transaction creation - [FEATURE] `sequelize --undo` will now actually undo migrations. Its basically an alias for `sequelize --migrate --undo`. [ - [BUG] fix bug where `{where: {ne: null}}` would result in `!= NULL` instead of `IS NOT NULL` [ - [BUG] fixes a bug with validation skipping using the `fields` options. [ - [BUG] fixes a bug with postgres and setters [ - [BUG] fixes it so `field: {type: Sequelize.ENUM(value1, value2)}` works # Backwards compatability changes - Hooks are no longer passing value hashes. Instead, they are now passing instances of the model. - Hook callbacks no longer take two arguments (previously: `err, newValues`). They only take the error argument since values can be changed directly on the model instance. # v1.7.0-beta8 - [FEATURE] max()/min() now supports dates [ - [FEATURE] findAndCountAll now supports the include option # Backwards compatibility changes - You will now need to include the relevant subtables to query on them in finders (find/findAll) - Subquery logic no longer depends on where objects with keys containing '.', instead where options on the include options [ # v1.7.0-beta7 # - [FEATURE] Nested eager loading / prefetching is now supported. [Docs](http://sequelizejs.com/docs/latest/models#<API key>) - [FEATURE] Eager loading / prefetching now supports inner joins and extending the ON statement [ - [FEATURE] Eager loading / prefetching now returns the attributes of through models aswell [ - [FEATURE] New set/get/changed/previous feature [ - Various bug fixes # Backwards compatibility changes None # v1.7.0-beta1 # - [DEPENDENCIES] Upgraded validator for IPv6 support. [ - [DEPENDENCIES] replaced underscore by lodash. [ - [DEPENDENCIES] Upgraded pg to 2.0.0. [ - [DEPENDENCIES] Upgraded command to 2.0.0 and generic-pool to 2.0.4. thanks to durango - [DEPENDENCIES] No longer require semver. thanks to durango - [BUG] Fix string escape with postgresql on raw SQL queries. [ - [BUG] "order by" is now after "group by". [ - [BUG] Added decimal support for min/max. [ - [BUG] Null dates don't break SQLite anymore. [ - [BUG] Correctly handle booleans in MySQL. [ - [BUG] Fixed empty where conditions in MySQL. [ - [BUG] Allow overriding of default columns. [ - [BUG] Fix where params for belongsTo [ - [BUG] Default ports are now declared in the connector manager, which means the default port for PG correctly becomes 5432. [ - [BUG] Columns with type BOOLEAN were always added to toJSON output, even if they were not selected [see](https://gist.github.com/gchaincl/<API key>). janmeier - [BUG] Hstore is now fully supported [ - [BUG] Correct join table name for tables with custom names [ - [BUG] PostgreSQL should now be able to insert empty arrays with typecasting. [ - [BUG] Fields should be escaped by quoteIdentifier for max/min functions which allows SQL reserved keywords to be used. [ - [BUG] Fixed bug when trying to save objects with eagerly loaded attributes [ - [BUG] Strings for .find() should be fixed. Also added support for string primary keys to be found easily. [ - [BUG] bulkCreate would have problems with a disparate field list [ - [BUG] Fixed problems with quoteIdentifiers and {raw: false} option on raw queries [ - [BUG] Fixed SQL escaping with sqlite and unified escaping [ - [BUG] Fixed Postgres' pools [ff57af63](https://github.com/sequelize/sequelize/commit/<SHA1-like>) - [BUG] Fixed BLOB/TEXT columns having a default value declared in MySQL [ - [BUG] You can now use .find() on any single integer primary key when throwing just a number as an argument [ - [BUG] Adding unique to a column for Postgres in the migrator should be fixed [ - [BUG] For MySQL users, if their collation allows case insensitivity then allow enums to be case insensitive as well [ - [BUG] Custom primary key (not keys, just singular) should no longer be a problem for models when using any of the data retrievals with just a number or through associations [ - [BUG] Default schemas should now be utilized when describing tables [ - [BUG] Fixed eager loading for many-to-many associations. [ - [BUG] allowNull: true enums can now be null [ - [BUG] Fixes Postgres' ability to search within arrays. [ - [BUG] Find and finAll would modify the options objects, now the objects are cloned at the start of the method [ - [BUG] Add support for typed arrays in SqlString.escape and SqlString.arrayToList [ - [BUG] Postgres requires empty array to be explicitly cast on update [ - [BUG] Added tests & bugfixes for DAO-Factory.update and array of values in where clause [ - [BUG] sqlite no longer leaks a global `db` variable [ - [BUG] Fix for counts queries with no result [ - [BUG] Allow include when the same table is referenced multiple times using hasMany [ - [BUG] Allow definition of defaultValue for the timestamp columns (createdAt, updatedAt, deletedAt) [ - [BUG] Don't delete foreign keys of many-to-many associations, if still needed. [ - [BUG] Update timestamps when incrementing and decrementing [ - [FEATURE] Validate a model before it gets saved. [ - [FEATURE] Schematics. [ - [FEATURE] Foreign key constraints. [ - [FEATURE] Support for bulk insert (`<DAOFactory>.bulkCreate()`, update (`<DAOFactory>.update()`) and delete (`<DAOFactory>.destroy()`) [ - [FEATURE] Add an extra `queryOptions` parameter to `DAOFactory.find` and `DAOFactory.findAll`. This allows a user to specify `{ raw: true }`, meaning that the raw result should be returned, instead of built DAOs. Usefull for queries returning large datasets, see [ - [FEATURE] Added convenient data types. [ - [FEATURE] Binary is more verbose now. [ - [FEATURE] Promises/A support. [ - [FEATURE] Added Getters/Setters method for DAO. [ - [FEATURE] Added model wide validations. [ - [FEATURE] `findOrCreate` now returns an additional flag (`created`), that is true if a model was created, and false if it was found [ - [FEATURE] Field and table comments for MySQL and PG. [ - [FEATURE] BigInts can now be used for autoincrement/serial columns. [ - [FEATURE] Use moment for better postgres timestamp strings. [ - [FEATURE] Keep milliseconds in timestamps for postgres. [ - [FEATURE] You can now set lingo's language through Sequelize. [ - [FEATURE] Added a `findAndCountAll`, useful for pagination. [ - [FEATURE] Made explicit migrations possible. [ - [FEATURE] Added support for where clauses containing !=, < etc. and support for date ranges [ - [FEATURE] Added support for model instances being referenced [ - [FEATURE] Added support for specifying the path to load a module for a dialect. [ - [FEATURE] Drop index if exists has been added to sqlite [ - [FEATURE] bulkCreate() now has a third argument which gives you the ability to validate each row before attempting to bulkInsert [ - [FEATURE] Added `isDirty` to model instances. [ - [FEATURE] Added possibility to use env variable for the database connection. [ - [FEATURE] Blob support. janmeier - [FEATURE] We can now define our own custom timestamp columns [ - [FEATURE] Scopes. [ - [FEATURE] Model - [FEATURE] Shortcut method for getting a defined model. [ - [FEATURE] Added Sequelize.fn() and Sequelize.col() to properly call columns and functions within Sequelize. [ - [FEATURE] Sequelize.import supports relative paths. [ - [FEATURE] Sequelize.import can now handle functions. [ - [FEATURE] Uses sequelize.fn and sequelize.col functionality to allow you to use the value of another column or a function when updating. It also allows you to use a function as a default value when supported (in sqlite and postgres). [ - [FEATURE] Added possibility to pass options to node-mysql. [ - [FEATURE] Triggers for Postgres. [ - [FEATURE] Support for join tables. [ - [FEATURE] Support for hooks. [ - [FEATURE] Support for literals and casts. [ - [FEATURE] Model - [FEATURE] Support for MariaDB. [ - [FEATURE] Filter through associations. [ - [FEATURE] Possibility to disable loging for .sync [ - [FEATURE] Support for transactions. [1062](https://github.com/sequelize/sequelize/pull/1062). - [REFACTORING] hasMany now uses a single SQL statement when creating and destroying associations, instead of removing each association seperately [690](https://github.com/sequelize/sequelize/pull/690). Inspired by [ - [REFACTORING] Consistent handling of offset across dialects. Offset is now always applied, and limit is set to max table size of not limit is given [ - [REFACTORING] Moved Jasmine to Buster and then Buster to Mocha + Chai. sdepold and durango # v1.6.0 # - [DEPENDENCIES] upgrade mysql to alpha7. You *MUST* use this version or newer for DATETIMEs to work - [DEPENDENCIES] upgraded most dependencies. most important: mysql was upgraded to 2.0.0-alpha-3 - [DEPENDENCIES] mysql is now an optional dependency. #355 (thanks to clkao) - [REFACTORING] separated tests for dialects - [REFACTORING] reduced number of sql queries used for adding an element to a N:M association. #449 (thanks to innofluence/janmeier) - [REFACTORING] dropped support for synchronous migrations. added third parameter which needs to get called once the migration has been finished. also this adds support for asynchronous actions in migrations. - [OTHERS] code was formatted to fit the latest code style guidelines (thanks to durango) - [OTHERS] Explicitly target ./docs folder for generate-docs script. #444 (thanks to carsondarling) - [OTHERS] Overwrite existing <API key> if there already has been one. (thanks to robraux) - [BUG] fixed wrong version in sequelize binary - [BUG] local options have higher priority than global options (thanks to guersam) - [BUG] fixed where clause when passing an empty array (thanks to kbackowski) - [BUG] fixed updateAttributes for models/tables without primary key (thanks to durango) - [BUG] fixed the location of the foreign key when using belongsTo (thanks to ricardograca) - [BUG] don't return timestamps if only specific attributes have been seleceted (thanks to ricardograca) - [BUG] fixed removeColumn for sqlite - [BUG] fixed date equality check for instances. (thanks to solotimes) - [FEATURE] added association prefetching /eager loading for find and findAll. #465 - [FEATURE] it's now possible to use callbacks of async functions inside migrations (thanks to mphilpot) - [FEATURE] improved comfort of sequelize.query. just pass an sql string to it and wait for the result - [FEATURE] Migrations now understand NODE_ENV (thanks to gavri) - [FEATURE] Performance improvements (thanks to Mick-Hansen and janmeier from innofluence) - [FEATURE] Model.find and Model.findAll can now take a String with an ID. (thanks to ghernandez345) - [FEATURE] Compatibility for JSON-like strings in Postgres (thanks to aslakhellesoy) - [FEATURE] honor <API key> option (thanks to dchester) - [FEATURE] added support for stored procedures (inspired by wuyuntao) - [FEATURE] added possibility to use pg lib's native api (thanks to denysonique) - [FEATURE] added possibility to define the attributes of received associations (thanks to joshm) - [FEATURE] added findOrCreate, which returns a the already existing instance or creates one (thanks to eveiga) - [FEATURE] minConnections option for MySQL pooling (thanks to dominiklessel) - [FEATURE] added BIGINT data type which is treated like a string (thanks to adamsch1) - [FEATURE] experimental support for read replication for mysql (thanks to Janzeh) - [FEATURE] allow definition of a models table name (thanks to slamkajs) - [FEATURE] allow usage of enums. #440 (thanks to KevinMartin) - [FEATURE] allows updateAttributes to target specific fields only (thanks to Pasvaz) - [FEATURE] timestamps are now stored as UTC. #461 (thanks to innofluence/janmeier) - [FEATURE] results of raw queries are parsed with dottie. #468 (thanks to kozze89) - [FEATURE] support for array serialization. pg only. #443 (thanks to clkao) - [FEATURE] add increment and decrement methods on dao. #408 (thanks to janmeier/innofluence) - [FEATURE] unified the result of describeTable - [FEATURE] add support for decimals (thanks to alexyoung) - [FEATURE] added DAO.reload(), which updates the attributes of the DAO in-place (as opposed to doing having to do a find() and returning a new model) # v1.5.0 # - [REFACTORING] use underscore functions for Utils.isHash (thanks to Mick-Hansen/innofluence) - [REFACTORING] removed the 'failure' event and replaced it with 'error' - [BUG] fixed booleans for sqlite (thanks to vlmonk) - [BUG] obsolete reference attribute for many-to-many associations are removed correctly - [BUG] associations can be cleared via passing null to the set method - [BUG] "fixed" quota handling (thanks to dgf) - [BUG] fixed destroy in postgresql (thanks to robraux) - [FEATURE] added possibility to set protocol and to remove port from postgresql connection uri (thanks to danielschwartz) - [FEATURE] added possibility to not use a junction table for many-to-many associations on the same table (thanks to janmeier/innofluence) - [FEATURE] results of the `import` method is now cached (thanks to janmeier/innofluence) - [FEATURE] added possibility to check if a specific object or a whole bunch of objects is currently associated with another object (thanks to janmeier/innofluence) - [FEATURE] added possibility to globally disable adding of NULL values to sql queries (thanks to janmeier/innofluence) - [FEATURE] Model.create can now also be used to specify values for mass assignment (thanks to janmeier/innofluence) - [FEATURE] QueryChainer will now provide the results of the added emitters in the order the emitters have been added (thanks to LaurentZuijdwijk and me ;)) - [FEATURE] QueryChainer can now be initialized with serial items - [FEATURE] node 0.8 compatibility - [FEATURE] added options to hasMany getters (thanks to janmeier/innofluence) - [FEATURE] pooling option is now correctly passed to postgres (thanks to megshark) # v1.4.1 # - [DEPRECATION] Added deprecation warning for node < v0.6. - [FEATURE] added selective saving of instances (thanks to kioopi) - [FEATURE] added command to binary for creating a migration skeleton with current timestamp - [FEATURE] added `complete` function for each finder method (thanks to sstoiana) - [BUG] fixed quotation for sqlite statements (thanks to vlmonk) - [BUG] fixed timestamp parsing in migratios (thanks to grn) - [FEATURE] added consistent logging behaviour to postgres (thanks to reacuna) # v1.4.0 # - [BUG] fixed booleans in sqlite (thanks to alexstrat) - [BUG] fixed forced sync of many-to-many associations (thanks to SirUli) - [FEATURE] objects are now compatible to JSON.stringify. (thanks to grayt0r) - [FEATURE] When instantiating the sequelize object, you can now pass a function to logging. This allows you to customize the logging behavior. Default is now: console.log (thanks to kenperkins) - [BUG] The default logging is still console.log but is wrapped after initialization as it crashes node < 0.6.x. - [FEATURE] postgresql support. (thanks to swoodtke) - [FEATURE] connection-pooling for mysql. (thanks to megshark) - [FEATURE] added possibility to define NOW as default value for date data-types. Use Sequelize.NOW as defaultValue - [BUG] Fixed date handling in sqlite (thanks to iizukanao) # v1.3.7 # - [BUG] fixed issue where multiple belongsTo or hasOne associations to the same table overwrite each other - [BUG] fixed memory leaks (thanks to megshark) # v1.3.6 # - [BUG] don't update an existing updatedAt-attribute if timestamps option for a DAO is false # v1.3.5 # - [BUG] fixed missed DAO renaming in migrations (thanks to nov) # v1.3.4 # - [REFACTORING] renamed Model/ModelFactory/ModelFactoryManager to DAO/DAOFactory/DAOFactoryManager - [IMPROVEMENT] `npm test` will run the test suite (thanks to gabrielfalcao) - [IMPROVEMENT] documentation about setting up local development environment (thanks to gabrielfalcao) - [REFACTORING] removed updatedAt + createdAt from SequelizeMeta # v1.3.3 # - [BUG] fixed sql-event emitter in all possible locations (thanks to megshark) # v1.3.2 # - [FEATURE] sqlite is now emitting the 'sql'-event as well (thanks to megshark) # v1.3.1 # - [REFACTORING] renamed ModelManager to ModelFactoryManager - [IMPROVEMENT] decreased delay of CustomEventEmitter execution from 5ms to 1ms - [IMPROVEMENT] improved performance of association handling (many-to-many) (thanks to magshark) - [FEATURE] added possibility to specify name of the join table (thanks to magshark) - [FEATURE] mysql is emitting a 'sql'-event when executing a query - [BUG] correctly delete existing SequelizeMeta entry from database after undoing migration - [BUG] fix path of migration files in executable (thanks to bcg) # v1.3.0 # - [REFACTORING] Model#all is now a function and not a getter. - [REFACTORING] Renamed ModelDefinition to ModelFactory - [REFACTORING] Private method scoping; Attributes are still public - [REFACTORING] Use the new util module for node 0.6.2 - [FEATURE] QueryChainer can now run serially - [FEATURE] Association definition is chainable: Person.hasOne(House).hasMany(Address) - [FEATURE] Validations (Thanks to [hiddentao](https://github.com/hiddentao)) - [FEATURE] jQuery-like event listeners: .success(callback) and .error(callback) - [FEATURE] aliasing for select queries: Model.find({ where: 'id = 1', attributes: ['id', ['name', 'username']] }) ==> will return the user's name as username - [FEATURE] cross-database support. currently supported: mysql, sqlite - [FEATURE] migrations - [TEST] removed all expresso tests and converted them to jasmine # v1.2.1 # - [REFACTORING] renamed the global options for sync, query and define on sequelize; before: options.queryOptions; now: options.query - [FEATURE] allow definition of charset via global define option in sequelize or via charset option in sequelize.define - [FEATURE] allow definition of mysql engine via global define option in sequelize or via engine option in sequelize.define; default is InnoDB now - [FEATURE] find and findAll will now search in a list of values via: Model.findAll({where: { id: [1,2,3] }}); will return all models with id 1, 2 and 3 - [TEST] force latin1 charset for travis # v1.2.0 # - [FEATURE] min/max function for models, which return the min/max value in a column - [FEATURE] getModel for modelManager for getting a model without storing it in a variable; use it via sequelize.modelManager.getModel('User') - [TEST] test suite refactoring for jasmine # v1.1.4 # - [BUG] tables with identical prefix (e.g. wp_) can now be used in many-to-many associations # v1.1.3 # - [BUG] scoped options in model => a model can now have the attribute options - [FEATURE] added drop method for sequelize, that drops all currently registered tables # v1.1.2 # - [BUG] prevent malfunction after being idle # v1.1.1 # - [BUG] fixed memory leaks - [FEATURE] added query queueing (adjustable via <API key> in config; default: 50) # v1.1.0 # - [BUG] defaultValue 0 is now working - [REMOVED] mysql-pool usage (will give it a new try later) - [CHORE] updated node-mysql to 0.9.4 # v1.0.2 # - [BUG] Fixed where clause generation for models with explicit primary keys (allanca) - [BUG] Set insertId for non-default auto increment fields (allanca) # v1.0.1 # - [FEATURE] Added Model.count(callback), which returns the number of elements saved in the database - [BUG] Fixed self associations # v1.0.0 # - complete rewrite - added new emitter syntax - sql injection protection - select now supports hash usage of where - select now supports array usage of where - added a lot of options to find/findAll - Wrapped queries correctly using `foo` - using expresso 0.7.2 - moved config for test database into seperated config file - Added method for adding and deleting single associations # v0.4.3 # - renamed loadAssociatedData to fetchAssociations - renamed Model#associatedData to fetchedAssociations - added fetchAssociations to finder methods - store data found by finder method in the associatedData hash + grep them from there if reload is not forced - added option to sequelize constructor for disabling the pluralization of tablenames: <API key> - allow array as value for chainQueries => Sequelize.chainQueries([save: [a,b,c]], callback) - remove the usage of an array => Sequelize.chainQueries({save: a}, {destroy: b}, callback) # v0.4.2 # - fixed bugs from 0.4.1 - added the model instance method loadAssociatedData which adds the hash Model#associatedData to an instance which contains all associated data # v0.4.1 # - THIS UPDATE CHANGES TABLE STRUCTURES MASSIVELY! - MAKE SURE TO DROP YOUR CURRENT TABLES AND LET THEM CREATE AGAIN! - names of <API key> are chosen from passed association names - foreign keys are chosen from passed association name - added many-to-many association on the same model - added hasManyAndBelongsTo - added hasOneAndBelongsTo - nodejs-mysql-native 0.4.2 # v0.4.0 # - added error handling when defining invalid database credentials - Sequelize#sync, Sequelize#drop, model#sync, model#drop returns errors via callback - code is now located under lib/sequelize to use it with nDistro - added possibility to use non default mysql database (host/port) - added error handling when defining invalid database port/host - schema definitions can now contain default values and null allowance - database credentials can now also contain an empty / no password # v0.3.0 # - added possibility to define class and instance methods for models - added import method for loading model definition from a file # v0.2.6 # - refactored Sequelize to fit CommonJS module conventions # v0.2.5 # - added BOOLEAN type - added FLOAT type - fixed DATE type issue - fixed npm package # v0.2.4 # - fixed bug when using cross associated tables (many to many associations) # v0.2.3 # - added latest mysql connection library - fixed id handling on save - fixed text handling (varchar > 255; text) - using the inflection library for naming tables more convenient - Sequelize.TEXT is now using MySQL datatype TEXT instead of varchar(4000) # v0.2.2 # - released project as npm package # v0.2.1 # - fixed date bug # v0.2.0 # - added methods for setting associations - added method for chaining an arbitraty amount of queries # v0.1.0 # - first stable version - implemented all basic functions - associations are working
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http: <html xmlns="http: <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>pymatgen.io.babel &#8212; pymatgen 2017.11.6 documentation</title> <link rel="stylesheet" href="../../../_static/proBlue.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> <script type="text/javascript"> var <API key> = { URL_ROOT: '../../../', VERSION: '2017.11.6', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true, SOURCELINK_SUFFIX: '.txt' }; </script> <script type="text/javascript" src="../../../_static/jquery.js"></script> <script type="text/javascript" src="../../../_static/underscore.js"></script> <script type="text/javascript" src="../../../_static/doctools.js"></script> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=<API key>"></script> <link rel="shortcut icon" href="../../../_static/favicon.ico"/> <link rel="index" title="Index" href="../../../genindex.html" /> <link rel="search" title="Search" href="../../../search.html" /> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-33990148-1']); _gaq.push(['_trackPageview']); </script> </head> <body> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../../../genindex.html" title="General Index" accesskey="I">index</a></li> <li class="right" > <a href="../../../py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="nav-item nav-item-0"><a href="../../../index.html">pymatgen 2017.11.6 documentation</a> &#187;</li> <li class="nav-item nav-item-1"><a href="../../index.html" >Module code</a> &#187;</li> <li class="nav-item nav-item-2"><a href="../../pymatgen.html" accesskey="U">pymatgen</a> &#187;</li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body" role="main"> <h1>Source code for pymatgen.io.babel</h1><div class="highlight"><pre> <span></span><span class="c1"># coding: utf-8</span> <span class="c1"> <span class="c1"> <span class="kn">from</span> <span class="nn">__future__</span> <span class="k">import</span> <span class="n">division</span><span class="p">,</span> <span class="n">unicode_literals</span> <span class="sd">&quot;&quot;&quot;</span> <span class="sd">OpenBabel interface module, which opens up access to the hundreds of file</span> <span class="sd">formats supported by OpenBabel. Requires openbabel with python bindings to be</span> <span class="sd">installed. Please consult the</span> <span class="sd">`openbabel documentation &lt;http://openbabel.org/wiki/Main_Page&gt;`_.</span> <span class="sd">&quot;&quot;&quot;</span> <span class="n">__author__</span> <span class="o">=</span> <span class="s2">&quot;Shyue Ping Ong&quot;</span> <span class="n">__copyright__</span> <span class="o">=</span> <span class="s2">&quot;Copyright 2012, The Materials Project&quot;</span> <span class="n">__version__</span> <span class="o">=</span> <span class="s2">&quot;0.1&quot;</span> <span class="n">__maintainer__</span> <span class="o">=</span> <span class="s2">&quot;Shyue Ping Ong&quot;</span> <span class="n">__email__</span> <span class="o">=</span> <span class="s2">&quot;shyuep@gmail.com&quot;</span> <span class="n">__date__</span> <span class="o">=</span> <span class="s2">&quot;Apr 28, 2012&quot;</span> <span class="kn">from</span> <span class="nn">pymatgen.core.structure</span> <span class="k">import</span> <span class="n">Molecule</span> <span class="kn">from</span> <span class="nn">monty.dev</span> <span class="k">import</span> <span class="n">requires</span> <span class="k">try</span><span class="p">:</span> <span class="kn">import</span> <span class="nn">openbabel</span> <span class="k">as</span> <span class="nn">ob</span> <span class="kn">import</span> <span class="nn">pybel</span> <span class="k">as</span> <span class="nn">pb</span> <span class="k">except</span><span class="p">:</span> <span class="n">pb</span> <span class="o">=</span> <span class="kc">None</span> <span class="n">ob</span> <span class="o">=</span> <span class="kc">None</span> <div class="viewcode-block" id="BabelMolAdaptor"><a class="viewcode-back" href="../../../pymatgen.io.babel.html#pymatgen.io.babel.BabelMolAdaptor">[docs]</a><span class="k">class</span> <span class="nc">BabelMolAdaptor</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span> <span class="sd">&quot;&quot;&quot;</span> <span class="sd"> Adaptor serves as a bridge between OpenBabel&#39;s Molecule and pymatgen&#39;s</span> <span class="sd"> Molecule.</span> <span class="sd"> &quot;&quot;&quot;</span> <span class="nd">@requires</span><span class="p">(</span><span class="n">pb</span> <span class="ow">and</span> <span class="n">ob</span><span class="p">,</span> <span class="s2">&quot;BabelMolAdaptor requires openbabel to be installed with &quot;</span> <span class="s2">&quot;Python bindings. Please get it at http://openbabel.org.&quot;</span><span class="p">)</span> <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">mol</span><span class="p">):</span> <span class="sd">&quot;&quot;&quot;</span> <span class="sd"> Initializes with pymatgen Molecule or OpenBabel&quot;s OBMol.</span> <span class="sd"> Args:</span> <span class="sd"> mol: pymatgen&#39;s Molecule or OpenBabel OBMol</span> <span class="sd"> &quot;&quot;&quot;</span> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">mol</span><span class="p">,</span> <span class="n">Molecule</span><span class="p">):</span> <span class="k">if</span> <span class="ow">not</span> <span class="n">mol</span><span class="o">.</span><span class="n">is_ordered</span><span class="p">:</span> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">&quot;OpenBabel Molecule only supports ordered &quot;</span> <span class="s2">&quot;molecules.&quot;</span><span class="p">)</span> <span class="c1"># For some reason, manually adding atoms does not seem to create</span> <span class="c1"># the correct OBMol representation to do things like force field</span> <span class="c1"># optimization. So we go through the indirect route of creating</span> <span class="c1"># an XYZ file and reading in that file.</span> <span class="n">obmol</span> <span class="o">=</span> <span class="n">ob</span><span class="o">.</span><span class="n">OBMol</span><span class="p">()</span> <span class="n">obmol</span> <span class="o">=</span> <span class="n">ob</span><span class="o">.</span><span class="n">OBMol</span><span class="p">()</span> <span class="n">obmol</span><span class="o">.</span><span class="n">BeginModify</span><span class="p">()</span> <span class="k">for</span> <span class="n">site</span> <span class="ow">in</span> <span class="n">mol</span><span class="p">:</span> <span class="n">coords</span> <span class="o">=</span> <span class="p">[</span><span class="n">c</span> <span class="k">for</span> <span class="n">c</span> <span class="ow">in</span> <span class="n">site</span><span class="o">.</span><span class="n">coords</span><span class="p">]</span> <span class="n">atomno</span> <span class="o">=</span> <span class="n">site</span><span class="o">.</span><span class="n">specie</span><span class="o">.</span><span class="n">Z</span> <span class="n">obatom</span> <span class="o">=</span> <span class="n">ob</span><span class="o">.</span><span class="n">OBAtom</span><span class="p">()</span> <span class="n">obatom</span><span class="o">.</span><span class="n">thisown</span> <span class="o">=</span> <span class="mi">0</span> <span class="n">obatom</span><span class="o">.</span><span class="n">SetAtomicNum</span><span class="p">(</span><span class="n">atomno</span><span class="p">)</span> <span class="n">obatom</span><span class="o">.</span><span class="n">SetVector</span><span class="p">(</span><span class="o">*</span><span class="n">coords</span><span class="p">)</span> <span class="n">obmol</span><span class="o">.</span><span class="n">AddAtom</span><span class="p">(</span><span class="n">obatom</span><span class="p">)</span> <span class="k">del</span> <span class="n">obatom</span> <span class="n">obmol</span><span class="o">.</span><span class="n">ConnectTheDots</span><span class="p">()</span> <span class="n">obmol</span><span class="o">.</span><span class="n">PerceiveBondOrders</span><span class="p">()</span> <span class="n">obmol</span><span class="o">.</span><span class="n"><API key></span><span class="p">(</span><span class="n">mol</span><span class="o">.</span><span class="n">spin_multiplicity</span><span class="p">)</span> <span class="n">obmol</span><span class="o">.</span><span class="n">SetTotalCharge</span><span class="p">(</span><span class="n">mol</span><span class="o">.</span><span class="n">charge</span><span class="p">)</span> <span class="n">obmol</span><span class="o">.</span><span class="n">Center</span><span class="p">()</span> <span class="n">obmol</span><span class="o">.</span><span class="n">Kekulize</span><span class="p">()</span> <span class="n">obmol</span><span class="o">.</span><span class="n">EndModify</span><span class="p">()</span> <span class="bp">self</span><span class="o">.</span><span class="n">_obmol</span> <span class="o">=</span> <span class="n">obmol</span> <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">mol</span><span class="p">,</span> <span class="n">ob</span><span class="o">.</span><span class="n">OBMol</span><span class="p">):</span> <span class="bp">self</span><span class="o">.</span><span class="n">_obmol</span> <span class="o">=</span> <span class="n">mol</span> <span class="nd">@property</span> <span class="k">def</span> <span class="nf">pymatgen_mol</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> <span class="sd">&quot;&quot;&quot;</span> <span class="sd"> Returns pymatgen Molecule object.</span> <span class="sd"> &quot;&quot;&quot;</span> <span class="n">sp</span> <span class="o">=</span> <span class="p">[]</span> <span class="n">coords</span> <span class="o">=</span> <span class="p">[]</span> <span class="k">for</span> <span class="n">atom</span> <span class="ow">in</span> <span class="n">ob</span><span class="o">.</span><span class="n">OBMolAtomIter</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_obmol</span><span class="p">):</span> <span class="n">sp</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">atom</span><span class="o">.</span><span class="n">GetAtomicNum</span><span class="p">())</span> <span class="n">coords</span><span class="o">.</span><span class="n">append</span><span class="p">([</span><span class="n">atom</span><span class="o">.</span><span class="n">GetX</span><span class="p">(),</span> <span class="n">atom</span><span class="o">.</span><span class="n">GetY</span><span class="p">(),</span> <span class="n">atom</span><span class="o">.</span><span class="n">GetZ</span><span class="p">()])</span> <span class="k">return</span> <span class="n">Molecule</span><span class="p">(</span><span class="n">sp</span><span class="p">,</span> <span class="n">coords</span><span class="p">)</span> <span class="nd">@property</span> <span class="k">def</span> <span class="nf">openbabel_mol</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> <span class="sd">&quot;&quot;&quot;</span> <span class="sd"> Returns OpenBabel&#39;s OBMol.</span> <span class="sd"> &quot;&quot;&quot;</span> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_obmol</span> <div class="viewcode-block" id="BabelMolAdaptor.localopt"><a class="viewcode-back" href="../../../pymatgen.io.babel.html#pymatgen.io.babel.BabelMolAdaptor.localopt">[docs]</a> <span class="k">def</span> <span class="nf">localopt</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">forcefield</span><span class="o">=</span><span class="s1">&#39;mmff94&#39;</span><span class="p">,</span> <span class="n">steps</span><span class="o">=</span><span class="mi">500</span><span class="p">):</span> <span class="sd">&quot;&quot;&quot;</span> <span class="sd"> A wrapper to pybel&#39;s localopt method to optimize a Molecule.</span> <span class="sd"> Args:</span> <span class="sd"> forcefield: Default is mmff94. Options are &#39;gaff&#39;, &#39;ghemical&#39;,</span> <span class="sd"> &#39;mmff94&#39;, &#39;mmff94s&#39;, and &#39;uff&#39;.</span> <span class="sd"> steps: Default is 500.</span> <span class="sd"> &quot;&quot;&quot;</span> <span class="n">pbmol</span> <span class="o">=</span> <span class="n">pb</span><span class="o">.</span><span class="n">Molecule</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_obmol</span><span class="p">)</span> <span class="n">pbmol</span><span class="o">.</span><span class="n">localopt</span><span class="p">(</span><span class="n">forcefield</span><span class="o">=</span><span class="n">forcefield</span><span class="p">,</span> <span class="n">steps</span><span class="o">=</span><span class="n">steps</span><span class="p">)</span> <span class="bp">self</span><span class="o">.</span><span class="n">_obmol</span> <span class="o">=</span> <span class="n">pbmol</span><span class="o">.</span><span class="n">OBMol</span></div> <span class="nd">@property</span> <span class="k">def</span> <span class="nf">pybel_mol</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> <span class="sd">&quot;&quot;&quot;</span> <span class="sd"> Returns Pybel&#39;s Molecule object.</span> <span class="sd"> &quot;&quot;&quot;</span> <span class="k">return</span> <span class="n">pb</span><span class="o">.</span><span class="n">Molecule</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_obmol</span><span class="p">)</span> <div class="viewcode-block" id="BabelMolAdaptor.write_file"><a class="viewcode-back" href="../../../pymatgen.io.babel.html#pymatgen.io.babel.BabelMolAdaptor.write_file">[docs]</a> <span class="k">def</span> <span class="nf">write_file</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">filename</span><span class="p">,</span> <span class="n">file_format</span><span class="o">=</span><span class="s2">&quot;xyz&quot;</span><span class="p">):</span> <span class="sd">&quot;&quot;&quot;</span> <span class="sd"> Uses OpenBabel to output all supported formats.</span> <span class="sd"> Args:</span> <span class="sd"> filename: Filename of file to output</span> <span class="sd"> file_format: String specifying any OpenBabel supported formats.</span> <span class="sd"> &quot;&quot;&quot;</span> <span class="n">mol</span> <span class="o">=</span> <span class="n">pb</span><span class="o">.</span><span class="n">Molecule</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_obmol</span><span class="p">)</span> <span class="k">return</span> <span class="n">mol</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">file_format</span><span class="p">,</span> <span class="n">filename</span><span class="p">,</span> <span class="n">overwrite</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span></div> <div class="viewcode-block" id="BabelMolAdaptor.from_file"><a class="viewcode-back" href="../../../pymatgen.io.babel.html#pymatgen.io.babel.BabelMolAdaptor.from_file">[docs]</a> <span class="nd">@staticmethod</span> <span class="k">def</span> <span class="nf">from_file</span><span class="p">(</span><span class="n">filename</span><span class="p">,</span> <span class="n">file_format</span><span class="o">=</span><span class="s2">&quot;xyz&quot;</span><span class="p">):</span> <span class="sd">&quot;&quot;&quot;</span> <span class="sd"> Uses OpenBabel to read a molecule from a file in all supported formats.</span> <span class="sd"> Args:</span> <span class="sd"> filename: Filename of input file</span> <span class="sd"> file_format: String specifying any OpenBabel supported formats.</span> <span class="sd"> Returns:</span> <span class="sd"> BabelMolAdaptor object</span> <span class="sd"> &quot;&quot;&quot;</span> <span class="n">mols</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">pb</span><span class="o">.</span><span class="n">readfile</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">file_format</span><span class="p">),</span> <span class="nb">str</span><span class="p">(</span><span class="n">filename</span><span class="p">)))</span> <span class="k">return</span> <span class="n">BabelMolAdaptor</span><span class="p">(</span><span class="n">mols</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">OBMol</span><span class="p">)</span></div> <div class="viewcode-block" id="BabelMolAdaptor.from_string"><a class="viewcode-back" href="../../../pymatgen.io.babel.html#pymatgen.io.babel.BabelMolAdaptor.from_string">[docs]</a> <span class="nd">@staticmethod</span> <span class="k">def</span> <span class="nf">from_string</span><span class="p">(</span><span class="n">string_data</span><span class="p">,</span> <span class="n">file_format</span><span class="o">=</span><span class="s2">&quot;xyz&quot;</span><span class="p">):</span> <span class="sd">&quot;&quot;&quot;</span> <span class="sd"> Uses OpenBabel to read a molecule from a string in all supported</span> <span class="sd"> formats.</span> <span class="sd"> Args:</span> <span class="sd"> string_data: String containing molecule data.</span> <span class="sd"> file_format: String specifying any OpenBabel supported formats.</span> <span class="sd"> Returns:</span> <span class="sd"> BabelMolAdaptor object</span> <span class="sd"> &quot;&quot;&quot;</span> <span class="n">mols</span> <span class="o">=</span> <span class="n">pb</span><span class="o">.</span><span class="n">readstring</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">file_format</span><span class="p">),</span> <span class="nb">str</span><span class="p">(</span><span class="n">string_data</span><span class="p">))</span> <span class="k">return</span> <span class="n">BabelMolAdaptor</span><span class="p">(</span><span class="n">mols</span><span class="o">.</span><span class="n">OBMol</span><span class="p">)</span></div></div> </pre></div> </div> </div> </div> <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> <div class="<API key>"> <div id="searchbox" style="display: none" role="search"> <h3>Quick search</h3> <form class="search" action="../../../search.html" method="get"> <div><input type="text" name="q" /></div> <div><input type="submit" value="Go" /></div> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <div class="clearer"></div> </div> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../../../genindex.html" title="General Index" >index</a></li> <li class="right" > <a href="../../../py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="nav-item nav-item-0"><a href="../../../index.html">pymatgen 2017.11.6 documentation</a> &#187;</li> <li class="nav-item nav-item-1"><a href="../../index.html" >Module code</a> &#187;</li> <li class="nav-item nav-item-2"><a href="../../pymatgen.html" >pymatgen</a> &#187;</li> </ul> </div> <div class="footer" role="contentinfo"> & Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.6.5. </div> <div class="footer">This page uses <a href="http://analytics.google.com/"> Google Analytics</a> to collect statistics. You can disable it by blocking the JavaScript coming from www.google-analytics.com. <script type="text/javascript"> (function() { var ga = document.createElement('script'); ga.src = ('https:' == document.location.protocol ? 'https: ga.setAttribute('async', 'true'); document.documentElement.firstChild.appendChild(ga); })(); </script> </div> </body> </html>
// by DotNetNuke Corporation // documentation files (the "Software"), to deal in the Software without restriction, including without limitation // to permit persons to whom the Software is furnished to do so, subject to the following conditions: // of the Software. // TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System.Web.UI; namespace DotNetNuke.Web.Client.<API key> { using ClientDependency.Core.Controls; <summary> Registers a JavaScript resource </summary> public class DnnJsInclude : JsInclude { <summary> Sets up default settings for the control </summary> public DnnJsInclude() { ForceProvider = <API key>.DefaultJsProvider; } protected override void OnLoad(System.EventArgs e) { base.OnLoad(e); this.PathNameAlias = this.PathNameAlias.ToLowerInvariant(); } protected override void Render(HtmlTextWriter writer) { if (AddTag || Context.IsDebuggingEnabled) { writer.Write("<!--CDF({0}|{1}|{2}|{3})-->", DependencyType, FilePath, ForceProvider, Priority); } } } }
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Jasmine Spec Runner v2.4.1</title> <link rel="shortcut icon" type="image/png" href="lib/jasmine-2.4.1/jasmine_favicon.png"> <link rel="stylesheet" href="lib/jasmine-2.4.1/jasmine.css"> <script src="lib/jasmine-2.4.1/jasmine.js"></script> <script src="lib/jasmine-2.4.1/jasmine-html.js"></script> <script src="lib/jasmine-2.4.1/boot.js"></script> <!-- include source files here... --> <script src="src/Thermostat.js"></script> <!-- include spec files here... --> <script src="spec/SpecHelper.js"></script> <script src="spec/ThermostatSpec.js"></script> </head> <body> </body> </html>
import { moduleFor, test } from 'ember-qunit'; moduleFor('service:sounds', 'Unit | Service | sounds', { // Specify the other units that are required for this test. // needs: ['service:foo'] }); // Replace this with your real tests. test('it exists', function(assert) { let service = this.subject(); assert.ok(service); });
package com.microsoft.azure.management.network.v2019_09_01; import com.microsoft.azure.SubResource; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; /** * IP configuration of an application gateway. Currently 1 public and 1 private * IP configuration is allowed. */ @JsonFlatten public class <API key> extends SubResource { /** * Reference of the subnet resource. A subnet from where application * gateway gets its private address. */ @JsonProperty(value = "properties.subnet") private SubResource subnet; /** * The provisioning state of the application gateway IP configuration * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', * 'Failed'. */ @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; /** * Name of the IP configuration that is unique within an Application * Gateway. */ @JsonProperty(value = "name") private String name; /** * A unique read-only string that changes whenever the resource is updated. */ @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; /** * Type of the resource. */ @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) private String type; /** * Get reference of the subnet resource. A subnet from where application gateway gets its private address. * * @return the subnet value */ public SubResource subnet() { return this.subnet; } /** * Set reference of the subnet resource. A subnet from where application gateway gets its private address. * * @param subnet the subnet value to set * @return the <API key> object itself. */ public <API key> withSubnet(SubResource subnet) { this.subnet = subnet; return this; } /** * Get the provisioning state of the application gateway IP configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. * * @return the provisioningState value */ public ProvisioningState provisioningState() { return this.provisioningState; } /** * Get name of the IP configuration that is unique within an Application Gateway. * * @return the name value */ public String name() { return this.name; } /** * Set name of the IP configuration that is unique within an Application Gateway. * * @param name the name value to set * @return the <API key> object itself. */ public <API key> withName(String name) { this.name = name; return this; } /** * Get a unique read-only string that changes whenever the resource is updated. * * @return the etag value */ public String etag() { return this.etag; } /** * Get type of the resource. * * @return the type value */ public String type() { return this.type; } }
<reference path="../../../definitions/mocha.d.ts"/> <reference path="../../../definitions/node.d.ts"/> <reference path="../../../definitions/Q.d.ts"/> import assert = require('assert'); import trm = require('../../lib/taskRunner'); import path = require('path'); import os = require('os'); import fs = require('fs'); function setResponseFile(name: string) { process.env['MOCK_RESPONSES'] = path.join(__dirname, name); } describe('AzureCLI Suite', function () { this.timeout(20000); before((done) => { done(); }); after(function () { }); function <API key>(responseFileName:string, <API key>:string) { var jsonFileObject:any = JSON.parse(fs.readFileSync(path.join(__dirname,responseFileName)).toString()); if( !jsonFileObject.exec['/usr/local/bin/azure account import ' + <API key>]){ jsonFileObject.exec['/usr/local/bin/azure account import ' + <API key>] = jsonFileObject.exec['/usr/local/bin/azure account import subscriptions.publishsettings']; } fs.writeFileSync(path.join(__dirname,responseFileName), JSON.stringify(jsonFileObject)); } function addInlineObjectJson(responseFileName:string, <API key>:string) { var jsonFileObject:any = JSON.parse(fs.readFileSync(path.join(__dirname,responseFileName)).toString()); if(os.type() == "Windows_NT") { if( !jsonFileObject.exec[<API key>]){ jsonFileObject.exec[<API key>] = jsonFileObject.exec['script.bat arg1']; } if(!jsonFileObject.which[<API key>]) { jsonFileObject.which[<API key>] = <API key>; } if(!jsonFileObject.checkPath[<API key>]) { jsonFileObject.checkPath[<API key>] = true; } } else { if( !jsonFileObject.checkPath[<API key>]){ jsonFileObject.checkPath[<API key>] = true; } if( !jsonFileObject.exec[<API key>]){ jsonFileObject.exec[<API key>] = jsonFileObject.exec['script.bat arg1']; } } fs.writeFileSync(path.join(__dirname,responseFileName), JSON.stringify(jsonFileObject)); } function <API key>(responseFileName:string, <API key>:string) { var jsonFileObject:any = JSON.parse(fs.readFileSync(path.join(__dirname,responseFileName)).toString()); if(os.type() === "Windows_NT") { delete jsonFileObject.exec[<API key>]; delete jsonFileObject.which[<API key>]; delete jsonFileObject.checkPath[<API key>]; } else { delete jsonFileObject.exec[<API key>]; delete jsonFileObject.checkPath[<API key>]; } fs.writeFileSync(path.join(__dirname,responseFileName), JSON.stringify(jsonFileObject)); } function <API key>(responseFileName:string, <API key>:string) { var jsonFileObject:any = JSON.parse(fs.readFileSync(path.join(__dirname,responseFileName)).toString()); delete jsonFileObject.exec['/usr/local/bin/azure account import ' + <API key>]; fs.writeFileSync(path.join(__dirname,responseFileName), JSON.stringify(jsonFileObject)); } var <API key>:string = '.*subscriptions.*'; var inlineScriptName:string = '.*azureclitaskscript.*'; it('successfully login azure classic and run shell script (scriptPath)', (done) => { var responseFileName:string = 'azureclitaskPass.json'; <API key>(responseFileName, <API key>); setResponseFile(responseFileName); var tr = new trm.TaskRunner('AzureCLI', false, false, true); tr.setInput('scriptLocation', 'scriptPath'); tr.setInput('scriptPath', 'script.sh'); tr.setInput('cwd', 'fake/wd'); tr.setInput('args', 'arg1'); tr.setInput('failOnStandardError', 'false'); tr.setInput('<API key>', '<API key>'); tr.setInput('<API key>', 'AzureClassic'); tr.run() .then(() => { <API key>(responseFileName, <API key>); assert(tr.ran('/usr/local/bin/azure account clear -s sName'), 'it should have logged out of azure'); assert(tr.ran('/usr/local/bin/azure config mode asm'), 'it should have set the mode to asm'); assert(tr.invokedToolCount == 5, 'should have only run ShellScript'); assert(tr.stderr.length == 0, 'should have written to stderr'); assert(tr.succeeded, 'task should have succeeded'); done(); }) .fail((err) => { done(err); }); }) it('successfully login azure classic and run batch script (scriptPath)', (done) => { var responseFileName:string = 'azureclitaskPass.json'; <API key>(responseFileName, <API key>); setResponseFile(responseFileName); var tr = new trm.TaskRunner('AzureCLI', false, false, true); tr.setInput('scriptLocation', 'scriptPath'); tr.setInput('scriptPath', 'script.bat'); tr.setInput('cwd', 'fake/wd'); tr.setInput('args', 'arg1'); tr.setInput('failOnStandardError', 'false'); tr.setInput('<API key>', '<API key>'); tr.setInput('<API key>', 'AzureClassic'); tr.run() .then(() => { <API key>(responseFileName, <API key>) assert(tr.ran('/usr/local/bin/azure account clear -s sName'), 'it should have logged out of azure'); assert(tr.ran('/usr/local/bin/azure config mode asm'), 'it should have set the mode to asm'); assert(tr.invokedToolCount == 5, 'should have only run Batch Script'); assert(tr.stderr.length == 0, 'should have written to stderr'); assert(tr.succeeded, 'task should have succeeded'); done(); }) .fail((err) => { done(err); }); }) it('successfully login azure classic and run shell script (inline)', (done) => { var responseFileName:string = 'azureclitaskPass.json'; addInlineObjectJson(responseFileName, inlineScriptName); <API key>(responseFileName, <API key>); setResponseFile(responseFileName); var tr = new trm.TaskRunner('AzureCLI', false, false, true); tr.setInput('scriptLocation', 'inlineScript'); tr.setInput('inlineScript', 'console.log("test");'); tr.setInput('cwd', 'fake/wd'); tr.setInput('args', 'arg1'); tr.setInput('failOnStandardError', 'false'); tr.setInput('<API key>', '<API key>'); tr.setInput('<API key>', 'AzureClassic'); tr.run() .then(() => { <API key>(responseFileName, <API key>); <API key>(responseFileName, inlineScriptName); assert(tr.ran('/usr/local/bin/azure account clear -s sName'), 'it should have logged out of azure'); assert(tr.ran('/usr/local/bin/azure config mode asm'), 'it should have set the mode to asm'); assert(tr.invokedToolCount == 5, 'should have only run ShellScript'); assert(tr.stderr.length == 0, 'should have written to stderr'); assert(tr.succeeded, 'task should have succeeded'); done(); }) .fail((err) => { done(err); }); }) it('successfully login azure classic and run batch script (inline)', (done) => { var responseFileName:string = 'azureclitaskPass.json'; addInlineObjectJson(responseFileName, inlineScriptName); <API key>(responseFileName, <API key>); setResponseFile(responseFileName); var tr = new trm.TaskRunner('AzureCLI', false, false, true); tr.setInput('scriptLocation', 'inlineScript'); tr.setInput('inlineScript', 'console.log("test");'); tr.setInput('cwd', 'fake/wd'); tr.setInput('args', 'arg1'); tr.setInput('failOnStandardError', 'false'); tr.setInput('<API key>', '<API key>'); tr.setInput('<API key>', 'AzureClassic'); tr.run() .then(() => { <API key>(responseFileName, <API key>); <API key>(responseFileName, inlineScriptName); assert(tr.ran('/usr/local/bin/azure account clear -s sName'), 'it should have logged out of azure'); assert(tr.ran('/usr/local/bin/azure config mode asm'), 'it should have set the mode to asm'); assert(tr.invokedToolCount == 5, 'should have only run Batch Script'); assert(tr.stderr.length == 0, 'should have written to stderr'); assert(tr.succeeded, 'task should have succeeded'); done(); }) .fail((err) => { done(err); }); }) it('successfully login azure RM and run shell script (scriptPath)', (done) => { setResponseFile('azureclitaskPass.json'); var tr = new trm.TaskRunner('AzureCLI', false, false ,false); tr.setInput('scriptLocation', 'scriptPath'); tr.setInput('scriptPath', 'script.sh'); tr.setInput('cwd', 'fake/wd'); tr.setInput('args', 'arg1'); tr.setInput('failOnStandardError', 'false'); tr.setInput('<API key>', '<API key>'); tr.setInput('<API key>', 'AzureRM'); tr.run() .then(() => { assert(tr.ran('/usr/local/bin/azure account clear -s sName'), 'it should have logged out of azure'); assert(tr.ran('/usr/local/bin/azure config mode arm'), 'it should have set the mode to asm'); assert(tr.invokedToolCount == 5, 'should have only run ShellScript'); assert(tr.stderr.length == 0, 'should not have written to stderr'); assert(tr.succeeded, 'task should have succeeded'); done(); }) .fail((err) => { done(err); }); }) it('successfully login azure RM and run shell script (inline)', (done) => { var responseFileName:string = 'azureclitaskPass.json'; addInlineObjectJson(responseFileName, inlineScriptName); setResponseFile(responseFileName); var tr = new trm.TaskRunner('AzureCLI', false, false, true); tr.setInput('scriptLocation', 'inlineScript'); tr.setInput('inlineScript', 'console.log("test");'); tr.setInput('cwd', 'fake/wd'); tr.setInput('args', 'arg1'); tr.setInput('failOnStandardError', 'false'); tr.setInput('<API key>', '<API key>'); tr.setInput('<API key>', 'AzureRM'); tr.run() .then(() => { <API key>(responseFileName, inlineScriptName); assert(tr.ran('/usr/local/bin/azure account clear -s sName'), 'it should have logged out of azure'); assert(tr.ran('/usr/local/bin/azure config mode arm'), 'it should have set the mode to asm'); assert(tr.invokedToolCount == 5, 'should have only run ShellScript'); assert(tr.stderr.length == 0, 'should not have written to stderr'); assert(tr.succeeded, 'task should have succeeded'); done(); }) .fail((err) => { done(err); }); }) it('should fail when endpoint is not correct (scriptPath)',(done) => { setResponseFile('azureLoginFails.json'); var tr = new trm.TaskRunner('AzureCLI'); tr.setInput('scriptLocation', 'scriptPath'); tr.setInput('scriptPath', 'script.sh'); tr.setInput('cwd', 'fake/wd'); tr.setInput('args', 'arg1'); tr.setInput('failOnStandardError', 'false'); tr.setInput('<API key>', '<API key>'); tr.setInput('<API key>', 'InvalidEndpoint'); tr.run() .then(() => { assert(tr.invokedToolCount == 0, 'should have only run ShellScript'); assert(tr.stderr.length > 0, 'should have written to stderr'); assert(tr.failed, 'task should have failed'); done(); }) .fail((err) => { done(err); }); }) it('should not logout and not run bash when login failed AzureRM (scriptPath)',(done) => { setResponseFile('azureLoginFails.json'); var tr = new trm.TaskRunner('AzureCLI'); tr.setInput('scriptLocation', 'scriptPath'); tr.setInput('scriptPath', 'script.sh'); tr.setInput('cwd', 'fake/wd'); tr.setInput('args', 'arg1'); tr.setInput('failOnStandardError', 'false'); tr.setInput('<API key>', '<API key>'); tr.setInput('<API key>', 'AzureRMFail'); tr.run() .then(() => { assert(tr.invokedToolCount == 2, 'should have only run 2 azure invocations'); assert(tr.stderr.length > 0, 'should have written to stderr'); assert(tr.failed, 'task should have failed'); done(); }) .fail((err) => { done(err); }); }) it('should not logout and not run bash when login failed Classic (scriptPath)',(done) => { var responseFileName:string ='azureLoginFails.json'; <API key>(responseFileName, <API key>) setResponseFile(responseFileName); var tr = new trm.TaskRunner('AzureCLI', false, false, true); tr.setInput('scriptLocation', 'scriptPath'); tr.setInput('scriptPath', 'script.sh'); tr.setInput('cwd', 'fake/wd'); tr.setInput('args', 'arg1'); tr.setInput('failOnStandardError', 'false'); tr.setInput('<API key>', '<API key>'); tr.setInput('<API key>', 'AzureClassicFail'); tr.run() .then(() => { <API key>(responseFileName, <API key>) assert(tr.invokedToolCount == 2, 'should have only run 2 azure invocations'); assert(tr.stderr.length > 0, 'should have written to stderr'); assert(tr.failed, 'task should have failed'); done(); }) .fail((err) => { done(err); }); }) it('should logout and fail without running bash when subscription not set in AzureRM (scriptPath)',(done) => { setResponseFile('azureLoginFails.json'); var tr = new trm.TaskRunner('AzureCLI'); tr.setInput('scriptLocation', 'scriptPath'); tr.setInput('scriptPath', 'script.sh'); tr.setInput('cwd', 'fake/wd'); tr.setInput('args', 'arg1'); tr.setInput('failOnStandardError', 'false'); tr.setInput('<API key>', '<API key>'); tr.setInput('<API key>', 'AzureRM'); tr.run() .then(() => { assert(tr.ran('/usr/local/bin/azure account clear -s sName'), 'it should have logged out of azure'); assert(tr.invokedToolCount == 4, 'should have only run ShellScript'); assert(tr.resultWasSet, 'task should have set a result'); assert(tr.stderr.length > 0, 'should have written to stderr'); assert(tr.failed, 'task should have failed'); done(); }) .fail((err) => { done(err); }); }) it('should logout of AzureRM if shell script execution failed (scripPath)',(done) => { setResponseFile('<API key>.json'); var tr = new trm.TaskRunner('AzureCLI'); tr.setInput('scriptLocation', 'scriptPath'); tr.setInput('scriptPath', 'scriptfail.sh'); tr.setInput('cwd', 'fake/wd'); tr.setInput('args', 'arg1'); tr.setInput('failOnStandardError', 'false'); tr.setInput('<API key>', '<API key>'); tr.setInput('<API key>', 'AzureRM'); tr.run() .then(() => { assert(tr.invokedToolCount == 5, 'logout happened when bash fails'); assert(tr.stderr.length > 0, 'should have written to stderr'); assert(tr.failed, 'task should have failed'); done(); }) .fail((err) => { done(err); }); }) it('should logout of AzureClassic if shell script execution failed (scriptPath)',(done) => { var responseFileName:string = '<API key>.json'; <API key>(responseFileName, <API key>); setResponseFile(responseFileName); var tr = new trm.TaskRunner('AzureCLI', false, false, true); tr.setInput('scriptLocation', 'scriptPath'); tr.setInput('scriptPath', 'scriptfail.sh'); tr.setInput('cwd', 'fake/wd'); tr.setInput('args', 'arg1'); tr.setInput('failOnStandardError', 'false'); tr.setInput('<API key>', '<API key>'); tr.setInput('<API key>', 'AzureClassic'); tr.run() .then(() => { <API key>(responseFileName, <API key>); assert(tr.invokedToolCount == 5, 'logout happened when bash fails'); assert(tr.stderr.length > 0, 'should have written to stderr'); assert(tr.failed, 'task should have failed'); done(); }) .fail((err) => { done(err); }); }) it('should logout of AzureClassic if batch script execution failed (scriptPath)',(done) => { var responseFileName:string = '<API key>.json'; <API key>(responseFileName, <API key>); setResponseFile(responseFileName); var tr = new trm.TaskRunner('AzureCLI', false, false, true); tr.setInput('scriptLocation', 'scriptPath'); tr.setInput('scriptPath', 'scriptfail.bat'); tr.setInput('cwd', 'fake/wd'); tr.setInput('args', 'arg1'); tr.setInput('failOnStandardError', 'false'); tr.setInput('<API key>', '<API key>'); tr.setInput('<API key>', 'AzureClassic'); tr.run() .then(() => { <API key>(responseFileName, <API key>); assert(tr.invokedToolCount == 5, 'logout happened when bash fails'); assert(tr.stderr.length > 0, 'should have written to stderr'); assert(tr.failed, 'task should have failed'); done(); }) .fail((err) => { done(err); }); }) it('task should fail if bash not found',(done) => { setResponseFile('toolnotfoundFails.json'); var tr = new trm.TaskRunner('AzureCLI'); tr.run() .then(() => { assert(tr.invokedToolCount == 0, 'should not have invoked any tool'); assert(tr.stderr.length > 0, 'should have written to stderr'); assert(tr.failed, 'task should have failed'); done(); }) .fail((err) => { done(err); }); }) it('task should fail if cmd not found',(done) => { setResponseFile('toolnotfoundFails.json'); var tr = new trm.TaskRunner('AzureCLI'); tr.setInput('scriptLocation', 'scriptPath'); tr.setInput('cwd', 'fake/wd'); tr.setInput('scriptPath', 'script.bat'); tr.setInput('args', 'args1'); tr.setInput('failOnStandardError', 'false'); tr.run() .then(() => { assert(tr.invokedToolCount == 0, 'should not have invoked any tool'); assert(tr.stderr.length > 0, 'should have written to stderr'); assert(tr.failed, 'task should have failed'); done(); }) .fail((err) => { done(err); }); }) it('task should fail in case script path is invalid',(done) => { setResponseFile('checkpathFails.json'); var tr = new trm.TaskRunner('AzureCLI'); tr.setInput('scriptLocation', 'scriptPath'); tr.setInput('cwd', 'fake/wd'); tr.setInput('scriptPath', 'scriptfail.sh'); tr.run() .then(() => { assert(tr.invokedToolCount == 0, 'logout happened when script checkpath fails'); assert(tr.stderr.length > 0, 'should have written to stderr'); assert(tr.failed, 'task should have failed'); done(); }) .fail((err) => { done(err); }); }) });
module Capybara::Selenium::Driver::Ios module Profile class Chrome def self.driver_options(params = {}) options = { :ios_version => ::Capybara::IosEmulationDriver::LATEST_IOS_VERSION, :ios_device => :iphone, }.update(params) profile = ::Selenium::WebDriver::Chrome::Profile.new ua = ::Capybara::IosEmulationDriver::UserAgent.of(:ios => options[:ios_version], :device => options[:ios_device]) { :switches => [ '--<API key>', "--user-agent=' :prefs => profile } end end end end
{% extends "layout.html" %} {% block page_title %} {{ proto.title + ' ' + proto.version }} - Step 4 {% endblock %} {% block content %} <main id="content" role="main"> <div class="grid-row"> <div class="column-two-thirds"> <h1 class="heading-large">Your bank details</h1> <p> Industrial Injuries Disablement Benefit can be paid into a UK bank account, either your own or someone else's, or your own Post Office card account. You're responsible for repaying any overpayments, even if the money is paid into someone else's account. </p> <form action="{{ proto.path }}/payment_frequency" method="post"> <fieldset> <legend class="visuallyhidden">Enter bank details</legend> <div class="form-group"> <label class="form-label" for="AC_Name">Account holder name</label> <input type="text" class="form-control" id="AC_Name" name="AC_Name"> </div> <div class="form-group"> <label class="form-label" for="Bank_Name">Name of bank or building society</label> <input type="text" class="form-control" id="Bank_Name" name="Bank_Name"> </div> <div class="form-group"> <label class="form-label">Sort code</label> <div class="form-date form-group"> <div class="form-group form-group-day"> <label for="sort_1"></label> <input class="form-control" id="sort_1" name="sort_1" type="number" min="0" max="31"> </div> <div class="form-group form-group-month"> <label for="sort_2"></label> <input class="form-control" id="sort_2" name="sort_2" type="number" min="0" max="12"> </div> <div class="form-group form-group-year"> <label for="sort_3"></label> <input class="form-control" id="sort_3" name="sort_3" type="number" min="0" max="2016"> </div> </div> </div> <div class="form-group"> <label class="form-label" for="AC_Number">Account number</label> <input type="number" class="form-control" id="AC_Number" name="AC_Number"> </div> <details class="form-group" role="group" open=""> <summary role="button" aria-controls="details-content-0" aria-expanded="false"> <span class="summary">Post Office card account numbers</span> </summary> <div class="panel panel-border-narrow" id="details-content-0" aria-hidden="true"> <p class="form-hint"> If you're using a Post Office card account, your account number isn't the number on your card. Find the correct number on any letter you've had from the Post Office about your account.</p> </div> </details> <div class="form-group"> <label class="form-label" for="Build_Society">Building society roll or reference number (optional)</label> <input type="text" class="form-control" id="Build_Society" name="Build_Society"> </div> </fieldset> <fieldset class="primary-nav form-group"> <legend class="visuallyhidden">Form Navigation</legend> <input type="submit" value="Continue" class="button" id="submitButton" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"> </fieldset> </form> </div> </div> </main> {% endblock %} {% block body_end %} {{ super() }} {% endblock %}
import os import time from ethereum import utils from ethereum import pruning_trie as trie from ethereum.refcount_db import RefcountDB from ethereum.db import OverlayDB from ethereum.utils import to_string, is_string import rlp from rlp.utils import encode_hex from ethereum import blocks from ethereum import processblock from ethereum.slogging import get_logger from ethereum.config import Env import sys log = get_logger('eth.chain') class Index(object): """" Collection of indexes children: - needed to get the uncles of a block blocknumbers: - needed to mark the longest chain (path to top) transactions: - optional to resolve txhash to block:tx """ def __init__(self, env, index_transactions=True): assert isinstance(env, Env) self.env = env self.db = env.db self._index_transactions = index_transactions def add_block(self, blk): self.add_child(blk.prevhash, blk.hash) if self._index_transactions: self._add_transactions(blk) def <API key>(self, number): return 'blocknumber:%d' % number def update_blocknumbers(self, blk): "start from head and update until the existing indices match the block" while True: if blk.number > 0: self.db.put_temporarily(self.<API key>(blk.number), blk.hash) else: self.db.put(self.<API key>(blk.number), blk.hash) self.db.<API key>(blk.number) if blk.number == 0: break blk = blk.get_parent() if self.has_block_by_number(blk.number) and \ self.get_block_by_number(blk.number) == blk.hash: break def has_block_by_number(self, number): return self.<API key>(number) in self.db def get_block_by_number(self, number): "returns block hash" return self.db.get(self.<API key>(number)) def _add_transactions(self, blk): "'tx_hash' -> 'rlp([blockhash,tx_number])" for i, tx in enumerate(blk.get_transactions()): self.db.put_temporarily(tx.hash, rlp.encode([blk.hash, i])) self.db.<API key>(blk.number) def get_transaction(self, txhash): "return (tx, block, index)" blockhash, tx_num_enc = rlp.decode(self.db.get(txhash)) blk = rlp.decode(self.db.get(blockhash), blocks.Block, env=self.env) num = utils.decode_int(tx_num_enc) tx_data = blk.get_transaction(num) return tx_data, blk, num def _child_db_key(self, blk_hash): return b'ci:' + blk_hash def add_child(self, parent_hash, child_hash): # only efficient for few children per block children = list(set(self.get_children(parent_hash) + [child_hash])) assert children.count(child_hash) == 1 self.db.put_temporarily(self._child_db_key(parent_hash), rlp.encode(children)) def get_children(self, blk_hash): "returns block hashes" key = self._child_db_key(blk_hash) if key in self.db: return rlp.decode(self.db.get(key)) return [] class Chain(object): head_candidate = None def __init__(self, env, genesis=None, new_head_cb=None, coinbase='\x00' * 20): assert isinstance(env, Env) self.env = env self.db = self.blockchain = env.db self.new_head_cb = new_head_cb self.index = Index(self.env) self._coinbase = coinbase if 'HEAD' not in self.db: self.<API key>(genesis) log.debug('chain @', head_hash=self.head) self.genesis = self.get(self.index.get_block_by_number(0)) log.debug('got genesis', nonce=self.genesis.nonce.encode('hex'), difficulty=self.genesis.difficulty) self.<API key>() def <API key>(self, genesis=None): log.info('Initializing new chain') if not genesis: genesis = blocks.genesis(self.env) log.info('new genesis', genesis_hash=genesis, difficulty=genesis.difficulty) self.index.add_block(genesis) self._store_block(genesis) assert genesis == blocks.get_block(self.env, genesis.hash) self._update_head(genesis) assert genesis.hash in self self.commit() @property def coinbase(self): assert self.head_candidate.coinbase == self._coinbase return self._coinbase @coinbase.setter def coinbase(self, value): self._coinbase = value # block reward goes to different address => redo finalization of head candidate self._update_head(self.head) @property def head(self): if self.blockchain is None or 'HEAD' not in self.blockchain: self.<API key>() ptr = self.blockchain.get('HEAD') return blocks.get_block(self.env, ptr) def _update_head(self, block, <API key>=True): log.debug('updating head') if not block.is_genesis(): #assert self.head.chain_difficulty() < block.chain_difficulty() if block.get_parent() != self.head: log.debug('New Head is on a different branch', head_hash=block, old_head_hash=self.head) # Some temporary auditing to make sure pruning is working well if block.number > 0 and block.number % 500 == 0 and isinstance(self.db, RefcountDB): trie.proof.push(trie.RECORDING) block.to_dict(with_state=True) n = trie.proof.get_nodelist() trie.proof.pop() sys.stderr.write('State size: %d\n' % sum([(len(rlp.encode(a)) + 32) for a in n])) # Fork detected, revert death row and change logs if block.number > 0: b = block.get_parent() h = self.head b_children = [] if b.hash != h.hash: log.warn('reverting') while h.number > b.number: h.state.db.<API key>(h.number) h = h.get_parent() while b.number > h.number: b_children.append(b) b = b.get_parent() while b.hash != h.hash: h.state.db.<API key>(h.number) h = h.get_parent() b_children.append(b) b = b.get_parent() for bc in b_children: processblock.verify(bc, bc.get_parent()) self.blockchain.put('HEAD', block.hash) assert self.blockchain.get('HEAD') == block.hash sys.stderr.write('New head: %s %d\n' % (utils.encode_hex(block.hash), block.number)) self.index.update_blocknumbers(self.head) self.<API key>(<API key>) if self.new_head_cb and not block.is_genesis(): self.new_head_cb(block) def <API key>(self, <API key>=True): "after new head is set" log.debug('updating head candidate') # collect uncles blk = self.head # parent of the block we are collecting uncles for uncles = set(u.header for u in self.get_brothers(blk)) for i in range(self.env.config['MAX_UNCLE_DEPTH'] + 2): for u in blk.uncles: assert isinstance(u, blocks.BlockHeader) uncles.discard(u) if blk.has_parent(): blk = blk.get_parent() assert not uncles or max(u.number for u in uncles) <= self.head.number uncles = list(uncles)[:self.env.config['MAX_UNCLES']] # create block ts = max(int(time.time()), self.head.timestamp + 1) _env = Env(OverlayDB(self.head.db), self.env.config, self.env.global_config) head_candidate = blocks.Block.init_from_parent(self.head, coinbase=self._coinbase, timestamp=ts, uncles=uncles, env=_env) assert head_candidate.validate_uncles() self.<API key> = head_candidate.state_root head_candidate.finalize() # add transactions from previous head candidate old_head_candidate = self.head_candidate self.head_candidate = head_candidate if old_head_candidate is not None and <API key>: log.debug('forwarding pending transactions') for tx in old_head_candidate.get_transactions(): self.add_transaction(tx) else: log.debug('discarding pending transactions') def get_uncles(self, block): """Return the uncles of `block`.""" if not block.has_parent(): return [] else: return self.get_brothers(block.get_parent()) def get_brothers(self, block): """Return the uncles of the hypothetical child of `block`.""" o = [] i = 0 while block.has_parent() and i < self.env.config['MAX_UNCLE_DEPTH']: parent = block.get_parent() o.extend([u for u in self.get_children(parent) if u != block]) block = block.get_parent() i += 1 return o def get(self, blockhash): assert is_string(blockhash) assert len(blockhash) == 32 return blocks.get_block(self.env, blockhash) def has_block(self, blockhash): assert is_string(blockhash) assert len(blockhash) == 32 return blockhash in self.blockchain def __contains__(self, blockhash): return self.has_block(blockhash) def _store_block(self, block): if block.number > 0: self.blockchain.put_temporarily(block.hash, rlp.encode(block)) else: self.blockchain.put(block.hash, rlp.encode(block)) def commit(self): self.blockchain.commit() def add_block(self, block, <API key>=True): "returns True if block was added sucessfully" _log = log.bind(block_hash=block) # make sure we know the parent if not block.has_parent() and not block.is_genesis(): _log.debug('missing parent') return False if not block.validate_uncles(): _log.debug('invalid uncles') return False if not len(block.nonce) == 8: _log.debug('nonce not set') return False elif not block.header.check_pow(nonce=block.nonce) and\ not block.is_genesis(): _log.debug('invalid nonce') return False if block.has_parent(): try: processblock.verify(block, block.get_parent()) except processblock.VerificationFailed as e: _log.critical('VERIFICATION FAILED', error=e) f = os.path.join(utils.data_dir, 'badblock.log') open(f, 'w').write(to_string(block.hex_serialize())) return False if block.number < self.head.number: _log.debug("older than head", head_hash=self.head) # Q: Should we have any limitations on adding blocks? self.index.add_block(block) self._store_block(block) # set to head if this makes the longest chain w/ most work for that number if block.chain_difficulty() > self.head.chain_difficulty(): _log.debug('new head') self._update_head(block, <API key>) elif block.number > self.head.number: _log.warn('has higher blk number than head but lower chain_difficulty', head_hash=self.head, block_difficulty=block.chain_difficulty(), head_difficulty=self.head.chain_difficulty()) block.transactions.clear_all() block.receipts.clear_all() block.state.db.<API key>(block.number) block.state.db.cleanup(block.number) self.commit() # batch commits all changes that came with the new block return True def get_children(self, block): return [self.get(c) for c in self.index.get_children(block.hash)] def add_transaction(self, transaction): """Add a transaction to the :attr:`head_candidate` block. If the transaction is invalid, the block will not be changed. :returns: `True` is the transaction was successfully added or `False` if the transaction was invalid """ assert self.head_candidate is not None head_candidate = self.head_candidate log.debug('add tx', num_txs=self.num_transactions(), tx=transaction, on=head_candidate) if self.head_candidate.<API key>(transaction.hash): log.debug('known tx') return old_state_root = head_candidate.state_root # revert finalization head_candidate.state_root = self.<API key> try: success, output = processblock.apply_transaction(head_candidate, transaction) except processblock.InvalidTransaction as e: # if unsuccessful the prerequisites were not fullfilled # and the tx is invalid, state must not have changed log.debug('invalid tx', error=e) head_candidate.state_root = old_state_root # reset return False log.debug('valid tx') # we might have a new head_candidate (due to ctx switches in pyethapp) if self.head_candidate != head_candidate: log.debug('head_candidate changed during validation, trying again') self.add_transaction(transaction) return self.<API key> = head_candidate.state_root head_candidate.finalize() log.debug('tx applied', result=output) assert old_state_root != head_candidate.state_root return True def get_transactions(self): """Get a list of new transactions not yet included in a mined block but known to the chain. """ if self.head_candidate: log.debug('get_transactions called', on=self.head_candidate) return self.head_candidate.get_transactions() else: return [] def num_transactions(self): if self.head_candidate: return self.head_candidate.transaction_count else: return 0 def get_chain(self, start='', count=10): "return 'count' blocks starting from head or start" log.debug("get_chain", start=encode_hex(start), count=count) blocks = [] block = self.head if start: if start not in self.index.db: return [] block = self.get(start) if not self.in_main_branch(block): return [] for i in range(count): blocks.append(block) if block.is_genesis(): break block = block.get_parent() return blocks def in_main_branch(self, block): try: return block.hash == self.index.get_block_by_number(block.number) except KeyError: return False def get_descendants(self, block, count=1): log.debug("get_descendants", block_hash=block) assert block.hash in self block_numbers = list(range(block.number + 1, min(self.head.number + 1, block.number + count + 1))) return [self.get(self.index.get_block_by_number(n)) for n in block_numbers]
/*jslint vars: true, plusplus: true, devel: true, nomen: true, regexp: true, indent: 4, maxerr: 50 */ /*global define, $, window, Mustache */ /* * The core search functionality used by Find in Files and single-file Replace Batch. */ define(function (require, exports, module) { "use strict"; var _ = require("thirdparty/lodash"), FileFilters = require("search/FileFilters"), Async = require("utils/Async"), StringUtils = require("utils/StringUtils"), ProjectManager = require("project/ProjectManager"), DocumentModule = require("document/Document"), DocumentManager = require("document/DocumentManager"), FileSystem = require("filesystem/FileSystem"), LanguageManager = require("language/LanguageManager"), SearchModel = require("search/SearchModel").SearchModel, PerfUtils = require("utils/PerfUtils"), FindUtils = require("search/FindUtils"); /** * Token used to indicate a specific reason for zero search results * @const @type {!Object} */ var <API key> = {}; /** * The search query and results model. * @type {SearchModel} */ var searchModel = new SearchModel(); /* Forward declarations */ var <API key>, <API key>, <API key>; /** Remove the listeners that were tracking potential search result changes */ function _removeListeners() { $(DocumentModule).off("documentChange", <API key>); FileSystem.off("change", <API key>); $(DocumentManager).off("fileNameChange", <API key>); } /** Add listeners to track events that might change the search result set */ function _addListeners() { if (searchModel.hasResults()) { // Avoid adding duplicate listeners - e.g. if a 2nd search is run without closing the old results panel first _removeListeners(); $(DocumentModule).on("documentChange", <API key>); FileSystem.on("change", <API key>); $(DocumentManager).on("fileNameChange", <API key>); } } /** * @private * Searches through the contents and returns an array of matches * @param {string} contents * @param {RegExp} queryExpr * @return {!Array.<{start: {line:number,ch:number}, end: {line:number,ch:number}, line: string}>} */ function _getSearchMatches(contents, queryExpr) { // Quick exit if not found or if we hit the limit if (searchModel.foundMaximum || contents.search(queryExpr) === -1) { return []; } var match, lineNum, line, ch, totalMatchLength, matchedLines, numMatchedLines, lastLineLength, lines = StringUtils.getLines(contents), matches = []; while ((match = queryExpr.exec(contents)) !== null) { lineNum = StringUtils.offsetToLineNum(lines, match.index); line = lines[lineNum]; ch = match.index - contents.lastIndexOf("\n", match.index) - 1; // 0-based index matchedLines = match[0].split("\n"); numMatchedLines = matchedLines.length; totalMatchLength = match[0].length; lastLineLength = matchedLines[matchedLines.length - 1].length; // Don't store more than 200 chars per line line = line.substr(0, Math.min(200, line.length)); matches.push({ start: {line: lineNum, ch: ch}, end: {line: lineNum + numMatchedLines - 1, ch: (numMatchedLines === 1 ? ch + totalMatchLength : lastLineLength)}, // Note that the following offsets from the beginning of the file are *not* updated if the search // results change. These are currently only used for multi-file replacement, and we always // abort the replace (by shutting the results panel) if we detect any result changes, so we don't // need to keep them up to date. Eventually, we should either get rid of the need for these (by // doing everything in terms of line/ch offsets, though that will require re-splitting files when // doing a replace) or properly update them. startOffset: match.index, endOffset: match.index + totalMatchLength, line: line, result: match, isChecked: true }); // We have the max hits in just this 1 file. Stop searching this file. // This fixed issue #1829 where code hangs on too many hits. if (matches.length >= SearchModel.MAX_TOTAL_RESULTS) { queryExpr.lastIndex = 0; break; } // Pathological regexps like /^/ return 0-length matches. Ensure we make progress anyway if (totalMatchLength === 0) { queryExpr.lastIndex++; } } return matches; } /** * @private * Update the search results using the given list of changes for the given document * @param {Document} doc The Document that changed, should be the current one * @param {Array.<{from: {line:number,ch:number}, to: {line:number,ch:number}, text: !Array.<string>}>} changeList * An array of changes as described in the Document constructor */ function _updateResults(doc, changeList) { var i, diff, matches, lines, start, howMany, resultsChanged = false, fullPath = doc.file.fullPath, resultInfo = searchModel.results[fullPath]; // Remove the results before we make any changes, so the SearchModel can accurately update its count. searchModel.removeResults(fullPath); changeList.forEach(function (change) { lines = []; start = 0; howMany = 0; // There is no from or to positions, so the entire file changed, we must search all over again if (!change.from || !change.to) { // TODO: add unit test exercising timestamp logic in this case // We don't just call <API key>() here because we want to continue iterating through changes in // the list and update at the end. resultInfo = {matches: _getSearchMatches(doc.getText(), searchModel.queryExpr), timestamp: doc.diskTimestamp}; resultsChanged = true; } else { // Get only the lines that changed for (i = 0; i < change.text.length; i++) { lines.push(doc.getLine(change.from.line + i)); } // We need to know how many newlines were inserted/deleted in order to update the rest of the line indices; // this is the total number of newlines inserted (which is the length of the lines array minus // 1, since the last line in the array is inserted without a newline after it) minus the // number of original newlines being removed. diff = lines.length - 1 - (change.to.line - change.from.line); if (resultInfo) { // Search the last match before a replacement, the amount of matches deleted and update // the lines values for all the matches after the change resultInfo.matches.forEach(function (item) { if (item.end.line < change.from.line) { start++; } else if (item.end.line <= change.to.line) { howMany++; } else { item.start.line += diff; item.end.line += diff; } }); // Delete the lines that where deleted or replaced if (howMany > 0) { resultInfo.matches.splice(start, howMany); } resultsChanged = true; } // Searches only over the lines that changed matches = _getSearchMatches(lines.join("\r\n"), searchModel.queryExpr); if (matches.length) { // Updates the line numbers, since we only searched part of the file matches.forEach(function (value, key) { matches[key].start.line += change.from.line; matches[key].end.line += change.from.line; }); // If the file index exists, add the new matches to the file at the start index found before if (resultInfo) { Array.prototype.splice.apply(resultInfo.matches, [start, 0].concat(matches)); // If not, add the matches to a new file index } else { // TODO: add unit test exercising timestamp logic in self case resultInfo = { matches: matches, collapsed: false, timestamp: doc.diskTimestamp }; } resultsChanged = true; } } }); // Always re-add the results, even if nothing changed. if (resultInfo && resultInfo.matches.length) { searchModel.setResults(fullPath, resultInfo); } if (resultsChanged) { // Pass `true` for quickChange here. This will make listeners debounce the change event, // avoiding lots of updates if the user types quickly. searchModel.fireChanged(true); } } /** * Checks that the file matches the given subtree scope. To fully check whether the file * should be in the search set, use _inSearchScope() instead - a supserset of this. * * @param {!File} file * @param {?FileSystemEntry} scope Search scope, or null if whole project * @return {boolean} */ function _subtreeFilter(file, scope) { if (scope) { if (scope.isDirectory) { // Dirs always have trailing slash, so we don't have to worry about being // a substring of another dir name return file.fullPath.indexOf(scope.fullPath) === 0; } else { return file.fullPath === scope.fullPath; } } return true; } /** * Filters out files that are known binary types. * @param {string} fullPath * @return {boolean} True if the file's contents can be read as text */ function _isReadableText(fullPath) { return !LanguageManager.getLanguageForPath(fullPath).isBinary(); } /** * Finds all candidate files to search in the given scope's subtree that are not binary content. Does NOT apply * the current filter yet. * @param {?FileSystemEntry} scope Search scope, or null if whole project * @return {$.Promise} A promise that will be resolved with the list of files in the scope. Never rejected. */ function getCandidateFiles(scope) { function filter(file) { return _subtreeFilter(file, scope) && _isReadableText(file.fullPath); } // If the scope is a single file, just check if the file passes the filter directly rather than // trying to use ProjectManager.getAllFiles(), both for performance and because an individual // in-memory file might be an untitled document that doesn't show up in getAllFiles(). if (scope && scope.isFile) { return new $.Deferred().resolve(filter(scope) ? [scope] : []).promise(); } else { return ProjectManager.getAllFiles(filter, true); } } /** * Checks that the file is eligible for inclusion in the search (matches the user's subtree scope and * file exclusion filters, and isn't binary). Used when updating results incrementally - during the * initial search, these checks are done in bulk via getCandidateFiles() and the filterFileList() call * after it. * @param {!File} file * @return {boolean} */ function _inSearchScope(file) { // Replicate the checks getCandidateFiles() does if (searchModel && searchModel.scope) { if (!_subtreeFilter(file, searchModel.scope)) { return false; } } else { // Still need to make sure it's within project or working set // In getCandidateFiles(), this is covered by the baseline getAllFiles() itself if (file.fullPath.indexOf(ProjectManager.getProjectRoot().fullPath) !== 0) { var inWorkingSet = DocumentManager.getWorkingSet().some(function (wsFile) { return wsFile.fullPath === file.fullPath; }); if (!inWorkingSet) { return false; } } } if (!_isReadableText(file.fullPath)) { return false; } // Replicate the filtering filterFileList() does return FileFilters.filterPath(searchModel.filter, file.fullPath); } /** * @private * Tries to update the search result on document changes * @param {$.Event} event * @param {Document} document * @param {<{from: {line:number,ch:number}, to: {line:number,ch:number}, text: !Array.<string>}>} change * A change list as described in the Document constructor */ <API key> = function (event, document, change) { if (_inSearchScope(document.file)) { _updateResults(document, change); } }; /** * @private * Finds search results in the given file and adds them to 'searchResults.' Resolves with * true if any matches found, false if none found. Errors reading the file are treated the * same as if no results found. * * Does not perform any filtering - assumes caller has already vetted this file as a search * candidate. * * @param {!File} file * @return {$.Promise} */ function _doSearchInOneFile(file) { var result = new $.Deferred(); DocumentManager.getDocumentText(file) .done(function (text, timestamp) { // Note that we don't fire a model change here, since this is always called by some outer batch // operation that will fire it once it's done. var matches = _getSearchMatches(text, searchModel.queryExpr); searchModel.setResults(file.fullPath, {matches: matches, timestamp: timestamp}); result.resolve(!!matches.length); }) .fail(function () { // Always resolve. If there is an error, this file // is skipped and we move on to the next file. result.resolve(false); }); return result.promise(); } /** * @private * Executes the Find in Files search inside the current scope. * @param {{query: string, caseSensitive: boolean, isRegexp: boolean}} queryInfo Query info object * @param {!$.Promise} <API key> Promise from getCandidateFiles(), which was called earlier * @param {?string} filter A "compiled" filter as returned by FileFilters.compile(), or null for no filter * @return {?$.Promise} A promise that's resolved with the search results (or <API key>) or rejected when the find competes. * Will be null if the query is invalid. */ function _doSearch(queryInfo, <API key>, filter) { searchModel.filter = filter; var queryResult = searchModel.setQueryInfo(queryInfo); if (!queryResult.valid) { return null; } var scopeName = searchModel.scope ? searchModel.scope.fullPath : ProjectManager.getProjectRoot().fullPath, perfTimer = PerfUtils.markStart("FindIn: " + scopeName + " - " + queryInfo.query); return <API key> .then(function (fileListResult) { // Filter out files/folders that match user's current exclusion filter fileListResult = FileFilters.filterFileList(filter, fileListResult); if (fileListResult.length) { return Async.doInParallel(fileListResult, _doSearchInOneFile); } else { return <API key>; } }) .then(function (zeroFilesToken) { exports._searchDone = true; // for unit tests PerfUtils.addMeasurement(perfTimer); // Listen for FS & Document changes to keep results up to date _addListeners(); if (zeroFiles<API key>) { return zeroFilesToken; } else { return searchModel.results; } }, function (err) { console.log("find in files failed: ", err); PerfUtils.finalizeMeasurement(perfTimer); // In jQuery promises, returning the error here propagates the rejection, // unlike in Promises/A, where we would need to re-throw it to do so. return err; }); } /** * @private * Clears any previous search information, removing update listeners and clearing the model. * @param {?Entry} scope Project file/subfolder to search within; else searches whole project. */ function clearSearch() { _removeListeners(); searchModel.clear(); } /** * Does a search in the given scope with the given filter. Used when you want to start a search * programmatically. * @param {{query: string, caseSensitive: boolean, isRegexp: boolean}} queryInfo Query info object * @param {?Entry} scope Project file/subfolder to search within; else searches whole project. * @param {?string} filter A "compiled" filter as returned by FileFilters.compile(), or null for no filter * @param {?string} replaceText If this is a replacement, the text to replace matches with. This is just * stored in the model for later use - the replacement is not actually performed right now. * @param {?$.Promise} <API key> If specified, a promise that should resolve with the same set of files that * getCandidateFiles(scope) would return. * @return {$.Promise} A promise that's resolved with the search results or rejected when the find competes. */ function doSearchInScope(queryInfo, scope, filter, replaceText, <API key>) { clearSearch(); searchModel.scope = scope; if (replaceText !== undefined) { searchModel.isReplace = true; searchModel.replaceText = replaceText; } <API key> = <API key> || getCandidateFiles(scope); return _doSearch(queryInfo, <API key>, filter); } /** * Given a set of search results, replaces them with the given replaceText, either on disk or in memory. * @param {Object.<fullPath: string, {matches: Array.<{start: {line:number,ch:number}, end: {line:number,ch:number}, startOffset: number, endOffset: number, line: string}>, collapsed: boolean}>} results * The list of results to replace, as returned from _doSearch.. * @param {string} replaceText The text to replace each result with. * @param {?Object} options An options object: * forceFilesOpen: boolean - Whether to open all files in editors and do replacements there rather than doing the * replacements on disk. Note that even if this is false, files that are already open in editors will have replacements * done in memory. * isRegexp: boolean - Whether the original query was a regexp. If true, $-substitution is performed on the replaceText. * @return {$.Promise} A promise that's resolved when the replacement is finished or rejected with an array of errors * if there were one or more errors. Each individual item in the array will be a {item: string, error: string} object, * where item is the full path to the file that could not be updated, and error is either a FileSystem error or one * of the `FindInFiles.ERROR_*` constants. */ function doReplace(results, replaceText, options) { return FindUtils.performReplacements(results, replaceText, options).always(function () { // For UI integration testing only exports._replaceDone = true; }); } /** * @private * Moves the search results from the previous path to the new one and updates the results list, if required * @param {$.Event} event * @param {string} oldName * @param {string} newName */ <API key> = function (event, oldName, newName) { var resultsChanged = false; // Update the search results _.forEach(searchModel.results, function (item, fullPath) { if (fullPath.indexOf(oldName) === 0) { searchModel.removeResults(fullPath); searchModel.setResults(fullPath.replace(oldName, newName), item); resultsChanged = true; } }); if (resultsChanged) { searchModel.fireChanged(); } }; /** * @private * Updates search results in response to FileSystem "change" event * @param {$.Event} event * @param {FileSystemEntry} entry * @param {Array.<FileSystemEntry>=} added Added children * @param {Array.<FileSystemEntry>=} removed Removed children */ <API key> = function (event, entry, added, removed) { var resultsChanged = false; /* * Remove existing search results that match the given entry's path * @param {(File|Directory)} entry */ function <API key>(entry) { Object.keys(searchModel.results).forEach(function (fullPath) { if (fullPath.indexOf(entry.fullPath) === 0) { searchModel.removeResults(fullPath); resultsChanged = true; } }); } /* * Add new search results for this entry and all of its children * @param {(File|Directory)} entry * @return {jQuery.Promise} Resolves when the results have been added */ function <API key>(entry) { var addedFiles = [], deferred = new $.Deferred(); // gather up added files var visitor = function (child) { // Replicate filtering that getAllFiles() does if (ProjectManager.shouldShow(child)) { if (child.isFile && _isReadableText(child.name)) { // Re-check the filtering that the initial search applied if (_inSearchScope(child)) { addedFiles.push(child); } } return true; } return false; }; entry.visit(visitor, function (err) { if (err) { deferred.reject(err); return; } // find additional matches in all added files Async.doInParallel(addedFiles, function (file) { return _doSearchInOneFile(file) .done(function (foundMatches) { resultsChanged = resultsChanged || foundMatches; }); }).always(deferred.resolve); }); return deferred.promise(); } if (!entry) { // TODO: re-execute the search completely? return; } var addPromise; if (entry.isDirectory) { if (!added || !removed) { // If the added or removed sets are null, must redo the search for the entire subtree - we // don't know which child files/folders may have been added or removed. <API key>(entry); var deferred = $.Deferred(); addPromise = deferred.promise(); entry.getContents(function (err, entries) { Async.doInParallel(entries, <API key>).always(deferred.resolve); }); } else { removed.forEach(<API key>); addPromise = Async.doInParallel(added, <API key>); } } else { // entry.isFile <API key>(entry); addPromise = <API key>(entry); } addPromise.always(function () { // Restore the results if needed if (resultsChanged) { searchModel.fireChanged(); } }); }; // Public exports exports.searchModel = searchModel; exports.doSearchInScope = doSearchInScope; exports.doReplace = doReplace; exports.getCandidateFiles = getCandidateFiles; exports.clearSearch = clearSearch; exports.<API key> = <API key>; // For unit tests only exports.<API key> = <API key>; exports.<API key> = <API key>; exports.<API key> = <API key>; });
<?php namespace OckCyp\CoversValidator\Tests\Fixtures; use PHPUnit\Framework\TestCase; class <API key> extends TestCase { /** * @covers NonExistentClass */ public function testDummyTest() { } }
package goodhosts import ( "fmt" "testing" ) func TestItemInSlice(t *testing.T) { item := "this" list := []string{"hello", "brah"} result := itemInSlice("goodbye", list) if result { t.Error(fmt.Sprintf("'%' should not have been found in slice.", item)) } item = "hello" result = itemInSlice(item, list) if !result { t.Error(fmt.Sprintf("'%' should have been found in slice.", item)) } }
// GJCFStringUitil.h // GJCommonFoundation #import <Foundation/Foundation.h> #import <CoreGraphics/CoreGraphics.h> @interface GJCFStringUitil : NSObject + (BOOL)stringIsNull:(NSString *)string; + (BOOL)<API key>:(NSString *)string; + (BOOL)stringToBool:(NSString*)sourceString; + (NSInteger)stringToInt:(NSString*)sourceString; + (CGFloat)stringToFloat:(NSString*)sourceString; + (double)stringToDouble:(NSString*)sourceString; + (NSString *)boolToString:(BOOL)boolValue; + (NSString *)intToString:(NSInteger)intValue; + (NSString *)floatToString:(CGFloat)floatValue; + (NSString *)doubleToString:(double)doubleValue; + (BOOL)<API key>:(NSString *)string; + (BOOL)<API key>:(NSString *)string; + (BOOL)<API key>:(NSString *)string; + (BOOL)<API key>:(NSString *)string; + (BOOL)<API key>:(NSString *)string; + (BOOL)<API key>:(NSString *)string; + (BOOL)stringIsValidateUrl:(NSString *)string; + (BOOL)<API key>:(NSString *)string; + (BOOL)<API key>:(NSString *)string; + (BOOL)stringJustHasNumber:(NSString *)string; + (BOOL)<API key>:(NSString *)string; + (BOOL)sourceString:(NSString*)sourceString regexMatch:(NSString *)regexString; + (NSString*)stringFromFile:(NSString*)path; + (NSString*)<API key>; + (NSString *)unarchieveFromPath:(NSString *)filePath; + (NSString *)MD5:(NSString *)string; + (NSString *)<API key>:(NSString *)string; + (NSString *)<API key>:(NSString *)string; + (NSString *)<API key>:(NSString *)string; + (NSString *)urlEncode:(id)object; + (NSString *)<API key>:(NSDictionary *)dict; + (NSRange)stringRange:(NSString *)string; @end
#.rst: # FindHSPELL # Try to find Hspell # Once done this will define # HSPELL_FOUND - system has Hspell # HSPELL_INCLUDE_DIR - the Hspell include directory # HSPELL_LIBRARIES - The libraries needed to use Hspell # HSPELL_DEFINITIONS - Compiler switches required for using Hspell # <API key> - The version of Hspell found (x.y) # <API key> - the major version of Hspell # <API key> - The minor version of Hspell find_path(HSPELL_INCLUDE_DIR hspell.h) find_library(HSPELL_LIBRARIES NAMES hspell) if (HSPELL_INCLUDE_DIR) file(STRINGS "${HSPELL_INCLUDE_DIR}/hspell.h" HSPELL_H REGEX "#define HSPELL_VERSION_M(AJO|INO)R [0-9]+") string(REGEX REPLACE ".*#define <API key> ([0-9]+).*" "\\1" <API key> "${HSPELL_H}") string(REGEX REPLACE ".*#define <API key> ([0-9]+).*" "\\1" <API key> "${HSPELL_H}") set(<API key> "${<API key>}.${<API key>}") unset(HSPELL_H) endif() include(${<API key>}/<API key>.cmake) <API key>(HSPELL REQUIRED_VARS HSPELL_LIBRARIES HSPELL_INCLUDE_DIR VERSION_VAR <API key>) mark_as_advanced(HSPELL_INCLUDE_DIR HSPELL_LIBRARIES)
require 'thread' module RailsMetrics # An instrumenter that does not send notifications. This is used in the # AsyncQueue so saving events does not send any notifications, not even # for logging. class VoidInstrumenter < ::ActiveSupport::Notifications::Instrumenter def instrument(name, payload={}) yield(payload) if block_given? end end class AsyncConsumer attr_reader :thread def initialize(queue=Queue.new, &block) @off = true @block = block @queue = queue @mutex = Mutex.new @thread = Thread.new do <API key> consume end end def push(*args) @mutex.synchronize { @off = false } @queue.push(*args) end def finished? @off end protected def <API key> #:nodoc: Thread.current[:"instrumentation_#{notifier.object_id}"] = VoidInstrumenter.new(notifier) end def notifier #:nodoc: ActiveSupport::Notifications.notifier end def consume #:nodoc: while args = @queue.shift @block.call(args) @mutex.synchronize { @off = @queue.empty? } end end end end
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_17) on Mon Dec 02 20:33:05 CET 2013 --> <title>Uses of Package org.lwjgl.util.jinput (LWJGL API)</title> <meta name="date" content="2013-12-02"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><! if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Package org.lwjgl.util.jinput (LWJGL API)"; } </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <div class="topNav"><a name="navbar_top"> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li>Class</li> <li class="navBarCell1Rev">Use</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/lwjgl/util/jinput/package-use.html" target="_top">Frames</a></li> <li><a href="package-use.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <a name="skip-navbar_top"> </a></div> <div class="header"> <h1 title="Uses of Package org.lwjgl.util.jinput" class="title">Uses of Package<br>org.lwjgl.util.jinput</h1> </div> <div class="contentContainer">No usage of org.lwjgl.util.jinput</div> <div class="bottomNav"><a name="navbar_bottom"> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="<API key>"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li>Class</li> <li class="navBarCell1Rev">Use</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/lwjgl/util/jinput/package-use.html" target="_top">Frames</a></li> <li><a href="package-use.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <a name="skip-navbar_bottom"> </a></div> <p class="legalCopy"><small><i>Copyright & </body> </html>
// <auto-generated> // Dieser Code wurde von einem Tool generiert. // der Code erneut generiert wird. // </auto-generated> using NMF.Collections.Generic; using NMF.Collections.ObjectModel; using NMF.Expressions; using NMF.Expressions.Linq; using NMF.Models; using NMF.Models.Collections; using NMF.Models.Expressions; using NMF.Models.Meta; using NMF.Models.Repository; using NMF.Serialization; using NMF.Utilities; using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Diagnostics; using System.Linq; using TTC2017.SmartGrids.CIM.IEC61968.Assets; using TTC2017.SmartGrids.CIM.IEC61968.Common; using TTC2017.SmartGrids.CIM.IEC61968.Customers; using TTC2017.SmartGrids.CIM.IEC61970.Core; using TTC2017.SmartGrids.CIM.IEC61970.Informative.InfAssets; using TTC2017.SmartGrids.CIM.IEC61970.Informative.InfCommon; using TTC2017.SmartGrids.CIM.IEC61970.Informative.InfCustomers; using TTC2017.SmartGrids.CIM.IEC61970.Informative.InfERPSupport; using TTC2017.SmartGrids.CIM.IEC61970.Informative.InfGMLSupport; using TTC2017.SmartGrids.CIM.IEC61970.Informative.InfWork; using TTC2017.SmartGrids.CIM.IEC61970.Outage; namespace TTC2017.SmartGrids.CIM.IEC61970.Informative.InfOperations { <summary> The public interface for OutageCode </summary> [<API key>(typeof(OutageCode))] [<API key>(typeof(OutageCode))] public interface IOutageCode : IModelElement, IIdentifiedObject { <summary> The subCode property </summary> string SubCode { get; set; } <summary> The OutageRecords property </summary> <API key><IOutageRecord> OutageRecords { get; } <summary> The OutageSteps property </summary> <API key><IOutageStep> OutageSteps { get; } <summary> Gets fired before the SubCode property changes its value </summary> event System.EventHandler<<API key>> SubCodeChanging; <summary> Gets fired when the SubCode property changed its value </summary> event System.EventHandler<<API key>> SubCodeChanged; } }
<!-- $$test comment$$ --> <p class="b-site-header" attr="\testattrvalue\"> Hello from {{ vm.title }} </p>
Simplify Payment PHP Server [![Deploy](https: ====================== This is an companion application to help developers start building mobile applications using Simplify Commerce by MasterCard to accept payments. For more information on how Simplify Commerce works, please go through the overview section of Tutorial at Simplify.com - https: ##Steps for running * Register with Heroku (if you haven't done so already) * Register with [Simplify Commerce](https: * Click on "Deploy to Heroku" button you see above * Go to index.php from the deployed app for next steps... ##Steps for integrating with iOS & Android apps * Copy the url and paste it in your application. For example in iOS: ios NSURL *url= [NSURL URLWithString:@"http://arcane-ridge-6454.herokuapp.com/charge.php"]; * Add code to post ios //Process Request on your own server NSURLResponse *response; NSData *responseData = [NSURLConnection <API key>:request returningResponse:&response error:&error]; NSString *string = [[NSString alloc] initWithData:responseData encoding:<API key>]; NSLog(@"responseData: %@", string); * Or in Android: java URL url = null; HttpURLConnection con = null; try { URL url = new URL("http://simplifypay.herokuapp.com//charge.php"); HttpURLConnection con = (HttpURLConnection) url.openConnection(); //add reuqest header con.setRequestMethod("POST"); con.setRequestProperty("User-Agent", ""Mozilla/5.0"); con.setRequestProperty("Accept-Language", "en-US,en;q=0.5"); String urlParameters = "simplifyToken="+token.getId()+"&amount=1000"; // Send post request con.setDoOutput(true); DataOutputStream wr = new DataOutputStream(con.getOutputStream()); wr.writeBytes(urlParameters); wr.flush(); wr.close(); int responseCode = con.getResponseCode(); System.out.println("\nSending 'POST' request to URL : " + url); System.out.println("Post parameters : " + urlParameters); System.out.println("Response Code : " + responseCode); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); String inputLine; StringBuffer response = new StringBuffer(); while ((inputLine = in.readLine()) != null) { response.append(inputLine); } in.close(); //print result System.out.println(response.toString()); } catch (Exception e) { e.printStackTrace(); } finally { con.close(); } ##References * https: * https://www.simplify.com/commerce/docs/tutorial/index#payments-form * https://www.simplify.com/commerce/docs/tutorial/index#testing
## Changelog 1.0.3.2 Released 2019-08-21. - Added flag to use hardcoded values for registry keys: The names of the registry keys used to store package information are available as CPP values from file lauxlib.h since Lua 5.3.4; compiling HsLua against older Lua versions was not possible, as those values were expected to exist. The respective values are now hardcoded into HsLua, and a new flag `hardcode-reg-key` is introduced, which will cause the use of these hardcoded values instead of those defined in lauxlib.h. Using this flag makes it possible to compile hslua against all Lua 5.3.* versions. - Added missing C files for benchmarking to list of *extra-source-files*. 1.0.3.1 Released 2019-05-08. - Prevent filenames being treated as strings in debug messages. Lua's `loadbuffer` takes a `source` description as an argument, which is used for debug messages. The `loadfile` function now adds a special prefix (`@`) to `source`, thus marking it as a filename. 1.0.3 Released 2019-05-04. - New module `Foreign.Lua.Module`, containing helper functions to define and load modules from Haskell. - Improve documentation of `open<lib>` (many thanks to Christian Charukiewicz.) 1.0.2 Released 2019-01-05. - Fixed cross-compilation: placement of C import declarations were fixed, thereby resolving issues with cross-compilation. (Vanessa McHale and Faraz Maleknia) - Added .gitattributes file, fixing the wrong language classification of the GitHub repository. (Vanessa McHale) - Improved `toHaskellFunction` documentation. The documentation is now more specific on which Haskell exceptions are caught and which will lead to crashes. 1.0.1 - Exposed more functions from Lua's `lauxlib` library: + `getmetafield`, + `getmetatable'`, + `getsubtable`, and + `traceback`. The function `getsubtable` is a reimplementation instead of a wrapper to the C function for simplicity (thereby avoiding additional C wrappers). - Fixed tests for GHC 8.6 by no longer depending on failable pattern matching. 1.0.0 # New features - Error handling at language borders has been vastly improved and is now mostly automatic. Haskell's `Foreign.Lua.Exception`s are transformed into Lua errors and *vice versa*. Lua-side wrappers are no longer necessary. - Haskell functions are no longer pushed as userdata by `pushHaskellFunction`, but as C functions. This simplifies tasks where Lua expects true function objects object (for example when looking for module loaders). - Added stack instance for + Data.Set.Set, + Integer, + Int, + Float, and + Double. Instances for numbers fall back to strings when the representation as a Lua number would cause a loss of precision. - Haskell functions pushed with `pushHaskellFunction` can now be garbage collected by Lua without having to call back into Haskell. The callback into Haskell by the GC had previously caused programs to hang in some situations. - Bindings to more Lua C API functions and macros: `isinteger`, `load`, `loadbuffer`, and `pushglobaltable`. - Any Haskell value can be pushed to the Lua stack as userdata via `pushAny` and retrieved via `peekAny`. Additional functions are provided to setup the userdata metatable. - The C preprocessor constants `LUA_LOADED_TABLE` and `LUA_PRELOAD_TABLE` are made available as `<API key>` and `<API key>`, respectively. - Additional small helper functions: + `peekRead` -- read value from a string. + `popValue` -- peek value at the top of the Lua stack, then remove it from the stack regardless of whether peeking was successful or not. # Naming - The *Lua* prefix was removed from types (`State`, `Integer`, `Number`, `Exception`) and the respective infix from functions (`try`, `run`, `runWith`, `runEither`). HsLua should be imported qualified to avoid name collisions. - Terminology now consistently uses *exception* to refer to Haskell exceptions, and *error* for Lua errors; function names changed accordingly (`throwException`, `catchException`, `<API key>`). - Module *Foreign.Lua.Api* was renamed to *Foreign.Lua.Core*. - *Foreign.Lua.lerror* was renamed to *Foreign.Lua.error*. - Typeclass *ToLuaStack* was renamed to *Pushable*. - Typeclass *FromLuaStack* was renamed to *Peekable*. - Cabal flag *use-pkgconfig* was renamed to *pkg-config* (which is the flag name used by other projects such a zlib). # Type signatures - The return value of `lua_newuserdata` is *CSize* (was *CInt*). - Table index parameter in `rawgeti` and `rawseti` must be of type *LuaInteger*, but were of type *Int*. - The number of upvalues passed to `pushcclosure` must be of type *NumArgs*. - `Lua.error` has type *Lua NumResults*, simplifying its use in HaskellFunctions. - Retrieval functions which can fail, i.e. `tocfunction`, `tointeger`, `tonumber`, `tostring`, `tothread`, and `touserdata`, use the *Maybe* type to indicate success or failure, avoiding the need to perform additional checks. # Removed Features - Support for Lua versions before 5.3 has been dropped. - Support for GHC 7.8 has been dropped. - `wrapHaskellFunction` has been made internal and is no longer exported. # Changed behavior - Peekable instances for numbers and strings became more forgiving. Peeking of basic types now follows Lua's default conversion rules: + numbers can be given as strings, and *vice versa*; + any value can be converted into a boolean -- only `nil` and `false` are peeked as `False`, all other as `True`. # Other - Many internal improvements and additions such as a benchmarking suite, code cleanups, better tests, etc. 0.9.5.{1,2} - Relaxed upper bound on *exceptions*. 0.9.5 - Provide Optional as a replacement for OrNil. Exports of the latter have been fixed. - Provide utility function `raiseError`: Its argument will be thrown as an error in Lua. - Add `modifyLuaError`: The function lives in Foreign.Lua.Error and allows to alter error messages. This is most useful for amending errors with additional information. - Fixed a bug in `toList` which left a element on the stack if deserializing that element lead to an error. This also affected the FromLuaStack instance for lists. - Fixed a bug in `pairsFromTable` which left a key-value pair on the stack if either of them could not be read into the expected type. This also affected the FromLuaStack instance for Map. 0.9.4 - Make Lua an instance of MonadMask: MonadMask from Control.Monad.Catch allows to mask asynchronous exceptions. This allows to define a finalizer for Lua operations. - Add functions and constants to refer to stack indices: The functions `nthFromBottom`, `nthFromTop` as well as the constants `stackTop` and `stackBottom` have been introduced. Numeric constants are less clear, and named constants can aid readability. - Add type OrNil: This type can be used when dealing with optional arguments to Lua functions. - Add function absindex: it converts the acceptable index `idx` into an equivalent absolute index (that is, one that does not depend on the stack top). The function calls `lua_absindex` when compiled with Lua 5.2 or later; for Lua 5.1, it is reimplemented in Haskell. - Functions in `tasty` which have been deprecated have been replaced with non-deprecated alternatives. 0.9.3 - Re-export more FunctionCalling helpers in `Foreign.Lua`: The typeclass `ToHaskellFunction` and the helper function `toHaskellFunction` are useful when working with functions. Importing them separately from `Foreign.Lua.FunctionCalling` was an unnecessary burden; they are therefor now re-exported by the main module. - Export registry-relatd constants `refnil` and `noref`: The constants are related to Lua's registry functions (`ref` and `unref`). - Add helper to convert functions into CFunction: A new helper `wrapHaskellFunction` is provided. It expects a <API key> userdata (as produced by `pushHaskellFunction`) on top of the stack and replaces it with a C function. The new function converts error values generated with `lerror` into Lua errors, i.e. it calls `lua_error`. - Add utility function `setglobal'`: It works like `setglobal`, but works with packages and nested tables (dot-notation only). 0.9.2 - Add cabal flag 'export-dynamic': Default behavior is to include all symbols in the dynamic symbol table, as this enables users to load dynamic lua libraries. However, it is sometimes desirable to disable, e.g., when compiling a fully static binary. See jgm/pandoc#3986. 0.9.1 - Increase user-friendlyness of error messages: The error message returned by `toHaskellFunction` hinted at the fact that the failing function is a Haskell function. This is mostly unnecessary information and might have confused users. 0.9.0 - Added cabal flag to allow fully safe garbage collection: Lua garbage collection can occur in most of the API functions, even in those usually not calling back into haskell and hence marked as optimizable. The effect of this is that finalizers which call Haskell functions will cause the program to hang. A new flag `allow-unsafe-gc` is introduced and enabled by default. Disabling this flag will mark more C API functions as potentially calling back into Haskell. This has a serious performance impact. - `FromLuaStack` and `ToLuaStack` instances for lazy ByteStrings are added. - None-string error messages are handled properly: Lua allows error messages to be of any type, but the haskell error handlers expected string values. Tables, booleans, and other non-string values are now handled as well and converted to strings. 0.8.0 - Use newtype definitions instead of type aliases for LuaNumber and LuaInteger. This makes it easier to ensure the correct numeric instances in situations where Lua might have been compiled with 32-bit numbers. - Instances of `FromLuaStack` and `ToLuaStack` for `Int` are removed. The correctness of these instances cannot be guaranteed if Lua was compiled with a non-standard integer type. 0.7.1 - The flag `lua_32bits` was added to allow users to compile Lua for 32-bit systems. - When reading a list, throw an error if the lua value isn't a table instead of silently returning an empty list. 0.7.0 - Tuples from pairs to octuples have been made instances of `FromLuaStack` and `ToLuaStack`. - New functions `dostring` and `dofile` are provided to load and run strings and files in a single step. - `LuaStatus` was renamed to `Status`, the *Lua* prefix was removed from its type constructors. - The constructor `ErrFile` was added to `Status`. It is returned by `loadfile` if the file cannot be read. - Remove unused FFI bindings and unused types, including all functions unsafe to use from within Haskell and the library functions added with 0.5.0. Users with special requirements should define their own wrappers and raw bindings. - The module *Foreign.Lua.Api.SafeBindings* was merge into *Foreign.Lua.Api.RawBindings*. - FFI bindings are changed to use newtypes where sensible, most notably `StackIndex`, `NumArgs`, and `NumResults`, but also the newly introduced newtypes `StatusCode`, `TypeCode`, and `LuaBool`. - Add functions `tointegerx` and `tonumberx` which can be used to get and check values from the stack in a single step. - The signature of `concat` was changed from `Int -> Lua ()` to `NumArgs -> Lua ()`. - The signature of `loadfile` was changed from `String -> Lua Int` to `String -> Lua Status`. - The type `LTYPE` was renamed to `Type`, its constructors were renamed to follow the pattern `Type<Typename>`. `LuaRelation` was renamed to `RelationalOperator`, the *Lua* prefix was removed from its constructors. - Add function `tolist` to allow getting a generic list from the stack without having to worry about the overlapping instance with `[Char]`. 0.6.0 * Supported Lua Versions now include Lua 5.2 and Lua 5.3. LuaJIT and Lua 5.1 remain supported as well. * Flag `use-pkgconfig` was added to allow discovery of library and include paths via pkg-config. Setting a specific Lua version flag now implies `system-lua`. (Sean Proctor) * The module was renamed from `Scripting.Lua` to `Foreign.Lua`. The code is now split over multiple sub-modules. Files processed with hsc2hs are restricted to Foreign.Lua.Api. * A `Lua` monad (reader monad over LuaState) is introduced. Functions which took a LuaState as their first argument are changed into monadic functions within that monad. * Error handling has been redesigned completely. A new LuaException was introduced and is thrown in unexpected situations. Errors in lua which are leading to a `longjmp` are now caught with the help of additional C wrapper functions. Those no longer lead to uncontrolled program termination but are converted into a LuaException. * `peek` no longer returns `Maybe a` but just `a`. A LuaException is thrown if an error occurs (i.e. in situtations where Nothing would have been returned previously). * The `StackValue` typeclass has been split into `FromLuaStack` and `ToLuaStack`. Instances not satisfying the law `x == push x *> peek (-1)` have been dropped. * Documentation of API functions was improved. Most docstrings have been copied from the official Lua manual, enriched with proper markup and links, and changed to properly describe hslua specifics when necessary. * Example programs have been moved to a separate repository. * Unused files were removed. (Sean Proctor) 0.5.0 * New raw functions for `luaopen_base`, `luaopen_package`, `luaopen_string`, `luaopen_table`, `luaopen_math`, `luaopen_io`, `luaopen_os`, `luaopen_debug` and their high-level wrappers (with names `openbase`, `opentable` etc.) implemented. * Remove custom versions of `loadfile` and `loadstring`. * Drop support for GHC versions < 7.8, avoid compiler warnings. * Ensure no symbols are stripped when linking the bundled lua interpreter. * Simplify `tostring` function definition. (Sean Proctor) * Explicitly deprecate `strlen`. (Sean Proctor) * Add links to lua documentation for functions wrapping the official lua C API. (Sean Proctor). 0.4.1 * Bugfix(#30): `tolist` wasn't popping elements of the list from stack. 0.4.0 * `pushstring` and `tostring` now uses `ByteString` instead of `[Char]`. * `StackValue [Char]` instance is removed, `StackValue ByteString` is added. * `StackValue a => StackValue [a]` instance is added. It pushes a Lua array to the stack. `pushlist`, `islist` and `tolist` functions are added. * Type errors in Haskell functions now propagated differently. See the `Scripting.Lua` documentation for detailed explanation. This should fix segfaults reported several times. * `lua_error` function is removed, it's never safe to call in Haskell. Related issues and pull requests: #12, #26, #24, #23, #18. 0.3.14 * Pkgconf-based setup removed. Cabal is now using `extra-libraries` to link with Lua. * `luajit` flag is added to link hslua with LuaJIT. 0.3.13 * Small bugfix related with GHCi running under Windows. 0.3.12 * `pushrawhsfunction` and `<API key>` functions are added. * `apicheck` flag is added to Cabal package to enable Lua API checking. (useful for debugging) 0.3.11 * `luaL_ref` and `luaL_unref` functions are added.
i.flag:not(.icon) { display: inline-block; width: 16px; height: 11px; line-height: 11px; vertical-align: baseline; margin: 0em 0.5em 0em 0em; text-decoration: inherit; speak: none; font-smoothing: antialiased; -<API key>: hidden; backface-visibility: hidden; } i.flag:not(.icon):before { display: inline-block; content: ''; background: url("../themes/default/assets/images/flags.png") no-repeat 0px 0px; width: 16px; height: 11px; } i.flag.ad:before, i.flag.andorra:before { background-position: 0px 0px; } i.flag.ae:before, i.flag.united.arab.emirates:before, i.flag.uae:before { background-position: 0px -26px; } i.flag.af:before, i.flag.afghanistan:before { background-position: 0px -52px; } i.flag.ag:before, i.flag.antigua:before { background-position: 0px -78px; } i.flag.ai:before, i.flag.anguilla:before { background-position: 0px -104px; } i.flag.al:before, i.flag.albania:before { background-position: 0px -130px; } i.flag.am:before, i.flag.armenia:before { background-position: 0px -156px; } i.flag.an:before, i.flag.netherlands.antilles:before { background-position: 0px -182px; } i.flag.ao:before, i.flag.angola:before { background-position: 0px -208px; } i.flag.ar:before, i.flag.argentina:before { background-position: 0px -234px; } i.flag.as:before, i.flag.american.samoa:before { background-position: 0px -260px; } i.flag.at:before, i.flag.austria:before { background-position: 0px -286px; } i.flag.au:before, i.flag.australia:before { background-position: 0px -312px; } i.flag.aw:before, i.flag.aruba:before { background-position: 0px -338px; } i.flag.ax:before, i.flag.aland.islands:before { background-position: 0px -364px; } i.flag.az:before, i.flag.azerbaijan:before { background-position: 0px -390px; } i.flag.ba:before, i.flag.bosnia:before { background-position: 0px -416px; } i.flag.bb:before, i.flag.barbados:before { background-position: 0px -442px; } i.flag.bd:before, i.flag.bangladesh:before { background-position: 0px -468px; } i.flag.be:before, i.flag.belgium:before { background-position: 0px -494px; } i.flag.bf:before, i.flag.burkina.faso:before { background-position: 0px -520px; } i.flag.bg:before, i.flag.bulgaria:before { background-position: 0px -546px; } i.flag.bh:before, i.flag.bahrain:before { background-position: 0px -572px; } i.flag.bi:before, i.flag.burundi:before { background-position: 0px -598px; } i.flag.bj:before, i.flag.benin:before { background-position: 0px -624px; } i.flag.bm:before, i.flag.bermuda:before { background-position: 0px -650px; } i.flag.bn:before, i.flag.brunei:before { background-position: 0px -676px; } i.flag.bo:before, i.flag.bolivia:before { background-position: 0px -702px; } i.flag.br:before, i.flag.brazil:before { background-position: 0px -728px; } i.flag.bs:before, i.flag.bahamas:before { background-position: 0px -754px; } i.flag.bt:before, i.flag.bhutan:before { background-position: 0px -780px; } i.flag.bv:before, i.flag.bouvet.island:before { background-position: 0px -806px; } i.flag.bw:before, i.flag.botswana:before { background-position: 0px -832px; } i.flag.by:before, i.flag.belarus:before { background-position: 0px -858px; } i.flag.bz:before, i.flag.belize:before { background-position: 0px -884px; } i.flag.ca:before, i.flag.canada:before { background-position: 0px -910px; } i.flag.cc:before, i.flag.cocos.islands:before { background-position: 0px -962px; } i.flag.cd:before, i.flag.congo:before { background-position: 0px -988px; } i.flag.cf:before, i.flag.central.african.republic:before { background-position: 0px -1014px; } i.flag.cg:before, i.flag.congo.brazzaville:before { background-position: 0px -1040px; } i.flag.ch:before, i.flag.switzerland:before { background-position: 0px -1066px; } i.flag.ci:before, i.flag.cote.divoire:before { background-position: 0px -1092px; } i.flag.ck:before, i.flag.cook.islands:before { background-position: 0px -1118px; } i.flag.cl:before, i.flag.chile:before { background-position: 0px -1144px; } i.flag.cm:before, i.flag.cameroon:before { background-position: 0px -1170px; } i.flag.cn:before, i.flag.china:before { background-position: 0px -1196px; } i.flag.co:before, i.flag.colombia:before { background-position: 0px -1222px; } i.flag.cr:before, i.flag.costa.rica:before { background-position: 0px -1248px; } i.flag.cs:before, i.flag.serbia:before { background-position: 0px -1274px; } i.flag.cu:before, i.flag.cuba:before { background-position: 0px -1300px; } i.flag.cv:before, i.flag.cape.verde:before { background-position: 0px -1326px; } i.flag.cx:before, i.flag.christmas.island:before { background-position: 0px -1352px; } i.flag.cy:before, i.flag.cyprus:before { background-position: 0px -1378px; } i.flag.cz:before, i.flag.czech.republic:before { background-position: 0px -1404px; } i.flag.de:before, i.flag.germany:before { background-position: 0px -1430px; } i.flag.dj:before, i.flag.djibouti:before { background-position: 0px -1456px; } i.flag.dk:before, i.flag.denmark:before { background-position: 0px -1482px; } i.flag.dm:before, i.flag.dominica:before { background-position: 0px -1508px; } i.flag.do:before, i.flag.dominican.republic:before { background-position: 0px -1534px; } i.flag.dz:before, i.flag.algeria:before { background-position: 0px -1560px; } i.flag.ec:before, i.flag.ecuador:before { background-position: 0px -1586px; } i.flag.ee:before, i.flag.estonia:before { background-position: 0px -1612px; } i.flag.eg:before, i.flag.egypt:before { background-position: 0px -1638px; } i.flag.eh:before, i.flag.western.sahara:before { background-position: 0px -1664px; } i.flag.er:before, i.flag.eritrea:before { background-position: 0px -1716px; } i.flag.es:before, i.flag.spain:before { background-position: 0px -1742px; } i.flag.et:before, i.flag.ethiopia:before { background-position: 0px -1768px; } i.flag.eu:before, i.flag.european.union:before { background-position: 0px -1794px; } i.flag.fi:before, i.flag.finland:before { background-position: 0px -1846px; } i.flag.fj:before, i.flag.fiji:before { background-position: 0px -1872px; } i.flag.fk:before, i.flag.falkland.islands:before { background-position: 0px -1898px; } i.flag.fm:before, i.flag.micronesia:before { background-position: 0px -1924px; } i.flag.fo:before, i.flag.faroe.islands:before { background-position: 0px -1950px; } i.flag.fr:before, i.flag.france:before { background-position: 0px -1976px; } i.flag.ga:before, i.flag.gabon:before { background-position: -36px 0px; } i.flag.gb:before, i.flag.england:before, i.flag.united.kingdom:before { background-position: -36px -26px; } i.flag.gd:before, i.flag.grenada:before { background-position: -36px -52px; } i.flag.ge:before, i.flag.georgia:before { background-position: -36px -78px; } i.flag.gf:before, i.flag.french.guiana:before { background-position: -36px -104px; } i.flag.gh:before, i.flag.ghana:before { background-position: -36px -130px; } i.flag.gi:before, i.flag.gibraltar:before { background-position: -36px -156px; } i.flag.gl:before, i.flag.greenland:before { background-position: -36px -182px; } i.flag.gm:before, i.flag.gambia:before { background-position: -36px -208px; } i.flag.gn:before, i.flag.guinea:before { background-position: -36px -234px; } i.flag.gp:before, i.flag.guadeloupe:before { background-position: -36px -260px; } i.flag.gq:before, i.flag.equatorial.guinea:before { background-position: -36px -286px; } i.flag.gr:before, i.flag.greece:before { background-position: -36px -312px; } i.flag.gs:before, i.flag.sandwich.islands:before { background-position: -36px -338px; } i.flag.gt:before, i.flag.guatemala:before { background-position: -36px -364px; } i.flag.gu:before, i.flag.guam:before { background-position: -36px -390px; } i.flag.gw:before, i.flag.guinea-bissau:before { background-position: -36px -416px; } i.flag.gy:before, i.flag.guyana:before { background-position: -36px -442px; } i.flag.hk:before, i.flag.hong.kong:before { background-position: -36px -468px; } i.flag.hm:before, i.flag.heard.island:before { background-position: -36px -494px; } i.flag.hn:before, i.flag.honduras:before { background-position: -36px -520px; } i.flag.hr:before, i.flag.croatia:before { background-position: -36px -546px; } i.flag.ht:before, i.flag.haiti:before { background-position: -36px -572px; } i.flag.hu:before, i.flag.hungary:before { background-position: -36px -598px; } i.flag.id:before, i.flag.indonesia:before { background-position: -36px -624px; } i.flag.ie:before, i.flag.ireland:before { background-position: -36px -650px; } i.flag.il:before, i.flag.israel:before { background-position: -36px -676px; } i.flag.in:before, i.flag.india:before { background-position: -36px -702px; } i.flag.io:before, i.flag.indian.ocean.territory:before { background-position: -36px -728px; } i.flag.iq:before, i.flag.iraq:before { background-position: -36px -754px; } i.flag.ir:before, i.flag.iran:before { background-position: -36px -780px; } i.flag.is:before, i.flag.iceland:before { background-position: -36px -806px; } i.flag.it:before, i.flag.italy:before { background-position: -36px -832px; } i.flag.jm:before, i.flag.jamaica:before { background-position: -36px -858px; } i.flag.jo:before, i.flag.jordan:before { background-position: -36px -884px; } i.flag.jp:before, i.flag.japan:before { background-position: -36px -910px; } i.flag.ke:before, i.flag.kenya:before { background-position: -36px -936px; } i.flag.kg:before, i.flag.kyrgyzstan:before { background-position: -36px -962px; } i.flag.kh:before, i.flag.cambodia:before { background-position: -36px -988px; } i.flag.ki:before, i.flag.kiribati:before { background-position: -36px -1014px; } i.flag.km:before, i.flag.comoros:before { background-position: -36px -1040px; } i.flag.kn:before, i.flag.saint.kitts.and.nevis:before { background-position: -36px -1066px; } i.flag.kp:before, i.flag.north.korea:before { background-position: -36px -1092px; } i.flag.kr:before, i.flag.south.korea:before { background-position: -36px -1118px; } i.flag.kw:before, i.flag.kuwait:before { background-position: -36px -1144px; } i.flag.ky:before, i.flag.cayman.islands:before { background-position: -36px -1170px; } i.flag.kz:before, i.flag.kazakhstan:before { background-position: -36px -1196px; } i.flag.la:before, i.flag.laos:before { background-position: -36px -1222px; } i.flag.lb:before, i.flag.lebanon:before { background-position: -36px -1248px; } i.flag.lc:before, i.flag.saint.lucia:before { background-position: -36px -1274px; } i.flag.li:before, i.flag.liechtenstein:before { background-position: -36px -1300px; } i.flag.lk:before, i.flag.sri.lanka:before { background-position: -36px -1326px; } i.flag.lr:before, i.flag.liberia:before { background-position: -36px -1352px; } i.flag.ls:before, i.flag.lesotho:before { background-position: -36px -1378px; } i.flag.lt:before, i.flag.lithuania:before { background-position: -36px -1404px; } i.flag.lu:before, i.flag.luxembourg:before { background-position: -36px -1430px; } i.flag.lv:before, i.flag.latvia:before { background-position: -36px -1456px; } i.flag.ly:before, i.flag.libya:before { background-position: -36px -1482px; } i.flag.ma:before, i.flag.morocco:before { background-position: -36px -1508px; } i.flag.mc:before, i.flag.monaco:before { background-position: -36px -1534px; } i.flag.md:before, i.flag.moldova:before { background-position: -36px -1560px; } i.flag.me:before, i.flag.montenegro:before { background-position: -36px -1586px; } i.flag.mg:before, i.flag.madagascar:before { background-position: -36px -1613px; } i.flag.mh:before, i.flag.marshall.islands:before { background-position: -36px -1639px; } i.flag.mk:before, i.flag.macedonia:before { background-position: -36px -1665px; } i.flag.ml:before, i.flag.mali:before { background-position: -36px -1691px; } i.flag.mm:before, i.flag.myanmar:before, i.flag.burma:before { background-position: -36px -1717px; } i.flag.mn:before, i.flag.mongolia:before { background-position: -36px -1743px; } i.flag.mo:before, i.flag.macau:before { background-position: -36px -1769px; } i.flag.mp:before, i.flag.northern.mariana.islands:before { background-position: -36px -1795px; } i.flag.mq:before, i.flag.martinique:before { background-position: -36px -1821px; } i.flag.mr:before, i.flag.mauritania:before { background-position: -36px -1847px; } i.flag.ms:before, i.flag.montserrat:before { background-position: -36px -1873px; } i.flag.mt:before, i.flag.malta:before { background-position: -36px -1899px; } i.flag.mu:before, i.flag.mauritius:before { background-position: -36px -1925px; } i.flag.mv:before, i.flag.maldives:before { background-position: -36px -1951px; } i.flag.mw:before, i.flag.malawi:before { background-position: -36px -1977px; } i.flag.mx:before, i.flag.mexico:before { background-position: -72px 0px; } i.flag.my:before, i.flag.malaysia:before { background-position: -72px -26px; } i.flag.mz:before, i.flag.mozambique:before { background-position: -72px -52px; } i.flag.na:before, i.flag.namibia:before { background-position: -72px -78px; } i.flag.nc:before, i.flag.new.caledonia:before { background-position: -72px -104px; } i.flag.ne:before, i.flag.niger:before { background-position: -72px -130px; } i.flag.nf:before, i.flag.norfolk.island:before { background-position: -72px -156px; } i.flag.ng:before, i.flag.nigeria:before { background-position: -72px -182px; } i.flag.ni:before, i.flag.nicaragua:before { background-position: -72px -208px; } i.flag.nl:before, i.flag.netherlands:before { background-position: -72px -234px; } i.flag.no:before, i.flag.norway:before { background-position: -72px -260px; } i.flag.np:before, i.flag.nepal:before { background-position: -72px -286px; } i.flag.nr:before, i.flag.nauru:before { background-position: -72px -312px; } i.flag.nu:before, i.flag.niue:before { background-position: -72px -338px; } i.flag.nz:before, i.flag.new.zealand:before { background-position: -72px -364px; } i.flag.om:before, i.flag.oman:before { background-position: -72px -390px; } i.flag.pa:before, i.flag.panama:before { background-position: -72px -416px; } i.flag.pe:before, i.flag.peru:before { background-position: -72px -442px; } i.flag.pf:before, i.flag.french.polynesia:before { background-position: -72px -468px; } i.flag.pg:before, i.flag.new.guinea:before { background-position: -72px -494px; } i.flag.ph:before, i.flag.philippines:before { background-position: -72px -520px; } i.flag.pk:before, i.flag.pakistan:before { background-position: -72px -546px; } i.flag.pl:before, i.flag.poland:before { background-position: -72px -572px; } i.flag.pm:before, i.flag.saint.pierre:before { background-position: -72px -598px; } i.flag.pn:before, i.flag.pitcairn.islands:before { background-position: -72px -624px; } i.flag.pr:before, i.flag.puerto.rico:before { background-position: -72px -650px; } i.flag.ps:before, i.flag.palestine:before { background-position: -72px -676px; } i.flag.pt:before, i.flag.portugal:before { background-position: -72px -702px; } i.flag.pw:before, i.flag.palau:before { background-position: -72px -728px; } i.flag.py:before, i.flag.paraguay:before { background-position: -72px -754px; } i.flag.qa:before, i.flag.qatar:before { background-position: -72px -780px; } i.flag.re:before, i.flag.reunion:before { background-position: -72px -806px; } i.flag.ro:before, i.flag.romania:before { background-position: -72px -832px; } i.flag.rs:before, i.flag.serbia:before { background-position: -72px -858px; } i.flag.ru:before, i.flag.russia:before { background-position: -72px -884px; } i.flag.rw:before, i.flag.rwanda:before { background-position: -72px -910px; } i.flag.sa:before, i.flag.saudi.arabia:before { background-position: -72px -936px; } i.flag.sb:before, i.flag.solomon.islands:before { background-position: -72px -962px; } i.flag.sc:before, i.flag.seychelles:before { background-position: -72px -988px; } i.flag.sd:before, i.flag.sudan:before { background-position: -72px -1040px; } i.flag.se:before, i.flag.sweden:before { background-position: -72px -1066px; } i.flag.sg:before, i.flag.singapore:before { background-position: -72px -1092px; } i.flag.sh:before, i.flag.saint.helena:before { background-position: -72px -1118px; } i.flag.si:before, i.flag.slovenia:before { background-position: -72px -1144px; } i.flag.sj:before, i.flag.svalbard:before, i.flag.jan.mayen:before { background-position: -72px -1170px; } i.flag.sk:before, i.flag.slovakia:before { background-position: -72px -1196px; } i.flag.sl:before, i.flag.sierra.leone:before { background-position: -72px -1222px; } i.flag.sm:before, i.flag.san.marino:before { background-position: -72px -1248px; } i.flag.sn:before, i.flag.senegal:before { background-position: -72px -1274px; } i.flag.so:before, i.flag.somalia:before { background-position: -72px -1300px; } i.flag.sr:before, i.flag.suriname:before { background-position: -72px -1326px; } i.flag.st:before, i.flag.sao.tome:before { background-position: -72px -1352px; } i.flag.sv:before, i.flag.el.salvador:before { background-position: -72px -1378px; } i.flag.sy:before, i.flag.syria:before { background-position: -72px -1404px; } i.flag.sz:before, i.flag.swaziland:before { background-position: -72px -1430px; } i.flag.tc:before, i.flag.caicos.islands:before { background-position: -72px -1456px; } i.flag.td:before, i.flag.chad:before { background-position: -72px -1482px; } i.flag.tf:before, i.flag.french.territories:before { background-position: -72px -1508px; } i.flag.tg:before, i.flag.togo:before { background-position: -72px -1534px; } i.flag.th:before, i.flag.thailand:before { background-position: -72px -1560px; } i.flag.tj:before, i.flag.tajikistan:before { background-position: -72px -1586px; } i.flag.tk:before, i.flag.tokelau:before { background-position: -72px -1612px; } i.flag.tl:before, i.flag.timorleste:before { background-position: -72px -1638px; } i.flag.tm:before, i.flag.turkmenistan:before { background-position: -72px -1664px; } i.flag.tn:before, i.flag.tunisia:before { background-position: -72px -1690px; } i.flag.to:before, i.flag.tonga:before { background-position: -72px -1716px; } i.flag.tr:before, i.flag.turkey:before { background-position: -72px -1742px; } i.flag.tt:before, i.flag.trinidad:before { background-position: -72px -1768px; } i.flag.tv:before, i.flag.tuvalu:before { background-position: -72px -1794px; } i.flag.tw:before, i.flag.taiwan:before { background-position: -72px -1820px; } i.flag.tz:before, i.flag.tanzania:before { background-position: -72px -1846px; } i.flag.ua:before, i.flag.ukraine:before { background-position: -72px -1872px; } i.flag.ug:before, i.flag.uganda:before { background-position: -72px -1898px; } i.flag.um:before, i.flag.us.minor.islands:before { background-position: -72px -1924px; } i.flag.us:before, i.flag.america:before, i.flag.united.states:before { background-position: -72px -1950px; } i.flag.uy:before, i.flag.uruguay:before { background-position: -72px -1976px; } i.flag.uz:before, i.flag.uzbekistan:before { background-position: -108px 0px; } i.flag.va:before, i.flag.vatican.city:before { background-position: -108px -26px; } i.flag.vc:before, i.flag.saint.vincent:before { background-position: -108px -52px; } i.flag.ve:before, i.flag.venezuela:before { background-position: -108px -78px; } i.flag.vg:before, i.flag.british.virgin.islands:before { background-position: -108px -104px; } i.flag.vi:before, i.flag.us.virgin.islands:before { background-position: -108px -130px; } i.flag.vn:before, i.flag.vietnam:before { background-position: -108px -156px; } i.flag.vu:before, i.flag.vanuatu:before { background-position: -108px -182px; } i.flag.wf:before, i.flag.wallis.and.futuna:before { background-position: -108px -234px; } i.flag.ws:before, i.flag.samoa:before { background-position: -108px -260px; } i.flag.ye:before, i.flag.yemen:before { background-position: -108px -286px; } i.flag.yt:before, i.flag.mayotte:before { background-position: -108px -312px; } i.flag.za:before, i.flag.south.africa:before { background-position: -108px -338px; } i.flag.zm:before, i.flag.zambia:before { background-position: -108px -364px; } i.flag.zw:before, i.flag.zimbabwe:before { background-position: -108px -390px; }
/** * @unrestricted */ Persistence.IsolatedFileSystem = class { /** * @param {!Persistence.<API key>} manager * @param {string} path * @param {string} embedderPath * @param {!DOMFileSystem} domFileSystem * @param {string} type */ constructor(manager, path, embedderPath, domFileSystem, type) { this._manager = manager; this._path = path; this._embedderPath = embedderPath; this._domFileSystem = domFileSystem; this._type = type; this.<API key> = Common.settings.createLocalSetting('<API key>', {}); /** @type {!Set<string>} */ this._excludedFolders = new Set(this.<API key>.get()[path] || []); /** @type {!Array<string>} */ this.<API key> = []; /** @type {!Set<string>} */ this._initialFilePaths = new Set(); /** @type {!Set<string>} */ this._initialGitFolders = new Set(); /** @type {!Map<string, !Promise>} */ this._fileLocks = new Map(); } /** * @param {!Persistence.<API key>} manager * @param {string} path * @param {string} embedderPath * @param {string} type * @param {string} name * @param {string} rootURL * @return {!Promise<?Persistence.IsolatedFileSystem>} */ static create(manager, path, embedderPath, type, name, rootURL) { const domFileSystem = <API key>.isolatedFileSystem(name, rootURL); if (!domFileSystem) return Promise.resolve(/** @type {?Persistence.IsolatedFileSystem} */ (null)); const fileSystem = new Persistence.IsolatedFileSystem(manager, path, embedderPath, domFileSystem, type); return fileSystem.<API key>() .then(() => fileSystem) .catchException(/** @type {?Persistence.IsolatedFileSystem} */ (null)); } /** * @param {!DOMError} error * @return {string} */ static errorMessage(error) { return Common.UIString('File system error: %s', error.message); } /** * @template T * @param {string} path * @param {function():!Promise<T>} operation * @return {!Promise<T>} */ <API key>(path, operation) { const promise = Promise.resolve(this._fileLocks.get(path)).then(() => operation.call(null)); this._fileLocks.set(path, promise); return promise; } /** * @param {string} path * @return {!Promise<?{modificationTime: !Date, size: number}>} */ getMetadata(path) { let fulfill; const promise = new Promise(f => fulfill = f); this._domFileSystem.root.getFile(path, undefined, fileEntryLoaded, errorHandler); return promise; /** * @param {!FileEntry} entry */ function fileEntryLoaded(entry) { entry.getMetadata(fulfill, errorHandler); } /** * @param {!FileError} error */ function errorHandler(error) { const errorMessage = Persistence.IsolatedFileSystem.errorMessage(error); console.error(errorMessage + ' when getting file metadata \'' + path); fulfill(null); } } /** * @return {!Array<string>} */ initialFilePaths() { return this._initialFilePaths.valuesArray(); } /** * @return {!Array<string>} */ initialGitFolders() { return this._initialGitFolders.valuesArray(); } /** * @return {string} */ path() { return this._path; } /** * @return {string} */ embedderPath() { return this._embedderPath; } /** * @return {string} */ type() { return this._type; } /** * @return {!Promise} */ <API key>() { let fulfill; const promise = new Promise(x => fulfill = x); let pendingRequests = 1; const boundInnerCallback = innerCallback.bind(this); this._requestEntries('', boundInnerCallback); return promise; /** * @param {!Array.<!FileEntry>} entries * @this {Persistence.IsolatedFileSystem} */ function innerCallback(entries) { for (let i = 0; i < entries.length; ++i) { const entry = entries[i]; if (!entry.isDirectory) { if (this.isFileExcluded(entry.fullPath)) continue; this._initialFilePaths.add(entry.fullPath.substr(1)); } else { if (entry.fullPath.endsWith('/.git')) { const lastSlash = entry.fullPath.lastIndexOf('/'); const parentFolder = entry.fullPath.substring(1, lastSlash); this._initialGitFolders.add(parentFolder); } if (this.isFileExcluded(entry.fullPath + '/')) { this.<API key>.push( Common.ParsedURL.urlToPlatformPath(this._path + entry.fullPath, Host.isWin())); continue; } ++pendingRequests; this._requestEntries(entry.fullPath, boundInnerCallback); } } if ((--pendingRequests === 0)) fulfill(); } } /** * @param {string} folderPath * @return {!Promise<?DirectoryEntry>} */ async <API key>(folderPath) { // Fast-path. If parent directory already exists we return it immidiatly. let dirEntry = await new Promise( resolve => this._domFileSystem.root.getDirectory(folderPath, undefined, resolve, () => resolve(null))); if (dirEntry) return dirEntry; const paths = folderPath.split('/'); let activePath = ''; for (const path of paths) { activePath = activePath + '/' + path; dirEntry = await this.<API key>(activePath); if (!dirEntry) return null; } return dirEntry; } /** * @param {string} path * @return {!Promise<?DirectoryEntry>} */ <API key>(path) { return new Promise(resolve => { this._domFileSystem.root.getDirectory(path, {create: true}, dirEntry => resolve(dirEntry), error => { const errorMessage = Persistence.IsolatedFileSystem.errorMessage(error); console.error(errorMessage + ' trying to create directory \'' + path + '\''); resolve(null); }); }); } /** * @param {string} path * @param {?string} name * @return {!Promise<?string>} */ async createFile(path, name) { const dirEntry = await this.<API key>(path); if (!dirEntry) return null; const fileEntry = await this.<API key>(path, createFileCandidate.bind(this, name || 'NewFile')); if (!fileEntry) return null; return fileEntry.fullPath.substr(1); /** * @param {string} name * @param {number=} newFileIndex * @return {!Promise<?FileEntry>} * @this {Persistence.IsolatedFileSystem} */ function createFileCandidate(name, newFileIndex) { return new Promise(resolve => { const nameCandidate = name + (newFileIndex || ''); dirEntry.getFile(nameCandidate, {create: true, exclusive: true}, resolve, error => { if (error.name === '<API key>') { resolve(createFileCandidate.call(this, name, (newFileIndex ? newFileIndex + 1 : 1))); return; } const errorMessage = Persistence.IsolatedFileSystem.errorMessage(error); console.error( errorMessage + ' when testing if file exists \'' + (this._path + '/' + path + '/' + nameCandidate) + '\''); resolve(null); }); }); } } /** * @param {string} path * @return {!Promise<boolean>} */ deleteFile(path) { let resolveCallback; const promise = new Promise(resolve => resolveCallback = resolve); this._domFileSystem.root.getFile(path, undefined, fileEntryLoaded.bind(this), errorHandler.bind(this)); return promise; /** * @param {!FileEntry} fileEntry * @this {Persistence.IsolatedFileSystem} */ function fileEntryLoaded(fileEntry) { fileEntry.remove(fileEntryRemoved, errorHandler.bind(this)); } function fileEntryRemoved() { resolveCallback(true); } function errorHandler(error) { const errorMessage = Persistence.IsolatedFileSystem.errorMessage(error); console.error(errorMessage + ' when deleting file \'' + (this._path + '/' + path) + '\''); resolveCallback(false); } } /** * @param {string} path * @return {!Promise<?Blob>} */ requestFileBlob(path) { return new Promise(resolve => { this._domFileSystem.root.getFile(path, undefined, entry => { entry.file(resolve, errorHandler.bind(this)); }, errorHandler.bind(this)); /** * @this {Persistence.IsolatedFileSystem} */ function errorHandler(error) { if (error.name === 'NotFoundError') { resolve(null); return; } const errorMessage = Persistence.IsolatedFileSystem.errorMessage(error); console.error(errorMessage + ' when getting content for file \'' + (this._path + '/' + path) + '\''); resolve(null); } }); } /** * @param {string} path * @param {function(?string,boolean)} callback */ requestFileContent(path, callback) { const <API key> = async () => { const blob = await this.requestFileBlob(path); if (!blob) { callback(null, false); return; } const reader = new FileReader(); const extension = Common.ParsedURL.extractExtension(path); const encoded = Persistence.IsolatedFileSystem.BinaryExtensions.has(extension); const readPromise = new Promise(x => reader.onloadend = x); if (encoded) reader.readAsBinaryString(blob); else reader.readAsText(blob); await readPromise; if (reader.error) { console.error('Can\'t read file: ' + path + ': ' + reader.error); callback(null, false); return; } let result; try { result = reader.result; } catch (e) { result = null; console.error('Can\'t read file: ' + path + ': ' + e); } if (result === undefined || result === null) { callback(null, false); return; } callback(encoded ? btoa(result) : result, encoded); }; this.<API key>(path, <API key>); } /** * @param {string} path * @param {string} content * @param {boolean} isBase64 */ async setFileContent(path, content, isBase64) { Host.userMetrics.actionTaken(Host.UserMetrics.Action.<API key>); let callback; const innerSetFileContent = () => { const promise = new Promise(x => callback = x); this._domFileSystem.root.getFile(path, {create: true}, fileEntryLoaded.bind(this), errorHandler.bind(this)); return promise; }; this.<API key>(path, innerSetFileContent); /** * @param {!FileEntry} entry * @this {Persistence.IsolatedFileSystem} */ function fileEntryLoaded(entry) { entry.createWriter(fileWriterCreated.bind(this), errorHandler.bind(this)); } /** * @param {!FileWriter} fileWriter * @this {Persistence.IsolatedFileSystem} */ async function fileWriterCreated(fileWriter) { fileWriter.onerror = errorHandler.bind(this); fileWriter.onwriteend = fileWritten; let blob; if (isBase64) blob = await(await fetch(`data:application/octet-stream;base64,${content}`)).blob(); else blob = new Blob([content], {type: 'text/plain'}); fileWriter.write(blob); function fileWritten() { fileWriter.onwriteend = callback; fileWriter.truncate(blob.size); } } /** * @this {Persistence.IsolatedFileSystem} */ function errorHandler(error) { const errorMessage = Persistence.IsolatedFileSystem.errorMessage(error); console.error(errorMessage + ' when setting content for file \'' + (this._path + '/' + path) + '\''); callback(); } } /** * @param {string} path * @param {string} newName * @param {function(boolean, string=)} callback */ renameFile(path, newName, callback) { newName = newName ? newName.trim() : newName; if (!newName || newName.indexOf('/') !== -1) { callback(false); return; } let fileEntry; let dirEntry; this._domFileSystem.root.getFile(path, undefined, fileEntryLoaded.bind(this), errorHandler.bind(this)); /** * @param {!FileEntry} entry * @this {Persistence.IsolatedFileSystem} */ function fileEntryLoaded(entry) { if (entry.name === newName) { callback(false); return; } fileEntry = entry; fileEntry.getParent(dirEntryLoaded.bind(this), errorHandler.bind(this)); } /** * @param {!Entry} entry * @this {Persistence.IsolatedFileSystem} */ function dirEntryLoaded(entry) { dirEntry = entry; dirEntry.getFile(newName, null, newFileEntryLoaded, <API key>.bind(this)); } /** * @param {!FileEntry} entry */ function newFileEntryLoaded(entry) { callback(false); } /** * @this {Persistence.IsolatedFileSystem} */ function <API key>(error) { if (error.name !== 'NotFoundError') { callback(false); return; } fileEntry.moveTo(dirEntry, newName, fileRenamed, errorHandler.bind(this)); } /** * @param {!FileEntry} entry */ function fileRenamed(entry) { callback(true, entry.name); } /** * @this {Persistence.IsolatedFileSystem} */ function errorHandler(error) { const errorMessage = Persistence.IsolatedFileSystem.errorMessage(error); console.error(errorMessage + ' when renaming file \'' + (this._path + '/' + path) + '\' to \'' + newName + '\''); callback(false); } } /** * @param {!DirectoryEntry} dirEntry * @param {function(!Array.<!FileEntry>)} callback */ _readDirectory(dirEntry, callback) { const dirReader = dirEntry.createReader(); let entries = []; function innerCallback(results) { if (!results.length) { callback(entries.sort()); } else { entries = entries.concat(toArray(results)); dirReader.readEntries(innerCallback, errorHandler); } } function toArray(list) { return Array.prototype.slice.call(list || [], 0); } dirReader.readEntries(innerCallback, errorHandler); function errorHandler(error) { const errorMessage = Persistence.IsolatedFileSystem.errorMessage(error); console.error(errorMessage + ' when reading directory \'' + dirEntry.fullPath + '\''); callback([]); } } /** * @param {string} path * @param {function(!Array.<!FileEntry>)} callback */ _requestEntries(path, callback) { this._domFileSystem.root.getDirectory(path, undefined, innerCallback.bind(this), errorHandler); /** * @param {!DirectoryEntry} dirEntry * @this {Persistence.IsolatedFileSystem} */ function innerCallback(dirEntry) { this._readDirectory(dirEntry, callback); } function errorHandler(error) { const errorMessage = Persistence.IsolatedFileSystem.errorMessage(error); console.error(errorMessage + ' when requesting entry \'' + path + '\''); callback([]); } } <API key>() { const settingValue = this.<API key>.get(); settingValue[this._path] = this._excludedFolders.valuesArray(); this.<API key>.set(settingValue); } /** * @param {string} path */ addExcludedFolder(path) { this._excludedFolders.add(path); this.<API key>(); this._manager.<API key>(Persistence.<API key>.Events.ExcludedFolderAdded, path); } /** * @param {string} path */ <API key>(path) { this._excludedFolders.delete(path); this.<API key>(); this._manager.<API key>(Persistence.<API key>.Events.<API key>, path); } fileSystemRemoved() { const settingValue = this.<API key>.get(); delete settingValue[this._path]; this.<API key>.set(settingValue); } /** * @param {string} folderPath * @return {boolean} */ isFileExcluded(folderPath) { if (this._excludedFolders.has(folderPath)) return true; const regex = this._manager.<API key>().asRegExp(); return !!(regex && regex.test(folderPath)); } /** * @return {!Set<string>} */ excludedFolders() { return this._excludedFolders; } /** * @param {string} query * @param {!Common.Progress} progress * @return {!Promise<!Array<string>>} */ searchInPath(query, progress) { return new Promise(resolve => { const requestId = this._manager.registerCallback(innerCallback); <API key>.searchInPath(requestId, this._embedderPath, query); /** * @param {!Array<string>} files */ function innerCallback(files) { resolve(files.map(path => Common.ParsedURL.platformPathToURL(path))); progress.worked(1); } }); } /** * @param {!Common.Progress} progress */ indexContent(progress) { progress.setTotalWork(1); const requestId = this._manager.registerProgress(progress); <API key>.indexPath(requestId, this._embedderPath, JSON.stringify(this.<API key>)); } }; Persistence.IsolatedFileSystem.ImageExtensions = new Set(['jpeg', 'jpg', 'svg', 'gif', 'webp', 'png', 'ico', 'tiff', 'tif', 'bmp']); Persistence.IsolatedFileSystem.BinaryExtensions = new Set([ 'cmd', 'com', 'exe', 'a', 'ar', 'iso', 'tar', 'bz2', 'gz', 'lz', 'lzma', 'z', '7z', 'apk', 'arc', 'cab', 'dmg', 'jar', 'pak', 'rar', 'zip', // Audio file extensions, roughly taken from https://en.wikipedia.org/wiki/Audio_file_format#List_of_formats '3gp', 'aac', 'aiff', 'flac', 'm4a', 'mmf', 'mp3', 'ogg', 'oga', 'raw', 'sln', 'wav', 'wma', 'webm', 'mkv', 'flv', 'vob', 'ogv', 'gifv', 'avi', 'mov', 'qt', 'mp4', 'm4p', 'm4v', 'mpg', 'mpeg', // Image file extensions 'jpeg', 'jpg', 'gif', 'webp', 'png', 'ico', 'tiff', 'tif', 'bmp' ]);
'use strict'; var util = require('util'); var TapReporter = require('testem/lib/ci/test_reporters/tap_reporter'); function CustomTapReporter() { this.out = process.stdout; this.silent = false; this.stoppedOnError = null; this.id = 1; this.total = 0; this.pass = 0; this.results = []; this.errors = []; this.logs = []; } util.inherits(CustomTapReporter, TapReporter); CustomTapReporter.prototype.report = function(prefix, data) { var stack = data.items && data.items.length > 0 && data.items[0].stack; if (stack) { try { var details = JSON.parse(stack); data.error = { actual: details.actual, expected: details.expected, message: details.message }; } catch (error) { process.stderr.write(stack); } } CustomTapReporter.super_.prototype.report.call(this, prefix, data); }; module.exports = new CustomTapReporter();
const crypto = require('crypto'); module.exports = (replitApiKey) => { const hmac = crypto.createHmac('sha256', replitApiKey); const timeCreated = Date.now(); hmac.update(timeCreated.toString()); const msgMac = hmac.digest('base64'); return { time_created: timeCreated, msg_mac: msgMac, }; };
// Automated Testing Framework (atf) // modification, are permitted provided that the following conditions // are met: // documentation and/or other materials provided with the distribution. // THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND // CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, // INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE // GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER // IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN // IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. extern "C" { #include <fcntl.h> #include <unistd.h> } #include <cerrno> #include <cstdlib> #include <iostream> #include <stdexcept> #include "macros.hpp" #include "detail/fs.hpp" #include "detail/process.hpp" #include "detail/sanity.hpp" #include "detail/test_helpers.hpp" #include "detail/text.hpp" // Auxiliary functions. static void create_ctl_file(const atf::tests::tc& tc, const char *name) { ATF_REQUIRE(open(name, O_CREAT | O_WRONLY | O_TRUNC, 0644) != -1); } // Auxiliary test cases. ATF_TEST_CASE(h_pass); ATF_TEST_CASE_HEAD(h_pass) { set_md_var("descr", "Helper test case"); } ATF_TEST_CASE_BODY(h_pass) { create_ctl_file(*this, "before"); ATF_PASS(); create_ctl_file(*this, "after"); } ATF_TEST_CASE(h_fail); ATF_TEST_CASE_HEAD(h_fail) { set_md_var("descr", "Helper test case"); } ATF_TEST_CASE_BODY(h_fail) { create_ctl_file(*this, "before"); ATF_FAIL("Failed on purpose"); create_ctl_file(*this, "after"); } ATF_TEST_CASE(h_skip); ATF_TEST_CASE_HEAD(h_skip) { set_md_var("descr", "Helper test case"); } ATF_TEST_CASE_BODY(h_skip) { create_ctl_file(*this, "before"); ATF_SKIP("Skipped on purpose"); create_ctl_file(*this, "after"); } ATF_TEST_CASE(h_require); ATF_TEST_CASE_HEAD(h_require) { set_md_var("descr", "Helper test case"); } ATF_TEST_CASE_BODY(h_require) { bool condition = atf::text::to_bool(get_config_var("condition")); create_ctl_file(*this, "before"); ATF_REQUIRE(condition); create_ctl_file(*this, "after"); } ATF_TEST_CASE(h_require_eq); ATF_TEST_CASE_HEAD(h_require_eq) { set_md_var("descr", "Helper test case"); } ATF_TEST_CASE_BODY(h_require_eq) { long v1 = atf::text::to_type< long >(get_config_var("v1")); long v2 = atf::text::to_type< long >(get_config_var("v2")); create_ctl_file(*this, "before"); ATF_REQUIRE_EQ(v1, v2); create_ctl_file(*this, "after"); } ATF_TEST_CASE(h_require_match); ATF_TEST_CASE_HEAD(h_require_match) { set_md_var("descr", "Helper test case"); } ATF_TEST_CASE_BODY(h_require_match) { const std::string regexp = get_config_var("regexp"); const std::string string = get_config_var("string"); create_ctl_file(*this, "before"); ATF_REQUIRE_MATCH(regexp, string); create_ctl_file(*this, "after"); } ATF_TEST_CASE(h_require_throw); ATF_TEST_CASE_HEAD(h_require_throw) { set_md_var("descr", "Helper test case"); } ATF_TEST_CASE_BODY(h_require_throw) { create_ctl_file(*this, "before"); if (get_config_var("what") == "throw_int") ATF_REQUIRE_THROW(std::runtime_error, if (1) throw int(5)); else if (get_config_var("what") == "throw_rt") ATF_REQUIRE_THROW(std::runtime_error, if (1) throw std::runtime_error("e")); else if (get_config_var("what") == "no_throw_rt") ATF_REQUIRE_THROW(std::runtime_error, if (0) throw std::runtime_error("e")); create_ctl_file(*this, "after"); } ATF_TEST_CASE(h_require_throw_re); ATF_TEST_CASE_HEAD(h_require_throw_re) { set_md_var("descr", "Helper test case"); } ATF_TEST_CASE_BODY(h_require_throw_re) { create_ctl_file(*this, "before"); if (get_config_var("what") == "throw_int") <API key>(std::runtime_error, "5", if (1) throw int(5)); else if (get_config_var("what") == "throw_rt_match") <API key>(std::runtime_error, "foo.*baz", if (1) throw std::runtime_error("a foo bar baz")); else if (get_config_var("what") == "throw_rt_no_match") <API key>(std::runtime_error, "foo.*baz", if (1) throw std::runtime_error("baz foo bar a")); else if (get_config_var("what") == "no_throw_rt") <API key>(std::runtime_error, "e", if (0) throw std::runtime_error("e")); create_ctl_file(*this, "after"); } static int errno_fail_stub(const int raised_errno) { errno = raised_errno; return -1; } static int errno_ok_stub(void) { return 0; } ATF_TEST_CASE(h_check_errno); ATF_TEST_CASE_HEAD(h_check_errno) { set_md_var("descr", "Helper test case"); } ATF_TEST_CASE_BODY(h_check_errno) { create_ctl_file(*this, "before"); if (get_config_var("what") == "no_error") ATF_CHECK_ERRNO(-1, errno_ok_stub() == -1); else if (get_config_var("what") == "errno_ok") ATF_CHECK_ERRNO(2, errno_fail_stub(2) == -1); else if (get_config_var("what") == "errno_fail") ATF_CHECK_ERRNO(3, errno_fail_stub(4) == -1); else UNREACHABLE; create_ctl_file(*this, "after"); } ATF_TEST_CASE(h_require_errno); ATF_TEST_CASE_HEAD(h_require_errno) { set_md_var("descr", "Helper test case"); } ATF_TEST_CASE_BODY(h_require_errno) { create_ctl_file(*this, "before"); if (get_config_var("what") == "no_error") ATF_REQUIRE_ERRNO(-1, errno_ok_stub() == -1); else if (get_config_var("what") == "errno_ok") ATF_REQUIRE_ERRNO(2, errno_fail_stub(2) == -1); else if (get_config_var("what") == "errno_fail") ATF_REQUIRE_ERRNO(3, errno_fail_stub(4) == -1); else UNREACHABLE; create_ctl_file(*this, "after"); } // Test cases for the macros. ATF_TEST_CASE(pass); ATF_TEST_CASE_HEAD(pass) { set_md_var("descr", "Tests the ATF_PASS macro"); } ATF_TEST_CASE_BODY(pass) { run_h_tc< ATF_TEST_CASE_NAME(h_pass) >(); ATF_REQUIRE(grep_file("result", "^passed")); ATF_REQUIRE(atf::fs::exists(atf::fs::path("before"))); ATF_REQUIRE(!atf::fs::exists(atf::fs::path("after"))); } ATF_TEST_CASE(fail); ATF_TEST_CASE_HEAD(fail) { set_md_var("descr", "Tests the ATF_FAIL macro"); } ATF_TEST_CASE_BODY(fail) { run_h_tc< ATF_TEST_CASE_NAME(h_fail) >(); ATF_REQUIRE(grep_file("result", "^failed: Failed on purpose")); ATF_REQUIRE(atf::fs::exists(atf::fs::path("before"))); ATF_REQUIRE(!atf::fs::exists(atf::fs::path("after"))); } ATF_TEST_CASE(skip); ATF_TEST_CASE_HEAD(skip) { set_md_var("descr", "Tests the ATF_SKIP macro"); } ATF_TEST_CASE_BODY(skip) { run_h_tc< ATF_TEST_CASE_NAME(h_skip) >(); ATF_REQUIRE(grep_file("result", "^skipped: Skipped on purpose")); ATF_REQUIRE(atf::fs::exists(atf::fs::path("before"))); ATF_REQUIRE(!atf::fs::exists(atf::fs::path("after"))); } ATF_TEST_CASE(require); ATF_TEST_CASE_HEAD(require) { set_md_var("descr", "Tests the ATF_REQUIRE macro"); } ATF_TEST_CASE_BODY(require) { struct test { const char *cond; bool ok; } *t, tests[] = { { "false", false }, { "true", true }, { NULL, false } }; const atf::fs::path before("before"); const atf::fs::path after("after"); for (t = &tests[0]; t->cond != NULL; t++) { atf::tests::vars_map config; config["condition"] = t->cond; std::cout << "Checking with a " << t->cond << " value\n"; run_h_tc< ATF_TEST_CASE_NAME(h_require) >(config); ATF_REQUIRE(atf::fs::exists(before)); if (t->ok) { ATF_REQUIRE(grep_file("result", "^passed")); ATF_REQUIRE(atf::fs::exists(after)); } else { ATF_REQUIRE(grep_file("result", "^failed: .*condition not met")); ATF_REQUIRE(!atf::fs::exists(after)); } atf::fs::remove(before); if (t->ok) atf::fs::remove(after); } } ATF_TEST_CASE(require_eq); ATF_TEST_CASE_HEAD(require_eq) { set_md_var("descr", "Tests the ATF_REQUIRE_EQ macro"); } ATF_TEST_CASE_BODY(require_eq) { struct test { const char *v1; const char *v2; bool ok; } *t, tests[] = { { "1", "1", true }, { "1", "2", false }, { "2", "1", false }, { "2", "2", true }, { NULL, NULL, false } }; const atf::fs::path before("before"); const atf::fs::path after("after"); for (t = &tests[0]; t->v1 != NULL; t++) { atf::tests::vars_map config; config["v1"] = t->v1; config["v2"] = t->v2; std::cout << "Checking with " << t->v1 << ", " << t->v2 << " and expecting " << (t->ok ? "true" : "false") << "\n"; run_h_tc< ATF_TEST_CASE_NAME(h_require_eq) >(config); ATF_REQUIRE(atf::fs::exists(before)); if (t->ok) { ATF_REQUIRE(grep_file("result", "^passed")); ATF_REQUIRE(atf::fs::exists(after)); } else { ATF_REQUIRE(grep_file("result", "^failed: .*v1 != v2")); ATF_REQUIRE(!atf::fs::exists(after)); } atf::fs::remove(before); if (t->ok) atf::fs::remove(after); } } ATF_TEST_CASE(require_match); ATF_TEST_CASE_HEAD(require_match) { set_md_var("descr", "Tests the ATF_REQUIRE_MATCH macro"); } ATF_TEST_CASE_BODY(require_match) { struct test { const char *regexp; const char *string; bool ok; } *t, tests[] = { { "foo.*bar", "this is a foo, bar, baz", true }, { "bar.*baz", "this is a baz, bar, foo", false }, { NULL, NULL, false } }; const atf::fs::path before("before"); const atf::fs::path after("after"); for (t = &tests[0]; t->regexp != NULL; t++) { atf::tests::vars_map config; config["regexp"] = t->regexp; config["string"] = t->string; std::cout << "Checking with " << t->regexp << ", " << t->string << " and expecting " << (t->ok ? "true" : "false") << "\n"; run_h_tc< ATF_TEST_CASE_NAME(h_require_match) >(config); ATF_REQUIRE(atf::fs::exists(before)); if (t->ok) { ATF_REQUIRE(grep_file("result", "^passed")); ATF_REQUIRE(atf::fs::exists(after)); } else { ATF_REQUIRE(grep_file("result", "^failed: ")); ATF_REQUIRE(!atf::fs::exists(after)); } atf::fs::remove(before); if (t->ok) atf::fs::remove(after); } } ATF_TEST_CASE(require_throw); ATF_TEST_CASE_HEAD(require_throw) { set_md_var("descr", "Tests the ATF_REQUIRE_THROW macro"); } ATF_TEST_CASE_BODY(require_throw) { struct test { const char *what; bool ok; const char *msg; } *t, tests[] = { { "throw_int", false, "unexpected error" }, { "throw_rt", true, NULL }, { "no_throw_rt", false, "did not throw" }, { NULL, false, NULL } }; const atf::fs::path before("before"); const atf::fs::path after("after"); for (t = &tests[0]; t->what != NULL; t++) { atf::tests::vars_map config; config["what"] = t->what; std::cout << "Checking with " << t->what << " and expecting " << (t->ok ? "true" : "false") << "\n"; run_h_tc< ATF_TEST_CASE_NAME(h_require_throw) >(config); ATF_REQUIRE(atf::fs::exists(before)); if (t->ok) { ATF_REQUIRE(grep_file("result", "^passed")); ATF_REQUIRE(atf::fs::exists(after)); } else { std::cout << "Checking that message contains '" << t->msg << "'\n"; std::string exp_result = std::string("^failed: .*") + t->msg; ATF_REQUIRE(grep_file("result", exp_result.c_str())); ATF_REQUIRE(!atf::fs::exists(after)); } atf::fs::remove(before); if (t->ok) atf::fs::remove(after); } } ATF_TEST_CASE(require_throw_re); ATF_TEST_CASE_HEAD(require_throw_re) { set_md_var("descr", "Tests the <API key> macro"); } ATF_TEST_CASE_BODY(require_throw_re) { struct test { const char *what; bool ok; const char *msg; } *t, tests[] = { { "throw_int", false, "unexpected error" }, { "throw_rt_match", true, NULL }, { "throw_rt_no_match", true, "threw.*runtime_error(baz foo bar a).*" "does not match 'a foo bar baz'" }, { "no_throw_rt", false, "did not throw" }, { NULL, false, NULL } }; const atf::fs::path before("before"); const atf::fs::path after("after"); for (t = &tests[0]; t->what != NULL; t++) { atf::tests::vars_map config; config["what"] = t->what; std::cout << "Checking with " << t->what << " and expecting " << (t->ok ? "true" : "false") << "\n"; run_h_tc< ATF_TEST_CASE_NAME(h_require_throw) >(config); ATF_REQUIRE(atf::fs::exists(before)); if (t->ok) { ATF_REQUIRE(grep_file("result", "^passed")); ATF_REQUIRE(atf::fs::exists(after)); } else { std::cout << "Checking that message contains '" << t->msg << "'\n"; std::string exp_result = std::string("^failed: .*") + t->msg; ATF_REQUIRE(grep_file("result", exp_result.c_str())); ATF_REQUIRE(!atf::fs::exists(after)); } atf::fs::remove(before); if (t->ok) atf::fs::remove(after); } } ATF_TEST_CASE(check_errno); ATF_TEST_CASE_HEAD(check_errno) { set_md_var("descr", "Tests the ATF_CHECK_ERRNO macro"); } ATF_TEST_CASE_BODY(check_errno) { struct test { const char *what; bool ok; const char *msg; } *t, tests[] = { { "no_error", false, "Expected true value in errno_ok_stub\\(\\) == -1" }, { "errno_ok", true, NULL }, { "errno_fail", false, "Expected errno 3, got 4, in errno_fail_stub\\(4\\) == -1" }, { NULL, false, NULL } }; const atf::fs::path before("before"); const atf::fs::path after("after"); for (t = &tests[0]; t->what != NULL; t++) { atf::tests::vars_map config; config["what"] = t->what; run_h_tc< ATF_TEST_CASE_NAME(h_check_errno) >(config); ATF_REQUIRE(atf::fs::exists(before)); ATF_REQUIRE(atf::fs::exists(after)); if (t->ok) { ATF_REQUIRE(grep_file("result", "^passed")); } else { ATF_REQUIRE(grep_file("result", "^failed")); std::string exp_result = "macros_test.cpp:[0-9]+: " + std::string(t->msg) + "$"; ATF_REQUIRE(grep_file("stderr", exp_result.c_str())); } atf::fs::remove(before); atf::fs::remove(after); } } ATF_TEST_CASE(require_errno); ATF_TEST_CASE_HEAD(require_errno) { set_md_var("descr", "Tests the ATF_REQUIRE_ERRNO macro"); } ATF_TEST_CASE_BODY(require_errno) { struct test { const char *what; bool ok; const char *msg; } *t, tests[] = { { "no_error", false, "Expected true value in errno_ok_stub\\(\\) == -1" }, { "errno_ok", true, NULL }, { "errno_fail", false, "Expected errno 3, got 4, in errno_fail_stub\\(4\\) == -1" }, { NULL, false, NULL } }; const atf::fs::path before("before"); const atf::fs::path after("after"); for (t = &tests[0]; t->what != NULL; t++) { atf::tests::vars_map config; config["what"] = t->what; run_h_tc< ATF_TEST_CASE_NAME(h_require_errno) >(config); ATF_REQUIRE(atf::fs::exists(before)); if (t->ok) { ATF_REQUIRE(grep_file("result", "^passed")); ATF_REQUIRE(atf::fs::exists(after)); } else { std::string exp_result = "^failed: .*macros_test.cpp:[0-9]+: " + std::string(t->msg) + "$"; ATF_REQUIRE(grep_file("result", exp_result.c_str())); ATF_REQUIRE(!atf::fs::exists(after)); } atf::fs::remove(before); if (t->ok) atf::fs::remove(after); } } // Tests cases for the header file. HEADER_TC(include, "atf-c++/macros.hpp"); BUILD_TC(use, "macros_hpp_test.cpp", "Tests that the macros provided by the atf-c++/macros.hpp file " "do not cause syntax errors when used", "Build of macros_hpp_test.cpp failed; some macros in " "atf-c++/macros.hpp are broken"); // Main. ATF_INIT_TEST_CASES(tcs) { // Add the test cases for the macros. ATF_ADD_TEST_CASE(tcs, pass); ATF_ADD_TEST_CASE(tcs, fail); ATF_ADD_TEST_CASE(tcs, skip); ATF_ADD_TEST_CASE(tcs, check_errno); ATF_ADD_TEST_CASE(tcs, require); ATF_ADD_TEST_CASE(tcs, require_eq); ATF_ADD_TEST_CASE(tcs, require_match); ATF_ADD_TEST_CASE(tcs, require_throw); ATF_ADD_TEST_CASE(tcs, require_throw_re); ATF_ADD_TEST_CASE(tcs, require_errno); // Add the test cases for the header file. ATF_ADD_TEST_CASE(tcs, include); ATF_ADD_TEST_CASE(tcs, use); }
var <API key> = [ [ "GCluster", "<API key>.html", "<API key>" ], [ "GSearch", "<API key>.html", "<API key>" ], [ "GStructs", "<API key>.html", "<API key>" ], [ "compareFiles.h", "compare_files_8h.html", "compare_files_8h" ], [ "computeSensSpec.h", "<API key>.html", "<API key>" ], [ "GCluster.h", "_g_cluster_8h.html", null ], [ "getIdWithoutMaster.h", "<API key>.html", "<API key>" ], [ "GSearch.h", "_g_search_8h.html", null ], [ "GStructs.h", "_g_structs_8h.html", null ] ];
<?php namespace LeagueWrap\Exception; final class <API key> extends \Exception { }
title: "Getting started" Howdy! If you're reading this, hopefully it's because you're interested in learning the Squiggle programming language. If so, read on! If you have never used [Node.js][] or [npm][], you should learn about those first. This tutorial assumes you have both tools installed and are familiar with the process of installing and using npm modules. ## Installation Squiggle can be installed via npm: bash npm install -g squiggle-lang Please be aware that Squiggle fully intends to follow [Semantic Versioning][semver], but is currently version zero, so things may change at any point. If you use [Sublime Text][sublime], there's a syntax highlighter plugin. You can install it via [Package Control][pkgctrl]. Simply open the command palette and use `Package Control: Install Package`, then type in **Squiggle**. If you use [Vim][vim], there's also a [Vim syntax highlighter plugin on GitHub][vimplug]. Now any files ending in `.sqg` will be highlighted automatically as Squiggle code. ## Built-in linter Many programming languages have tools built around them called linters. Usually these tools advise you of potential mistakes, or othwerwise ill-advised techniques. Frequently these tools require configuration before use, and are completely separate from the normal process of using the language. Squiggle is designed to be easy, so linting happens automatically during the compilation process, no extra steps required. This ensures all projects using Squiggle will adhere to common guidelines. In addition, Squiggle is designed so that at the language level there are as few "gotchas" as possible, reducing the amount of linting necessary. ## Using with Node.js You may be familiar with CoffeeScript or JSX hooks into Node.js's `require` function. This behavior is deprecated in Node.js and will not be included in Squiggle. The correct way to use Squiggle code with Node.js is to compile it ahead of time and put the resulting JavaScript code in another directory. Squiggle has a keyword for creating Node.js modules: `export` squiggle let x = 1 export x This is like the following JavaScript: javascript var x = 1; exports.x = x; So a common pattern for creating modules is: squiggle let a = 1 let b = 2 let cSecret = 3 let dSecret = 4 let e = 5 export a export b export e This is like the following JavaScript: javascript var a = 1; var b = 2; var cSecret = 3; var dSecret = 4; var e = 5; exports.a = a; exports.b = b; exports.e = e; Squiggle also adds `require` as a keyword, rather than regular function, so you write CommonJS imports as follows: squiggle let fs = require "fs" let L = require "lodash" let other = require "./foo/other" Note that the parentheses are omitted after `require` because it is a keyword. Parentheses cannot be omitted on normal function calls. Or you could use `export` and `require` together for a module that just collects other modules, like: squiggle let module1 = require "./module1" let module2 = require "./module2" let module3 = require "./module3" export module1 export module2 export module3 Where in JavaScript you might write: javascript var module1 = require("./module1"); var module2 = require("./module2"); var module3 = require("./module3"); exports.module1 = module1; exports.module2 = module2; exports.module3 = module3; ## Using in the browser The easiest way to use Squiggle code in the browser is to use the Browserify plugin. bash npm install --save-dev browserify squiggle-browserify After installation, use a script like this to build your code: bash #!/usr/bin/env bash PATH="$(npm bin):$PATH" browserify \ -t squiggle-browserify \ --extension=".sqg" \ src/main.sqg \ -o out/bundle.js Additionally, if you really don't want to use Browserify to bundle, you can avoid the need for Browserify by never using `require` or `export` in your code. In this case, you'll need to pull in globals manually (or the Squiggle linter will complain), and manually export globals. See example: squiggle # file bar.js # Import foo library from global scope. # Simply using `foo` won't work because the Squiggle # linter will complain about using an # undeclared binding. let {Object, foo} = global def bar1() do foo(1) end def bar2() do foo(2) end def bar3() do foo(3) end let api = {bar1, bar2, bar3} Object.assign(global, {bar: api}) [vim]: http: [npm]: https: [semver]: http://semver.org/ [lodash]: https://lodash.com/ [node.js]: https://nodejs.org/ [sublime]: http: [pkgctrl]: https://packagecontrol.io/ [vimplug]: https://github.com/squiggle-lang/vim-squiggle
<?php include 'CommonAssetsInit.lang.pl'; $<API key> = 'Nie przekazałeś referencji do modułu [app::$application].'; $<API key> = 'Przekaż prawidłową reference do modułu [app::$application]. Aktualnie znajduje się tam <b>%s</b>.'; $<API key> = 'Popraw przekazywaną referencje.';
import React from 'react'; import randomValue from './randomValue'; import Row from '../../../form/Grid/Row'; import LeftColumn from '../../../form/Grid/LeftColumn'; import RightColumn from '../../../form/Grid/RightColumn'; import CarteBlancheInput from '../../../form/CarteBlancheInput'; import Label from '../../../form/Label'; const StringControl = (props) => { const { label, value, onUpdate, secondaryLabel, nestedLevel, required } = props; return ( <Row> <LeftColumn nestedLevel={nestedLevel}> <Label type={secondaryLabel} propKey={label} /> </LeftColumn> <RightColumn> <div style={{ padding: '0 0.5rem' }}> <CarteBlancheInput value={value} fallbackValue="" onChange={onUpdate} hasRandomButton hasSettings={!required} onRandomButtonClick={() => onUpdate({ value: StringControl.randomValue(props) })} /> </div> </RightColumn> </Row> ); }; StringControl.randomValue = randomValue; export default StringControl;
/*can@2.2.7#event/event*/ steal('can/util/can.js', function (can) { can.addEvent = function (event, handler) { var allEvents = this.__bindEvents || (this.__bindEvents = {}), eventList = allEvents[event] || (allEvents[event] = []); eventList.push({ handler: handler, name: event }); return this; }; can.listenTo = function (other, event, handler) { var idedEvents = this.__listenToEvents; if (!idedEvents) { idedEvents = this.__listenToEvents = {}; } var otherId = can.cid(other); var othersEvents = idedEvents[otherId]; if (!othersEvents) { othersEvents = idedEvents[otherId] = { obj: other, events: {} }; } var eventsEvents = othersEvents.events[event]; if (!eventsEvents) { eventsEvents = othersEvents.events[event] = []; } eventsEvents.push(handler); can.bind.call(other, event, handler); }; can.stopListening = function (other, event, handler) { var idedEvents = this.__listenToEvents, iterIdedEvents = idedEvents, i = 0; if (!idedEvents) { return this; } if (other) { var othercid = can.cid(other); (iterIdedEvents = {})[othercid] = idedEvents[othercid]; if (!idedEvents[othercid]) { return this; } } for (var cid in iterIdedEvents) { var othersEvents = iterIdedEvents[cid], eventsEvents; other = idedEvents[cid].obj; if (!event) { eventsEvents = othersEvents.events; } else { (eventsEvents = {})[event] = othersEvents.events[event]; } for (var eventName in eventsEvents) { var handlers = eventsEvents[eventName] || []; i = 0; while (i < handlers.length) { if (handler && handler === handlers[i] || !handler) { can.unbind.call(other, eventName, handlers[i]); handlers.splice(i, 1); } else { i++; } } if (!handlers.length) { delete othersEvents.events[eventName]; } } if (can.isEmptyObject(othersEvents.events)) { delete idedEvents[cid]; } } return this; }; can.removeEvent = function (event, fn, __validate) { if (!this.__bindEvents) { return this; } var events = this.__bindEvents[event] || [], i = 0, ev, isFunction = typeof fn === 'function'; while (i < events.length) { ev = events[i]; if (__validate ? __validate(ev, event, fn) : isFunction && ev.handler === fn || !isFunction && (ev.cid === fn || !fn)) { events.splice(i, 1); } else { i++; } } return this; }; can.dispatch = function (event, args) { var events = this.__bindEvents; if (!events) { return; } if (typeof event === 'string') { event = { type: event }; } var eventName = event.type, handlers = (events[eventName] || []).slice(0), passed = [event]; if (args) { passed.push.apply(passed, args); } for (var i = 0, len = handlers.length; i < len; i++) { handlers[i].handler.apply(this, passed); } return event; }; can.one = function (event, handler) { var one = function () { can.unbind.call(this, event, one); return handler.apply(this, arguments); }; can.bind.call(this, event, one); return this; }; can.event = { on: function () { if (arguments.length === 0 && can.Control && this instanceof can.Control) { return can.Control.prototype.on.call(this); } else { return can.addEvent.apply(this, arguments); } }, off: function () { if (arguments.length === 0 && can.Control && this instanceof can.Control) { return can.Control.prototype.off.call(this); } else { return can.removeEvent.apply(this, arguments); } }, bind: can.addEvent, unbind: can.removeEvent, delegate: function (selector, event, handler) { return can.addEvent.call(this, event, handler); }, undelegate: function (selector, event, handler) { return can.removeEvent.call(this, event, handler); }, trigger: can.dispatch, one: can.one, addEvent: can.addEvent, removeEvent: can.removeEvent, listenTo: can.listenTo, stopListening: can.stopListening, dispatch: can.dispatch }; return can.event; });
package dht import ( "bytes" "fmt" "math/rand" "sort" "sync" "testing" "time" ds "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore" dssync "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore/sync" ma "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr" context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context" key "github.com/ipfs/go-ipfs/blocks/key" peer "github.com/ipfs/go-ipfs/p2p/peer" netutil "github.com/ipfs/go-ipfs/p2p/test/util" routing "github.com/ipfs/go-ipfs/routing" record "github.com/ipfs/go-ipfs/routing/record" u "github.com/ipfs/go-ipfs/util" ci "github.com/ipfs/go-ipfs/util/testutil/ci" travisci "github.com/ipfs/go-ipfs/util/testutil/ci/travis" ) var testCaseValues = map[key.Key][]byte{} func init() { testCaseValues["hello"] = []byte("world") for i := 0; i < 100; i++ { k := fmt.Sprintf("%d -- key", i) v := fmt.Sprintf("%d -- value", i) testCaseValues[key.Key(k)] = []byte(v) } } func setupDHT(ctx context.Context, t *testing.T) *IpfsDHT { h := netutil.GenHostSwarm(t, ctx) dss := dssync.MutexWrap(ds.NewMapDatastore()) d := NewDHT(ctx, h, dss) d.Validator["v"] = &record.ValidChecker{ Func: func(key.Key, []byte) error { return nil }, Sign: false, } return d } func setupDHTS(ctx context.Context, n int, t *testing.T) ([]ma.Multiaddr, []peer.ID, []*IpfsDHT) { addrs := make([]ma.Multiaddr, n) dhts := make([]*IpfsDHT, n) peers := make([]peer.ID, n) for i := 0; i < n; i++ { dhts[i] = setupDHT(ctx, t) peers[i] = dhts[i].self addrs[i] = dhts[i].peerstore.Addrs(dhts[i].self)[0] } return addrs, peers, dhts } func connect(t *testing.T, ctx context.Context, a, b *IpfsDHT) { idB := b.self addrB := b.peerstore.Addrs(idB) if len(addrB) == 0 { t.Fatal("peers setup incorrectly: no local address") } a.peerstore.AddAddrs(idB, addrB, peer.TempAddrTTL) pi := peer.PeerInfo{ID: idB} if err := a.host.Connect(ctx, pi); err != nil { t.Fatal(err) } } func bootstrap(t *testing.T, ctx context.Context, dhts []*IpfsDHT) { ctx, cancel := context.WithCancel(ctx) log.Debugf("bootstrapping dhts...") // tried async. sequential fares much better. compare: // probably because results compound var cfg BootstrapConfig cfg = <API key> cfg.Queries = 3 start := rand.Intn(len(dhts)) // randomize to decrease bias. for i := range dhts { dht := dhts[(start+i)%len(dhts)] dht.runBootstrap(ctx, cfg) } cancel() } func TestValueGetSet(t *testing.T) { // t.Skip("skipping test to debug another") ctx := context.Background() dhtA := setupDHT(ctx, t) dhtB := setupDHT(ctx, t) defer dhtA.Close() defer dhtB.Close() defer dhtA.host.Close() defer dhtB.host.Close() vf := &record.ValidChecker{ Func: func(key.Key, []byte) error { return nil }, Sign: false, } dhtA.Validator["v"] = vf dhtB.Validator["v"] = vf connect(t, ctx, dhtA, dhtB) ctxT, _ := context.WithTimeout(ctx, time.Second) dhtA.PutValue(ctxT, "/v/hello", []byte("world")) ctxT, _ = context.WithTimeout(ctx, time.Second*2) val, err := dhtA.GetValue(ctxT, "/v/hello") if err != nil { t.Fatal(err) } if string(val) != "world" { t.Fatalf("Expected 'world' got '%s'", string(val)) } ctxT, _ = context.WithTimeout(ctx, time.Second*2) val, err = dhtB.GetValue(ctxT, "/v/hello") if err != nil { t.Fatal(err) } if string(val) != "world" { t.Fatalf("Expected 'world' got '%s'", string(val)) } } func TestProvides(t *testing.T) { // t.Skip("skipping test to debug another") ctx := context.Background() _, _, dhts := setupDHTS(ctx, 4, t) defer func() { for i := 0; i < 4; i++ { dhts[i].Close() defer dhts[i].host.Close() } }() connect(t, ctx, dhts[0], dhts[1]) connect(t, ctx, dhts[1], dhts[2]) connect(t, ctx, dhts[1], dhts[3]) for k, v := range testCaseValues { log.Debugf("adding local values for %s = %s", k, v) sk := dhts[3].peerstore.PrivKey(dhts[3].self) rec, err := record.MakePutRecord(sk, k, v, false) if err != nil { t.Fatal(err) } err = dhts[3].putLocal(k, rec) if err != nil { t.Fatal(err) } bits, err := dhts[3].getLocal(k) if err != nil { t.Fatal(err) } if !bytes.Equal(bits, v) { t.Fatal("didn't store the right bits (%s, %s)", k, v) } } for k := range testCaseValues { log.Debugf("announcing provider for %s", k) if err := dhts[3].Provide(ctx, k); err != nil { t.Fatal(err) } } // what is this timeout for? was 60ms before. time.Sleep(time.Millisecond * 6) n := 0 for k := range testCaseValues { n = (n + 1) % 3 log.Debugf("getting providers for %s from %d", k, n) ctxT, _ := context.WithTimeout(ctx, time.Second) provchan := dhts[n].FindProvidersAsync(ctxT, k, 1) select { case prov := <-provchan: if prov.ID == "" { t.Fatal("Got back nil provider") } if prov.ID != dhts[3].self { t.Fatal("Got back wrong provider") } case <-ctxT.Done(): t.Fatal("Did not get a provider back.") } } } // if minPeers or avgPeers is 0, dont test for it. func <API key>(t *testing.T, dhts []*IpfsDHT, minPeers, avgPeers int, timeout time.Duration) bool { // test "well-formed-ness" (>= minPeers peers in every routing table) checkTables := func() bool { totalPeers := 0 for _, dht := range dhts { rtlen := dht.routingTable.Size() totalPeers += rtlen if minPeers > 0 && rtlen < minPeers { t.Logf("routing table for %s only has %d peers (should have >%d)", dht.self, rtlen, minPeers) return false } } actualAvgPeers := totalPeers / len(dhts) t.Logf("avg rt size: %d", actualAvgPeers) if avgPeers > 0 && actualAvgPeers < avgPeers { t.Logf("avg rt size: %d < %d", actualAvgPeers, avgPeers) return false } return true } timeoutA := time.After(timeout) for { select { case <-timeoutA: log.Debugf("did not reach well-formed routing tables by %s", timeout) return false // failed case <-time.After(5 * time.Millisecond): if checkTables() { return true // succeeded } } } } func printRoutingTables(dhts []*IpfsDHT) { // the routing tables should be full now. let's inspect them. fmt.Println("checking routing table of %d", len(dhts)) for _, dht := range dhts { fmt.Printf("checking routing table of %s\n", dht.self) dht.routingTable.Print() fmt.Println("") } } func TestBootstrap(t *testing.T) { // t.Skip("skipping test to debug another") if testing.Short() { t.SkipNow() } ctx := context.Background() nDHTs := 30 _, _, dhts := setupDHTS(ctx, nDHTs, t) defer func() { for i := 0; i < nDHTs; i++ { dhts[i].Close() defer dhts[i].host.Close() } }() t.Logf("connecting %d dhts in a ring", nDHTs) for i := 0; i < nDHTs; i++ { connect(t, ctx, dhts[i], dhts[(i+1)%len(dhts)]) } <-time.After(100 * time.Millisecond) // bootstrap a few times until we get good tables. stop := make(chan struct{}) go func() { for { t.Logf("bootstrapping them so they find each other", nDHTs) ctxT, _ := context.WithTimeout(ctx, 5*time.Second) bootstrap(t, ctxT, dhts) select { case <-time.After(50 * time.Millisecond): continue // being explicit case <-stop: return } } }() <API key>(t, dhts, 7, 10, 20*time.Second) close(stop) if u.Debug { // the routing tables should be full now. let's inspect them. printRoutingTables(dhts) } } func <API key>(t *testing.T) { // t.Skip("skipping test to debug another") if ci.IsRunning() { t.Skip("skipping on CI. highly timing dependent") } if testing.Short() { t.SkipNow() } ctx := context.Background() nDHTs := 30 _, _, dhts := setupDHTS(ctx, nDHTs, t) defer func() { for i := 0; i < nDHTs; i++ { dhts[i].Close() defer dhts[i].host.Close() } }() // signal amplifier amplify := func(signal chan time.Time, other []chan time.Time) { for t := range signal { for _, s := range other { s <- t } } for _, s := range other { close(s) } } signal := make(chan time.Time) allSignals := []chan time.Time{} var cfg BootstrapConfig cfg = <API key> cfg.Queries = 5 // kick off periodic bootstrappers with instrumented signals. for _, dht := range dhts { s := make(chan time.Time) allSignals = append(allSignals, s) dht.BootstrapOnSignal(cfg, s) } go amplify(signal, allSignals) t.Logf("dhts are not connected.", nDHTs) for _, dht := range dhts { rtlen := dht.routingTable.Size() if rtlen > 0 { t.Errorf("routing table for %s should have 0 peers. has %d", dht.self, rtlen) } } for i := 0; i < nDHTs; i++ { connect(t, ctx, dhts[i], dhts[(i+1)%len(dhts)]) } t.Logf("dhts are now connected to 1-2 others.", nDHTs) for _, dht := range dhts { rtlen := dht.routingTable.Size() if rtlen > 2 { t.Errorf("routing table for %s should have at most 2 peers. has %d", dht.self, rtlen) } } if u.Debug { printRoutingTables(dhts) } t.Logf("bootstrapping them so they find each other", nDHTs) signal <- time.Now() // this is async, and we dont know when it's finished with one cycle, so keep checking // until the routing tables look better, or some long timeout for the failure case. <API key>(t, dhts, 7, 10, 20*time.Second) if u.Debug { printRoutingTables(dhts) } } func TestProvidesMany(t *testing.T) { t.Skip("this test doesn't work") // t.Skip("skipping test to debug another") ctx := context.Background() nDHTs := 40 _, _, dhts := setupDHTS(ctx, nDHTs, t) defer func() { for i := 0; i < nDHTs; i++ { dhts[i].Close() defer dhts[i].host.Close() } }() t.Logf("connecting %d dhts in a ring", nDHTs) for i := 0; i < nDHTs; i++ { connect(t, ctx, dhts[i], dhts[(i+1)%len(dhts)]) } <-time.After(100 * time.Millisecond) t.Logf("bootstrapping them so they find each other", nDHTs) ctxT, _ := context.WithTimeout(ctx, 20*time.Second) bootstrap(t, ctxT, dhts) if u.Debug { // the routing tables should be full now. let's inspect them. t.Logf("checking routing table of %d", nDHTs) for _, dht := range dhts { fmt.Printf("checking routing table of %s\n", dht.self) dht.routingTable.Print() fmt.Println("") } } var providers = map[key.Key]peer.ID{} d := 0 for k, v := range testCaseValues { d = (d + 1) % len(dhts) dht := dhts[d] providers[k] = dht.self t.Logf("adding local values for %s = %s (on %s)", k, v, dht.self) rec, err := record.MakePutRecord(nil, k, v, false) if err != nil { t.Fatal(err) } err = dht.putLocal(k, rec) if err != nil { t.Fatal(err) } bits, err := dht.getLocal(k) if err != nil { t.Fatal(err) } if !bytes.Equal(bits, v) { t.Fatal("didn't store the right bits (%s, %s)", k, v) } t.Logf("announcing provider for %s", k) if err := dht.Provide(ctx, k); err != nil { t.Fatal(err) } } // what is this timeout for? was 60ms before. time.Sleep(time.Millisecond * 6) errchan := make(chan error) ctxT, _ = context.WithTimeout(ctx, 5*time.Second) var wg sync.WaitGroup getProvider := func(dht *IpfsDHT, k key.Key) { defer wg.Done() expected := providers[k] provchan := dht.FindProvidersAsync(ctxT, k, 1) select { case prov := <-provchan: actual := prov.ID if actual == "" { errchan <- fmt.Errorf("Got back nil provider (%s at %s)", k, dht.self) } else if actual != expected { errchan <- fmt.Errorf("Got back wrong provider (%s != %s) (%s at %s)", expected, actual, k, dht.self) } case <-ctxT.Done(): errchan <- fmt.Errorf("Did not get a provider back (%s at %s)", k, dht.self) } } for k := range testCaseValues { // everyone should be able to find it... for _, dht := range dhts { log.Debugf("getting providers for %s at %s", k, dht.self) wg.Add(1) go getProvider(dht, k) } } // we need this because of printing errors go func() { wg.Wait() close(errchan) }() for err := range errchan { t.Error(err) } } func TestProvidesAsync(t *testing.T) { // t.Skip("skipping test to debug another") if testing.Short() { t.SkipNow() } ctx := context.Background() _, _, dhts := setupDHTS(ctx, 4, t) defer func() { for i := 0; i < 4; i++ { dhts[i].Close() defer dhts[i].host.Close() } }() connect(t, ctx, dhts[0], dhts[1]) connect(t, ctx, dhts[1], dhts[2]) connect(t, ctx, dhts[1], dhts[3]) k := key.Key("hello") val := []byte("world") sk := dhts[3].peerstore.PrivKey(dhts[3].self) rec, err := record.MakePutRecord(sk, k, val, false) if err != nil { t.Fatal(err) } err = dhts[3].putLocal(k, rec) if err != nil { t.Fatal(err) } bits, err := dhts[3].getLocal(k) if err != nil && bytes.Equal(bits, val) { t.Fatal(err) } err = dhts[3].Provide(ctx, key.Key("hello")) if err != nil { t.Fatal(err) } time.Sleep(time.Millisecond * 60) ctxT, _ := context.WithTimeout(ctx, time.Millisecond*300) provs := dhts[0].FindProvidersAsync(ctxT, key.Key("hello"), 5) select { case p, ok := <-provs: if !ok { t.Fatal("Provider channel was closed...") } if p.ID == "" { t.Fatal("Got back nil provider!") } if p.ID != dhts[3].self { t.Fatalf("got a provider, but not the right one. %s", p) } case <-ctxT.Done(): t.Fatal("Didnt get back providers") } } func TestLayeredGet(t *testing.T) { // t.Skip("skipping test to debug another") if testing.Short() { t.SkipNow() } ctx := context.Background() _, _, dhts := setupDHTS(ctx, 4, t) defer func() { for i := 0; i < 4; i++ { dhts[i].Close() defer dhts[i].host.Close() } }() connect(t, ctx, dhts[0], dhts[1]) connect(t, ctx, dhts[1], dhts[2]) connect(t, ctx, dhts[1], dhts[3]) err := dhts[3].Provide(ctx, key.Key("/v/hello")) if err != nil { t.Fatal(err) } time.Sleep(time.Millisecond * 6) t.Log("interface was changed. GetValue should not use providers.") ctxT, _ := context.WithTimeout(ctx, time.Second) val, err := dhts[0].GetValue(ctxT, key.Key("/v/hello")) if err != routing.ErrNotFound { t.Error(err) } if string(val) == "world" { t.Error("should not get value.") } if len(val) > 0 && string(val) != "world" { t.Error("worse, there's a value and its not even the right one.") } } func TestFindPeer(t *testing.T) { // t.Skip("skipping test to debug another") if testing.Short() { t.SkipNow() } ctx := context.Background() _, peers, dhts := setupDHTS(ctx, 4, t) defer func() { for i := 0; i < 4; i++ { dhts[i].Close() dhts[i].host.Close() } }() connect(t, ctx, dhts[0], dhts[1]) connect(t, ctx, dhts[1], dhts[2]) connect(t, ctx, dhts[1], dhts[3]) ctxT, _ := context.WithTimeout(ctx, time.Second) p, err := dhts[0].FindPeer(ctxT, peers[2]) if err != nil { t.Fatal(err) } if p.ID == "" { t.Fatal("Failed to find peer.") } if p.ID != peers[2] { t.Fatal("Didnt find expected peer.") } } func <API key>(t *testing.T) { t.Skip("not quite correct (see note)") if testing.Short() { t.SkipNow() } ctx := context.Background() _, peers, dhts := setupDHTS(ctx, 4, t) defer func() { for i := 0; i < 4; i++ { dhts[i].Close() dhts[i].host.Close() } }() // topology: // 0-1, 1-2, 1-3, 2-3 connect(t, ctx, dhts[0], dhts[1]) connect(t, ctx, dhts[1], dhts[2]) connect(t, ctx, dhts[1], dhts[3]) connect(t, ctx, dhts[2], dhts[3]) // fmt.Println("0 is", peers[0]) // fmt.Println("1 is", peers[1]) // fmt.Println("2 is", peers[2]) // fmt.Println("3 is", peers[3]) ctxT, _ := context.WithTimeout(ctx, time.Second) pchan, err := dhts[0].<API key>(ctxT, peers[2]) if err != nil { t.Fatal(err) } // shouldFind := []peer.ID{peers[1], peers[3]} found := []peer.PeerInfo{} for nextp := range pchan { found = append(found, nextp) } // fmt.Printf("querying 0 (%s) <API key> 2 (%s)\n", peers[0], peers[2]) // fmt.Println("should find 1, 3", shouldFind) // fmt.Println("found", found) // testPeerListsMatch(t, shouldFind, found) log.Warning("<API key> is not quite correct") if len(found) == 0 { t.Fatal("didn't find any peers.") } } func testPeerListsMatch(t *testing.T, p1, p2 []peer.ID) { if len(p1) != len(p2) { t.Fatal("did not find as many peers as should have", p1, p2) } ids1 := make([]string, len(p1)) ids2 := make([]string, len(p2)) for i, p := range p1 { ids1[i] = string(p) } for i, p := range p2 { ids2[i] = string(p) } sort.Sort(sort.StringSlice(ids1)) sort.Sort(sort.StringSlice(ids2)) for i := range ids1 { if ids1[i] != ids2[i] { t.Fatal("Didnt find expected peer", ids1[i], ids2) } } } func <API key>(t *testing.T) { // t.Skip("skipping test to debug another") if testing.Short() { t.SkipNow() } if travisci.IsRunning() { t.Skip("Skipping on Travis-CI.") } runTimes := 10 for rtime := 0; rtime < runTimes; rtime++ { log.Info("Running Time: ", rtime) ctx := context.Background() dhtA := setupDHT(ctx, t) dhtB := setupDHT(ctx, t) addrA := dhtA.peerstore.Addrs(dhtA.self)[0] addrB := dhtB.peerstore.Addrs(dhtB.self)[0] peerA := dhtA.self peerB := dhtB.self errs := make(chan error) go func() { dhtA.peerstore.AddAddr(peerB, addrB, peer.TempAddrTTL) pi := peer.PeerInfo{ID: peerB} err := dhtA.host.Connect(ctx, pi) errs <- err }() go func() { dhtB.peerstore.AddAddr(peerA, addrA, peer.TempAddrTTL) pi := peer.PeerInfo{ID: peerA} err := dhtB.host.Connect(ctx, pi) errs <- err }() timeout := time.After(5 * time.Second) select { case e := <-errs: if e != nil { t.Fatal(e) } case <-timeout: t.Fatal("Timeout received!") } select { case e := <-errs: if e != nil { t.Fatal(e) } case <-timeout: t.Fatal("Timeout received!") } dhtA.Close() dhtB.Close() dhtA.host.Close() dhtB.host.Close() } }
The MIT License (MIT) Copyright (c) 2014 Sergio Pereira Valiente Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
<?php declare(strict_types=1); namespace Inowas\ModflowModel\Model\Event; use Inowas\Common\Id\ModflowId; use Inowas\Common\Id\UserId; use Inowas\Common\Modflow\OptimizationState; use Inowas\ModflowModel\Model\AMQP\<API key>; use Prooph\EventSourcing\AggregateChanged; class <API key> extends AggregateChanged { /** @var ModflowId */ private $modflowId; /** @var ModflowId */ private $optimizationId; /** @var OptimizationState */ private $state; /** @var <API key> */ private $response; /** @var UserId */ private $userId; /** @noinspection <API key> * @param ModflowId $modflowId * @param ModflowId $optimizationId * @param OptimizationState $state * @return self */ public static function withModelIdAndState(ModflowId $modflowId, ModflowId $optimizationId, OptimizationState $state): self { /** @var self $event */ $event = self::occur( $modflowId->toString(), [ 'optimization_id' => $optimizationId->toString(), 'state' => $state->toInt() ] ); $event->modflowId = $modflowId; $event->optimizationId = $optimizationId; $event->state = $state; return $event; } /** @noinspection <API key> * @param ModflowId $modflowId * @param ModflowId $optimizationId * @param OptimizationState $state * @param <API key> $response * @return self */ public static function <API key>(ModflowId $modflowId, ModflowId $optimizationId, OptimizationState $state, <API key> $response): self { /** @var self $event */ $event = self::occur( $modflowId->toString(), [ 'optimization_id' => $optimizationId->toString(), 'state' => $state->toInt(), 'response' => $response->toArray() ] ); $event->modflowId = $modflowId; $event->optimizationId = $optimizationId; $event->response = $response; $event->state = $state; return $event; } /** @noinspection <API key> * @param UserId $userId * @param ModflowId $modflowId * @param ModflowId $optimizationId * @param OptimizationState $state * @return self */ public static function <API key>(UserId $userId, ModflowId $modflowId, ModflowId $optimizationId, OptimizationState $state): self { /** @var self $event */ $event = self::occur( $modflowId->toString(), [ 'user_id' => $userId->toString(), 'optimization_id' => $optimizationId->toString(), 'state' => $state->toInt() ] ); $event->modflowId = $modflowId; $event->state = $state; $event->optimizationId = $optimizationId; return $event; } public function modelId(): ModflowId { if ($this->modflowId === null) { $this->modflowId = ModflowId::fromString($this->aggregateId()); } return $this->modflowId; } public function optimizationId(): ModflowId { if ($this->optimizationId === null) { $this->optimizationId = ModflowId::fromString($this->payload['optimization_id']); } return $this->optimizationId; } public function state(): OptimizationState { if ($this->state === null) { $this->state = OptimizationState::fromInt($this->payload['state']); } return $this->state; } public function userId(): ?UserId { if (!\array_key_exists('user_id', $this->payload)) { return null; } if ($this->userId === null) { $this->userId = UserId::fromString($this->payload['user_id']); } return $this->userId; } public function response(): ?<API key> { if (!\array_key_exists('response', $this->payload)) { return null; } if ($this->response === null) { $this->response = <API key>::fromArray($this->payload['response']); } return $this->response; } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Xceed.Wpf.Toolkit; namespace Progressive.Commons.Views.Controls { class <API key> : IntegerUpDown { protected override void OnValueChanged(int? oldValue, int? newValue) { if (newValue == null) { Value = oldValue; return; } base.OnValueChanged(oldValue, newValue); } } }
_hold = false hold() = (global _hold = !_hold) hold(h::Bool) = (global _hold = h) function ghf() if !_hold global _pwinston = FramedPlot() end _pwinston end ghf(p) = (global _pwinston = p) savefig(fname::String, args...; kvs...) = savefig(_pwinston, fname, args...; kvs...) @deprecate file savefig for f in (:xlabel,:ylabel,:title) @eval $f(s::String) = (setattr(_pwinston, $f=s); _pwinston) end for (f,k) in ((:xlim,:xrange),(:ylim,:yrange)) @eval $f(a, b) = (setattr(_pwinston, $k=(a,b)); _pwinston) @eval $f(a) = (setattr(_pwinston, $k=(a[1],a[2])); _pwinston) @eval $f() = $k(limits(_pwinston)) end const chartokens = @Dict( '-' => (:linekind, "solid"), ':' => (:linekind, "dotted"), ';' => (:linekind, "dotdashed"), '+' => (:symbolkind, "plus"), 'o' => (:symbolkind, "circle"), '*' => (:symbolkind, "asterisk"), '.' => (:symbolkind, "dot"), 'x' => (:symbolkind, "cross"), 's' => (:symbolkind, "square"), 'd' => (:symbolkind, "diamond"), '^' => (:symbolkind, "triangle"), 'v' => (:symbolkind, "down-triangle"), '>' => (:symbolkind, "right-triangle"), '<' => (:symbolkind, "left-triangle"), 'y' => (:color, colorant"yellow"), 'm' => (:color, colorant"magenta"), 'c' => (:color, colorant"cyan"), 'r' => (:color, colorant"red"), 'g' => (:color, colorant"green"), 'b' => (:color, colorant"blue"), 'w' => (:color, colorant"white"), 'k' => (:color, colorant"black"), ) function _parse_spec(spec::String) style = Dict() try style[:color] = parse(Colors.Colorant, spec) return style end for (k,v) in (("--","dashed"), ("-.","dotdashed")) splitspec = split(spec, k) if length(splitspec) > 1 style[:linekind] = v spec = join(splitspec) end end for char in spec if haskey(chartokens, char) (k,v) = chartokens[char] style[k] = v else warn("unrecognized style '$char'") end end style end function default_color(i::Int) cs = [0x000000, 0xED2C30, 0x008C46, 0x1859A9, 0xF37C21, 0x652B91, 0xA11C20, 0xB33794] cs[mod1(i,length(cs))] end function _process_keywords(kvs, p, components...) for (k,v) in kvs if k in [:angle, :color, :face, :halign, :linecolor, :linekind, :linewidth, :size, :symbolkind, :symbolsize, :valign] for c in components style(c, k, v) end else setattr(p, k, v) end end end typealias PlotArg Union(String,AbstractVector,AbstractMatrix,Function,Real) isrowvec(x::AbstractArray) = ndims(x) == 2 && size(x,1) == 1 && size(x,2) > 1 isvector(x::AbstractVector) = true isvector(x::AbstractMatrix) = size(x,1) == 1 function plot(p::FramedPlot, args::PlotArg...; kvs...) args = Any[args...] components = Any[] color_idx = 0 default_style = Dict() attr = Any[] xrange = nothing for (k,v) in kvs if k in (:linestyle, :linetype) default_style[:linekind] = v elseif k in (:marker, :symboltype) default_style[:symbolkind] = v elseif k in (:markersize,) default_style[:symbolsize] = v elseif k in (:color, :linekind, :linewidth, :symbolkind, :symbolsize) default_style[k] = v else k == :xrange && (xrange = v) push!(attr, (k,v)) end end # parse the args into tuples of the form (x, y, spec) or (func, lims, spec) parsed_args = Any[] i = 0 need_xrange = false while length(args) > 0 local x, y a = shift!(args); i += 1 if isa(a, Function) x = a if length(args) > 1 && isa(args[1],Real) && isa(args[2],Real) y = (shift!(args),shift!(args)); i += 2 else y = () need_xrange = true end elseif isa(a, AbstractVecOrMat) elt = eltype(a) if elt <: Complex x = real(a) y = imag(a) elseif length(args) > 0 && isa(args[1], AbstractVecOrMat) && elt <: Real && eltype(args[1]) <: Real x = a y = shift!(args); i += 1 elseif elt <: Real y = a x = 1:(isrowvec(y) ? size(y,2) : size(y,1)) else error("eltype of argument #$i is not Real or Complex") end else error("expected array or function for argument #$i; got $(typeof(a))") end spec = "" if length(args) > 0 && isa(args[1], String) spec = shift!(args); i += 1 end push!(parsed_args, (x,y,spec)) end need_xrange && xrange === nothing && error("need to specify xrange") for (a,b,spec) in parsed_args local x, y if isa(a, Function) xlim = b == () ? xrange : b x, y = fplot_points(a, xlim[1], xlim[2]) else x, y = a, b end sopts = copy(default_style) spec != "" && merge!(sopts, _parse_spec(spec)) no_color = !haskey(sopts, :color) add_curve = haskey(sopts, :linekind) || !haskey(sopts, :symbolkind) add_points = haskey(sopts, :symbolkind) isvector(x) && (x = vec(x)) isvector(y) && (y = vec(y)) local xys if isa(x, AbstractVector) && isa(y, AbstractVector) xys = [ (x,y) ] elseif isa(x, AbstractVector) xys = length(x) == size(y,1) ? [ (x, sub(y,:,j)) for j = 1:size(y,2) ] : [ (x, sub(y,i,:)) for i = 1:size(y,1) ] elseif isa(y, AbstractVector) xys = size(x,1) == length(y) ? [ (sub(x,:,j), y) for j = 1:size(x,2) ] : [ (sub(x,i,:), y) for i = 1:size(x,1) ] else @assert size(x) == size(y) xys = [ (sub(x,:,j), sub(y,:,j)) for j = 1:size(y,2) ] end for (x,y) in xys if no_color color_idx += 1 sopts[:color] = default_color(color_idx) end if add_curve push!(components, Curve(x, y, sopts)) end if add_points push!(components, Points(x, y, sopts)) end end end for (k,v) in attr setattr(p, k, v) end for c in components add(p, c) end global _pwinston = p p end plot(args::PlotArg...; kvs...) = plot(ghf(), args...; kvs...) # shortcut for overplotting oplot(args::PlotArg...; kvs...) = plot(_pwinston, args...; kvs...) # shortcuts for creating log plots semilogx(args::PlotArg...; kvs...) = plot(args...; xlog=true, kvs...) semilogy(args::PlotArg...; kvs...) = plot(args...; ylog=true, kvs...) loglog(args::PlotArg...; kvs...) = plot(args...; xlog=true, ylog=true, kvs...) typealias Interval @compat(Tuple{Real,Real}) function data2rgb{T<:Real}(data::AbstractArray{T}, limits::Interval, colormap::Array{Uint32,1}) img = similar(data, Uint32) ncolors = length(colormap) limlower = limits[1] limscale = ncolors/(limits[2]-limits[1]) for i = 1:length(data) datai = data[i] if isfinite(datai) idxr = limscale*(datai - limlower) idx = trunc(Int, idxr) idx += idxr > convert(T, idx) idx = clamp(idx, 1, ncolors) img[i] = colormap[idx] else img[i] = 0x00000000 end end img end function jetrgb(x) fourValue = 4x r = min(fourValue - 1.5, -fourValue + 4.5) g = min(fourValue - 0.5, -fourValue + 3.5) b = min(fourValue + 0.5, -fourValue + 2.5) RGB(clamp(r,0.,1.), clamp(g,0.,1.), clamp(b,0.,1.)) end colormap() = (global _current_colormap; _current_colormap) colormap(c::Array{Uint32,1}) = (global _current_colormap = c; nothing) colormap{C<:Color}(cs::Array{C,1}) = colormap(Uint32[convert(RGB24,c) for c in cs]) function colormap(name::String, n::Int=256) if name == "jet" colormap([jetrgb(x) for x in linspace(0.,1.,n)]) else colormap(Colors.colormap(name, n)) end end colormap("jet") function imagesc{T<:Real}(xrange::Interval, yrange::Interval, data::AbstractArray{T,2}, clims::Interval) p = ghf() if !_hold setattr(p, :xrange, xrange) setattr(p, :yrange, reverse(yrange)) end img = data2rgb(data, clims, _current_colormap) xrange[1] > xrange[2] && (img = flipdim(img,2)) yrange[1] < yrange[2] && (img = flipdim(img,1)) add(p, Image(xrange, reverse(yrange), img)) ghf(p) end imagesc(xrange, yrange, data) = imagesc(xrange, yrange, data, (minimum(data),maximum(data)+1)) imagesc(data) = ((h, w) = size(data); imagesc((0,w), (0,h), data)) imagesc{T}(data::AbstractArray{T,2}, clims::Interval) = ((h, w) = size(data); imagesc((0,w), (0,h), data, clims)) function spy(S::SparseMatrixCSC, nrS::Integer, ncS::Integer) m, n = size(S) colptr = S.colptr rowval = S.rowval nzval = S.nzval if nrS > m; nrS = m; end if ncS > n; ncS = n; end target = zeros(nrS, ncS) x = nrS / m y = ncS / n for col = 1:n for k = colptr[col]:colptr[col+1]-1 row = rowval[k] target[ceil(row * x), ceil(col * y)] += 1 end end imagesc((1,m), (1,n), target) end scatter(x::AbstractVecOrMat, y::AbstractVecOrMat, spec::ASCIIString="o"; kvs...) = scatter(x, y, 1., spec; kvs...) scatter{C<:Complex}(z::AbstractVecOrMat{C}, spec::ASCIIString="o"; kvs...) = scatter(real(z), imag(z), 1., spec; kvs...) function scatter(x::AbstractVecOrMat, y::AbstractVecOrMat, s::Real, spec::ASCIIString="o"; kvs...) sopts = _parse_spec(spec) p = ghf() c = Points(x, y, sopts, symbolsize=s) add(p, c) for (k,v) in kvs if k in [:linekind,:symbolkind,:color,:linecolor,:linewidth,:symbolsize] style(c, k, v) else setattr(p, k, v) end end ghf(p) end function scatter(x::AbstractVecOrMat, y::AbstractVecOrMat, s::AbstractVecOrMat, spec::ASCIIString="o"; kvs...) c = convert(RGB24, color(get(_parse_spec(spec), :color, RGB(0,0,0)))) scatter(x, y, s, fill(c,size(x)...), spec; kvs...) end function scatter(x::AbstractVecOrMat, y::AbstractVecOrMat, s::Union(Real,AbstractVecOrMat), c::AbstractVecOrMat, spec::ASCIIString="o"; kvs...) if typeof(s) <: Real s = fill(s, size(x)...) end if eltype(c) <: Real c = data2rgb(c, extrema(c), _current_colormap) elseif !(eltype(c) <: Color) error("bad color array") end sopts = _parse_spec(spec) p = ghf() c = ColoredPoints(x, y, s, c, sopts) add(p, c) for (k,v) in kvs if k in [:linekind,:symbolkind,:color,:linecolor,:linewidth,:symbolsize] style(c, k, v) else setattr(p, k, v) end end ghf(p) end ## stem ## stem(y::AbstractVecOrMat, spec::ASCIIString="o"; kvs...) = stem(1:length(y), y, spec; kvs...) function stem(x::AbstractVecOrMat, y::AbstractVecOrMat, spec::ASCIIString="o"; kvs...) p = ghf() sopts = _parse_spec(spec) s = Stems(x, y, sopts) haskey(sopts,:symbolkind) || (sopts[:symbolkind] = "circle") o = Points(x, y, sopts) _process_keywords(kvs, p, s, o) add(p, s, o) ghf(p) end function text(x::Real, y::Real, s::String; kvs...) p = _pwinston c = DataLabel(x, y, s, halign="left") _process_keywords(kvs, p, c) add(p, c) end spy(S::SparseMatrixCSC) = spy(S, 100, 100) spy(A::AbstractMatrix, nrS, ncS) = spy(sparse(A), nrS, ncS) spy(A::AbstractMatrix) = spy(sparse(A)) function plothist(p::FramedPlot, h::@compat(Tuple{Range,Vector}); kvs...) c = Histogram(h...) add(p, c) for (k,v) in kvs if k in [:color,:linecolor,:linekind,:linetype,:linewidth] style(c, k, v) else setattr(p, k, v) end end global _pwinston = p p end plothist(p::FramedPlot, args...; kvs...) = plothist(p::FramedPlot, hist(args...); kvs...) plothist(args...; kvs...) = plothist(ghf(), args...; kvs...) # 3x3 gaussian #_default_kernel2d=[.05 .1 .05; .1 .4 .1; .05 .1 .05] # 5x5 gaussian _default_kernel2d=(1.0/273.)*[1.0 4.0 7.0 4.0 1.0; 4.0 16. 26. 16. 4.0; 7.0 26. 41. 26. 7.0; 1.0 4.0 7.0 4.0 1.0; 4.0 16. 26. 16. 4.0] #hist2d function plothist2d(p::FramedPlot, h::@compat(Tuple{Union(Range,Vector),Union(Range,Vector),Array{Int,2}}); colormap=_current_colormap, smooth=0, kernel=_default_kernel2d, kvs...) xr, yr, hdata = h for i in 1:smooth hdata = conv2(hdata*1.0, kernel) end clims = (minimum(hdata), maximum(hdata)+1) img = data2rgb(hdata, clims, colormap)' add(p, Image((xr[1], xr[end]), (yr[1], yr[end]), img;)) #XXX: check if there is any Image-related named arguments setattr(p; kvs...) global _pwinston = p p end plothist2d(p::FramedPlot, args...; kvs...) = plothist2d(p::FramedPlot, hist2d(args...); kvs...) plothist2d(args...; kvs...) = plothist2d(ghf(), args...; kvs...) #errorbar errorbar(args...; kvs...) = errorbar(ghf(), args...; kvs...) function errorbar(p::FramedPlot, x::AbstractVector, y::AbstractVector; xerr=nothing, yerr=nothing, kvs...) xn=length(x) yn=length(y) if xerr != nothing xen = length(xerr) if xen == xn cx = SymmetricErrorBarsX(x, y, xerr) elseif xen == 2xn cx = ErrorBarsX(y, x.-xerr[1:xn], x.+xerr[xn+1:xen]) else warn("Dimensions of x and xerr do not match!") end style(cx; kvs...) add(p,cx) end if yerr != nothing yen=length(yerr) if yen == yn cy = SymmetricErrorBarsY(x, y, yerr) elseif yen == 2yn cy = ErrorBarsY(x, y.-yerr[1:yn], y.+yerr[yn+1:yen]) else warn("Dimensions of y and yerr do not match!") end style(cy; kvs...) add(p,cy) end global _pwinston = p p end function fplot_points(f::Function, xmin::Real, xmax::Real; max_recursion::Int=6, min_points::Int=10, tol::Float64=0.01) @assert xmin < xmax @assert min_points > 1 @assert max_recursion >= 0 xs = Float64[] ys = Float64[] cs = Array(Float64, max_recursion) fcs = Array(Float64, max_recursion) ls = Array(Int, max_recursion) local c::Float64 local fc::Float64 function good(a, b, c, fa, fb, fc, tol) u = b - a fu = fb - fa v = c - b fv = fc - fb n = u*v + fu*fv d2 = (u*u + fu*fu)*(v*v + fv*fv) n*n > d2*(1. - tol) end p = linspace(xmin, xmax, min_points) q = [f(x) for x in p] if max_recursion == 0 return p, q end for i = 1:length(p)-1 a::Float64 = p[i] fa::Float64 = q[i] c = p[i+1] fc = q[i+1] level::Int = 0 n::Int = 0 while true b::Float64 = 0.5(a + c) fb::Float64 = f(b) g1::Bool = good(a,b,c,fa,fb,fc,tol) g2::Bool = length(xs) > 0 ? good(xs[end],a,b,ys[end],fa,fb,tol) : true if (g1 && g2) || level == max_recursion push!(xs, a, b) push!(ys, fa, fb) a = c fa = fc n == 0 && break c = cs[n] fc = fcs[n] level = ls[n] n -= 1 else level += 1 n += 1 ls[n] = level cs[n] = c fcs[n] = fc c = b fc = fb end end end push!(xs, c) push!(ys, fc) xs, ys end function fplot(f::Function, limits, args...; kvs...) pargs = [] fopts = Dict() for arg in args if typeof(arg) <: String pargs = [arg] elseif typeof(arg) <: Integer fopts[:min_points] = arg elseif typeof(arg) <: FloatingPoint fopts[:tol] = arg else error("unrecognized argument ", arg) end end xmin = limits[1] xmax = limits[2] x,y = fplot_points(f, xmin, xmax; fopts...) plot(x, y, pargs...; kvs...) end # bar, barh ax = @compat Dict{Any,Any}(:bar => :x, :barh => :y) ax1 = @compat Dict{Any,Any}(:bar => :x1, :barh => :y1) vert = @compat Dict{Any,Any}(:bar => true, :barh => false) for fn in (:bar, :barh) eval(quote function $fn(p::FramedPlot, b::FramedBar, args...; kvs...) setattr(b, vertical=$(vert[fn])) setattr(p.$(ax[fn]), draw_subticks=false) setattr(p.$(ax[fn]), ticks=collect(1.:length(b.h))) setattr(p.$(ax1[fn]), ticklabels=b.g) add(p, b) global _pwinston = p p end function $fn(p::FramedPlot, g::AbstractVector, h::AbstractVector, args...; kvs...) b = FramedBar(g, h[:,end], args...; kvs...) $fn(p, b, args...; kvs...) end function $fn(p::FramedPlot, g::AbstractVector, h::AbstractMatrix, args...; kvs...) nc = size(h,2) barwidth = config_value("FramedBar", "barwidth")/nc offsets = barwidth * (nc - 1) * linspace(-.5, .5, nc) for c = 1:nc-1 b = FramedBar(g, h[:,c], args...; kvs...) setattr(b, offset=offsets[c]) setattr(b, barwidth=barwidth) setattr(b, vertical=$(vert[fn])) style(b, fillcolor=default_color(c)) style(b, draw_baseline=false) add(p, b) end b = FramedBar(g, h[:,nc], args...; kvs...) setattr(b, offset=offsets[nc]) setattr(b, barwidth=barwidth) style(b, fillcolor=default_color(nc)) $fn(p, b, args...; kvs...) end $fn(p::FramedPlot, h::AbstractVecOrMat, args...; kvs...) = $fn(p, [1:size(h,1)], h, args...; kvs...) $fn(args...; kvs...) = $fn(ghf(), args...; kvs...) end ) end grid(p::FramedPlot, tf::Bool) = (setattr(p.frame, draw_grid=tf); p) grid(p::FramedPlot) = grid(p, !any(map(x->getattr(x, "draw_grid"), p.frame.objs))) grid(args...) = grid(_pwinston, args...) function legend(p::FramedPlot, lab::AbstractVector, args...; kvs...) if length(args) > 0 && length(args[1]) == 2 && eltype(args[1]) <: Real position = args[1] args = args[2:end] elseif length(args) > 1 && eltype(args[1:2]) <: Real position = args[1:2] args = args[3:end] else position = [0.1, 0.9] end # TODO: define other legend positions plotcomp = getcomponents(p) nitems = min(length(lab), length(plotcomp)) for c in 1:nitems setattr(plotcomp[c], label=lab[c]) end add(p, Legend(position..., plotcomp[1:nitems], args...; kvs...)) end legend(lab::AbstractVector, args...; kvs...) = legend(_pwinston, lab, args...; kvs...) function timeplot(p::FramedPlot, x::Vector{DateTime}, y::AbstractArray, args...; kvs...) limits = datetime2unix([minimum(x), maximum(x)]) ticks = collect(0.0:0.2:1.0) ticklabels = x[round(Int64, ticks * (length(x) - 1) + 1)] normalized_x = (datetime2unix(x) - limits[1]) / (limits[2] - limits[1]) span = @compat Int(x[end] - x[1]) / 1000 kvs = Dict(kvs) if :format in keys(kvs) format = kvs[:format] delete!(kvs, :format) else if span > 365 * 24 * 60 * 60 # 1 year format = "%Y-%m" elseif 365 * 24 * 60 * 60 > span > 30 * 24 * 60 * 60 # 1 month format = "%Y-%m-%d" elseif 30 * 24 * 60 * 60 > span > 24 * 60 * 60 # 1 day format = "%Y-%m-%d\n%H:%M" elseif 24 * 60 * 60 > span > 60 * 60 # 1 hour format = "%H:%M" elseif 60 * 60 > 60 # 1 minute format = "%H:%M:%S" else format = "%H:%M:%S" end end ticklabels = map(d -> strftime(format, datetime2unix(d)), ticklabels) setattr(p.x1, :ticklabels, ticklabels) setattr(p.x1, :ticks, ticks) setattr(p.x1, :ticklabels_style, @compat Dict(:fontsize=>1.5)) plot(p, normalized_x, y, args...; kvs...) end timeplot(x::Vector{DateTime}, y::AbstractArray, args...; kvs...) = timeplot(ghf(), x, y, args...; kvs...) timeplot(x::Vector{Date}, y::AbstractArray, arg...; kvs...) = timeplot(ghf(), DateTime(x), y, arg...; kvs...) timeplot(p::FramedPlot, x::Vector{Date}, y::AbstractArray, arg...; kvs...) = timeplot(p, DateTime(x), y, arg...; kvs...)
'use strict'; /* Dependencies. */ var repeat = require('repeat-string'); var pad = require('../util/pad'); /* Expose. */ module.exports = listItem; /* Which checkbox to use. */ var CHECKBOX_MAP = {}; CHECKBOX_MAP.undefined = CHECKBOX_MAP.null = ''; CHECKBOX_MAP.true = '[x] '; CHECKBOX_MAP.false = '[ ] '; /** * Stringify a list item. * * Prefixes the content with a checked checkbox when * `checked: true`: * * [x] foo * * Prefixes the content with an unchecked checkbox when * `checked: false`: * * [ ] foo * * @param {Object} node - `listItem` node. * @param {Object} parent - `list` node. * @param {number} position - Index of `node` in `parent`. * @param {string} bullet - Bullet to use. This, and the * `listItemIndent` setting define the used indent. * @return {string} - Markdown list item. */ function listItem(node, parent, position, bullet) { var self = this; var style = self.options.listItemIndent; var loose = node.loose; var children = node.children; var length = children.length; var values = []; var index = -1; var value; var indent; var spacing; while (++index < length) { values[index] = self.visit(children[index], node); } value = CHECKBOX_MAP[node.checked] + values.join(loose ? '\n\n' : '\n'); if (style === '1' || (style === 'mixed' && value.indexOf('\n') === -1)) { indent = bullet.length + 1; spacing = ' '; } else { indent = Math.ceil((bullet.length + 1) / 4) * 4; spacing = repeat(' ', indent - bullet.length); } value = bullet + spacing + pad(value, indent / 4).slice(indent); if (loose && parent.children.length - 1 !== position) { value += '\n'; } return value; }
#pragma once #include "common.h" #include STRINGIFY(arch/TARGET_FOLDER/interface/arch_atomic.h)
<html dir="LTR"> <head> <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" /> <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5" /> <title><API key> Constructor</title> <xml> </xml> <link rel="stylesheet" type="text/css" href="MSDN.css" /> </head> <body id="bodyID" class="dtBODY"> <div id="nsbanner"> <div id="bannerrow1"> <table class="bannerparthead" cellspacing="0"> <tr id="hdr"> <td class="runninghead">Apache log4net™ SDK Documentation - Microsoft .NET Framework 4.0</td> <td class="product"> </td> </tr> </table> </div> <div id="TitleRow"> <h1 class="dtH1"><API key> Constructor </h1> </div> </div> <div id="nstext"> <p> Construct the configurator for a hierarchy </p> <div class="syntax"> <span class="lang">[Visual Basic]</span> <br />Public Sub New( _<br />   ByVal <i>hierarchy</i> As <a href="log4net.Repository.Hierarchy.Hierarchy.html">Hierarchy</a> _<br />)</div> <div class="syntax"> <span class="lang">[C#]</span> <br />public <API key>(<br />   <a href="log4net.Repository.Hierarchy.Hierarchy.html">Hierarchy</a> <i>hierarchy</i><br />);</div> <h4 class="dtH4">Parameters</h4> <dl> <dt> <i>hierarchy</i> </dt> <dd>The hierarchy to build.</dd> </dl> <h4 class="dtH4">Remarks</h4> <p> Initializes a new instance of the <a href="log4net.Repository.Hierarchy.<API key>.html"><API key></a> class with the specified <a href="log4net.Repository.Hierarchy.Hierarchy.html">Hierarchy</a>. </p> <h4 class="dtH4">See Also</h4><p><a href="log4net.Repository.Hierarchy.<API key>.html"><API key> Class</a> | <a href="log4net.Repository.Hierarchy.html">log4net.Repository.Hierarchy Namespace</a></p><object type="application/x-oleobject" classid="clsid:<API key>" viewastext="true" style="display: none;"><param name="Keyword" value="<API key> class, constructor"></param></object><hr /><div id="footer"><a href='http: </body> </html>
/* * kmp_config.h -- Feature macros */ // The LLVM Compiler Infrastructure #ifndef KMP_CONFIG_H #define KMP_CONFIG_H #include "kmp_platform.h" // cmakedefine01 MACRO will define MACRO as either 0 or 1 // cmakedefine MACRO 1 will define MACRO as 1 or leave undefined #cmakedefine01 DEBUG_BUILD #cmakedefine01 <API key> #cmakedefine01 <API key> #define USE_ITT_NOTIFY <API key> #if ! <API key> # define <API key> #endif #cmakedefine01 <API key> #if <API key> # define <API key> #endif #cmakedefine01 <API key> #define <API key> <API key> #cmakedefine01 LIBOMP_HAVE_PSAPI #define KMP_HAVE_PSAPI LIBOMP_HAVE_PSAPI #cmakedefine01 LIBOMP_STATS #define KMP_STATS_ENABLED LIBOMP_STATS #cmakedefine01 <API key> #define <API key> <API key> #cmakedefine01 <API key> #define <API key> <API key> #define KMP_HAVE___RDTSC LIBOMP_HAVE___RDTSC #cmakedefine01 LIBOMP_USE_DEBUGGER #define USE_DEBUGGER LIBOMP_USE_DEBUGGER #cmakedefine01 LIBOMP_OMPT_DEBUG #define OMPT_DEBUG LIBOMP_OMPT_DEBUG #cmakedefine01 LIBOMP_OMPT_SUPPORT #define OMPT_SUPPORT LIBOMP_OMPT_SUPPORT #cmakedefine01 LIBOMP_OMPT_BLAME #define OMPT_BLAME LIBOMP_OMPT_BLAME #cmakedefine01 LIBOMP_OMPT_TRACE #define OMPT_TRACE LIBOMP_OMPT_TRACE #cmakedefine01 <API key> #define <API key> <API key> #define <API key> 0 #cmakedefine01 <API key> #define <API key> <API key> #cmakedefine01 <API key> #define KMP_USE_ASSERT <API key> #cmakedefine01 STUBS_LIBRARY #cmakedefine01 LIBOMP_USE_HWLOC #define KMP_USE_HWLOC LIBOMP_USE_HWLOC #define KMP_ARCH_STR "@LIBOMP_LEGAL_ARCH@" #define KMP_LIBRARY_FILE "@LIBOMP_LIB_FILE@" #define KMP_VERSION_MAJOR @<API key>@ #define KMP_VERSION_MINOR @<API key>@ #define LIBOMP_OMP_VERSION @LIBOMP_OMP_VERSION@ #define OMP_50_ENABLED (LIBOMP_OMP_VERSION >= 50) #define OMP_45_ENABLED (LIBOMP_OMP_VERSION >= 45) #define OMP_40_ENABLED (LIBOMP_OMP_VERSION >= 40) #define OMP_30_ENABLED (LIBOMP_OMP_VERSION >= 30) #cmakedefine01 LIBOMP_TSAN_SUPPORT #if LIBOMP_TSAN_SUPPORT #define TSAN_SUPPORT #endif // Configured cache line based on architecture #if KMP_ARCH_PPC64 # define CACHE_LINE 128 #else # define CACHE_LINE 64 #endif #if ! KMP_32_BIT_ARCH # define BUILD_I8 1 #endif #define KMP_DYNAMIC_LIB 1 #define <API key> 1 #define <API key> 1 #define <API key> 1 #define KMP_ASM_INTRINS 1 #define USE_ITT_BUILD <API key> #define <API key> __kmp_itt_ #if ! KMP_MIC # define USE_LOAD_BALANCE 1 #endif #if ! (KMP_OS_WINDOWS || KMP_OS_DARWIN) # define KMP_TDATA_GTID 1 #endif #if STUBS_LIBRARY # define KMP_STUB 1 #endif #if DEBUG_BUILD || <API key> # define KMP_DEBUG 1 #endif #if KMP_OS_WINDOWS # define KMP_WIN_CDECL #else # define BUILD_TV # define KMP_GOMP_COMPAT #endif #endif // KMP_CONFIG_H
using System.Linq.Expressions; using Marten.Linq.Fields; using Marten.Linq.SqlGeneration; using Weasel.Postgresql; using Weasel.Postgresql.SqlGeneration; namespace Marten.Linq.Parsing { internal class ModuloFragment : IComparableFragment, ISqlFragment { private readonly ISqlFragment _left; private readonly ISqlFragment _right; private string _op; private CommandParameter _value; public ModuloFragment(BinaryExpression expression, IFieldMapping fields) { _left = analyze(expression.Left, fields); _right = analyze(expression.Right, fields); } private ISqlFragment analyze(Expression expression, IFieldMapping fields) { if (expression is ConstantExpression c) { return new CommandParameter(c); } else { return fields.FieldFor(expression); } } public ISqlFragment CreateComparison(string op, ConstantExpression value, Expression memberExpression) { _op = " " + op + " "; _value = new CommandParameter(value); return this; } public void Apply(CommandBuilder builder) { _left.Apply(builder); builder.Append(" % "); _right.Apply(builder); builder.Append(_op); _value.Apply(builder); } public bool Contains(string sqlText) { return false; } } }
#ifndef AD_DBPL_H #define AD_DBPL_H 1 // object code form for any purpose and without fee is hereby granted, // restricted rights notice below appear in all supporting // documentation. // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC. // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE // UNINTERRUPTED OR ERROR FREE. // Use, duplication, or disclosure by the U.S. Government is subject to // restrictions set forth in FAR 52.227-19 (Commercial Computer // (Rights in Technical Data and Computer Software), as applicable. // DESCRIPTION: Lightweight polyline API header file. #include "dbmain.h" #include "dbcurve.h" #include "gelnsg2d.h" #include "gelnsg3d.h" #include "gearc2d.h" #include "gearc3d.h" #include "gept2dar.h" #include "dbboiler.h" #pragma pack(push, 8) class AcDb2dPolyline; class AcDbPolyline : public AcDbCurve { public: AcDbPolyline(); AcDbPolyline(unsigned int num_verts); virtual ~AcDbPolyline(); <API key>(AcDbPolyline); #endif /*AD_DBPL_H*/
import createSvgIcon from './utils/createSvgIcon'; import { jsx as _jsx } from "react/jsx-runtime"; export default createSvgIcon( /*#__PURE__*/_jsx("path", { d: "M18 14c0-3.98-6-10.8-6-10.8s-1.18 1.35-2.5 3.19l8.44 8.44c.03-.27.06-.55.06-.83zM5.41 5.14 4 6.55l3.32 3.32C6.55 11.33 6 12.79 6 14c0 3.31 2.69 6 6 6 1.52 0 2.9-.57 3.95-1.5l2.63 2.63L20 19.72 5.41 5.14z" }), '<API key>');
function BEServices(){ var addresses = []; this.save = function (addressBookItem){ console.log("INITIAL addresses.length: " + addresses.length); console.log("typeof addressBookItem=" + typeof addressBookItem); if (addressBookItem instanceof AddressBookItem) { addresses.push(addressBookItem); console.log("CURRENT addresses.length: " + addresses.length); return "OK"; } return "KO"; } this.findAll = function (){ return addresses; } } export default BEServices;
import * as React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon( <path d="M19.94 21.12c-1.1-2.94-1.64-6.03-1.64-9.12 0-3.09.55-6.18 1.64-9.12.04-.11.06-.22.06-.31 0-.34-.23-.57-.63-.57H4.63c-.4 0-.63.23-.63.57 0 .1.02.2.06.31C5.16 5.82 5.71 8.91 5.71 12c0 3.09-.55 6.18-1.64 9.12-.05.11-.07.22-.07.31 0 .33.23.57.63.57h14.75c.39 0 .63-.24.63-.57-.01-.1-.03-.2-.07-.31zM6.54 20c.77-2.6 1.16-5.28 1.16-8 0-2.72-.39-5.4-1.16-8h10.91c-.77 2.6-1.16 5.28-1.16 8 0 2.72.39 5.4 1.16 8H6.54z" /> , 'PanoramaVertical');
{% load foundations_tags %} {% load i18n %} <div id="edit-modal"> <div class="modal-header"> <h3>{% trans "Edit Profile" %}</h3> </div> <form class="nice" method="POST" action="{% url profile_edit %}"> {% csrf_token %} <div class="modal-body"> <fieldset> {{ profile_form|as_foundation }} </fieldset> </div> <div class="modal-footer"> <button type="submit" class="button medium radius nice">Update</button> <button type="cancel" class="button white medium radius nice">Cancel</button> </div> </form> </div>
package com.pragmaticobjects.oo.atom.codegen.bytebuddy.smt; import com.pragmaticobjects.oo.atom.codegen.bytebuddy.matchers.NaturalJavaAtom; import io.vavr.collection.List; import net.bytebuddy.description.type.TypeDescription; /** * Loads all non-natural fields of on-stack object and creates an array from them. * * @author Kapralov Sergey */ public class <API key> extends SmtInferred { /** * Ctor. * * @param type Type. */ public <API key>(TypeDescription type) { super(new Inference(type)); } /** * {@link <API key>} inference. * * @author Kapralov Sergey */ private static class Inference implements <API key>.Inference { private final TypeDescription type; /** * Ctor. * * @param type Type. */ public Inference(TypeDescription type) { this.type = type; } @Override public final StackManipulation<API key>() { NaturalJavaAtom naturalMatcher = new NaturalJavaAtom(); return new SmtArray( List.of(type) .flatMap(TypeDescription::getDeclaredFields) .filter(f -> !f.isStatic()) .filter(f -> !naturalMatcher.matches(f.getType().asErasure())) .map(f -> new SmtLoadField(f)) .toJavaArray(SmtLoadField.class) ); } } }
*, *::after, *::before { box-sizing: border-box; } html { font-size: 62.5%; } body { font-size: 1.6rem; font-family: "Source Sans Pro", sans-serif; color: #343642; background-color: #ffffff; } a { color: #982b3c; text-decoration: none; } button { cursor: pointer; border: none; background-color: transparent; outline: none; font-size: 1.6rem; } .cd-image-block { position: relative; } .cd-image-block::before { /* this is the layer used to cover the .cd-image-block when the content block becomes visible - mobile only */ content: ''; position: absolute; top: 0; left: 0; height: 100%; width: 100%; background-color: rgba(52, 54, 66, 0.6); opacity: 0; visibility: hidden; -webkit-transition: opacity 0.3s 0s, visibility 0s 0.3s; -moz-transition: opacity 0.3s 0s, visibility 0s 0.3s; transition: opacity 0.3s 0s, visibility 0s 0.3s; } .cd-image-block.<API key>::before { opacity: 1; visibility: visible; -webkit-transition: opacity 0.3s 0s, visibility 0s 0s; -moz-transition: opacity 0.3s 0s, visibility 0s 0s; transition: opacity 0.3s 0s, visibility 0s 0s; } @media only screen and (min-width: 768px) { .cd-image-block::before { display: none; } } .cd-images-list::before { /* never visible - this is used in jQuery to check the current MQ */ content: 'mobile'; display: none; } .cd-images-list > li { height: 250px; background: #979c9c url(../img/img-1.jpg) no-repeat center center; background-size: cover; } .cd-images-list > li:nth-of-type(2) { background: #343642 url(../img/img-2.jpg) no-repeat center center; background-size: cover; } .cd-images-list > li:nth-of-type(3) { background: #982b3c url(../img/img-3.jpg) no-repeat center center; background-size: cover; } .cd-images-list > li:nth-of-type(4) { background: #338899 url(../img/img-4.jpg) no-repeat center center; background-size: cover; } .cd-images-list > li > a { /* used to vertically align the h2 child - mobile version only */ display: table; height: 100%; width: 100%; } .cd-images-list h2 { /* used to vertically align h2 - mobile version only */ display: table-cell; vertical-align: middle; text-align: center; font-size: 3rem; color: #ffffff; font-weight: 700; -<API key>: antialiased; -<API key>: grayscale; } @media only screen and (min-width: 768px) { .cd-images-list::before { /* never visible - this is used in jQuery to check the current MQ */ content: 'desktop'; } .cd-images-list > li > a { display: block; padding: 4em 3em; cursor: default; pointer-events: none; } .cd-images-list h2 { font-size: 5.5rem; text-align: left; } } .cd-content-block { /* move the block outside the viewport (to the right) - mobile only */ position: fixed; z-index: 1; top: 0; left: 0; height: 100%; -webkit-transform: translateX(100%); -moz-transform: translateX(100%); -ms-transform: translateX(100%); -o-transform: translateX(100%); transform: translateX(100%); -webkit-transition: -webkit-transform 0.3s; -moz-transition: -moz-transform 0.3s; transition: transform 0.3s; } .cd-content-block.is-visible { -webkit-transform: translateX(0); -moz-transform: translateX(0); -ms-transform: translateX(0); -o-transform: translateX(0); transform: translateX(0); } .cd-content-block > ul { height: 100%; } .cd-content-block > ul > li { position: absolute; height: 100%; padding: 2em; overflow-y: scroll; background-color: #ffffff; opacity: 0; visibility: hidden; } .cd-content-block > ul > li.is-selected { /* this is the selected content */ position: relative; opacity: 1; visibility: visible; -<API key>: touch; } .cd-content-block h2 { line-height: 1.2; font-weight: 700; font-size: 2.3rem; margin-bottom: 1em; } .cd-content-block p { margin-bottom: 2em; line-height: 1.6; color: #85868d; } .cd-content-block .cd-close { /* 'X' icon to close the content block - mobile only */ position: fixed; top: 0; right: 0; height: 44px; width: 44px; /* image replacement */ overflow: hidden; text-indent: 100%; white-space: nowrap; color: transparent; -webkit-transform: scale(0); -moz-transform: scale(0); -ms-transform: scale(0); -o-transform: scale(0); transform: scale(0); -webkit-transition: -webkit-transform 0.2s; -moz-transition: -moz-transform 0.2s; transition: transform 0.2s; } .cd-content-block .cd-close::after, .cd-content-block .cd-close::before { /* these are the 2 lines of the 'X' icon */ content: ''; position: absolute; left: 50%; top: 50%; width: 2px; height: 24px; background-color: #343642; /* Force Hardware Acceleration */ -<API key>: hidden; backface-visibility: hidden; -webkit-transform: translateZ(0); -moz-transform: translateZ(0); -ms-transform: translateZ(0); -o-transform: translateZ(0); transform: translateZ(0); } .cd-content-block .cd-close::after { -webkit-transform: translateX(-50%) translateY(-50%) rotate(45deg); -moz-transform: translateX(-50%) translateY(-50%) rotate(45deg); -ms-transform: translateX(-50%) translateY(-50%) rotate(45deg); -o-transform: translateX(-50%) translateY(-50%) rotate(45deg); transform: translateX(-50%) translateY(-50%) rotate(45deg); } .cd-content-block .cd-close::before { -webkit-transform: translateX(-50%) translateY(-50%) rotate(-45deg); -moz-transform: translateX(-50%) translateY(-50%) rotate(-45deg); -ms-transform: translateX(-50%) translateY(-50%) rotate(-45deg); -o-transform: translateX(-50%) translateY(-50%) rotate(-45deg); transform: translateX(-50%) translateY(-50%) rotate(-45deg); } .cd-content-block .cd-close.is-scaled-up { -webkit-transform: scale(1); -moz-transform: scale(1); -ms-transform: scale(1); -o-transform: scale(1); transform: scale(1); } .no-touch .cd-content-block .cd-close.is-scaled-up:hover { -webkit-transform: scale(1.2); -moz-transform: scale(1.2); -ms-transform: scale(1.2); -o-transform: scale(1.2); transform: scale(1.2); } @media only screen and (min-width: 768px) { .cd-content-block { /* reset style */ position: static; -webkit-transform: translateX(0); -moz-transform: translateX(0); -ms-transform: translateX(0); -o-transform: translateX(0); transform: translateX(0); } .cd-content-block > ul > li { /* reset style */ opacity: 1; visibility: visible; padding: 4em 3em; } .cd-content-block > ul > li.overflow-hidden { /* this class is used during the animation (slider change) to hide the scrolling bar */ overflow: hidden; } .cd-content-block h2 { font-size: 3rem; } .cd-content-block .cd-close { display: none; } } @media only screen and (min-width: 768px) { .cd-image-block, .cd-content-block { /* slider style - desktop version only */ width: 50%; float: left; height: 100vh; overflow: hidden; } .cd-image-block > ul, .cd-content-block > ul { position: relative; height: 100%; } .cd-image-block > ul > li, .cd-content-block > ul > li { position: absolute; top: 0; left: 0; height: 100%; width: 100%; /* Force Hardware Acceleration */ -webkit-transform: translateZ(0); -moz-transform: translateZ(0); -ms-transform: translateZ(0); -o-transform: translateZ(0); transform: translateZ(0); -<API key>: hidden; backface-visibility: hidden; will-change: transform; /* by default, the items are moved to the right - relative to their parent elements */ -webkit-transform: translateX(100%); -moz-transform: translateX(100%); -ms-transform: translateX(100%); -o-transform: translateX(100%); transform: translateX(100%); -webkit-transition: -webkit-transform 0.5s; -moz-transition: -moz-transform 0.5s; transition: transform 0.5s; } .cd-image-block > ul > li.is-selected, .cd-content-block > ul > li.is-selected { /* this is the visible item */ position: absolute; -webkit-transform: translateX(0); -moz-transform: translateX(0); -ms-transform: translateX(0); -o-transform: translateX(0); transform: translateX(0); } .cd-image-block > ul > li.move-left, .cd-content-block > ul > li.move-left { /* this is the item hidden on the left */ -webkit-transform: translateX(-100%); -moz-transform: translateX(-100%); -ms-transform: translateX(-100%); -o-transform: translateX(-100%); transform: translateX(-100%); } } .block-navigation { /* this is the slider navigation - desktop version only */ display: none; } @media only screen and (min-width: 768px) { .block-navigation { display: block; position: fixed; bottom: 0; left: 0; width: 50%; } .block-navigation::after { clear: both; content: ""; display: table; } .block-navigation li { width: 50%; height: 50px; line-height: 50px; text-align: center; background-color: rgba(0, 0, 0, 0.5); -webkit-transition: background 0.2s; -moz-transition: background 0.2s; transition: background 0.2s; } .block-navigation li:hover { background-color: rgba(0, 0, 0, 0.7); } .block-navigation li:first-of-type { float: left; } .block-navigation li:last-of-type { float: right; } .block-navigation button { display: block; height: 100%; width: 100%; color: #ffffff; -<API key>: antialiased; -<API key>: grayscale; } .block-navigation button.inactive { opacity: .3; cursor: not-allowed; } } @media only screen and (min-width: 768px) { .no-js .cd-content-block { display: none; } .no-js .cd-image-block { width: 100%; overflow: visible; } .no-js .cd-images-list::after { clear: both; content: ""; display: table; } .no-js .cd-images-list > li { position: static; width: 50%; float: left; height: 400px; -webkit-transform: translateX(0); -moz-transform: translateX(0); -ms-transform: translateX(0); -o-transform: translateX(0); transform: translateX(0); } .no-js .cd-images-list > li.is-selected { position: static; } .no-js .cd-images-list > li > a { cursor: pointer; pointer-events: auto; } .no-js .block-navigation { display: none; } }
# KMMGhostLoginClient [![CI Status](https: [![Version](https: [![License](https: [![Platform](https: ## Usage To run the example project, clone the repo, and run `pod install` from the Example directory first. To login to a Ghost blog use the `KMMGhostLoginClient`, then create an instance of a class that conforms to `<API key>` (e.g. `<API key>`) and an instance of a class that conforms to `<API key>` (e.g. `<API key>`). Use these objects to create a login client: objective-c KMMGhostLoginClient *client = [[KMMGhostLoginClient alloc] initWithManager:manager parser:parser]; [client loginWithUsername:@"username" password:@"password" complete:^(KMMGhostLoginToken *__nullable token, NSError *__nullable error) { if(error) { NSLog(@"An error occurred"); } else { //Use token here to get your auth token NSString *accessToken = token.accessToken; } }]; ## Requirements This project requires the latest iOS, iOS 8.4. It also has a dependency on AFNetworking version 2.6. ## Installation GhostLoginClient is available through [CocoaPods](http://cocoapods.org). To install it, simply add the following line to your Podfile: ruby pod "KMMGhostLoginClient" Alternatively, although I discourage this approach, clone the project and copy all the files under the `Pod` folder into your project. ## Author Kerr Marin Miller, @kerrmarin, www.kerrmarin.com GhostLoginClient is available under the MIT license. See the LICENSE file for more info.
-- See RFC6265 http://tools.ietf.org/search/rfc6265 -- require "luacov" local type = type local byte = string.byte local sub = string.sub local format = string.format local log = ngx.log local ERR = ngx.ERR local EQUAL = byte("=") local SEMICOLON = byte(";") local SPACE = byte(" ") local HTAB = byte("\t") local ok, new_tab = pcall(require, "table.new") if not ok then new_tab = function (narr, nrec) return {} end end local _M = new_tab(0, 2) _M._VERSION = '0.01' local mt = { __index = _M } local function get_cookie_table(text_cookie) if type(text_cookie) ~= "string" then log(ERR, format("expect text_cookie to be \"string\" but found %s", type(text_cookie))) return {} end local EXPECT_KEY = 1 local EXPECT_VALUE = 2 local EXPECT_SP = 3 local n = 0 local len = #text_cookie for i=1, len do if byte(text_cookie, i) == SEMICOLON then n = n + 1 end end local cookie_table = new_tab(0, n + 1) local state = EXPECT_SP local i = 1 local j = 1 local key, value while j <= len do if state == EXPECT_KEY then if byte(text_cookie, j) == EQUAL then key = sub(text_cookie, i, j - 1) state = EXPECT_VALUE i = j + 1 end elseif state == EXPECT_VALUE then if byte(text_cookie, j) == SEMICOLON or byte(text_cookie, j) == SPACE or byte(text_cookie, j) == HTAB then value = sub(text_cookie, i, j - 1) cookie_table[key] = value key, value = nil, nil state = EXPECT_SP i = j + 1 end elseif state == EXPECT_SP then if byte(text_cookie, j) ~= SPACE and byte(text_cookie, j) ~= HTAB then state = EXPECT_KEY i = j j = j - 1 end end j = j + 1 end if key ~= nil and value == nil then cookie_table[key] = sub(text_cookie, i) end return cookie_table end function _M.new(self) local _cookie = ngx.var.http_cookie --if not _cookie then --return nil, "no cookie found in current request" --end return setmetatable({ _cookie = _cookie }, mt) end function _M.get(self, key) if not self._cookie then return nil, "no cookie found in the current request" end if self.cookie_table == nil then self.cookie_table = get_cookie_table(self._cookie) end return self.cookie_table[key] end function _M.get_all(self) local err if not self._cookie then return nil, "no cookie found in the current request" end if self.cookie_table == nil then self.cookie_table = get_cookie_table(self._cookie) end return self.cookie_table end local function bake(cookie) if not cookie.key or not cookie.value then return nil, 'missing cookie field "key" or "value"' end if cookie["max-age"] then cookie.max_age = cookie["max-age"] end local str = cookie.key .. "=" .. cookie.value .. (cookie.expires and "; Expires=" .. cookie.expires or "") .. (cookie.max_age and "; Max-Age=" .. cookie.max_age or "") .. (cookie.domain and "; Domain=" .. cookie.domain or "") .. (cookie.path and "; Path=" .. cookie.path or "") .. (cookie.secure and "; Secure" or "") .. (cookie.httponly and "; HttpOnly" or "") .. (cookie.extension and "; " .. cookie.extension or "") return str end function _M.set(self, cookie) local cookie_str, err = bake(cookie) if not cookie_str then return nil, err end ngx.header['Set-Cookie'] = cookie_str return true end return _M
{{<layout}} {{$pageTitle}} Licensing platform {{/pageTitle}} {{$content}} <main id="content" role="main"> <div class="grid-row"> <div class="column-two-thirds"> <p><h1 class="heading-xlarge">Apply for a CITES permit</h1> <h2>What is the purpose of the export?</h2> <p> <fieldset> <label class="block-label" for="radio-inline-1"> <input id="radio-inline-1" type="radio" name="radio-inline-group" value="I"> Commercial sale </label> <label class="block-label" for="radio-inline-2"> <input id="radio-inline-2" type="radio" name="radio-inline-group" value="II"> Personal export </label> <label class="block-label" for="radio-inline-3"> <input id="radio-inline-3" type="radio" name="radio-inline-group" value="III"> Hunting trophy </label> <label class="block-label" for="radio-inline-4"> <input id="radio-inline-4" type="radio" name="radio-inline-group" value="IV"> Scientific research </label> <label class="block-label" for="radio-inline-5"> <input id="radio-inline-5" type="radio" name="radio-inline-group" value="V"> Medical research </label> <label class="block-label" for="radio-inline-6"> <input id="radio-inline-6" type="radio" name="radio-inline-group" value="VI"> Educational </label> <label class="block-label" for="radio-inline-7"> <input id="radio-inline-7" type="radio" name="radio-inline-group" value="VII"> Law enforcement </label> <label class="block-label" for="radio-inline-8"> <input id="radio-inline-8" type="radio" name="radio-inline-group" value="VIII"> Zoos </label> <label class="block-label" for="radio-inline-9"> <input id="radio-inline-9" type="radio" name="radio-inline-group" value="VIII"> Travelling exhibitions </label> <label class="block-label" for="radio-inline-10"> <input id="radio-inline-10" type="radio" name="radio-inline-group" value="VIII"> Breeding in captivity </label> <label class="block-label" for="radio-inline-11"> <input id="radio-inline-11" type="radio" name="radio-inline-group" value="VIII"> Introduction to the wild </label> </fieldset> </p> <p><a href="cites_questions_3"><button class="button">Continue</button></a> <br> <a href="#">Back</a></p> <! <fieldset class="validate inline-fields" <API key>="dateOfBirthDate" <API key>="fieldset" <API key>="allNonEmpty" <API key>="day month year"> <span class="day field-wrapper"> <label for="dob_dob_day" class=""> Day </label> <input type="number" id="dob_dob_day" name="dob.dob.day" value="" autocomplete="off" class="text day validate " <API key>="day" <API key>="field" <API key>="nonEmpty" onkeyup="moveOnMax(this,'dob_dob_month')"> </span> <span class="month field-wrapper"> <label for="dob_dob_month" class=""> Month </label> <input type="number" id="dob_dob_month" name="dob.dob.month" value="" autocomplete="off" class="text month validate " <API key>="month" <API key>="field" <API key>="nonEmpty" onkeyup="moveOnMax(this,'dob_dob_year')"> </span> <span class="year field-wrapper"> <label for="dob_dob_year" class=""> Year </label> <input type="number" id="dob_dob_year" name="dob.dob.year" value="" autocomplete="off" class="text year text validate " <API key>="year" <API key>="field" <API key>="nonEmpty"> </span> <p class="example">For example: <span class="date">31 3 2010</span></p> </fieldset> </div> <div class="column-third"> <p></p> </div> </div> </main> </div> {{/content}} {{/layout}}
#ifndef BITCOIN_VERSION_H #define BITCOIN_VERSION_H #include "clientversion.h" #include <string> // client versioning static const int CLIENT_VERSION = 1000000 * <API key> + 10000 * <API key> + 100 * <API key> + 1 * <API key>; extern const std::string CLIENT_NAME; extern const std::string CLIENT_BUILD; extern const std::string CLIENT_DATE; // network protocol versioning static const int PROTOCOL_VERSION = 70002; // intial proto version, to be increased after version/verack negotiation static const int INIT_PROTO_VERSION = 209; // disconnect from peers older than this proto version static const int <API key> = 70002; // nTime field added to CAddress, starting with this version; // if possible, avoid requesting addresses nodes older than this static const int CADDR_TIME_VERSION = 31402; // only request blocks from nodes outside this range of versions static const int <API key> = 60000; static const int NOBLKS_VERSION_END = 60002; // BIP 0031, pong message, is enabled for all versions AFTER this one static const int BIP0031_VERSION = 60000; static const int MEMPOOL_GD_VERSION = 60002; #endif
Rails.application.configure do # Verifies that versions and hashed value of the package contents in the project's package.json config.webpacker.<API key> = false # Settings specified here will take precedence over those in config/application.rb. # Code is not reloaded between requests. config.cache_classes = true # Eager load code on boot. This eager loads most of Rails and # your application in memory, allowing both threaded web servers # and those relying on copy on write to perform better. # Rake tasks automatically ignore this option for performance. config.eager_load = true # Full error reports are disabled and caching is turned on. config.<API key> = false config.action_controller.perform_caching = true # Disable serving static files from the `/public` folder by default since # Apache or NGINX already handles this. config.public_file_server.enabled = ENV['<API key>'].present? # Compress JavaScripts and CSS. config.assets.js_compressor = Uglifier.new(harmony: true) # config.assets.css_compressor = :sass # Do not fallback to assets pipeline if a precompiled asset is missed. config.assets.compile = true # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb # Enable serving of images, stylesheets, and JavaScripts from an asset server. # Specifies the header that your server uses for sending files. # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX # Action Cable endpoint configuration # config.action_cable.url = 'wss://example.com/cable' # Don't mount Action Cable in the main server process. # config.action_cable.mount_path = nil # Force all access to the app over SSL, use <API key>, and use secure cookies. # config.force_ssl = true # Use the lowest log level to ensure availability of diagnostic information # when problems arise. config.log_level = :debug # Prepend all log lines with the following tags. config.log_tags = [:request_id] # Use a different cache store in production. # config.cache_store = :mem_cache_store # Use a real queuing backend for Active Job (and separate queues per environment) # config.active_job.queue_adapter = :resque # config.active_job.queue_name_prefix = "<API key>#{Rails.env}" config.action_mailer.perform_caching = false # Ignore bad email addresses and do not raise email delivery errors. # Set this to true and configure the email server for immediate delivery to raise delivery errors. # config.action_mailer.<API key> = false # Enable locale fallbacks for I18n (makes lookups for any locale fall back to # the I18n.default_locale when a translation cannot be found). config.i18n.fallbacks = true # Send deprecation notices to registered listeners. config.active_support.deprecation = :notify # Use default logging formatter so that PID and timestamp are not suppressed. config.log_formatter = ::Logger::Formatter.new # Use a different logger for distributed setups. # require 'syslog/logger' # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') if ENV["RAILS_LOG_TO_STDOUT"].present? logger = ActiveSupport::Logger.new(STDOUT) logger.formatter = config.log_formatter config.logger = ActiveSupport::TaggedLogging.new(logger) end config.assets.logger = Logger.new $stdout # Do not dump schema after migrations. config.active_record.<API key> = false end
'use strict'; var defineUsDollar = require('dbjs-ext/number/currency/us-dollar') , Database = require('dbjs'); module.exports = function (t, a) { var db = new Database() , UsDollar = defineUsDollar(db) , BusinessProcess = require('../../../model/<API key>')(db) , businessProcess = BusinessProcess.prototype; t(BusinessProcess, { currencyType: UsDollar, assets: { label: "Property", inputPlaceholder: "Property description: "All the buildings, land and other immovable property belonging to the " + "merchant and are affected to their activity." }, machinery: { label: "Machinery, equipment and vehicles", inputPlaceholder: "Machinery, equipment and vehicles description: "All the machines, tools, computer equipment, vehicles and other movable " + "property affected to the commercial activity.", addLabel: "Add" } }); a(businessProcess.inventory.getDescriptor('assets').label, "Property"); businessProcess.inventory.assets.map.get('mop').setProperties({ description: "Great for cleaning floors", value: 150 }); a(businessProcess.inventory.assets.ordered.first.value, 150); };
// Elix is a JavaScript project, but we define TypeScript declarations so we can // confirm our code is type safe, and to support TypeScript users. <reference path="../core/shared.d.ts"/> import { contentSlot } from "./internal.js"; declare const SlotContentMixin: StateMixin< {}, {}, { readonly [contentSlot]: HTMLSlotElement | null; }, { content: Node[]; } >; export default SlotContentMixin;
/* @option Width */ .wrapperOuter{min-width:1150px;} .wrapperInner{width:1060px;}
#include <UtH/Platform/Android/AndroidWindowImpl.hpp> #include <UtH/Platform/OpenGL.hpp> #include <UtH/Platform/OGLCheck.hpp> #include <UtH/Platform/Android/AndroidEngine.hpp> #include <UtH/Platform/Debug.hpp> #include <UtH/Platform/Window.hpp> #include <UtH/Engine/Engine.hpp> #include <UtH/Platform/Graphics.hpp> #include <UtH/Platform/Android/InputSensor.hpp> namespace uth { static bool focused = true; void* AndroidWindowImpl::create(const WindowSettings& settings) { const EGLint attribs[] = { EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL_BLUE_SIZE, 8, EGL_GREEN_SIZE, 8, EGL_RED_SIZE, 8, EGL_ALPHA_SIZE, 8, EGL_DEPTH_SIZE, 8, EGL_STENCIL_SIZE, 8, EGL_NONE }; EGLint attribList[] = { <API key>, 2, EGL_NONE }; EGLint format, numConfigs; uthAndroidEngine.display = eglGetDisplay(EGL_DEFAULT_DISPLAY); WriteLog("eglGetDisplay %d", (int)uthAndroidEngine.display); CheckGLError("eglGetDisplay"); if(uthAndroidEngine.display == EGL_NO_DISPLAY) { WriteError("display nodisplay"); } eglInitialize(uthAndroidEngine.display,0,0); WriteLog("eglInitialize succeeded"); CheckGLError("eglInitialize"); //eglChooseConfig(androidengine.display, attribs, 0, 1, &numConfigs); //WriteLog("Configs: %d", (int)numConfigs); eglChooseConfig(uthAndroidEngine.display, attribs, &uthAndroidEngine.config, 1, &numConfigs); CheckGLError("eglChooseConfig"); WriteLog("eglChooseConfig succeeded"); eglGetConfigAttrib(uthAndroidEngine.display, uthAndroidEngine.config, <API key>, &format); CheckGLError("eglGetConfigAttrib"); WriteLog("eglGetConfigAttrib succeeded"); //<API key>(androidengine.app->window, 0, 0, 0); //CheckGLError(); // WriteLog("<API key> succeeded"); uthAndroidEngine.surface = <API key>(uthAndroidEngine.display, uthAndroidEngine.config, uthAndroidEngine.app->window, 0); CheckGLError("<API key>"); WriteLog("<API key> succeeded"); uthAndroidEngine.context = eglCreateContext(uthAndroidEngine.display, uthAndroidEngine.config, EGL_NO_CONTEXT, attribList); CheckGLError("eglCreateContext"); WriteLog("eglCreateContext succeeded"); if(eglMakeCurrent(uthAndroidEngine.display, uthAndroidEngine.surface, uthAndroidEngine.surface, uthAndroidEngine.context) == EGL_FALSE) { CheckGLError("eglMakeCurrent"); WriteError("eglMakeCurrent failed"); return nullptr; } EGLint tempX; EGLint tempY; eglQuerySurface(uthAndroidEngine.display, uthAndroidEngine.surface, EGL_WIDTH, &tempX); CheckGLError("eglQuerySurface"); eglQuerySurface(uthAndroidEngine.display, uthAndroidEngine.surface, EGL_HEIGHT, &tempY); CheckGLError("eglQuerySurface"); uthAndroidEngine.settings.size.x = static_cast<float>(tempX); uthAndroidEngine.settings.size.y = static_cast<float>(tempY); const_cast<WindowSettings&>(settings).size = uthAndroidEngine.settings.size; //glHint(<API key>, GL_FASTEST); //glEnable(GL_CULL_FACE); //glEnable(GL_DEPTH_TEST); Graphics::SetBlendFunction(true, SRC_ALPHA, ONE_MINUS_SRC_ALPHA); WriteLog("+++++++++++++++++++++++++++++++++++++++"); WriteLog((const char*)glGetString(GL_VERSION)); WriteLog("+++++++++++++++++++++++++++++++++++++++"); return nullptr; } void* AndroidWindowImpl::destroy(void* handle) { if(uthAndroidEngine.display != EGL_NO_DISPLAY) { eglMakeCurrent(uthAndroidEngine.display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); if(uthAndroidEngine.display != EGL_NO_DISPLAY) { eglDestroyContext(uthAndroidEngine.display, uthAndroidEngine.context); } if (uthAndroidEngine.surface != EGL_NO_SURFACE) { eglDestroySurface(uthAndroidEngine.display, uthAndroidEngine.surface); } eglTerminate(uthAndroidEngine.display); } uthAndroidEngine.display = EGL_NO_DISPLAY; uthAndroidEngine.context = EGL_NO_CONTEXT; uthAndroidEngine.surface = EGL_NO_SURFACE; uthAndroidEngine.initialized = false; WriteLog("Window Destroyed"); return nullptr; } void AndroidWindowImpl::clear( const float r, const float g, const float b, const float a, const bool clearDepth, const bool clearStencil) { oglCheck(glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | <API key> )); oglCheck(glClearColor(r, g, b, a)); if (!clearDepth) return; oglCheck(glClearDepthf(1.0f)); } void AndroidWindowImpl::swapBuffers(void* handle) { //glxSwapBuffers(); eglSwapBuffers(uth::AndroidEngine::getInstance().display, uth::AndroidEngine::getInstance().surface); } bool AndroidWindowImpl::processMessages(void* handle) { android_app* app = uthAndroidEngine.app; uth::Window* window = ((uth::Window*)app->userData); switch (uthAndroidEngine.message) { case APP_CMD_SAVE_STATE: WriteLog("APP_CMD_SAVE_STATE"); break; case APP_CMD_INIT_WINDOW: WriteLog("APP_CMD_INIT_WINDOW"); uthAndroidEngine.initialized = true; uthAndroidEngine.winEveHand(window); uthEngine.Init(uthAndroidEngine.settings); uthRS.<API key>(); focused = true; break; case APP_CMD_TERM_WINDOW: WriteLog("APP_CMD_TERM_WINDOW"); uthAndroidEngine.initialized = false; uthRS.ClearOpenGLContext(); window->destroy(); return true; break; case <API key>: WriteLog("<API key>"); uthAndroidEngine.initialized = true; uthRS.PauseSounds(false); focused = true; uth::SensorInput::GainFocus(); break; case APP_CMD_LOST_FOCUS: WriteLog("APP_CMD_LOST_FOCUS"); uthAndroidEngine.initialized = false; uthRS.PauseSounds(true); focused = false; uth::SensorInput::LostFocus(); break; } return false; } void AndroidWindowImpl::setResizeCallback(ResizeFunc) { } bool AndroidWindowImpl::Focused() { return focused; } }
<TS language="ar" version="2.1"> <context> <name>AddressBookPage</name> <message> <source>Right-click to edit address or label</source> <translation>انقر بالزر الايمن لتعديل العنوان</translation> </message> <message> <source>Create a new address</source> <translation>انشأ عنوان جديد</translation> </message> <message> <source>&amp;New</source> <translation>&amp;جديد</translation> </message> <message> <source>Copy the currently selected address to the system clipboard</source> <translation>قم بنسخ القوانين المختارة لحافظة النظام</translation> </message> <message> <source>&amp;Copy</source> <translation>&amp;نسخ</translation> </message> <message> <source>C&amp;lose</source> <translation>ا&amp;غلاق</translation> </message> <message> <source>Delete the currently selected address from the list</source> <translation>حذف العنوان المحدد من القائمة</translation> </message> <message> <source>Export the data in the current tab to a file</source> <translation>تحميل البيانات في علامة التبويب الحالية إلى ملف.</translation> </message> <message> <source>&amp;Export</source> <translation>&amp;تصدير</translation> </message> <message> <source>&amp;Delete</source> <translation>&amp;أمسح</translation> </message> <message> <source>Choose the address to send coins to</source> <translation>اختر العنوان الذي سترسل له العملات</translation> </message> <message> <source>Choose the address to receive coins with</source> <translation>اختر العنوان الذي تستقبل عليه العملات</translation> </message> <message> <source>C&amp;hoose</source> <translation>&amp;اختر</translation> </message> <message> <source>Sending addresses</source> <translation>ارسال العناوين</translation> </message> <message> <source>Receiving addresses</source> <translation>استقبال العناوين</translation> </message> <message> <source>These are your Creativecoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source> <translation>هذه هي عناوين Litecion التابعة لك من أجل إرسال الدفعات. تحقق دائما من المبلغ و عنوان المرسل المستقبل قبل إرسال العملات</translation> </message> <message> <source>These are your Creativecoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source> <translation>هذه هي عناوين Litecion التابعة لك من أجل إستقبال الدفعات. ينصح استخدام عنوان جديد من أجل كل صفقة</translation> </message> <message> <source>&amp;Copy Address</source> <translation>انسخ العنوان</translation> </message> <message> <source>Copy &amp;Label</source> <translation>نسخ &amp;الوصف</translation> </message> <message> <source>&amp;Edit</source> <translation>تعديل</translation> </message> <message> <source>Export Address List</source> <translation>تصدير قائمة العناوين</translation> </message> <message> <source>Comma separated file (*.csv)</source> <translation>ملف مفصول بفواصل (*.csv)</translation> </message> <message> <source>Exporting Failed</source> <translation>فشل التصدير</translation> </message> <message> <source>There was an error trying to save the address list to %1. Please try again.</source> <translation>لقد حدث خطأ أثناء حفظ قائمة العناوين إلى %1. يرجى المحاولة مرة أخرى.</translation> </message> </context> <context> <name>AddressTableModel</name> <message> <source>Label</source> <translation>وصف</translation> </message> <message> <source>Address</source> <translation>عنوان</translation> </message> <message> <source>(no label)</source> <translation>(لا وصف)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <source>Passphrase Dialog</source> <translation>حوار جملة السر</translation> </message> <message> <source>Enter passphrase</source> <translation>ادخل كلمة المرور</translation> </message> <message> <source>New passphrase</source> <translation>كلمة مرور جديدة</translation> </message> <message> <source>Repeat new passphrase</source> <translation>ادخل كلمة المرور الجديدة مرة أخرى</translation> </message> <message> <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source> <translation>أدخل عبارة مرور جديدة إلى المحفظة. الرجاء استخدام عبارة مرور تتكون من10 حروف عشوائية على الاقل, أو أكثر من 7 كلمات</translation> </message> <message> <source>Encrypt wallet</source> <translation>تشفير المحفظة</translation> </message> <message> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>هذه العملية تحتاج كلمة مرور محفظتك لفتحها</translation> </message> <message> <source>Unlock wallet</source> <translation>إفتح المحفظة</translation> </message> <message> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>هذه العملية تحتاج كلمة مرور محفظتك لفك تشفيرها </translation> </message> <message> <source>Decrypt wallet</source> <translation>فك تشفير المحفظة</translation> </message> <message> <source>Change passphrase</source> <translation>تغيير كلمة المرور</translation> </message> <message> <source>Enter the old passphrase and new passphrase to the wallet.</source> <translation>أدخل كلمة المرور القديمة والجديدة للمحفظة.</translation> </message> <message> <source>Confirm wallet encryption</source> <translation>تأكيد تشفير المحفظة</translation> </message> <message> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR LITECOINS&lt;/b&gt;!</source> <translation>تحذير: إذا قمت بتشفير محفظتك وفقدت كلمة المرور الخاص بك, ستفقد كل عملات LITECOINS الخاصة بك.</translation> </message> <message> <source>Are you sure you wish to encrypt your wallet?</source> <translation>هل أنت متأكد من رغبتك في تشفير محفظتك ؟</translation> </message> <message> <source>Wallet encrypted</source> <translation>محفظة مشفرة</translation> </message> <message> <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source> <translation>هام: أي نسخة إحتياطية سابقة قمت بها لمحفظتك يجب استبدالها بأخرى حديثة، مشفرة. لأسباب أمنية، النسخ الاحتياطية السابقة لملفات المحفظة الغير مشفرة تصبح عديمة الفائدة مع بداية استخدام المحفظة المشفرة الجديدة.</translation> </message> <message> <source>Wallet encryption failed</source> <translation>فشل تشفير المحفظة</translation> </message> <message> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>فشل تشفير المحفظة بسبب خطأ داخلي. لم يتم تشفير محفظتك.</translation> </message> <message> <source>The supplied passphrases do not match.</source> <translation>كلمتي المرور ليستا متطابقتان</translation> </message> <message> <source>Wallet unlock failed</source> <translation>فشل فتح المحفظة</translation> </message> <message> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>كلمة المرور التي تم إدخالها لفك تشفير المحفظة غير صحيحة.</translation> </message> <message> <source>Wallet decryption failed</source> <translation>فشل فك التشفير المحفظة</translation> </message> <message> <source>Wallet passphrase was successfully changed.</source> <translation>لقد تم تغير عبارة مرور المحفظة بنجاح</translation> </message> <message> <source>Warning: The Caps Lock key is on!</source> <translation>تحذير: مفتاح الحروف الكبيرة مفعل</translation> </message> </context> <context> <name>BanTableModel</name> <message> <source>IP/Netmask</source> <translation>عنوان البروتوكول/قناع</translation> </message> <message> <source>Banned Until</source> <translation>محظور حتى</translation> </message> </context> <context> <name>BitcoinGUI</name> <message> <source>Sign &amp;message...</source> <translation>التوقيع و الرسائل</translation> </message> <message> <source>Synchronizing with network...</source> <translation>مزامنة مع الشبكة ...</translation> </message> <message> <source>&amp;Overview</source> <translation>&amp;نظرة عامة</translation> </message> <message> <source>Node</source> <translation>جهاز</translation> </message> <message> <source>Show general overview of wallet</source> <translation>إظهار نظرة عامة على المحفظة</translation> </message> <message> <source>&amp;Transactions</source> <translation>&amp;المعاملات</translation> </message> <message> <source>Browse transaction history</source> <translation>تصفح سجل المعاملات</translation> </message> <message> <source>E&amp;xit</source> <translation>خروج</translation> </message> <message> <source>Quit application</source> <translation>الخروج من التطبيق</translation> </message> <message> <source>&amp;About %1</source> <translation>حوالي %1</translation> </message> <message> <source>Show information about %1</source> <translation>أظهر المعلومات حولة %1</translation> </message> <message> <source>About &amp;Qt</source> <translation>عن &amp;Qt</translation> </message> <message> <source>Show information about Qt</source> <translation>اظهر المعلومات</translation> </message> <message> <source>&amp;Options...</source> <translation>&amp;خيارات ...</translation> </message> <message> <source>Modify configuration options for %1</source> <translation>تغيير خيارات الإعداد لأساس ل%1</translation> </message> <message> <source>&amp;Encrypt Wallet...</source> <translation>&amp;تشفير المحفظة</translation> </message> <message> <source>&amp;Backup Wallet...</source> <translation>&amp;نسخ احتياط للمحفظة</translation> </message> <message> <source>&amp;Change Passphrase...</source> <translation>&amp;تغيير كلمة المرور</translation> </message> <message> <source>&amp;Sending addresses...</source> <translation>ارسال العناوين.</translation> </message> <message> <source>&amp;Receiving addresses...</source> <translation>استقبال العناوين</translation> </message> <message> <source>Open &amp;URI...</source> <translation>افتح &amp;URI...</translation> </message> <message> <source>Reindexing blocks on disk...</source> <translation>إعادة الفهرسة الكتل على القرص ...</translation> </message> <message> <source>Send coins to a Creativecoin address</source> <translation>ارسل عملات الى عنوان Creativecoin</translation> </message> <message> <source>Backup wallet to another location</source> <translation>احفظ نسخة احتياطية للمحفظة في مكان آخر</translation> </message> <message> <source>Change the passphrase used for wallet encryption</source> <translation>تغيير كلمة المرور المستخدمة لتشفير المحفظة</translation> </message> <message> <source>&amp;Debug window</source> <translation>&amp;نافذة المعالجة</translation> </message> <message> <source>Open debugging and diagnostic console</source> <translation>إفتح وحدة التصحيح و التشخيص</translation> </message> <message> <source>&amp;Verify message...</source> <translation>&amp;التحقق من الرسالة...</translation> </message> <message> <source>Creativecoin</source> <translation>بت كوين</translation> </message> <message> <source>Wallet</source> <translation>محفظة</translation> </message> <message> <source>&amp;Send</source> <translation>&amp;ارسل</translation> </message> <message> <source>&amp;Receive</source> <translation>&amp;استقبل</translation> </message> <message> <source>&amp;Show / Hide</source> <translation>&amp;عرض / اخفاء</translation> </message> <message> <source>Show or hide the main Window</source> <translation>عرض او اخفاء النافذة الرئيسية</translation> </message> <message> <source>Encrypt the private keys that belong to your wallet</source> <translation>تشفير المفتاح الخاص بمحفظتك</translation> </message> <message> <source>Sign messages with your Creativecoin addresses to prove you own them</source> <translation>وقَع الرسائل بواسطة ال: Creativecoin الخاص بك لإثبات امتلاكك لهم</translation> </message> <message> <source>Verify messages to ensure they were signed with specified Creativecoin addresses</source> <translation>تحقق من الرسائل للتأكد من أنَها وُقعت برسائل Creativecoin محدَدة</translation> </message> <message> <source>&amp;File</source> <translation>&amp;ملف</translation> </message> <message> <source>&amp;Settings</source> <translation>&amp;الاعدادات</translation> </message> <message> <source>&amp;Help</source> <translation>&amp;مساعدة</translation> </message> <message> <source>Tabs toolbar</source> <translation>شريط أدوات علامات التبويب</translation> </message> <message> <source>Request payments (generates QR codes and creativecoin: URIs)</source> <translation>أطلب دفعات (يولد كودات الرمز المربع وبيت كوين: العناوين المعطاة)</translation> </message> <message> <source>Show the list of used sending addresses and labels</source> <translation>عرض قائمة عناوين الإرسال المستخدمة والملصقات</translation> </message> <message> <source>Show the list of used receiving addresses and labels</source> <translation>عرض قائمة عناوين الإستقبال المستخدمة والملصقات</translation> </message> <message> <source>Open a creativecoin: URI or payment request</source> <translation>فتح URI : Creativecoin أو طلب دفع</translation> </message> <message> <source>&amp;Command-line options</source> <translation>&amp;خيارات سطر الأوامر</translation> </message> <message> <source>Indexing blocks on disk...</source> <translation>ترتيب الفهرسة الكتل على القرص...</translation> </message> <message> <source>Processing blocks on disk...</source> <translation>معالجة الكتل على القرص...</translation> </message> <message> <source>%1 behind</source> <translation>خلف %1</translation> </message> <message> <source>Last received block was generated %1 ago.</source> <translation>تم توليد الكتلة المستقبلة الأخيرة منذ %1.</translation> </message> <message> <source>Transactions after this will not yet be visible.</source> <translation>المعاملات بعد ذلك لن تكون مريئة بعد.</translation> </message> <message> <source>Error</source> <translation>خطأ</translation> </message> <message> <source>Warning</source> <translation>تحذير</translation> </message> <message> <source>Information</source> <translation>معلومات</translation> </message> <message> <source>Up to date</source> <translation>محدث</translation> </message> <message> <source>Show the %1 help message to get a list with possible Creativecoin command-line options</source> <translation>بين اشارة المساعدة %1 للحصول على قائمة من خيارات اوامر البت كوين المحتملة </translation> </message> <message> <source>%1 client</source> <translation>الزبون %1</translation> </message> <message> <source>Catching up...</source> <translation>اللحاق بالركب ...</translation> </message> <message> <source>Date: %1 </source> <translation>التاريخ %1 </translation> </message> <message> <source>Amount: %1 </source> <translation>الكمية %1 </translation> </message> <message> <source>Type: %1 </source> <translation>نوع %1 </translation> </message> <message> <source>Label: %1 </source> <translation>علامه: %1 </translation> </message> <message> <source>Address: %1 </source> <translation>عنوان %1 </translation> </message> <message> <source>Sent transaction</source> <translation>المعاملات المرسلة</translation> </message> <message> <source>Incoming transaction</source> <translation>المعاملات الواردة</translation> </message> <message> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation>المحفظة &lt;b&gt;مشفرة&lt;/b&gt; و &lt;b&gt;مفتوحة&lt;/b&gt; حاليا</translation> </message> <message> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation>المحفظة &lt;b&gt;مشفرة&lt;/b&gt; و &lt;b&gt;مقفلة&lt;/b&gt; حاليا</translation> </message> </context> <context> <name>CoinControlDialog</name> <message> <source>Coin Selection</source> <translation>اختيار العمله</translation> </message> <message> <source>Quantity:</source> <translation>الكمية :</translation> </message> <message> <source>Bytes:</source> <translation>بايت</translation> </message> <message> <source>Amount:</source> <translation>القيمة :</translation> </message> <message> <source>Fee:</source> <translation>رسوم :</translation> </message> <message> <source>Dust:</source> <translation>غبار:</translation> </message> <message> <source>After Fee:</source> <translation>بعد الرسوم :</translation> </message> <message> <source>Change:</source> <translation>تعديل :</translation> </message> <message> <source>(un)select all</source> <translation>عدم اختيار الجميع</translation> </message> <message> <source>Tree mode</source> <translation>صيغة الشجرة</translation> </message> <message> <source>List mode</source> <translation>صيغة القائمة</translation> </message> <message> <source>Amount</source> <translation>مبلغ</translation> </message> <message> <source>Received with label</source> <translation>مستقبل مع ملصق</translation> </message> <message> <source>Received with address</source> <translation>مستقبل مع عنوان</translation> </message> <message> <source>Date</source> <translation>تاريخ</translation> </message> <message> <source>Confirmations</source> <translation>تأكيدات</translation> </message> <message> <source>Confirmed</source> <translation>تأكيد</translation> </message> <message> <source>Copy address</source> <translation> انسخ عنوان</translation> </message> <message> <source>Copy label</source> <translation> انسخ التسمية</translation> </message> <message> <source>Copy amount</source> <translation>نسخ الكمية</translation> </message> <message> <source>Copy transaction ID</source> <translation>نسخ رقم العملية</translation> </message> <message> <source>Copy quantity</source> <translation>نسخ الكمية </translation> </message> <message> <source>Copy fee</source> <translation>نسخ الرسوم</translation> </message> <message> <source>Copy after fee</source> <translation>نسخ بعد الرسوم</translation> </message> <message> <source>Copy change</source> <translation>نسخ التعديل</translation> </message> <message> <source>yes</source> <translation>نعم</translation> </message> <message> <source>no</source> <translation>لا</translation> </message> <message> <source>(no label)</source> <translation>(لا وصف)</translation> </message> <message> <source>(change)</source> <translation>(تغير)</translation> </message> </context> <context> <name>EditAddressDialog</name> <message> <source>Edit Address</source> <translation>عدل العنوان</translation> </message> <message> <source>&amp;Label</source> <translation>&amp;وصف</translation> </message> <message> <source>The label associated with this address list entry</source> <translation>الملصق المرتبط بقائمة العناوين المدخلة</translation> </message> <message> <source>The address associated with this address list entry. This can only be modified for sending addresses.</source> <translation>العنوان المرتبط بقائمة العناوين المدخلة. و التي يمكن تعديلها فقط بواسطة ارسال العناوين</translation> </message> <message> <source>&amp;Address</source> <translation>&amp;العنوان</translation> </message> <message> <source>New receiving address</source> <translation>عنوان أستلام جديد</translation> </message> <message> <source>New sending address</source> <translation>عنوان إرسال جديد</translation> </message> <message> <source>Edit receiving address</source> <translation>تعديل عنوان الأستلام</translation> </message> <message> <source>Edit sending address</source> <translation>تعديل عنوان الارسال</translation> </message> <message> <source>The entered address "%1" is not a valid Creativecoin address.</source> <translation>العنوان المدخل "%1" ليس عنوان بيت كوين صحيح.</translation> </message> <message> <source>The entered address "%1" is already in the address book.</source> <translation>هدا العنوان "%1" موجود مسبقا في دفتر العناوين</translation> </message> <message> <source>Could not unlock wallet.</source> <translation> يمكن فتح المحفظة.</translation> </message> <message> <source>New key generation failed.</source> <translation>فشل توليد مفتاح جديد.</translation> </message> </context> <context> <name>FreespaceChecker</name> <message> <source>A new data directory will be created.</source> <translation>سيتم انشاء دليل بيانات جديد</translation> </message> <message> <source>name</source> <translation>الاسم</translation> </message> <message> <source>Directory already exists. Add %1 if you intend to create a new directory here.</source> <translation>الدليل موجوج بالفعل. أضف %1 لو نويت إنشاء دليل جديد هنا.</translation> </message> <message> <source>Path already exists, and is not a directory.</source> <translation>المسار موجود بالفعل، وهو ليس دليلاً.</translation> </message> <message> <source>Cannot create data directory here.</source> <translation>لا يمكن انشاء دليل بيانات هنا .</translation> </message> </context> <context> <name>HelpMessageDialog</name> <message> <source>version</source> <translation>النسخة</translation> </message> <message> <source>About %1</source> <translation>حوالي %1</translation> </message> <message> <source>Command-line options</source> <translation>خيارات سطر الأوامر</translation> </message> <message> <source>Usage:</source> <translation>المستخدم</translation> </message> <message> <source>command-line options</source> <translation>خيارات سطر الأوامر</translation> </message> <message> <source>UI Options:</source> <translation>خيارات واجهة المستخدم</translation> </message> <message> <source>Choose data directory on startup (default: %u)</source> <translation>اختر دليل البيانات عند بدء التشغير (افتراضي: %u)</translation> </message> <message> <source>Set language, for example "de_DE" (default: system locale)</source> <translation>أضع لغة, على سبيل المثال " de_DE " (افتراضي:- مكان النظام)</translation> </message> <message> <source>Start minimized</source> <translation>الدخول مصغر</translation> </message> <message> <source>Set SSL root certificates for payment request (default: -system-)</source> <translation>أضع شهادة بروتوكول الشبقة الأمنية لطلب المدفوع (افتراضي: -نظام-)</translation> </message> <message> <source>Show splash screen on startup (default: %u)</source> <translation>أظهر شاشة البداية عند بدء التشغيل (افتراضي: %u)</translation> </message> <message> <source>Reset all settings changed in the GUI</source> <translation>اعد تعديل جميع النظم المتغيرة في GUI</translation> </message> </context> <context> <name>Intro</name> <message> <source>Welcome</source> <translation>أهلا</translation> </message> <message> <source>Welcome to %1.</source> <translation> اهلا بكم في %1</translation> </message> <message> <source>As this is the first time the program is launched, you can choose where %1 will store its data.</source> <translation>بما انه هذه اول مرة لانطلاق هذا البرنامج, فيمكنك ان تختار اين سيخزن %1 بياناته</translation> </message> <message> <source>Use the default data directory</source> <translation>استخدام دليل البانات الافتراضي</translation> </message> <message> <source>Use a custom data directory:</source> <translation>استخدام دليل بيانات مخصص:</translation> </message> <message> <source>Error: Specified data directory "%1" cannot be created.</source> <translation>خطأ: لا يمكن تكوين دليل بيانات مخصص ل %1</translation> </message> <message> <source>Error</source> <translation>خطأ</translation> </message> </context> <context> <name>ModalOverlay</name> <message> <source>Form</source> <translation>نمودج</translation> </message> <message> <source>Hide</source> <translation>إخفاء</translation> </message> </context> <context> <name>OpenURIDialog</name> <message> <source>Open URI</source> <translation>افتح URL</translation> </message> <message> <source>Open payment request from URI or file</source> <translation>حدد طلب الدفع من ملف او URI</translation> </message> <message> <source>Select payment request file</source> <translation>حدد ملف طلب الدفع</translation> </message> <message> <source>Select payment request file to open</source> <translation>حدد ملف طلب الدفع لفتحه</translation> </message> </context> <context> <name>OptionsDialog</name> <message> <source>Options</source> <translation>خيارات ...</translation> </message> <message> <source>&amp;Main</source> <translation>&amp;الرئيسي</translation> </message> <message> <source>MB</source> <translation>م ب</translation> </message> <message> <source>Accept connections from outside</source> <translation>إقبل التواصل من الخارج</translation> </message> <message> <source>Third party transaction URLs</source> <translation>عنوان النطاق للطرف الثالث</translation> </message> <message> <source>&amp;Reset Options</source> <translation>&amp;استعادة الخيارات</translation> </message> <message> <source>&amp;Network</source> <translation>&amp;الشبكة</translation> </message> <message> <source>W&amp;allet</source> <translation>&amp;محفظة</translation> </message> <message> <source>Expert</source> <translation>تصدير</translation> </message> <message> <source>Proxy &amp;IP:</source> <translation>بروكسي &amp;اي بي:</translation> </message> <message> <source>&amp;Port:</source> <translation>&amp;المنفذ:</translation> </message> <message> <source>Port of the proxy (e.g. 9050)</source> <translation>منفذ البروكسي (مثلا 9050)</translation> </message> <message> <source>Used for reaching peers via:</source> <translation>مستخدم للاتصال بالاصدقاء من خلال:</translation> </message> <message> <source>&amp;Window</source> <translation>نافذه</translation> </message> <message> <source>Hide tray icon</source> <translation>اخفاء لوحة الايقون</translation> </message> <message> <source>&amp;Display</source> <translation>&amp;عرض</translation> </message> <message> <source>User Interface &amp;language:</source> <translation>واجهة المستخدم &amp;اللغة:</translation> </message> <message> <source>&amp;OK</source> <translation>تم</translation> </message> <message> <source>&amp;Cancel</source> <translation>الغاء</translation> </message> <message> <source>default</source> <translation>الافتراضي</translation> </message> <message> <source>none</source> <translation>لا شيء</translation> </message> <message> <source>Confirm options reset</source> <translation>تأكيد استعادة الخيارات</translation> </message> <message> <source>The supplied proxy address is invalid.</source> <translation>عنوان الوكيل توفيره غير صالح.</translation> </message> </context> <context> <name>OverviewPage</name> <message> <source>Form</source> <translation>نمودج</translation> </message> <message> <source>Available:</source> <translation>متوفر</translation> </message> <message> <source>Pending:</source> <translation>معلق:</translation> </message> <message> <source>Immature:</source> <translation>غير ناضجة</translation> </message> <message> <source>Total:</source> <translation>المجموع:</translation> </message> <message> <source>Your current total balance</source> <translation>رصيدك الكلي الحالي</translation> </message> </context> <context> <name>PaymentServer</name> <message> <source>Bad response from server %1</source> <translation>استجابة سيئة من الملقم %1</translation> </message> </context> <context> <name>PeerTableModel</name> </context> <context> <name>QObject</name> <message> <source>Amount</source> <translation>مبلغ</translation> </message> <message> <source>%1 h</source> <translation>%1 ساعة</translation> </message> <message> <source>%1 m</source> <translation>%1 دقيقة</translation> </message> <message> <source>N/A</source> <translation>غير معروف</translation> </message> <message> <source>%1 and %2</source> <translation>%1 و %2</translation> </message> </context> <context> <name>QObject::QObject</name> </context> <context> <name>QRImageWidget</name> <message> <source>&amp;Save Image...</source> <translation>&amp;حفظ الصورة</translation> </message> <message> <source>&amp;Copy Image</source> <translation>&amp;نسخ الصورة</translation> </message> <message> <source>Save QR Code</source> <translation>حفظ رمز الاستجابة السريعة QR</translation> </message> <message> <source>PNG Image (*.png)</source> <translation>صورة PNG (*.png)</translation> </message> </context> <context> <name>RPCConsole</name> <message> <source>N/A</source> <translation>غير معروف</translation> </message> <message> <source>Client version</source> <translation>نسخه العميل</translation> </message> <message> <source>&amp;Information</source> <translation>المعلومات</translation> </message> <message> <source>Debug window</source> <translation>نافذة المعالجة</translation> </message> <message> <source>General</source> <translation>عام</translation> </message> <message> <source>Startup time</source> <translation>وقت البدء</translation> </message> <message> <source>Network</source> <translation>الشبكه</translation> </message> <message> <source>Name</source> <translation>الاسم</translation> </message> <message> <source>Number of connections</source> <translation>عدد الاتصالات</translation> </message> <message> <source>Received</source> <translation>إستقبل</translation> </message> <message> <source>Sent</source> <translation>تم الإرسال</translation> </message> <message> <source>&amp;Peers</source> <translation>&amp;اصدقاء</translation> </message> <message> <source>Direction</source> <translation>جهة</translation> </message> <message> <source>Services</source> <translation>خدمات</translation> </message> <message> <source>Last Send</source> <translation>آخر استقبال</translation> </message> <message> <source>Last Receive</source> <translation>آخر إرسال</translation> </message> <message> <source>&amp;Open</source> <translation>الفتح</translation> </message> <message> <source>&amp;Network Traffic</source> <translation>&amp;حركة مرور الشبكة</translation> </message> <message> <source>&amp;Clear</source> <translation>&amp;مسح</translation> </message> <message> <source>Totals</source> <translation>المجاميع</translation> </message> <message> <source>In:</source> <translation>داخل:</translation> </message> <message> <source>Out:</source> <translation>خارج:</translation> </message> <message> <source>1 &amp;hour</source> <translation>1 &amp;ساعة</translation> </message> <message> <source>1 &amp;day</source> <translation>1 &amp; يوم</translation> </message> <message> <source>1 &amp;week</source> <translation>1 &amp; اسبوع</translation> </message> <message> <source>1 &amp;year</source> <translation>1 &amp; سنة</translation> </message> <message> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation>استخدم اسهم الاعلى و الاسفل للتنقل بين السجلات و &lt;b&gt;Ctrl-L&lt;/b&gt; لمسح الشاشة</translation> </message> <message> <source>%1 B</source> <translation>%1 بايت</translation> </message> <message> <source>%1 KB</source> <translation>%1 كيلو بايت</translation> </message> <message> <source>%1 MB</source> <translation>%1 ميقا بايت</translation> </message> <message> <source>%1 GB</source> <translation>%1 قيقا بايت</translation> </message> <message> <source>never</source> <translation>ابدا</translation> </message> <message> <source>Inbound</source> <translation>داخل</translation> </message> <message> <source>Outbound</source> <translation>خارجي</translation> </message> <message> <source>Yes</source> <translation>نعم</translation> </message> <message> <source>No</source> <translation>لا</translation> </message> <message> <source>Unknown</source> <translation>غير معرف</translation> </message> </context> <context> <name>ReceiveCoinsDialog</name> <message> <source>&amp;Amount:</source> <translation>&amp;القيمة</translation> </message> <message> <source>&amp;Label:</source> <translation>&amp;وصف :</translation> </message> <message> <source>&amp;Message:</source> <translation>&amp;رسالة:</translation> </message> <message> <source>Clear all fields of the form.</source> <translation>مسح كل حقول النموذج المطلوبة</translation> </message> <message> <source>Clear</source> <translation>مسح</translation> </message> <message> <source>Requested payments history</source> <translation>سجل طلبات الدفع</translation> </message> <message> <source>Show</source> <translation>عرض</translation> </message> <message> <source>Remove</source> <translation>ازل</translation> </message> <message> <source>Copy label</source> <translation> انسخ التسمية</translation> </message> <message> <source>Copy message</source> <translation>انسخ الرسالة</translation> </message> <message> <source>Copy amount</source> <translation>نسخ الكمية</translation> </message> </context> <context> <name><API key></name> <message> <source>QR Code</source> <translation>رمز كيو ار</translation> </message> <message> <source>Copy &amp;URI</source> <translation>نسخ &amp;URI</translation> </message> <message> <source>Copy &amp;Address</source> <translation>نسخ &amp;العنوان</translation> </message> <message> <source>&amp;Save Image...</source> <translation>&amp;حفظ الصورة</translation> </message> <message> <source>Payment information</source> <translation>معلومات الدفع</translation> </message> <message> <source>URI</source> <translation> URI</translation> </message> <message> <source>Address</source> <translation>عنوان</translation> </message> <message> <source>Amount</source> <translation>مبلغ</translation> </message> <message> <source>Label</source> <translation>وصف</translation> </message> <message> <source>Message</source> <translation>رسالة </translation> </message> </context> <context> <name><API key></name> <message> <source>Date</source> <translation>تاريخ</translation> </message> <message> <source>Label</source> <translation>وصف</translation> </message> <message> <source>Message</source> <translation>رسالة </translation> </message> <message> <source>(no label)</source> <translation>(لا وصف)</translation> </message> <message> <source>(no message)</source> <translation>( لا رسائل )</translation> </message> </context> <context> <name>SendCoinsDialog</name> <message> <source>Send Coins</source> <translation>إرسال Coins</translation> </message> <message> <source>automatically selected</source> <translation>اختيار تلقائيا</translation> </message> <message> <source>Insufficient funds!</source> <translation>الرصيد غير كافي!</translation> </message> <message> <source>Quantity:</source> <translation>الكمية :</translation> </message> <message> <source>Bytes:</source> <translation>بايت</translation> </message> <message> <source>Amount:</source> <translation>القيمة :</translation> </message> <message> <source>Fee:</source> <translation>رسوم :</translation> </message> <message> <source>After Fee:</source> <translation>بعد الرسوم :</translation> </message> <message> <source>Change:</source> <translation>تعديل :</translation> </message> <message> <source>Transaction Fee:</source> <translation>رسوم المعاملة:</translation> </message> <message> <source>Hide</source> <translation>إخفاء</translation> </message> <message> <source>normal</source> <translation>طبيعي</translation> </message> <message> <source>fast</source> <translation>سريع</translation> </message> <message> <source>Send to multiple recipients at once</source> <translation>إرسال إلى عدة مستلمين في وقت واحد</translation> </message> <message> <source>Add &amp;Recipient</source> <translation>أضافة &amp;مستلم</translation> </message> <message> <source>Clear all fields of the form.</source> <translation>مسح كل حقول النموذج المطلوبة</translation> </message> <message> <source>Dust:</source> <translation>غبار:</translation> </message> <message> <source>Clear &amp;All</source> <translation>مسح الكل</translation> </message> <message> <source>Balance:</source> <translation>الرصيد:</translation> </message> <message> <source>Confirm the send action</source> <translation>تأكيد الإرسال</translation> </message> <message> <source>S&amp;end</source> <translation>&amp;ارسال</translation> </message> <message> <source>Copy quantity</source> <translation>نسخ الكمية </translation> </message> <message> <source>Copy amount</source> <translation>نسخ الكمية</translation> </message> <message> <source>Copy fee</source> <translation>نسخ الرسوم</translation> </message> <message> <source>Copy after fee</source> <translation>نسخ بعد الرسوم</translation> </message> <message> <source>Copy change</source> <translation>نسخ التعديل</translation> </message> <message> <source>%1 to %2</source> <translation>%1 الى %2</translation> </message> <message> <source>or</source> <translation>أو</translation> </message> <message> <source>Confirm send coins</source> <translation>تأكيد الإرسال Coins</translation> </message> <message> <source>The amount to pay must be larger than 0.</source> <translation>المبلغ المدفوع يجب ان يكون اكبر من 0</translation> </message> <message> <source>The amount exceeds your balance.</source> <translation>القيمة تتجاوز رصيدك</translation> </message> <message> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation>المجموع يتجاوز رصيدك عندما يتم اضافة %1 رسوم العملية</translation> </message> <message> <source>(no label)</source> <translation>(لا وصف)</translation> </message> </context> <context> <name>SendCoinsEntry</name> <message> <source>A&amp;mount:</source> <translation>&amp;القيمة</translation> </message> <message> <source>Pay &amp;To:</source> <translation>ادفع &amp;الى :</translation> </message> <message> <source>&amp;Label:</source> <translation>&amp;وصف :</translation> </message> <message> <source>Choose previously used address</source> <translation>اختر عنوانا مستخدم سابقا</translation> </message> <message> <source>This is a normal payment.</source> <translation>هذا دفع اعتيادي</translation> </message> <message> <source>The Creativecoin address to send the payment to</source> <translation>عنوان البت كوين المرسل اليه الدفع</translation> </message> <message> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <source>Paste address from clipboard</source> <translation>انسخ العنوان من لوحة المفاتيح</translation> </message> <message> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <source>Remove this entry</source> <translation>ازل هذه المداخله</translation> </message> <message> <source>Message:</source> <translation>الرسائل</translation> </message> <message> <source>Pay To:</source> <translation>ادفع &amp;الى :</translation> </message> <message> <source>Enter a label for this address to add it to your address book</source> <translation>إدخال تسمية لهذا العنوان لإضافته إلى دفتر العناوين الخاص بك</translation> </message> </context> <context> <name><API key></name> <message> <source>Yes</source> <translation>نعم</translation> </message> </context> <context> <name><API key></name> </context> <context> <name>ShutdownWindow</name> <message> <source>Do not shut down the computer until this window disappears.</source> <translation>لا توقف عمل الكمبيوتر حتى تختفي هذه النافذة</translation> </message> </context> <context> <name><API key></name> <message> <source>&amp;Sign Message</source> <translation>&amp;توقيع الرسالة</translation> </message> <message> <source>Choose previously used address</source> <translation>اختر عنوانا مستخدم سابقا</translation> </message> <message> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <source>Paste address from clipboard</source> <translation>انسخ العنوان من لوحة المفاتيح</translation> </message> <message> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <source>Enter the message you want to sign here</source> <translation>ادخل الرسالة التي تريد توقيعها هنا</translation> </message> <message> <source>Signature</source> <translation>التوقيع</translation> </message> <message> <source>Sign the message to prove you own this Creativecoin address</source> <translation>وقع الرسالة لتثبت انك تمتلك عنوان البت كوين هذا</translation> </message> <message> <source>Sign &amp;Message</source> <translation>توقيع $الرسالة</translation> </message> <message> <source>Clear &amp;All</source> <translation>مسح الكل</translation> </message> <message> <source>&amp;Verify Message</source> <translation>&amp;تحقق رسالة</translation> </message> <message> <source>Verify &amp;Message</source> <translation>تحقق &amp;الرسالة</translation> </message> <message> <source>Click "Sign Message" to generate signature</source> <translation>اضغط "توقيع الرسالة" لتوليد التوقيع</translation> </message> <message> <source>The entered address is invalid.</source> <translation>العنوان المدخل غير صالح</translation> </message> <message> <source>Please check the address and try again.</source> <translation>الرجاء التأكد من العنوان والمحاولة مرة اخرى</translation> </message> <message> <source>The entered address does not refer to a key.</source> <translation>العنوان المدخل لا يشير الى مفتاح</translation> </message> <message> <source>Wallet unlock was cancelled.</source> <translation>تم الغاء عملية فتح المحفظة</translation> </message> <message> <source>Private key for the entered address is not available.</source> <translation>المفتاح الخاص للعنوان المدخل غير موجود.</translation> </message> <message> <source>Message signing failed.</source> <translation>فشل توقيع الرسالة.</translation> </message> <message> <source>Message signed.</source> <translation>الرسالة موقعة.</translation> </message> <message> <source>Please check the signature and try again.</source> <translation>فضلا تاكد من التوقيع وحاول مرة اخرى</translation> </message> <message> <source>Message verification failed.</source> <translation>فشلت عملية التأكد من الرسالة.</translation> </message> <message> <source>Message verified.</source> <translation>تم تأكيد الرسالة.</translation> </message> </context> <context> <name>SplashScreen</name> <message> <source>[testnet]</source> <translation>[testnet]</translation> </message> </context> <context> <name>TrafficGraphWidget</name> </context> <context> <name>TransactionDesc</name> <message> <source>Open until %1</source> <translation>مفتوح حتى %1</translation> </message> <message> <source>%1/offline</source> <translation>%1 غير متواجد</translation> </message> <message> <source>%1/unconfirmed</source> <translation>غير مؤكدة/%1</translation> </message> <message> <source>%1 confirmations</source> <translation>تأكيد %1</translation> </message> <message> <source>Status</source> <translation>الحالة.</translation> </message> <message> <source>, has not been successfully broadcast yet</source> <translation>, لم يتم حتى الآن البث بنجاح</translation> </message> <message> <source>Date</source> <translation>تاريخ</translation> </message> <message> <source>Source</source> <translation>المصدر</translation> </message> <message> <source>Generated</source> <translation>تم اصداره.</translation> </message> <message> <source>From</source> <translation>من</translation> </message> <message> <source>unknown</source> <translation>غير معروف</translation> </message> <message> <source>To</source> <translation>الى</translation> </message> <message> <source>own address</source> <translation>عنوانه</translation> </message> <message> <source>label</source> <translation>علامة</translation> </message> <message> <source>not accepted</source> <translation>غير مقبولة</translation> </message> <message> <source>Debit</source> <translation>دين</translation> </message> <message> <source>Transaction fee</source> <translation>رسوم المعاملة</translation> </message> <message> <source>Message</source> <translation>رسالة </translation> </message> <message> <source>Comment</source> <translation>تعليق</translation> </message> <message> <source>Transaction ID</source> <translation>رقم المعاملة</translation> </message> <message> <source>Merchant</source> <translation>تاجر</translation> </message> <message> <source>Transaction</source> <translation>معاملة</translation> </message> <message> <source>Amount</source> <translation>مبلغ</translation> </message> <message> <source>true</source> <translation>صحيح</translation> </message> <message> <source>false</source> <translation>خاطئ</translation> </message> </context> <context> <name><API key></name> <message> <source>This pane shows a detailed description of the transaction</source> <translation>يبين هذا الجزء وصفا مفصلا لهده المعاملة</translation> </message> </context> <context> <name><API key></name> <message> <source>Date</source> <translation>تاريخ</translation> </message> <message> <source>Type</source> <translation>النوع</translation> </message> <message> <source>Label</source> <translation>وصف</translation> </message> <message> <source>Open until %1</source> <translation>مفتوح حتى %1</translation> </message> <message> <source>Offline</source> <translation>غير متصل</translation> </message> <message> <source>Conflicted</source> <translation>يتعارض</translation> </message> <message> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation>لم يتم تلقى هذه الكتلة (Block) من قبل أي العقد الأخرى وربما لن تكون مقبولة!</translation> </message> <message> <source>Generated but not accepted</source> <translation>ولدت ولكن لم تقبل</translation> </message> <message> <source>Received with</source> <translation>استقبل مع</translation> </message> <message> <source>Received from</source> <translation>استقبل من</translation> </message> <message> <source>Sent to</source> <translation>أرسل إلى</translation> </message> <message> <source>Payment to yourself</source> <translation>دفع لنفسك</translation> </message> <message> <source>Mined</source> <translation>Mined</translation> </message> <message> <source>(n/a)</source> <translation>غير متوفر</translation> </message> <message> <source>(no label)</source> <translation>(لا وصف)</translation> </message> <message> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>حالة المعاملة. تحوم حول هذا الحقل لعرض عدد التأكيدات.</translation> </message> <message> <source>Date and time that the transaction was received.</source> <translation>التاريخ والوقت الذي تم فيه تلقي المعاملة.</translation> </message> <message> <source>Type of transaction.</source> <translation>نوع المعاملات</translation> </message> <message> <source>Amount removed from or added to balance.</source> <translation>المبلغ الذي أزيل أو أضيف الى الرصيد</translation> </message> </context> <context> <name>TransactionView</name> <message> <source>All</source> <translation>الكل</translation> </message> <message> <source>Today</source> <translation>اليوم</translation> </message> <message> <source>This week</source> <translation>هدا الاسبوع</translation> </message> <message> <source>This month</source> <translation>هدا الشهر</translation> </message> <message> <source>Last month</source> <translation>الشهر الماضي</translation> </message> <message> <source>This year</source> <translation>هدا العام</translation> </message> <message> <source>Range...</source> <translation>المدى...</translation> </message> <message> <source>Received with</source> <translation>استقبل مع</translation> </message> <message> <source>Sent to</source> <translation>أرسل إلى</translation> </message> <message> <source>To yourself</source> <translation>إليك</translation> </message> <message> <source>Mined</source> <translation>Mined</translation> </message> <message> <source>Other</source> <translation>اخرى</translation> </message> <message> <source>Enter address or label to search</source> <translation>ادخل عنوان أووصف للبحث</translation> </message> <message> <source>Min amount</source> <translation>الحد الأدنى</translation> </message> <message> <source>Copy address</source> <translation> انسخ عنوان</translation> </message> <message> <source>Copy label</source> <translation> انسخ التسمية</translation> </message> <message> <source>Copy amount</source> <translation>نسخ الكمية</translation> </message> <message> <source>Copy transaction ID</source> <translation>نسخ رقم العملية</translation> </message> <message> <source>Edit label</source> <translation>عدل الوصف</translation> </message> <message> <source>Show transaction details</source> <translation>عرض تفاصيل المعاملة</translation> </message> <message> <source>Comma separated file (*.csv)</source> <translation>ملف مفصول بفواصل (*.csv)</translation> </message> <message> <source>Confirmed</source> <translation>تأكيد</translation> </message> <message> <source>Date</source> <translation>تاريخ</translation> </message> <message> <source>Type</source> <translation>النوع</translation> </message> <message> <source>Label</source> <translation>وصف</translation> </message> <message> <source>Address</source> <translation>عنوان</translation> </message> <message> <source>ID</source> <translation>العنوان</translation> </message> <message> <source>Exporting Failed</source> <translation>فشل التصدير</translation> </message> <message> <source>Exporting Successful</source> <translation>نجح التصدير</translation> </message> <message> <source>Range:</source> <translation>المدى:</translation> </message> <message> <source>to</source> <translation>الى</translation> </message> </context> <context> <name><API key></name> </context> <context> <name>WalletFrame</name> </context> <context> <name>WalletModel</name> <message> <source>Send Coins</source> <translation>إرسال Coins</translation> </message> </context> <context> <name>WalletView</name> <message> <source>&amp;Export</source> <translation>&amp;تصدير</translation> </message> <message> <source>Export the data in the current tab to a file</source> <translation>تحميل البيانات في علامة التبويب الحالية إلى ملف.</translation> </message> <message> <source>Backup Wallet</source> <translation>نسخ احتياط للمحفظة</translation> </message> <message> <source>Backup Failed</source> <translation>فشل النسخ الاحتياطي</translation> </message> <message> <source>Backup Successful</source> <translation>نجاح النسخ الاحتياطي</translation> </message> </context> <context> <name>bitcoin-core</name> <message> <source>Options:</source> <translation>خيارات: </translation> </message> <message> <source>Specify data directory</source> <translation>حدد مجلد المعلومات</translation> </message> <message> <source>Creativecoin Core</source> <translation>جوهر البيت كوين</translation> </message> <message> <source>The %s developers</source> <translation>%s المبرمجون</translation> </message> <message> <source>Error: Disk space is low!</source> <translation>تحذير: مساحة القرص منخفضة</translation> </message> <message> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation>فشل في الاستماع على أي منفذ. استخدام الاستماع = 0 إذا كنت تريد هذا.</translation> </message> <message> <source>Invalid -onion address: '%s'</source> <translation>عنوان اونيون غير صحيح : '%s'</translation> </message> <message> <source>Verifying wallet...</source> <translation>التحقق من المحفظة ...</translation> </message> <message> <source>Wallet options:</source> <translation>خيارات المحفظة :</translation> </message> <message> <source>Information</source> <translation>معلومات</translation> </message> <message> <source>Signing transaction failed</source> <translation>فشل توقيع المعاملة</translation> </message> <message> <source>Transaction amount too small</source> <translation>قيمة العملية صغيره جدا</translation> </message> <message> <source>Transaction too large</source> <translation>المعاملة طويلة جدا</translation> </message> <message> <source>Warning</source> <translation>تحذير</translation> </message> <message> <source>Loading addresses...</source> <translation>تحميل العنوان</translation> </message> <message> <source>Invalid -proxy address: '%s'</source> <translation>عنوان البروكسي غير صحيح : '%s'</translation> </message> <message> <source>Make the wallet broadcast transactions</source> <translation>إنتاج معاملات بث المحفظة</translation> </message> <message> <source>Insufficient funds</source> <translation>اموال غير كافية</translation> </message> <message> <source>Loading block index...</source> <translation>تحميل مؤشر الكتلة</translation> </message> <message> <source>Loading wallet...</source> <translation>تحميل المحفظه</translation> </message> <message> <source>Cannot downgrade wallet</source> <translation>لا يمكن تخفيض قيمة المحفظة</translation> </message> <message> <source>Cannot write default address</source> <translation>لايمكن كتابة العنوان الافتراضي</translation> </message> <message> <source>Rescanning...</source> <translation>إعادة مسح</translation> </message> <message> <source>Done loading</source> <translation>انتهاء التحميل</translation> </message> <message> <source>Error</source> <translation>خطأ</translation> </message> </context> </TS>
require File.expand_path('../boot', __FILE__) require "rails" # Pick the frameworks you want: require "active_model/railtie" require "active_job/railtie" require "active_record/railtie" require "action_controller/railtie" require "action_mailer/railtie" require "action_view/railtie" require "sprockets/railtie" # require "rails/test_unit/railtie" # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) module Caravan class Application < Rails::Application
Parses Prisma Cloud Compute vulnerability alerts. This is a default playbook. ## Dependencies This playbook uses the following sub-playbooks, integrations, and scripts. Sub-playbooks This playbook does not use any sub-playbooks. Integrations This playbook does not use any integrations. Scripts * <API key> Commands This playbook does not use any commands. ## Playbook Inputs There are no inputs for this playbook. ## Playbook Outputs There are no outputs for this playbook. ## Playbook Image ![<API key>](https://raw.githubusercontent.com/demisto/content/<SHA1-like>/docs/images/playbooks/<API key>.png)
{% extends "navbase.html" %} {% block content %} <h1>Admin</h1> <ul> <li><a href="{{ url_for("configurations.configurations_view") }}">configurations</a> <li><a href="{{ url_for("clarifications.clarifications_view")}}">clarifications</a> <li><a href="{{ url_for("languages.languages_view") }}">languages</a> <li><a href="{{ url_for("problems.problems_view") }}">problems</a> <li><a href="{{ url_for("users.users_view") }}">users</a> <li><a href="{{ url_for("runs.runs_view") }}">runs</a> <li><a href="{{ url_for("contests.contests_view") }}">contests</a> </ul> <h1>Utils</h1> <ul> <li><a href="{{ url_for("utils.random_contestants") }}">random contestants</a> <li><a href="{{ url_for("utils.invalidate_caches") }}">invalidate caches</a> </ul> <h1>Info</h2> <table class="table"> <tbody> {% for key, val in info.items() %} <tr> <td><strong>{{ key }}</strong></td> <td>{{ val }}</td> </tr> {% endfor %} </tbody> </table> {% endblock %}
S V U I By: Munglunch LOCALIZED LUA FUNCTIONS ]] --[[ GLOBALS ]]-- local _G = _G; local unpack = _G.unpack; local select = _G.select; local pairs = _G.pairs; local string = _G.string; --[[ STRING METHODS ]]-- local format = string.format; GET ADDON DATA ]] local SV = _G['SVUI']; local L = SV.L; local MOD = SV.Skins; local Schema = MOD.Schema; LIGHTHEADED ]] local timeLapse = 0; local function DoDis(self, elapsed) self.timeLapse = self.timeLapse + elapsed if(self.timeLapse < 2) then return else self.timeLapse = 0 end QuestNPCModel:ClearAllPoints() QuestNPCModel:SetPoint("TOPLEFT", LightHeadedFrame, "TOPRIGHT", 5, -10) QuestNPCModel:SetAlpha(0.85) LightHeadedFrame:SetPoint("LEFT", QuestLogFrame, "RIGHT", 2, 0) end local function StyleLightHeaded() assert(LightHeadedFrame, "AddOn Not Loaded") local lhframe = _G["LightHeadedFrame"] local lhsub = _G["LightHeadedFrameSub"] local lhopts = _G["LightHeaded_Panel"] SV.API:Set("Frame", LightHeadedFrame) SV.API:Set("Frame", LightHeadedFrameSub) SV.API:Set("Frame", <API key>) SV.API:Set("Tooltip", LightHeadedTooltip) <API key>:RemoveTextures() lhframe.close:Hide() SV.API:Set("CloseButton", lhframe.close) lhframe.handle:Hide() SV.API:Set("PageButton", lhsub.prev) SV.API:Set("PageButton", lhsub.next) lhsub.prev:SetWidth(16) lhsub.prev:SetHeight(16) lhsub.next:SetWidth(16) lhsub.next:SetHeight(16) lhsub.prev:SetPoint("RIGHT", lhsub.page, "LEFT", -25, 0) lhsub.next:SetPoint("LEFT", lhsub.page, "RIGHT", 25, 0) SV.API:Set("ScrollBar", <API key>, 5) lhsub.title:SetTextColor(23/255, 132/255, 209/255) lhframe.timeLapse = 0; lhframe:SetScript("OnUpdate", DoDis) if lhopts:IsVisible() then for i = 1, 9 do local cbox = _G["<API key>"..i] cbox:SetStyle("CheckButton") end local buttons = { "<API key>", "<API key>", } for _, button in pairs(buttons) do _G[button]:SetStyle("Button") end <API key>:Disable() end end MOD:SaveAddonStyle("Lightheaded", StyleLightHeaded)
<!DOCTYPE html > <html> <head> <link rel="stylesheet" href="demos.css" type="text/css" media="screen" /> <script src="../libraries/RGraph.common.core.js" ></script> <script src="../libraries/RGraph.gauge.js" ></script> <!--[if lt IE 9]><script src="../excanvas/excanvas.js"></script><![endif]--> <title>A customised Gauge chart</title> <meta name="keywords" content="demo gauge customised" /> <meta name="description" content="A customised Gauge chart" /> <meta name="robots" content="noindex,nofollow" /> </head> <body> <h1>A customised Gauge chart</h1> <canvas id="cvs" width="250" height="250">[No canvas support]</canvas> <script> window.onload = function () { var gauge = new RGraph.Gauge('cvs', 0, 200, [184,12]) .Set('title.top', 'Air Speed') .Set('title.top.size', 'Italic 22') .Set('title.top.font', 'Impact') .Set('title.top.color', 'white') .Set('title.top', 'Air Speed') .Set('title.bottom.size', 'Italic 14') .Set('title.bottom.font', 'Impact') .Set('title.bottom.color', '#ccc') .Set('title.bottom', 'Knots') .Set('title.bottom.pos', 0.4) .Set('background.color', 'black') .Set('background.gradient', true) .Set('centerpin.color', '#666'); gauge.Set('needle.colors', [RGraph.RadialGradient(gauge, 125, 125, 0, 125, 125, 25, 'transparent', 'white'), RGraph.RadialGradient(gauge, 125, 125, 0, 125, 125, 25, 'transparent', '#d66')]) .Set('needle.size', [null, 50]) .Set('text.color', 'white') .Set('tickmarks.big.color', 'white') .Set('tickmarks.medium.color', 'white') .Set('tickmarks.small.color', 'white') .Set('border.outer', '#666') .Set('border.inner', '#333') .Set('colors.ranges', []) .Draw(); } </script> <p> <a href="./">&laquo; Back</a> </p> </body> </html>
<div ng-init="offCanvas=false" class="row row-offcanvas row-offcanvas-left" ng-class="{active: offCanvas}"> <div class="col-xs-6 col-sm-2 sidebar-offcanvas" id="sidebar"> <ul class="nav navbar-stacked"> <li role="presentation" route-active="assets/{{paramEngine}}/{{paramAsset}}/trade"> <a href="#/assets/{{paramEngine}}/{{paramAsset}}/trade" translate-cloak> <i class="fa fa-line-chart"></i>&nbsp;&nbsp;<span translate="translate.trade" /> </a> </li> <li role="presentation" route-active="assets/{{paramEngine}}/{{paramAsset}}/pulse"> <a href="#/assets/{{paramEngine}}/{{paramAsset}}/pulse" translate-cloak> <i class="fa fa-heartbeat"></i>&nbsp;&nbsp;<span translate="translate.pulse" /> </a> </li> <li role="presentation" route-active="assets/{{paramEngine}}/{{paramAsset}}/private" ng-show="privateEnabled && isPrivate && showPrivate"> <a href="#/assets/{{paramEngine}}/{{paramAsset}}/private" translate-cloak> <i class="fa fa-university"></i>&nbsp;&nbsp;<span>Private</span> </a> </li> <!-- <li role="presentation" > <a href ng-click="buyAsset()" translate="translate.buy"></a> </li> <li role="presentation" > <a href ng-click="sellAsset()" translate="translate.sell"></a> </li> <li role="presentation" > <a href ng-click="writePost()" translate="translate.write_post"></a> </li> </ul> </div> <div class="col-xs-12 col-sm-10"> <p class="visible-xs"> <button type="button" class="btn btn-xs" ng-class="{'btn-default':offCanvas, 'btn-primary':!offCanvas}" ng-click="offCanvas=!offCanvas"> <i class="fa fa-angle-double-{{offCanvas?'left':'right'}}"></i> <i class="fa fa-angle-double-{{offCanvas?'left':'right'}}"></i> <i class="fa fa-angle-double-{{offCanvas?'left':'right'}}"></i> </button> </p> <div class="row"> <div class="col-md-12"> <ol class="breadcrumb"> <li ng-repeat="b in breadcrumb" ng-class="{active: b.active}"> <span ng-if="b.translate && !b.period"> <a ng-if="b.href" href="{{b.href}}">{{ b.label | translate }}</a> <span ng-if="!b.href">{{ b.label | translate }}</span> </span> <span ng-if="!b.translate && !b.period"> <a ng-if="b.href" href="{{b.href}}">{{ b.label }}</a> <span ng-if="!b.href">{{ b.label }}</span> </span> </li> <a href ng-click="reload()" class="pull-right"> {{ 'translate.reload' | translate }}&nbsp;&nbsp; <i class="fa fa-refresh" ng-class="{'fa-spin': my_orders.isLoading || chart.isLoading || askOrders.isLoading || bidOrders.isLoading || trades.isLoading }"></i> </a> </ol> </div> </div> <div ng-if="paramSection=='pulse'"> <div class="row"> <div class="col-md-6"> <div class="media"> <a class="pull-left" style="width: 100px"> <i class="fa fa-pie-chart fa-5x text-muted"></i> </a> <div class="media-body" style="min-height: 120px"> <h4 class="media-heading">{{assetName}}</h4> <p>{{assetDescription}}<span ng-if="!assetDescription">no description</span></p> </div> </div> </div> <div class="col-md-6"> <div> <table class="table table-condensed"> <tr><td>Id</td><td colspan="3"><a ng-href="#/assets/{{paramEngine}}/{{paramAsset}}/trade">{{paramAsset}}</a></td></tr> <tr> <td>Issuer</td colspan="3"> <td> <a ng-href="#/accounts/{{assetIssuerRS}}/activity/latest" ng-hide="TRADE_UI_ONLY">{{assetIssuerName||assetIssuerRS}}</a> <span ng-show="TRADE_UI_ONLY">{{assetIssuerName||assetIssuerRS}}</span> </td> </tr> <tr ng-if="isPrivate"><td>Type</td><td colspan="3"><b>Private</b></td></tr> <tr><td>Quantity</td><td>{{assetQuantity}}</td><td>Decimals</td><td>{{assetDecimals}}</td></tr> <tr><td>Trades</td><td>{{assetTrades}}</td><td>Transfers</td><td>{{assetTransfers}}</td></tr> </table> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div ng-if="provider.entities.length == 0"> <p>{{assetName}} did not write any posts</p> <button class="btn btn-primary" ng-click="writePost()">Write first post</button> </div> <div ng-if="provider.entities.length > 0"> <div> <!-- List all posts --> <ul class="media-list"> <li class="media" ng-repeat="p in provider.entities"> <a class="pull-left" style="width: 100px"> <i class="fa fa-pencil-square-o fa-5x text-muted"></i> <div class="pull-right"> <span ng-if="p.confirmations < 0"><i class="fa fa-spinner fa-spin text-muted"></i></span> <span ng-if="p.confirmations >= 0 && p.confirmations <= 10" class="text-danger"><b>{{p.confirmations}}</b></span> <span ng-if="p.confirmations > 10" tooltip="{{p.confirmations}} confirmations"> <i class="fa fa-check text-success"></i> </span> </div> </a> <div class="media-body"> <h4 class="media-heading"><small>{{p.date}}&nbsp;&nbsp; <a href><i class="fa fa-<TwitterConsumerkey>"></i></a>&nbsp;&nbsp; <a href><i class="fa fa-facebook text-muted"></i></a>&nbsp;&nbsp; <a href><i class="fa fa-linkedin text-muted"></i></a>&nbsp;&nbsp; <a href><i class="fa fa-google-plus text-muted"></i></a></small> </h4> <p>{{p.message}}</p> <p> <button class="btn btn-sm btn-primary" ng-click="writeComment(p.transaction)"> <i class="fa fa-comment-o"></i>&nbsp;&nbsp;{{p.comment_count}}&nbsp;&nbsp;<span translate="translate.leave_comment"/> </button> &nbsp; <a href ng-click="p.commentProvider.reload()" ng-if="p.comment_count > 0 && p.commentProvider.entities.length == 0"> <span ng-show="p.commentProvider.isLoading"><i class="fa fa-refresh fa-spin"></i></span> <span translate="translate.load_comments" /> </a> <a href ng-click="p.commentProvider.clear()" ng-if="p.comment_count > 0 && p.commentProvider.entities.length > 0"> <span translate="translate.hide_comments" /> </a> </p> <br> <!-- comments --> <div ng-if="p.commentProvider.entities.length > 0"> <div class="media" ng-repeat="c in p.commentProvider.entities"> <a class="pull-left"> <i class="fa fa-user fa-5x text-muted"></i> <div class="pull-right"> <span ng-if="c.confirmations < 0"><i class="fa fa-spinner fa-spin text-muted"></i></span> <span ng-if="c.confirmations >= 0 && c.confirmations <= 10" class="text-danger"><b>{{c.confirmations}}</b></span> <span ng-if="c.confirmations > 10" tooltip="{{c.confirmations}} confirmations"> <i class="fa fa-check text-success"></i> </span> </div> </a> <div class="media-body"> <h4 class="media-heading"><small><a ng-href="#/accounts/{{c.senderRS}}/activity/latest">{{c.senderName||c.senderRS}}</a>&nbsp;&nbsp;{{c.date}}&nbsp;&nbsp; <a href><i class="fa fa-<TwitterConsumerkey>"></i></a>&nbsp;&nbsp; <a href><i class="fa fa-facebook text-muted"></i></a>&nbsp;&nbsp; <a href><i class="fa fa-linkedin text-muted"></i></a>&nbsp;&nbsp; <a href><i class="fa fa-google-plus text-muted"></i></a></small> </h4> <p>{{c.text}}</p> </div> </div> <div class="load-more-button" ng-show="p.commentProvider.hasMore"> <a href ng-click="p.commentProvider.loadMore()" class="text-lowercase text-muted"> <span ng-show="p.commentProvider.isLoading"><i class="fa fa-refresh fa-spin"></i></span> <span translate="translate.load_more_comments"></span> </a> </div> </div> </div> </li> </ul> </div> <div class="load-more-button" ng-show="provider.hasMore"> <a href ng-click="provider.loadMore()" class="text-lowercase text-muted"> <span ng-show="provider.isLoading"><i class="fa fa-refresh fa-spin"></i></span> <span translate="translate.load_more_posts"></span> </a> </div> </div> </div> </div> </div> <style> .panel-heading a:after { display: none; } </style> <div ng-if="paramSection=='trade'"> <!-- Chart + Description --> <div class="row" ng-init="chartType='old'"> <div class="col-md-6"> <div class="panel panel-default" style="width: 100%"> <div class="panel-heading"> <b>Price chart</b> <!-- <span class="pull-right"> Show&nbsp;<a href ng-click="chartType='old'">old</a>&nbsp;/&nbsp;<a href ng-click="chartType='new'">new</a> </span> </div> <div class="panel-body" style="padding: 0px; height: 250px; width: 100%;"> <!-- <div id="chartdiv" style="width:100%; height:100%" ng-show="chartType=='old'"></div> --> <price-chart chart="chart" style="width:100%; height:100%"></price-chart> </div> </div> </div> <div class="col-md-6"> <div class="panel panel-default"> <div class="panel-heading"> <b>{{assetName}}</b>&nbsp;#<a href="#/assets/{{paramEngine}}/{{paramAsset}}/trade">{{paramAsset}}</a> <a href="#/assets/{{paramEngine}}/{{paramAsset}}/pulse" class="pull-right text-uppercase"> <span translate="translate.show_pulse" /> </a> </div> <div class="panel-body" style="height: 250px;"> <p><span translate="translate.marketcap"></span>:&nbsp;{{details.data.marketcapNXT}}&nbsp;{{symbol}}</p> <p><span translate="translate.last_price"></span>:&nbsp;{{details.data.lastPriceNXT}}&nbsp;{{symbol}}</p> <p><span translate="translate.volume_today"></span>:&nbsp;{{details.data.volumeToday}}&nbsp;{{assetName}}&nbsp;({{details.data.numberOfTradesToday}}&nbsp;{{ 'translate.trades' | translate }})</p> <p><span translate="translate.volume_total"></span>:&nbsp;{{details.data.volumeTotal}}&nbsp;{{assetName}}&nbsp;({{details.data.numberOfTrades}}&nbsp;{{ 'translate.trades' | translate }})</p> <p ng-show="isPrivate"><span translate="translate.order_fee"></span>:&nbsp;{{details.data.orderFee}}%&nbsp;<span translate="translate.trade_fee"></span>:&nbsp;{{details.data.tradeFee}}%</p> <p ng-show="<API key>"> Balance:&nbsp; <span> <b>{{<API key>}}</b> <span class="text-muted" ng-show="<API key>!=assetBalance">({{assetBalance}})</span> {{assetName}} </span> </p> <p class="text-muted">{{details.data.description}}</p> </div> </div> </div> </div> <div class="row"> <!-- Buy/Bid orders --> <div class="col-md-4"> <div class="panel panel-default" style="margin-top: 5px; "> <div class="panel-heading"> <b>{{ 'translate.buy_orders' | translate }}</b> </div> <div class="panel-body" style="padding: 0px; overflow-y: auto; height: 250px;"> <div class="table-responsive"> <table class="table table-striped table-condensed table-hover"> <thead> <tr translate-cloak> <th></th> <th>{{ 'translate.price' | translate }}</th> <th>{{ 'translate.quantity' | translate }}</th> <th>{{ 'translate.total' | translate }}</th> </tr> </thead> <tbody> <tr ng-repeat="o in bidOrders.entities" ng-class="{'text-danger': o.cancellers}" ng-hide="o.cancelled || o.quantity=='0'" style="cursor:pointer" ng-click="bidOrderClicked(o)"> <td> <span ng-if="o.confirmations <= 0" class="text-muted"> <i class="fa fa-spinner fa-spin"></i> </span> <span ng-if="o.confirmations > 0 && o.confirmations <= 10" class="text-muted"> <b>{{o.confirmations}}</b> </span> <span ng-if="o.confirmations > 10" tooltip="{{o.confirmations}} {{ 'translate.confirmations' | translate }}" class="text-success"> <i class="fa fa-check"></i> </span> </td> <td>{{o.price}}</td> <td>{{o.quantity}}</td> <td>{{o.total}}</td> </tr> </tbody> </table> </div> <div class="load-more-button" ng-show="bidOrders.hasMore"> <a href ng-click="bidOrders.loadMore()" class="text-lowercase text-muted"> <span ng-show="bidOrders.isLoading"><i class="fa fa-refresh fa-spin"></i></span> <span translate-cloak>{{ 'translate.<API key>' | translate }}</span> </a> </div> </div> </div> </div> <!-- Buy/Sell controls --> <div class="col-md-4"> <div class="panel" style="margin-top: 5px;"> <div class="panel-body" style="height: 100%"> <div class="row"> <div class="col-xs-12"> <p> <form class="form-inline"> <div class="form-group"> <label translate="translate.how_many_shares"></label>&nbsp; <input type="text" class="form-control" placeholder="{{'translate.enter_amount' | translate}}" ng-model="order.quantity" ng-change="order.reCalculate()" money precision="{{assetDecimals}}"> </div> </form> </p> <p> <form class="form-inline"> <div class="form-group"> <label translate="translate.price_per_share"></label>&nbsp; <input type="text" class="form-control" placeholder="{{'translate.enter_price' | translate}}" ng-model="order.priceNXT" ng-change="order.reCalculate()" money precision="8"> </div> </form> </p> <p> <span translate="translate.total_price"></span>&nbsp;<b>{{order.totalPriceNXT}}</b>&nbsp;{{symbol}} <span class="text-muted" ng-show="isPrivate">&nbsp; <br>(transaction fee {{details.data.tradeFee}}% + {{order.transactionFeeNXT}} {{symbol}})</span> </p> </div> </div> <div class="row"> <div class="col-xs-6"> <button class="btn btn-success btn-block text-center" ng-click="buyAsset()" ng-disabled="!currentAccount || !order.priceNXT || !order.quantity"> <big><b><span translate="translate.buy"></span></b></big><br> <small>Click to send order</small> </button> </div> <div class="col-xs-6"> <button class="btn btn-danger btn-block text-center" ng-click="sellAsset()" ng-disabled="!currentAccount || !order.priceNXT || !order.quantity"> <big><b><span translate="translate.sell"></span></b></big><br> <small>Click to send order</small> </button> </div> </div> </div> </div> </div> <!-- Sell/Ask orders --> <div class="col-md-4"> <div class="panel panel-default" style="margin-top: 5px; "> <div class="panel-heading"> <b>{{ 'translate.sell_orders' | translate }}</b> </div> <div class="panel-body" style="padding: 0px; overflow-y: auto; height: 250px;"> <div class="table-responsive"> <table class="table table-striped table-condensed table-hover"> <thead> <tr translate-cloak> <th></th> <th>{{ 'translate.price' | translate }}</th> <th>{{ 'translate.quantity' | translate }}</th> <th>{{ 'translate.total' | translate }}</th> </tr> </thead> <tbody> <tr ng-repeat="o in askOrders.entities" ng-class="{'text-danger': o.cancellers}" ng-hide="o.cancelled || o.quantity=='0'" style="cursor:pointer" ng-click="askOrderClicked(o)"> <td> <span ng-if="o.confirmations <= 0" class="text-muted"> <i class="fa fa-spinner fa-spin"></i> </span> <span ng-if="o.confirmations > 0 && o.confirmations <= 10" class="text-muted"> <b>{{o.confirmations}}</b> </span> <span ng-if="o.confirmations > 10" tooltip="{{o.confirmations}} {{ 'translate.confirmations' | translate }}" class="text-success"> <i class="fa fa-check"></i> </span> </td> <td>{{o.price}}</td> <td>{{o.quantity}}</td> <td>{{o.total}}</td> </tr> </tbody> </table> </div> <div class="load-more-button" ng-show="askOrders.hasMore"> <a href ng-click="askOrders.loadMore()" class="text-lowercase text-muted"> <span ng-show="askOrders.isLoading"><i class="fa fa-refresh fa-spin"></i></span> <span translate-cloak>{{ 'translate.<API key>' | translate }}</span> </a> </div> </div> </div> </div> </div> <div class="row"> <!-- Recent trades --> <div class="col-md-4"> <div class="panel panel-default" style="margin-top: 5px;"> <div class="panel-heading"><b>{{ 'translate.recent_trades' | translate }}</b></div> <div class="panel-body" style="padding: 0px; overflow-y: auto; height: 250px"> <div class="table-responsive"> <table class="table table-striped table-condensed"> <thead> <tr translate-cloak> <th></th> <th>{{ 'translate.date' | translate }}</th> <th>{{ 'translate.type' | translate }}</th> <th>{{ 'translate.price' | translate }}</th> <th>{{ 'translate.quantity' | translate }}</th> <th>{{ 'translate.total' | translate }}</th> </tr> </thead> <tbody> <tr ng-repeat="o in trades.entities"> <td> <span ng-if="o.confirmations <= 0" class="text-muted"> <i class="fa fa-spinner fa-spin"></i> </span> <span ng-if="o.confirmations > 0 && o.confirmations <= 10" class="text-muted"> <b>{{o.confirmations}}</b> </span> <span ng-if="o.confirmations > 10" tooltip="{{o.confirmations}} {{ 'translate.confirmations' | translate }}" class="text-success"> <i class="fa fa-check"></i> </span> </td> <td>{{o.date}}</td> <td style="color: {{trades.getTypeColor(o.tradeType)}}">{{o.tradeType}}</td> <td>{{o.price}}</td> <td>{{o.quantity}}</td> <td>{{o.total}}</td> </tr> </tbody> </table> </div> <div class="load-more-button" ng-show="trades.hasMore"> <a href ng-click="trades.loadMore()" class="text-lowercase text-muted"> <span ng-show="trades.isLoading"><i class="fa fa-refresh fa-spin"></i></span> <span translate-cloak>{{ 'translate.load_more_trades' | translate }}</span> </a> </div> </div> </div> </div> <!-- My buy orders --> <div class="col-md-4"> <div class="panel panel-default" style="margin-top: 5px;" ng-show="currentAccount"> <div class="panel-heading"><b>{{ 'translate.my_bid_orders' | translate }}</b></div> <div class="panel-body" style="padding: 0px; overflow-y: auto; height: 250px"> <div class="table-responsive"> <table class="table table-striped table-condensed"> <thead> <tr translate-cloak> <th></th> <th>{{ 'translate.price' | translate }}</th> <th>{{ 'translate.quantity' | translate }}</th> <th>{{ 'translate.total' | translate }}</th> <th></th> </tr> </thead> <tbody> <tr ng-repeat="o in myBidOrders.entities" ng-class="{'text-danger': o.cancellers}" ng-hide="o.cancelled || o.quantity=='0'"> <td> <span ng-if="o.confirmations <= 0" class="text-muted"> <i class="fa fa-spinner fa-spin"></i> </span> <span ng-if="o.confirmations > 0 && o.confirmations <= 10" class="text-muted"> <b>{{o.confirmations}}</b> </span> <span ng-if="o.confirmations > 10" tooltip="{{o.confirmations}} {{ 'translate.confirmations' | translate }}" ng-class="{'text-danger': o.cancellers, 'text-success': !o.cancellers}"> <i class="fa fa-check"></i> </span> </td> <td>{{o.price}}</td> <td>{{o.quantity}}</td> <td>{{o.total}}</td> <td><a href ng-click="cancelOrder(o)" class="pull-right" ng-hide="o.confirmations < 1">Cancel</a></td> </tr> </tbody> </table> </div> <div class="load-more-button" ng-show="myBidOrders.hasMore"> <a href ng-click="myBidOrders.loadMore()" class="text-lowercase text-muted"> <span ng-show="myBidOrders.isLoading"><i class="fa fa-refresh fa-spin"></i></span> <span translate-cloak>{{ 'translate.load_more_orders' | translate }}</span> </a> </div> </div> </div> </div> <!-- My sell orders --> <div class="col-md-4"> <div class="panel panel-default" style="margin-top: 5px; " ng-show="currentAccount"> <div class="panel-heading"><b>{{ 'translate.my_ask_orders' | translate }}</b></div> <div class="panel-body" style="padding: 0px; overflow-y: auto; height: 250px"> <div class="table-responsive"> <table class="table table-striped table-condensed"> <thead> <tr translate-cloak> <th></th> <th>{{ 'translate.price' | translate }}</th> <th>{{ 'translate.quantity' | translate }}</th> <th>{{ 'translate.total' | translate }}</th> <th></th> </tr> </thead> <tbody> <tr ng-repeat="o in myAskOrders.entities" ng-class="{'text-danger': o.cancellers}" ng-hide="o.cancelled || o.quantity=='0'"> <td> <span ng-if="o.confirmations <= 0" class="text-muted"> <i class="fa fa-spinner fa-spin"></i> </span> <span ng-if="o.confirmations > 0 && o.confirmations <= 10" class="text-muted"> <b>{{o.confirmations}}</b> </span> <span ng-if="o.confirmations > 10" tooltip="{{o.confirmations}} {{ 'translate.confirmations' | translate }}" ng-class="{'text-danger': o.cancellers, 'text-success': !o.cancellers}"> <i class="fa fa-check"></i> </span> </td> <td>{{o.price}}</td> <td>{{o.quantity}}</td> <td>{{o.total}}</td> <td><a href ng-click="cancelOrder(o)" class="pull-right" ng-hide="o.confirmations < 1">Cancel</a></td> </tr> </tbody> </table> </div> <div class="load-more-button" ng-show="myAskOrders.hasMore"> <a href ng-click="myAskOrders.loadMore()" class="text-lowercase text-muted"> <span ng-show="myAskOrders.isLoading"><i class="fa fa-refresh fa-spin"></i></span> <span translate-cloak>{{ 'translate.load_more_orders' | translate }}</span> </a> </div> </div> </div> </div> </div> </div> <!-- private assets --> <div ng-if="paramSection=='private'"> <div class="row"> <div class="col-md-12"> <div> <span><b translate="translate.order_fee"></b>:&nbsp;&nbsp;{{provider.orderFee}}&nbsp;%</span>&nbsp;&nbsp; <span><b translate="translate.trade_fee"></b>:&nbsp;&nbsp;{{provider.tradeFee}}&nbsp;%</span> </div> <div> <form class="form-inline"> <div class="form-group"> <b>{{ 'translate.show' | translate }}</b>&nbsp;&nbsp; <input type="radio" name="showAllowed" ng-value="'all'" ng-model="provider.showWhat" ng-change="provider.reload()">&nbsp;{{ 'translate.all' | translate }}&nbsp;&nbsp; <input type="radio" name="showAllowed" ng-value="'allowed'" ng-model="provider.showWhat" ng-change="provider.reload()">&nbsp;{{ 'translate.allowed' | translate }}&nbsp;&nbsp; <input type="radio" name="showAllowed" ng-value="'prohibited'" ng-model="provider.showWhat" ng-change="provider.reload()">&nbsp;{{ 'translate.prohibited' | translate }} </div> <div class="pull-right"> <button class="btn btn-success" translate="translate.add_account" ng-click="<API key>(a.id_rs)"></button> <button class="btn btn-primary" translate="translate.set_fees" ng-click="setPrivateAssetFee(a.id_rs)"></button> </div> </form> </div> <div infinite-scroll="provider.loadMore()" <API key>="0" <API key>="false"> <div> <div class="table-responsive"> <table class="table table-striped table-condensed"> <thead> <tr translate-cloak> <th></th> <th>{{ 'translate.name' | translate }}</th> <th>{{ 'translate.account' | translate }}</th> <!-- <th>{{ 'translate.quantity' | translate }}</th> --> <th></th> </tr> </thead> <tbody> <tr ng-repeat="a in provider.entities"> <td> <span ng-if="a.confirmations <= 0"><i class="fa fa-spinner fa-spin text-muted"></i></span> <span ng-if="a.confirmations > 0 && a.confirmations <= 10" class="text-danger"><b>{{a.confirmations}}</b></span> <span ng-if="a.confirmations > 10" tooltip="{{a.confirmations}} confirmations"> <i class="fa fa-check text-success"></i></span> </td> <td>{{a.name}}</td> <td><a href="#/accounts/{{a.id_rs}}/activity/latest">{{a.id_rs}}</a></td> <!-- <td>{{a.quantity}}</td> --> <td> <span ng-hide="a.confirmations <= 0"> <a class="pull-right" ng-if="!a.allowed" href ng-click="<API key>(a.id_rs)" translate="translate.add_account"></a> <a class="pull-right" ng-if="a.allowed" href ng-click="<API key>(a.id_rs)" translate="translate.remove_account"></a> </span> </td> </tr> </tbody> </table> </div> </div> </div> </div> </div> </div> </div> </div>
/* global describe:true, it:true */ 'use strict'; // Utilities: import chai from 'chai'; import dirtyChai from 'dirty-chai'; import Promise from 'bluebird'; import sinon from 'sinon'; import sinonChai from 'sinon-chai'; // Test setup: const expect = chai.expect; chai.use(dirtyChai); chai.use(sinonChai); // Dependencies: import <API key> from './<API key>'; import createBaseTestFiles from './<API key>'; import <API key> from './<API key>'; import log from 'npmlog'; import setUpSelenium from './set-up-selenium'; // Under test: import cliInit from './index'; describe('server/cli/init: index:', () => { it('should run the initialisation steps', () => { sinon.stub(<API key>, 'run').returns(Promise.resolve()); sinon.stub(createBaseTestFiles, 'run').returns(Promise.resolve()); sinon.stub(<API key>, 'run').returns(Promise.resolve()); sinon.stub(setUpSelenium, 'run').returns(Promise.resolve()); sinon.stub(log, 'info'); return cliInit() .then(() => { expect(<API key>.run).to.have.been.calledOnce(); expect(createBaseTestFiles.run).to.have.been.calledOnce(); expect(<API key>.run).to.have.been.calledOnce(); expect(setUpSelenium.run).to.have.been.calledOnce(); }) .finally(() => { <API key>.run.restore(); createBaseTestFiles.run.restore(); <API key>.run.restore(); setUpSelenium.run.restore(); log.info.restore(); }); }); it('should tell the user what it is doing', () => { sinon.stub(<API key>, 'run').returns(Promise.resolve()); sinon.stub(createBaseTestFiles, 'run').returns(Promise.resolve()); sinon.stub(<API key>, 'run').returns(Promise.resolve()); sinon.stub(setUpSelenium, 'run').returns(Promise.resolve()); sinon.stub(log, 'info'); return cliInit() .then(() => { expect(log.info).to.have.been.calledWith('Setting up tractor...'); expect(log.info).to.have.been.calledWith('Set up complete!'); }) .finally(() => { <API key>.run.restore(); createBaseTestFiles.run.restore(); <API key>.run.restore(); setUpSelenium.run.restore(); log.info.restore(); }); }); it('should tell the user if there is an error', () => { let message = 'error'; sinon.stub(<API key>, 'run').returns(Promise.reject(new Error(message))); sinon.stub(log, 'error'); sinon.stub(log, 'info'); return cliInit() .catch(() => { }) .then(() => { expect(log.error).to.have.been.calledWith('Something broke, sorry :('); expect(log.error).to.have.been.calledWith(message); }) .finally(() => { <API key>.run.restore(); log.error.restore(); log.info.restore(); }); }); });
<?php namespace Lexik\Bundle\MaintenanceBundle\Tests\Maintenance; use Lexik\Bundle\MaintenanceBundle\Drivers\FileDriver; use Symfony\Bundle\FrameworkBundle\Translation\Translator; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; /** * Test driver file * * @package <API key> * @author Gilles Gauthier <g.gauthier@lexik.fr> */ class FileDriverTest extends TestCase { static protected $tmpDir; protected $container; static public function setUpBeforeClass() { parent::setUpBeforeClass(); self::$tmpDir = sys_get_temp_dir().'/symfony2_finder'; } public function setUp() { $this->container = $this->initContainer(); } public function tearDown() { $this->container = null; } public function testDecide() { $options = array('file_path' => self::$tmpDir.'/lock.lock'); $fileM = new FileDriver($this->getTranslator(), $options); $this->assertTrue($fileM->decide()); $options = array('file_path' => self::$tmpDir.'/clok'); $fileM2 = new FileDriver($this->getTranslator(), $options); $this->assertFalse($fileM2->decide()); } /** * @expectedException <API key> */ public function <API key>() { $fileM = new FileDriver($this->getTranslator(), array()); } public function testLock() { $options = array('file_path' => self::$tmpDir.'/lock.lock'); $fileM = new FileDriver($this->getTranslator(), $options); $fileM->lock(); $this->assertFileExists($options['file_path']); } public function testUnlock() { $options = array('file_path' => self::$tmpDir.'/lock.lock'); $fileM = new FileDriver($this->getTranslator(), $options); $fileM->lock(); $fileM->unlock(); $this->assertFileNotExists($options['file_path']); } public function testIsExists() { $options = array('file_path' => self::$tmpDir.'/lock.lock', 'ttl' => 3600); $fileM = new FileDriver($this->getTranslator(), $options); $fileM->lock(); $this->assertTrue($fileM->isEndTime(3600)); } public function testMessages() { $options = array('file_path' => self::$tmpDir.'/lock.lock', 'ttl' => 3600); $fileM = new FileDriver($this->getTranslator(), $options); $fileM->lock(); // lock $this->assertEquals($fileM->getMessageLock(true), 'lexik_maintenance.success_lock_file'); $this->assertEquals($fileM->getMessageLock(false), 'lexik_maintenance.not_success_lock'); // unlock $this->assertEquals($fileM->getMessageUnlock(true), 'lexik_maintenance.success_unlock'); $this->assertEquals($fileM->getMessageUnlock(false), 'lexik_maintenance.not_success_unlock'); } static public function tearDownAfterClass() { parent::tearDownAfterClass(); } protected function initContainer() { $container = new ContainerBuilder(new ParameterBag(array( 'kernel.debug' => false, 'kernel.bundles' => array('MaintenanceBundle' => 'Lexik\Bundle\MaintenanceBundle'), 'kernel.cache_dir' => sys_get_temp_dir(), 'kernel.environment' => 'dev', 'kernel.root_dir' => __DIR__.'/../../../../' // src dir ))); return $container; } public function getTranslator() { $translator = new Translator( $this->container, $this->getMock('Symfony\Component\Translation\MessageSelector') ); return $translator; } }
<f:layout name="Backend" /> <f:section name="content"> <div class="tabs_inner" id="inner-layer-{tabInfo.uid}"> <span onClick='removeTab("{tabInfo.uid}", "layer", "{delete-uri}")' class='ui-icon ui-icon-close closeicon' style='float: right;' role='presentation'></span> <input type="hidden" value="" id="layer_order_{tabInfo.uid}" name="<API key>[layer_data][{tabInfo.uid}][layer_order]"/> <ul> <label>Layer #{tabInfo.uid}</label> <li class="slide-tab"><a href="#tabs-effects-{tabInfo.uid}">Effects</a></li> <li class="slide-tab"><a href="#tabs-basic-{tabInfo.uid}">Basic</a></li> </ul> <div id="tabs-effects-{tabInfo.uid}"> <table style="width: 100%;"> <tr>&nbsp;</tr> <tr>&nbsp;</tr> <tr> <td width=100> <table> <tr><td><img width="100px" height="100px" src="http: </table> </td> <td>&nbsp;</td> <td width="200"> <table> <tr><td>&nbsp;</td></tr> <tr><td>Slide In:</td> <td><label>Direction</label> <select data-help="The type of the transition." class="sublayerprop" name="<API key>[layer_data][{tabInfo.uid}][layer_slidein_dir]"> <f:for each="{tabInfo.transitionList}" as="value" key="key"> <f:if condition="{tabInfo.layer_slidein_dir}=={key}"> <f:then> <option selected="selected" value="{key}">{value}</option> </f:then> <f:else> <option value="{key}">{value}</option> </f:else> </f:if> </f:for> </select> </td></tr> <tr> <td>Slide Out:</td> <td> <label>Direction</label> <select data-help="The type of the transition." class="sublayerprop" name="<API key>[layer_data][{tabInfo.uid}][layer_slideout_dir]"> <f:for each="{tabInfo.transitionList}" as="value" key="key"> <f:if condition="{tabInfo.layer_slideout_dir}=={key}"> <f:then> <option selected="selected" value="{key}">{value}</option> </f:then> <f:else> <option value="{key}">{value}</option> </f:else> </f:if> </f:for> </select> </td></tr> <tr><td>Other Options:</td><td><label>P.level</label><input type="text" style="width: 100px" name="<API key>[layer_data][{tabInfo.uid}][<API key>]" value=""></td></tr> </table> </td> <td> <table> <tr><td>&nbsp;</td></tr> <tr><td><label>Duration</label><input type="text" style="width: 100px" name="<API key>[layer_data][{tabInfo.uid}][<API key>]" value="" >ms</td></tr> <tr><td><label>Duration</label><input type="text" style="width: 100px" name="<API key>[layer_data][{tabInfo.uid}][<API key>]" value="" >ms</td></tr> <tr><td>&nbsp;</td></tr> </table> </td> <td> <table> <tr><td>&nbsp;</td></tr> <tr><td><label>Easing</label> <select class="layerprop" name="<API key>[layer_data][{tabInfo.uid}][layer_easingin]"> <f:for each="{tabInfo.easingList}" as="value" key="key"> <f:if condition="{tabInfo.layer_easingin}=={value}"> <f:then> <option selected>{value}</option> </f:then> <f:else> <option>{value}</option> </f:else> </f:if> </f:for> </select></td></tr> <tr><td><label>Easing</label> <select class="layerprop" name="<API key>[layer_data][{tabInfo.uid}][layer_easingout]"> <f:for each="{tabInfo.easingList}" as="value" key="key"> <f:if condition="{tabInfo.layer_easingout}=={value}"> <f:then> <option selected>{value}</option> </f:then> <f:else> <option>{value}</option> </f:else> </f:if> </f:for> </select> </td></tr> <tr><td><label>Show unit</label><input type="text" style="width: 100px" name="<API key>[layer_data][{tabInfo.uid}][layer_units]" value="">(ms)</td></tr> </table> </td> <td> <table> <tr><td>&nbsp;</td></tr> <tr><td><label>Delay</label><input type="text" style="width: 100px" name="<API key>[layer_data][{tabInfo.uid}][layer_delay_in]" value="">(ms)</td></tr> <tr><td><label>Delay</label><input type="text" style="width: 100px" name="<API key>[layer_data][{tabInfo.uid}][layer_delay_out]" value="">(ms)</td></tr> <tr><td>&nbsp;</td></tr> </table> </td> </tr> </table> </div> <div id="tabs-basic-{tabInfo.uid}"> <table style="width: 100%;"> <tr>&nbsp;</tr> <tr>&nbsp;</tr> <tr> <td width=100> <table> <tr><td><img width="100px" height="100px" src="http: <tr><td> <input type="hidden" value="" name="<API key>[layer_data][{tabInfo.uid}][layer_image]" id="child_layer_img_{tabInfo.uid}_text"/> <input type="button" style="width: 100px" value="upload" class="topopup" onclick="load_elfinder('{tabInfo.uid}','1');"/> </td></tr> </table> </td> <td>&nbsp;</td> <td> <table> <tr><td>&nbsp;</td></tr> <tr><td></td></tr> <tr><td>&nbsp;</td></tr> <tr><td>&nbsp;</td></tr> <tr><td></td></tr> <tr><td>&nbsp;</td></tr> <tr><td><input type="text" style="width: 100px" id="layertext_{tabInfo.uid}" placeholder="Text here" class="attributes tooltip" value="" name="<API key>[layer_data][{tabInfo.uid}][layer_text]" value="{tabInfoChild.layer_text}"></td></tr> <tr> <td> <label>Style</label> <select name="<API key>[layer_data][{tabInfo.uid}][layer_style]" class="attributes" id="htmltag_{tabInfo.uid}" > <f:for each="{tabInfo.styleList}" as="value" key="key"> <f:if condition="{tabInfo.layer_style}=={key}"> <f:then> <option selected="selected" value="{key}">{value}</option> </f:then> <f:else> <option value="{key}">{value}</option> </f:else> </f:if> </f:for> </select> </td> <td>&nbsp;</td> </tr> </table> </td> <td> <table> <tr><td>&nbsp;</td></tr> <tr><td>&nbsp;</td></tr> <tr><td>&nbsp;</td></tr> <tr><td>Sublayer URL</td></tr> <tr> <td><input type="text" style="width: 100px" placeholder="URL for the layer" name="<API key>[layer_data][{tabInfo.uid}][layer_url]" value=""> <select name="<API key>[layer_data][{tabInfo.uid}][layer_link_control]"> <f:for each="{tabInfo.urlControlList}" as="value" key="key"> <f:if condition="{tabInfo.layer_link_control}=={value}"> <f:then> <option selected>{value}</option> </f:then> <f:else> <option>{value}</option> </f:else> </f:if> </f:for> </select></td> <td>&nbsp;</td> </tr> </table> </td> <td> <table> <tr><td>&nbsp;</td></tr> <tr><td>Attributes</td></tr> <tr><td><input type="text" style="width: 100px" placeholder="Title for the layer." name="<API key>[layer_data][{tabInfo.uid}][layer_title]" value="{tabInfoChild.layer_title}" ></td></tr> <tr><td><input type="text" style="width: 100px" placeholder="Alt text for image." name="<API key>[layer_data][{tabInfo.uid}][layer_image_alt]" value="{tabInfoChild.layer_image_alt}" ></td></tr> <tr><td><input type="text" style="width: 100px" placeholder="Custom field." id="layer_custom_{tabInfo.uid}" class="attributes tooltip" name="<API key>[layer_data][{tabInfo.uid}][layer_custom]" value="{tabInfoChild.layer_custom}"></td></tr> </table> </td> <td> <table> <tr><td>&nbsp;</td></tr> <tr><td>Top</td><td><input onkeyup="setPreview('{tabsInfoChild.uid}')" type="text" style="width: 100px" class="attributes" id="layer_top_{tabInfo.uid}" name="<API key>[layer_data][{tabInfo.uid}][layer_top]" value="{tabInfoChild.layer_top}"></td></tr> <tr><td>Left</td><td><input onkeyup="setPreview('{tabsInfoChild.uid}')" type="text" style="width: 100px" class="attributes" id="layer_left_{tabInfo.uid}" name="<API key>[layer_data][{tabInfo.uid}][layer_left]" value="{tabInfoChild.layer_left}"></td></tr> <tr><td>Custom Styles</td><td><textarea rows="5" cols="15" class="attributes tooltip" id="layercustomstyle_{tabInfo.uid}" name="<API key>[layer_data][{tabInfo.uid}][layer_custom_style]">{tabInfoChild.layer_custom_style}</textarea></td></tr> </table> </td> </tr> </table> </div> <input id="new-addlayer-url" class="new-addlayer-url" type="hidden" value="{f:uri.action(action: 'addlayer', controller: 'Pitslayerslider')}"> <input id ='add_sublayer_{tabInfo.tab_id}' class="sub_layer" type="button" value="Add new sublayer" /> </div> </f:section>
var Class = require('../../../../utils/Class'); var CONST = require('./const'); var DataBuffer32 = require('../../utils/DataBuffer32'); var Earcut = require('../../../../geom/polygon/Earcut'); var PHASER_CONST = require('../../../../const'); var <API key> = require('../../shaders/<API key>'); var ShapeBatch = new Class({ initialize: function ShapeBatch (game, gl, manager) { this.game = game; this.type = PHASER_CONST.WEBGL; this.view = game.canvas; this.resolution = game.config.resolution; this.width = game.config.width * game.config.resolution; this.height = game.config.height * game.config.resolution; this.glContext = gl; this.maxVertices = null; this.shader = null; this.vertexBufferObject = null; this.vertexDataBuffer = null; this.vertexCount = 0; this.viewMatrixLocation = null; this.tempTriangle = [ {x: 0, y: 0, width: 0, rgb: 0xFFFFFF, alpha: 1.0}, {x: 0, y: 0, width: 0, rgb: 0xFFFFFF, alpha: 1.0}, {x: 0, y: 0, width: 0, rgb: 0xFFFFFF, alpha: 1.0}, {x: 0, y: 0, width: 0, rgb: 0xFFFFFF, alpha: 1.0} ]; // All of these settings will be able to be controlled via the Game Config this.config = { clearBeforeRender: true, transparent: false, autoResize: false, <API key>: false, WebGLContextOptions: { alpha: true, antialias: true, premultipliedAlpha: true, stencil: true, <API key>: false } }; this.manager = manager; this.dirty = false; this.context = null; this.init(this.glContext); }, init: function (gl) { var vertexDataBuffer = new DataBuffer32(CONST.VERTEX_SIZE * CONST.MAX_VERTICES); var shader = this.manager.resourceManager.createShader('<API key>', <API key>); var vertexBufferObject = this.manager.resourceManager.createBuffer(gl.ARRAY_BUFFER, vertexDataBuffer.getByteCapacity(), gl.STREAM_DRAW); var viewMatrixLocation = shader.getUniformLocation('u_view_matrix'); var max = CONST.MAX_VERTICES; vertexBufferObject.addAttribute(shader.getAttribLocation('a_position'), 2, gl.FLOAT, false, CONST.VERTEX_SIZE, 0); vertexBufferObject.addAttribute(shader.getAttribLocation('a_color'), 4, gl.UNSIGNED_BYTE, true, CONST.VERTEX_SIZE, 8); vertexBufferObject.addAttribute(shader.getAttribLocation('a_alpha'), 1, gl.FLOAT, false, CONST.VERTEX_SIZE, 12); this.vertexDataBuffer = vertexDataBuffer; this.shader = shader; this.vertexBufferObject = vertexBufferObject; this.viewMatrixLocation = viewMatrixLocation; this.maxVertices = max; this.polygonCache = []; this.resize(this.width, this.height, this.game.config.resolution); }, shouldFlush: function () { return false; }, isFull: function () { return (this.vertexDataBuffer.getByteLength() >= this.vertexDataBuffer.getByteCapacity()); }, bind: function (shader) { if (shader === undefined) { this.shader.bind(); } else { shader.bind(); this.resize(this.width, this.height, this.game.config.resolution, shader); } this.vertexBufferObject.bind(); }, flush: function (shader) { var gl = this.glContext; var vertexDataBuffer = this.vertexDataBuffer; if (this.vertexCount === 0) { return; } this.bind(shader); this.vertexBufferObject.updateResource(vertexDataBuffer.<API key>(), 0); gl.drawArrays(gl.TRIANGLES, 0, this.vertexCount); vertexDataBuffer.clear(); this.vertexCount = 0; }, resize: function (width, height, resolution, shader) { var activeShader = shader !== undefined ? shader : this.shader; this.width = width * resolution; this.height = height * resolution; activeShader.<API key>( this.viewMatrixLocation, new Float32Array([ 2 / this.width, 0, 0, 0, 0, -2 / this.height, 0, 0, 0, 0, 1, 1, -1, 1, 0, 0 ]) ); }, // Graphics Game Object properties // srcX, srcY, srcScaleX, srcScaleY, srcRotation, // line properties // ax, ay, bx, by, aLineWidth, bLineWidth, aLineColor, bLineColor, lineAlpha, // transform // a1, b1, c1, d1, e1, f1, // currentMatrix addLine: function (srcX, srcY, srcScaleX, srcScaleY, srcRotation, ax, ay, bx, by, aLineWidth, bLineWidth, aLineColor, bLineColor, lineAlpha, a1, b1, c1, d1, e1, f1, currentMatrix) { if (this.vertexCount + 6 > this.maxVertices) { this.flush(); } this.vertexCount += 6; var a0 = currentMatrix.matrix[0]; var b0 = currentMatrix.matrix[1]; var c0 = currentMatrix.matrix[2]; var d0 = currentMatrix.matrix[3]; var e0 = currentMatrix.matrix[4]; var f0 = currentMatrix.matrix[5]; var a = a1 * a0 + b1 * c0; var b = a1 * b0 + b1 * d0; var c = c1 * a0 + d1 * c0; var d = c1 * b0 + d1 * d0; var e = e1 * a0 + f1 * c0 + e0; var f = e1 * b0 + f1 * d0 + f0; var vertexDataBuffer = this.vertexDataBuffer; var vertexBufferF32 = vertexDataBuffer.floatView; var vertexBufferU32 = vertexDataBuffer.uintView; var dx = bx - ax; var dy = by - ay; var len = Math.sqrt(dx * dx + dy * dy); var al0 = aLineWidth * (by - ay) / len; var al1 = aLineWidth * (ax - bx) / len; var bl0 = bLineWidth * (by - ay) / len; var bl1 = bLineWidth * (ax - bx) / len; var lx0 = bx - bl0; var ly0 = by - bl1; var lx1 = ax - al0; var ly1 = ay - al1; var lx2 = bx + bl0; var ly2 = by + bl1; var lx3 = ax + al0; var ly3 = ay + al1; var x0 = lx0 * a + ly0 * c + e; var y0 = lx0 * b + ly0 * d + f; var x1 = lx1 * a + ly1 * c + e; var y1 = lx1 * b + ly1 * d + f; var x2 = lx2 * a + ly2 * c + e; var y2 = lx2 * b + ly2 * d + f; var x3 = lx3 * a + ly3 * c + e; var y3 = lx3 * b + ly3 * d + f; var vertexOffset = vertexDataBuffer.allocate(24); vertexBufferF32[vertexOffset++] = x0; vertexBufferF32[vertexOffset++] = y0; vertexBufferU32[vertexOffset++] = bLineColor; vertexBufferF32[vertexOffset++] = lineAlpha; vertexBufferF32[vertexOffset++] = x1; vertexBufferF32[vertexOffset++] = y1; vertexBufferU32[vertexOffset++] = aLineColor; vertexBufferF32[vertexOffset++] = lineAlpha; vertexBufferF32[vertexOffset++] = x2; vertexBufferF32[vertexOffset++] = y2; vertexBufferU32[vertexOffset++] = bLineColor; vertexBufferF32[vertexOffset++] = lineAlpha; vertexBufferF32[vertexOffset++] = x1; vertexBufferF32[vertexOffset++] = y1; vertexBufferU32[vertexOffset++] = aLineColor; vertexBufferF32[vertexOffset++] = lineAlpha; vertexBufferF32[vertexOffset++] = x3; vertexBufferF32[vertexOffset++] = y3; vertexBufferU32[vertexOffset++] = aLineColor; vertexBufferF32[vertexOffset++] = lineAlpha; vertexBufferF32[vertexOffset++] = x2; vertexBufferF32[vertexOffset++] = y2; vertexBufferU32[vertexOffset++] = bLineColor; vertexBufferF32[vertexOffset++] = lineAlpha; return [ x0, y0, bLineColor, x1, y1, aLineColor, x2, y2, bLineColor, x3, y3, aLineColor ]; }, // Graphics Game Object properties // srcX, srcY, srcScaleX, srcScaleY, srcRotation, // Path properties // path, lineWidth, lineColor, lineAlpha, // transform // a, b, c, d, e, f, // is last connection // isLastPath, // currentMatrix addStrokePath: function (srcX, srcY, srcScaleX, srcScaleY, srcRotation, path, lineWidth, lineColor, lineAlpha, a, b, c, d, e, f, isLastPath, currentMatrix) { var point0, point1; var pathLength = path.length; var polylines = this.polygonCache; var last, curr; var vertexDataBuffer = this.vertexDataBuffer; var vertexBufferF32 = vertexDataBuffer.floatView; var vertexBufferU32 = vertexDataBuffer.uintView; var vertexOffset; var line; for (var pathIndex = 0; pathIndex + 1 < pathLength; pathIndex += 1) { point0 = path[pathIndex]; point1 = path[pathIndex + 1]; line = this.addLine( srcX, srcY, srcScaleX, srcScaleY, srcRotation, point0.x, point0.y, point1.x, point1.y, point0.width / 2, point1.width / 2, point0.rgb, point1.rgb, lineAlpha, a, b, c, d, e, f, currentMatrix ); polylines.push(line); } /* Render joints */ for (var index = 1, polylinesLength = polylines.length; index < polylinesLength; ++index) { if (this.vertexCount + 6 > this.maxVertices) { this.flush(); } last = polylines[index - 1] || polylines[polylinesLength - 1]; curr = polylines[index]; vertexOffset = vertexDataBuffer.allocate(24); vertexBufferF32[vertexOffset++] = last[3 * 2 + 0]; vertexBufferF32[vertexOffset++] = last[3 * 2 + 1]; vertexBufferU32[vertexOffset++] = last[3 * 2 + 2]; vertexBufferF32[vertexOffset++] = lineAlpha; vertexBufferF32[vertexOffset++] = last[3 * 0 + 0]; vertexBufferF32[vertexOffset++] = last[3 * 0 + 1]; vertexBufferU32[vertexOffset++] = last[3 * 0 + 2]; vertexBufferF32[vertexOffset++] = lineAlpha; vertexBufferF32[vertexOffset++] = curr[3 * 3 + 0]; vertexBufferF32[vertexOffset++] = curr[3 * 3 + 1]; vertexBufferU32[vertexOffset++] = curr[3 * 3 + 2]; vertexBufferF32[vertexOffset++] = lineAlpha; vertexBufferF32[vertexOffset++] = last[3 * 0 + 0]; vertexBufferF32[vertexOffset++] = last[3 * 0 + 1]; vertexBufferU32[vertexOffset++] = last[3 * 0 + 2]; vertexBufferF32[vertexOffset++] = lineAlpha; vertexBufferF32[vertexOffset++] = last[3 * 2 + 0]; vertexBufferF32[vertexOffset++] = last[3 * 2 + 1]; vertexBufferU32[vertexOffset++] = last[3 * 2 + 2]; vertexBufferF32[vertexOffset++] = lineAlpha; vertexBufferF32[vertexOffset++] = curr[3 * 1 + 0]; vertexBufferF32[vertexOffset++] = curr[3 * 1 + 1]; vertexBufferU32[vertexOffset++] = curr[3 * 1 + 2]; vertexBufferF32[vertexOffset++] = lineAlpha; this.vertexCount += 6; } polylines.length = 0; }, // Graphics Game Object properties // srcX, srcY, srcScaleX, srcScaleY, srcRotation, // Path properties // path, fillColor, fillAlpha, // transform // a1, b1, c1, d1, e1, f1, // currentMatrix addFillPath: function (srcX, srcY, srcScaleX, srcScaleY, srcRotation, path, fillColor, fillAlpha, a1, b1, c1, d1, e1, f1, currentMatrix) { var length = path.length; var polygonCache = this.polygonCache; var polygonIndexArray; var point; var v0, v1, v2; var vertexOffset; var vertexCount = this.vertexCount; var maxVertices = this.maxVertices; var vertexDataBuffer = this.vertexDataBuffer; var vertexBufferF32 = vertexDataBuffer.floatView; var vertexBufferU32 = vertexDataBuffer.uintView; var x0, y0, x1, y1, x2, y2; var tx0, ty0, tx1, ty1, tx2, ty2; var a0 = currentMatrix.matrix[0]; var b0 = currentMatrix.matrix[1]; var c0 = currentMatrix.matrix[2]; var d0 = currentMatrix.matrix[3]; var e0 = currentMatrix.matrix[4]; var f0 = currentMatrix.matrix[5]; var a = a1 * a0 + b1 * c0; var b = a1 * b0 + b1 * d0; var c = c1 * a0 + d1 * c0; var d = c1 * b0 + d1 * d0; var e = e1 * a0 + f1 * c0 + e0; var f = e1 * b0 + f1 * d0 + f0; for (var pathIndex = 0; pathIndex < length; ++pathIndex) { point = path[pathIndex]; polygonCache.push(point.x, point.y); } polygonIndexArray = Earcut(polygonCache); length = polygonIndexArray.length; for (var index = 0; index < length; index += 3) { v0 = polygonIndexArray[index + 0] * 2; v1 = polygonIndexArray[index + 1] * 2; v2 = polygonIndexArray[index + 2] * 2; if (vertexCount + 3 > maxVertices) { this.vertexCount = vertexCount; this.flush(); vertexCount = 0; } vertexOffset = vertexDataBuffer.allocate(12); vertexCount += 3; x0 = polygonCache[v0 + 0]; y0 = polygonCache[v0 + 1]; x1 = polygonCache[v1 + 0]; y1 = polygonCache[v1 + 1]; x2 = polygonCache[v2 + 0]; y2 = polygonCache[v2 + 1]; tx0 = x0 * a + y0 * c + e; ty0 = x0 * b + y0 * d + f; tx1 = x1 * a + y1 * c + e; ty1 = x1 * b + y1 * d + f; tx2 = x2 * a + y2 * c + e; ty2 = x2 * b + y2 * d + f; vertexBufferF32[vertexOffset++] = tx0; vertexBufferF32[vertexOffset++] = ty0; vertexBufferU32[vertexOffset++] = fillColor; vertexBufferF32[vertexOffset++] = fillAlpha; vertexBufferF32[vertexOffset++] = tx1; vertexBufferF32[vertexOffset++] = ty1; vertexBufferU32[vertexOffset++] = fillColor; vertexBufferF32[vertexOffset++] = fillAlpha; vertexBufferF32[vertexOffset++] = tx2; vertexBufferF32[vertexOffset++] = ty2; vertexBufferU32[vertexOffset++] = fillColor; vertexBufferF32[vertexOffset++] = fillAlpha; } this.vertexCount = vertexCount; polygonCache.length = 0; }, // Graphics Game Object properties // srcX, srcY, srcScaleX, srcScaleY, srcRotation, // Rectangle properties // x, y, width, height, fillColor, fillAlpha, // transform // a1, b1, c1, d1, e1, f1, // currentMatrix addFillRect: function (srcX, srcY, srcScaleX, srcScaleY, srcRotation, x, y, width, height, fillColor, fillAlpha, a1, b1, c1, d1, e1, f1, currentMatrix) { if (this.vertexCount + 6 > this.maxVertices) { this.flush(); } var vertexDataBuffer = this.vertexDataBuffer; var vertexBufferF32 = vertexDataBuffer.floatView; var vertexBufferU32 = vertexDataBuffer.uintView; var vertexOffset = vertexDataBuffer.allocate(24); var xw = x + width; var yh = y + height; var a0 = currentMatrix.matrix[0]; var b0 = currentMatrix.matrix[1]; var c0 = currentMatrix.matrix[2]; var d0 = currentMatrix.matrix[3]; var e0 = currentMatrix.matrix[4]; var f0 = currentMatrix.matrix[5]; var a = a1 * a0 + b1 * c0; var b = a1 * b0 + b1 * d0; var c = c1 * a0 + d1 * c0; var d = c1 * b0 + d1 * d0; var e = e1 * a0 + f1 * c0 + e0; var f = e1 * b0 + f1 * d0 + f0; var tx0 = x * a + y * c + e; var ty0 = x * b + y * d + f; var tx1 = x * a + yh * c + e; var ty1 = x * b + yh * d + f; var tx2 = xw * a + yh * c + e; var ty2 = xw * b + yh * d + f; var tx3 = xw * a + y * c + e; var ty3 = xw * b + y * d + f; vertexBufferF32[vertexOffset++] = tx0; vertexBufferF32[vertexOffset++] = ty0; vertexBufferU32[vertexOffset++] = fillColor; vertexBufferF32[vertexOffset++] = fillAlpha; vertexBufferF32[vertexOffset++] = tx1; vertexBufferF32[vertexOffset++] = ty1; vertexBufferU32[vertexOffset++] = fillColor; vertexBufferF32[vertexOffset++] = fillAlpha; vertexBufferF32[vertexOffset++] = tx2; vertexBufferF32[vertexOffset++] = ty2; vertexBufferU32[vertexOffset++] = fillColor; vertexBufferF32[vertexOffset++] = fillAlpha; vertexBufferF32[vertexOffset++] = tx0; vertexBufferF32[vertexOffset++] = ty0; vertexBufferU32[vertexOffset++] = fillColor; vertexBufferF32[vertexOffset++] = fillAlpha; vertexBufferF32[vertexOffset++] = tx2; vertexBufferF32[vertexOffset++] = ty2; vertexBufferU32[vertexOffset++] = fillColor; vertexBufferF32[vertexOffset++] = fillAlpha; vertexBufferF32[vertexOffset++] = tx3; vertexBufferF32[vertexOffset++] = ty3; vertexBufferU32[vertexOffset++] = fillColor; vertexBufferF32[vertexOffset++] = fillAlpha; this.vertexCount += 6; }, // Graphics Game Object properties // srcX, srcY, srcScaleX, srcScaleY, srcRotation, // Triangle properties // x0, y0, x1, y1, x2, y2, fillColor, fillAlpha, // transform // a1, b1, c1, d1, e1, f1, // currentMatrix addFillTriangle: function (srcX, srcY, srcScaleX, srcScaleY, srcRotation, x0, y0, x1, y1, x2, y2, fillColor, fillAlpha, a1, b1, c1, d1, e1, f1, currentMatrix) { if (this.vertexCount + 3 > this.maxVertices) { this.flush(); } var a0 = currentMatrix.matrix[0]; var b0 = currentMatrix.matrix[1]; var c0 = currentMatrix.matrix[2]; var d0 = currentMatrix.matrix[3]; var e0 = currentMatrix.matrix[4]; var f0 = currentMatrix.matrix[5]; var a = a1 * a0 + b1 * c0; var b = a1 * b0 + b1 * d0; var c = c1 * a0 + d1 * c0; var d = c1 * b0 + d1 * d0; var e = e1 * a0 + f1 * c0 + e0; var f = e1 * b0 + f1 * d0 + f0; var vertexDataBuffer = this.vertexDataBuffer; var vertexBufferF32 = vertexDataBuffer.floatView; var vertexBufferU32 = vertexDataBuffer.uintView; var vertexOffset = vertexDataBuffer.allocate(12); var tx0 = x0 * a + y0 * c + e; var ty0 = x0 * b + y0 * d + f; var tx1 = x1 * a + y1 * c + e; var ty1 = x1 * b + y1 * d + f; var tx2 = x2 * a + y2 * c + e; var ty2 = x2 * b + y2 * d + f; vertexBufferF32[vertexOffset++] = tx0; vertexBufferF32[vertexOffset++] = ty0; vertexBufferU32[vertexOffset++] = fillColor; vertexBufferF32[vertexOffset++] = fillAlpha; vertexBufferF32[vertexOffset++] = tx1; vertexBufferF32[vertexOffset++] = ty1; vertexBufferU32[vertexOffset++] = fillColor; vertexBufferF32[vertexOffset++] = fillAlpha; vertexBufferF32[vertexOffset++] = tx2; vertexBufferF32[vertexOffset++] = ty2; vertexBufferU32[vertexOffset++] = fillColor; vertexBufferF32[vertexOffset++] = fillAlpha; this.vertexCount += 3; }, // Graphics Game Object properties // srcX, srcY, srcScaleX, srcScaleY, srcRotation, // Triangle properties // x0, y0, x1, y1, x2, y2, lineWidth, lineColor, lineAlpha, // transform // a, b, c, d, e, f, // currentMatrix addStrokeTriangle: function (srcX, srcY, srcScaleX, srcScaleY, srcRotation, x0, y0, x1, y1, x2, y2, lineWidth, lineColor, lineAlpha, a, b, c, d, e, f, currentMatrix) { var tempTriangle = this.tempTriangle; tempTriangle[0].x = x0; tempTriangle[0].y = y0; tempTriangle[0].width = lineWidth; tempTriangle[0].rgb = lineColor; tempTriangle[0].alpha = lineAlpha; tempTriangle[1].x = x1; tempTriangle[1].y = y1; tempTriangle[1].width = lineWidth; tempTriangle[1].rgb = lineColor; tempTriangle[1].alpha = lineAlpha; tempTriangle[2].x = x2; tempTriangle[2].y = y2; tempTriangle[2].width = lineWidth; tempTriangle[2].rgb = lineColor; tempTriangle[2].alpha = lineAlpha; tempTriangle[3].x = x0; tempTriangle[3].y = y0; tempTriangle[3].width = lineWidth; tempTriangle[3].rgb = lineColor; tempTriangle[3].alpha = lineAlpha; this.addStrokePath( srcX, srcY, srcScaleX, srcScaleY, srcRotation, tempTriangle, lineWidth, lineColor, lineAlpha, a, b, c, d, e, f, false, currentMatrix ); }, destroy: function () { this.manager.resourceManager.deleteShader(this.shader); this.manager.resourceManager.deleteBuffer(this.vertexBufferObject); this.shader = null; this.vertexBufferObject = null; } }); module.exports = ShapeBatch;