code
stringlengths
3
1.05M
repo_name
stringlengths
4
116
path
stringlengths
3
942
language
stringclasses
30 values
license
stringclasses
15 values
size
int32
3
1.05M
#!/bin/bash set -ex mkdir /chroot mkdir /chroot/bin mkdir /chroot/lib mkdir /chroot/lib64 mkdir /chroot/dev mkdir /chroot/tmp mkdir /chroot/var # # debootstrap # debootstrap saucy /chroot # busybox cp /bin/busybox /chroot/bin/sh cp /lib64/ld-linux-x86-64.so.2 /chroot/lib64/ld-linux-x86-64.so.2 cp /lib/x86_64-linux-gnu/libc.so.6 /chroot/lib/libc.so.6 # legacy-bridge cp /src/sandstorm-master/bin/legacy-bridge /chroot/ cp /usr/local/lib/libcapnp-rpc-0.5-dev.so /chroot/lib/libcapnp-rpc-0.5-dev.so cp /usr/local/lib/libkj-async-0.5-dev.so /chroot/lib/libkj-async-0.5-dev.so cp /usr/local/lib/libcapnp-0.5-dev.so /chroot/lib/libcapnp-0.5-dev.so cp /usr/local/lib/libkj-0.5-dev.so /chroot/lib/libkj-0.5-dev.so cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /chroot/lib/libstdc++.so.6 cp /lib/x86_64-linux-gnu/libm.so.6 /chroot/lib/libm.so.6 cp /lib/x86_64-linux-gnu/libgcc_s.so.1 /chroot/lib/libgcc_s.so.1 # shell go build -o /chroot/shell github.com/kevinwallace/sandstorm-shell/shell cp /lib/x86_64-linux-gnu/libpthread.so.0 /chroot/lib/libpthread.so.0 # manifest capnp eval -I /src/sandstorm-master/src -b /root/manifest.capnp manifest > /chroot/sandstorm-manifest # package spk pack /chroot /root/secret.key /output/shell.spk
kevinwallace/sandstorm-shell
make.sh
Shell
mit
1,231
# Wateruby Interesting twist of ruby language: YAML contains fragments of ruby, that can be composed. Compiles to ruby. Art of true metaprogramming and code generation. ## Installation Add this line to your application's Gemfile: ```ruby gem 'wateruby' ``` And then execute: $ bundle Or install it yourself as: $ gem install wateruby ## Usage ### Hello world example Create `hello.wateruby`: ```yaml language: ruby body: - puts "Hello, World" ``` Compiling to ruby: ``` $ wateruby hello.wateruby > hello.rb ``` Running ruby: ``` $ ruby hello.rb Hello, World ``` ### Greeter class example ```yaml language: ruby definitions: Greeter: define: class <%= name %> < Struct.new(:greeting) definitions: greet: define: def <%= name %>(name) body: - "#{greeting}, #{name}!" body: - puts Greeter.new("hello").greet("world") ``` ### Inline method call This is required when you are dealing with decorators for almost all methods in your system: they need to be ridicuously light - this makes method call cost very relevant, so you want to have as least as possible of them. ```yaml language: ruby definitions: Contract: define: class <%= name %> definitions: self.make_validator: define: def <%= name %>(contract) body: - klass = contract.class - | <%= inline("self.proc_contract", contract, klass) %> || <%= inline("self.array_contract", contract, klass) %> || <%= inline("self.hash_contract", contract, klass) %> || <%= inline("self.args_contract", contract, klass) %> || <%= inline("self.func_contract", contract, klass) %> || <%= inline("self.default_contract", contract, klass) %> self.proc_contract: # e.g. lambda {true} inlinable: true define: def <%= name %>(contract, its_klass) pre: its_klass == Proc body: contract self.array_contract: # e.g. [Num, String] # TODO: account for these errors too inlinable: true define: def <%= name %>(contract, its_klass) pre: klass == Array body: | lambda do |arg| return false unless arg.is_a?(Array) && arg.length == contract.length arg.zip(contract).all? do |_arg, _contract| Contract.valid?(_arg, _contract) end end # and so on.. ``` ## Contributing 1. Fork it ( https://github.com/waterlink/wateruby/fork ) 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create a new Pull Request
waterlink/wateruby
README.md
Markdown
mit
2,721
#ifndef V_Phi_Error_Calculator_h #define V_Phi_Error_Calculator_h #include "Intensity_Moment_Data.h" #include "Cell_Data.h" #include "Fem_Quadrature.h" #include "Input_Reader.h" #include <algorithm> /** @file V_Phi_Error_Calculator.h * @author pmaginot * @brief Base class to implement interface for various measures to assess convergence of phi: L1, L2 , rho normalized L1, rho normalized L2, pointwise convergence check */ class V_Phi_Error_Calculator { public: V_Phi_Error_Calculator( const Fem_Quadrature& fem_quadrature, const Cell_Data& cell_data, const Angular_Quadrature& angular_quadrature); virtual ~V_Phi_Error_Calculator(){} virtual double calculate_phi_error_norm(const Intensity_Moment_Data& phi_new , const Intensity_Moment_Data& phi_old, const int iter) = 0; protected: const int m_n_cell; const int m_n_groups; const int m_n_l_mom; const int m_n_el; }; #endif
pgmaginot/DARK_ARTS
src/solvers/V_Phi_Error_Calculator.h
C
mit
953
package ui import ( "image" "image/color" "image/draw" ) // UI represents an instance of the UI type UI struct { component WindowTitle string Input Input keyFuncs map[Key]func() error prevX, prevY int } // New creates a new UI instance func New(width, height int) *UI { rect := image.Rect(0, 0, width, height) ui := UI{ WindowTitle: "ui window", keyFuncs: make(map[Key]func() error), } ui.Dimension = Dimension{Width: width, Height: height} ui.Image = image.NewRGBA(rect) return &ui } // AddKeyFunc registers a function to run on key press func (ui *UI) AddKeyFunc(key Key, fnc func() error) { ui.keyFuncs[key] = fnc } // Update is called on every frame from the ebiten.Run update callback func (ui *UI) Update() error { ui.Input.updateMouse() ui.handleClick() if err := ui.handleKeypress(); err != nil { return err } return nil } // SetWindowTitle sets the title of the application window func (ui *UI) SetWindowTitle(s string) { ui.WindowTitle = s } // AddComponent adds a component to the ui func (ui *UI) AddComponent(o Component) { ui.addChild(o) } // Render returns a fresh frame of the GUI. mx, my is absolute mouse position func (ui *UI) Render() image.Image { mx := ui.Input.X my := ui.Input.Y if ui.isChildrenClean() { if mx == ui.prevX && my == ui.prevY { return ui.Image } if (mx < 0 || mx > ui.Dimension.Width) || (my < 0 || my > ui.Dimension.Height) { // cursor outside window will not change hover state return ui.Image } } ui.prevX = mx ui.prevY = my whole := image.Rect(0, 0, ui.Dimension.Width, ui.Dimension.Height) draw.Draw(ui.Image, whole, &image.Uniform{color.Transparent}, image.ZP, draw.Src) ui.drawChildren(mx, my) ui.drawTooltips(mx, my) return ui.Image } // mx, my is absolute mouse position func (ui *UI) drawTooltips(mx, my int) { for _, child := range ui.children { if grp, ok := child.(*Group); ok { for _, gchild := range grp.children { ui.drawTooltip(gchild, mx, my, mx-grp.Position.X, my-grp.Position.Y) } } ui.drawTooltip(child, mx, my, mx, my) } } func (ui *UI) drawTooltip(child Component, mx, my, relx, rely int) { r := child.GetBounds() child.Hover(relx >= r.Min.X && relx <= r.Max.X && rely >= r.Min.Y && rely <= r.Max.Y) tooltip := child.Tooltip() if child.IsMouseOver() && tooltip != nil { tooltip.Move(mx, my) tr := tooltip.GetBounds() draw.Draw(ui.Image, tr, tooltip.Draw(relx, rely), image.ZP, draw.Over) } } // IsClean returns true if all UI components are clean func (ui *UI) IsClean() bool { for _, c := range ui.children { if !c.IsClean() { return false } } return true } // handleKeypress runs corresponding function when a key is pressed func (ui *UI) handleKeypress() error { ui.Input.updateKeyboard() for key, fnc := range ui.keyFuncs { if ui.Input.StateForKey(key) { if err := fnc(); err != nil { return err } } } return nil }
martinlindhe/gameui
ui.go
GO
mit
2,922
# frozen_string_literal: true require 'basquiat/adapters/rabbitmq_adapter' RSpec.describe Basquiat::Adapters::RabbitMq do subject(:adapter) { Basquiat::Adapters::RabbitMq.new } let(:base_options) do { connection: { hosts: [ENV.fetch('BASQUIAT_RABBITMQ_1_PORT_5672_TCP_ADDR') { 'localhost' }], port: ENV.fetch('BASQUIAT_RABBITMQ_1_PORT_5672_TCP_PORT') { 5672 } }, publisher: { persistent: true } } end context 'RabbitMQ interactions' do before(:each) do adapter.adapter_options(base_options) adapter.reset_connection end after(:each) do remove_queues_and_exchanges end context 'publisher' do context 'main process' do it '#publish [enqueue a message]' do expect do adapter.publish('messages.welcome', data: 'A Nice Welcome Message') end.to_not raise_error end end context 'multiple threads' do let(:base_options) do { connection: { hosts: [ENV.fetch('BASQUIAT_RABBITMQ_1_PORT_5672_TCP_ADDR') { 'localhost' }], port: ENV.fetch('BASQUIAT_RABBITMQ_1_PORT_5672_TCP_PORT') { 5672 } }, publisher: { persistent: true, session_pool: { size: 10 } } } end before { Basquiat.configure { |c| c.connection = Bunny.new.tap(&:start) } } it '#publish [enqueue a message 10 times concurrently]' do expect do threads = [] 10.times do threads << Thread.new { adapter.publish('messages.welcome', data: 'A Nice Welcome Message') } end threads.each(&:join) end.not_to raise_error end after { Basquiat.configure { |c| c.connection = nil } } end end context 'listener' do it 'runs the rescue block when an exception happens' do coisa = '' adapter.subscribe_to('some.event', ->(_msg) { raise ArgumentError }) adapter.listen(block: false, rescue_proc: ->(ex, _msg) { coisa = ex.class.to_s }) adapter.publish('some.event', data: 'coisa') sleep 0.3 expect(coisa).to eq('ArgumentError') end it '#subscribe_to some event' do message = '' adapter.subscribe_to('some.event', ->(msg) { message = msg[:data].upcase }) adapter.listen(block: false) adapter.publish('some.event', data: 'message') sleep 0.3 expect(message).to eq('MESSAGE') end end it '#subscribe_to other.event with #' do message_received = '' subject.subscribe_to('other.event.#', ->(msg) { message_received = msg[:data].upcase }) subject.listen(block: false) subject.publish('other.event.test', data: 'some stuff') sleep 0.3 expect(message_received).to eq('SOME STUFF') end end def remove_queues_and_exchanges adapter.session.queue.delete adapter.session.exchange.delete rescue Bunny::TCPConnectionFailed true ensure adapter.send(:disconnect) end end
VAGAScom/basquiat
spec/lib/adapters/rabbitmq_adapter_spec.rb
Ruby
mit
3,032
/** * Created by raynald on 8/22/14. */ App.Collections.Contacts = Backbone.Collection.extend({ model : App.Models.Contact, localStorage: new Backbone.LocalStorage('my-contacts') });
raynaldmo/my-contacts
v1/public/js/collection/Contacts.js
JavaScript
mit
189
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2016.09.02 at 01:00:06 PM UYT // package dgi.classes.respuestas.reporte; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for RSAKeyValueType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="RSAKeyValueType"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="Modulus" type="{http://www.w3.org/2000/09/xmldsig#}CryptoBinary"/> * &lt;element name="Exponent" type="{http://www.w3.org/2000/09/xmldsig#}CryptoBinary"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "RSAKeyValueType", propOrder = { "modulus", "exponent" }) public class RSAKeyValueType { @XmlElement(name = "Modulus", required = true) protected byte[] modulus; @XmlElement(name = "Exponent", required = true) protected byte[] exponent; /** * Gets the value of the modulus property. * * @return * possible object is * byte[] */ public byte[] getModulus() { return modulus; } /** * Sets the value of the modulus property. * * @param value * allowed object is * byte[] */ public void setModulus(byte[] value) { this.modulus = value; } /** * Gets the value of the exponent property. * * @return * possible object is * byte[] */ public byte[] getExponent() { return exponent; } /** * Sets the value of the exponent property. * * @param value * allowed object is * byte[] */ public void setExponent(byte[] value) { this.exponent = value; } }
nicoribeiro/java_efactura_uy
app/dgi/classes/respuestas/reporte/RSAKeyValueType.java
Java
mit
2,365
# Multilingual ShapeWorld ### Table of content - [Dependency Minimal Recursion Semantics (DMRS)](#dependency-minimal-recursion-semantics-dmrs) - [Linearized DMRS Notation (LDN)](#linearized-dmrs-notation-ldn) + [How to go from MRS to DMRS using LDN](#how-to-go-from-mrs-to-dmrs-using-ldn) - [How to integrate the grammar for another language](#how-to-integrate-the-grammar-for-another-language) + [Caption components](#caption-components) - [Links and references](#links-and-references) ## Dependency Minimal Recursion Semantics (DMRS) DMRS is a graph representation of MRS structures. The transformation to and from DMRS is essentially an equivalence conversion (if the MRS satisfies a few basic assumptions). More information can be found [here](http://www.aclweb.org/anthology/E/E09/E09-1001.pdf) or, more recently, [here](http://www.lrec-conf.org/proceedings/lrec2016/pdf/634_Paper.pdf). There is a DMRS demo website available for some grammars (for instance, [ERG](http://chimpanzee.ling.washington.edu/demophin/erg/) for English, [Jacy](http://chimpanzee.ling.washington.edu/demophin/jacy/) for Japanese, [Zhong](http://chimpanzee.ling.washington.edu/demophin/zhong/) for Mandarin Chinese), where one can parse natural language sentences and inspect the visualized DMRS graph representation. ## Linearized DMRS Notation (LDN) LDN is a formalism to specify DMRS graphs in a linearized string form, with the aim to be easily read- and writable by humans. In particular, it simplifies the definition of small, potentially underspecified or otherwise constrained DMRS subgraph snippets, which can be used, for instance, to express DMRS graph search queries, DMRS paraphrase or simplification rules, or in general graph mappings of any kind. A one-page overview over the formalism can be found [here](https://www.cl.cam.ac.uk/~aok25/files/graphlang_overview.pdf). ### How to go from MRS to DMRS using LDN In this informal walkthrough we will look at the English example sentence *"There are three squares"*. Parsed by ACE using the ERG, we get the following MRS structure: ``` [ LTOP: h0 INDEX: e2 RELS: < [ _be_v_there LBL: h1 ARG0: e2 [ e SF: prop TENSE: pres MOOD: indicative PROG: - PERF: - ] ARG1: x4 ] [ udef_q LBL: h5 ARG0: x4 RSTR: h6 BODY: h7 ] [ card LBL: h8 CARG: "3" ARG0: e10 [ e SF: prop TENSE: untensed MOOD: indicative PERF: - PROG: - ] ARG1: x4 ] [ _square_n_of LBL: h8 ARG0: x4 [ x PERS: 3 NUM: pl GEND: n IND: + ] ARG1: i11 ] > HCONS: < h0 qeq h1 h6 qeq h8 > ICONS: < > ] ``` First, each MRS elementary predication (EP) is a node in the DMRS graph, with their intrinsic `ARG0` variable being the node variable. Here, quantifier EPs (and only them) are treated differently in that they do not have their own variable, since they are unambiguously associated with the instance variable of another EP. A `CARG` (constant argument) is represented as suffix to the predicate, enclosed in brackets. This gives us the following list of DMRS nodes in LDN: ``` _be_v_there e[sf=prop,tense=pres,mood=indicative,perf=-,prog=-] udef_q card(3) e[sf=prop,tense=untensed,mood=indicative,perf=-,prog=-] _square_n_of x[pers=3,num=pl,gend=n,ind=+] ``` For the other arguments `ARG#` of an EP (`#` a number in 1-4), there are two possibilities. On the one hand, they might point to another node variable and hence the corresponding node, which is indicated by a link `-#->` if they do not share the same label `LBL`, or `=#=>` if they do share a label. On the other hand, they might point to a label, which is indicated by a link `-#h->` or `=#h=>` to the node corresponding to the head EP of EPs with this label. Finally, some EPs (e.g., quantifiers or connectives) have special values which, accordingly, are indicated by special link types: `RSTR` as `-->`, `#-INDEX` as `-#->` or `=#=>`, `#-HNDL` as `-#h->` or `=#h=>` (`#` either `l` or `r`). Consequently, we can start with the following DMRS graph representation of the above sentence in LDN: ``` udef_q --> _square_n_of x[pers=3,num=pl,gend=n,ind=+] <=1= card(3) e ``` To be able to represent links for a node which is in more than two relations to other nodes, once introduced they can be referred to via repeating its predicate string (without variable definition) with a leading colon. That enables us to express the second part of the LDN representation: ``` :_square_n_of <-1- _be_v_there e[sf=prop,tense=pres,mood=indicative,perf=-,prog=-] ``` Alternatively, nodes can be annotated with and referred to by an identifier prefixing the colon, which we will do in the following full LDN representation. Both parts are combined with a newline or semicolon, and the top handle `LTOP` and index variable `INDEX` is annotated with `***`: ``` udef_q --> entity:_square_n_of x[pers=3,num=pl,gend=n,ind=+] <=1= card(3) e ; :entity <-1- ***_be_v_there e[sf=prop,tense=pres,mood=indicative,perf=-,prog=-] ``` For the application in a compositional generation system, we need to match and unify nodes in different DMRS snippets. This is done by indicating an anchor node (possibly underspecified, compare `pred`, `x?`, `node` in the lines below) with square brackets around its identifier. We can, for instance, define a snippet for the quantifier *"three"* as follows: ``` udef_q --> [entity]:pred x?[num=pl] <=1= card(3) e ``` The corresponding snippet for the noun *"square"* is given by: ``` [entity]:_square_n_of x?[pers=3,ind=+] ``` ## How to integrate the grammar for another language To be able to generate language data in another language, you need to provide the grammar file `[LANGUAGE].dat` for the language and an identically named JSON file `[LANGUAGE].json` in this directory `shapeworld/realizers/dmrs/languages/` (see command line below). The latter mainly specifies the mapping of the ShapeWorld-internal semantic objects (attributes, relations, quantifiers, etc) to DMRS subgraphs corresponding to the MRS representation of this concept for the language in question. Moreover, it specifies the features of the sortinfo variables in the grammar and potential post-processing paraphrase rules (which, for instance, can be useful for certain language peculiarities not consistent with the composition system of the ShapeWorld framework). The directory contains both the files for the [default English version](https://github.com/AlexKuhnle/ShapeWorld/blob/master/shapeworld/realizers/dmrs/languages/english.json) as well as a [minimal specification](https://github.com/AlexKuhnle/ShapeWorld/blob/master/shapeworld/realizers/dmrs/languages/minimal.json) (for English) only containing the necessary components for very basic existential statements. This file is thought of as a starting point for other languages. First, run the following command line from the main ShapeWorld directory for your grammar (for instance, `[LANGUAGE]` being `english` and `[PATH_TO_ACE_CONFIG_TDL]` as `.../erg/ace/config.tdl`): ```bash .../ShapeWorld$ shapeworld/realizers/dmrs/languages/integrate_language.sh [LANGUAGE] [PATH_TO_ACE_CONFIG_TDL] ``` This compiles the grammar with the version of ACE ShapeWorld is using, and copies the minimal specification file accordingly. After *'translating'* the English DMRS snippets in there, it should be possible to run the following command line to generate your first data: ```bash .../ShapeWorld$ python generate.py -d [DATA_DIRECTORY] -t agreement -n multishape -l [LANGUAGE] -H ``` This should be sufficient to be able to extend the language file further, where the [full English specification file](https://github.com/AlexKuhnle/ShapeWorld/blob/master/shapeworld/realizers/dmrs/languages/english.json) then serves as guidance for what other entries can be included. If you encounter any problems, please let me know. ### Caption components The following paragraphs describe the ShapeWorld-internal caption components and give examples from the default ERG-based English language specification file. (Side note: Some of the terminology (for instance, *'noun'*) might be inspired by English, but this does not necessarily mean that the corresponding components are restricted in that way.) #### Attributes Attribute DMRS snippets are required to indicate the head *'modifier'* node with a `[attr]` identifier and the head *'noun'* node via `[type]`. For instance, the attribute *"red"* is defined as `[attr]:_red_a_sw e? =1=> [type]:node` for English. Note that both identifiers might apply to the same node, as is the case for the attribute *"square"* in English: `[attr,type]:_square_n_sw x?[pers=3]`. Furthermore, there are two special *'attribute'* entries, the *'empty'* unspecified type, in English *"shape"* given by `[attr,type]:_shape_n_sw x?[pers=3]`, and one turning a relation (see below) into an attribute, in English via a relative clause specified by `[attr]:pred e[ppi--] =1=> [type]:node`. #### Entity types Entity types are a conjunctive combination of attributes. Their DMRS representation is obtained as composition of the corresponding attribute DMRS snippets by unifying their nodes labeled as `[type]`. Consequently, there are no *'atomic'* type DMRS snippets. #### Relations Relation DMRS snippets are required to indicate the head relation node via `[rel]` and the head *'reference'* node with `[ref]`. An example from the specification for English is the relation *"to the left of something"*, which is defined as `[rel]:_to_p e? -2-> _left_n_of x[num=s] <-- _the_q; :_left_n_of <=1= _of_p e -2-> [ref]:node <-- _a_q`. There are again two special relation entries for turning an attribute or type into a relation. For English, they are defined as `[rel]:_be_v_id e? -2-> [ref]:_shape_n_sw x? <-- default_q` and `[rel]:_be_v_id e? -2-> [ref]:node <-- default_q`, respectively, both defining an *"is a"* pattern. #### Existential The special *existential* entry combines the restrictor type and the body relation, and just expresses that *"there is such an entity"*, in English defined as `_a_q --> [rstr]:pred x?[num=s] <-1- [body]:node`. #### Quantifiers ... #### Comparative quantifiers ... #### Propositions There is a special entry for each of the above components which turns it into the simplest form of a full proposition. Each of them is composed by fusing node identifier of the same name, so `[type]` with `[type]` etc. In English, for entity types this is a *"there is a"* statement given by `***[head]:_be_v_there e[ppi--] -1-> [type]:pred x? <-- _a_q`, and for the existential quantifier it is given by `***[head,body]:pred e[ppi--]`. ## Links and references #### Tools - [DMRS demo website](http://chimpanzee.ling.washington.edu/demophin/erg/) - [MRS/EDS/DM demo website](http://erg.delph-in.net/logon) - [pydmrs](https://github.com/delph-in/pydmrs), with a visualization tool for DMRS in XML format under `pydmrs/visualization/index.html` - [PyDelphin](https://github.com/delph-in/pydelphin), by *Michael Goodman* #### Parser/generator - [Answer Constraint Engine](http://sweaglesw.org/linguistics/ace/), by *Woodley Packard* #### Grammars - [English Resource Grammar](http://www.delph-in.net/erg/), by *Dan Flickinger* - [Zhong](http://moin.delph-in.net/ZhongTop) ([GitHub](https://github.com/delph-in/zhong)), by *Zhenzhen Fan, Sanghoun Song, and Francis Bond*
AlexKuhnle/ShapeWorld
shapeworld/realizers/dmrs/languages/README.md
Markdown
mit
11,341
package org.scalajs.openui5.sap.m import org.scalajs.openui5.sap.ui.core.{CSSSize, Wrapping} import org.scalajs.openui5.util.{Settings, SettingsMap, noSettings} import scala.scalajs.js import scala.scalajs.js.annotation.{JSName, ScalaJSDefined} @ScalaJSDefined trait TextAreaSettings extends InputBaseSettings object TextAreaSettings extends TextAreaSettingsBuilder(noSettings) class TextAreaSettingsBuilder(val dict: SettingsMap) extends Settings[TextAreaSettings, TextAreaSettingsBuilder](new TextAreaSettingsBuilder(_)) with TextAreaSetters[TextAreaSettings, TextAreaSettingsBuilder] trait TextAreaSetters[T <: js.Object, B <: Settings[T, _]] extends InputBaseSetters[T, B] { def rows(v: Int) = setting("rows", v) def cols(v: Int) = setting("cols", v) def height(v: CSSSize) = setting("height", v) def maxLength(v: Int) = setting("maxLength", v) def wrapping(v: Wrapping) = setting("wrapping", v) def valueLiveUpdate(v: Boolean) = setting("valueLiveMapping", v) def liveChange(v: js.Function) = setting("liveChange", v) } @JSName("sap.m.TextArea") @js.native class TextArea(id: js.UndefOr[String] = js.native, settings: js.UndefOr[TextAreaSettings] = js.native) extends InputBase { def this(id: String) = this(id, js.undefined) def this(settings: TextAreaSettings) = this(js.undefined, settings) }
lastsys/scalajs-openui5
src/main/scala/org/scalajs/openui5/sap/m/TextArea.scala
Scala
mit
1,347
using UnityEngine; using System.Collections; namespace Com.LuisPedroFonseca.ProCamera2D.TopDownShooter { public class EnemyAttack : MonoBehaviour { public float RotationSpeed = 2f; public Pool BulletPool; public Transform WeaponTip; public float FireRate = .3f; public float FireAngleRandomness = 10f; bool _hasTarget; Transform _target; NavMeshAgent _navMeshAgent; Transform _transform; void Awake() { _transform = transform; _navMeshAgent = this.GetComponentInChildren<NavMeshAgent>(); } public void Attack(Transform target) { _navMeshAgent.updateRotation = false; _target = target; _hasTarget = true; StartCoroutine(LookAtTarget()); StartCoroutine(FollowTarget()); StartCoroutine(Fire()); } public void StopAttack() { _navMeshAgent.updateRotation = true; _hasTarget = false; } IEnumerator LookAtTarget() { while (_hasTarget) { var lookAtPos = new Vector3(_target.position.x, _transform.position.y, _target.position.z); var diff = lookAtPos - _transform.position; var newRotation = Quaternion.LookRotation(diff, Vector3.up); _transform.rotation = Quaternion.Slerp(_transform.rotation, newRotation, RotationSpeed * Time.deltaTime); yield return null; } } IEnumerator FollowTarget() { while (_hasTarget) { var rnd = Random.insideUnitCircle; _navMeshAgent.destination = _target.position - (_target.position - _transform.position).normalized * 5f + new Vector3(rnd.x, 0, rnd.y); yield return null; } } IEnumerator Fire() { while (_hasTarget) { var bullet = BulletPool.nextThing; bullet.transform.position = WeaponTip.position; bullet.transform.rotation = _transform.rotation * Quaternion.Euler(new Vector3(0, -90 + Random.Range(-FireAngleRandomness, FireAngleRandomness), 0)); yield return new WaitForSeconds(FireRate); } } public static Vector2 RandomOnUnitCircle2(float radius) { Vector2 randomPointOnCircle = Random.insideUnitCircle; randomPointOnCircle.Normalize(); randomPointOnCircle *= radius; return randomPointOnCircle; } } }
LabGaming/Locally-multiplayer-minigame
Assets/ProCamera2D/Examples/TopDownShooter/Scripts/Enemy/EnemyAttack.cs
C#
mit
2,675
import * as React from 'react'; import { Ratings, Mode, Size, Layout } from '..'; import * as examples from './examples'; import { header, api, divider, importExample, playground, tab, code as baseCode, tabs, testkit, title, } from 'wix-storybook-utils/Sections'; import { allComponents } from '../../../../stories/utils/allComponents'; import { settingsPanel } from '../../../../stories/utils/SettingsPanel'; import { settingsApi } from '../../../../stories/utils/SettingsApi'; import * as ExtendedRawSource from '!raw-loader!./RatingsExtendedExample.tsx'; import * as ExtendedCSSRawSource from '!raw-loader!./RatingsExtendedExample.st.css'; import { RatingsExtendedExample } from './RatingsExtendedExample'; import { StoryCategory } from '../../../../stories/storyHierarchy'; const code = (config) => baseCode({ components: allComponents, compact: true, ...config }); export default { category: StoryCategory.COMPONENTS, storyName: 'Ratings', component: Ratings, componentPath: '../Ratings.tsx', componentProps: () => ({ 'data-hook': 'storybook-Ratings', }), exampleProps: { mode: Object.values(Mode), size: Object.values(Size), layout: Object.values(Layout), inputOptions: [ { value: [], label: 'no hovers' }, { value: ['Very Baasa', 'Baasa', 'OK', 'Achla', 'Very Achla'], label: 'with hovers', }, ], }, dataHook: 'storybook-Ratings', sections: [ header(), tabs([ tab({ title: 'Usage', sections: [ importExample({ source: examples.importExample, }), divider(), title('Examples'), ...[{ title: 'mode="input"', source: examples.defult }].map(code), ...[ { title: 'mode="input" with inputOptions', source: examples.inputWithValue, }, ].map(code), ...[{ title: 'mode="display"', source: examples.defaultDisplay }].map( code, ), ...[ { title: 'mode="display" with labels', source: examples.displayWithLables, }, ].map(code), ], }), ...[ { title: 'API', sections: [api()] }, { title: 'Style API', sections: [settingsApi()] }, { title: 'TestKit', sections: [testkit()] }, { title: 'Playground', sections: [playground()] }, { title: 'Settings Panel', sections: [ settingsPanel({ title: 'Settings Panel', example: <RatingsExtendedExample />, rawSource: ExtendedRawSource, rawCSSSource: ExtendedCSSRawSource, params: { colors: [ { label: 'Icon Color', wixParam: 'iconColor', defaultColor: 'color-8', }, { label: 'Icon Empty Color', wixParam: 'iconEmptyColor', defaultColor: 'color-3', }, { label: 'Text Color', wixParam: 'textColor', defaultColor: 'color-5', }, ], }, }), ], }, ].map(tab), ]), ], };
wix/wix-style-react
packages/wix-ui-tpa/src/components/Ratings/docs/index.story.tsx
TypeScript
mit
3,405
import * as path from 'path'; import { EmptyTree } from '@angular-devkit/schematics'; import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing'; describe('Update 6.1.0', () => { let appTree: UnitTestTree; const schematicRunner = new SchematicTestRunner('ig-migrate', path.join(__dirname, '../migration-collection.json')); const configJson = { defaultProject: 'testProj', projects: { testProj: { sourceRoot: '/testSrc' } }, schematics: { '@schematics/angular:component': { prefix: 'appPrefix' } } }; beforeEach(() => { appTree = new UnitTestTree(new EmptyTree()); appTree.create('/angular.json', JSON.stringify(configJson)); }); it('should update igxToggle events and selectors', async () => { appTree.create( '/testSrc/appPrefix/component/test.component.html', `<igx-tab-bar attr igxForRemote="true"></igx-tab-bar>` + `<elem igxToggle (onOpen)="handler" (onClose)="handler"></elem>` ); const tree = await schematicRunner.runSchematicAsync('migration-04', {}, appTree) .toPromise(); expect(tree.readContent('/testSrc/appPrefix/component/test.component.html')) .toEqual( `<igx-bottom-nav attr></igx-bottom-nav>` + `<elem igxToggle (onOpened)="handler" (onClosed)="handler"></elem>`); }); });
Infragistics/zero-blocks
projects/igniteui-angular/migrations/update-6_1/index.spec.ts
TypeScript
mit
1,517
# Minion_Game This is a project for a game that I currently work on with a friend. We decided to use github to enable both of us to work on the project simultaneously. Due to the way githubs payment model works, we decided to upload the code into a public repository, while keeping compilation instructions and assets private using different systems.
dwarfofdawn/Minion_Game
README.md
Markdown
mit
352
package cn.jzvd.demo; import android.content.Context; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.LayoutInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.AbsListView; import android.widget.BaseAdapter; import android.widget.ListView; import android.widget.TextView; import com.bumptech.glide.Glide; import cn.jzvd.Jzvd; import cn.jzvd.JzvdStd; /** * Created by Nathen * On 2016/05/23 21:34 */ public class ActivityListViewMultiHolder extends AppCompatActivity { ListView listView; VideoListAdapter mAdapter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_listview_normal); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(true); getSupportActionBar().setDisplayShowTitleEnabled(true); getSupportActionBar().setDisplayUseLogoEnabled(false); getSupportActionBar().setTitle("MultiHolderListView"); listView = findViewById(R.id.listview); mAdapter = new VideoListAdapter(this); listView.setAdapter(mAdapter); listView.setOnScrollListener(new AbsListView.OnScrollListener() { @Override public void onScrollStateChanged(AbsListView view, int scrollState) { } @Override public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { if (Jzvd.CURRENT_JZVD == null) return; int lastVisibleItem = firstVisibleItem + visibleItemCount; int currentPlayPosition = Jzvd.CURRENT_JZVD.positionInList; // Log.e(TAG, "onScrollReleaseAllVideos: " + // currentPlayPosition + " " + firstVisibleItem + " " + currentPlayPosition + " " + lastVisibleItem); if (currentPlayPosition >= 0) { if ((currentPlayPosition < firstVisibleItem || currentPlayPosition > (lastVisibleItem - 1))) { if (Jzvd.CURRENT_JZVD.screen != Jzvd.SCREEN_FULLSCREEN) { Jzvd.releaseAllVideos();//为什么最后一个视频横屏会调用这个,其他地方不会 } } } } }); } @Override public void onBackPressed() { if (Jzvd.backPress()) { return; } super.onBackPressed(); } @Override protected void onPause() { super.onPause(); Jzvd.releaseAllVideos(); } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: finish(); break; } return super.onOptionsItemSelected(item); } public class VideoListAdapter extends BaseAdapter { int[] viewtype = {0, 0, 0, 1, 0, 0, 0, 1, 0, 0};//1 = jzvdStd, 0 = textView Context context; LayoutInflater mInflater; public VideoListAdapter(Context context) { this.context = context; mInflater = LayoutInflater.from(context); } @Override public int getCount() { return viewtype.length; } @Override public Object getItem(int position) { return null; } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { if (getItemViewType(position) == 1) { VideoHolder viewHolder; if (convertView != null && convertView.getTag() != null && convertView.getTag() instanceof VideoHolder) { viewHolder = (VideoHolder) convertView.getTag(); } else { viewHolder = new VideoHolder(); convertView = mInflater.inflate(R.layout.item_videoview, null); viewHolder.jzvdStd = convertView.findViewById(R.id.videoplayer); convertView.setTag(viewHolder); } viewHolder.jzvdStd.setUp( VideoConstant.videoUrls[0][position], VideoConstant.videoTitles[0][position], Jzvd.SCREEN_NORMAL); viewHolder.jzvdStd.positionInList = position; Glide.with(ActivityListViewMultiHolder.this) .load(VideoConstant.videoThumbs[0][position]) .into(viewHolder.jzvdStd.thumbImageView); } else { TextViewHolder textViewHolder; if (convertView != null && convertView.getTag() != null && convertView.getTag() instanceof TextViewHolder) { textViewHolder = (TextViewHolder) convertView.getTag(); } else { textViewHolder = new TextViewHolder(); LayoutInflater mInflater = LayoutInflater.from(context); convertView = mInflater.inflate(R.layout.item_textview, null); textViewHolder.textView = convertView.findViewById(R.id.textview); convertView.setTag(textViewHolder); } } return convertView; } @Override public int getItemViewType(int position) { return viewtype[position]; } @Override public int getViewTypeCount() { return 2; } class VideoHolder { JzvdStd jzvdStd; } class TextViewHolder { TextView textView; } } }
lipangit/JiaoZiVideoPlayer
app/src/main/java/cn/jzvd/demo/ActivityListViewMultiHolder.java
Java
mit
5,869
const assert = require('assert')
airtoxin/elekiter
test/index.js
JavaScript
mit
33
// @public import RavenType = require('raven-js'); import {Breadcrumb, CaptureOptions, User} from './interface'; export {Breadcrumb, CaptureOptions, User}; let output = { enabled: false, captureException(ex: Error, options?: CaptureOptions) {}, context<T>(fn: () => T): T { return fn(); }, wrap<TFunc extends Function>(fn: TFunc): TFunc { return fn; }, setUserContext(user?: User) {}, captureMessage(message: string, options?: CaptureOptions) {}, captureBreadcrumb(crumb: Breadcrumb) {}, showReportDialog(options?: {eventId?: string}) {}, }; if (process.env.SENTRY_DSN_CLIENT || process.env.SENTRY_DSN) { const Raven = require('raven-js') as typeof RavenType; Raven.config( (process.env.SENTRY_DSN_CLIENT || process.env.SENTRY_DSN)!, ).install(); (window as any).onunhandledrejection = function(e: any) { if (Raven) { Raven.captureException(e.reason); } }; output = { enabled: true, captureException(ex: Error, options?: CaptureOptions) { Raven.captureException(ex, options); }, context<T>(fn: () => T): T { return Raven.context(fn) as any; }, wrap<TFunc extends Function>(fn: TFunc): TFunc { return Raven.wrap(fn) as any; }, setUserContext(user?: User) { user ? Raven.setUserContext(user) : Raven.setUserContext(); }, captureMessage(message: string, options?: CaptureOptions) { Raven.captureMessage(message, options); }, captureBreadcrumb(crumb: Breadcrumb) { Raven.captureBreadcrumb(crumb); }, showReportDialog(options?: {eventId?: string}) { Raven.showReportDialog(options); }, }; } export default output; module.exports = output; module.exports.default = output;
mopedjs/moped
packages/sentry/src/client.ts
TypeScript
mit
1,735
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <title>SEEPPP v1</title> </head> <body onLoad="document.location.href='app.php'"></body> </html>
efraxpc/SEPPP
index.html
HTML
mit
256
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.11"/> <title>nucleo-dynamixel: HAL TIM Aliased Macros maintained for legacy purpose</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtreedata.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); $(window).load(resizeHeight); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { init_search(); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">nucleo-dynamixel &#160;<span id="projectnumber">0.0.1</span> </div> <div id="projectbrief">A library for controlling dynamixel servomotors, designed for nucleo stm32</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.11 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="pages.html"><span>Related&#160;Pages</span></a></li> <li class="current"><a href="modules.html"><span>Modules</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('group___h_a_l___t_i_m___aliased___macros.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="summary"> <a href="#define-members">Macros</a> </div> <div class="headertitle"> <div class="title">HAL TIM Aliased Macros maintained for legacy purpose</div> </div> </div><!--header--> <div class="contents"> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a> Macros</h2></td></tr> <tr class="memitem:ga1f487f25516b3fd87b864f5be8229b7e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga1f487f25516b3fd87b864f5be8229b7e"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>__HAL_TIM_SetICPrescalerValue</b>&#160;&#160;&#160;TIM_SET_ICPRESCALERVALUE</td></tr> <tr class="separator:ga1f487f25516b3fd87b864f5be8229b7e"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:gac171a25ce55eafe62671d40d7397d721"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gac171a25ce55eafe62671d40d7397d721"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>__HAL_TIM_ResetICPrescalerValue</b>&#160;&#160;&#160;TIM_RESET_ICPRESCALERVALUE</td></tr> <tr class="separator:gac171a25ce55eafe62671d40d7397d721"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga1dd7eae80b853d3526091193e81b4731"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga1dd7eae80b853d3526091193e81b4731"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>TIM_GET_ITSTATUS</b>&#160;&#160;&#160;__HAL_TIM_GET_IT_SOURCE</td></tr> <tr class="separator:ga1dd7eae80b853d3526091193e81b4731"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:gadd580b2357a85c03653006349721a36e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gadd580b2357a85c03653006349721a36e"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>TIM_GET_CLEAR_IT</b>&#160;&#160;&#160;__HAL_TIM_CLEAR_IT</td></tr> <tr class="separator:gadd580b2357a85c03653006349721a36e"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga5b35f7cd15ac31c7b1a9596ac8521f36"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga5b35f7cd15ac31c7b1a9596ac8521f36"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>__HAL_TIM_GET_ITSTATUS</b>&#160;&#160;&#160;__HAL_TIM_GET_IT_SOURCE</td></tr> <tr class="separator:ga5b35f7cd15ac31c7b1a9596ac8521f36"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga76886ef4a5712e8627ea09ff564cdff2"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga76886ef4a5712e8627ea09ff564cdff2"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>__HAL_TIM_DIRECTION_STATUS</b>&#160;&#160;&#160;__HAL_TIM_IS_TIM_COUNTING_DOWN</td></tr> <tr class="separator:ga76886ef4a5712e8627ea09ff564cdff2"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga64fdbe2a68fc8459071ee0dcb9096e34"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga64fdbe2a68fc8459071ee0dcb9096e34"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>__HAL_TIM_PRESCALER</b>&#160;&#160;&#160;__HAL_TIM_SET_PRESCALER</td></tr> <tr class="separator:ga64fdbe2a68fc8459071ee0dcb9096e34"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga23ef14334077dc01d9e6d8bfa6614260"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga23ef14334077dc01d9e6d8bfa6614260"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>__HAL_TIM_SetCounter</b>&#160;&#160;&#160;<a class="el" href="group___t_i_m___exported___macros.html#ga9746ac75e4cd25cec1a9ebac8cb82b97">__HAL_TIM_SET_COUNTER</a></td></tr> <tr class="separator:ga23ef14334077dc01d9e6d8bfa6614260"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga074ff6af2efe776a0e76622bf8d4c85a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga074ff6af2efe776a0e76622bf8d4c85a"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>__HAL_TIM_GetCounter</b>&#160;&#160;&#160;<a class="el" href="group___t_i_m___exported___macros.html#gaf1af08014b9d06efbbb091d58d47c8ba">__HAL_TIM_GET_COUNTER</a></td></tr> <tr class="separator:ga074ff6af2efe776a0e76622bf8d4c85a"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga8857297381807be432e6b6eb98fdb591"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga8857297381807be432e6b6eb98fdb591"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>__HAL_TIM_SetAutoreload</b>&#160;&#160;&#160;<a class="el" href="group___t_i_m___exported___macros.html#ga1e6300cab1e34ecaaf490dc7d4812d69">__HAL_TIM_SET_AUTORELOAD</a></td></tr> <tr class="separator:ga8857297381807be432e6b6eb98fdb591"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:gae96afd3a280ee1faf2551537e6618ee4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gae96afd3a280ee1faf2551537e6618ee4"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>__HAL_TIM_GetAutoreload</b>&#160;&#160;&#160;<a class="el" href="group___t_i_m___exported___macros.html#gaa7a5c7645695bad15bacd402513a028a">__HAL_TIM_GET_AUTORELOAD</a></td></tr> <tr class="separator:gae96afd3a280ee1faf2551537e6618ee4"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga8b8f3cf144c4058ec55e6e3659c6a68f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga8b8f3cf144c4058ec55e6e3659c6a68f"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>__HAL_TIM_SetClockDivision</b>&#160;&#160;&#160;<a class="el" href="group___t_i_m___exported___macros.html#ga8aa84d77c670890408092630f9b2bdc4">__HAL_TIM_SET_CLOCKDIVISION</a></td></tr> <tr class="separator:ga8b8f3cf144c4058ec55e6e3659c6a68f"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:gaaf835e3864f2ba2e2026d417ad0d5e40"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gaaf835e3864f2ba2e2026d417ad0d5e40"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>__HAL_TIM_GetClockDivision</b>&#160;&#160;&#160;<a class="el" href="group___t_i_m___exported___macros.html#gae6bc91bb5940bce52828c690f24001b8">__HAL_TIM_GET_CLOCKDIVISION</a></td></tr> <tr class="separator:gaaf835e3864f2ba2e2026d417ad0d5e40"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga1cb3c9854441539ebe076fba62c36d22"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga1cb3c9854441539ebe076fba62c36d22"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>__HAL_TIM_SetICPrescaler</b>&#160;&#160;&#160;<a class="el" href="group___t_i_m___exported___macros.html#gaeb106399b95ef02cec502f58276a0e92">__HAL_TIM_SET_ICPRESCALER</a></td></tr> <tr class="separator:ga1cb3c9854441539ebe076fba62c36d22"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:gae8d82e4e04e81f7a023a45b73c9705b7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gae8d82e4e04e81f7a023a45b73c9705b7"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>__HAL_TIM_GetICPrescaler</b>&#160;&#160;&#160;<a class="el" href="group___t_i_m___exported___macros.html#gabfeec6b3c67a5747c7dbd20aff61d8e2">__HAL_TIM_GET_ICPRESCALER</a></td></tr> <tr class="separator:gae8d82e4e04e81f7a023a45b73c9705b7"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga03feb77e8c86f3563d671c1ec2439e76"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga03feb77e8c86f3563d671c1ec2439e76"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>__HAL_TIM_SetCompare</b>&#160;&#160;&#160;<a class="el" href="group___t_i_m___exported___macros.html#ga300d0c9624c3b072d3afeb7cef639b66">__HAL_TIM_SET_COMPARE</a></td></tr> <tr class="separator:ga03feb77e8c86f3563d671c1ec2439e76"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga6c5f81acbdba730e0cd6a67f06e97de2"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga6c5f81acbdba730e0cd6a67f06e97de2"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>__HAL_TIM_GetCompare</b>&#160;&#160;&#160;<a class="el" href="group___t_i_m___exported___macros.html#gaa40722f56910966e1da5241b610eed84">__HAL_TIM_GET_COMPARE</a></td></tr> <tr class="separator:ga6c5f81acbdba730e0cd6a67f06e97de2"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:gab7cf2b7db3956d4fd1e5a5d84f4891e7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gab7cf2b7db3956d4fd1e5a5d84f4891e7"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>TIM_TS_ITR0</b>&#160;&#160;&#160;((uint32_t)0x0000)</td></tr> <tr class="separator:gab7cf2b7db3956d4fd1e5a5d84f4891e7"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:gad90fbca297153ca9c0112a67ea2c6cb3"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gad90fbca297153ca9c0112a67ea2c6cb3"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>TIM_TS_ITR1</b>&#160;&#160;&#160;((uint32_t)0x0010)</td></tr> <tr class="separator:gad90fbca297153ca9c0112a67ea2c6cb3"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga8599ba58a5f911d648503c7ac55d4320"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga8599ba58a5f911d648503c7ac55d4320"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>TIM_TS_ITR2</b>&#160;&#160;&#160;((uint32_t)0x0020)</td></tr> <tr class="separator:ga8599ba58a5f911d648503c7ac55d4320"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga63183e611b91c5847040172c0069514d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga63183e611b91c5847040172c0069514d"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>TIM_TS_ITR3</b>&#160;&#160;&#160;((uint32_t)0x0030)</td></tr> <tr class="separator:ga63183e611b91c5847040172c0069514d"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga1ce6c387021e2fdaf3fa3d7cd3eae962"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><b>IS_TIM_INTERNAL_TRIGGER_SELECTION</b>(SELECTION)</td></tr> <tr class="separator:ga1ce6c387021e2fdaf3fa3d7cd3eae962"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga6b1541e4a49d62610899e24bf23f4879"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga6b1541e4a49d62610899e24bf23f4879"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>TIM_CHANNEL_1</b>&#160;&#160;&#160;((uint32_t)0x0000)</td></tr> <tr class="separator:ga6b1541e4a49d62610899e24bf23f4879"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga33e02d43345a7ac5886f01b39e4f7ccd"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga33e02d43345a7ac5886f01b39e4f7ccd"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>TIM_CHANNEL_2</b>&#160;&#160;&#160;((uint32_t)0x0004)</td></tr> <tr class="separator:ga33e02d43345a7ac5886f01b39e4f7ccd"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga9ec916c398ee31bce684335fb81c54dc"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><b>IS_TIM_PWMI_CHANNELS</b>(CHANNEL)</td></tr> <tr class="separator:ga9ec916c398ee31bce684335fb81c54dc"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga07bb7288fc4ed155301a3276908a23a0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga07bb7288fc4ed155301a3276908a23a0"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>TIM_OUTPUTNSTATE_DISABLE</b>&#160;&#160;&#160;((uint32_t)0x0000)</td></tr> <tr class="separator:ga07bb7288fc4ed155301a3276908a23a0"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga3323d8c81a7f3940aa290d160dea3e0d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga3323d8c81a7f3940aa290d160dea3e0d"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>TIM_OUTPUTNSTATE_ENABLE</b>&#160;&#160;&#160;(<a class="el" href="group___peripheral___registers___bits___definition.html#ga813056b3f90a13c4432aeba55f28957e">TIM_CCER_CC1NE</a>)</td></tr> <tr class="separator:ga3323d8c81a7f3940aa290d160dea3e0d"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga81e27a982d9707f699451f30314c4274"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><b>IS_TIM_OUTPUTN_STATE</b>(STATE)</td></tr> <tr class="separator:ga81e27a982d9707f699451f30314c4274"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga98fa585adffeb0d3654b47040576c6b7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga98fa585adffeb0d3654b47040576c6b7"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>TIM_OUTPUTSTATE_DISABLE</b>&#160;&#160;&#160;((uint32_t)0x0000)</td></tr> <tr class="separator:ga98fa585adffeb0d3654b47040576c6b7"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga114555abc521311f689478a7e0a9ace9"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga114555abc521311f689478a7e0a9ace9"></a> #define&#160;</td><td class="memItemRight" valign="bottom"><b>TIM_OUTPUTSTATE_ENABLE</b>&#160;&#160;&#160;(<a class="el" href="group___peripheral___registers___bits___definition.html#ga3f494b9881e7b97bb2d79f7ad4e79937">TIM_CCER_CC1E</a>)</td></tr> <tr class="separator:ga114555abc521311f689478a7e0a9ace9"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga5848617f830d2de688eaff50ed279679"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><b>IS_TIM_OUTPUT_STATE</b>(STATE)</td></tr> <tr class="separator:ga5848617f830d2de688eaff50ed279679"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <h2 class="groupheader">Macro Definition Documentation</h2> <a class="anchor" id="ga1ce6c387021e2fdaf3fa3d7cd3eae962"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define IS_TIM_INTERNAL_TRIGGER_SELECTION</td> <td>(</td> <td class="paramtype">&#160;</td> <td class="paramname">SELECTION</td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <b>Value:</b><div class="fragment"><div class="line">(((SELECTION) == TIM_TS_ITR0) || \</div><div class="line"> ((SELECTION) == TIM_TS_ITR1) || \</div><div class="line"> ((SELECTION) == TIM_TS_ITR2) || \</div><div class="line"> ((SELECTION) == TIM_TS_ITR3))</div></div><!-- fragment --> </div> </div> <a class="anchor" id="ga5848617f830d2de688eaff50ed279679"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define IS_TIM_OUTPUT_STATE</td> <td>(</td> <td class="paramtype">&#160;</td> <td class="paramname">STATE</td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <b>Value:</b><div class="fragment"><div class="line">(((STATE) == TIM_OUTPUTSTATE_DISABLE) || \</div><div class="line"> ((STATE) == TIM_OUTPUTSTATE_ENABLE))</div></div><!-- fragment --> </div> </div> <a class="anchor" id="ga81e27a982d9707f699451f30314c4274"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define IS_TIM_OUTPUTN_STATE</td> <td>(</td> <td class="paramtype">&#160;</td> <td class="paramname">STATE</td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <b>Value:</b><div class="fragment"><div class="line">(((STATE) == TIM_OUTPUTNSTATE_DISABLE) || \</div><div class="line"> ((STATE) == TIM_OUTPUTNSTATE_ENABLE))</div></div><!-- fragment --> </div> </div> <a class="anchor" id="ga9ec916c398ee31bce684335fb81c54dc"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define IS_TIM_PWMI_CHANNELS</td> <td>(</td> <td class="paramtype">&#160;</td> <td class="paramname">CHANNEL</td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <b>Value:</b><div class="fragment"><div class="line">(((CHANNEL) == TIM_CHANNEL_1) || \</div><div class="line"> ((CHANNEL) == TIM_CHANNEL_2))</div></div><!-- fragment --> </div> </div> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="footer">Generated by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li> </ul> </div> </body> </html>
team-diana/nucleo-dynamixel
docs/html/group___h_a_l___t_i_m___aliased___macros.html
HTML
mit
21,613
// This file auto generated by plugin for ida pro. Generated code only for x64. Please, dont change manually #pragma once #include <common/common.h> START_ATF_NAMESPACE typedef SLR_FLAGS __MIDL___MIDL_itf_shobjidl_0212_0001; END_ATF_NAMESPACE
goodwinxp/Yorozuya
library/ATF/__MIDL___MIDL_itf_shobjidl_0212_0001.hpp
C++
mit
250
FROM johnnyasantoss/dotnet-mono-docker:dotnet2.0-mono5.2-sdk WORKDIR /app COPY ./** /app/ RUN apt-get update && apt-get install -y libgit2-24 RUN ./build.sh -t "pack" -v > dockerbuild.txt 2>&1
PagueVeloz/JsonFluentMap
Dockerfile
Dockerfile
mit
197
#region Copyright (c) 2014 Orcomp development team. // ------------------------------------------------------------------------------------------------------------------- // <copyright file="GraphExplorerViewModel.cs" company="Orcomp development team"> // Copyright (c) 2014 Orcomp development team. All rights reserved. // </copyright> // -------------------------------------------------------------------------------------------------------------------- #endregion namespace Orc.GraphExplorer.ViewModels { using System.ComponentModel; using System.Threading.Tasks; using Catel; using Catel.Configuration; using Catel.MVVM; using Factories; using Messages; using Models; using Services; public class GraphExplorerViewModel : ViewModelBase { #region Fields private readonly IGraphDataService _graphDataService; private readonly IGraphExplorerFactory _graphExplorerFactory; private readonly INavigationService _navigationService; #endregion #region Constructors public GraphExplorerViewModel(IGraphDataService graphDataService, IGraphExplorerFactory graphExplorerFactory, INavigationService navigationService) { Argument.IsNotNull(() => graphDataService); Argument.IsNotNull(() => graphExplorerFactory); Argument.IsNotNull(() => navigationService); _graphDataService = graphDataService; _graphExplorerFactory = graphExplorerFactory; _navigationService = navigationService; Explorer = _graphExplorerFactory.CreateExplorer(); CloseNavTabCommand = new Command(OnCloseNavTabCommandExecute); OpenSettingsCommand = new Command(OnOpenSettingsCommandExecute); EditingStartStopMessage.Register(this, OnEditingStartStopMessage, Explorer.EditorToolset.ToolsetName); ReadyToLoadGraphMessage.Register(this, OnReadyToLoadGraphMessage); NavigationMessage.Register(this, OnNavigationMessage); } #endregion #region Properties /// <summary> /// Gets the OpenSettingsCommand command. /// </summary> public Command OpenSettingsCommand { get; private set; } /// <summary> /// Gets the CloseNavTabCommand command. /// </summary> public Command CloseNavTabCommand { get; private set; } /// <summary> /// Gets or sets the property value. /// </summary> [Model] public Explorer Explorer { get; set; } /// <summary> /// Gets or sets the property value. /// </summary> [Model] [ViewModelToModel("Explorer")] public Settings Settings { get; set; } /// <summary> /// Gets or sets the property value. /// </summary> [ViewModelToModel("Settings")] public bool IsSettingsVisible { get; set; } /// <summary> /// Gets or sets the property value. /// </summary> [Model] [ViewModelToModel("Explorer")] public GraphToolset EditorToolset { get; set; } /// <summary> /// Gets or sets the property value. /// </summary> [ViewModelToModel("EditorToolset")] public bool IsChanged { get; set; } /// <summary> /// Gets or sets the property value. /// </summary> [ViewModelToModel("Explorer")] public bool IsNavTabVisible { get; set; } /// <summary> /// Gets or sets the property value. /// </summary> [ViewModelToModel("Explorer")] public bool IsNavTabSelected { get; set; } /// <summary> /// Gets or sets the property value. /// </summary> [DefaultValue(false)] public bool IsEditorTabSelected { get; set; } #endregion #region Methods private void OnNavigationMessage(NavigationMessage message) { _navigationService.NavigateTo(Explorer, message.Data); } private void OnReadyToLoadGraphMessage(ReadyToLoadGraphMessage message) { var editorArea = Explorer.EditorToolset.Area; if (string.Equals(message.Data, "Editor") && editorArea.GraphDataGetter == null) { editorArea.GraphDataGetter = _graphDataService; editorArea.GraphDataSaver = _graphDataService; } var navigatorArea = Explorer.NavigatorToolset.Area; if (string.Equals(message.Data, "Navigator") && navigatorArea.GraphDataGetter == null) { navigatorArea.GraphDataGetter = new NavigatorGraphDataGetter(); } } private void OnEditingStartStopMessage(EditingStartStopMessage message) { if (message.Data) { IsNavTabVisible = false; } } protected override async Task Initialize() { await base.Initialize(); IsEditorTabSelected = true; } /// <summary> /// Method to invoke when the OpenSettingsCommand command is executed. /// </summary> private void OnOpenSettingsCommandExecute() { IsSettingsVisible = !IsSettingsVisible; } /// <summary> /// Method to invoke when the CloseNavTabCommand command is executed. /// </summary> private void OnCloseNavTabCommandExecute() { IsNavTabVisible = false; IsNavTabSelected = false; IsEditorTabSelected = true; } #endregion } }
Orcomp/Orc.GraphExplorer
src/Orc.GraphExplorer/ViewModels/GraphExplorerViewModel.cs
C#
mit
5,680
require 'spec_helper' describe Fastball do it 'has a version number' do expect(Fastball::VERSION).not_to be nil end end
jbgo/fastball
spec/lib/fastball_spec.rb
Ruby
mit
129
namespace IronSharp.IronMQ { /// <summary> /// http://dev.iron.io/mq/reference/clouds/ /// </summary> public static class IronMqCloudHosts { public const string DEFAULT = AWS_US_EAST_HOST; /// <summary> /// Default /// </summary> public const string AWS_US_EAST_HOST = "mq-aws-us-east-1-1.iron.io"; } }
iron-io/iron_dotnet
src/IronSharp.IronMQ/IronMqCloudHosts.cs
C#
mit
371
The MIT License (MIT) Copyright (c) crdx 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.
crdx/utorrent-mrc
LICENCE.md
Markdown
mit
1,066
package com.yngvark.communicate_through_named_pipes.input; import org.slf4j.Logger; import java.io.BufferedReader; import java.io.IOException; import static org.slf4j.LoggerFactory.getLogger; public class InputFileReader { private final Logger logger = getLogger(getClass()); private final BufferedReader bufferedReader; private boolean run = true; private boolean streamClosed = false; public InputFileReader(BufferedReader bufferedReader) { this.bufferedReader = bufferedReader; } /** * @throws IORuntimeException If an {@link java.io.IOException} occurs. */ public void consume(MessageListener messageListener) throws RuntimeException { logger.debug("Consume: start."); try { tryToConsume(messageListener); } catch (IOException e) { throw new IORuntimeException(e); } logger.debug(""); logger.debug("Consume: done."); } private void tryToConsume(MessageListener messageListener) throws IOException { String msg = null; while (run) { msg = bufferedReader.readLine(); if (msg == null) break; logger.trace("<<< From other side: " + msg); messageListener.messageReceived(msg); } if (msg == null) { logger.debug("Consume file stream was closed from other side."); } bufferedReader.close(); } public synchronized void closeStream() { logger.debug("Stopping consuming input file..."); if (streamClosed) { logger.info("Already stopped."); return; } run = false; try { logger.trace("Closing buffered reader."); bufferedReader.close(); streamClosed = true; } catch (IOException e) { logger.error("Caught exception when closing stream: {}", e); } logger.debug("Stopping consuming input file... done"); } }
yngvark/gridwalls2
source/lib/communicate-through-named-pipes/source/src/main/java/com/yngvark/communicate_through_named_pipes/input/InputFileReader.java
Java
mit
2,016
--- layout: post title: Syntax Highlighting Post description: "Demo post displaying the various ways of highlighting code in Markdown." modified: 2016-06-01T15:27:45-04:00 tags: [sample post, code, highlighting] published: false image: feature: abstract-10.jpg credit: dargadgetz creditlink: http://www.dargadgetz.com/ios-7-abstract-wallpaper-pack-for-iphone-5-and-ipod-touch-retina/ --- Syntax highlighting is a feature that displays source code, in different colors and fonts according to the category of terms. This feature facilitates writing in a structured language such as a programming language or a markup language as both structures and syntax errors are visually distinct. Highlighting does not affect the meaning of the text itself; it is intended only for human readers.[^1] [^1]: <http://en.wikipedia.org/wiki/Syntax_highlighting> ### GFM Code Blocks GitHub Flavored Markdown [fenced code blocks](https://help.github.com/articles/creating-and-highlighting-code-blocks/) are supported. To modify styling and highlight colors edit `/_sass/syntax.scss`. ```css #container { float: left; margin: 0 -240px 0 0; width: 100%; } ``` {% highlight scss %} .highlight { margin: 0; padding: 1em; font-family: $monospace; font-size: $type-size-7; line-height: 1.8; } {% endhighlight %} ```html {% raw %}<nav class="pagination" role="navigation"> {% if page.previous %} <a href="{{ site.url }}{{ page.previous.url }}" class="btn" title="{{ page.previous.title }}">Previous article</a> {% endif %} {% if page.next %} <a href="{{ site.url }}{{ page.next.url }}" class="btn" title="{{ page.next.title }}">Next article</a> {% endif %} </nav><!-- /.pagination -->{% endraw %} ``` {% highlight html linenos %} {% raw %}<nav class="pagination" role="navigation"> {% if page.previous %} <a href="{{ site.url }}{{ page.previous.url }}" class="btn" title="{{ page.previous.title }}">Previous article</a> {% endif %} {% if page.next %} <a href="{{ site.url }}{{ page.next.url }}" class="btn" title="{{ page.next.title }}">Next article</a> {% endif %} </nav><!-- /.pagination -->{% endraw %} {% endhighlight %} ```ruby module Jekyll class TagIndex < Page def initialize(site, base, dir, tag) @site = site @base = base @dir = dir @name = 'index.html' self.process(@name) self.read_yaml(File.join(base, '_layouts'), 'tag_index.html') self.data['tag'] = tag tag_title_prefix = site.config['tag_title_prefix'] || 'Tagged: ' tag_title_suffix = site.config['tag_title_suffix'] || '&#8211;' self.data['title'] = "#{tag_title_prefix}#{tag}" self.data['description'] = "An archive of posts tagged #{tag}." end end end ``` ### Code Blocks in Lists Indentation matters. Be sure the indent of the code block aligns with the first non-space character after the list item marker (e.g., `1.`). Usually this will mean indenting 3 spaces instead of 4. 1. Do step 1. 2. Now do this: ```ruby def print_hi(name) puts "Hi, #{name}" end print_hi('Tom') #=> prints 'Hi, Tom' to STDOUT. ``` 3. Now you can do this. ### GitHub Gist Embed An example of a Gist embed below. {% gist mmistakes/6589546 %}
yfuseki/yfuseki.github.io
_posts/2013-08-16-code-highlighting-post.md
Markdown
mit
3,246
'use strict'; var _ = require('lodash'), jsonFormat = require('json-format'), grunt = require('grunt'); var util = require('../util/util'); module.exports = { json: function(data, options, generatedContent, callback){ if(_.isString(options.dest)){ grunt.file.write(options.dest + '/json/' + generatedContent.task + '.json', jsonFormat(generatedContent)); grunt.file.write(options.dest + '/json/content/' + data.uuid + '.json', jsonFormat(data)); } callback(generatedContent); } }; //
lwhiteley/grunt-pagespeed-report
tasks/config/reporters/json.js
JavaScript
mit
523
/** * Dont edit this file! * This module generates itself from lang.js files! * Instead edit the language files in /lang/ **/ /*global define*/ define(function () { "use strict"; var i18n = {}; i18n.de = { "Visit %s overview" : "Zur %s Übersicht", "An error occured, please reload." : "Es gab einen unerwarteten Fehler. Bitte laden Sie die Seite neu.", "Order successfully saved" : "Reihenfolge erfolgreich gespeichert", "Your browser doesnt support the following technologies: %s <br>Please update your browser!" : "Ihr Browser unterstützt die folgenden Technologien nicht: %s <br>Bitte installieren Sie eine neuere Version Ihres Browsers!", "Close" : "Schließen", "When asynchronously trying to load a ressource, I came across an error: %s" : "Beim Laden einer Ressource gab es leider folgenden Fehler: %s", "You are using an outdated web browser. Please consider an update!" : "Sie benutzen eine veraltete Browser Version. Bitte installieren Sie einen aktuelleren Browser.", "No results found." : "Keine Ergebnisse gefunden.", "No results found for \"%s\"." : "Keine Ergebnisse für \"%s\" gefunden.", "Illegal injection found" : "", "Could not load injection" : "", "You\'re almost done!" : "Du hast es fast geschafft!", "Show overview" : "Übersicht anzeigen", "Show %d contents for \"%s\"" : "", "Abort": "Abbrechen" }; i18n.en = { "An error occured, please reload." : "", "Close" : "", "Visit %s overview" : "", "Order successfully saved" : "", "Your browser doesnt support the following technologies: %s <br>Please update your browser!" : "", "When asynchronously trying to load a ressource, I came across an error: %s" : "", "You are using an outdated web browser. Please consider an update!" : "", "No results found." : "", "No results found for \"%s\"." : "", "Illegal injection found" : "", "Could not load injection" : "", "You\'re almost done!" : "", "Show overview" : "", "Show %d contents for \"%s\"" : "", "Abort": "" }; return i18n; });
creitiv/athene2
src/assets/source/scripts/modules/serlo_i18n.js
JavaScript
mit
2,085
--- layout: page title: "ACCT 4825: Experimental Seminar Statistics" comments: true description: "blanks" keywords: "ACCT,4825,CU,Boulder" --- <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script src="https://dl.dropboxusercontent.com/s/pc42nxpaw1ea4o9/highcharts.js?dl=0"></script> <!-- <script src="../assets/js/highcharts.js"></script> --> <style type="text/css">@font-face { font-family: "Bebas Neue"; src: url(https://www.filehosting.org/file/details/544349/BebasNeue Regular.otf) format("opentype"); } h1.Bebas { font-family: "Bebas Neue", Verdana, Tahoma; } </style> </head> <body> <div id="container" style="float: right; width: 45%; height: 88%; margin-left: 2.5%; margin-right: 2.5%;"></div> <script language="JavaScript"> $(document).ready(function() { var chart = {type: 'column'}; var title = {text: 'Grade Distribution'}; var xAxis = {categories: ['A','B','C','D','F'],crosshair: true}; var yAxis = {min: 0,title: {text: 'Percentage'}}; var tooltip = {headerFormat: '<center><b><span style="font-size:20px">{point.key}</span></b></center>', pointFormat: '<td style="padding:0"><b>{point.y:.1f}%</b></td>', footerFormat: '</table>',shared: true,useHTML: true}; var plotOptions = {column: {pointPadding: 0.0,borderWidth: 0}}; var credits = {enabled: false};var series= [{name: 'Percent',data: [36.0,60.0,0.0,4.0,0.0,]}]; var json = {}; json.chart = chart; json.title = title; json.tooltip = tooltip; json.xAxis = xAxis; json.yAxis = yAxis; json.series = series; json.plotOptions = plotOptions; json.credits = credits; $('#container').highcharts(json); }); </script> </body> #### GRADE AND WORKLOAD STATISTICS **Percent withdrawn**: 0.0% **Percent incomplete**: 0.0% **Average grade** (4.0 scale): 3.3 **Standard deviation in grades** (4.0 scale): 0.0 **Average workload** (raw): 2.62 **Standard deviation in workload** (raw): 0.0 #### COURSE AND INSTRUCTOR RATINGS/INFORMATION **Average course rating** (6 point scale): 5.32 **Standard deviation in course rating** (6 point scale): 0.0 **Average instructor rating** (6 point scale): 5.86 **Standard deviation in instructor rating** (6 point scale): 0.0 **Instructors**: <a href='../../instructors/Susan_Morley'>Susan Morley</a> #### GENERAL CLASS INFORMATION **Years provided**: Fall 2011 **Credits**: 3 **RAP/Honors class?** Neither **Number of Sections**: 1 **Department**: BADM **College**: Leeds School of Business **Level**: Upper **Activity**: LEC - Lecture
nikhilrajaram/nikhilrajaram.github.io
courses/ACCT-4825.md
Markdown
mit
2,593
use chrono::{offset::Utc, DateTime}; use rustorm::{pool, DbError, FromDao, Pool, ToColumnNames, ToDao, ToTableName}; /// Run using: /// ```sh /// cargo run --example insert_usage_mysql --features "with-mysql" /// ``` fn main() { mod for_insert { use super::*; #[derive(Debug, PartialEq, ToDao, ToColumnNames, ToTableName)] pub struct Actor { pub first_name: String, pub last_name: String, } } mod for_retrieve { use super::*; #[derive(Debug, FromDao, ToColumnNames, ToTableName)] pub struct Actor { pub actor_id: i32, pub first_name: String, pub last_name: String, pub last_update: DateTime<Utc>, } } let db_url = "mysql://root:r00tpwdh3r3@localhost/sakila"; let mut pool = Pool::new(); pool.ensure(db_url); let mut em = pool.em(db_url).expect("Can not connect"); let tom_cruise = for_insert::Actor { first_name: "TOM".into(), last_name: "CRUISE".to_string(), }; let tom_hanks = for_insert::Actor { first_name: "TOM".into(), last_name: "HANKS".to_string(), }; println!("tom_cruise: {:#?}", tom_cruise); println!("tom_hanks: {:#?}", tom_hanks); let actors: Result<Vec<for_retrieve::Actor>, DbError> = em.insert(&[&tom_cruise, &tom_hanks]); println!("Actor: {:#?}", actors); assert!(actors.is_ok()); let actors = actors.unwrap(); let today = Utc::now().date(); assert_eq!(tom_cruise.first_name, actors[0].first_name); assert_eq!(tom_cruise.last_name, actors[0].last_name); assert_eq!(today, actors[0].last_update.date()); assert_eq!(tom_hanks.first_name, actors[1].first_name); assert_eq!(tom_hanks.last_name, actors[1].last_name); assert_eq!(today, actors[1].last_update.date()); }
ivanceras/rustorm
examples/insert_usage_mysql.rs
Rust
mit
1,853
// Copyright 2017 The Lynx Authors. All rights reserved. #ifndef LYNX_BASE_THREADING_MESSAGE_PUMP_POSIX_H_ #define LYNX_BASE_THREADING_MESSAGE_PUMP_POSIX_H_ #include "base/task/task.h" #include "base/threading/condition.h" #include "base/threading/message_pump.h" #include "base/timer/timer.h" namespace base { class MessagePumpPosix : public MessagePump { public: MessagePumpPosix(); virtual ~MessagePumpPosix(); virtual void Run(Delegate* delegate); virtual void ScheduleWork(); virtual void ScheduleDelayedWork(Closure* closure, int delayed_time); virtual void ScheduleIntervalWork(Closure* closure, int delayed_time); virtual void Stop(); private: Condition condition_; Timer timer_; bool keep_running_; }; } // namespace base #endif // LYNX_BASE_THREADING_MESSAGE_PUMP_POSIX_H_
hxxft/lynx-native
Core/base/threading/message_pump_posix.h
C
mit
844
'use strict'; /** * Module dependencies. */ var path = require('path'), mongoose = require('mongoose'), Person = mongoose.model('Person'), errorHandler = require(path.resolve('./modules/core/server/controllers/errors.server.controller')), _ = require('lodash'); /** * Create a Person */ exports.create = function(req, res) { var person = new Person(req.body); person.user = req.user; person.save(function(err) { if (err) { return res.status(400).send({ message: errorHandler.getErrorMessage(err) }); } else { res.jsonp(person); } }); }; /** * Show the current Person */ exports.read = function(req, res) { // convert mongoose document to JSON var person = req.person ? req.person.toJSON() : {}; // Add a custom field to the Article, for determining if the current User is the "owner". // NOTE: This field is NOT persisted to the database, since it doesn't exist in the Article model. // person.isCurrentUserOwner = req.user && person.user && person.user._id.toString() === req.user._id.toString(); res.jsonp(person); }; /** * Update a Person */ exports.update = function(req, res) { var person = req.person; person = _.extend(person, req.body); person.save(function(err) { if (err) { return res.status(400).send({ message: errorHandler.getErrorMessage(err) }); } else { res.jsonp(person); } }); }; /** * Delete a Person */ exports.delete = function(req, res) { var person = req.person; person.remove(function(err) { if (err) { return res.status(400).send({ message: errorHandler.getErrorMessage(err) }); } else { res.jsonp(person); } }); }; /** * List of People */ exports.list = function(req, res) { var search = {}; if (req.query.full_name) { search.full_name = new RegExp(req.query.full_name, 'i'); } if (req.query.url) { search.url = new RegExp(req.query.url, 'i'); } if (req.query.email) { search.email = new RegExp(req.query.email, 'i'); } if (req.query.job) { search.job = new RegExp(req.query.job, 'i'); } if (req.query.location_safe) { search.location_safe = new RegExp(req.query.location_safe, 'i'); } if (req.query.phone) { search.phone = new RegExp(req.query.phone, 'i'); } if (req.query.notes) { search.notes = new RegExp(req.query.notes, 'i'); } if (req.query.keywords) { search.keywords = new RegExp(req.query.keywords, 'i'); } Person.find(search).sort('-created').exec(function (err, people) { if (err) { return res.status(400).send({ message: err.message }); } else { res.json(people); } }); }; /** * List of Dupliacte People */ exports.duplicates = function (req, res) { var aggregate = [ { $group: { _id: { url: '$url' }, count: { $sum: 1 } } }, { $match: { count: { $gte: 2 } } } ]; Person.aggregate(aggregate, function (err, groups) { if (err) { return res.status(400).send({ message: err.message }); } else { var dup_urls = []; for (var i = 0; i < groups.length; i++) { var group = groups[i]; var _id = group._id; dup_urls.push(_id.url); } Person.find({ url: { $in: dup_urls } }).sort('url').exec(function (err, people) { if (err) { return res.status(400).send({ message: err.message }); } else { res.json(people); } }); } }); }; /** * Person middleware */ exports.personByID = function(req, res, next, id) { if (!mongoose.Types.ObjectId.isValid(id)) { return res.status(400).send({ message: 'Person is invalid' }); } Person.findById(id).populate('user', 'displayName').exec(function (err, person) { if (err) { return next(err); } else if (!person) { return res.status(404).send({ message: 'No Person with that identifier has been found' }); } req.person = person; next(); }); };
tmrotz/LinkedIn-People-MEAN.JS
modules/people/server/controllers/people.server.controller.js
JavaScript
mit
4,096
--- title: "Spreadsheet hijinks" excerpt: The results from crowd-sourcing a suitable term for a common spreadsheet practice. tags: - excel - munging - unheadr - clippy header: image: /assets/images/featureExcel.png --- Earlier in the week Jenny Bryan helped me ask the Twitter community what to call this widely used spreadsheet habit (see the image in my Tweet). <blockquote class="twitter-tweet" data-lang="en"><p lang="en" dir="ltr">Do you have a pithy name for this spreadsheet phenomenon? Do tell! <a href="https://t.co/XbqOOSmr4i">https://t.co/XbqOOSmr4i</a></p>&mdash; Jenny Bryan (@JennyBryan) <a href="https://twitter.com/JennyBryan/status/1039267761174732800?ref_src=twsrc%5Etfw">September 10, 2018</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> I kept track of the replies to my tweet and to Jenny's retweet, and here are _most_ of the suggested names... <figure> <a href="/assets/images/factros.png"><img src="/assets/images/factros.png"></a> </figure> and again as a proper table... |term given |user hande | |:------------------------------------------------------------------------|:----------------| |Replies to Luis |NA | |pain in the neck |@AnneMarie_DC | |interrupting subheaders |@pandapoop42 | |Interstitial group labels |@BrodieGaslam | |Nested relational model |@arnabdotorg | |subgroups |@Thoughtfulnz | |group titles, group names |@benomial | |partial normalization for human/visual consumption |@jgraham909 | |groups, grouping |@jgraham909 | |demon rows |@NthChapter | |Meta-data |@IsabellaGhement | |Embheaders (embedded headers) |@tammylarmstrong | |pivots |@antonycourtney | |spreadsheet block groups, spreadsheet sub-table groups, sub-table groups |@cormac85 | |Meta-data headers |@cbirunda | |group representatives, grouping criterion |@Teggy | |complete shit |@StevenNHart | |2D matrix in a column of a data frame |@dnlakhotia | |subgroups |@enoches | |paragraph grouping |@gshotwell | |Highlighted Collapsed Factor |@PragmaticDon | |small multiples |@nacnudus | |Replies to Jenny |NA | |Merged cells gone wild |@RikaGorn | |windowmakers, widowmakers |@polesasunder | |rowgory, separators |@EmilyRiederer | |Factros (factor rows) |@EmilyRiederer | |Growps = row + groups |@thmscwlls | |20 minutes of uninterrupted screaming |@tpoi | |premature tabulation |@pdalgd | |Read bumps |@MilesMcBain | |Row group headers |@dmik3 | |factor interruptus |@zentree | |Beheaders |@djhocking | |Third Abnormal Form |@pitakakariki | |Hydra |@JasonWilliamsNY | |stubs |@IanDennisMiller | |nuisance categorical (or subgroup) variables |@nspyrison | |Categorical nuisance formatting |@nspyrison | |Business logic |@doomsuckle | |Data beheading! Factorless features, grouping gone wrong... |@SamanthaSifleet | |Adjacent attribution |@dagoodman1 | |group names |@benomial | |facet but in tabular form |@kdpsinghlab | |murder of rows |@RileenSinha | |GroupNotRow |@kevin_lanning | Overall, there seemed to be no clear-cut consensus but a few themes kept popping up, such as: groups, subgroups, headers, row groups, etc. Everyone is familiar with this somewhat annoying practice, and people from different disciplines pitched in with interpretations that often invoked concepts from database normalization or pivot tables. Personally, I'm now partial to calling these things **embedded subheaders**. The header row typically contains the variable names, and the subheader concept seems more flexible. In this case they are embedded in the data rectangle to define subgroups or slices of data, equivalent to the **small multiples** concept from data visualization, as suggested by Duncan Garmonsway in his [Spreadsheet Munging](https://nacnudus.github.io/spreadsheet-munging-strategies/index.html) book. I particularly liked **adjacent attribution** (suggested by Daniel Goodman) as a way to explain how embedded subheaders are expected to work. From what I could find out, this is a term from computer science used when defining clauses used to parse text strings. Embedded subheaders imply that the rows below them belong to a subgroup until a new subheader indicates otherwise, so establishing membership across different groups is a good example of attribution by adjaceny. Lastly, I liked the name _factros_ (factor rows) suggested by Emily Riederer, it has a cool _tidyverse_ ring to it and I when I update the documentation for _unheadr_ (an [R](https://github.com/luisDVA/unheadr) package that can untangle most cases of embedded subheaders) with everyone's feedback I will try to work it in. If you have any other suggestions please let me know.
luisDVA/luisdva.github.io
_posts/2018-09-14-spreadsheet-hijinks.md
Markdown
mit
7,271
#include <iostream> #include <sstream> #include <vector> #include <cmath> #include <reader.hpp> #include <writer.hpp> using namespace std; using namespace jam; struct JoinK { JoinK(vector<vector<char>>&& input, int kIn) : g(input), k(kIn) { n = g.size(); } void rotate() { for (auto& v : g) { v.erase(remove(v.begin(), v.end(), '.'), v.end()); v.insert(v.begin(), g.size() - v.size(), '.'); } } bool winAt(int i, int j, char c) { bool winRight = false, winDown = false, winDiagRight = false, winDiagLeft = false; if (i <= n - k) { winDown = true; for (int x = i; x < i + k; ++x) { if (g[x][j] != c) { winDown = false; break; } } } if (j <= n - k) { winRight = true; for (int x = j; x < j + k; ++x) { if (g[i][x] != c) { winRight = false; break; } } } if (i <= n - k && j >= k - 1) { winDiagLeft = true; for (int x = 0; x < k; ++x) { if (g[i + x][j - x] != c) { winDiagLeft = false; break; } } } if (i <= n - k && j <= n - k) { winDiagRight = true; for (int x = 0; x < k; ++x) { if (g[i + x][j + x] != c) { winDiagRight = false; break; } } } return winRight || winDown || winDiagRight || winDiagLeft; } bool winFor(char c) { for (int i = 0; i < n; ++i) { for (int j = 0; j < n; ++j) { if (winAt(i, j, c)) { return true; } } } return false; } void dump() { cout << endl; for (int i = 0; i < n; ++i) { for (int j = 0; j < n; ++j) { cout << g[i][j]; } cout << endl; } } string result() { //dump(); bool redWins = winFor('R'); bool blueWins = winFor('B'); if (redWins && blueWins) return "Both"; else if (redWins) return "Red"; else if (blueWins) return "Blue"; else return "Neither"; } vector<vector<char>> g; int k; size_t n = 0; }; int main(int argc, char** argv) { Writer w(argc, argv); Reader r(argc, argv); stringstream ss; int numCases = 0; r.nextLine(ss); ss >> numCases; for (int i = 0; i < numCases; ++i) { r.nextLine(ss); int n, k; ss >> n >> k; vector<vector<char>> input; for (int j = 0; j < n; ++j) { r.nextLine(ss); string line; ss >> line; vector<char> temp; move(line.begin(), line.end(), back_inserter(temp)); input.push_back(temp); } JoinK j(move(input), k); j.rotate(); w.out() << "Case #" << (i + 1) << ": " << j.result() << '\n'; } return 0; }
zenonparker/googlejam
contests/2010_round1a_may_22/a/main.cpp
C++
mit
2,533
"use strict";require("retape")(require("./index"))
SunboX/fxos-washing-machine_interface
b2g_sdk/34.0a1-2014-08-12-04-02-01/B2G.app/Contents/MacOS/modules/commonjs/diffpatcher/test/tap.js
JavaScript
mit
50
--- title: Scala 入门笔记 author: He Tao date: 2015-03-28 tag: [Scala] category: 编程语言 layout: post --- Scala初学笔记。 Hello World in Scala --------------------- 学习Scala的语法,还是从Hello World开始吧: ```scala object HelloWorld { def main(args: Array[String]) { print("Hello World, Scala!") } } ``` <!--more--> 编译, scalac HelloWorld.scala <!--more--> 运行, scala -classpath . HelloWorld 在控制台输出: Hello World, Scala! 跟Java挺像!需要**注意**的是,`main`函数没有返回值(procedure method)。 在Scala中,可以每行写一条语句,行末不用使用`;`分隔,如果在同一行书写多条语句,语句间需要用`;`隔开。 Interaction with Java --------------------- Scala运行于JVM之上,Scala代码也很容易与Java代码进行交互。Scala中,可以使用`import`来导入Java的包,`java.lang`包会默认导入,其他的包需要显式导入。Scala中的`import`与Java相比有一些语法上的扩展,使得更灵活易用。例如: import java.lang.{Math, Boolean} // import Math 和 Boolean import java.lang.Math._ // import java.lang.Math包中的所有内容 Scala与Java进行代码级的交互的例子: ```scala import java.util.{Data, Locale} object Main { def main(args: Array[String]) { val now = new Date print(now) } } ``` 编译,运行,得到输出: Thu Mar 26 23:31:14 CST 2015 面向对象特性 ------------ Scala是一门纯面向对象的语言(a pure object-oritented language),一切皆对象,(everything is an object),包括数字、函数等。在这一点上,Scala与Java之间存在差异,Java中区分基本类型与引用类型,例如boolean与Boolean、int与Integer,并且,在Java中,函数不能被当成值来操作。 纯面向对象的一个体现: 1+2*3 等价于: 1.+(2.*(3)) 运算符`+`、`-`、`*`、`/`等都是number对象的方法。 Scala中,函数也是对象,可以把函数当成值来传参和作为函数返回值,这也是Scala函数式编程特性的体现。将函数作为参数传递时类似C/C++中的函数指针。如下例: ```scala object Main { def timer(callback: () => Unit) : Unit { var cnt = 0 // var表示定义变量 while(cnt < 10) { Thread sleep 2000 cnt += 1 callback() } } def task() : Unit { println("working...") } def main(args: Array[String]) : Unit { timer(task) } ``` 此处,`timer`函数进行传递回调函数是,还可以使用匿名函数,写成这样: ```scala timer(() => Unit { println("working...") }) ``` 面向对象自然少不了类的概念,在Scala中,也是用`class`关键字来定义类。例如,用Scala定义一个Person类: ```scala class Student { private var id = Int.MaxValue def setId(id: Int) { } } class Person(id: Integer, name: String) { } ``` 可以用 var p = new Person(10, "abcd") 来实例化得到一个Person类的对象p。 同样,在类中也可以定义类的方法和属性,只是在这一点上Scala更多地具有函数式编程的特点。在这一点上,Scala的语法与Haskell的**“绑定”**类似。举例: ```scala class Person(id: Integer, name: String) { def aid = id def aname = name def getId(pid: Integer) = id def getName(pname: String) = name } ``` 实例化类得到对象并调用类的方法,操作(读/写)类的属性:
compile-me/compile-me.github.io
_posts/programming-language/scala/2015-03-26-scala_begin.md
Markdown
mit
3,675
/** * Copyright © 2009-2012 A. Matías Quezada */ use('sassmine').on(function(sas) { var Block = Class.extend({ constructor: function(message, code) { this.base(); this.message = message; this.code = code; this.before = []; this.after = []; }, execute: function() { this.code.call(null, sas); }, addBeforeEach: function(action) { this.before.push(action); }, addAfterEach: function(action) { this.after.push(action); }, beforeEach: function() { for (var i = 0; i < this.before.length; i++) this.before[i].call(null, sas); }, afterEach: function() { for (var i = 0; i < this.after.length; i++) this.after[i].call(null, sas); } }); sas.Spec = sas.Suite = Block.extend(); });
amatiasq/Sassmine
lib/Block.js
JavaScript
mit
753
#include <Core/Platform.h> #include <Shared/misc.h> #include <Core/Core.h> #include "DebugCamera.h" #include "SceneTools.h" DebugCamera::DebugCamera(Pimp::World* world) : world(world) , isEnabled(false) , isLookingAt(false) { ASSERT(nullptr != world); camera = new Pimp::Camera(world); world->GetElements().push_back(camera); camera->SetFOVy(0.563197f); xform = new Pimp::Xform(world); world->GetElements().push_back(xform); AddChildToParent(xform,world->GetRootNode()); AddChildToParent(camera,xform); } void DebugCamera::SetEnabled( bool enabled ) { if (enabled == isEnabled) return; else { isEnabled = enabled; if (true == isEnabled) { // Adopt current camera. Pimp::Camera* prevCam = world->GetCamera(); ASSERT(prevCam->GetParents().size() == 1); Pimp::Node* prevCamParent = prevCam->GetParents()[0]; ASSERT(prevCamParent->GetType() == Pimp::ET_Xform); Pimp::Xform* prevDirectedCamXform = static_cast<Pimp::Xform*>(prevCamParent); // And then set it as ours. xform->SetTranslation(prevDirectedCamXform->GetTranslation()); xform->SetRotation(prevDirectedCamXform->GetRotation()); world->SetCamera(camera); } } } void DebugCamera::Move( const Vector3& directionViewSpace ) { float speed = 1.0f; //< Totally framerate-dependent movement speed Vector3 dirWorld = xform->GetWorldTransform()->TransformNormal(directionViewSpace); Vector3 pos = xform->GetTranslation(); pos += dirWorld * speed; xform->SetTranslation(pos); } void DebugCamera::Roll(bool positive) { Quaternion rot = xform->GetRotation(); const float rollAmount = 0.10f; //< Totally framerate-dependent roll amount rot = CreateQuaternionFromYawPitchRoll(0, 0, positive ? rollAmount : -rollAmount) * rot; xform->SetRotation(rot); } void DebugCamera::StartLookAt() { ASSERT(!isLookingAt); isLookingAt = true; lookAtInitialRotation = xform->GetRotation(); } void DebugCamera::EndLookAt() { ASSERT(isLookingAt); isLookingAt = false; } void DebugCamera::LookAt(int deltaMouseX, int deltaMouseY) { ASSERT(isLookingAt); // Calculate new orientation const float mouseSensitivity = -0.01f; float yaw = deltaMouseX * mouseSensitivity; float pitch = deltaMouseY * mouseSensitivity; Quaternion camOrientationDelta = CreateQuaternionFromYawPitchRoll(yaw, pitch, 0); Quaternion newRot = camOrientationDelta * lookAtInitialRotation; xform->SetRotation(newRot); } void DebugCamera::DumpCurrentTransformToOutputWindow() { Quaternion rot = xform->GetRotation(); Vector3 pos = xform->GetTranslation(); Vector3 rotEulerXYZ = rot.GetEulerAnglesXYZ(); DEBUG_LOG("Current debug camera transform:"); DEBUG_LOG("X = %.2ff", pos.x); DEBUG_LOG("Y = %.2ff", pos.y); DEBUG_LOG("Z = %.2ff", pos.z); DEBUG_LOG("X = %.2ff", rot.x); DEBUG_LOG("Y = %.2ff", rot.y); DEBUG_LOG("Z = %.2ff", rot.z); DEBUG_LOG("W = %.2ff", rot.w); }
visualizersdotnl/tpb-06-final
Src/Player/DebugCamera.cpp
C++
mit
2,869
--- redirect_from: '/webmaster.html' --- Page to test redirection artefacts
jekyll/jekyll-admin
spec/fixtures/site/support.md
Markdown
mit
77
#ifndef OPENTISSUE_COLLISION_SDF_SDF_COMPUTE_POINT_SAMPLING_H #define OPENTISSUE_COLLISION_SDF_SDF_COMPUTE_POINT_SAMPLING_H // // OpenTissue Template Library // - A generic toolbox for physics-based modeling and simulation. // Copyright (C) 2008 Department of Computer Science, University of Copenhagen. // // OTTL is licensed under zlib: http://opensource.org/licenses/zlib-license.php // #include <OpenTissue/configuration.h> #include <OpenTissue/core/containers/mesh/mesh.h> #include <boost/cast.hpp> //--- Needed for boost::numerical_cast #include <list> namespace OpenTissue { namespace sdf { /** * Compute Point Sampling. * This function tries to resample a mesh geometry to better fit the * resolution of the corresponding signed distance map. * * @param mesh The surface mesh from which a point sampling is computed. * @param phi The signed distance field corresponding to the specified mesh. * * @param edge_resolution Threshold value, indicating the sampling * resolution along edges. If zero it will be * computed on the fly, to match the resolution * of the signed distance map. * * @param face_sampling Boolean flag indicating wheter face sampling is on or off. * * @param points Upon return this argument holds the computed point sampling. */ template<typename mesh_type,typename grid_type, typename point_container> void compute_point_sampling( mesh_type /*const*/ & mesh , grid_type const & phi , double edge_resolution , bool face_sampling , point_container & points ) { using std::min; using std::max; using std::sqrt; typedef typename mesh_type::vertex_iterator vertex_iterator; typedef typename mesh_type::halfedge_iterator halfedge_iterator; typedef typename mesh_type::face_iterator face_iterator; typedef typename mesh_type::face_type face_type; typedef typename mesh_type::halfedge_type halfedge_type; typedef typename mesh_type::face_halfedge_circulator face_halfedge_circulator; typedef typename std::list<face_type*> face_queue; typedef typename mesh_type::math_types math_types; typedef typename math_types::vector3_type vector3_type; typedef typename math_types::real_type real_type; assert(edge_resolution>=0 || !"compute_point_sampling(): edge resolution was negative"); mesh::clear_vertex_tags( mesh); mesh::clear_halfedge_tags( mesh); mesh::clear_face_tags( mesh); points.clear(); //--- Ignore vertices in flat regions for(vertex_iterator v = mesh.vertex_begin();v!=mesh.vertex_end();++v) { v->m_tag = 1; if(!is_convex( *v ) ) continue; points.push_back( v->m_coord ); } //--- long flat edges are linearly sub-samplet, to help catch edge-face intersections. real_type tmp = boost::numeric_cast<real_type>( edge_resolution ); real_type threshold = max(tmp, sqrt( phi.dx()*phi.dx() + phi.dy()*phi.dy() + phi.dz()*phi.dz() )); for(halfedge_iterator h = mesh.halfedge_begin();h!=mesh.halfedge_end();++h) { if(h->m_tag) continue; h->m_tag = 1; h->get_twin_iterator()->m_tag = 1; if(!is_convex( *h ) ) continue; vector3_type u = h->get_destination_iterator()->m_coord - h->get_origin_iterator()->m_coord; real_type lgth = sqrt(u*u); if(lgth>threshold) { u /= lgth; vector3_type p = h->get_origin_iterator()->m_coord; real_type t = threshold; while(t<lgth) { p += u*threshold; t += threshold; points.push_back( p ); } } } //--- Objects perfectly aligned along flat faces, may penetrate, to //--- avoid this, centroid point of flat regions are added to sample points. if(face_sampling) { vector3_type Ai,ai,ei; real_type area_test = max( phi.dx()*phi.dy(), max(phi.dx()*phi.dz(),phi.dy()*phi.dz())); for(face_iterator face = mesh.face_begin();face!=mesh.face_end();++face) { if(face->m_tag) continue; real_type area = 0; vector3_type centroid = vector3_type(0,0,0); unsigned int size = 0; face_queue Q; Q.push_back( &(*face) ); face->m_tag = 1; while(!Q.empty()) { face_type * cur = Q.front();Q.pop_front(); face_halfedge_circulator h(*cur),hend; for(;h!=hend;++h) { ai = h->get_origin_iterator()->m_coord; ei = h->get_destination_iterator()->m_coord - ai; Ai = ai % ei; area += 0.5*sqrt(Ai*Ai); ++size; centroid += h->get_origin_iterator()->m_coord; if(h->get_twin_iterator()->get_face_handle().is_null()) continue; face_type * neighbor = &(*h->get_twin_iterator()->get_face_iterator()); bool unseen = !neighbor->m_tag; // TODO 2007-02-08: polymesh specific, bad idea bool coplanar = is_planar(*h); if(unseen && coplanar) { neighbor->m_tag = 1; Q.push_back(neighbor); } } } if(size && area > area_test) { centroid /= size; points.push_back( centroid ); } } } } } // namespace sdf } // namespace OpenTissue // OPENTISSUE_COLLISION_SDF_SDF_COMPUTE_POINT_SAMPLING_H #endif
misztal/GRIT
3RDPARTY/OpenTissue/OpenTissue/collision/sdf/sdf_compute_point_sampling.h
C
mit
5,941
<?xml version="1.0" ?><!DOCTYPE TS><TS language="fa_IR" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About callcoin</source> <translation>در مورد بیتکویین</translation> </message> <message> <location line="+39"/> <source>&lt;b&gt;callcoin&lt;/b&gt; version</source> <translation>&lt;b&gt;callcoin&lt;/b&gt; version</translation> </message> <message> <location line="+57"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young ([email protected]) and UPnP software written by Thomas Bernard.</source> <translation type="unfinished"/> </message> <message> <location filename="../aboutdialog.cpp" line="+14"/> <source>Copyright</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>The callcoin developers</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation>دفترچه آدرس</translation> </message> <message> <location line="+19"/> <source>Double-click to edit address or label</source> <translation>برای ویرایش آدرس/برچسب دوبار کلیک نمایید</translation> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation>یک آدرس جدید بسازید</translation> </message> <message> <location line="+14"/> <source>Copy the currently selected address to the system clipboard</source> <translation>آدرس انتخاب شده را در کلیپ بوردِ سیستم کپی کنید</translation> </message> <message> <location line="-11"/> <source>&amp;New Address</source> <translation>و آدرس جدید</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+63"/> <source>These are your callcoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source> <translation type="unfinished"/> </message> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>&amp;Copy Address</source> <translation>و کپی آدرس</translation> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation>نشان و کد QR</translation> </message> <message> <location line="+11"/> <source>Sign a message to prove you own a callcoin address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Delete the currently selected address from the list</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Export the data in the current tab to a file</source> <translation>صدور داده نوار جاری به یک فایل</translation> </message> <message> <location line="+3"/> <source>&amp;Export</source> <translation type="unfinished"/> </message> <message> <location line="-44"/> <source>Verify a message to ensure it was signed with a specified callcoin address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>&amp;Delete</source> <translation>و حذف</translation> </message> <message> <location filename="../addressbookpage.cpp" line="-5"/> <source>These are your callcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Copy &amp;Label</source> <translation>کپی و برچسب</translation> </message> <message> <location line="+1"/> <source>&amp;Edit</source> <translation>و ویرایش</translation> </message> <message> <location line="+1"/> <source>Send &amp;Coins</source> <translation type="unfinished"/> </message> <message> <location line="+260"/> <source>Export Address Book Data</source> <translation>انتقال اطلاعات دفترچه آدرس</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>سی.اس.وی. (فایل جداگانه دستوری)</translation> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation>صدور پیام خطا</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>قابل کپی در فایل نیست %1</translation> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+144"/> <source>Label</source> <translation>برچسب</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>آدرس</translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation>(برچسب ندارد)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation>رمز/پَس فرِیز را وارد کنید</translation> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation>رمز/پَس فرِیز جدید را وارد کنید</translation> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation>رمز/پَس فرِیز را دوباره وارد کنید</translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="+33"/> <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;10 or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source> <translation>رمز/پَس فرِیز جدید را در wallet وارد کنید. برای انتخاب رمز/پَس فرِیز از 10 کاراکتر تصادفی یا بیشتر و یا هشت کلمه یا بیشتر استفاده کنید. </translation> </message> <message> <location line="+1"/> <source>Encrypt wallet</source> <translation>wallet را رمزگذاری کنید</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>برای انجام این عملکرد به رمز/پَس فرِیزِwallet نیاز است تا آن را از حالت قفل درآورد.</translation> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation>باز کردن قفل wallet </translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>برای کشف رمز wallet، به رمز/پَس فرِیزِwallet نیاز است.</translation> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation>کشف رمز wallet</translation> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation>تغییر رمز/پَس فرِیز</translation> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation>رمز/پَس فرِیزِ قدیم و جدید را در wallet وارد کنید</translation> </message> <message> <location line="+46"/> <source>Confirm wallet encryption</source> <translation>رمزگذاری wallet را تایید کنید</translation> </message> <message> <location line="+1"/> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR SKEINCOINS&lt;/b&gt;!</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <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 type="unfinished"/> </message> <message> <location line="+100"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation type="unfinished"/> </message> <message> <location line="-130"/> <location line="+58"/> <source>Wallet encrypted</source> <translation>تایید رمزگذاری</translation> </message> <message> <location line="-56"/> <source>callcoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your callcoins from being stolen by malware infecting your computer.</source> <translation>callcoin برای اتمام فرایند رمزگذاری بسته خواهد شد. به خاطر داشته باشید که رمزگذاری WALLET شما، کامپیوتر شما را از آلودگی به بدافزارها مصون نمی دارد.</translation> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+42"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation>رمزگذاری تایید نشد</translation> </message> <message> <location line="-54"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>رمزگذاری به علت خطای داخلی تایید نشد. wallet شما رمزگذاری نشد</translation> </message> <message> <location line="+7"/> <location line="+48"/> <source>The supplied passphrases do not match.</source> <translation>رمزهای/پَس فرِیزهایِ وارد شده با هم تطابق ندارند</translation> </message> <message> <location line="-37"/> <source>Wallet unlock failed</source> <translation>قفل wallet باز نشد</translation> </message> <message> <location line="+1"/> <location line="+11"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>رمزهای/پَس فرِیزهایِ وارد شده wallet برای کشف رمز اشتباه است.</translation> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation>کشف رمز wallet انجام نشد</translation> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation type="unfinished"/> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+233"/> <source>Sign &amp;message...</source> <translation>امضا و پیام</translation> </message> <message> <location line="+280"/> <source>Synchronizing with network...</source> <translation>به روز رسانی با شبکه...</translation> </message> <message> <location line="-349"/> <source>&amp;Overview</source> <translation>و بازبینی</translation> </message> <message> <location line="+1"/> <source>Show general overview of wallet</source> <translation>نمای کلی از wallet را نشان بده</translation> </message> <message> <location line="+20"/> <source>&amp;Transactions</source> <translation>و تراکنش</translation> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation>تاریخچه تراکنش را باز کن</translation> </message> <message> <location line="+7"/> <source>Edit the list of stored addresses and labels</source> <translation>فهرست آدرسها و برچسبهای ذخیره شده را ویرایش کن</translation> </message> <message> <location line="-14"/> <source>Show the list of addresses for receiving payments</source> <translation>فهرست آدرسها را برای دریافت وجه نشان بده</translation> </message> <message> <location line="+31"/> <source>E&amp;xit</source> <translation>خروج</translation> </message> <message> <location line="+1"/> <source>Quit application</source> <translation>از &quot;درخواست نامه&quot;/ application خارج شو</translation> </message> <message> <location line="+4"/> <source>Show information about callcoin</source> <translation>اطلاعات در مورد callcoin را نشان بده</translation> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation>درباره و QT</translation> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation>نمایش اطلاعات درباره QT</translation> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation>و انتخابها</translation> </message> <message> <location line="+6"/> <source>&amp;Encrypt Wallet...</source> <translation>و رمزگذاری wallet</translation> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation>و گرفتن نسخه پیشتیبان از wallet</translation> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation>تغییر رمز/پَس فرِیز</translation> </message> <message> <location line="+285"/> <source>Importing blocks from disk...</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Reindexing blocks on disk...</source> <translation type="unfinished"/> </message> <message> <location line="-347"/> <source>Send coins to a callcoin address</source> <translation type="unfinished"/> </message> <message> <location line="+49"/> <source>Modify configuration options for callcoin</source> <translation>اصلاح انتخابها برای پیکربندی callcoin</translation> </message> <message> <location line="+9"/> <source>Backup wallet to another location</source> <translation>گرفتن نسخه پیشتیبان در آدرسی دیگر</translation> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation>رمز مربوط به رمزگذاریِ wallet را تغییر دهید</translation> </message> <message> <location line="+6"/> <source>&amp;Debug window</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation type="unfinished"/> </message> <message> <location line="-4"/> <source>&amp;Verify message...</source> <translation type="unfinished"/> </message> <message> <location line="-165"/> <location line="+530"/> <source>callcoin</source> <translation>callcoin</translation> </message> <message> <location line="-530"/> <source>Wallet</source> <translation>کیف پول</translation> </message> <message> <location line="+101"/> <source>&amp;Send</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Receive</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>&amp;Addresses</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>&amp;About callcoin</source> <translation>&amp;در مورد بیتکویین</translation> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation>&amp;نمایش/ عدم نمایش و</translation> </message> <message> <location line="+1"/> <source>Show or hide the main Window</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Encrypt the private keys that belong to your wallet</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Sign messages with your callcoin addresses to prove you own them</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Verify messages to ensure they were signed with specified callcoin addresses</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>&amp;File</source> <translation>و فایل</translation> </message> <message> <location line="+7"/> <source>&amp;Settings</source> <translation>و تنظیمات</translation> </message> <message> <location line="+6"/> <source>&amp;Help</source> <translation>و راهنما</translation> </message> <message> <location line="+9"/> <source>Tabs toolbar</source> <translation>نوار ابزار</translation> </message> <message> <location line="+17"/> <location line="+10"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> <message> <location line="+47"/> <source>callcoin client</source> <translation>مشتری callcoin</translation> </message> <message numerus="yes"> <location line="+141"/> <source>%n active connection(s) to callcoin network</source> <translation><numerusform>%n ارتباط فعال به شبکه callcoin %n ارتباط فعال به شبکه callcoin</numerusform></translation> </message> <message> <location line="+22"/> <source>No block source available...</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Processed %1 of %2 (estimated) blocks of transaction history.</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Processed %1 blocks of transaction history.</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+20"/> <source>%n hour(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n week(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+4"/> <source>%1 behind</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Last received block was generated %1 ago.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Transactions after this will not yet be visible.</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>Error</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Information</source> <translation type="unfinished"/> </message> <message> <location line="+70"/> <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source> <translation type="unfinished"/> </message> <message> <location line="-140"/> <source>Up to date</source> <translation>روزآمد</translation> </message> <message> <location line="+31"/> <source>Catching up...</source> <translation>در حال روزآمد سازی..</translation> </message> <message> <location line="+113"/> <source>Confirm transaction fee</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Sent transaction</source> <translation>ارسال تراکنش</translation> </message> <message> <location line="+0"/> <source>Incoming transaction</source> <translation>تراکنش دریافتی</translation> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>تاریخ: %1⏎ میزان وجه : %2⏎ نوع: %3⏎ آدرس: %4⏎ </translation> </message> <message> <location line="+33"/> <location line="+23"/> <source>URI handling</source> <translation type="unfinished"/> </message> <message> <location line="-23"/> <location line="+23"/> <source>URI can not be parsed! This can be caused by an invalid callcoin address or malformed URI parameters.</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation>wallet رمزگذاری شد و در حال حاضر از حالت قفل در آمده است</translation> </message> <message> <location line="+8"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation>wallet رمزگذاری شد و در حال حاضر قفل است</translation> </message> <message> <location filename="../bitcoin.cpp" line="+111"/> <source>A fatal error occurred. callcoin can no longer continue safely and will quit.</source> <translation type="unfinished"/> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+104"/> <source>Network Alert</source> <translation>هشدار شبکه</translation> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation>ویرایش آدرسها</translation> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation>و برچسب</translation> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation>برچسب مربوط به این دفترچه آدرس</translation> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation>و آدرس</translation> </message> <message> <location line="+10"/> <source>The address associated with this address book entry. This can only be modified for sending addresses.</source> <translation>برچسب مربوط به این دفترچه آدرس و تنها ب</translation> </message> <message> <location filename="../editaddressdialog.cpp" line="+21"/> <source>New receiving address</source> <translation>آدرسِ دریافت کننده جدید</translation> </message> <message> <location line="+4"/> <source>New sending address</source> <translation>آدرس ارسال کننده جدید</translation> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation>ویرایش آدرسِ دریافت کننده</translation> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation>ویرایش آدرسِ ارسال کننده</translation> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation>آدرس وارد شده %1 قبلا به فهرست آدرسها اضافه شده بوده است.</translation> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid callcoin address.</source> <translation>آدرس وارد شده &quot;%1&quot; یک آدرس صحیح برای callcoin نسشت</translation> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation>عدم توانیی برای قفل گشایی wallet</translation> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation>عدم توانیی در ایجاد کلید جدید</translation> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+424"/> <location line="+12"/> <source>callcoin-Qt</source> <translation type="unfinished"/> </message> <message> <location line="-12"/> <source>version</source> <translation>نسخه</translation> </message> <message> <location line="+2"/> <source>Usage:</source> <translation>میزان استفاده:</translation> </message> <message> <location line="+1"/> <source>command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>UI options</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation type="unfinished"/> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation>انتخاب/آپشن</translation> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Automatically start callcoin after logging in to the system.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Start callcoin on system login</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Reset all client options to default.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Reset Options</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>&amp;Network</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Automatically open the callcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Connect to the callcoin network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation type="unfinished"/> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting callcoin.</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Whether to show callcoin addresses in the transaction list or not.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation>و نمایش آدرسها در فهرست تراکنش</translation> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation>و تایید</translation> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation>و رد</translation> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation>و به کار گرفتن</translation> </message> <message> <location filename="../optionsdialog.cpp" line="+53"/> <source>default</source> <translation>پیش فرض</translation> </message> <message> <location line="+130"/> <source>Confirm options reset</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Some settings may require a client restart to take effect.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Do you want to proceed?</source> <translation type="unfinished"/> </message> <message> <location line="+42"/> <location line="+9"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting callcoin.</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation type="unfinished"/> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation>فرم</translation> </message> <message> <location line="+50"/> <location line="+166"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the callcoin network after a connection is established, but this process has not completed yet.</source> <translation>اطلاعات نمایش داده شده ممکن است روزآمد نباشد. wallet شما به صورت خودکار بعد از برقراری اتصال با شبکه callcoin به روز می شود اما این فرایند هنوز تکمیل نشده است.</translation> </message> <message> <location line="-124"/> <source>Balance:</source> <translation>مانده حساب:</translation> </message> <message> <location line="+29"/> <source>Unconfirmed:</source> <translation>تایید نشده</translation> </message> <message> <location line="-78"/> <source>Wallet</source> <translation>کیف پول</translation> </message> <message> <location line="+107"/> <source>Immature:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation type="unfinished"/> </message> <message> <location line="+46"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation>تراکنشهای اخیر</translation> </message> <message> <location line="-101"/> <source>Your current balance</source> <translation>مانده حساب جاری</translation> </message> <message> <location line="+29"/> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source> <translation>تعداد تراکنشهایی که نیاز به تایید دارند و هنوز در مانده حساب جاری شما به حساب نیامده اند</translation> </message> <message> <location filename="../overviewpage.cpp" line="+116"/> <location line="+1"/> <source>out of sync</source> <translation>خارج از روزآمد سازی</translation> </message> </context> <context> <name>PaymentServer</name> <message> <location filename="../paymentserver.cpp" line="+107"/> <source>Cannot start callcoin: click-to-pay handler</source> <translation type="unfinished"/> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation>درخواست وجه</translation> </message> <message> <location line="+56"/> <source>Amount:</source> <translation>میزان وجه:</translation> </message> <message> <location line="-44"/> <source>Label:</source> <translation>برچسب:</translation> </message> <message> <location line="+19"/> <source>Message:</source> <translation>پیام:</translation> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation>و ذخیره با عنوانِ...</translation> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation>متن وارد شده طولانی است، متنِ برچسب/پیام را کوتاه کنید</translation> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation>تصاویر با فرمت PNG (*.png)</translation> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <location line="+23"/> <location line="+26"/> <location line="+23"/> <location line="+23"/> <location line="+36"/> <location line="+53"/> <location line="+23"/> <location line="+23"/> <location filename="../rpcconsole.cpp" line="+339"/> <source>N/A</source> <translation type="unfinished"/> </message> <message> <location line="-217"/> <source>Client version</source> <translation type="unfinished"/> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation type="unfinished"/> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation type="unfinished"/> </message> <message> <location line="+49"/> <source>Startup time</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>Network</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>On testnet</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Block chain</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Last block time</source> <translation type="unfinished"/> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Show the callcoin-Qt help message to get a list with possible callcoin command-line options.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation type="unfinished"/> </message> <message> <location line="-260"/> <source>Build date</source> <translation type="unfinished"/> </message> <message> <location line="-104"/> <source>callcoin - Debug window</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>callcoin Core</source> <translation type="unfinished"/> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Open the callcoin debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation type="unfinished"/> </message> <message> <location line="+102"/> <source>Clear console</source> <translation type="unfinished"/> </message> <message> <location filename="../rpcconsole.cpp" line="-30"/> <source>Welcome to the callcoin RPC console.</source> <translation>به کنسول آر.پی.سی. SKEINCOIN خوش آمدید</translation> </message> <message> <location line="+1"/> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation type="unfinished"/> </message> </context> <context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> <location filename="../sendcoinsdialog.cpp" line="+124"/> <location line="+5"/> <location line="+5"/> <location line="+5"/> <location line="+6"/> <location line="+5"/> <location line="+5"/> <source>Send Coins</source> <translation>سکه های ارسالی</translation> </message> <message> <location line="+50"/> <source>Send to multiple recipients at once</source> <translation>ارسال همزمان به گیرنده های متعدد</translation> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation type="unfinished"/> </message> <message> <location line="+20"/> <source>Remove all transaction fields</source> <translation>تمامی فیلدهای تراکنش حذف شوند</translation> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>Balance:</source> <translation>مانده حساب:</translation> </message> <message> <location line="+10"/> <source>123.456 BTC</source> <translation>123.456 BTC</translation> </message> <message> <location line="+31"/> <source>Confirm the send action</source> <translation>تایید عملیات ارسال </translation> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation>و ارسال</translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-59"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation>%1 به %2 (%3)</translation> </message> <message> <location line="+5"/> <source>Confirm send coins</source> <translation>تایید ارسال سکه ها</translation> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation>شما مطمئن هستید که می خواهید %1 را ارسال کنید؟</translation> </message> <message> <location line="+0"/> <source> and </source> <translation>و</translation> </message> <message> <location line="+23"/> <source>The recipient address is not valid, please recheck.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation>میزان پرداخت باید بیشتر از 0 باشد</translation> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed!</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation>خطا: تراکنش تایید نشد. این خطا ممکن است به این دلیل اتفاق بیافتد که سکه های wallet شما خرج شده باشند مثلا اگر wallet.dat را مپی کرده باشید و سکه های شما در آن کپی استفاده شده باشند اما در اینجا نمایش داده نشده اند.</translation> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation>فرم</translation> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation>و میزان وجه</translation> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation>پرداخت و به چه کسی</translation> </message> <message> <location line="+34"/> <source>The address to send the payment to (e.g. X6ENACNZSWAvxM96TiGp3Du9YhVmbhweMa)</source> <translation type="unfinished"/> </message> <message> <location line="+60"/> <location filename="../sendcoinsentry.cpp" line="+26"/> <source>Enter a label for this address to add it to your address book</source> <translation>یک برچسب برای این آدرس بنویسید تا به دفترچه آدرسهای شما اضافه شود</translation> </message> <message> <location line="-78"/> <source>&amp;Label:</source> <translation>و برچسب</translation> </message> <message> <location line="+28"/> <source>Choose address from address book</source> <translation>آدرس از فهرست آدرس انتخاب کنید</translation> </message> <message> <location line="+10"/> <source>Alt+A</source> <translation>Alt و A</translation> </message> <message> <location line="+7"/> <source>Paste address from clipboard</source> <translation>آدرس را بر کلیپ بورد کپی کنید</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt و P</translation> </message> <message> <location line="+7"/> <source>Remove this recipient</source> <translation>این گیرنده را حذف کن</translation> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a callcoin address (e.g. X6ENACNZSWAvxM96TiGp3Du9YhVmbhweMa)</source> <translation>یک آدرس callcoin وارد کنید (مثال X6ENACNZSWAvxM96TiGp3Du9YhVmbhweMa)</translation> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>&amp;Sign Message</source> <translation>و امضای پیام </translation> </message> <message> <location line="+6"/> <source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. X6ENACNZSWAvxM96TiGp3Du9YhVmbhweMa)</source> <translation>یک آدرس callcoin وارد کنید (مثال X6ENACNZSWAvxM96TiGp3Du9YhVmbhweMa)</translation> </message> <message> <location line="+10"/> <location line="+213"/> <source>Choose an address from the address book</source> <translation>آدرس از فهرست آدرس انتخاب کنید</translation> </message> <message> <location line="-203"/> <location line="+213"/> <source>Alt+A</source> <translation>Alt و A</translation> </message> <message> <location line="-203"/> <source>Paste address from clipboard</source> <translation>آدرس را بر کلیپ بورد کپی کنید</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt و P</translation> </message> <message> <location line="+12"/> <source>Enter the message you want to sign here</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Signature</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Copy the current signature to the system clipboard</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this callcoin address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Reset all sign message fields</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation type="unfinished"/> </message> <message> <location line="-87"/> <source>&amp;Verify Message</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. X6ENACNZSWAvxM96TiGp3Du9YhVmbhweMa)</source> <translation>یک آدرس callcoin وارد کنید (مثال X6ENACNZSWAvxM96TiGp3Du9YhVmbhweMa)</translation> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified callcoin address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Verify &amp;Message</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Reset all verify message fields</source> <translation type="unfinished"/> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a callcoin address (e.g. X6ENACNZSWAvxM96TiGp3Du9YhVmbhweMa)</source> <translation>یک آدرس callcoin وارد کنید (مثال X6ENACNZSWAvxM96TiGp3Du9YhVmbhweMa)</translation> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Enter callcoin signature</source> <translation type="unfinished"/> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation type="unfinished"/> </message> <message> <location line="-81"/> <location line="+8"/> <location line="+73"/> <location line="+8"/> <source>Please check the address and try again.</source> <translation type="unfinished"/> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation type="unfinished"/> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation type="unfinished"/> </message> </context> <context> <name>SplashScreen</name> <message> <location filename="../splashscreen.cpp" line="+25"/> <source>The callcoin developers</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+20"/> <source>Open until %1</source> <translation>باز کن تا %1</translation> </message> <message> <location line="+6"/> <source>%1/offline</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation>%1 غیرقابل تایید</translation> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation>%1 تاییدها</translation> </message> <message> <location line="+18"/> <source>Status</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation>تاریخ</translation> </message> <message> <location line="+7"/> <source>Source</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Generated</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation type="unfinished"/> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>label</source> <translation>برچسب</translation> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation type="unfinished"/> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation type="unfinished"/> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Net amount</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Message</source> <translation>پیام</translation> </message> <message> <location line="+2"/> <source>Comment</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Generated coins must mature 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to &quot;not accepted&quot; and it won&apos;t be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Debug information</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Transaction</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Inputs</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Amount</source> <translation>میزان</translation> </message> <message> <location line="+1"/> <source>true</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>false</source> <translation type="unfinished"/> </message> <message> <location line="-209"/> <source>, has not been successfully broadcast yet</source> <translation>تا به حال با موفقیت انتشار نیافته است</translation> </message> <message numerus="yes"> <location line="-35"/> <source>Open for %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+70"/> <source>unknown</source> <translation>ناشناس</translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+14"/> <source>Transaction details</source> <translation>جزئیات تراکنش</translation> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation>این بخش جزئیات تراکنش را نشان می دهد</translation> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+225"/> <source>Date</source> <translation>تاریخ</translation> </message> <message> <location line="+0"/> <source>Type</source> <translation>نوع</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>آدرس</translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation>میزان وجه</translation> </message> <message numerus="yes"> <location line="+57"/> <source>Open for %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+3"/> <source>Open until %1</source> <translation>باز کن تا %1</translation> </message> <message> <location line="+3"/> <source>Offline (%1 confirmations)</source> <translation>برون خطی (%1 تاییدها)</translation> </message> <message> <location line="+3"/> <source>Unconfirmed (%1 of %2 confirmations)</source> <translation>تایید نشده (%1 از %2 تاییدها)</translation> </message> <message> <location line="+3"/> <source>Confirmed (%1 confirmations)</source> <translation>تایید شده (%1 تاییدها)</translation> </message> <message numerus="yes"> <location line="+8"/> <source>Mined balance will be available when it matures in %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+5"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation>این block توسط گره های دیگری دریافت نشده است و ممکن است قبول نشود</translation> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation>تولید شده اما قبول نشده است</translation> </message> <message> <location line="+43"/> <source>Received with</source> <translation>قبول با </translation> </message> <message> <location line="+2"/> <source>Received from</source> <translation>دریافت شده از</translation> </message> <message> <location line="+3"/> <source>Sent to</source> <translation>ارسال به</translation> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation>وجه برای شما </translation> </message> <message> <location line="+2"/> <source>Mined</source> <translation>استخراج شده</translation> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation>خالی</translation> </message> <message> <location line="+199"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>وضعیت تراکنش. با اشاره به این بخش تعداد تاییدها نمایش داده می شود</translation> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation>زمان و تاریخی که تراکنش دریافت شده است</translation> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation>نوع تراکنش</translation> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation>آدرس مقصد در تراکنش</translation> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation>میزان وجه کم شده یا اضافه شده به حساب</translation> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+52"/> <location line="+16"/> <source>All</source> <translation>همه</translation> </message> <message> <location line="-15"/> <source>Today</source> <translation>امروز</translation> </message> <message> <location line="+1"/> <source>This week</source> <translation>این هفته</translation> </message> <message> <location line="+1"/> <source>This month</source> <translation>این ماه</translation> </message> <message> <location line="+1"/> <source>Last month</source> <translation>ماه گذشته</translation> </message> <message> <location line="+1"/> <source>This year</source> <translation>این سال</translation> </message> <message> <location line="+1"/> <source>Range...</source> <translation>حدود..</translation> </message> <message> <location line="+11"/> <source>Received with</source> <translation>دریافت با</translation> </message> <message> <location line="+2"/> <source>Sent to</source> <translation>ارسال به</translation> </message> <message> <location line="+2"/> <source>To yourself</source> <translation>به شما</translation> </message> <message> <location line="+1"/> <source>Mined</source> <translation>استخراج شده</translation> </message> <message> <location line="+1"/> <source>Other</source> <translation>دیگر</translation> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation>آدرس یا برچسب را برای جستجو وارد کنید</translation> </message> <message> <location line="+7"/> <source>Min amount</source> <translation>حداقل میزان وجه</translation> </message> <message> <location line="+34"/> <source>Copy address</source> <translation>آدرس را کپی کنید</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>برچسب را کپی کنید</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>میزان وجه کپی شود</translation> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Edit label</source> <translation>برچسب را ویرایش کنید</translation> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation type="unfinished"/> </message> <message> <location line="+139"/> <source>Export Transaction Data</source> <translation>داده های تراکنش را صادر کنید</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Comma separated file (*.csv) فایل جداگانه دستوری</translation> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation>تایید شده</translation> </message> <message> <location line="+1"/> <source>Date</source> <translation>تاریخ</translation> </message> <message> <location line="+1"/> <source>Type</source> <translation>نوع</translation> </message> <message> <location line="+1"/> <source>Label</source> <translation>برچسب</translation> </message> <message> <location line="+1"/> <source>Address</source> <translation>آدرس</translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation>میزان</translation> </message> <message> <location line="+1"/> <source>ID</source> <translation>شناسه کاربری</translation> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation>خطا در ارسال</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>قابل کپی به فایل نیست %1.</translation> </message> <message> <location line="+100"/> <source>Range:</source> <translation>دامنه:</translation> </message> <message> <location line="+8"/> <source>to</source> <translation>به</translation> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+193"/> <source>Send Coins</source> <translation>سکه های ارسالی</translation> </message> </context> <context> <name>WalletView</name> <message> <location filename="../walletview.cpp" line="+42"/> <source>&amp;Export</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Export the data in the current tab to a file</source> <translation>صدور داده نوار جاری به یک فایل</translation> </message> <message> <location line="+193"/> <source>Backup Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Backup Successful</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>The wallet data was successfully saved to the new location.</source> <translation type="unfinished"/> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+94"/> <source>callcoin version</source> <translation>نسخه callcoin</translation> </message> <message> <location line="+102"/> <source>Usage:</source> <translation>میزان استفاده:</translation> </message> <message> <location line="-29"/> <source>Send command to -server or callcoind</source> <translation>ارسال دستور به سرور یا callcoined</translation> </message> <message> <location line="-23"/> <source>List commands</source> <translation>فهرست دستورها</translation> </message> <message> <location line="-12"/> <source>Get help for a command</source> <translation>درخواست کمک برای یک دستور</translation> </message> <message> <location line="+24"/> <source>Options:</source> <translation>انتخابها:</translation> </message> <message> <location line="+24"/> <source>Specify configuration file (default: callcoin.conf)</source> <translation>فایل پیکربندیِ را مشخص کنید (پیش فرض: callcoin.conf)</translation> </message> <message> <location line="+3"/> <source>Specify pid file (default: callcoind.pid)</source> <translation>فایل pid را مشخص کنید (پیش فرض: callcoind.pid)</translation> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation>دایرکتوری داده را مشخص کن</translation> </message> <message> <location line="-9"/> <source>Set database cache size in megabytes (default: 25)</source> <translation>حافظه بانک داده را به مگابایت تنظیم کنید (پیش فرض: 25)</translation> </message> <message> <location line="-28"/> <source>Listen for connections on &lt;port&gt; (default: 8333 or testnet: 18333)</source> <translation>ارتباطات را در &lt;PORT&gt; بشنوید (پیش فرض: 8333 or testnet: 18333)</translation> </message> <message> <location line="+5"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation>نگهداری &lt;N&gt; ارتباطات برای قرینه سازی (پیش فرض:125)</translation> </message> <message> <location line="-48"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation type="unfinished"/> </message> <message> <location line="+82"/> <source>Specify your own public address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>آستانه قطع برای قرینه سازی اشتباه (پیش فرض:100)</translation> </message> <message> <location line="-134"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>تعداد ثانیه ها برای اتصال دوباره قرینه های اشتباه (پیش فرض:86400)</translation> </message> <message> <location line="-29"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 8332 or testnet: 18332)</source> <translation>ارتباطاتِ JSON-RPC را در &lt;port&gt; گوش کنید (پیش فرض:8332)</translation> </message> <message> <location line="+37"/> <source>Accept command line and JSON-RPC commands</source> <translation>command line و JSON-RPC commands را قبول کنید</translation> </message> <message> <location line="+76"/> <source>Run in the background as a daemon and accept commands</source> <translation>به عنوان daemon بک گراند را اجرا کنید و دستورات را قبول نمایید</translation> </message> <message> <location line="+37"/> <source>Use the test network</source> <translation>از تستِ شبکه استفاده نمایید</translation> </message> <message> <location line="-112"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation type="unfinished"/> </message> <message> <location line="-80"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=callcoinrpc rpcpassword=%s (you do not need to remember this password) The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; for example: alertnotify=echo %%s | mail -s &quot;callcoin Alert&quot; [email protected] </source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Cannot obtain a lock on data directory %s. callcoin is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong callcoin will not work properly.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Block creation options:</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Connect only to the specified node(s)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Corrupted block database detected</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Do you want to rebuild the block database now?</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Error initializing block database</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error initializing wallet database environment %s!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error loading block database</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Error opening block database</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Error: Disk space is low!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error: Wallet locked, unable to create transaction!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error: system error: </source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to read block info</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to read block</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to sync block index</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write block index</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write block info</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write block</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write file info</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write to coin database</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write transaction index</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write undo data</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Find peers using DNS lookup (default: 1 unless -connect)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Generate coins (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>How many blocks to check at startup (default: 288, 0 = all)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-4, default: 3)</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Not enough file descriptors available.</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Rebuild block chain index from current blk000??.dat files</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Set the number of threads to service RPC calls (default: 4)</source> <translation type="unfinished"/> </message> <message> <location line="+26"/> <source>Verifying blocks...</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Verifying wallet...</source> <translation type="unfinished"/> </message> <message> <location line="-69"/> <source>Imports blocks from external blk000??.dat file</source> <translation type="unfinished"/> </message> <message> <location line="-76"/> <source>Set the number of script verification threads (up to 16, 0 = auto, &lt;0 = leave that many cores free, default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+77"/> <source>Information</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Invalid amount for -minrelaytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Invalid amount for -mintxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Maintain a full transaction index (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Only accept block chain matching built-in checkpoints (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Output extra debugging information. Implies all other -debug* options</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Prepend debug output with timestamp</source> <translation>برونداد اشکال زدایی با timestamp</translation> </message> <message> <location line="+5"/> <source>SSL options: (see the callcoin Wiki for SSL setup instructions)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation>ارسال اطلاعات پیگیری/خطایابی به کنسول به جای ارسال به فایل debug.log</translation> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation>ارسال اطاعات خطایابی/پیگیری به سیستم خطایاب</translation> </message> <message> <location line="+5"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Signing transaction failed</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation>تعیین مدت زمان وقفه (time out) به هزارم ثانیه</translation> </message> <message> <location line="+4"/> <source>System error: </source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Transaction amount too small</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Transaction amounts must be positive</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Transaction too large</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Username for JSON-RPC connections</source> <translation>شناسه کاربری برای ارتباطاتِ JSON-RPC</translation> </message> <message> <location line="+4"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>You need to rebuild the databases using -reindex to change -txindex</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>wallet.dat corrupt, salvage failed</source> <translation type="unfinished"/> </message> <message> <location line="-50"/> <source>Password for JSON-RPC connections</source> <translation>رمز برای ارتباطاتِ JSON-RPC</translation> </message> <message> <location line="-67"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>ارتباطاتِ JSON-RPC را از آدرس آی.پی. مشخصی برقرار کنید.</translation> </message> <message> <location line="+76"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation>دستورات را به گره اجرا شده در&lt;ip&gt; ارسال کنید (پیش فرض:127.0.0.1)</translation> </message> <message> <location line="-120"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation>دستور را وقتی بهترین بلاک تغییر کرد اجرا کن (%s در دستور توسط block hash جایگزین شده است)</translation> </message> <message> <location line="+147"/> <source>Upgrade wallet to latest format</source> <translation>wallet را به جدیدترین نسخه روزآمد کنید</translation> </message> <message> <location line="-21"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation>حجم key pool را به اندازه &lt;n&gt; تنظیم کنید (پیش فرض:100)</translation> </message> <message> <location line="-12"/> <source>Rescan the block chain for missing wallet transactions</source> <translation>زنجیره بلاک را برای تراکنش جا افتاده در WALLET دوباره اسکن کنید</translation> </message> <message> <location line="+35"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>برای ارتباطاتِ JSON-RPC از OpenSSL (https) استفاده کنید</translation> </message> <message> <location line="-26"/> <source>Server certificate file (default: server.cert)</source> <translation>فایل certificate سرور (پیش فرض server.cert)</translation> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation>رمز اختصاصی سرور (پیش فرض: server.pem)</translation> </message> <message> <location line="-151"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation>ciphers قابل قبول (پیش فرض: default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</translation> </message> <message> <location line="+165"/> <source>This help message</source> <translation>این پیام راهنما</translation> </message> <message> <location line="+6"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation type="unfinished"/> </message> <message> <location line="-91"/> <source>Connect through socks proxy</source> <translation type="unfinished"/> </message> <message> <location line="-10"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation type="unfinished"/> </message> <message> <location line="+55"/> <source>Loading addresses...</source> <translation>لود شدن آدرسها..</translation> </message> <message> <location line="-35"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>خطا در هنگام لود شدن wallet.dat: Wallet corrupted</translation> </message> <message> <location line="+1"/> <source>Error loading wallet.dat: Wallet requires newer version of callcoin</source> <translation>خطا در هنگام لود شدن wallet.dat. به نسخه جدید callcoin برای wallet نیاز است.</translation> </message> <message> <location line="+93"/> <source>Wallet needed to be rewritten: restart callcoin to complete</source> <translation>wallet نیاز به بازنویسی دارد. callcoin را برای تکمیل عملیات دوباره اجرا کنید.</translation> </message> <message> <location line="-95"/> <source>Error loading wallet.dat</source> <translation>خطا در هنگام لود شدن wallet.dat</translation> </message> <message> <location line="+28"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+56"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation type="unfinished"/> </message> <message> <location line="-96"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+44"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>میزان اشتباه است for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount</source> <translation>میزان اشتباه است</translation> </message> <message> <location line="-6"/> <source>Insufficient funds</source> <translation>وجوه ناکافی</translation> </message> <message> <location line="+10"/> <source>Loading block index...</source> <translation>لود شدن نمایه بلاکها..</translation> </message> <message> <location line="-57"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>یک گره برای اتصال اضافه کنید و تلاش کنید تا اتصال را باز نگاه دارید</translation> </message> <message> <location line="-25"/> <source>Unable to bind to %s on this computer. callcoin is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="+64"/> <source>Fee per KB to add to transactions you send</source> <translation>هزینه بر اساس کیلو بایت برای اضافه شدن به تراکنشی که ارسال کرده اید</translation> </message> <message> <location line="+19"/> <source>Loading wallet...</source> <translation>wallet در حال لود شدن است...</translation> </message> <message> <location line="-52"/> <source>Cannot downgrade wallet</source> <translation>قابلیت برگشت به نسخه قبلی برای wallet امکان پذیر نیست</translation> </message> <message> <location line="+3"/> <source>Cannot write default address</source> <translation>آدرس پیش فرض قابل ذخیره نیست</translation> </message> <message> <location line="+64"/> <source>Rescanning...</source> <translation>اسکنِ دوباره...</translation> </message> <message> <location line="-57"/> <source>Done loading</source> <translation>اتمام لود شدن</translation> </message> <message> <location line="+82"/> <source>To use the %s option</source> <translation>برای استفاده از %s از اختیارات</translation> </message> <message> <location line="-74"/> <source>Error</source> <translation>خطا</translation> </message> <message> <location line="-31"/> <source>You must set rpcpassword=&lt;password&gt; in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> <translation>شما باید یک رمز rpcpassword=&lt;password&gt; را در فایل تنظیمات ایجاد کنید⏎ %s ⏎ اگر فایل ایجاد نشده است، آن را با یک فایل &quot;فقط متنی&quot; ایجاد کنید. </translation> </message> </context> </TS>
callcoin/callcoin
src/qt/locale/bitcoin_fa_IR.ts
TypeScript
mit
107,444
The MIT License (MIT) Copyright (c) 2017 Santiago Chávez 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.
sanxofon/basicnlp
LICENSE.md
Markdown
mit
1,084
import { Component } from '@angular/core'; import { ContactService } from './contact.service'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { title = 'Simple Contacts Application'; constructor(private contactService:ContactService){ } }
csrahulram/contacts
ng/src/app/app.component.ts
TypeScript
mit
342
package org.moe.runtime class MoeSystem( private var STDOUT : java.io.PrintStream = Console.out, private var STDIN : java.io.BufferedReader = Console.in, private var STDERR : java.io.PrintStream = Console.err ) { def getSTDIN = STDIN def getSTDOUT = STDOUT def getSTDERR = STDERR def getEnv = sys.env def exit () = sys.exit() def exit (status: Int) = sys.exit(status) } /* * Might be useful to steal much of what is in here: * https://github.com/scala/scala/blob/v2.10.0/src/library/scala/Console.scala */
MoeOrganization/moe
src/main/scala/org/moe/runtime/MoeSystem.scala
Scala
mit
554
<?php use Phinx\Migration\AbstractMigration; class CreateCinemaTables extends AbstractMigration { public function change() { $movies = $this->table("movies", ['id' => true, 'primary_key' => 'id']); $movies->addColumn('kinopoisk_id', 'integer') ->addColumn('name', 'string') ->addColumn('poster', 'string') ->addColumn('data', 'text') ->addIndex(['kinopoisk_id']) ->save(); $sessions = $this->table("sessions", ['id' => true, 'primary_key' => 'id']); $sessions->addColumn('movie_id', 'integer') ->addColumn('time', 'datetime') ->addIndex(['movie_id']) ->save(); } }
kachkanar/website
db/migrations/20171019235147_create_cinema_tables.php
PHP
mit
735
import { delay } from "../delay" import { getOneTrustConsent } from "../getOneTrustConsent" import { oneTrustReady } from "../oneTrustReady" jest.mock("../delay") jest.mock("../oneTrustReady") describe("getOneTrustConsent", () => { const delayMock = delay as jest.Mock const oneTrustReadyMock = oneTrustReady as jest.Mock beforeEach(() => { delayMock.mockImplementation(() => Promise.resolve()) }) afterEach(() => { delayMock.mockRestore() oneTrustReadyMock.mockRestore() }) it("returns empty string if onetrust is never ready", async () => { oneTrustReadyMock.mockImplementation(() => { return false }) const result = await getOneTrustConsent() expect(delayMock).toHaveBeenCalledWith(10) expect(delayMock).toHaveBeenCalledTimes(101) expect(oneTrustReadyMock).toHaveBeenCalledWith() expect(oneTrustReadyMock).toHaveBeenCalledTimes(103) expect(result).toBe("") }) it("returns onetrust consent string if onetrust is ready", async () => { oneTrustReadyMock.mockImplementation(() => { return true }) window.OnetrustActiveGroups = "C0001" const result = await getOneTrustConsent() expect(delayMock).not.toHaveBeenCalled() expect(oneTrustReadyMock).toHaveBeenCalledWith() expect(result).toBe("C0001") }) })
artsy/force
src/lib/analytics/segmentOneTrustIntegration/__tests__/getOneTrustConsent.jest.ts
TypeScript
mit
1,310
'use strict' const { describe, it, beforeEach, afterEach } = require('mocha') const Helper = require('hubot-test-helper') const { expect } = require('chai') const mock = require('mock-require') const http = require('http') const sleep = m => new Promise(resolve => setTimeout(() => resolve(), m)) const request = uri => { return new Promise((resolve, reject) => { http .get(uri, res => { const result = { statusCode: res.statusCode } if (res.statusCode !== 200) { resolve(result) } else { res.setEncoding('utf8') let rawData = '' res.on('data', chunk => { rawData += chunk }) res.on('end', () => { result.body = rawData resolve(result) }) } }) .on('error', err => reject(err)) }) } const infoRutStub = { getPersonByRut (rut) { return new Promise((resolve, reject) => { if (rut === '11111111-1') { return resolve({ name: 'Anonymous', rut }) } else if (rut === '77777777-7') { return resolve({ name: 'Sushi', rut }) } else if (rut === '22222222-2') { return resolve(null) } reject(new Error('Not found')) }) }, getEnterpriseByRut (rut) { return new Promise((resolve, reject) => { if (rut === '11111111-1') { return resolve({ name: 'Anonymous', rut }) } else if (rut === '77777777-7') { return resolve({ name: 'Sushi', rut }) } else if (rut === '22222222-2') { return resolve(null) } reject(new Error('Not found')) }) }, getPersonByName (name) { return new Promise((resolve, reject) => { if (name === 'juan perez perez') { return resolve([ { rut: '11.111.111-1', name: 'Anonymous' }, { rut: '11.111.111-1', name: 'Anonymous' }, { rut: '11.111.111-1', name: 'Anonymous' }, { rut: '11.111.111-1', name: 'Anonymous' }, { rut: '11.111.111-1', name: 'Anonymous' }, { rut: '11.111.111-1', name: 'Anonymous' } ]) } else if (name === 'soto') { return resolve([ { rut: '11.111.111-1', name: 'Anonymous' }, { rut: '11.111.111-1', name: 'Anonymous' }, { rut: '11.111.111-1', name: 'Anonymous' }, { rut: '11.111.111-1', name: 'Anonymous' }, { rut: '11.111.111-1', name: 'Anonymous' } ]) } else if (name === 'info-rut') { return resolve([]) } reject(new Error('Not found')) }) }, getEnterpriseByName (name) { return new Promise((resolve, reject) => { if (name === 'perez') { return resolve([{ rut: '11.111.111-1', name: 'Anonymous' }]) } else if (name === 'info-rut') { return resolve([]) } reject(new Error('Not found')) }) } } mock('info-rut', infoRutStub) const helper = new Helper('./../src/index.js') describe('info rut', function () { beforeEach(() => { this.room = helper.createRoom() }) afterEach(() => this.room.destroy()) describe('person rut valid', () => { const rut = '11111111-1' beforeEach(async () => { this.room.user.say('user', `hubot info-rut rut ${rut}`) await sleep(1000) }) it('should return a full name', () => { expect(this.room.messages).to.eql([ ['user', `hubot info-rut rut ${rut}`], ['hubot', `Anonymous (${rut})`] ]) }) }) describe('enterprise rut valid', () => { const rut = '77777777-7' beforeEach(async () => { this.room.user.say('user', `hubot info-rut rut ${rut}`) await sleep(1000) }) it('should return a full name', () => { expect(this.room.messages).to.eql([ ['user', `hubot info-rut rut ${rut}`], ['hubot', `Sushi (${rut})`] ]) }) }) describe('rut invalid', () => { const rut = '22222222-2' beforeEach(async () => { this.room.user.say('user', `hubot info-rut rut ${rut}`) await sleep(1000) }) it('should return a error', () => { expect(this.room.messages).to.eql([ ['user', `hubot info-rut rut ${rut}`], ['hubot', '@user rut sin resultados'] ]) }) }) describe('rut error', () => { const rut = '1' beforeEach(async () => { this.room.user.say('user', `hubot info-rut rut ${rut}`) await sleep(1000) }) it('should return a error', () => { expect(this.room.messages).to.eql([ ['user', `hubot info-rut rut ${rut}`], ['hubot', '@user ocurrio un error al consultar el rut'] ]) }) }) describe('name valid', () => { const name = 'juan perez perez' beforeEach(async () => { this.room.user.say('user', `hubot info-rut persona ${name}`) await sleep(1000) }) it('should return a array of results with link', () => { expect(this.room.messages).to.eql([ ['user', `hubot info-rut persona ${name}`], [ 'hubot', 'Anonymous (11.111.111-1)\n' + 'Anonymous (11.111.111-1)\n' + 'Anonymous (11.111.111-1)\n' + 'Anonymous (11.111.111-1)\n' + 'Anonymous (11.111.111-1)\n' + 'Más resultados en ' + 'http://localhost:8080/info-rut?name=juan%20perez%20perez&' + 'type=persona' ] ]) }) }) describe('name valid', () => { const name = 'soto' beforeEach(async () => { this.room.user.say('user', `hubot info-rut persona ${name}`) await sleep(500) }) it('should return a array of results', () => { expect(this.room.messages).to.eql([ ['user', `hubot info-rut persona ${name}`], [ 'hubot', 'Anonymous (11.111.111-1)\n' + 'Anonymous (11.111.111-1)\n' + 'Anonymous (11.111.111-1)\n' + 'Anonymous (11.111.111-1)\n' + 'Anonymous (11.111.111-1)' ] ]) }) }) describe('name without results', () => { const name = 'info-rut' beforeEach(async () => { this.room.user.say('user', `hubot info-rut empresa ${name}`) await sleep(500) }) it('should return a empty results', () => { expect(this.room.messages).to.eql([ ['user', `hubot info-rut empresa ${name}`], ['hubot', `@user no hay resultados para ${name}`] ]) }) }) describe('name invalid', () => { const name = 'asdf' beforeEach(async () => { this.room.user.say('user', `hubot info-rut persona ${name}`) await sleep(500) }) it('should return a empty results', () => { expect(this.room.messages).to.eql([ ['user', `hubot info-rut persona ${name}`], ['hubot', '@user ocurrio un error al consultar el nombre'] ]) }) }) describe('GET /info-rut?name=perez&type=persona', () => { beforeEach(async () => { this.response = await request( 'http://localhost:8080/info-rut?name=juan%20perez%20perez&type=persona' ) }) it('responds with status 200 and results', () => { expect(this.response.statusCode).to.equal(200) expect(this.response.body).to.equal( 'Anonymous (11.111.111-1)<br/>' + 'Anonymous (11.111.111-1)<br/>' + 'Anonymous (11.111.111-1)<br/>' + 'Anonymous (11.111.111-1)<br/>' + 'Anonymous (11.111.111-1)<br/>' + 'Anonymous (11.111.111-1)' ) }) }) describe('GET /info-rut?name=perez&type=empresa', () => { beforeEach(async () => { this.response = await request( 'http://localhost:8080/info-rut?name=perez&type=empresa' ) }) it('responds with status 200 and results', () => { expect(this.response.statusCode).to.equal(200) expect(this.response.body).to.equal('Anonymous (11.111.111-1)') }) }) describe('GET /info-rut?name=info-rut&type=persona', () => { beforeEach(async () => { this.response = await request( 'http://localhost:8080/info-rut?name=info-rut&type=persona' ) }) it('responds with status 200 and not results', () => { expect(this.response.statusCode).to.equal(200) expect(this.response.body).to.equal('no hay resultados para info-rut') }) }) describe('GET /info-rut', () => { beforeEach(async () => { this.response = await request('http://localhost:8080/info-rut') }) it('responds with status 200 and not results', () => { expect(this.response.statusCode).to.equal(200) expect(this.response.body).to.equal('faltan los parametros type y name') }) }) describe('GET /info-rut?name=asdf&type=persona', () => { beforeEach(async () => { this.response = await request( 'http://localhost:8080/info-rut?name=asdf&type=persona' ) }) it('responds with status 200 and not results', () => { expect(this.response.statusCode).to.equal(200) expect(this.response.body).to.equal( 'Ocurrio un error al consultar el nombre' ) }) }) })
lgaticaq/hubot-info-rut
test/test.js
JavaScript
mit
9,067
module Modernizr module Rails class Engine < ::Rails::Engine end end end
tsechingho/modernizr-rails
lib/modernizr-rails/engine.rb
Ruby
mit
85
using System.Collections; using System.Collections.Generic; using UnityEngine; namespace Fungus { // <summary> /// Add force to a Rigidbody2D /// </summary> [CommandInfo("Rigidbody2D", "AddForce2D", "Add force to a Rigidbody2D")] [AddComponentMenu("")] public class AddForce2D : Command { [SerializeField] protected Rigidbody2DData rb; [SerializeField] protected ForceMode2D forceMode = ForceMode2D.Force; public enum ForceFunction { AddForce, AddForceAtPosition, AddRelativeForce } [SerializeField] protected ForceFunction forceFunction = ForceFunction.AddForce; [Tooltip("Vector of force to be added")] [SerializeField] protected Vector2Data force; [Tooltip("Scale factor to be applied to force as it is used.")] [SerializeField] protected FloatData forceScaleFactor = new FloatData(1); [Tooltip("World position the force is being applied from. Used only in AddForceAtPosition")] [SerializeField] protected Vector2Data atPosition; public override void OnEnter() { switch (forceFunction) { case ForceFunction.AddForce: rb.Value.AddForce(force.Value * forceScaleFactor.Value, forceMode); break; case ForceFunction.AddForceAtPosition: rb.Value.AddForceAtPosition(force.Value * forceScaleFactor.Value, atPosition.Value, forceMode); break; case ForceFunction.AddRelativeForce: rb.Value.AddRelativeForce(force.Value * forceScaleFactor.Value, forceMode); break; default: break; } Continue(); } public override string GetSummary() { return forceMode.ToString() + ": " + force.ToString(); } public override Color GetButtonColor() { return new Color32(235, 191, 217, 255); } public override bool HasReference(Variable variable) { if (rb.rigidbody2DRef == variable || force.vector2Ref == variable || forceScaleFactor.floatRef == variable || atPosition.vector2Ref == variable) return true; return false; } } }
FungusGames/Fungus
Assets/Fungus/Scripts/Commands/Rigidbody2D/AddForce2D.cs
C#
mit
2,491
// package metadata file for Meteor.js Package.describe({ name: 'startup-cafe', "author": "Dragos Mateescu <[email protected]>", "licenses": [ { "type": "MIT", "url": "http://opensource.org/licenses/MIT" } ], "scripts": { }, "engines": { "node": ">= 0.10.0" }, "devDependencies": { "grunt": "~0.4.5", "grunt-autoprefixer": "~0.8.1", "grunt-contrib-concat": "~0.4.0", "grunt-contrib-jshint": "~0.10.0", "grunt-contrib-less": "~0.11.3", "grunt-contrib-uglify": "~0.5.0", "grunt-contrib-watch": "~0.6.1", "grunt-contrib-clean": "~ v0.6.0", "grunt-modernizr": "~0.5.2", "grunt-stripmq": "0.0.6", "grunt-wp-assets": "~0.2.6", "load-grunt-tasks": "~0.6.0", "time-grunt": "~0.3.2", "grunt-bless": "^0.1.1" } }); Package.onUse(function (api) { api.versionsFrom('[email protected]'); api.use('jquery', 'client'); api.addFiles([ 'dist/fonts/glyphicons-halflings-regular.eot', 'dist/fonts/glyphicons-halflings-regular.svg', 'dist/fonts/glyphicons-halflings-regular.ttf', 'dist/fonts/glyphicons-halflings-regular.woff', 'dist/fonts/glyphicons-halflings-regular.woff2', 'dist/css/bootstrap.css', 'dist/js/bootstrap.js', ], 'client'); });
dragosmateescu/startup-cafe
package.js
JavaScript
mit
1,260
exports.engine = function(version){ version = version || null; switch (version){ case null: case '0.8.2': return require('./0.8.2').engine; default: return null; } };
keeto/deck
Source/engines/v8cgi/engine.js
JavaScript
mit
182
/* This is a managed file. Do not delete this comment. */ #include <include/lifecycle.h> static void echo(lifecycle_Foo this, char* hook) { corto_state s = corto_stateof(this); char *stateStr = corto_ptr_str(&s, corto_state_o, 0); corto_info("callback: %s [%s]", hook, stateStr); free(stateStr); } int16_t lifecycle_Foo_construct( lifecycle_Foo this) { echo(this, "construct"); return 0; } void lifecycle_Foo_define( lifecycle_Foo this) { echo(this, "define"); } void lifecycle_Foo_deinit( lifecycle_Foo this) { echo(this, "deinit"); } void lifecycle_Foo_delete( lifecycle_Foo this) { echo(this, "delete"); } void lifecycle_Foo_destruct( lifecycle_Foo this) { echo(this, "destruct"); } int16_t lifecycle_Foo_init( lifecycle_Foo this) { echo(this, "init"); return 0; } void lifecycle_Foo_update( lifecycle_Foo this) { echo(this, "update"); } int16_t lifecycle_Foo_validate( lifecycle_Foo this) { echo(this, "validate"); return 0; }
cortoproject/examples
c/modeling/lifecycle/src/Foo.c
C
mit
1,051
""" http://community.topcoder.com/stat?c=problem_statement&pm=1667 Single Round Match 147 Round 1 - Division II, Level One """ class CCipher: def decode(self, cipherText, shift): a = ord('A') decoder = [a + (c - shift if c >= shift else c - shift + 26) for c in range(26)] plain = [chr(decoder[ord(c) - a]) for c in cipherText] return ''.join(plain)
warmsea/tc-srm
srm147/CCipher.py
Python
mit
389
'use strict'; var Killable = artifacts.require('../contracts/lifecycle/Killable.sol'); require('./helpers/transactionMined.js'); contract('Killable', function(accounts) { it('should send balance to owner after death', async function() { let killable = await Killable.new({from: accounts[0], value: web3.toWei('10','ether')}); let owner = await killable.owner(); let initBalance = web3.eth.getBalance(owner); await killable.kill({from: owner}); let newBalance = web3.eth.getBalance(owner); assert.isTrue(newBalance > initBalance); }); });
maraoz/zeppelin-solidity
test/Killable.js
JavaScript
mit
571
// // PCMenuPopView.h // PCMenuPopDemo // // Created by peichuang on 16/6/30. // Copyright © 2016年 peichuang. All rights reserved. // #import <UIKit/UIKit.h> @class PCMenuPopView; @protocol PCMenuPopViewDelegate <NSObject> //返回需要多少个菜单项 - (NSInteger)numberOfitemsInMenuPopView:(PCMenuPopView *)menuPopView; //配置对应菜单button - (void)menuPopView:(PCMenuPopView *)menuPopView configureWithMenuItem:(UIButton *)menuButton index:(NSInteger)index; //配置对应的button的位置 - (CGRect)menuPopView:(PCMenuPopView *)menuPopView rectForMenuItemWithIndex:(NSInteger)index; @end @interface PCMenuPopView : UIView @property (nonatomic, strong) UIButton *closeButton; @property (nonatomic, weak) id<PCMenuPopViewDelegate>delegate; - (void)showInView:(UIView *)view withPopButton:(UIButton *)popButton; - (void)hide; //根据index可以设置默认位置,从右到左的顺序 - (CGRect)defaultItemRectWithSize:(CGSize)size index:(NSInteger)index; @end
pclion/MenuPopView
PCMenuPopDemo/PCMenuPopView/PCMenuPopView.h
C
mit
993
--- layout: post title: Word Embedding category: NLP --- ## 基于矩阵的分布表示 * 选取上下文,确定矩阵类型 1. “词-文档”矩阵,非常稀疏 2. “词-词”矩阵,选取词附近上下文中的各个词(如上下文窗口中的5个词),相对稠密 3. “词-n gram词组”,选取词附近上下文各词组成的n元词组,更加精准,但是更加稀疏 * 确定矩阵中各元素的值,包括TF-IDF,PMI,log * 矩阵分解,包括 SVD,NMF,CCA,HPCA ## 基于神经网络的语言模型 * NNLM basic Language model ![nnlm](http://7xpv97.com1.z0.glb.clouddn.com/6e27cb7b6cc755694077db17bd0f3a29.png) * LBL 双线性结构 和nnlm基本类似,只是输出的目标函数稍有不同。 * RNNLM 利用所有的上下文信息,不进行简化(每个词都用上之前看过的所有单词,而不是n个) 一个语言模型的描述 ![word-embedding-1](http://7xpv97.com1.z0.glb.clouddn.com/e4f2ceab920fa8692122d09e3d38a853.png) 当m很大的时候没法算,因此做了n-gram的估算 ![word-embedding-2](http://7xpv97.com1.z0.glb.clouddn.com/842c3f059e28d74deff8912cc16662af.png) 在计算右边的公式的时候,一般直接采用频率计数的方法进行计算 ![word-embedding-3](http://7xpv97.com1.z0.glb.clouddn.com/a3a8bf394bb857bfb85824ef4de65c26.png) 由此带来的问题是数据稀疏问题和平滑问题,由此,神经网络语言模型产生。 Bengio Neural Probabilistic Language Model ![nplm](http://7xpv97.com1.z0.glb.clouddn.com/81301bde23b2843b1a1835410e949ae4.png) x是一个分布式向量 ![distribution](http://7xpv97.com1.z0.glb.clouddn.com/28d9f8c439364f6c190513346c97fcc8.png) ### word2vec 前面的模型相对而言都很复杂,然后出了一个CBOW和Skip-gram模型。 ![skip-gram model](http://7xpv97.com1.z0.glb.clouddn.com/f7190942789f72698eb5593189e2b4e4.png) 没有很多的计算过程,就是根据上下文关系的softmax
cdmaok/cdmaok.github.io
_drafts/2016-03-01-Word-Embedding.md
Markdown
mit
1,967
from hwt.synthesizer.rtlLevel.extract_part_drivers import extract_part_drivers from hwt.synthesizer.rtlLevel.remove_unconnected_signals import removeUnconnectedSignals from hwt.synthesizer.rtlLevel.mark_visibility_of_signals_and_check_drivers import markVisibilityOfSignalsAndCheckDrivers class DummyPlatform(): """ :note: all processors has to be callable with only one parameter which is actual Unit/RtlNetlist instance """ def __init__(self): self.beforeToRtl = [] self.beforeToRtlImpl = [] self.afterToRtlImpl = [] self.beforeHdlArchGeneration = [ extract_part_drivers, removeUnconnectedSignals, markVisibilityOfSignalsAndCheckDrivers, ] self.afterToRtl = []
Nic30/HWToolkit
hwt/synthesizer/dummyPlatform.py
Python
mit
775
using Microsoft.Diagnostics.Tracing; using System; using System.Collections.Concurrent; using System.Diagnostics; using System.Linq; using System.Management.Automation; using System.Reactive.Disposables; using System.Reactive.Linq; using System.Threading; namespace EtwStream.PowerShell { [Cmdlet(VerbsCommon.Get, "TraceEventStream", DefaultParameterSetName = "nameOrGuid")] public class GetTraceEvent : PSCmdlet { private CompositeDisposable disposable = new CompositeDisposable(); [Parameter(Position = 0, ParameterSetName = "nameOrGuid", Mandatory = true, ValueFromPipeline = true)] public string[] NameOrGuid { get; set; } [ValidateSet( nameof(WellKnownEventSources.AspNetEventSource), nameof(WellKnownEventSources.ConcurrentCollectionsEventSource), nameof(WellKnownEventSources.FrameworkEventSource), nameof(WellKnownEventSources.PinnableBufferCacheEventSource), nameof(WellKnownEventSources.PlinqEventSource), nameof(WellKnownEventSources.SqlEventSource), nameof(WellKnownEventSources.SynchronizationEventSource), nameof(WellKnownEventSources.TplEventSource))] [Parameter(Position = 0, ParameterSetName = "wellKnown", Mandatory = true, ValueFromPipeline = true)] public string[] WellKnownEventSource { get; set; } [ValidateSet( nameof(IISEventSources.AspDotNetEvents), nameof(IISEventSources.HttpEvent), nameof(IISEventSources.HttpLog), nameof(IISEventSources.HttpService), nameof(IISEventSources.IISAppHostSvc), nameof(IISEventSources.IISLogging), nameof(IISEventSources.IISW3Svc), nameof(IISEventSources.RuntimeWebApi), nameof(IISEventSources.RuntimeWebHttp))] [Parameter(Position = 0, ParameterSetName = "IIS", Mandatory = true, ValueFromPipeline = true)] public string[] IISEventSource { get; set; } [Parameter] public SwitchParameter DumpWithColor { get; set; } [Parameter] public TraceEventLevel TraceLevel { get; set; } = TraceEventLevel.Verbose; private IObservable<TraceEvent> listener = Observable.Empty<TraceEvent>(); protected override void ProcessRecord() { switch (ParameterSetName) { case "wellKnown": listener = listener.Merge(WellKnownEventSource.Select(x => GetWellKnownEventListener(x)).Merge()); break; case "IIS": listener = listener.Merge(IISEventSource.Select(x => GetIISEventListener(x)).Merge()); break; default: listener = listener.Merge(NameOrGuid.Select(x => ObservableEventListener.FromTraceEvent(x)).Merge()); break; } } protected override void EndProcessing() { var q = new BlockingCollection<Action>(); Exception exception = null; var d = listener .Where(x => Process.GetCurrentProcess().Id != x.ProcessID) .Where(x => x.Level <= TraceLevel) .Subscribe( x => { q.Add(() => { var item = new PSTraceEvent(x, Host.UI); if (DumpWithColor.IsPresent) { item.DumpWithColor(); } else { WriteObject(item); } WriteVerbose(item.DumpPayloadOrMessage()); }); }, e => { exception = e; q.CompleteAdding(); }, q.CompleteAdding); disposable.Add(d); var cts = new CancellationTokenSource(); disposable.Add(new CancellationDisposable(cts)); foreach (var act in q.GetConsumingEnumerable(cts.Token)) { act(); } if (exception != null) { ThrowTerminatingError(new ErrorRecord(exception, "1", ErrorCategory.OperationStopped, null)); } } protected override void StopProcessing() { disposable.Dispose(); } private IObservable<TraceEvent> GetWellKnownEventListener(string wellKnownEventSource) { switch (wellKnownEventSource) { case nameof(WellKnownEventSources.AspNetEventSource): return ObservableEventListener.FromTraceEvent(WellKnownEventSources.AspNetEventSource); case nameof(WellKnownEventSources.ConcurrentCollectionsEventSource): return ObservableEventListener.FromTraceEvent(WellKnownEventSources.ConcurrentCollectionsEventSource); case nameof(WellKnownEventSources.FrameworkEventSource): return ObservableEventListener.FromTraceEvent(WellKnownEventSources.FrameworkEventSource); case nameof(WellKnownEventSources.PinnableBufferCacheEventSource): return ObservableEventListener.FromTraceEvent(WellKnownEventSources.PinnableBufferCacheEventSource); case nameof(WellKnownEventSources.PlinqEventSource): return ObservableEventListener.FromTraceEvent(WellKnownEventSources.PlinqEventSource); case nameof(WellKnownEventSources.SqlEventSource): return ObservableEventListener.FromTraceEvent(WellKnownEventSources.SqlEventSource); case nameof(WellKnownEventSources.SynchronizationEventSource): return ObservableEventListener.FromTraceEvent(WellKnownEventSources.SynchronizationEventSource); case nameof(WellKnownEventSources.TplEventSource): return ObservableEventListener.FromTraceEvent(WellKnownEventSources.TplEventSource); default: return Observable.Empty<TraceEvent>(); } } private IObservable<TraceEvent> GetIISEventListener(string iisEventSource) { switch (iisEventSource) { case nameof(IISEventSources.AspDotNetEvents): return ObservableEventListener.FromTraceEvent(IISEventSources.AspDotNetEvents); case nameof(IISEventSources.HttpEvent): return ObservableEventListener.FromTraceEvent(IISEventSources.HttpEvent); case nameof(IISEventSources.HttpLog): return ObservableEventListener.FromTraceEvent(IISEventSources.HttpLog); case nameof(IISEventSources.HttpService): return ObservableEventListener.FromTraceEvent(IISEventSources.HttpService); case nameof(IISEventSources.IISAppHostSvc): return ObservableEventListener.FromTraceEvent(IISEventSources.IISAppHostSvc); case nameof(IISEventSources.IISLogging): return ObservableEventListener.FromTraceEvent(IISEventSources.IISLogging); case nameof(IISEventSources.IISW3Svc): return ObservableEventListener.FromTraceEvent(IISEventSources.IISW3Svc); case nameof(IISEventSources.RuntimeWebApi): return ObservableEventListener.FromTraceEvent(IISEventSources.RuntimeWebApi); case nameof(IISEventSources.RuntimeWebHttp): return ObservableEventListener.FromTraceEvent(IISEventSources.RuntimeWebHttp); default: return Observable.Empty<TraceEvent>(); } } } }
pierre3/EtwStream.PowerShell
EtwStream.PowerShell/GetTraceEventStream.cs
C#
mit
7,932
package com.yunpian.sdk.model; /** * Created by bingone on 15/11/8. */ public class VoiceSend extends BaseInfo { }
yunpian/yunpian-java-sdk
src/main/java/com/yunpian/sdk/model/VoiceSend.java
Java
mit
119
package com.ipvans.flickrgallery.ui.main; import android.util.Log; import com.ipvans.flickrgallery.data.SchedulerProvider; import com.ipvans.flickrgallery.di.PerActivity; import com.ipvans.flickrgallery.domain.FeedInteractor; import com.ipvans.flickrgallery.domain.UpdateEvent; import java.util.concurrent.TimeUnit; import javax.inject.Inject; import io.reactivex.Observable; import io.reactivex.disposables.CompositeDisposable; import io.reactivex.disposables.Disposable; import io.reactivex.subjects.BehaviorSubject; import io.reactivex.subjects.PublishSubject; import static com.ipvans.flickrgallery.ui.main.MainViewState.*; @PerActivity public class MainPresenterImpl implements MainPresenter<MainViewState> { private final FeedInteractor interactor; private final SchedulerProvider schedulers; private BehaviorSubject<MainViewState> stateSubject = BehaviorSubject.createDefault(empty()); private PublishSubject<UpdateEvent> searchSubject = PublishSubject.create(); private Disposable disposable = new CompositeDisposable(); @Inject public MainPresenterImpl(FeedInteractor interactor, SchedulerProvider schedulers) { this.interactor = interactor; this.schedulers = schedulers; } @Override public void onAttach() { Observable.combineLatest(searchSubject .debounce(150, TimeUnit.MILLISECONDS, schedulers.io()) .doOnNext(interactor::getFeed), interactor.observe(), (tags, feed) -> new MainViewState(feed.isLoading(), feed.getError(), feed.getData(), tags.getTags())) .withLatestFrom(stateSubject, (newState, oldState) -> new MainViewState( newState.isLoading(), newState.getError(), newState.getData() != null ? newState.getData() : oldState.getData(), newState.getTags() )) .observeOn(schedulers.io()) .subscribeWith(stateSubject) .onSubscribe(disposable); } @Override public void onDetach() { disposable.dispose(); } @Override public void restoreState(MainViewState data) { stateSubject.onNext(data); } @Override public Observable<MainViewState> observe() { return stateSubject; } @Override public MainViewState getLatestState() { return stateSubject.getValue(); } @Override public void search(String tags, boolean force) { searchSubject.onNext(new UpdateEvent(tags, force)); } }
VansPo/flickr-gallery
FlickrGallery/app/src/main/java/com/ipvans/flickrgallery/ui/main/MainPresenterImpl.java
Java
mit
2,680
package aaron.org.anote.viewbinder; import android.app.Activity; import android.os.Bundle; public class DynamicActivity extends Activity { @Override public void onCreate(Bundle savedInstance) { super.onCreate(savedInstance); Layout.start(this); } }
phil0522/anote
anote-mobile/ANote/app/src/main/java/aaron/org/anote/viewbinder/DynamicActivity.java
Java
mit
279
'use strict'; describe('Directive: resize', function () { // load the directive's module beforeEach(module('orderDisplayApp')); var element, scope; beforeEach(inject(function ($rootScope) { scope = $rootScope.$new(); })); //TODO: Add unit tests /*it('should change height', inject(function ($compile, $window) { element = angular.element('<resize></resize>'); element = $compile(element)(scope); expect(scope.screenHeight).toBe($window.outerHeight); }));*/ });
PureHacks/PickMeUp
test/spec/directives/resize.js
JavaScript
mit
487
/* * Copyright (c) 2005 Dizan Vasquez. * * 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. */ package net.jenet; import java.nio.ByteBuffer; import org.apache.commons.lang.builder.ToStringBuilder; import org.apache.commons.lang.builder.ToStringStyle; /** * Wraps information to be sent through JeNet. * @author Dizan Vasquez */ public class Packet implements IBufferable { /** * Indicates that this packet is reliable */ public static final int FLAG_RELIABLE = 1; /** * Indicates that the packet should be processed no * matter its order relative to other packets. */ public static final int FLAG_UNSEQUENCED = 2; protected int referenceCount; protected int flags; protected ByteBuffer data; protected int dataLength; private Packet() { super(); } /** * Creates a new Packet. * The constructor allocates a new packet and allocates a * buffer of <code>dataLength</code> bytes for it. * * @param dataLength * The size in bytes of this packet. * @param flags * An byte inidicating the how to handle this packet. */ public Packet( int dataLength, int flags ) { data = ByteBuffer.allocateDirect( dataLength ); this.dataLength = dataLength; this.flags = flags; } /** * Copies this packet's data into the given buffer. * @param buffer * Destination buffer */ public void toBuffer( ByteBuffer buffer ) { data.flip(); for ( int i = 0; i < dataLength; i++ ) { buffer.put( data.get() ); } } /** * Copies part of this packet's data into the given buffer. * @param buffer * Destination buffer * @param offset * Initial position of the destination buffer * @param length * Total number of bytes to copy */ public void toBuffer( ByteBuffer buffer, int offset, int length ) { int position = data.position(); int limit = data.limit(); data.flip(); data.position( offset ); for ( int i = 0; i < length; i++ ) { buffer.put( data.get() ); } data.position( position ); data.limit( limit ); } /** * Copies the given buffer into this packet's data. * @ param buffer * Buffer to copy from */ public void fromBuffer( ByteBuffer buffer ) { data.clear(); for ( int i = 0; i < dataLength; i++ ) { data.put( buffer.get() ); } } /** * Copies part of the given buffer into this packet's data. * @param buffer * Buffer to copy from * @param fragmentOffset * Position of the first byte to copy * @param length * Total number of bytes to copy */ public void fromBuffer( ByteBuffer buffer, int fragmentOffset, int length ) { data.position( fragmentOffset ); for ( int i = 0; i < length; i++ ) { data.put( buffer.get() ); } data.position( dataLength ); data.limit( dataLength ); } /** * Returs size of this packet. * @return Size in bytes of this packet */ public int byteSize() { return dataLength; } /** * Returns the data contained in this packet * @return Returns the data. */ public ByteBuffer getData() { return data; } /** * Returns the size in bytes of this packet's data * @return Returns the dataLength. */ public int getDataLength() { return dataLength; } /** * Returns this packet's flags. * @return Returns the flags. */ public int getFlags() { return flags; } /** * @return Returns the referenceCount. */ int getReferenceCount() { return referenceCount; } /** * Sets the flags for this packet. * The parameter is an or of the flags <code>FLAG_RELIABLE</code> and <code>FLAG_UNSEQUENCED</code> * a value of zero indicates an unreliable, sequenced (last one is kept) packet. * @param flags * The flags to set. */ public void setFlags( int flags ) { this.flags = flags; } /** * @param referenceCount * The referenceCount to set. */ void setReferenceCount( int referenceCount ) { this.referenceCount = referenceCount; } public String toString() { return ToStringBuilder.reflectionToString( this, ToStringStyle.MULTI_LINE_STYLE ); } }
seeseekey/jenet
src/net/jenet/Packet.java
Java
mit
6,482
'use strict'; angular.module('core').controller('HomeController', ['$scope', 'Authentication', '$http', '$modal','$rootScope', function($scope, Authentication, $http, $modal, $rootScope) { // This provides Authentication context. $scope.authentication = Authentication; $scope.card = {}; $scope.columnWidth = function() { return Math.floor((100 / $scope.columns.length) * 100) / 100; }; $scope.updateCard = function(column, card) { var modalInstance = $modal.open({ templateUrl: '/modules/core/views/card-details.client.view.html', controller: modalController, size: 'lg', resolve: { items: function() { return angular.copy({ title: card.title, Details: card.details, release: card.release, cardColor: card.ragStatus, column: column, architect: card.architect, analyst: card.Analyst, designer: card.designer, buildCell: card.buildCell }); } } }); modalInstance.result.then(function(result) { console.log(result.title); angular.forEach($scope.columns, function(col) { if(col.name === column.name) { angular.forEach(col.cards, function(cd) { if (cd.title === card.title) { if (col.name === 'Backlog') { cd.details = result.Details; } else { cd.details = result.Details; if (result.cardColor) { cd.ragStatus = '#' + result.cardColor; } else { cd.ragStatus = '#5CB85C'; } cd.release = result.release; cd.architect = result.architect; cd.designer = result.designer; cd.Analyst = result.analyst; cd.buildCell = result.buildCell } } }); } }); console.log('modal closed'); }, function() { console.log('modal dismissed'); }); //setTimeout(function() { // $scope.$apply(function(){ // console.log('broadcasting event'); // $rootScope.$broadcast('OpenCardDetails', column, card); // }); //}, 500); }; var modalController = function($scope, $modalInstance, items) { $scope.colorOptions = ['5CB85C','FFEB13','FF0000']; console.log(items.column.name); $scope.card = items; $scope.ok = function () { //events(); $modalInstance.close($scope.card); }; $scope.cancel = function () { $modalInstance.dismiss('cancel'); }; }; $scope.$on('OpenCardDetails', function(e, column,card) { console.log('in broadcast event'); console.log(column.name); $scope.card = card; }); $scope.columns = [ {'name': 'Backlog',cards: [{'id': '1', 'title': 'item1', 'drag':true, 'release':"",'ragStatus':'#5cb85c', 'details':"",'architect':"", 'Analyst':"",'designer':"",'buildCell':""}, {'id': '2','title': 'item2', 'drag':true, 'release':"",'ragStatus':'#5cb85c', 'details':"",'architect':"", 'Analyst':"",'designer':"",'buildCell':""}, {'id': '3','title': 'item3', 'drag':true, 'release':"",'ragStatus':'#ffeb13', 'details':"",'architect':"", 'Analyst':"",'designer':"",'buildCell':""}, {'id': '4','title': 'item4', 'drag':true, 'release':"",'ragStatus':'#5cb85c', 'details':"",'architect':"", 'Analyst':"",'designer':"",'buildCell':""}, {'id': '5','title': 'item5', 'drag':true, 'release':"",'ragStatus':'#ff0000', 'details':"",'architect':"", 'Analyst':"",'designer':"",'buildCell':""}, {'id': '6','title': 'item6', 'drag':true, 'release':"",'ragStatus':'#5cb85c', 'details':"",'architect':"", 'Analyst':"",'designer':"",'buildCell':""}], 'hideCol':false}, {'name': 'Discovery',cards: [], 'hideCol':false}, {'name': 'Design',cards: [], 'hideCol':false}, {'name': 'Build',cards: [], 'hideCol':false}, {'name': 'Pilot',cards: [], 'hideCol':false} ]; $scope.hiddenCol = function(column) { angular.forEach($scope.columns, function(col) { if(col.name === column.name) { if(column.hideCol === true) { column.hideCol = false; } else { column.hideCol = true; } } }); }; $scope.addCard = function(column) { angular.forEach($scope.columns, function(col){ if(col.name === column.name) { column.cards.push({'title': 'item8','drag':true}); } }); }; $scope.list1 = [ {'title': 'item1', 'drag':true}, {'title': 'item2', 'drag':true}, {'title': 'item3', 'drag':true}, {'title': 'item4', 'drag':true}, {'title': 'item5', 'drag':true}, {'title': 'item6', 'drag':true} ]; $scope.list2 = []; $scope.sortableOptions = { //containment: '#sortable-container1' }; $scope.sortableOptions1 = { //containment: '#sortable-container2' }; $scope.removeCard = function(column, card) { angular.forEach($scope.columns, function(col) { if (col.name === column.name) { col.cards.splice(col.cards.indexOf(card), 1); } }); }; $scope.dragControlListeners = { itemMoved: function (event) { var releaseVar = ''; var columnName = event.dest.sortableScope.$parent.column.name; if (columnName === 'Backlog') { releaseVar = ''; } else { //releaseVar = prompt('Enter Release Info !'); } angular.forEach($scope.columns, function(col) { if (col.name === columnName) { angular.forEach(col.cards, function(card) { if (card.title === event.source.itemScope.modelValue.title) { if (releaseVar === ' ' || releaseVar.length === 0) { releaseVar = 'Rel'; } card.release = releaseVar; } }); } }); } }; } ]);
bonzyKul/continuous
public/modules/core/controllers/home.client.controller.js
JavaScript
mit
7,537
/*eslint-disable */ var webpack = require( "webpack" ); var sml = require( "source-map-loader" ); /*eslint-enable */ var path = require( "path" ); module.exports = { module: { preLoaders: [ { test: /\.js$/, loader: "source-map-loader" } ], loaders: [ { test: /sinon.*\.js/, loader: "imports?define=>false" }, { test: /\.spec\.js$/, exclude: /node_modules/, loader: "babel-loader" } ], postLoaders: [ { test: /\.js$/, exclude: /(spec|node_modules)\//, loader: "istanbul-instrumenter" } ] }, resolve: { alias: { "when.parallel": "when/parallel", "when.pipeline": "when/pipeline", react: "react/dist/react-with-addons.js", lux: path.join( __dirname, "./lib/lux.js" ) } } };
rniemeyer/lux.js
webpack.config.test.js
JavaScript
mit
733
import {Component, OnInit} from '@angular/core'; import {ActivityService} from '../../services/activity.service'; import {Activity} from "../../models/activity"; import {BarChartComponent} from "../bar-chart/bar-chart.component"; @Component({ selector: 'records-view', moduleId: module.id, templateUrl: 'records-view.component.html', styleUrls: ['records-view.component.css'], directives: [BarChartComponent] }) export class RecordsViewComponent implements OnInit { calBurnActs:Activity[]; longestActs:Activity[]; constructor(private activityService:ActivityService) { } getData() { this.activityService.getActivities('totalCalories','desc',6).then( data => this.calBurnActs = data ); this.activityService.getActivities('totalDistance','desc',6).then( data => this.longestActs = data ); } ngOnInit() { this.getData(); } }
montgomeryce/HAVC
app/components/records-view/records-view.component.ts
TypeScript
mit
951
from __future__ import (absolute_import, division, print_function, unicode_literals) RJUST = 12 def format_fans(fans): return format_line(prefix='fans'.rjust(RJUST), values=fans) def format_rpms(rpms): return format_line(prefix='rpms'.rjust(RJUST), values=rpms) def format_pwms(pwms): return format_line(prefix='pwms'.rjust(RJUST), values=pwms) def format_tmps(tmps): return format_line(prefix='temps'.rjust(RJUST), values=tmps) def format_names(names): return format_line(prefix='names'.rjust(RJUST), values=names) def format_ports(ports): return format_line(prefix='ports'.rjust(RJUST), values=ports) def format_temps(temps): return format_line(prefix='temps'.rjust(RJUST), values=temps) def format_ambients(ambients): return format_line(prefix='ambients'.rjust(RJUST), values=ambients) def format_limits(limits): return format_line(prefix='limits'.rjust(RJUST), values=limits) def format_buffers(buffers): return format_line(prefix='buffers'.rjust(RJUST), values=buffers) def format_headrooms(headrooms): return format_line(prefix='headrooms'.rjust(RJUST), values=headrooms) def format_directions(directions): return format_line(prefix='directions'.rjust(RJUST), values=directions) def format_differences(differences): return format_line(prefix='differences'.rjust(RJUST), values=differences) def format_pwms_new(pwms_new): return format_line(prefix='new pwms'.rjust(RJUST), values=pwms_new) def format_line(prefix, values): line = '' line += prefix line += ': ' line += '[' for value in values: try: if value >= 1: value = int(round(value, 0)) if 1 > value != 0: value = str(value)[1:4].ljust(3, '0') except TypeError: # value is None pass value = str(value) if value is not None else '' line += value.rjust(6) line += ', ' line = line[:-len(', ')] line += ']' return line
Bengt/AL-FanControl
python/fancontrol/ui/cli_util.py
Python
mit
2,042
/* ///////////////////////////////////////////////////////////////////////// * File: stlsoft/conversion/internal/explicit_cast_specialisations.hpp * * Purpose: Specialisations of explicit_cast * * Created: 13th August 2003 * Updated: 10th August 2009 * * Home: http://stlsoft.org/ * * Copyright (c) 2003-2009, Matthew Wilson and Synesis Software * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * - Neither the name(s) of Matthew Wilson and Synesis Software nor the names of * any contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. * * ////////////////////////////////////////////////////////////////////// */ /** \file stlsoft/conversion/internal/explicit_cast_specialisations.hpp * * \brief [C++ only] Explicit specialisations of stlsoft::explicit_cast * (\ref group__library__conversion "Conversion" Library). */ #ifndef STLSOFT_INCL_STLSOFT_CONVERSION_HPP_EXPLICIT_CAST # error This file is included from within stlsoft/conversion/explicit_cast.hpp, and cannot be included directly #else #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION # define STLSOFT_VER_STLSOFT_CONVERSION_INTERNAL_HPP_EXPLICIT_CAST_SPECIALISATIONS_MAJOR 4 # define STLSOFT_VER_STLSOFT_CONVERSION_INTERNAL_HPP_EXPLICIT_CAST_SPECIALISATIONS_MINOR 0 # define STLSOFT_VER_STLSOFT_CONVERSION_INTERNAL_HPP_EXPLICIT_CAST_SPECIALISATIONS_REVISION 1 # define STLSOFT_VER_STLSOFT_CONVERSION_INTERNAL_HPP_EXPLICIT_CAST_SPECIALISATIONS_EDIT 21 #endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */ /* ///////////////////////////////////////////////////////////////////////// * Auto-generation and compatibility */ /* [<[STLSOFT-AUTO:NO-UNITTEST]>] [<[STLSOFT-AUTO:NO-DOCFILELABEL]>] */ /* ///////////////////////////////////////////////////////////////////////// * Specialisations */ STLSOFT_TEMPLATE_SPECIALISATION class explicit_cast<char const&> { public: typedef char value_type; typedef explicit_cast<char> class_type; // Construction public: explicit_cast(char const& t) : m_t(t) {} // Conversions public: operator char const& () const { return m_t; } // Members private: char const& m_t; }; #ifdef STLSOFT_CF_NATIVE_WCHAR_T_SUPPORT STLSOFT_TEMPLATE_SPECIALISATION class explicit_cast<wchar_t const&> { public: typedef wchar_t value_type; typedef explicit_cast<wchar_t> class_type; // Construction public: explicit_cast(wchar_t const& t) : m_t(t) {} // Conversions public: operator wchar_t const& () const { return m_t; } // Members private: wchar_t const& m_t; }; #endif /* STLSOFT_CF_NATIVE_WCHAR_T_SUPPORT */ STLSOFT_TEMPLATE_SPECIALISATION class explicit_cast<unsigned char const&> { public: typedef unsigned char value_type; typedef explicit_cast<unsigned char> class_type; // Construction public: explicit_cast(unsigned char const& t) : m_t(t) {} // Conversions public: operator unsigned char const& () const { return m_t; } // Members private: unsigned char const& m_t; }; STLSOFT_TEMPLATE_SPECIALISATION class explicit_cast<signed char const&> { public: typedef signed char value_type; typedef explicit_cast<signed char> class_type; // Construction public: explicit_cast(signed char const& t) : m_t(t) {} // Conversions public: operator signed char const& () const { return m_t; } // Members private: signed char const& m_t; }; STLSOFT_TEMPLATE_SPECIALISATION class explicit_cast<signed short const&> { public: typedef signed short value_type; typedef explicit_cast<signed short> class_type; // Construction public: explicit_cast(signed short const& t) : m_t(t) {} // Conversions public: operator signed short const& () const { return m_t; } // Members private: signed short const& m_t; }; STLSOFT_TEMPLATE_SPECIALISATION class explicit_cast<unsigned short const&> { public: typedef unsigned short value_type; typedef explicit_cast<unsigned short> class_type; // Construction public: explicit_cast(unsigned short const& t) : m_t(t) {} // Conversions public: operator unsigned short const& () const { return m_t; } // Members private: unsigned short const& m_t; }; STLSOFT_TEMPLATE_SPECIALISATION class explicit_cast<signed int const&> { public: typedef signed int value_type; typedef explicit_cast<signed int> class_type; // Construction public: explicit_cast(signed int const& t) : m_t(t) {} // Conversions public: operator signed int const& () const { return m_t; } // Members private: signed int const& m_t; }; STLSOFT_TEMPLATE_SPECIALISATION class explicit_cast<unsigned int const&> { public: typedef unsigned int value_type; typedef explicit_cast<unsigned int> class_type; // Construction public: explicit_cast(unsigned int const& t) : m_t(t) {} // Conversions public: operator unsigned int const& () const { return m_t; } // Members private: unsigned int const& m_t; }; STLSOFT_TEMPLATE_SPECIALISATION class explicit_cast<signed long const&> { public: typedef signed long value_type; typedef explicit_cast<signed long> class_type; // Construction public: explicit_cast(signed long const& t) : m_t(t) {} // Conversions public: operator signed long const& () const { return m_t; } // Members private: signed long const& m_t; }; STLSOFT_TEMPLATE_SPECIALISATION class explicit_cast<unsigned long const&> { public: typedef unsigned long value_type; typedef explicit_cast<unsigned long> class_type; // Construction public: explicit_cast(unsigned long const& t) : m_t(t) {} // Conversions public: operator unsigned long const& () const { return m_t; } // Members private: unsigned long const& m_t; }; #ifdef STLSOFT_CF_64BIT_INT_IS_long_long STLSOFT_TEMPLATE_SPECIALISATION class explicit_cast<signed long long const&> { public: typedef signed long long value_type; typedef explicit_cast<signed long long> class_type; // Construction public: explicit_cast(signed long long const& t) : m_t(t) {} // Conversions public: operator signed long long const& () const { return m_t; } // Members private: signed long long const& m_t; }; STLSOFT_TEMPLATE_SPECIALISATION class explicit_cast<unsigned long long const&> { public: typedef unsigned long long value_type; typedef explicit_cast<unsigned long long> class_type; // Construction public: explicit_cast(unsigned long long const& t) : m_t(t) {} // Conversions public: operator unsigned long long const& () const { return m_t; } // Members private: unsigned long long const& m_t; }; #elif defined(STLSOFT_CF_64BIT_INT_IS___int64) STLSOFT_TEMPLATE_SPECIALISATION class explicit_cast<signed __int64 const&> { public: typedef signed __int64 value_type; typedef explicit_cast<signed __int64> class_type; // Construction public: explicit_cast(signed __int64 const& t) : m_t(t) {} // Conversions public: operator signed __int64 const& () const { return m_t; } // Members private: signed __int64 const& m_t; }; STLSOFT_TEMPLATE_SPECIALISATION class explicit_cast<unsigned __int64 const&> { public: typedef unsigned __int64 value_type; typedef explicit_cast<unsigned __int64> class_type; // Construction public: explicit_cast(unsigned __int64 const& t) : m_t(t) {} // Conversions public: operator unsigned __int64 const& () const { return m_t; } // Members private: unsigned __int64 const& m_t; }; #else # error 64-bit discrimination not handled correctly #endif /* 64-bit */ STLSOFT_TEMPLATE_SPECIALISATION class explicit_cast<float const&> { public: typedef float value_type; typedef explicit_cast<float> class_type; // Construction public: explicit_cast(float const& t) : m_t(t) {} // Conversions public: operator float const& () const { return m_t; } // Members private: float const& m_t; }; STLSOFT_TEMPLATE_SPECIALISATION class explicit_cast<double const&> { public: typedef double value_type; typedef explicit_cast<double> class_type; // Construction public: explicit_cast(double const& t) : m_t(t) {} // Conversions public: operator double const& () const { return m_t; } // Members private: double const& m_t; }; STLSOFT_TEMPLATE_SPECIALISATION class explicit_cast<long double const&> { public: typedef long double value_type; typedef explicit_cast<long double> class_type; // Construction public: explicit_cast(long double const& t) : m_t(t) {} // Conversions public: operator long double const& () const { return m_t; } // Members private: long double const& m_t; }; #ifdef STLSOFT_CF_NATIVE_BOOL_SUPPORT STLSOFT_TEMPLATE_SPECIALISATION class explicit_cast<bool const&> { public: typedef bool value_type; typedef explicit_cast<bool> class_type; // Construction public: explicit_cast(bool const& t) : m_t(t) {} // Conversions public: operator bool const& () const { return m_t; } // Members private: bool const& m_t; }; #endif /* STLSOFT_CF_NATIVE_BOOL_SUPPORT */ /* ////////////////////////////////////////////////////////////////////// */ #endif /* !STLSOFT_INCL_STLSOFT_CONVERSION_HPP_EXPLICIT_CAST */ /* ///////////////////////////// end of file //////////////////////////// */
rokn/Count_Words_2015
fetched_code/cpp/code/explicit_cast_specialisations.hpp
C++
mit
11,877
<!-- 説明、ファイル操作・読み込み --> # ファイル操作(読み込み) ではファイルの内容を読み込めるようにしましょう。 ファイル操作は - ファイルを開く(fopen) - ファイルの中身を読み込む(fgets) - ファイルを閉じる(fclose) という手順になります。 それぞれを説明します ## fopen ファイルを開き、ファイルハンドルを返します。 ファイルハンドルとはファイルを特定するIDのようなもので、この後読み込むときやファイルを閉じるときに必要になります。 ``` fopen(ファイル名, モード); ``` の形式で使われます。 モードには大きく3つあり, - r:読み込み(ファイルポインタはファイルの先頭) - w:書き込み(ファイルポインタはファイルの先頭) - a:書き込み(ファイルポインタはファイルの最後) のようになります。 たとえば、file01.txtを読み込みモードで開く時は ``` $fp = fopen('file01.txt', 'r'); ``` のようになります。 ## fclose fopenで開いたファイルを閉じます。必ずfopenで開いたファイルは閉じるようにしましょう。 ``` fclose($fp); ``` ## fgets fopenで開いたファイルを1行ずつ読み込みます。 先のfopen,fcloseと組み合わせると例えば以下のように使われます。 ``` if (($fp = fopen($filename, 'r')) !== FALSE) { while (($tmp = fgets($fp)) !== FALSE) { $data[] = htmlspecialchars($tmp, ENT_QUOTES, 'UTF-8'); } fclose($fp); } ``` このように書くことで、1行ずつ最後まで読み込まれ、1行ずつのデータが$dataという配列の1行ずつに格納されます。
CodeshipTeachers/document-php
4/1.md
Markdown
mit
1,767
<!DOCTYPE html> <html> <head> <title>JAVASCRIPT BASICS</title> <meta charset="UTF-8"> <link href="../styles/main.css" rel="stylesheet" type="text/css"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/skeleton/2.0.4/skeleton.css"> <link rel="stylesheet" href="styles/main.css"> <link href="https://fonts.googleapis.com/css?family=Amatic+SC|Fredericka+the+Great" rel="stylesheet"> </head> <body> <h1>JAVASCRIPT BASICS</h1> <div class="container"> <h4>Technical Blog Part Four</h4> <h5>Terminology: "Learning the Lingo"</h5> <strong>How does JavaScript compare to HTML and CSS?</strong> <p> <strong><em>JavaScript</em></strong> compares differently to HTML and CSS as it is used for website functionality, this means it is able to process data and tells a page how to behave, where as HTML dictates structure, i.e. how the contents is divided, and CSS dictates style, i.e. how the page looks. </p> <strong> Explain control flow and loops using an example process from everyday life.</strong> <p> <strong><em>Control flow</em></strong> is the order in which the computer executes statements. <em>Loops</em> offer a quick and easy way to do something repeatedly, changing the control flow of the code. An example of this in daily life would be the process of waking up. The control flow when you wake up is that your alarm goes off, you turn alarm off, you wake up and you take a shower. However as we all know we like to snooze so sometimes when our alarm goes off we will snooze and go back to bed. A loop would then check that we haven't woken up and so the code to take a shower will not run until the condition of us waking up is met. If we are already awake when the alarm goes off the loop will not run at all as the condition has been met. </p> <strong>Explain the difference between accessing data from arrays and objects</strong> <p> The difference between accessing data from arrays and objects is that data from an array can only be accessed through bracket notation where as data from an object can be accessed with bracket and dot notation. Also I think arrays are ordered so that you can only add/remove the first and last element where as you can add/remove or modify any property within an object as long as you know the property name. </p> <strong>Explain what functions are and why they are useful</strong> <p> <strong><em>Functions</em></strong> are a way for us to give instructions to the computer more efficiently. Imagine us doing a daily task such as cooking. Our Ingredients(inputs) and meal(output) would differ but our method i.e. cook will be the same. Functions let us tell the computer to perform a set of instructions, without typing it over and over again, we just give it different inputs to get the corresponding output. </p> </div> </body> <footer> <p> <a href="../tblog.html">Back</a> </p> </footer> </html>
amandahogan/amandahogan.github.io
blog/t4-javascript-basics.html
HTML
mit
3,202
<h1>Full Sail Landing Page</h1> <h2>README</h2> <h3>Objective:</h3> <p>Recreate a PSD landing page using HTML/CSS/JavaScript for Full Sail University</p> <h3>Dependencies</h3> <ul> <li>Rails</li> <li>Boostrap</li> </ul> <h3>How to run through terminal</h3> <ul> <li>Fork project</li> <li>Clone forked repo/install locally</li> <li>Bundle install</li> <li>run "rails s" in the terminal from the root directory of the forked project</li> <li>Type "localhost:3000" into your browsers search bar to view the project</li> </ul> <h3>Designers</h3> <ul> <li>Full Sail University</li> </ul> <h3>Developers</h3> <ul> <li>Christopher Pelnar</li> </ul>
ctpelnar1988/FullSailLandingPage
README.md
Markdown
mit
676
package com.aspose.cloud.sdk.cells.model; public enum ValidFormatsForDocumentEnum { csv, xlsx, xlsm, xltx, xltm, text, html, pdf, ods, xls, spreadsheetml, xlsb, xps, tiff, jpeg, png, emf, bmp, gif }
asposeforcloud/Aspose_Cloud_SDK_For_Android
asposecloudsdk/src/main/java/com/aspose/cloud/sdk/cells/model/ValidFormatsForDocumentEnum.java
Java
mit
236
# Haml Changelog ## 5.0.1 Released on May 3, 2017 ([diff](https://github.com/haml/haml/compare/v5.0.0...v5.0.1)). * Fix parsing attributes including string interpolation. [#917](https://github.com/haml/haml/pull/917) [#921](https://github.com/haml/haml/issues/921) * Stop distributing test files in gem package and allow installing on Windows. * Use ActionView's Erubi/Erubis handler for erb filter only on ActionView. [#914](https://github.com/haml/haml/pull/914) ## 5.0.0 Released on April 26, 2017 ([diff](https://github.com/haml/haml/compare/4.0.7...v5.0.0)). Breaking Changes * Haml now requires Ruby 2.0.0 or above. * Rails 3 is no longer supported, matching the official [Maintenance Policy for Ruby on Rails](http://weblog.rubyonrails.org/2013/2/24/maintenance-policy-for-ruby-on-rails/). (Tee Parham) * The `haml` command's debug option (`-d`) no longer executes the Haml code, but rather checks the generated Ruby syntax for errors. * Drop parser/compiler accessor from `Haml::Engine`. Modify `Haml::Engine#initialize` options or `Haml::Template.options` instead. (Takashi Kokubun) * Drop dynamic quotes support and always escape `'` for `escape_html`/`escape_attrs` instead. Also, escaped results are slightly changed and always unified to the same characters. (Takashi Kokubun) * Don't preserve newlines in attributes. (Takashi Kokubun) * HTML escape interpolated code in filters. [#770](https://github.com/haml/haml/pull/770) (Matt Wildig) :javascript #{JSON.generate(foo: "bar")} Haml 4 output: {"foo":"bar"} Haml 5 output: {&quot;foo&quot;:&quot;bar&quot;} Added * Add a tracing option. When enabled, Haml will output a data-trace attribute on each tag showing the path to the source Haml file from which it was generated. Thanks [Alex Babkin](https://github.com/ababkin). * Add `haml_tag_if` to render a block, conditionally wrapped in another element (Matt Wildig) * Support Rails 5.1 Erubi template handler. * Support Sprockets 3. Thanks [Sam Davies](https://github.com/samphilipd) and [Jeremy Venezia](https://github.com/jvenezia). * General performance and memory usage improvements. (Akira Matsuda) * Analyze attribute values by Ripper and render static attributes beforehand. (Takashi Kokubun) * Optimize attribute rendering about 3x faster. (Takashi Kokubun) * Add temple gem as dependency and create `Haml::TempleEngine` class. Some methods in `Haml::Compiler` are migrated to `Haml::TempleEngine`. (Takashi Kokubun) Fixed * Fix for attribute merging. When an attribute method (or literal nested hash) was used in an old style attribute hash and there is also a (non-static) new style hash there is an error. The fix can result in different behavior in some circumstances. See the [commit message](https://github.com/haml/haml/tree/e475b015d3171fb4c4f140db304f7970c787d6e3) for detailed info. (Matt Wildig) * Make escape_once respect hexadecimal references. (Matt Wildig) * Don't treat the 'data' attribute specially when merging attribute hashes. (Matt Wildig and Norman Clarke) * Fix #@foo and #$foo style interpolation that was not working in html_safe mode. (Akira Matsuda) * Allow `@` as tag's class name. Thanks [Joe Bartlett](https://github.com/redoPop). * Raise `Haml::InvalidAttributeNameError` when attribute name includes invalid characters. (Takashi Kokubun) * Don't ignore unexpected exceptions on initializing `ActionView::OutputBuffer`. (Takashi Kokubun) ## 4.0.7 Released on August 10, 2015 ([diff](https://github.com/haml/haml/compare/4.0.6...4.0.7)). * Significantly improve performance of regexp used to fix whitespace handling in textareas (thanks [Stan Hu](https://github.com/stanhu)). ## 4.0.6 Released on Dec 1, 2014 ([diff](https://github.com/haml/haml/compare/4.0.5...4.0.6)). * Fix warning on Ruby 1.8.7 "regexp has invalid interval" (thanks [Elia Schito](https://github.com/elia)). ## 4.0.5 Released on Jan 7, 2014 ([diff](https://github.com/haml/haml/compare/4.0.4...4.0.5)). * Fix haml_concat appending unescaped HTML after a call to haml_tag. * Fix for bug whereby when HAML :ugly option is "true", ActionView::Helpers::CaptureHelper::capture returns the whole view buffer when passed a block that returns nothing (thanks [Mircea Moise](https://github.com/mmircea16)). ## 4.0.4 Released on November 5, 2013 ([diff](https://github.com/haml/haml/compare/4.0.3...4.0.4)). * Check for Rails::Railtie rather than Rails (thanks [Konstantin Shabanov](https://github.com/etehtsea)). * Parser fix to allow literal '#' with suppress_eval (Matt Wildig). * Helpers#escape_once works on frozen strings (as does ERB::Util.html_escape_once for which it acts as a replacement in Rails (thanks [Patrik Metzmacher](https://github.com/patrik)). * Minor test fix (thanks [Mircea Moise](https://github.com/mmircea16)). ## 4.0.3 Released May 21, 2013 ([diff](https://github.com/haml/haml/compare/4.0.2...4.0.3)). * Compatibility with newer versions of Rails's Erubis handler. * Fix Erubis handler for compatibility with Tilt 1.4.x, too. * Small performance optimization for html_escape. (thanks [Lachlan Sylvester](https://github.com/lsylvester)) * Documentation fixes. * Documented some helper methods that were left out of the reference. (thanks [Shane Riley](https://github.com/shaneriley)) ## 4.0.2 Released April 5, 2013 ([diff](https://github.com/haml/haml/compare/4.0.1...4.0.2)). * Explicitly require Erubis to work around bug in older versions of Tilt. * Fix :erb filter printing duplicate content in Rails views. (thanks [Jori Hardman](https://github.com/jorihardman)) * Replace range with slice to reduce objects created by `capture_haml`. (thanks [Tieg Zaharia](https://github.com/tiegz)) * Correct/improve some documentation. ## 4.0.1 Released March 21, 2013 ([diff](https://github.com/haml/haml/compare/4.0.0...4.0.1)). * Remove Rails 3.2.3+ textarea hack in favor of a more general solution. * Fix some performance regressions. * Fix support for Rails 4 `text_area` helper method. * Fix data attribute flattening with singleton objects. (thanks [Alisdair McDiarmid](https://github.com/alisdair)) * Fix support for sass-rails 4.0 beta. (thanks [Ryunosuke SATO](https://github.com/tricknotes)) * Load "haml/template" in Railtie in order to prevent user options set in a Rails initializer from being overwritten * Don't depend on Rails in haml/template to allow using Haml with ActionView but without Rails itself. (thanks [Hunter Haydel](https://github.com/wedgex)) ## 4.0.0 * The Haml executable now accepts an `--autoclose` option. You can now specify a list of tags that should be autoclosed * The `:ruby` filter no longer redirects $stdout to the Haml document, as this is not thread safe. Instead it provides a `haml_io` local variable, which is an IO object that writes to the document. * HTML5 is now the default output format rather than XHTML. This was already the default on Rails 3+, so many users will notice no difference. * The :sass filter now wraps its output in a style tag, as do the new :less and :scss filters. The :coffee filter wraps its output in a script tag. * Haml now supports only Rails 3 and above, and Ruby 1.8.7 and above. If you still need support for Rails 2 and Ruby 1.8.6, please use Haml 3.1.x which will continue to be maintained for bug fixes. * The :javascript and :css filters no longer add CDATA tags when the format is html4 or html5. This can be overridden by setting the `cdata` option to `true`. CDATA tags are always added when the format is xhtml. * HTML2Haml has been extracted to a separate gem, creatively named "html2haml". * The `:erb` filter now uses Rails's safe output buffer to provide XSS safety. * Haml's internals have been refactored to move the parser, compiler and options handling into independent classes, rather than including them all in the Engine module. You can also specify your own custom Haml parser or compiler class in Haml::Options in order to extend or modify Haml reasonably easily. * Add an {file:REFERENCE.md#hyphenate_data_attrs-option `:hyphenate_data_attrs` option} that converts underscores to hyphens in your HTML5 data keys. This is a language change from 3.1 and is enabled by default. (thanks to [Andrew Smith](https://github.com/fullsailor)) * All Hash attribute values are now treated as HTML5 data, regardless of key. Previously only the "data" key was treated this way. Allowing arbitrary keys means you can now easily use this feature for Aria attributes, among other uses. (thanks to [Elvin Efendi](https://github.com/ElvinEfendi)) * Added `remove_whitespace` option to always remove all whitespace around Haml tags. (thanks to [Tim van der Horst](https://github.com/vdh)) * Haml now flattens deeply nested data attribute hashes. For example: `.foo{:data => {:a => "b", :c => {:d => "e", :f => "g"}}}` would render to: `<div class='foo' data-a='b' data-c-d='e' data-c-f='g'></div>` (thanks to [Péter Pál Koszta](https://github.com/koszta)) * Filters that rely on third-party template engines are now implemented using [Tilt](http://github.com/rtomayko/tilt). Several new filters have been added, namely SCSS (:scss), LessCSS, (:less), and Coffeescript (:coffee/:coffeescript). Though the list of "official" filters is kept intentionally small, Haml comes with a helper method that makes adding support for other Tilt-based template engines trivial. As of 4.0, Haml will also ship with a "haml-contrib" gem that includes useful but less-frequently used filters and helpers. This includes several additional filters such as Nokogiri, Yajl, Markaby, and others. * Generate object references based on `#to_key` if it exists in preference to `#id`. * Performance improvements. (thanks to [Chris Heald](https://github.com/cheald)) * Helper `list_of` takes an extra argument that is rendered into list item attributes. (thanks [Iain Barnett](http://iainbarnett.me.uk/)) * Fix parser to allow lines ending with `some_method?` to be a Ruby multinline. (thanks to [Brad Ediger](https://github.com/bradediger)) * Always use :xhtml format when the mime_type of the rendered template is 'text/xml'. (thanks to [Stephen Bannasch](https://github.com/stepheneb)) * html2haml now includes an `--html-attributes` option. (thanks [Stefan Natchev](https://github.com/snatchev)) * Fix for inner whitespace removal in loops. (thanks [Richard Michael](https://github.com/richardkmichael)) * Use numeric character references rather than HTML entities when escaping double quotes and apostrophes in attributes. This works around some bugs in Internet Explorer earlier than version 9. (thanks [Doug Mayer](https://github.com/doxavore)) * Fix multiline silent comments: Haml previously did not allow free indentation inside multline silent comments. * Fix ordering bug with partial layouts on Rails. (thanks [Sam Pohlenz](https://github.com/spohlenz)) * Add command-line option to suppress script evaluation. * It's now possible to use Rails's asset helpers inside the Sass and SCSS filters. Note that to do so, you must make sure sass-rails is loaded in production, usually by moving it out of the assets gem group. * The Haml project now uses [semantic versioning](http://semver.org/). ## 3.2.0 The Haml 3.2 series was released only as far as 3.2.0.rc.4, but then was renamed to Haml 4.0 when the project adopted semantic versioning. ## 3.1.8 * Fix for line numbers reported from exceptions in nested blocks (thanks to Grant Hutchins & Sabrina Staedt). ## 3.1.7 * Fix for compatibility with Sass 3.2.x. (thanks [Michael Westbom](https://github.com/totallymike)). ## 3.1.6 * In indented mode, don't reindent buffers that contain preserved tags, and provide a better workaround for Rails 3.2.3's textarea helpers. ## 3.1.5 * Respect Rails' `html_safe` flag when escaping attribute values (thanks to [Gerad Suyderhoud](https://github.com/gerad)). * Fix for Rails 3.2.3 textarea helpers (thanks to [James Coleman](https://github.com/jcoleman) and others). ## 3.1.4 * Fix the use of `FormBuilder#block` with a label in Haml. * Fix indentation after a self-closing tag with dynamic attributes. ## 3.1.3 * Stop partial layouts from being displayed twice. ## 3.1.2 * If the ActionView `#capture` helper is used in a Haml template but without any Haml being run in the block, return the value of the block rather than the captured buffer. * Don't throw errors when text is nested within comments. * Fix html2haml. * Fix an issue where destructive modification was sometimes performed on Rails SafeBuffers. * Use character code entities for attribute value replacements instead of named/keyword entities. ## 3.1.1 * Update the vendored Sass to version 3.1.0. ## 3.1.0 * Don't add a `type` attribute to `<script>` and `<style>` tags generated by filters when `:format` is set to `:html5`. * Add an {file:HAML_REFERENCE.md#escape_attrs-option `:escape_attrs` option} that allows attributes to either remain unescaped (for things like embedding PHP directives in Haml) or to be always escaped rather than `#escape_once`d. This can also be used from the command line via `--no-escape-attrs`. * Allow custom filters to be loaded from the command line. ### Backwards Incompatibilities -- Must Read! * Get rid of the `--rails` flag for the `haml` executable. This flag hasn't been necessary since Rails 2.0. Existing Rails 2.0 installations will continue to work. * Drop support for Hpricot 0.7. 0.8 has been out for nearly two years. ## 3.0.25 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.25). * HTML-to-Haml conversion now works within Ruby even if Hpricot is loaded before `haml/html`. ## 3.0.24 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.24). * `html2haml` now properly generates Haml for silent script expressions nested within blocks. * IronRuby compatibility. This is sort of a hack: IronRuby reports its version as 1.9, but it doesn't support the encoding APIs, so we treat it as 1.8 instead. ## 3.0.23 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.23). * Fix the error message for unloadable modules when running the executables under Ruby 1.9.2. * Fix an error when combining old-style and new-style attributes. ## 3.0.22 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.22). * Allow an empty line after `case` but before `when`. * Remove `vendor/sass`, which snuck into the gem by mistake and was causing trouble for Heroku users (thanks to [Jacques Crocker](http://railsjedi.com/)). * Support the Rails 3.1 template handler API. ## 3.0.21 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.21). * Fix the permissions errors for good. ## 3.0.20 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.20). * Fix some permissions errors. ## 3.0.19 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.19). * Fix the `:encoding` option under Ruby 1.9.2. * Fix interpolated if statement when HTML escaping is enabled. * Allow the `--unix-newlines` flag to work on Unix, where it's a no-op. ## 3.0.18 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.18). * Don't require `rake` in the gemspec, for bundler compatibility under JRuby. Thanks to [Gordon McCreight](http://www.gmccreight.com/blog). * Get rid of the annoying RDoc errors on install. * Disambiguate references to the `Rails` module when `haml-rails` is installed. * Fix a bug in `haml_tag` that would allow duplicate attributes to be added and make `data-` attributes not work. * Compatibility with Rails 3 final. ## 3.0.17 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.17). * Understand that mingw counts as Windows. ## 3.0.16 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.16). * Fix an html2haml ERB-parsing bug where ERB blocks were occasionally left without indentation in Haml. * Fix parsing of `if` and `case` statements whose values were assigned to variables. This is still bad style, though. * Fix `form_for` and `form_tag` when they're passed a block that returns a string in a helper. ## 3.0.15 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.15). There were no changes made to Haml between versions 3.0.14 and 3.0.15. ## 3.0.14 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.14). * Allow CSS-style classes and ids to contain colons. * Fix an obscure bug with if statements. ### Rails 3 Support * Don't use the `#returning` method, which Rails 3 no longer provides. ## 3.0.13 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.13). ## Rails 3 Support Support for Rails 3 versions prior to beta 4 has been removed. Upgrade to Rails 3.0.0.beta4 if you haven't already. ### Minor Improvements * Properly process frozen strings with encoding declarations. ## 3.0.12 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.12). ## Rails 3 Support Apparently the last version broke in new and exciting ways under Rails 3, due to the inconsistent load order caused by certain combinations of gems. 3.0.12 hacks around that inconsistency, and *should* be fully Rails 3-compatible. ### Deprecated: Rails 3 Beta 3 Haml's support for Rails 3.0.0.beta.3 has been deprecated. Haml 3.0.13 will only support 3.0.0.beta.4. ## 3.0.11 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.11). ## 3.0.10 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.10). ### Appengine-JRuby Support The way we determine the location of the Haml installation no longer breaks the version of JRuby used by [`appengine-jruby`](http://code.google.com/p/appengine-jruby/). ### Bug Fixes * Single-line comments are now handled properly by `html2haml`. ## 3.0.9 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.9). There were no changes made to Haml between versions 3.0.8 and 3.0.9. A bug in Gemcutter caused the gem to be uploaded improperly. ## 3.0.8 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.8). * Fix a bug with Rails versions prior to Rails 3. ## 3.0.7 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.7). ### Encoding Support Haml 3.0.7 adds support for Ruby-style `-# coding:` comments for declaring the encoding of a template. For details see {file:HAML_REFERENCE.md#encodings the reference}. This also slightly changes the behavior of Haml when the {file:HAML_REFERENCE.md#encoding-option `:encoding` option} is not set. Rather than defaulting to `"utf-8"`, it defaults to the encoding of the source document, and only falls back to `"utf-8"` if this encoding is `"us-ascii"`. The `haml` executable also now takes an `-E` option for specifying encoding, which works the same way as Ruby's `-E` option. ### Other Changes * Default to the {file:HAML_REFERENCE.md#format-option `:html5` format} when running under Rails 3, since it defaults to HTML5 as well. ### Bug Fixes * When generating Haml for something like `<span>foo</span>,`, use `= succeed` rather than `- succeed` (which doesn't work). ## 3.0.6 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.6). ### Rails 2.3.7 Support This release fully supports Rails 2.3.7. ### Rails 2.3.6 Support Removed Rails 2.3.6 was released with various bugs related to XSS-protection and interfacing with Haml. Rails 2.3.7 was released shortly after with fixes for these bugs. Thus, Haml no longer supports Rails 2.3.6, and anyone using it should upgrade to 2.3.7. Attempting to use Haml with Rails 2.3.6 will cause an error. ## 3.0.5 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.5). ### Rails 2.3.6 Support This release hacks around various bugs in Rails 2.3.6, bringing Haml up to full compatibility. ### Rails 3 Support Make sure the `#capture` helper in Rails 3 doesn't print its value directly to the template. ## 3.0.4 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.4). There were no changes made to Haml between versions 3.0.3 and 3.0.4. ## 3.0.3 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.3). ### Rails 3 Support In order to make some Rails loading errors easier to debug, Sass will now raise an error if `Rails.root` is `nil` when Sass is loading. Previously, this would just cause the paths to be mis-set. ## 3.0.2 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.2). There were no changes made to Haml between versions 3.0.1 and 3.0.2. ## 3.0.1 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.1). ### Installation in Rails `haml --rails` is no longer necessary for installing Haml in Rails. Now all you need to do is add `gem "haml"` to the Gemfile for Rails 3, or add `config.gem "haml"` to `config/environment.rb` for previous versions. `haml --rails` will still work, but it has been deprecated and will print an error message. It will not work in the next version of Haml. ### Rails Test Speed The {file:HAML_REFERENCE.md#ugly-option `:ugly` option} is now on by default in the testing environment in Rails to help tests run faster. ## 3.0.0 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.0). ### Backwards Incompatibilities: Must Read! * The `puts` helper has been removed. Use {Haml::Helpers#haml\_concat} instead. ### More Useful Multiline Ruby code can now be wrapped across multiple lines as long as each line but the last ends in a comma. For example: = link_to_remote "Add to cart", :url => { :action => "add", :id => product.id }, :update => { :success => "cart", :failure => "error" } ### `haml_tag` and `haml_concat` Improvements #### `haml_tag` with CSS Selectors The {Haml::Helpers#haml_tag haml\_tag} helper can now take a string using the same class/id shorthand as in standard Haml code. Manually-specified class and id attributes are merged, again as in standard Haml code. For example: haml_tag('#foo') #=> <div id='foo' /> haml_tag('.bar') #=> <div class='bar' /> haml_tag('span#foo.bar') #=> <span class='bar' id='foo' /> haml_tag('span#foo.bar', :class => 'abc') #=> <span class='abc bar' id='foo' /> haml_tag('span#foo.bar', :id => 'abc') #=> <span class='bar' id='abc_foo' /> Cheers, [S. Burkhard](http://github.com/hasclass/). #### `haml_tag` with Multiple Lines of Content The {Haml::Helpers#haml_tag haml\_tag} helper also does a better job of formatting tags with multiple lines of content. If a tag has multiple levels of content, that content is indented beneath the tag. For example: haml_tag(:p, "foo\nbar") #=> # <p> # foo # bar # </p> #### `haml_tag` with Multiple Lines of Content Similarly, the {Haml::Helpers#haml_concat haml\_concat} helper will properly indent multiple lines of content. For example: haml_tag(:p) {haml_concat "foo\nbar"} #=> # <p> # foo # bar # </p> #### `haml_tag` and `haml_concat` with `:ugly` When the {file:HAML_REFERENCE.md#ugly-option `:ugly` option} is enabled, {Haml::Helpers#haml_tag haml\_tag} and {Haml::Helpers#haml_concat haml\_concat} won't do any indentation of their arguments. ### Basic Tag Improvements * It's now possible to customize the name used for {file:HAML_REFERENCE.md#object_reference_ object reference} for a given object by implementing the `haml_object_ref` method on that object. This method should return a string that will be used in place of the class name of the object in the generated class and id. Thanks to [Tim Carey-Smith](http://twitter.com/halorgium). * All attribute values may be non-String types. Their `#to_s` method will be called to convert them to strings. Previously, this only worked for attributes other than `class`. ### `:class` and `:id` Attributes Accept Ruby Arrays In an attribute hash, the `:class` attribute now accepts an Array whose elements will be converted to strings and joined with <nobr>`" "`</nobr>. Likewise, the `:id` attribute now accepts an Array whose elements will be converted to strings and joined with `"_"`. The array will first be flattened and any elements that do not test as true will be stripped out. For example: .column{:class => [@item.type, @item == @sortcol && [:sort, @sortdir]] } could render as any of: class="column numeric sort ascending" class="column numeric" class="column sort descending" class="column" depending on whether `@item.type` is `"numeric"` or `nil`, whether `@item == @sortcol`, and whether `@sortdir` is `"ascending"` or `"descending"`. A single value can still be specified. If that value evaluates to false it is ignored; otherwise it gets converted to a string. For example: .item{:class => @item.is_empty? && "empty"} could render as either of: class="item" class="item empty" Thanks to [Ronen Barzel](http://www.ronenbarzel.org/). ### HTML5 Custom Data Attributes Creating an attribute named `:data` with a Hash value will generate [HTML5 custom data attributes](http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#embedding-custom-non-visible-data). For example: %div{:data => {:author_id => 123, :post_id => 234}} Will compile to: <div data-author_id='123' data-post_id='234'></div> Thanks to [John Reilly](http://twitter.com/johnreilly). ### More Powerful `:autoclose` Option The {file:HAML_REFERENCE.md#attributes_option `:attributes`} option can now take regular expressions that specify which tags to make self-closing. ### `--double-quote-attributes` Option The Haml executable now has a `--double-quote-attributes` option (short form: `-q`) that causes attributes to use a double-quote mark rather than single-quote. Thanks to [Charles Roper](http://charlesroper.com/). ### `:css` Filter Haml now supports a {file:HAML_REFERENCE.md#css-filter `:css` filter} that surrounds the filtered text with `<style>` and CDATA tags. ### `haml-spec` Integration We've added the cross-implementation tests from the [haml-spec](http://github.com/norman/haml-spec) project to the standard Haml test suite, to be sure we remain compatible with the base functionality of the many and varied [Haml implementations](http://en.wikipedia.org/wiki/Haml#Implementations). ### Ruby 1.9 Support * Haml and `html2haml` now produce more descriptive errors when given a template with invalid byte sequences for that template's encoding, including the line number and the offending character. * Haml and `html2haml` now accept Unicode documents with a [byte-order-mark](http://en.wikipedia.org/wiki/Byte_order_mark). ### Rails Support * When `form_for` is used with `=`, or `form_tag` is used with `=` and a block, they will now raise errors explaining that they should be used with `-`. This is similar to how {Haml::Helpers#haml\_concat} behaves, and will hopefully clear up some difficult bugs for some users. ### Rip Support Haml is now compatible with the [Rip](http://hellorip.com/) package management system. Thanks to [Josh Peek](http://joshpeek.com/). ### `html2haml` Improvements * Ruby blocks within ERB are now supported. The Haml code is properly indented and the `end`s are removed. This includes methods with blocks and all language constructs such as `if`, `begin`, and `case`. For example: <% content_for :footer do %> <p>Hi there!</p> <% end %> is now transformed into: - content_for :footer do %p Hi there! Thanks to [Jack Chen](http://chendo.net) and [Dr. Nic Williams](http://drnicwilliams) for inspiring this and creating the first draft of the code. * Inline HTML text nodes are now transformed into inline Haml text. For example, `<p>foo</p>` now becomes `%p foo`, whereas before it became: %p foo The same is true for inline comments, and inline ERB when running in ERB mode: `<p><%= foo %></p>` will now become `%p= foo`. * ERB included within text is now transformed into Ruby interpolation. For example: <p> Foo <%= bar %> baz! Flip <%= bang %>. </p> is now transformed into: %p Foo #{bar} baz! Flip #{bang}. * `<script>` tags are now transformed into `:javascript` filters, and `<style>` tags into `:css` filters. and indentation is preserved. For example: <script type="text/javascript"> function foo() { return 12; } </script> is now transformed into: :javascript function foo() { return 12; } * `<pre>` and `<textarea>` tags are now transformed into the `:preserve` filter. For example: <pre>Foo bar baz</pre> is now transformed into: %pre :preserve Foo bar baz * Self-closing tags (such as `<br />`) are now transformed into self-closing Haml tags (like `%br/`). * IE conditional comments are now properly parsed. * Attributes are now output in a more-standard format, without spaces within the curly braces (e.g. `%p{:foo => "bar"}` as opposed to `%p{ :foo => "bar" }`). * IDs and classes containing `#` and `.` are now output as string attributes (e.g. `%p{:class => "foo.bar"}`). * Attributes are now sorted, to maintain a deterministic order. * `>` or {Haml::Helpers#succeed #succeed} are inserted where necessary when inline formatting is used. * Multi-line ERB statements are now properly indented, and those without any content are removed. ### Minor Improvements * {Haml::Helpers#capture_haml capture\_haml} is now faster when using `:ugly`. Thanks to [Alf Mikula](http://alfmikula.blogspot.com/). * Add an `RDFa` doctype shortcut. ## 2.2.24 [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.24). * Don't prevent ActiveModel form elements from having error formatting applied. * Make sure `form_for` blocks are properly indented under Rails 3.0.0.beta.3. * Don't activate a bug in the `dynamic_form` plugin under Rails 3.0.0.beta.3 that would cause its methods not to be loaded. ## 2.2.23 [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.23). * Don't crash when `rake gems` is run in Rails with Haml installed. Thanks to [Florian Frank](http://github.com/flori). * Don't remove `\n` in filters with interpolation. * Silence those annoying `"regexp match /.../n against to UTF-8 string"` warnings. ## 2.2.22 [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.22). * Add a railtie so Haml and Sass will be automatically loaded in Rails 3. Thanks to [Daniel Neighman](http://pancakestacks.wordpress.com/). * Add a deprecation message for using `-` with methods like `form_for` that return strings in Rails 3. This is [the same deprecation that exists in Rails 3](http://github.com/rails/rails/commit/9de83050d3a4b260d4aeb5d09ec4eb64f913ba64). * Make sure line numbers are reported correctly when filters are being used. * Make loading the gemspec not crash on read-only filesystems like Heroku's. * Don't crash when methods like `form_for` return `nil` in, for example, Rails 3 beta. * Compatibility with Rails 3 beta's RJS facilities. ## 2.2.21 [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.21). * Fix a few bugs in the git-revision-reporting in Haml::Version. In particular, it will still work if `git gc` has been called recently, or if various files are missing. * Always use `__FILE__` when reading files within the Haml repo in the `Rakefile`. According to [this bug report](http://github.com/carlhuda/bundler/issues/issue/44), this should make Haml work better with Bundler. * Make the error message for `- end` a little more intuitive based on user feedback. * Compatibility with methods like `form_for` that return strings rather than concatenate to the template in Rails 3. * Add a {Haml::Helpers#with_tabs with_tabs} helper, which sets the indentation level for the duration of a block. ## 2.2.20 [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.20). * The `form_tag` Rails helper is now properly marked as HTML-safe when using Rails' XSS protection with Rails 2.3.5. * Calls to `defined?` shouldn't interfere with Rails' autoloading in very old versions (1.2.x). * Fix a bug where calls to ActionView's `render` method with blocks and layouts wouldn't work under the Rails 3.0 beta. * Fix a bug where the closing tags of nested calls to \{Haml::Helpers#haml\_concat} were improperly escaped under the Rails 3.0 beta. ## 2.2.19 [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.19). * Fix a bug with the integration with Rails' XSS support. In particular, correctly override `safe_concat`. ## 2.2.18 [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.18). * Support [the new XSS-protection API](http://yehudakatz.com/2010/02/01/safebuffers-and-rails-3-0/) used in Rails 3. * Use `Rails.env` rather than `RAILS_ENV` when running under Rails 3.0. Thanks to [Duncan Grazier](http://duncangrazier.com/). * Add a `--unix-newlines` flag to all executables for outputting Unix-style newlines on Windows. * Fix a couple bugs with the `:erb` filter: make sure error reporting uses the correct line numbers, and allow multi-line expressions. * Fix a parsing bug for HTML-style attributes including `#`. ## 2.2.17 [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.17). * Fix compilation of HTML5 doctypes when using `html2haml`. * `nil` values for Sass options are now ignored, rather than raising errors. ## 2.2.16 [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.16). * Abstract out references to `ActionView::TemplateError`, `ActionView::TemplateHandler`, etc. These have all been renamed to `ActionView::Template::*` in Rails 3.0. ## 2.2.15 [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.15). * Allow `if` statements with no content followed by `else` clauses. For example: - if foo - else bar ## 2.2.14 [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.14). * Don't print warnings when escaping attributes containing non-ASCII characters in Ruby 1.9. * Don't crash when parsing an XHTML Strict doctype in `html2haml`. * Support the HTML5 doctype in an XHTML document by using `!!! 5` as the doctype declaration. ## 2.2.13 [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.13). * Allow users to specify {file:HAML_REFERENCE.md#encoding_option `:encoding => "ascii-8bit"`} even for templates that include non-ASCII byte sequences. This makes Haml templates not crash when given non-ASCII input that's marked as having an ASCII encoding. * Fixed an incompatibility with Hpricot 0.8.2, which is used for `html2haml`. ## 2.2.12 [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.12). There were no changes made to Haml between versions 2.2.11 and 2.2.12. ## 2.2.11 [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.11). * Fixed a bug with XSS protection where HTML escaping would raise an error if passed a non-string value. Note that this doesn't affect any HTML escaping when XSS protection is disabled. * Fixed a bug in outer-whitespace nuking where whitespace-only Ruby strings blocked whitespace nuking beyond them. * Use `ensure` to protect the resetting of the Haml output buffer against exceptions that are raised within the compiled Haml code. * Fix an error line-numbering bug that appeared if an error was thrown within loud script (`=`). This is not the best solution, as it disables a few optimizations, but it shouldn't have too much effect and the optimizations will hopefully be re-enabled in version 2.4. * Don't crash if the plugin skeleton is installed and `rake gems:install` is run. * Don't use `RAILS_ROOT` directly. This no longer exists in Rails 3.0. Instead abstract this out as `Haml::Util.rails_root`. This changes makes Haml fully compatible with edge Rails as of this writing. ## 2.2.10 [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.10). * Fixed a bug where elements with dynamic attributes and no content would have too much whitespace between the opening and closing tag. * Changed `rails/init.rb` away from loading `init.rb` and instead have it basically copy the content. This allows us to transfer the proper binding to `Haml.init_rails`. * Make sure Haml only tries to enable XSS protection integration once all other plugins are loaded. This allows it to work properly when Haml is a gem and the `rails_xss` plugin is being used. * Mark the return value of Haml templates as HTML safe. This makes Haml partials work with Rails' XSS protection. ## 2.2.9 [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.9). * Fixed a bug where Haml's text was concatenated to the wrong buffer under certain circumstances. This was mostly an issue under Rails when using methods like `capture`. * Fixed a bug where template text was escaped when there was interpolation in a line and the `:escape_html` option was enabled. For example: Foo &lt; Bar #{"<"} Baz with `:escape_html` used to render as Foo &amp;lt; Bar &lt; Baz but now renders as Foo &lt; Bar &lt; Baz ### Rails XSS Protection Haml 2.2.9 supports the XSS protection in Rails versions 2.3.5+. There are several components to this: * If XSS protection is enabled, Haml's {file:HAML_REFERENCE.md#escape_html-option `:escape_html`} option is set to `true` by default. * Strings declared as HTML safe won't be escaped by Haml, including the {file:Haml/Helpers.html#html_escape-instance_method `#html_escape`} helper and `&=` if `:escape_html` has been disabled. * Haml helpers that generate HTML are marked as HTML safe, and will escape their input if it's not HTML safe. ## 2.2.8 [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.8). * Fixed a potential XSS issue with HTML escaping and wacky Unicode nonsense. This is the same as [the issue fixed in Rails](http://groups.google.com/group/rubyonrails-security/browse_thread/thread/48ab3f4a2c16190f) a bit ago. ## 2.2.7 [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.7). * Fixed an `html2haml` issue where ERB attribute values weren't HTML-unescaped before being transformed into Haml. * Fixed an `html2haml` issue where `#{}` wasn't escaped before being transformed into Haml. * Add `<code>` to the list of tags that's {file:HAML_REFERENCE.md#preserve-option automatically whitespace-preserved}. * Fixed a bug with `end` being followed by code in silent scripts - it no longer throws an error when it's nested beneath tags. * Fixed a bug with inner whitespace-nuking and conditionals. The `else` et al. clauses of conditionals are now properly whitespace-nuked. ## 2.2.6 [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.6). * Made the error message when unable to load a dependency for html2haml respect the `--trace` option. * Don't crash when the `__FILE__` constant of a Ruby file is a relative path, as apparently happens sometimes in TextMate (thanks to [Karl Varga](http://github.com/kjvarga)). * Add "Sass" to the `--version` string for the executables. * Raise an exception when commas are omitted in static attributes (e.g. `%p{:foo => "bar" :baz => "bang"}`). ## 2.2.5 [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.5). * Got rid of trailing whitespace produced when opening a conditional comment (thanks to [Norman Clarke](http://blog.njclarke.com/)). * Fixed CSS id concatenation when a numeric id is given as an attribute. (thanks to [Norman Clarke](http://blog.njclarke.com/)). * Fixed a couple bugs with using "-end" in strings. ## 2.2.4 [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.4). * Allow `end` to be used for silent script when it's followed by code. For example: - form_for do ... - end if @show_form This isn't very good style, but we're supporting it for consistency's sake. * Don't add `require 'rubygems'` to the top of init.rb when installed via `haml --rails`. This isn't necessary, and actually gets clobbered as soon as haml/template is loaded. ## 2.2.3 [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.3). Haml 2.2.3 adds support for the JRuby bundling tools for Google AppEngine, thanks to [Jan Ulbrich](http://github.com/ulbrich). ## 2.2.2 [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.2). Haml 2.2.2 is a minor bugfix release, with several notable changes. First, {file:Haml/Helpers.html#haml_concat-instance_method `haml_concat`} will now raise an error when used with `=`. This has always been incorrect behavior, and in fact has never actually worked. The only difference is that now it will fail loudly. Second, Ruby 1.9 is now more fully supported, especially with the {file:HAML_REFERENCE.md#htmlstyle_attributes_ new attribute syntax}. Third, filters are no longer escaped when the {file:HAML_REFERENCE.md#escape_html-option `:escape_html` option} is enabled and `#{}` interpolation is used. ## 2.2.1 [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.1). Haml 2.2.1 is a minor bug-fix release. ## 2.2.0 [Tagged on GitHub](http://github.com/nex3/haml/commit/2.2.0). Haml 2.2 adds several new features to the language, fixes several bugs, and dramatically improves performance (particularly when running with {file:HAML_REFERENCE.md#ugly-option `:ugly`} enabled). ### Syntax Changes #### HTML-Style Attribute Syntax Haml 2.2 introduces a new syntax for attributes based on the HTML syntax. For example: %a(href="http://haml.info" title="Haml's so cool!") %img(src="/images/haml.png" alt="Haml") There are two main reasons for this. First, the hash-style syntax is very Ruby-specific. There are now [Haml implementations](http://en.wikipedia.org/wiki/Haml#Implementations) in many languages, each of which has its own syntax for hashes (or dicts or associative arrays or whatever they're called). The HTML syntax will be adopted by all of them, so you can feel comfortable using Haml in whichever language you need. Second, the hash-style syntax is quite verbose. `%img{:src => "/images/haml.png", :alt => "Haml"}` is eight characters longer than `%img(src="/images/haml.png" alt="Haml")`. Haml's supposed to be about writing templates quickly and easily; HTML-style attributes should help out a lot with that. Ruby variables can be used as attribute values by omitting quotes. Local variables or instance variables can be used. For example: %a(title=@title href=href) Stuff This is the same as: %a{:title => @title, :href => href} Stuff Because there are no commas separating attributes, more complicated expressions aren't allowed. You can use `#{}` interpolation to insert complicated expressions in a HTML-style attribute, though: %span(class="widget_#{@widget.number}") #### Multiline Attributes In general, Haml tries to keep individual elements on a single line. There is a [multiline syntax](#multiline) for overflowing onto further lines, but it's intentionally awkward to use to encourage shorter lines. However, there is one case where overflow is reasonable: attributes. Often a tag will simply have a lot of attributes, and in this case it makes sense to allow overflow. You can now stretch an attribute hash across multiple lines: %script{:type => "text/javascript", :src => "javascripts/script_#{2 + 7}"} This also works for HTML-style attributes: %script(type="text/javascript" src="javascripts/script_#{2 + 7}") Note that for hash-style attributes, the newlines must come after commas. #### Universal interpolation In Haml 2.0, you could use `==` to interpolate Ruby code within a line of text using `#{}`. In Haml 2.2, the `==` is unnecessary; `#{}` can be used in any text. For example: %p This is a really cool #{h what_is_this}! But is it a #{h what_isnt_this}? In addition, to {file:HAML_REFERENCE.md#escaping_html escape} or {file:HAML_REFERENCE.md#unescaping_html unescape} the interpolated code, you can just add `&` or `!`, respectively, to the beginning of the line: %p& This is a really cool #{what_is_this}! & But is it a #{what_isnt_this}? #### Flexible indentation Haml has traditionally required its users to use two spaces of indentation. This is the universal Ruby style, and still highly recommended. However, Haml now allows any number of spaces or even tabs for indentation, provided: * Tabs and spaces are not mixed * The indentation is consistent within a given document ### New Options #### `:ugly` The `:ugly` option is not technically new; it was introduced in Haml 2.0 to make rendering deeply nested templates less painful. However, it's been greatly empowered in Haml 2.2. It now does all sorts of performance optimizations that couldn't be done before, and its use increases Haml's performance dramatically. It's enabled by default in production in Rails, and it's highly recommended for production environments in other frameworks. #### `:encoding` {#encoding-option} This option specifies the encoding of the Haml template when running under Ruby 1.9. It defaults to `Encoding.default_internal` or `"utf-8"`. This is useful for making sure that you don't get weird encoding errors when dealing with non-ASCII input data. ### Deprecations #### `Haml::Helpers#puts` This helper is being deprecated for the obvious reason that it conflicts with the `Kernel#puts` method. I'm ashamed I ever chose this name. Use `haml_concat` instead and spare me the embarrassment. #### `= haml_tag` A lot of people accidentally use "`= haml_tag`". This has always been wrong; `haml_tag` outputs directly to the template, and so should be used as "`- haml_tag`". Now it raises an error when you use `=`. ### Compatibility #### Rails Haml 2.2 is fully compatible with Rails, from 2.0.6 to the latest revision of edge, 783db25. #### Ruby 1.9 Haml 2.2 is also fully compatible with Ruby 1.9. It supports Ruby 1.9-style attribute hashes, and handles encoding-related issues (see [the `:encoding` option](#encoding-option)). ### Filters #### `:markdown` There are numerous improvements to the Markdown filter. No longer will Haml attempt to use RedCloth's inferior Markdown implementation. Instead, it will look for all major Markdown implementations: [RDiscount](https://github.com/rtomayko/rdiscount), [RPeg-Markdown](https://github.com/rtomayko/rpeg-markdown), [Maruku](http://maruku.rubyforge.org), and [BlueCloth](http://www.deveiate.org/projects/BlueCloth). #### `:cdata` There is now a `:cdata` filter for wrapping text in CDATA tags. #### `:sass` The `:sass` filter now uses options set in `Sass::Plugin`, if they're available. ### Executables #### `haml` The `haml` executable now takes `-r` and `-I` flags that act just like the same flags for the `ruby` executable. This allows users to load helper files when using Haml from the command line. It also takes a `--debug` flag that causes it to spit out the Ruby code that Haml generates from the template. This is more for my benefit than anything, but you may find it interesting. #### `html2haml` The `html2haml` executable has undergone significant improvements. Many of these are bugfixes, but there are also a few features. For one, it now understands CDATA tags and autodetects ERB files. In addition, a line containing just "`- end`" is now a Haml error; since it's not possible for `html2haml` to properly parse all Ruby blocks, this acts as a signal for the author that there are blocks to be dealt with. ### Miscellaneous #### XHTML Mobile DTD Haml 2.2 supports a DTD for XHTML Mobile: `!!! Mobile`. #### YARD All the documentation for Haml 2.2, including this changelog, has been moved to [YARD](http://yard.soen.ca). YARD is an excellent documentation system, and allows us to write our documentation in [Maruku](http://maruku.rubyforge.org), which is also excellent. >>>>>>> External Changes
lrosskamp/makealist-public
vendor/cache/ruby/2.3.0/gems/haml-5.0.1/CHANGELOG.md
Markdown
mit
47,994
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Package' db.create_table(u'api_package', ( (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=500, db_index=True)), ('url', self.gf('django.db.models.fields.CharField')(unique=True, max_length=500)), ('created_at', self.gf('django.db.models.fields.DateField')(auto_now_add=True, blank=True)), )) db.send_create_signal(u'api', ['Package']) # Adding unique constraint on 'Package', fields ['name', 'url'] db.create_unique(u'api_package', ['name', 'url']) def backwards(self, orm): # Removing unique constraint on 'Package', fields ['name', 'url'] db.delete_unique(u'api_package', ['name', 'url']) # Deleting model 'Package' db.delete_table(u'api_package') models = { u'api.package': { 'Meta': {'unique_together': "(('name', 'url'),)", 'object_name': 'Package'}, 'created_at': ('django.db.models.fields.DateField', [], {'auto_now_add': 'True', 'blank': 'True'}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '500', 'db_index': 'True'}), 'url': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '500'}) } } complete_apps = ['api']
toranb/django-bower-registry
api/migrations/0001_initial.py
Python
mit
1,703
from __future__ import absolute_import import matplotlib # Force matplotlib to not use any Xwindows backend. matplotlib.use('Agg') import matplotlib.pyplot as plt from plotly.tests.utils import compare_dict from plotly.tests.test_optional.optional_utils import run_fig from plotly.tests.test_optional.test_matplotlylib.data.annotations import * def test_annotations(): fig, ax = plt.subplots() ax.plot([1, 2, 3], 'b-') ax.plot([3, 2, 1], 'b-') ax.text(0.001, 0.999, 'top-left', transform=ax.transAxes, va='top', ha='left') ax.text(0.001, 0.001, 'bottom-left', transform=ax.transAxes, va='baseline', ha='left') ax.text(0.999, 0.999, 'top-right', transform=ax.transAxes, va='top', ha='right') ax.text(0.999, 0.001, 'bottom-right', transform=ax.transAxes, va='baseline', ha='right') renderer = run_fig(fig) for data_no, data_dict in enumerate(renderer.plotly_fig['data']): equivalent, msg = compare_dict(data_dict, ANNOTATIONS['data'][data_no]) assert equivalent, msg for no, note in enumerate(renderer.plotly_fig['layout']['annotations']): equivalent, msg = compare_dict(note, ANNOTATIONS['layout']['annotations'][no]) assert equivalent, msg
ee-in/python-api
plotly/tests/test_optional/test_matplotlylib/test_annotations.py
Python
mit
1,342
const { environment } = require('@rails/webpacker') const webpack = require('webpack') // excluding node_modules from being transpiled by babel-loader. environment.loaders.delete("nodeModules"); environment.plugins.prepend('Provide', new webpack.ProvidePlugin({ $: 'jquery', jQuery: 'jquery', jquery: "jquery", Popper: ['popper.js', 'default'] })) // const aliasConfig = { // 'jquery': 'jquery-ui-dist/external/jquery/jquery.js', // 'jquery-ui': 'jquery-ui-dist/jquery-ui.js' // }; // environment.config.set('resolve.alias', aliasConfig); // resolve-url-loader must be used before sass-loader // https://github.com/rails/webpacker/blob/master/docs/css.md#resolve-url-loader environment.loaders.get("sass").use.splice(-1, 0, { loader: "resolve-url-loader" }); module.exports = environment
edk/tribalknow
config/webpack/environment.js
JavaScript
mit
810
from distutils.core import setup setup( # Application name: name="streaker", # Version number (initial): version="0.0.1", # Application author details: author="Aldi Alimucaj", author_email="[email protected]", # Packages packages=["streaker"], scripts=['bin/streaker'], # Include additional files into the package include_package_data=True, # Details url="http://pypi.python.org/pypi/Streaker_v001/", # license="MIT", description="GitHub streak manipulator", # long_description=open("README.txt").read(), # Dependent packages (distributions) install_requires=[ # "", ], )
aldialimucaj/Streaker
setup.py
Python
mit
680
const ResponseMessage = require('../../messages').Response; const through2 = require('through2'); const xtend = require('xtend'); var defaults = { ignore_invalid: false }; function encoder(Message, options) { options = xtend(defaults, options || {}); return through2.obj(function(message, enc, callback) { if (Message.verify(message)) { if (options.ignore_invalid) { return this.queue(message); } throw new Error('unhandled request'); } return callback(null, Message.encodeDelimited(message).finish()); }); } module.exports = function () { return encoder(ResponseMessage); };
auth0/node-baas
lib/pipeline/response_writer.js
JavaScript
mit
673
<?php namespace CoreBundle\Model\map; use \RelationMap; use \TableMap; /** * This class defines the structure of the 'list_holidays' table. * * * * This map class is used by Propel to do runtime db structure discovery. * For example, the createSelectSql() method checks the type of a given column used in an * ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive * (i.e. if it's a text column type). * * @package propel.generator.src.CoreBundle.Model.map */ class ListHolidaysTableMap extends TableMap { /** * The (dot-path) name of this class */ const CLASS_NAME = 'src.CoreBundle.Model.map.ListHolidaysTableMap'; /** * Initialize the table attributes, columns and validators * Relations are not initialized by this method since they are lazy loaded * * @return void * @throws PropelException */ public function initialize() { // attributes $this->setName('list_holidays'); $this->setPhpName('ListHolidays'); $this->setClassname('CoreBundle\\Model\\ListHolidays'); $this->setPackage('src.CoreBundle.Model'); $this->setUseIdGenerator(true); // columns $this->addPrimaryKey('id', 'Id', 'INTEGER', true, null, null); $this->addColumn('date', 'Date', 'TIMESTAMP', true, null, null); $this->addColumn('name', 'Name', 'VARCHAR', true, 45, null); $this->addColumn('type', 'Type', 'VARCHAR', true, 45, null); // validators } // initialize() /** * Build the RelationMap objects for this table relationships */ public function buildRelations() { } // buildRelations() } // ListHolidaysTableMap
aianguanlao/prols
Backend/PROLS/src/CoreBundle/Model/map/ListHolidaysTableMap.php
PHP
mit
1,732
// Modified from https://github.com/dburrows/draft-js-basic-html-editor/blob/master/src/utils/draftRawToHtml.js 'use strict'; import { List } from 'immutable'; import * as InlineStylesProcessor from './inline-styles-processor'; import ApiDataInstance from './api-data-instance'; import AtomicBlockProcessor from './atomic-block-processor'; import ENTITY from './entities'; import merge from 'lodash/merge'; const _ = { merge, } const annotationIndicatorPrefix = '__ANNOTATION__='; let defaultBlockTagMap = { 'atomic': `<div>%content%</div>`, 'blockquote': `<blockquote>%content%</blockquote>`, 'code-block': `<code>%content%</code>`, 'default': `<p>%content%</p>`, 'header-one': `<h1>%content%</h1>`, 'header-two': `<h2>%content%</h2>`, 'header-three': `<h3>%content%</h3>`, 'header-four': `<h4>%content%</h4>`, 'header-five': `<h5>%content%</h5>`, 'header-six': `<h6>%content%</h6>`, 'ordered-list-item': `<li>%content%</li>`, 'paragraph': `<p>%content%</p>`, 'unordered-list-item': `<li>%content%</li>`, 'unstyled': `<p>%content%</p>`, }; let inlineTagMap = { BOLD: ['<strong>', '</strong>'], CODE: ['<code>', '</code>'], default: ['<span>', '</span>'], ITALIC: ['<em>', '</em>'], UNDERLINE: ['<u>', '</u>'], }; let defaultEntityTagMap = { [ENTITY.ANNOTATION.type]: ['<abbr title="<%= data.pureAnnotationText %>"><%= data.text %>', '</abbr>'], [ENTITY.AUDIO.type]: ['<div class="audio-container"><div class="audio-title"><%= data.title %></div><div class="audio-desc"><%= data.description %></div><audio src="<%= data.url %>" />', '</div>'], [ENTITY.BLOCKQUOTE.type]: ['<blockquote><div><%= data.quote %></div><div><%= data.quoteBy %></div>', '<blockquote>'], [ENTITY.EMBEDDEDCODE.type]: ['<div><%= data.embeddedCode%>', '</div>'], [ENTITY.INFOBOX.type]: ['<div class="info-box-container"><div class="info-box-title"><%= data.title %></div><div class="info-box-body"><%= data.body %></div>', '</div>'], [ENTITY.LINK.type]: ['<a target="_blank" href="<%= data.url %>">', '</a>'], [ENTITY.IMAGE.type]: ['<img alt="<%= data.description %>" src="<%= data.url %>">', '</img>'], [ENTITY.IMAGELINK.type]: ['<img alt="<%= data.description %>" src="<%= data.url %>">', '</img>'], [ENTITY.SLIDESHOW.type]: ['<!-- slideshow component start --> <ol class="slideshow-container"> <% if(!data) { data = []; } data.forEach(function(image) { %><li class="slideshow-slide"><img src="<%- image.url %>" /></li><% }); %>', '</ol><!-- slideshow component end -->'], [ENTITY.IMAGEDIFF.type]: ['<!-- imageDiff component start --> <ol class="image-diff-container"> <% if(!data) { data = []; } data.forEach(function(image, index) { if (index > 1) { return; } %><li class="image-diff-item"><img src="<%- image.url %>" /></li><% }); %>', '</ol><!-- imageDiff component end-->'], [ENTITY.YOUTUBE.type]: ['<iframe width="560" height="315" src="https://www.youtube.com/embed/<%= data.youtubeId %>" frameborder="0" allowfullscreen>', '</iframe>'], }; let nestedTagMap = { 'ordered-list-item': ['<ol>', '</ol>'], 'unordered-list-item': ['<ul>', '</ul>'], }; function _convertInlineStyle (block, entityMap, blockTagMap, entityTagMap) { return blockTagMap[block.type] ? blockTagMap[block.type].replace( '%content%', InlineStylesProcessor.convertToHtml(inlineTagMap, entityTagMap, entityMap, block) ) : blockTagMap.default.replace( '%content%', InlineStylesProcessor.convertToHtml(inlineTagMap, block) ); } function _convertBlocksToHtml (blocks, entityMap, blockTagMap, entityTagMap) { let html = ''; let nestLevel = []; // store the list type of the previous item: null/ol/ul blocks.forEach((block) => { // create tag for <ol> or <ul>: deal with ordered/unordered list item // if the block is a list-item && the previous block is not a list-item if (nestedTagMap[block.type] && nestLevel[0] !== block.type) { html += nestedTagMap[block.type][0]; // start with <ol> or <ul> nestLevel.unshift(block.type); } // end tag with </ol> or </ul>: deal with ordered/unordered list item if (nestLevel.length > 0 && nestLevel[0] !== block.type) { html += nestedTagMap[nestLevel.shift()][1]; // close with </ol> or </ul> } html += _convertInlineStyle(block, entityMap, blockTagMap, entityTagMap); }); // end tag with </ol> or </ul>: or if it is the last block if (blocks.length > 0 && nestedTagMap[blocks[blocks.length - 1].type]) { html += nestedTagMap[nestLevel.shift()][1]; // close with </ol> or </ul> } return html; } function convertBlocksToApiData (blocks, entityMap, entityTagMap) { let apiDataArr = List(); let content = []; let nestLevel = []; blocks.forEach((block) => { // block is not a list-item if (!nestedTagMap[block.type]) { // if previous block is a list-item if (content.length > 0 && nestLevel.length > 0) { apiDataArr = apiDataArr.push(new ApiDataInstance({ type: nestLevel[0], content: content })); content = []; nestLevel.shift(); } if (block.type.startsWith('atomic') || block.type.startsWith('media')) { apiDataArr = apiDataArr.push(AtomicBlockProcessor.convertBlock(entityMap, block)); } else { let converted = InlineStylesProcessor.convertToHtml(inlineTagMap, entityTagMap, entityMap, block); let type = block.type; // special case for block containing annotation entity // set this block type as annotation if (converted.indexOf(annotationIndicatorPrefix) > -1) { type = ENTITY.ANNOTATION.type.toLowerCase(); } apiDataArr = apiDataArr.push(new ApiDataInstance({ id: block.key, type: type, content: [converted] })); } } else { let converted = InlineStylesProcessor.convertToHtml(inlineTagMap, entityTagMap, entityMap, block); // previous block is not an item-list block if (nestLevel.length === 0) { nestLevel.unshift(block.type); content.push(converted); } else if (nestLevel[0] === block.type) { // previous block is a item-list and current block is the same item-list content.push(converted); } else if (nestLevel[0] !== block.type) { // previous block is a different item-list. apiDataArr = apiDataArr.push(new ApiDataInstance({ id: block.key, type: nestLevel[0], content: content })); content = [converted]; nestLevel[0] = block.type; } } }); // last block is a item-list if (blocks.length > 0 && nestLevel.length > 0) { let block = blocks[blocks.length - 1]; apiDataArr = apiDataArr.push(new ApiDataInstance({ id: block.key, type: block.type, content: content })); } return apiDataArr; } function convertRawToHtml (raw, blockTagMap, entityTagMap) { blockTagMap = _.merge({}, defaultBlockTagMap, blockTagMap); entityTagMap = entityTagMap || defaultEntityTagMap; let html = ''; raw = raw || {}; const blocks = Array.isArray(raw.blocks) ? raw.blocks : []; const entityMap = typeof raw.entityMap === 'object' ? raw.entityMap : {}; html = _convertBlocksToHtml(blocks, entityMap, blockTagMap, entityTagMap); return html; } function convertRawToApiData (raw) { let apiData; raw = raw || {}; const blocks = Array.isArray(raw.blocks) ? raw.blocks : []; const entityMap = typeof raw.entityMap === 'object' ? raw.entityMap : {}; let entityTagMap = _.merge({}, defaultEntityTagMap, { // special handling for annotation entity // annotation entity data will be included in the speical comment. [ENTITY.ANNOTATION.type]: [`<!--${annotationIndicatorPrefix}<%= JSON.stringify(data) %>--><!--`, '-->'], }); apiData = convertBlocksToApiData(blocks, entityMap, entityTagMap); return apiData; } export default { convertToHtml: convertRawToHtml, convertToApiData: convertRawToApiData, };
nickhsine/keystone
fields/types/html/editor/draft-converter.js
JavaScript
mit
7,620
-- -------------------------------------------------------- -- Host: 127.0.0.1 -- Versión del servidor: 5.6.17 - MySQL Community Server (GPL) -- SO del servidor: Win64 -- HeidiSQL Versión: 9.1.0.4867 -- -------------------------------------------------------- /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET NAMES utf8mb4 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -- Volcando estructura para tabla ironfist_areslands.laravel_migrations CREATE TABLE IF NOT EXISTS `laravel_migrations` ( `bundle` varchar(50) COLLATE utf8_bin NOT NULL, `name` varchar(200) COLLATE utf8_bin NOT NULL, `batch` int(11) NOT NULL, PRIMARY KEY (`bundle`,`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -- La exportación de datos fue deseleccionada. /*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */; /*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
Ruk33/AresLands
sql/tables/laravel_migrations.sql
SQL
mit
1,179
db_config = YAML.load(File.read(ROOT_DIR + '/../config/database.yaml'))['production'] ActiveRecord::Base.establish_connection(db_config) class Node < ActiveRecord::Base has_many :cidrs has_one :limit def flow_id self.id + 10 end def mark_in $config['iptables']['mark_prefix_in'] + "%04d" % self.id end def mark_out $config['iptables']['mark_prefix_out'] + "%04d" % self.id end end class Cidr < ActiveRecord::Base belongs_to :node end class Limit < ActiveRecord::Base belongs_to :node end
pawelsawicki/onoclea-qos
webapp/lib/database.rb
Ruby
mit
527
using System; using System.Runtime.InteropServices; using System.Text; namespace CSharpGL { public partial class GL { #region OpenGL 2.0 // Constants ///// <summary> ///// ///// </summary> //public const uint GL_BLEND_EQUATION_RGB = 0x8009; ///// <summary> ///// ///// </summary> //public const uint GL_VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622; ///// <summary> ///// ///// </summary> //public const uint GL_VERTEX_ATTRIB_ARRAY_SIZE = 0x8623; ///// <summary> ///// ///// </summary> //public const uint GL_VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624; ///// <summary> ///// ///// </summary> //public const uint GL_VERTEX_ATTRIB_ARRAY_TYPE = 0x8625; ///// <summary> ///// ///// </summary> //public const uint GL_CURRENT_VERTEX_ATTRIB = 0x8626; /// <summary> /// /// </summary> public const uint GL_VERTEX_PROGRAM_POINT_SIZE = 0x8642; ///// <summary> ///// ///// </summary> //public const uint GL_VERTEX_ATTRIB_ARRAY_POINTER = 0x8645; ///// <summary> ///// ///// </summary> //public const uint GL_STENCIL_BACK_FUNC = 0x8800; ///// <summary> ///// ///// </summary> //public const uint GL_STENCIL_BACK_FAIL = 0x8801; ///// <summary> ///// ///// </summary> //public const uint GL_STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802; ///// <summary> ///// ///// </summary> //public const uint GL_STENCIL_BACK_PASS_DEPTH_PASS = 0x8803; ///// <summary> ///// ///// </summary> //public const uint GL_MAX_DRAW_BUFFERS = 0x8824; ///// <summary> ///// ///// </summary> //public const uint GL_DRAW_BUFFER0 = 0x8825; ///// <summary> ///// ///// </summary> //public const uint GL_DRAW_BUFFER1 = 0x8826; ///// <summary> ///// ///// </summary> //public const uint GL_DRAW_BUFFER2 = 0x8827; ///// <summary> ///// ///// </summary> //public const uint GL_DRAW_BUFFER3 = 0x8828; ///// <summary> ///// ///// </summary> //public const uint GL_DRAW_BUFFER4 = 0x8829; ///// <summary> ///// ///// </summary> //public const uint GL_DRAW_BUFFER5 = 0x882A; ///// <summary> ///// ///// </summary> //public const uint GL_DRAW_BUFFER6 = 0x882B; ///// <summary> ///// ///// </summary> //public const uint GL_DRAW_BUFFER7 = 0x882C; ///// <summary> ///// ///// </summary> //public const uint GL_DRAW_BUFFER8 = 0x882D; ///// <summary> ///// ///// </summary> //public const uint GL_DRAW_BUFFER9 = 0x882E; ///// <summary> ///// ///// </summary> //public const uint GL_DRAW_BUFFER10 = 0x882F; ///// <summary> ///// ///// </summary> //public const uint GL_DRAW_BUFFER11 = 0x8830; ///// <summary> ///// ///// </summary> //public const uint GL_DRAW_BUFFER12 = 0x8831; ///// <summary> ///// ///// </summary> //public const uint GL_DRAW_BUFFER13 = 0x8832; ///// <summary> ///// ///// </summary> //public const uint GL_DRAW_BUFFER14 = 0x8833; ///// <summary> ///// ///// </summary> //public const uint GL_DRAW_BUFFER15 = 0x8834; ///// <summary> ///// ///// </summary> //public const uint GL_BLEND_EQUATION_ALPHA = 0x883D; ///// <summary> ///// ///// </summary> //public const uint GL_MAX_VERTEX_ATTRIBS = 0x8869; ///// <summary> ///// ///// </summary> //public const uint GL_VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A; ///// <summary> ///// ///// </summary> //public const uint GL_MAX_TEXTURE_IMAGE_UNITS = 0x8872; /// <summary> /// /// </summary> public const uint GL_FRAGMENT_SHADER = 0x8B30; /// <summary> /// /// </summary> public const uint GL_VERTEX_SHADER = 0x8B31; /// <summary> /// /// </summary> public const uint GL_TESS_CONTROL_SHADER = 0x8E88; /// <summary> /// /// </summary> public const uint GL_TESS_EVALUATION_SHADER = 0x8E87; /// <summary> /// /// </summary> public const uint GL_MAX_FRAGMENT_UNIFORM_COMPONENTS = 0x8B49; /// <summary> /// /// </summary> public const uint GL_MAX_VERTEX_UNIFORM_COMPONENTS = 0x8B4A; /// <summary> /// /// </summary> public const uint GL_MAX_VARYING_FLOATS = 0x8B4B; /// <summary> /// /// </summary> public const uint GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C; /// <summary> /// /// </summary> public const uint GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D; /// <summary> /// /// </summary> public const uint GL_SHADER_TYPE = 0x8B4F; /// <summary> /// /// </summary> public const uint GL_FLOAT_VEC2 = 0x8B50; /// <summary> /// /// </summary> public const uint GL_FLOAT_VEC3 = 0x8B51; /// <summary> /// /// </summary> public const uint GL_FLOAT_VEC4 = 0x8B52; /// <summary> /// /// </summary> public const uint GL_INT_VEC2 = 0x8B53; /// <summary> /// /// </summary> public const uint GL_INT_VEC3 = 0x8B54; /// <summary> /// /// </summary> public const uint GL_INT_VEC4 = 0x8B55; /// <summary> /// /// </summary> public const uint GL_BOOL = 0x8B56; /// <summary> /// /// </summary> public const uint GL_BOOL_VEC2 = 0x8B57; /// <summary> /// /// </summary> public const uint GL_BOOL_VEC3 = 0x8B58; /// <summary> /// /// </summary> public const uint GL_BOOL_VEC4 = 0x8B59; /// <summary> /// /// </summary> public const uint GL_FLOAT_MAT2 = 0x8B5A; /// <summary> /// /// </summary> public const uint GL_FLOAT_MAT3 = 0x8B5B; /// <summary> /// /// </summary> public const uint GL_FLOAT_MAT4 = 0x8B5C; /// <summary> /// /// </summary> public const uint GL_SAMPLER_1D = 0x8B5D; /// <summary> /// /// </summary> public const uint GL_SAMPLER_2D = 0x8B5E; /// <summary> /// /// </summary> public const uint GL_SAMPLER_3D = 0x8B5F; /// <summary> /// /// </summary> public const uint GL_SAMPLER_CUBE = 0x8B60; /// <summary> /// /// </summary> public const uint GL_SAMPLER_1D_SHADOW = 0x8B61; /// <summary> /// /// </summary> public const uint GL_SAMPLER_2D_SHADOW = 0x8B62; /// <summary> /// /// </summary> public const uint GL_DELETE_STATUS = 0x8B80; /// <summary> /// /// </summary> public const uint GL_COMPILE_STATUS = 0x8B81; /// <summary> /// /// </summary> public const uint GL_LINK_STATUS = 0x8B82; /// <summary> /// /// </summary> public const uint GL_VALIDATE_STATUS = 0x8B83; /// <summary> /// /// </summary> public const uint GL_INFO_LOG_LENGTH = 0x8B84; /// <summary> /// /// </summary> public const uint GL_ATTACHED_SHADERS = 0x8B85; /// <summary> /// /// </summary> public const uint GL_ACTIVE_UNIFORMS = 0x8B86; /// <summary> /// /// </summary> public const uint GL_ACTIVE_UNIFORM_MAX_LENGTH = 0x8B87; /// <summary> /// /// </summary> public const uint GL_SHADER_SOURCE_LENGTH = 0x8B88; /// <summary> /// /// </summary> public const uint GL_ACTIVE_ATTRIBUTES = 0x8B89; /// <summary> /// /// </summary> public const uint GL_ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A; /// <summary> /// /// </summary> public const uint GL_FRAGMENT_SHADER_DERIVATIVE_HINT = 0x8B8B; /// <summary> /// /// </summary> public const uint GL_SHADING_LANGUAGE_VERSION = 0x8B8C; /// <summary> /// /// </summary> public const uint GL_CURRENT_PROGRAM = 0x8B8D; /// <summary> /// /// </summary> public const uint GL_POINT_SPRITE_COORD_ORIGIN = 0x8CA0; /// <summary> /// /// </summary> public const uint GL_LOWER_LEFT = 0x8CA1; /// <summary> /// /// </summary> public const uint GL_UPPER_LEFT = 0x8CA2; /// <summary> /// /// </summary> public const uint GL_STENCIL_BACK_REF = 0x8CA3; /// <summary> /// /// </summary> public const uint GL_STENCIL_BACK_VALUE_MASK = 0x8CA4; /// <summary> /// /// </summary> public const uint GL_STENCIL_BACK_WRITEMASK = 0x8CA5; #endregion OpenGL 2.0 } }
bitzhuwei/CSharpGL
CSharpGL/GLAPI/GL.Constants/GL.2.0.Consts.cs
C#
mit
9,798
package ch.hesso.master.caldynam; import android.app.Fragment; import android.app.FragmentManager; import android.app.FragmentTransaction; import android.graphics.Outline; import android.os.Bundle; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.ActionBarActivity; import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.view.ViewOutlineProvider; import android.view.animation.Animation; import android.view.animation.Transformation; import android.widget.Toast; import ch.hesso.master.caldynam.ui.fragment.FoodAddFragment; import ch.hesso.master.caldynam.ui.fragment.FoodCatalogFragment; import ch.hesso.master.caldynam.ui.fragment.FoodViewFragment; import ch.hesso.master.caldynam.ui.fragment.LoggingFragment; import ch.hesso.master.caldynam.ui.fragment.NavigationDrawerFragment; import ch.hesso.master.caldynam.ui.fragment.SummaryFragment; import ch.hesso.master.caldynam.ui.fragment.WeightMeasurementFragment; import me.drakeet.materialdialog.MaterialDialog; public class MainActivity extends ActionBarActivity implements NavigationDrawerFragment.NavigationDrawerCallbacks, SummaryFragment.OnFragmentInteractionListener, WeightMeasurementFragment.OnFragmentInteractionListener, LoggingFragment.OnFragmentInteractionListener, FoodCatalogFragment.OnFragmentInteractionListener, FoodAddFragment.OnFragmentInteractionListener, FoodViewFragment.OnFragmentInteractionListener { private Fragment fragment = null; /** * Fragment managing the behaviors, interactions and presentation of the navigation drawer. */ private NavigationDrawerFragment mNavigationDrawerFragment; /** * Used to store the last screen title. For use in {@link #updateToolbar()}. */ private CharSequence mTitle; private Toolbar mToolbar; private View mFabButton; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // Handle Toolbar mToolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(mToolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setHomeButtonEnabled(true); // Handle different Drawer States :D // mDrawerLayout.setDrawerListener(mActionBarDrawerToggle); // Fab Button mFabButton = findViewById(R.id.fab_button); mFabButton.setOnClickListener(fabClickListener); mFabButton.setOutlineProvider(new ViewOutlineProvider() { @Override public void getOutline(View view, Outline outline) { int size = getResources().getDimensionPixelSize(R.dimen.fab_size); outline.setOval(0, 0, size, size); } }); mNavigationDrawerFragment = (NavigationDrawerFragment) getFragmentManager().findFragmentById(R.id.navigation_drawer); mNavigationDrawerFragment.setUp( R.id.navigation_drawer, (DrawerLayout) findViewById(R.id.drawer_layout) ); updateToolbar(); mTitle = getTitle(); } @Override public void onNavigationDrawerItemSelected(int position) { switch (position) { case 0: fragment = SummaryFragment.newInstance(); break; case 1: fragment = WeightMeasurementFragment.newInstance(); break; case 2: fragment = LoggingFragment.newInstance(); break; case 3: fragment = FoodCatalogFragment.newInstance(); break; } getFragmentManager().popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE); loadFragment(fragment, false); } View.OnClickListener fabClickListener = new View.OnClickListener() { @Override public void onClick(View view) { Toast.makeText(MainActivity.this, "New data", Toast.LENGTH_SHORT).show(); } }; public void onSectionAttached(int resourceId) { mTitle = (resourceId != 0) ? getString(resourceId) : null; } public void updateToolbar() { if (mTitle != null) { mToolbar.setTitle(mTitle); } resizeToolbar(mNavigationDrawerFragment.isToolbarLarge() ? 1.0f : 0.0f); mFabButton.setAlpha(mNavigationDrawerFragment.isFABVisible() ? 1.0f : 0.0f); } @Override public boolean onCreateOptionsMenu(Menu menu) { if (!mNavigationDrawerFragment.isDrawerOpen()) { // Only show items in the action bar relevant to this screen // if the drawer is not showing. Otherwise, let the drawer // decide what to show in the action bar. if (fragment != null) { fragment.onCreateOptionsMenu(menu, getMenuInflater()); } //getMenuInflater().inflate(R.menu.main, menu); updateToolbar(); return true; } return super.onCreateOptionsMenu(menu); } /** * Handle action bar item clicks here. The action bar will * automatically handle clicks on the Home/Up button, so long * as you specify a parent activity in AndroidManifest.xml. * * @param item * @return */ @Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); fragment.onOptionsItemSelected(item); if (id == R.id.action_about) { showAboutDialog(); return true; } return super.onOptionsItemSelected(item); } @Override public void onBackPressed(){ FragmentManager fm = getFragmentManager(); if (fm.getBackStackEntryCount() > 0) { Log.d(Constants.PROJECT_NAME, "Popping backstack"); fm.popBackStackImmediate(); this.fragment = getActiveFragment(); } else { Log.d(Constants.PROJECT_NAME, "Nothing on backstack, calling super"); super.onBackPressed(); } } private void showAboutDialog() { View contentView = LayoutInflater.from(this) .inflate(R.layout.fragment_about_dialog, null); final MaterialDialog aboutDialog = new MaterialDialog(this); aboutDialog .setContentView(contentView) .setPositiveButton(getString(R.string.ok), new View.OnClickListener() { @Override public void onClick(View v) { aboutDialog.dismiss(); } }); aboutDialog.show(); } public Fragment getActiveFragment() { if (getFragmentManager().getBackStackEntryCount() == 0) { return null; } String tag = getFragmentManager() .getBackStackEntryAt(getFragmentManager().getBackStackEntryCount() - 1) .getName(); return getFragmentManager().findFragmentByTag(tag); } public void loadFragment(Fragment fragment) { loadFragment(fragment, true); } public void loadFragment(Fragment fragment, boolean addToBackStack) { this.fragment = fragment; String tag = fragment.getClass().getSimpleName(); final FragmentTransaction ft = getFragmentManager().beginTransaction(); ft.replace(R.id.container, this.fragment, tag); if (addToBackStack) { Log.d("Fragment", tag); ft.addToBackStack(tag); } ft.commit(); // Replace current menu with the fragment menu this.invalidateOptionsMenu(); } public void resizeToolbar(float offset) { float minSize = mToolbar.getMinimumHeight(); float maxSize = getResources().getDimension(R.dimen.toolbar_height_large); ViewGroup.LayoutParams layout = mToolbar.getLayoutParams(); layout.height = (int) (minSize + (maxSize - minSize) * offset); mToolbar.requestLayout(); } public View getAddButton() { return mFabButton; } /** * an animation for resizing the view. */ private class ResizeAnimation extends Animation { private View mView; private float mToHeight; private float mFromHeight; private float mToWidth; private float mFromWidth; public ResizeAnimation(View v, float fromWidth, float fromHeight, float toWidth, float toHeight) { mToHeight = toHeight; mToWidth = toWidth; mFromHeight = fromHeight; mFromWidth = fromWidth; mView = v; setDuration(300); } @Override protected void applyTransformation(float interpolatedTime, Transformation t) { float height = (mToHeight - mFromHeight) * interpolatedTime + mFromHeight; float width = (mToWidth - mFromWidth) * interpolatedTime + mFromWidth; ViewGroup.LayoutParams p = mView.getLayoutParams(); p.height = (int) height; p.width = (int) width; mView.requestLayout(); } } }
Chavjoh/CalDynam
app/src/main/java/ch/hesso/master/caldynam/MainActivity.java
Java
mit
9,388
default: @echo "'make check'" for tests @echo "'make check-cov'" for tests with coverage @echo "'make lint'" for source code checks @echo "'make ckpatch'" to check a patch @echo "'make clean'" to clean generated files @echo "'make man'" to generate sphinx documentation @echo "'make update-requirements'" to update the requirements files .PHONY: check check: pytest --verbose .PHONY: check-cov check-cov: pytest --verbose --with-cov libqtile --cov-report term-missing .PHONY: lint lint: flake8 ./libqtile bin/q* ./test .PHONY: ckpatch ckpatch: lint check .PHONY: clean clean: -rm -rf dist qtile.egg-info docs/_build build/ # This is a little ugly: we want to be able to have users just run # 'python setup.py install' to install qtile, but we would also like to install # the man pages. I can't figure out a way to have the 'build' target invoke the # 'build_sphinx' target as well, so we commit the man pages, since they are # used in the 'install' target. .PHONY: man man: python setup.py build_sphinx -b man cp build/sphinx/man/* resources/ .PHONY: update-requirements update-requirements: pip-compile requirements.in
cortesi/qtile
Makefile
Makefile
mit
1,142
# encoding: utf-8 class DocsController < ApplicationController get '/doc' do before_all haml :docs, :layout => :'layouts/main' end end
yedit/yedit
app/controllers/docs_controller.rb
Ruby
mit
152
// // SR_ForgotPasswordViewController.h // scanreader // // Created by jbmac01 on 16/7/21. // Copyright © 2016年 jb. All rights reserved. // #import <UIKit/UIKit.h> @interface SR_ForgotPasswordViewController : UIViewController @end
zhaiyjgithub/scanreader
scanreader/Application/SR_ForgotPassword/SR_ForgotPasswordViewController.h
C
mit
241
#include <iostream> #include <string> #include <tuple> std::tuple<int,int> wczytaj_liczby(); int main () { std::string opcja; do { int a,b; std::cout << "wybierz opcje przeliczania" << std::endl; std::cout << "dodawanie, odejmowanie, mnozenie czy dzielenie?" << std::endl; std::cin >> opcja; if (opcja=="dodawanie"){ std::tie(a,b)=wczytaj_liczby(); std::cout << "wynik dodawania " << a+b << std::endl; } else if (opcja=="odejmowanie"){ std::tie(a,b)=wczytaj_liczby(); std::cout << "wynik odejmowania " << a-b << std::endl; } else if (opcja=="mnozenie"){ std::tie(a,b)=wczytaj_liczby(); std::cout << "wynik mnozenia " << a*b << std::endl; } else if (opcja=="dzielenie"){ std::tie(a,b)=wczytaj_liczby(); std::cout << "wynik dzielenia " << a/b << std::endl; } else std::cout << "nieznana opcja" << std::endl; } while(opcja!="koniec"); } std::tuple<int,int> wczytaj_liczby() { int a,b; std::cout << "podaj pierwsza liczbe" << std::endl; std::cin >> a; std::cout << "podaj druga liczbe" << std::endl; std::cin >> b; return std::make_tuple(a,b); }
mateka/cpp-school
calc1/Ekhem.cpp
C++
mit
1,120
// Code generated by protoc-gen-go. DO NOT EDIT. // source: google/ads/googleads/v2/resources/expanded_landing_page_view.proto package resources import ( fmt "fmt" math "math" proto "github.com/golang/protobuf/proto" wrappers "github.com/golang/protobuf/ptypes/wrappers" _ "google.golang.org/genproto/googleapis/api/annotations" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package // A landing page view with metrics aggregated at the expanded final URL // level. type ExpandedLandingPageView struct { // The resource name of the expanded landing page view. // Expanded landing page view resource names have the form: // // `customers/{customer_id}/expandedLandingPageViews/{expanded_final_url_fingerprint}` ResourceName string `protobuf:"bytes,1,opt,name=resource_name,json=resourceName,proto3" json:"resource_name,omitempty"` // The final URL that clicks are directed to. ExpandedFinalUrl *wrappers.StringValue `protobuf:"bytes,2,opt,name=expanded_final_url,json=expandedFinalUrl,proto3" json:"expanded_final_url,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ExpandedLandingPageView) Reset() { *m = ExpandedLandingPageView{} } func (m *ExpandedLandingPageView) String() string { return proto.CompactTextString(m) } func (*ExpandedLandingPageView) ProtoMessage() {} func (*ExpandedLandingPageView) Descriptor() ([]byte, []int) { return fileDescriptor_f0d9f18d76cfc25b, []int{0} } func (m *ExpandedLandingPageView) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ExpandedLandingPageView.Unmarshal(m, b) } func (m *ExpandedLandingPageView) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_ExpandedLandingPageView.Marshal(b, m, deterministic) } func (m *ExpandedLandingPageView) XXX_Merge(src proto.Message) { xxx_messageInfo_ExpandedLandingPageView.Merge(m, src) } func (m *ExpandedLandingPageView) XXX_Size() int { return xxx_messageInfo_ExpandedLandingPageView.Size(m) } func (m *ExpandedLandingPageView) XXX_DiscardUnknown() { xxx_messageInfo_ExpandedLandingPageView.DiscardUnknown(m) } var xxx_messageInfo_ExpandedLandingPageView proto.InternalMessageInfo func (m *ExpandedLandingPageView) GetResourceName() string { if m != nil { return m.ResourceName } return "" } func (m *ExpandedLandingPageView) GetExpandedFinalUrl() *wrappers.StringValue { if m != nil { return m.ExpandedFinalUrl } return nil } func init() { proto.RegisterType((*ExpandedLandingPageView)(nil), "google.ads.googleads.v2.resources.ExpandedLandingPageView") } func init() { proto.RegisterFile("google/ads/googleads/v2/resources/expanded_landing_page_view.proto", fileDescriptor_f0d9f18d76cfc25b) } var fileDescriptor_f0d9f18d76cfc25b = []byte{ // 342 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x91, 0xc1, 0x4a, 0xf3, 0x40, 0x14, 0x85, 0x49, 0x7e, 0xf8, 0xc1, 0xa8, 0x20, 0xd9, 0x58, 0x4a, 0x91, 0x56, 0x29, 0x74, 0x35, 0x81, 0xb8, 0x1b, 0x57, 0x29, 0x68, 0xa1, 0x88, 0x94, 0x8a, 0x59, 0x48, 0x20, 0xdc, 0x76, 0x6e, 0x87, 0x81, 0x74, 0x26, 0xcc, 0x24, 0xad, 0xaf, 0xa0, 0x8f, 0xe1, 0xd2, 0x47, 0xf1, 0x51, 0x7c, 0x0a, 0x49, 0x93, 0x99, 0x9d, 0xba, 0x3b, 0xcc, 0x9c, 0x73, 0xee, 0x77, 0xb9, 0xc1, 0x94, 0x2b, 0xc5, 0x0b, 0x8c, 0x80, 0x99, 0xa8, 0x95, 0x8d, 0xda, 0xc5, 0x91, 0x46, 0xa3, 0x6a, 0xbd, 0x46, 0x13, 0xe1, 0x4b, 0x09, 0x92, 0x21, 0xcb, 0x0b, 0x90, 0x4c, 0x48, 0x9e, 0x97, 0xc0, 0x31, 0xdf, 0x09, 0xdc, 0x93, 0x52, 0xab, 0x4a, 0x85, 0xa3, 0x36, 0x48, 0x80, 0x19, 0xe2, 0x3a, 0xc8, 0x2e, 0x26, 0xae, 0xa3, 0x7f, 0xd1, 0x8d, 0x39, 0x04, 0x56, 0xf5, 0x26, 0xda, 0x6b, 0x28, 0x4b, 0xd4, 0xa6, 0xad, 0xe8, 0x0f, 0x2c, 0x46, 0x29, 0x22, 0x90, 0x52, 0x55, 0x50, 0x09, 0x25, 0xbb, 0xdf, 0xcb, 0x37, 0x2f, 0x38, 0xbf, 0xed, 0x28, 0xee, 0x5b, 0x88, 0x05, 0x70, 0x4c, 0x05, 0xee, 0xc3, 0xab, 0xe0, 0xd4, 0x8e, 0xc9, 0x25, 0x6c, 0xb1, 0xe7, 0x0d, 0xbd, 0xc9, 0xd1, 0xf2, 0xc4, 0x3e, 0x3e, 0xc0, 0x16, 0xc3, 0x79, 0x10, 0xba, 0x2d, 0x36, 0x42, 0x42, 0x91, 0xd7, 0xba, 0xe8, 0xf9, 0x43, 0x6f, 0x72, 0x1c, 0x0f, 0x3a, 0x66, 0x62, 0xd9, 0xc8, 0x63, 0xa5, 0x85, 0xe4, 0x29, 0x14, 0x35, 0x2e, 0xcf, 0x6c, 0xee, 0xae, 0x89, 0x3d, 0xe9, 0x62, 0xfa, 0xea, 0x07, 0xe3, 0xb5, 0xda, 0x92, 0x3f, 0x97, 0x9e, 0x0e, 0x7e, 0x60, 0x5e, 0x34, 0x83, 0x16, 0xde, 0xf3, 0xbc, 0xab, 0xe0, 0xaa, 0x00, 0xc9, 0x89, 0xd2, 0x3c, 0xe2, 0x28, 0x0f, 0x18, 0xf6, 0x16, 0xa5, 0x30, 0xbf, 0x9c, 0xe6, 0xc6, 0xa9, 0x77, 0xff, 0xdf, 0x2c, 0x49, 0x3e, 0xfc, 0xd1, 0xac, 0xad, 0x4c, 0x98, 0x21, 0xad, 0x6c, 0x54, 0x1a, 0x93, 0xa5, 0x75, 0x7e, 0x5a, 0x4f, 0x96, 0x30, 0x93, 0x39, 0x4f, 0x96, 0xc6, 0x99, 0xf3, 0x7c, 0xf9, 0xe3, 0xf6, 0x83, 0xd2, 0x84, 0x19, 0x4a, 0x9d, 0x8b, 0xd2, 0x34, 0xa6, 0xd4, 0xf9, 0x56, 0xff, 0x0f, 0xb0, 0xd7, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x09, 0x2a, 0xe3, 0x32, 0x46, 0x02, 0x00, 0x00, }
pushbullet/engineer
vendor/google.golang.org/genproto/googleapis/ads/googleads/v2/resources/expanded_landing_page_view.pb.go
GO
mit
5,383
var log = require('./logger')('reporter', 'yellow'); var colors = require('colors'); /* eslint no-console: 0 */ module.exports = function(diff) { var keys = Object.keys(diff); var count = 0; var timer = log.timer('reporting'); if (keys.length === 0) { log('✔ no diff detected', 'green'); } else { log('✗ build doesn\'t match!', 'red'); console.log('\nREPORT\n' + colors.white.bgBlack(' [selector] ') + '\n [attribute] ' + '[actual] '.red + '[expected]'.green); keys.forEach(function(key) { var rules = Object.keys(diff[key]); console.log(colors.white.bgBlack('\n ' + key + ' ')); rules.forEach(function(rule) { count++; var expected = pretty(diff[key][rule].expected); var actual = pretty(diff[key][rule].actual); console.log(' ' + rule + ': ' + actual.red + ' ' + expected.green); }); }); } console.log(''); var c = count === 0 ? 'green' : 'red'; log('Broken rules: ' + count, c); log('Affected selectors: ' + keys.length, c); timer(); }; function pretty(val) { if (typeof val !== 'string') { val = JSON.stringify(val, null, 4); } return val; }
zeachco/css-specs
lib/reporter.js
JavaScript
mit
1,160
<html> <head> <title>%%%name%%% - Wright! Magazine</title> %%%=templates/headers.html%%% <link rel="stylesheet" href="%%%urlroot%%%fonts/stylesheet.css" type="text/css" charset="utf-8" /> <script type="text/javascript" src="%%%urlroot%%%js/wright.js?a=1"></script> </head> <body onload="onload()"> %%%=templates/headerbar.html%%% <div id="banner"> <div class="image" style="background-image:url('%%%urltapes%%%%%%issueid%%%/screenshots/%%%screenshots.1%%%')"></div> <div class="filter"></div> <div class="text"> <h1><a href="#settings">%%%name%%% %%%edition%%%</a></h1> <p>%%%genre%%%, &copy; %%%author%%% %%%year%%%</p> </div> </div> <div id="game"></div> <div id="body"> <p> <img src="%%%urltapes%%%%%%issueid%%%/screenshots/%%%screenshots.0%%%" class="articleimage"> %%%description%%% </p> <p class="small"> (Want to share something? You can find me <a href="https://twitter.com/KesieV">on Twitter</a>!) </p> <p class="links"> <a href="https://www.kesiev.com%%%urlroot%%%webapp/%%%issueid%%%/index.html"><img src="%%%urlroot%%%publishers/site/images/tape.png">Install / Add to home</a> <a href="https://github.com/kesiev/Wright/tree/master/tapes/%%%issueid%%%"><img src="%%%urlroot%%%publishers/site/images/github.png">View game sources</a> <span>...or play it online below!</span> </p> </div> <div id="settingscontainer"> <div id="settings"></div> </div> %%%=templates/footerbar.html%%% </body> <script> function onload() { runSingleWright('%%%issueid%%%', { controllerDefaults:{ PeerJSApiKey:'tlaw8l8f0kiysyvi', ChromecastApplicationID:'60B7E7EC', ChromecastNamespace:'urn:x-cast:com.kesiev.wright' }, tapesRoot:'%%%urltapes%%%', systemRoot:'%%%urlroot%%%system', gameContainer:document.getElementById('game'),settingsContainer:document.getElementById('settings'), onRun:function(){document.getElementById('body').innerHTML='';} } ); } </script> </html>
kesiev/Wright
publishers/site/templates/issue.html
HTML
mit
2,009
/** * The MIT License * Copyright (c) 2003 David G Jones * * 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. */ package info.dgjones.abora.white.edgeregion; import java.io.PrintWriter; import info.dgjones.abora.white.rcvr.Rcvr; import info.dgjones.abora.white.rcvr.Xmtr; import info.dgjones.abora.white.spaces.basic.Position; import info.dgjones.abora.white.xpp.basic.Heaper; /** * Clients of EdgeManager define concrete subclasses of this, which are then used by the * EdgeManager code */ public abstract class TransitionEdge extends Heaper { /* udanax-top.st:63348: Heaper subclass: #TransitionEdge instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Xanadu-EdgeRegion'! */ /* udanax-top.st:63352: TransitionEdge comment: 'Clients of EdgeManager define concrete subclasses of this, which are then used by the EdgeManager code'! */ /* udanax-top.st:63354: (TransitionEdge getOrMakeCxxClassDescription) attributes: ((Set new) add: #DEFERRED; add: #COPY; yourself)! */ ///////////////////////////////////////////// // Constructors protected TransitionEdge() { super(); } public TransitionEdge ceiling(TransitionEdge other) { if (other.isGE(this)) { return other; } else { return this; } /* udanax-top.st:63359:TransitionEdge methodsFor: 'accessing'! {TransitionEdge} ceiling: other {TransitionEdge} (other isGE: self) ifTrue: [^other] ifFalse: [^self]! */ } public TransitionEdge floor(TransitionEdge other) { if (isGE(other)) { return other; } else { return this; } /* udanax-top.st:63365:TransitionEdge methodsFor: 'accessing'! {TransitionEdge} floor: other {TransitionEdge} (self isGE: other) ifTrue: [^other] ifFalse: [^self]! */ } public int actualHashForEqual() { return System.identityHashCode(this); // return Heaper.takeOop(); /* udanax-top.st:63373:TransitionEdge methodsFor: 'testing'! {UInt32} actualHashForEqual ^Heaper takeOop! */ } /** * Whether the position is strictly less than this edge */ public abstract boolean follows(Position pos); /* udanax-top.st:63377:TransitionEdge methodsFor: 'testing'! {BooleanVar} follows: pos {Position} "Whether the position is strictly less than this edge" self subclassResponsibility! */ public abstract boolean isEqual(Heaper other); /* udanax-top.st:63382:TransitionEdge methodsFor: 'testing'! {BooleanVar} isEqual: other {Heaper} self subclassResponsibility! */ /** * Whether there is precisely one position between this edge and the next one */ public abstract boolean isFollowedBy(TransitionEdge next); /* udanax-top.st:63386:TransitionEdge methodsFor: 'testing'! {BooleanVar} isFollowedBy: next {TransitionEdge} "Whether there is precisely one position between this edge and the next one" self subclassResponsibility! */ /** * Defines a full ordering among all edges in a given CoordinateSpace */ public abstract boolean isGE(TransitionEdge other); /* udanax-top.st:63391:TransitionEdge methodsFor: 'testing'! {BooleanVar} isGE: other {TransitionEdge} "Defines a full ordering among all edges in a given CoordinateSpace" self subclassResponsibility! */ /** * Whether this edge touches the same position the other does */ public abstract boolean touches(TransitionEdge other); /* udanax-top.st:63396:TransitionEdge methodsFor: 'testing'! {BooleanVar} touches: other {TransitionEdge} "Whether this edge touches the same position the other does" self subclassResponsibility! */ /** * Print a description of this transition */ public abstract void printTransitionOn(PrintWriter oo, boolean entering, boolean touchesPrevious); /* udanax-top.st:63403:TransitionEdge methodsFor: 'printing'! {void} printTransitionOn: oo {ostream reference} with: entering {BooleanVar} with: touchesPrevious {BooleanVar} "Print a description of this transition" self subclassResponsibility! */ public TransitionEdge(Rcvr receiver) { super(receiver); /* udanax-top.st:63412:TransitionEdge methodsFor: 'generated:'! create.Rcvr: receiver {Rcvr} super create.Rcvr: receiver.! */ } public void sendSelfTo(Xmtr xmtr) { super.sendSelfTo(xmtr); /* udanax-top.st:63415:TransitionEdge methodsFor: 'generated:'! {void} sendSelfTo: xmtr {Xmtr} super sendSelfTo: xmtr.! */ } }
jonesd/abora-white
src/main/java/info/dgjones/abora/white/edgeregion/TransitionEdge.java
Java
mit
5,464
<?php namespace App\Repository; /** * ImageRepository * * This class was generated by the Doctrine ORM. Add your own custom * repository methods below. */ class ImageRepository extends \Doctrine\ORM\EntityRepository { }
Aluok/Recipes
Symfony/src/Repository/ImageRepository.php
PHP
mit
227
'use strict'; const moment = require('moment-timezone'); const mongoose = web.require('mongoose'); const Schema = mongoose.Schema, ObjectId = Schema.ObjectId; const OTHERS = {key: 'OTH', value: 'Others'}; module.exports = function({ modelName, displayName, cols, colMap = {}, enableDangerousClientFiltering = false, style, addPermission, editPermission, populate, // do you validations, extra save logic here // throw an error or handle it yourself by returning true beforeSave = (record, req, res)=>{}, beforeRender, afterSave, parentTemplate, shouldShowDeleteAction = true, shouldShowSaveButton = true, additionalSubmitButtons = [], handlers = {}, } = {}) { return { get: async function(req, res) { let queryModel = enableDangerousClientFiltering && req.query.model; let modelStr = modelName || queryModel; let recId = req.query._id; let isUpdateMode = recId; let isInsertMode = !isUpdateMode; let querySaveView = req.query.saveView; let queryDisplayName = displayName || req.query.displayName; let colIds = []; for (let col of cols || []) { if (web.objectUtils.isString(col)) { colIds.push(col); } else { colIds.push(col.id); colMap[col.id] = Object.assign({}, col, colMap[col.id]); } } let model = web.cms.dbedit.utils.searchModel(modelStr); // deep clone let modelAttr = model.getModelDictionary(); let modelSchema = modelAttr.schema; let filterCols = (colIds.length > 0 ? colIds : null) || (enableDangerousClientFiltering && req.query.filterCols && req.query.filterCols.split(',')) || Object.keys(modelSchema); for (let colId of filterCols) { if (!colMap[colId]) { colMap[colId] = {}; } } const readOnly = (enableDangerousClientFiltering && req.query.readOnly && req.query.readOnly.split(',')); let myShouldShowDeleteAction = shouldShowDeleteAction; if (enableDangerousClientFiltering && req.query.shouldShowDeleteAction) { myShouldShowDeleteAction = req.query.shouldShowDeleteAction === "Y"; } let myModelName = modelAttr.name; let modelDisplayName = queryDisplayName || modelAttr.displayName || modelAttr.name; parentTemplate = parentTemplate || web.cms.conf.adminTemplate; let redirectAfter = req.query._backUrl || ('/admin/dbedit/list' + (queryModel ? ('?model=' + encodeURIComponent(queryModel)) : '')); //can be optimized by avoiding query if there's no id let rec = {}; if (isUpdateMode) { let recProm = model.findOne({_id:recId}); if (populate) { recProm.populate(populate); } rec = await recProm.exec(); if (!rec) { req.flash('error', 'Record not found.'); res.redirect(redirectAfter); return; } } if (req.session.recCache && req.session.recCache[req.url]) { rec = req.session.recCache[req.url]; req.session.recCache[req.url] = null; } let pageTitle = null; if (isUpdateMode) { pageTitle = 'Update ' + modelDisplayName; } else { pageTitle = 'Create ' + modelDisplayName; } for (let colName in colMap) { let colMapObj = colMap[colName]; if (colMapObj.default && rec[colName] === undefined) { rec[colName] = colMapObj.default; } if (colMapObj.colSpan) { colMapObj.colSpanStr = '-' + colMapObj.colSpan.toString(); } if (colMapObj.inline) { colMapObj.inlineStr = " form-check-inline mr-2"; } if (colMapObj.hideLabel === true) { colMapObj._hideLabel = colMapObj.hideLabel; } else { colMapObj._hideLabel = false; } if (colMapObj.addOthers) { colMapObj._addOthers = Object.assign({ value: getVal(rec, colMapObj.addOthers.id), placeholder: 'If Others, please specify' }, colMapObj.addOthers); } if (colMapObj._addOthers) { colMapObj.inputValues.set(OTHERS.key, OTHERS.value) } handleModelSchemaForColObj(modelSchema, colName, colMap, rec) if (handlers[colName]) { colMapObj.htmlValue = await handlers[colName](rec, isUpdateMode, req); } handleColObjMultiple(colMapObj, colName, rec); if (colMapObj.inputValues && web.objectUtils.isFunction(colMapObj.inputValues)) { // need to do this to avoid the cache and overwriting the existing colMapObj.inputValuesFunc = colMapObj.inputValues; } if (colMapObj.inputValuesFunc) { colMapObj.inputValues = await colMapObj.inputValuesFunc(rec, req, isInsertMode); } colMapObj.readOnlyComputed = (readOnly && readOnly.indexOf(colName) !== -1) || (colMapObj.readOnly === 'U' && isUpdateMode) || (colMapObj.readOnly === 'I' && isInsertMode) || (web.objectUtils.isFunction(colMapObj.readOnly) && await colMapObj.readOnly(rec, req, isInsertMode)) || colMapObj.readOnly === true; colMapObj.visibleComputed = true; if (colMapObj.visible !== undefined) { colMapObj.visibleComputed = await colMapObj.visible(rec, req, isInsertMode); } if (colMapObj.header) { colMapObj.headerComputed = (web.objectUtils.isFunction(colMapObj.header) && await colMapObj.header(rec, req, isInsertMode)) || colMapObj.header; } let propsStrArr = []; colMapObj.props = colMapObj.props || {}; let inputType = colMapObj.inputType || colMapObj.props.type || 'text'; if (inputType === 'money') { inputType = 'number'; colMapObj.props.step = '0.01'; } switch (inputType) { case 'datetime': case 'date': case 'radio': case 'checkbox': case 'select': break; default: colMapObj.props.type = inputType; } for (let propName in colMapObj.props) { let propsValStr = colMapObj.props[propName] || ''; propsStrArr.push(`${propName}="${web.stringUtils.escapeHTML(propsValStr)}"`) } // TODO: unify all props later colMapObj._propsHtml = propsStrArr.join(' '); } let myShowSaveButton = true; if (isUpdateMode && shouldShowSaveButton !== undefined) { myShowSaveButton = (web.objectUtils.isFunction(shouldShowSaveButton) && await shouldShowSaveButton(rec, req, isInsertMode)) || shouldShowSaveButton === true; } for (let submitBtnObj of additionalSubmitButtons) { submitBtnObj.visibleComputed = true; if (submitBtnObj.visible) { submitBtnObj.visibleComputed = await submitBtnObj.visible(rec, req, isInsertMode); } } let fileBackUrl = encodeURIComponent(req.url); let options = { rec: rec, style: style, isUpdateMode: isUpdateMode, modelAttr: modelAttr, queryModelName: queryModel, pageTitle: pageTitle, redirectAfter: redirectAfter, fileBackUrl: fileBackUrl, colMap: colMap, parentTemplate: parentTemplate, filterCols: filterCols, shouldShowDeleteAction: myShouldShowDeleteAction, shouldShowSaveButton: myShowSaveButton, additionalSubmitButtons: additionalSubmitButtons, }; if (beforeRender) { await beforeRender(req, res, options); } let saveView = (enableDangerousClientFiltering && querySaveView) || web.cms.dbedit.conf.saveView; res.render(saveView, options); }, post: async function(req, res) { // TODO: proper error handling let queryModelName = enableDangerousClientFiltering && req.body.modelName; let myModelName = modelName || queryModelName || ''; let recId = req.body._id; if (recId == "") { recId = null; } let isInsertMode = !recId; if (isInsertMode) { if (addPermission && !req.user.hasPermission(addPermission)) { throw new Error("You don't have a permission to add this record."); } } else { if (editPermission && !req.user.hasPermission(editPermission)) { throw new Error("You don't have a permission to edit this record."); } } let model = web.models(myModelName); let rec = await save(recId, req, res, model, beforeSave, colMap, isInsertMode, queryModelName); if (!rec) { return; } if (afterSave && await afterSave(rec, req, res, isInsertMode)) { return; } let handled = false; for (let submitBtnObj of additionalSubmitButtons) { if (req.body.hasOwnProperty(submitBtnObj.actionName)) { handled = await submitBtnObj.handler(rec, req, res); } } if (!handled) { req.flash('info', 'Record saved.'); res.redirect(getRedirectAfter(rec, req, queryModelName)); } } } } async function save(recId, req, res, model, beforeSave, colMap, isInsertMode, queryModelName) { let rec = await model.findOne({_id:recId}); let modelAttr = model.getModelDictionary(); let modelSchema = modelAttr.schema; // TODO: use the col list to set one by one let attrToSet = Object.assign({}, req.body); const shouldSetProperTimezone = web.conf.timezone; for (let colName in modelAttr.schema) { if (attrToSet[colName] || attrToSet[colName] === "") { if (web.objectUtils.isArray(modelSchema[colName])) { attrToSet[colName] = web.ext.arrayUtils.removeDuplicateAndEmpty(attrToSet[colName]); } let dbCol = modelAttr.schema[colName]; if (shouldSetProperTimezone && dbCol.type == Date) { if (attrToSet[colName]) { let date = attrToSet[colName]; let dateFormat = 'MM/DD/YYYY'; if (colMap[colName] && colMap[colName].inputType === "datetime") { dateFormat = 'MM/DD/YYYY hh:mm A'; } if (!web.ext.dateTimeUtils.momentFromString(date, dateFormat).isValid()) { req.flash('error', `${colMap[colName].label} is an invalid date.`); res.redirect(req.url); return; } attrToSet[colName] = moment.tz(attrToSet[colName], dateFormat, web.conf.timezone).toDate(); } else if (attrToSet[colName] === "") { attrToSet[colName] = null; } } else if (dbCol.type == ObjectId) { if (attrToSet[colName] === "") { // for errors of casting empty string to object id attrToSet[colName] = null; } } } } if (!rec) { rec = new model(); attrToSet.createDt = new Date(); attrToSet.createBy = req.user._id; } delete attrToSet._id; attrToSet[web.cms.dbedit.conf.updateDtCol] = new Date(); attrToSet[web.cms.dbedit.conf.updateByCol] = req.user._id; rec.set(attrToSet); try { if (await beforeSave(rec, req, res, isInsertMode)) { return null; } } catch (ex) { console.error("beforeSave threw an error", ex); let errStr = ex.message || "Error on saving record."; req.flash('error', errStr); req.session.recCache[req.url] = req.body; res.redirect(req.url); return null; } if (web.ext && web.ext.dbUtils) { await web.ext.dbUtils.save(rec, req); } else { await rec.save(); } return rec; } function handleModelSchemaForColObj(modelSchema, colName, colMap, rec) { let colMapObj = colMap[colName]; if (modelSchema[colName]) { let attr = modelSchema[colName]; if (!colMap[colName]) { colMap[colName] = {}; } if (attr.default && rec[colName] === undefined) { // assign default values if non existing rec[colName] = attr.default; } colMapObj.required = colMapObj.required || attr.required; colMapObj.label = colMapObj.label == null ? attr.dbeditDisplay || web.cms.dbedit.utils.camelToTitle(colName) : colMapObj.label; } } function getRedirectAfter(rec, req, queryModelName) { let redirectAfter = 'save?_id=' + encodeURIComponent(rec._id.toString()); if (queryModelName) { redirectAfter += '&model=' + encodeURIComponent(queryModelName); } if (req.body._backUrl) { redirectAfter += '&_backUrl=' + encodeURIComponent(req.body._backUrl); } return redirectAfter; } function handleColObjMultiple(colMapObj, colName, rec) { colMapObj.multiple = colMapObj.multiple; if (colMapObj.multiple) { colMapObj.inputName = colName + '[]'; colMapObj._copies = colMapObj.copies; if (!colMapObj._copies) { if (colMapObj.inputType === 'checkbox') { colMapObj._copies = 1; } else { colMapObj._copies = 3; } } if (rec[colName] && rec[colName].length > colMapObj._copies && colMapObj.inputType !== 'checkbox') { colMapObj._copies = rec[colName].length; } } else { colMapObj.inputName = colName; colMapObj._copies = colMapObj._copies || 1; } } function getVal(recObj, key) { if (key.indexOf('.') == -1) { return recObj[key]; } else { return web.objectUtils.resolvePath(recObj, key); } }
mannyvergel/braziw-plugin-dbedit
utils/dbeditSaveController.js
JavaScript
mit
13,441
// // NYSegmentedControl+CBDSettings.h // SmartMathsMP // // Created by Colas on 11/08/2015. // Copyright (c) 2015 cassiopeia. All rights reserved. // #import "NYSegmentedControl.h" @interface NYSegmentedControl (CBDSettings) - (void)setUpForSegmentColor:(UIColor *)segmentColor titleColor:(UIColor *)titleColor selectedTitleColor:(UIColor *)selectedTitleColor font:(UIFont *)font cornerRadius:(CGFloat)cornerRadius ; @end
colasjojo/NYSegmentedControl
NYSegmentedControlDemo/NYSegmentedControl+CBDSettings.h
C
mit
499
<?php declare(strict_types=1); namespace Y0lk\SQLDumper; use ArrayObject; use PDO; use InvalidArgumentException; /** * A TableDumperCollection is used to group TableDumper objects together, allowing you to specify dump options on multiple table at once. * All TableDumper methods can be called directly on a TableDumperCollection, and will be executed on all the TableDumper instances in that collection. * * @author Gabriel Jean <[email protected]> */ class TableDumperCollection extends ArrayObject { /** * {@inheritDoc} */ public function append($value): void { //Make sure we're adding a TableDumper object if (!($value instanceof TableDumper)) { throw new InvalidArgumentException("TableDumperCollection only accepts TableDumper objects", 1); } //Append with table_name as key $this->offsetSet($value->getTable()->getName(), $value); } /** * {@inheritDoc} */ public function offsetSet($index, $newval): void { //Make sure we're adding a TableDumper object if (!($newval instanceof TableDumper)) { throw new InvalidArgumentException("TableDumperCollection only accepts TableDumper objects", 1); } //Append with table_name as key parent::offsetSet($newval->getTable()->getName(), $newval); } /** * @param Table|string $table Adds a table, either by name, or by Table instance, to the collection * * @return TableDumper Returns a TableDumper of the table that was just added */ public function addTable($table): TableDumper { if ($table instanceof Table) { $tableName = $table->getName(); } else { $tableName = $table; $table = new Table($tableName); } //First check if a dumper already exists for this table if (!$this->offsetExists($tableName)) { //Create new one $this->offsetSet($tableName, new TableDumper($table)); } return $this->offsetGet($tableName); } /** * @param TableDumperCollection|array<TableDumper|Table|string> $listTables Adds a list of tables, either by passing TableDumperCollection, or an array containing either TableDumper objects, Table objects or table naes * * @return TableDumperCollection Returns a TableDumperCollection of the list of tables that was just added */ public function addListTables($listTables): TableDumperCollection { //If arg is a TableDumperCollection, merge into this one if ($listTables instanceof TableDumperCollection) { foreach ($listTables as $table) { $this->append($table); } return $listTables; } else { return $this->addListTableArray($listTables); } } /** * Adds a list of tables passed as an array * @param array $listTables Array of tables to add * * @return TableDumperCollection Returns a TableDumperCollection of the list of tables that was just added */ protected function addListTableArray(array $listTables): TableDumperCollection { //Create TableDumperCollection $listDumpers = new TableDumperCollection; foreach ($listTables as $table) { //If table is already a Dumper, simply append to this if ($table instanceof TableDumper) { $listDumpers[] = $table; $this->append($table); } else { $listDumpers[] = $this->addTable($table); } } return $listDumpers; } /** * Writes all DROP statements to the dump stream * * @param resource $stream Stream to write the dump to * * @return void */ public function dumpDropStatements($stream): void { foreach ($this as $dumper) { if ($dumper->hasDrop()) { $dumper->dumpDropStatement($stream); } } } /** * Writes all INSERT statements to the dump stream * * @param PDO $db PDO instance to use for DB queries * @param resource $stream Stream to write the dump to * * @return void */ public function dumpInsertStatements(PDO $db, $stream): void { foreach ($this as $dumper) { if ($dumper->hasData()) { $dumper->dumpInsertStatement($db, $stream); } } } /** * Writes all the SQL statements of this dumper to the dump stream * * @param PDO $db PDO instance to use for DB queries * @param resource $stream Stream to write the dump to * @param boolean $groupDrops Determines if DROP statements will be grouped * @param boolean $groupInserts Determines if INSERT statements will be grouped * * @return void */ public function dump(PDO $db, $stream, bool $groupDrops = false, bool $groupInserts = false): void { if ($groupDrops) { $this->dumpDropStatements($stream); } foreach ($this as $dumper) { if (!$groupDrops) { $dumper->dumpDropStatement($stream); } $dumper->dumpCreateStatement($db, $stream); if (!$groupInserts) { $dumper->dumpInsertStatement($db, $stream); } } if ($groupInserts) { $this->dumpInsertStatements($db, $stream); } } public function __call(string $name, array $arguments) { //Call methods on TableDumper values foreach ($this as $value) { call_user_func_array([$value, $name], $arguments); } return $this; } }
Y0lk/sqldumper
src/TableDumperCollection.php
PHP
mit
5,834
<?php namespace modules\admin\controllers; use vendor\Controller; class Option extends Controller { public function index() { echo $this->render('module.admin@views/option.php', ['mainTitle' => '站点设置']); } }
SyanH/minicms
modules/admin/controllers/Option.php
PHP
mit
224
/** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. */ package com.microsoft.azure.management.resources.implementation; import com.microsoft.azure.management.resources.ResourceGroupProperties; import java.util.Map; import com.fasterxml.jackson.annotation.JsonProperty; /** * Resource group information. */ public class ResourceGroupInner { /** * The ID of the resource group. */ @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) private String id; /** * The name of the resource group. */ private String name; /** * The properties property. */ private ResourceGroupProperties properties; /** * The location of the resource group. It cannot be changed after the * resource group has been created. It muct be one of the supported Azure * locations. */ @JsonProperty(required = true) private String location; /** * The ID of the resource that manages this resource group. */ private String managedBy; /** * The tags attached to the resource group. */ private Map<String, String> tags; /** * Get the id value. * * @return the id value */ public String id() { return this.id; } /** * Get the name value. * * @return the name value */ public String name() { return this.name; } /** * Set the name value. * * @param name the name value to set * @return the ResourceGroupInner object itself. */ public ResourceGroupInner withName(String name) { this.name = name; return this; } /** * Get the properties value. * * @return the properties value */ public ResourceGroupProperties properties() { return this.properties; } /** * Set the properties value. * * @param properties the properties value to set * @return the ResourceGroupInner object itself. */ public ResourceGroupInner withProperties(ResourceGroupProperties properties) { this.properties = properties; return this; } /** * Get the location value. * * @return the location value */ public String location() { return this.location; } /** * Set the location value. * * @param location the location value to set * @return the ResourceGroupInner object itself. */ public ResourceGroupInner withLocation(String location) { this.location = location; return this; } /** * Get the managedBy value. * * @return the managedBy value */ public String managedBy() { return this.managedBy; } /** * Set the managedBy value. * * @param managedBy the managedBy value to set * @return the ResourceGroupInner object itself. */ public ResourceGroupInner withManagedBy(String managedBy) { this.managedBy = managedBy; return this; } /** * Get the tags value. * * @return the tags value */ public Map<String, String> tags() { return this.tags; } /** * Set the tags value. * * @param tags the tags value to set * @return the ResourceGroupInner object itself. */ public ResourceGroupInner withTags(Map<String, String> tags) { this.tags = tags; return this; } }
pomortaz/azure-sdk-for-java
azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ResourceGroupInner.java
Java
mit
3,619
#include <net/http/CServer.hpp> namespace net { namespace http { CServer::CServer(void) : net::CServer(net::EProtocol::TCP) { } }}
raduionita/project-hermes
old/Net.Http.Server/src/net/http/CServer.cpp
C++
mit
144
require "spec_helper" require "tidy_i18n/duplicate_keys" describe "Finding duplicate translations" do def locale_file_paths(file_names) file_names.collect do |path| File.expand_path(File.join(File.dirname(__FILE__), "fixtures", path)) end end it "finds duplicate keys when the locale only has one file" do duplicate_keys = TidyI18n::DuplicateKeys.new("en", locale_file_paths(["en_with_duplicate_keys.yml"])) expect(duplicate_keys.locale).to eq("en") expect(duplicate_keys.all.size).to eq(2) first_key = duplicate_keys.all.first expect(first_key.name).to eq("a.b") expect(first_key.values).to eq(["b1", "b2"]) second_key = duplicate_keys.all[1] expect(second_key.name).to eq("d.f") expect(second_key.values).to eq(["f1", "f2"]) end it "finds duplicate keys when the locale is split has multiple files" do file_paths = locale_file_paths(["en_with_duplicate_keys.yml", "en_with_more_duplicates.yml"]) duplicate_keys = TidyI18n::DuplicateKeys.new("en", file_paths) expect(duplicate_keys.locale).to eq("en") duplicate_key_names = duplicate_keys.all.map(&:name) expect(duplicate_key_names).to contain_exactly("a.b", "d.f", "c", "d.e") end end
ericmeyer/tidy_i18n
spec/acceptance/finding_duplicate_keys_spec.rb
Ruby
mit
1,230