code
stringlengths
3
1.01M
repo_name
stringlengths
5
116
path
stringlengths
3
311
language
stringclasses
30 values
license
stringclasses
15 values
size
int64
3
1.01M
<!DOCTYPE html> <html lang="en" class="js csstransforms3d"> <head> <meta charset="utf-8"> <!-- <meta http-equiv="refresh" content="0; url=https://matcornic.github.io/hugo-learn-doc/basics/what-is-this-hugo-theme/"/> --> <!-- <meta http-equiv="refresh" content="0; url=http://localhost:1313/basics/what-is-this-hugo-theme/"/> --> </style> </head> <body> </body> </html>
apalazzin/conself-docs
layouts/index.html
HTML
mit
395
<html lang="en"> <head> <title>Symbol Type - Using as</title> <meta http-equiv="Content-Type" content="text/html"> <meta name="description" content="Using as"> <meta name="generator" content="makeinfo 4.8"> <link title="Top" rel="start" href="index.html#Top"> <link rel="up" href="Symbol-Attributes.html#Symbol-Attributes" title="Symbol Attributes"> <link rel="prev" href="Symbol-Value.html#Symbol-Value" title="Symbol Value"> <link rel="next" href="a_002eout-Symbols.html#a_002eout-Symbols" title="a.out Symbols"> <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> <!-- This file documents the GNU Assembler "as". Copyright (C) 1991-2017 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU Free Documentation License''. --> <meta http-equiv="Content-Style-Type" content="text/css"> <style type="text/css"><!-- pre.display { font-family:inherit } pre.format { font-family:inherit } pre.smalldisplay { font-family:inherit; font-size:smaller } pre.smallformat { font-family:inherit; font-size:smaller } pre.smallexample { font-size:smaller } pre.smalllisp { font-size:smaller } span.sc { font-variant:small-caps } span.roman { font-family:serif; font-weight:normal; } span.sansserif { font-family:sans-serif; font-weight:normal; } --></style> </head> <body> <div class="node"> <p> <a name="Symbol-Type"></a> Next:&nbsp;<a rel="next" accesskey="n" href="a_002eout-Symbols.html#a_002eout-Symbols">a.out Symbols</a>, Previous:&nbsp;<a rel="previous" accesskey="p" href="Symbol-Value.html#Symbol-Value">Symbol Value</a>, Up:&nbsp;<a rel="up" accesskey="u" href="Symbol-Attributes.html#Symbol-Attributes">Symbol Attributes</a> <hr> </div> <h4 class="subsection">5.5.2 Type</h4> <p><a name="index-type-of-a-symbol-231"></a><a name="index-symbol-type-232"></a>The type attribute of a symbol contains relocation (section) information, any flag settings indicating that a symbol is external, and (optionally), other information for linkers and debuggers. The exact format depends on the object-code output format in use. </body></html>
ChangsoonKim/STM32F7DiscTutor
toolchain/osx/gcc-arm-none-eabi-6-2017-q1-update/share/doc/gcc-arm-none-eabi/html/as.html/Symbol-Type.html
HTML
mit
2,440
require 'spec_helper' describe OandaApiV20::Api do describe '#initialize' do let!(:client) { OandaApiV20::Client.new(access_token: 'my_access_token') } it 'sets the client attribute when supplied' do api = OandaApiV20::Api.new(client: client) expect(api.client).to eq(client) end it 'raises an OandaApiV20::ApiError exception when no client object was supplied' do expect{ OandaApiV20::Api.new }.to raise_error(OandaApiV20::ApiError) end it 'sets the base_uri attribute when supplied' do url = 'https://api-fxpractice.oanda.com/v3' api = OandaApiV20::Api.new(client: client, base_uri: url) expect(api.base_uri).to eq(url) end it 'sets the default base_uri attribute when not supplied' do api = OandaApiV20::Api.new(client: client) expect(api.base_uri).to eq('https://api-fxtrade.oanda.com/v3') end it 'sets the headers attribute when supplied' do headers = { 'Content-Type' => 'application/json', 'Connection' => 'keep-alive', 'Keep-Alive' => '30' } api = OandaApiV20::Api.new(client: client, headers: headers) expect(api.headers).to eq(headers) end it 'sets the default headers attribute when not supplied' do api = OandaApiV20::Api.new(client: client) expect(api.headers).to eq({ 'Authorization' => 'Bearer my_access_token', 'X-Accept-Datetime-Format' => 'RFC3339', 'Content-Type' => 'application/json' }) end it 'sets the account_id attribute when supplied' do account_id = '100-100-100' api = OandaApiV20::Api.new(client: client, account_id: account_id) expect(api.account_id).to eq(account_id) end it 'sets the instrument variable when supplied' do instrument = 'EUR_USD' api = OandaApiV20::Api.new(client: client, instrument: instrument) expect(api.instance_variable_get(:@instrument)).to eq(instrument) end it 'sets the last_action when supplied' do api = OandaApiV20::Api.new(client: client, last_action: 'accounts') expect(api.last_action).to eq('accounts') end it 'sets the last_arguments when supplied' do api = OandaApiV20::Api.new(client: client, last_action: 'account', last_arguments: ['100-100-100']) expect(api.last_action).to eq('account') expect(api.last_arguments).to eq(['100-100-100']) end end describe '#method_missing' do describe 'constructs the correct API URL under' do let!(:client) { OandaApiV20::Client.new(access_token: 'my_access_token', base_uri: 'https://api-fxtrade.oanda.com/v3', headers: {}) } let!(:stream_client) { OandaApiV20::Client.new(access_token: 'my_access_token', base_uri: 'https://api-fxtrade.oanda.com/v3', headers: {}, stream: true) } let!(:api) { OandaApiV20::Api.new(client: client, account_id: '100-100-100') } let!(:stream_api) { OandaApiV20::Api.new(client: stream_client, account_id: '100-100-100') } before(:each) do stub_request(:get, /https:\/\/api-fxtrade\.oanda\.com\/v3.*/) end context 'accounts for' do it 'retrieving an account' do api.account('100-100-100').show expect(a_request(:get, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100')).to have_been_made.once end it 'retrieving all accounts' do api.accounts.show expect(a_request(:get, 'https://api-fxtrade.oanda.com/v3/accounts')).to have_been_made.once end it 'retrieving a summary' do api.summary.show expect(a_request(:get, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/summary')).to have_been_made.once end it 'retrieving all instruments' do api.instruments.show expect(a_request(:get, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/instruments')).to have_been_made.once end it 'retrieving an instrument' do api.instruments('EUR_USD').show options = { 'instruments' => 'EUR_USD' } expect(a_request(:get, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/instruments').with(query: options)).to have_been_made.once end it 'retrieving no changes' do options = {} api.changes(options).show expect(a_request(:get, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/changes').with(query: { 'sinceTransactionID' => '' })).to have_been_made.once end it 'retrieving all changes since a transaction ID' do options = { 'sinceTransactionID' => '1' } api.changes(options).show expect(a_request(:get, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/changes').with(query: options)).to have_been_made.once end it 'updating a configuration' do options = { 'alias' => 'Timmy!' } request = stub_request(:patch, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/configuration').with(body: options) api.configuration(options).update expect(request).to have_been_requested.once end end context 'instruments for' do let!(:api) { OandaApiV20::Api.new(client: client, account_id: '100-100-100', instrument: 'EUR_USD') } it 'retrieving candlestick data' do options = { 'count' => '10' } api.candles(options).show expect(a_request(:get, 'https://api-fxtrade.oanda.com/v3/instruments/EUR_USD/candles').with(query: options)).to have_been_made.once end end context 'orders for' do it 'retrieving an order' do api.order('1').show expect(a_request(:get, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/orders/1')).to have_been_made.once end it 'creating an order' do options = { 'order' => { 'units' => '100', 'instrument' => 'EUR_CAD', 'timeInForce' => 'FOK', 'type' => 'MARKET', 'positionFill' => 'DEFAULT' } } request = stub_request(:post, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/orders').with(body: options) api.order(options).create expect(request).to have_been_requested.once end it 'updating an order' do options = { 'order' => { 'timeInForce' => 'GTC', 'price' => '1.7000', 'type' => 'TAKE_PROFIT', 'tradeID' => '1' } } request = stub_request(:put, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/orders/1').with(body: options) api.order('1', options).update expect(request).to have_been_requested.once end it 'updating an order client extensions' do options = { 'clientExtensions' => { 'comment' => 'New comment for my limit order' } } request = stub_request(:put, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/orders/1/clientExtensions').with(body: options) api.order('1', options).update expect(request).to have_been_requested.once end it 'cancelling an order' do request = stub_request(:put,'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/orders/1/cancel') api.order('1').cancel expect(request).to have_been_requested.once end it 'retrieving all orders' do api.orders.show expect(a_request(:get, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/orders')).to have_been_made.once end it 'retrieving all orders' do options = { 'instrument' => 'USD_CAD' } api.orders(options).show expect(a_request(:get, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/orders').with(query: options)).to have_been_made.once end it 'retrieving all pending orders' do api.pending_orders.show expect(a_request(:get, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/pendingOrders')).to have_been_made.once end end context 'trades for' do it 'retrieving a trade' do api.trade('1').show expect(a_request(:get, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/trades/1')).to have_been_made.once end it 'updating a trade' do options = { 'takeProfit' => { 'timeInForce' => 'GTC', 'price' => '0.5' }, 'stopLoss' => { 'timeInForce' => 'GTC', 'price' => '2.5' } } request = stub_request(:put, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/trades/1/orders').with(body: options) api.trade('1', options).update expect(request).to have_been_requested.once end it 'updating a trade client extensions' do options = { 'clientExtensions' => { 'comment' => 'This is a USD/CAD trade', 'tag' => 'trade tag', 'id' => 'my_usd_cad_trade' } } request = stub_request(:put, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/trades/1/clientExtensions').with(body: options) api.trade('1', options).update expect(request).to have_been_requested.once end it 'closing a trade' do request = stub_request(:put, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/trades/1/close') api.trade('1').close expect(request).to have_been_requested.once end it 'closing a trade partially' do options = { 'units' => '10' } request = stub_request(:put, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/trades/1/close') api.trade('1', options).close expect(request).to have_been_requested.once end it 'retrieving all trades' do options = { 'instrument' => 'USD_CAD' } api.trades(options).show expect(a_request(:get, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/trades').with(query: options)).to have_been_made.once end it 'retrieving all open trades' do api.open_trades.show expect(a_request(:get, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/openTrades')).to have_been_made.once end end context 'positions for' do it 'retrieving a position' do api.position('EUR_USD').show expect(a_request(:get, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/positions/EUR_USD')).to have_been_made.once end it 'retrieving all positions' do api.positions.show expect(a_request(:get, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/positions')).to have_been_made.once end it 'retrieving all open positions' do api.open_positions.show expect(a_request(:get, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/openPositions')).to have_been_made.once end it 'closing a position' do options = { 'longUnits' => 'ALL' } request = stub_request(:put, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/positions/EUR_CAD/close').with(body: options) api.position('EUR_CAD', options).close expect(request).to have_been_requested.once end it 'closing a position partially' do options = { 'longUnits' => '99' } request = stub_request(:put, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/positions/EUR_CAD/close').with(body: options) api.position('EUR_CAD', options).close expect(request).to have_been_requested.once end end context 'transactions for' do it 'retrieving a transaction' do api.transaction('1').show expect(a_request(:get, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/transactions/1')).to have_been_made.once end it 'retrieving all transactions' do api.transactions.show expect(a_request(:get, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/transactions')).to have_been_made.once end it 'retrieving all transactions in date range' do options = { 'from' => '2016-08-01T02:00:00Z', 'to' => '2016-08-15T02:00:00Z' } api.transactions(options).show expect(a_request(:get, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/transactions').with(query: options)).to have_been_made.once end it 'retrieving all transactions in an ID range' do options = { 'from' => '6409', 'to' => '6412' } api.transactions_id_range(options).show expect(a_request(:get, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/transactions/idrange').with(query: options)).to have_been_made.once end it 'retrieving all transactions since an ID' do options = { 'id' => '6411' } api.transactions_since_id(options).show expect(a_request(:get, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/transactions/sinceid').with(query: options)).to have_been_made.once end it 'retrieving all transactions stream' do body = <<~EOF {"id":"6","accountID":"100-100-100","userID":12345678,"batchID":"4","requestID":"11111111111111111","time":"2021-08-20T11:56:39.037505525Z","type":"TAKE_PROFIT_ORDER","tradeID":"5","timeInForce":"GTC","triggerCondition":"DEFAULT","price":"0.71388","reason":"ON_FILL"}\n{"id":"7","accountID":"100-100-100","userID":12345678,"batchID":"4","requestID":"11111111111111112","time":"2021-08-20T11:56:39.037505525Z","type":"STOP_LOSS_ORDER","tradeID":"5","timeInForce":"GTC","triggerCondition":"DEFAULT","triggerMode":"TOP_OF_BOOK","price":"0.71258","distance":"0.00030","reason":"ON_FILL"}\n\r\n EOF headers = { 'Transfer-Encoding' => 'chunked', 'Content-Type' => 'application/octet-stream' } stub_request(:get, 'https://stream-fxtrade.oanda.com/v3/accounts/100-100-100/transactions/stream').to_return(status: 200, body: body, headers: headers) messages = [] stream_api.transactions_stream.show do |message| messages << message end expect(a_request(:get, 'https://stream-fxtrade.oanda.com/v3/accounts/100-100-100/transactions/stream')).to have_been_made.once expect(messages.count).to eq(2) end end context 'pricing for' do it 'retrieving all pricing' do options = { 'instruments' => 'EUR_USD,USD_CAD' } api.pricing(options).show expect(a_request(:get, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/pricing').with(query: options)).to have_been_made.once end it 'retrieving all pricing stream' do options = { 'instruments' => 'EUR_USD,USD_CAD' } body = <<~EOF {"type":"PRICE","time":"2019-01-31T18:16:38.818627106Z","bids":[{"price":"0.72711","liquidity":10000000}],"asks":[{"price":"0.72725","liquidity":10000000}],"closeoutBid":"0.72696","closeoutAsk":"0.72740","status":"tradeable","tradeable":true,"instrument":"USD_CAD"}\n{"type":"PRICE","time":"2019-01-31T18:16:48.270050596Z","bids":[{"price":"0.95533","liquidity":10000000}],"asks":[{"price":"0.95554","liquidity":10000000}],"closeoutBid":"0.95533","closeoutAsk":"0.95554","status":"tradeable","tradeable":true,"instrument":"EUR_USD"}\n\r\n EOF headers = { 'Transfer-Encoding' => 'chunked', 'Content-Type' => 'application/octet-stream' } stub_request(:get, 'https://stream-fxtrade.oanda.com/v3/accounts/100-100-100/pricing/stream?instruments=EUR_USD,USD_CAD').to_return(status: 200, body: body, headers: headers) messages = [] stream_api.pricing_stream(options).show do |message| messages << message end expect(a_request(:get, 'https://stream-fxtrade.oanda.com/v3/accounts/100-100-100/pricing/stream').with(query: options)).to have_been_made.once expect(messages.count).to eq(2) end end end describe 'network' do let!(:client) { OandaApiV20::Client.new(access_token: 'my_access_token', base_uri: 'https://api-fxtrade.oanda.com/v3', headers: {}) } let!(:api) { OandaApiV20::Api.new(client: client) } let(:response_account) { '{"account":{"id":"100-100-100","NAV":"100000.0000","balance":"100000.0000","lastTransactionID":"99","orders":[],"positions":[],"trades":[],"pendingOrderCount":0},"lastTransactionID":"99"}' } let!(:request_account) { stub_request(:get, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100').to_return(status: 200, body: response_account, headers: {}) } let(:response_accounts) { '{"accounts":[{"id":"100-100-100","tags":[]}]}' } let!(:request_accounts) { stub_request(:get, 'https://api-fxtrade.oanda.com/v3/accounts').to_return(status: 200, body: response_accounts, headers: {}) } it 'makes a request to Oanda API' do api.accounts.show expect(request_accounts).to have_been_requested expect(request_accounts).to have_been_requested.at_most_once end it 'returns the response from Oanda API' do expect(api.accounts.show).to eq(JSON.parse(response_accounts)) expect(api.account('100-100-100').show).to eq(JSON.parse(response_account)) end end describe 'sets the correct HTTP verb' do let!(:client) { OandaApiV20::Client.new(access_token: 'my_access_token', base_uri: 'https://api-fxtrade.oanda.com/v3', headers: {}) } let!(:api) { OandaApiV20::Api.new(client: client, account_id: '100-100-100') } context 'for GET' do let!(:request) { stub_request(:get, 'https://api-fxtrade.oanda.com/v3/accounts') } it 'uses the correct HTTP verb' do api.accounts.show expect(request).to have_been_requested.once end it 'clears the HTTP verb attribute after use' do api.accounts.show expect(api.send(:http_verb)).to be_nil end end context 'for POST' do let!(:options) { { 'order' => { 'units' => '100', 'instrument' => 'EUR_CAD', 'timeInForce' => 'FOK', 'type' => 'MARKET', 'positionFill' => 'DEFAULT' } } } let!(:request) { stub_request(:post, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/orders').with(body: options) } it 'uses the correct HTTP verb' do api.order(options).create expect(request).to have_been_requested.once end it 'clears the HTTP verb attribute after use' do api.order(options).create expect(api.send(:http_verb)).to be_nil end end context 'for PATCH' do let!(:options) { { 'alias' => 'Timmy!' } } let!(:request) { stub_request(:patch, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/configuration').with(body: options) } it 'uses the correct HTTP verb' do api.configuration(options).update expect(request).to have_been_requested.once end it 'clears the HTTP verb attribute after use' do api.configuration(options).update expect(api.send(:http_verb)).to be_nil end end end end describe 'public methods' do let!(:client) { OandaApiV20::Client.new(access_token: 'my_access_token') } let!(:api) { OandaApiV20::Api.new(client: client) } let(:public_methods) { [ :account, :accounts, :summary, :instruments, :changes, :configuration, :order, :orders, :pending_orders, :trade, :trades, :open_trades, :position, :positions, :open_positions, :transaction, :transactions, :transactions_id_range, :transactions_since_id, :transactions_stream, :pricing, :pricing_stream, :candles ] } it 'responds to all public methods' do public_methods.each do |public_method| expect(api.respond_to?(public_method)).to be_truthy end end it 'returns an OandaApiV20::Api instance when calling any of the public methods' do expect(api.accounts).to be_an_instance_of(OandaApiV20::Api) end it 'makes a request to Oanda API when calling any of the action methods' do request = stub_request(:get, 'https://api-fxtrade.oanda.com/v3/accounts') api.accounts.show expect(request).to have_been_requested.once end end describe 'private methods' do describe '#set_http_verb' do let!(:client) { OandaApiV20::Client.new(access_token: 'my_access_token', base_uri: 'https://api-fxtrade.oanda.com/v3', headers: {}) } let!(:api) { OandaApiV20::Api.new(client: client) } describe 'sets the correct HTTP verb' do it 'for GET' do api.send(:set_http_verb, :show, nil) expect(api.send(:http_verb)).to eq(:get) end it 'for POST' do api.send(:set_http_verb, :create, nil) expect(api.send(:http_verb)).to eq(:post) end it 'for PUT' do api.send(:set_http_verb, :update, nil) expect(api.send(:http_verb)).to eq(:put) end it 'for PUT' do api.send(:set_http_verb, :cancel, nil) expect(api.send(:http_verb)).to eq(:put) end it 'for PUT' do api.send(:set_http_verb, :close, nil) expect(api.send(:http_verb)).to eq(:put) end it 'for PATCH' do api.send(:set_http_verb, :update, :configuration) expect(api.send(:http_verb)).to eq(:patch) end it 'for POST' do api.send(:set_http_verb, :create, nil) expect(api.send(:http_verb)).to eq(:post) end end end describe '#set_last_action_and_arguments' do let!(:client) { OandaApiV20::Client.new(access_token: 'my_access_token', base_uri: 'https://api-fxtrade.oanda.com/v3', headers: {}) } let!(:api) { OandaApiV20::Api.new(client: client) } it 'sets the last_action attribute' do api.send(:set_last_action_and_arguments, :accounts) expect(api.send(:last_action)).to eq(:accounts) end it 'sets the last_arguments attribute' do api.send(:set_last_action_and_arguments, :account, '100-100-100') expect(api.send(:last_arguments)).to eq(['100-100-100']) end end end end
kobusjoubert/oanda_api_v20
spec/oanda_api_v20/api_spec.rb
Ruby
mit
22,861
+++ title = "Note on Aug 13 EDT 2015 at 18:6" publishdate = 2015-08-13T22:06:07+00:00 draft = false syndicated = [ 'https://twitter.com/chrisjohndeluca/status/631949881716920300?s=20' ] +++ Love this http://t.co/nChJHeUHru
bronzehedwick/chrisdeluca
content/note/1439503567000.md
Markdown
mit
224
package com.zavitz.fml.data; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Timer; import java.util.TimerTask; import javax.microedition.io.Connector; import javax.microedition.io.HttpConnection; import com.zavitz.fml.FMLPostCommentScreen.LoadingField; import com.zavitz.fml.data.FMLPost.Post; public class FMLPostComment extends Thread { private LoadingField _loading; private PostCommentReceiver _receiver; private Post _post; private String _comment; public FMLPostComment(PostCommentReceiver receiver, LoadingField loading, Post post, String comment) { _receiver = receiver; _loading = loading; _post = post; _comment = comment; _receiver.commentPosting(); start(); } public void run() { try { Timer loadingTimer = new Timer(); TimerTask animate = new TimerTask() { public void run() { _loading.animate(); } }; loadingTimer.scheduleAtFixedRate(animate, 1000 / 16, 1000 / 16); URL url = new URL("/comment/"); url.addVar("id", _post.id); url.addVar("text", _comment); url.addVar("url",""); HttpConnection conn = (HttpConnection) Connector.open(url.construct()); InputStream is = conn.openInputStream(); final ByteArrayOutputStream os = new ByteArrayOutputStream(); copy(is, os); conn.close(); loadingTimer.cancel(); _receiver.commentPosted(os.toString()); } catch(final Exception e) { } } public static void copy(InputStream inputStream, OutputStream outputStream) throws IOException { byte[] s_copyBuffer = new byte[65536]; synchronized (s_copyBuffer) { for (int bytesRead = inputStream.read(s_copyBuffer); bytesRead >= 0; bytesRead = inputStream .read(s_copyBuffer)) if (bytesRead > 0) outputStream.write(s_copyBuffer, 0, bytesRead); } } }
gzavitz/blackberry-apps
FML/src/com/zavitz/fml/data/FMLPostComment.java
Java
mit
1,930
ReArms ====== small addon for wildstar to put an icon on your weapon when you're disarm/subdue.
vayan/ReArms
README.md
Markdown
mit
99
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "util.h" #include "sync.h" #include "strlcpy.h" #include "version.h" #include "ui_interface.h" #include <boost/algorithm/string/join.hpp> // Work around clang compilation problem in Boost 1.46: // /usr/include/boost/program_options/detail/config_file.hpp:163:17: error: call to function 'to_internal' that is neither visible in the template definition nor found by argument-dependent lookup // See also: http://stackoverflow.com/questions/10020179/compilation-fail-in-boost-librairies-program-options // http://clang.debian.net/status.php?version=3.0&key=CANNOT_FIND_FUNCTION namespace boost { namespace program_options { std::string to_internal(const std::string&); } } #include <boost/program_options/detail/config_file.hpp> #include <boost/program_options/parsers.hpp> #include <boost/filesystem.hpp> #include <boost/filesystem/fstream.hpp> #include <boost/foreach.hpp> #include <boost/thread.hpp> #include <openssl/crypto.h> #include <openssl/rand.h> #include <stdarg.h> #ifdef WIN32 #ifdef _MSC_VER #pragma warning(disable:4786) #pragma warning(disable:4804) #pragma warning(disable:4805) #pragma warning(disable:4717) #endif #ifdef _WIN32_WINNT #undef _WIN32_WINNT #endif #define _WIN32_WINNT 0x0501 #ifdef _WIN32_IE #undef _WIN32_IE #endif #define _WIN32_IE 0x0501 #define WIN32_LEAN_AND_MEAN 1 #ifndef NOMINMAX #define NOMINMAX #endif #include <io.h> /* for _commit */ #include "shlobj.h" #elif defined(__linux__) # include <sys/prctl.h> #endif #ifndef WIN32 #include <execinfo.h> #endif using namespace std; map<string, string> mapArgs; map<string, vector<string> > mapMultiArgs; bool fDebug = false; bool fDebugNet = false; bool fPrintToConsole = false; bool fPrintToDebugger = false; bool fRequestShutdown = false; bool fShutdown = false; bool fDaemon = false; bool fServer = false; bool fCommandLine = false; string strMiscWarning; bool fTestNet = false; bool fNoListen = false; bool fLogTimestamps = false; CMedianFilter<int64_t> vTimeOffsets(200,0); bool fReopenDebugLog = false; // Init OpenSSL library multithreading support static CCriticalSection** ppmutexOpenSSL; void locking_callback(int mode, int i, const char* file, int line) { if (mode & CRYPTO_LOCK) { ENTER_CRITICAL_SECTION(*ppmutexOpenSSL[i]); } else { LEAVE_CRITICAL_SECTION(*ppmutexOpenSSL[i]); } } LockedPageManager LockedPageManager::instance; // Init class CInit { public: CInit() { // Init OpenSSL library multithreading support ppmutexOpenSSL = (CCriticalSection**)OPENSSL_malloc(CRYPTO_num_locks() * sizeof(CCriticalSection*)); for (int i = 0; i < CRYPTO_num_locks(); i++) ppmutexOpenSSL[i] = new CCriticalSection(); CRYPTO_set_locking_callback(locking_callback); #ifdef WIN32 // Seed random number generator with screen scrape and other hardware sources RAND_screen(); #endif // Seed random number generator with performance counter RandAddSeed(); } ~CInit() { // Shutdown OpenSSL library multithreading support CRYPTO_set_locking_callback(NULL); for (int i = 0; i < CRYPTO_num_locks(); i++) delete ppmutexOpenSSL[i]; OPENSSL_free(ppmutexOpenSSL); } } instance_of_cinit; void RandAddSeed() { // Seed with CPU performance counter int64_t nCounter = GetPerformanceCounter(); RAND_add(&nCounter, sizeof(nCounter), 1.5); memset(&nCounter, 0, sizeof(nCounter)); } void RandAddSeedPerfmon() { RandAddSeed(); // This can take up to 2 seconds, so only do it every 10 minutes static int64_t nLastPerfmon; if (GetTime() < nLastPerfmon + 10 * 60) return; nLastPerfmon = GetTime(); #ifdef WIN32 // Don't need this on Linux, OpenSSL automatically uses /dev/urandom // Seed with the entire set of perfmon data unsigned char pdata[250000]; memset(pdata, 0, sizeof(pdata)); unsigned long nSize = sizeof(pdata); long ret = RegQueryValueExA(HKEY_PERFORMANCE_DATA, "Global", NULL, NULL, pdata, &nSize); RegCloseKey(HKEY_PERFORMANCE_DATA); if (ret == ERROR_SUCCESS) { RAND_add(pdata, nSize, nSize/100.0); memset(pdata, 0, nSize); printf("RandAddSeed() %lu bytes\n", nSize); } #endif } uint64_t GetRand(uint64_t nMax) { if (nMax == 0) return 0; // The range of the random source must be a multiple of the modulus // to give every possible output value an equal possibility uint64_t nRange = (std::numeric_limits<uint64_t>::max() / nMax) * nMax; uint64_t nRand = 0; do RAND_bytes((unsigned char*)&nRand, sizeof(nRand)); while (nRand >= nRange); return (nRand % nMax); } int GetRandInt(int nMax) { return GetRand(nMax); } uint256 GetRandHash() { uint256 hash; RAND_bytes((unsigned char*)&hash, sizeof(hash)); return hash; } static FILE* fileout = NULL; inline int OutputDebugStringF(const char* pszFormat, ...) { int ret = 0; if (fPrintToConsole) { // print to console va_list arg_ptr; va_start(arg_ptr, pszFormat); ret = vprintf(pszFormat, arg_ptr); va_end(arg_ptr); } else if (!fPrintToDebugger) { // print to debug.log if (!fileout) { boost::filesystem::path pathDebug = GetDataDir() / "debug.log"; fileout = fopen(pathDebug.string().c_str(), "a"); if (fileout) setbuf(fileout, NULL); // unbuffered } if (fileout) { static bool fStartedNewLine = true; // This routine may be called by global destructors during shutdown. // Since the order of destruction of static/global objects is undefined, // allocate mutexDebugLog on the heap the first time this routine // is called to avoid crashes during shutdown. static boost::mutex* mutexDebugLog = NULL; if (mutexDebugLog == NULL) mutexDebugLog = new boost::mutex(); boost::mutex::scoped_lock scoped_lock(*mutexDebugLog); // reopen the log file, if requested if (fReopenDebugLog) { fReopenDebugLog = false; boost::filesystem::path pathDebug = GetDataDir() / "debug.log"; if (freopen(pathDebug.string().c_str(),"a",fileout) != NULL) setbuf(fileout, NULL); // unbuffered } // Debug print useful for profiling if (fLogTimestamps && fStartedNewLine) fprintf(fileout, "%s ", DateTimeStrFormat("%x %H:%M:%S", GetTime()).c_str()); if (pszFormat[strlen(pszFormat) - 1] == '\n') fStartedNewLine = true; else fStartedNewLine = false; va_list arg_ptr; va_start(arg_ptr, pszFormat); ret = vfprintf(fileout, pszFormat, arg_ptr); va_end(arg_ptr); } } #ifdef WIN32 if (fPrintToDebugger) { static CCriticalSection cs_OutputDebugStringF; // accumulate and output a line at a time { LOCK(cs_OutputDebugStringF); static std::string buffer; va_list arg_ptr; va_start(arg_ptr, pszFormat); buffer += vstrprintf(pszFormat, arg_ptr); va_end(arg_ptr); int line_start = 0, line_end; while((line_end = buffer.find('\n', line_start)) != -1) { OutputDebugStringA(buffer.substr(line_start, line_end - line_start).c_str()); line_start = line_end + 1; } buffer.erase(0, line_start); } } #endif return ret; } string vstrprintf(const char *format, va_list ap) { char buffer[50000]; char* p = buffer; int limit = sizeof(buffer); int ret; while (true) { va_list arg_ptr; va_copy(arg_ptr, ap); #ifdef WIN32 ret = _vsnprintf(p, limit, format, arg_ptr); #else ret = vsnprintf(p, limit, format, arg_ptr); #endif va_end(arg_ptr); if (ret >= 0 && ret < limit) break; if (p != buffer) delete[] p; limit *= 2; p = new char[limit]; if (p == NULL) throw std::bad_alloc(); } string str(p, p+ret); if (p != buffer) delete[] p; return str; } string real_strprintf(const char *format, int dummy, ...) { va_list arg_ptr; va_start(arg_ptr, dummy); string str = vstrprintf(format, arg_ptr); va_end(arg_ptr); return str; } string real_strprintf(const std::string &format, int dummy, ...) { va_list arg_ptr; va_start(arg_ptr, dummy); string str = vstrprintf(format.c_str(), arg_ptr); va_end(arg_ptr); return str; } bool error(const char *format, ...) { va_list arg_ptr; va_start(arg_ptr, format); std::string str = vstrprintf(format, arg_ptr); va_end(arg_ptr); printf("ERROR: %s\n", str.c_str()); return false; } void ParseString(const string& str, char c, vector<string>& v) { if (str.empty()) return; string::size_type i1 = 0; string::size_type i2; while (true) { i2 = str.find(c, i1); if (i2 == str.npos) { v.push_back(str.substr(i1)); return; } v.push_back(str.substr(i1, i2-i1)); i1 = i2+1; } } string FormatMoney(int64_t n, bool fPlus) { // Note: not using straight sprintf here because we do NOT want // localized number formatting. int64_t n_abs = (n > 0 ? n : -n); int64_t quotient = n_abs/COIN; int64_t remainder = n_abs%COIN; string str = strprintf("%"PRId64".%08"PRId64, quotient, remainder); // Right-trim excess zeros before the decimal point: int nTrim = 0; for (int i = str.size()-1; (str[i] == '0' && isdigit(str[i-2])); --i) ++nTrim; if (nTrim) str.erase(str.size()-nTrim, nTrim); if (n < 0) str.insert((unsigned int)0, 1, '-'); else if (fPlus && n > 0) str.insert((unsigned int)0, 1, '+'); return str; } bool ParseMoney(const string& str, int64_t& nRet) { return ParseMoney(str.c_str(), nRet); } bool ParseMoney(const char* pszIn, int64_t& nRet) { string strWhole; int64_t nUnits = 0; const char* p = pszIn; while (isspace(*p)) p++; for (; *p; p++) { if (*p == '.') { p++; int64_t nMult = CENT*10; while (isdigit(*p) && (nMult > 0)) { nUnits += nMult * (*p++ - '0'); nMult /= 10; } break; } if (isspace(*p)) break; if (!isdigit(*p)) return false; strWhole.insert(strWhole.end(), *p); } for (; *p; p++) if (!isspace(*p)) return false; if (strWhole.size() > 10) // guard against 63 bit overflow return false; if (nUnits < 0 || nUnits > COIN) return false; int64_t nWhole = atoi64(strWhole); int64_t nValue = nWhole*COIN + nUnits; nRet = nValue; return true; } static const signed char phexdigit[256] = { -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0,1,2,3,4,5,6,7,8,9,-1,-1,-1,-1,-1,-1, -1,0xa,0xb,0xc,0xd,0xe,0xf,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,0xa,0xb,0xc,0xd,0xe,0xf,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, }; bool IsHex(const string& str) { BOOST_FOREACH(unsigned char c, str) { if (phexdigit[c] < 0) return false; } return (str.size() > 0) && (str.size()%2 == 0); } vector<unsigned char> ParseHex(const char* psz) { // convert hex dump to vector vector<unsigned char> vch; while (true) { while (isspace(*psz)) psz++; signed char c = phexdigit[(unsigned char)*psz++]; if (c == (signed char)-1) break; unsigned char n = (c << 4); c = phexdigit[(unsigned char)*psz++]; if (c == (signed char)-1) break; n |= c; vch.push_back(n); } return vch; } vector<unsigned char> ParseHex(const string& str) { return ParseHex(str.c_str()); } static void InterpretNegativeSetting(string name, map<string, string>& mapSettingsRet) { // interpret -nofoo as -foo=0 (and -nofoo=0 as -foo=1) as long as -foo not set if (name.find("-no") == 0) { std::string positive("-"); positive.append(name.begin()+3, name.end()); if (mapSettingsRet.count(positive) == 0) { bool value = !GetBoolArg(name); mapSettingsRet[positive] = (value ? "1" : "0"); } } } void ParseParameters(int argc, const char* const argv[]) { mapArgs.clear(); mapMultiArgs.clear(); for (int i = 1; i < argc; i++) { char psz[10000]; strlcpy(psz, argv[i], sizeof(psz)); char* pszValue = (char*)""; if (strchr(psz, '=')) { pszValue = strchr(psz, '='); *pszValue++ = '\0'; } #ifdef WIN32 _strlwr(psz); if (psz[0] == '/') psz[0] = '-'; #endif if (psz[0] != '-') break; mapArgs[psz] = pszValue; mapMultiArgs[psz].push_back(pszValue); } // New 0.6 features: BOOST_FOREACH(const PAIRTYPE(string,string)& entry, mapArgs) { string name = entry.first; // interpret --foo as -foo (as long as both are not set) if (name.find("--") == 0) { std::string singleDash(name.begin()+1, name.end()); if (mapArgs.count(singleDash) == 0) mapArgs[singleDash] = entry.second; name = singleDash; } // interpret -nofoo as -foo=0 (and -nofoo=0 as -foo=1) as long as -foo not set InterpretNegativeSetting(name, mapArgs); } } std::string GetArg(const std::string& strArg, const std::string& strDefault) { if (mapArgs.count(strArg)) return mapArgs[strArg]; return strDefault; } int64_t GetArg(const std::string& strArg, int64_t nDefault) { if (mapArgs.count(strArg)) return atoi64(mapArgs[strArg]); return nDefault; } bool GetBoolArg(const std::string& strArg, bool fDefault) { if (mapArgs.count(strArg)) { if (mapArgs[strArg].empty()) return true; return (atoi(mapArgs[strArg]) != 0); } return fDefault; } bool SoftSetArg(const std::string& strArg, const std::string& strValue) { if (mapArgs.count(strArg)) return false; mapArgs[strArg] = strValue; return true; } bool SoftSetBoolArg(const std::string& strArg, bool fValue) { if (fValue) return SoftSetArg(strArg, std::string("1")); else return SoftSetArg(strArg, std::string("0")); } string EncodeBase64(const unsigned char* pch, size_t len) { static const char *pbase64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; string strRet=""; strRet.reserve((len+2)/3*4); int mode=0, left=0; const unsigned char *pchEnd = pch+len; while (pch<pchEnd) { int enc = *(pch++); switch (mode) { case 0: // we have no bits strRet += pbase64[enc >> 2]; left = (enc & 3) << 4; mode = 1; break; case 1: // we have two bits strRet += pbase64[left | (enc >> 4)]; left = (enc & 15) << 2; mode = 2; break; case 2: // we have four bits strRet += pbase64[left | (enc >> 6)]; strRet += pbase64[enc & 63]; mode = 0; break; } } if (mode) { strRet += pbase64[left]; strRet += '='; if (mode == 1) strRet += '='; } return strRet; } string EncodeBase64(const string& str) { return EncodeBase64((const unsigned char*)str.c_str(), str.size()); } vector<unsigned char> DecodeBase64(const char* p, bool* pfInvalid) { static const int decode64_table[256] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; if (pfInvalid) *pfInvalid = false; vector<unsigned char> vchRet; vchRet.reserve(strlen(p)*3/4); int mode = 0; int left = 0; while (1) { int dec = decode64_table[(unsigned char)*p]; if (dec == -1) break; p++; switch (mode) { case 0: // we have no bits and get 6 left = dec; mode = 1; break; case 1: // we have 6 bits and keep 4 vchRet.push_back((left<<2) | (dec>>4)); left = dec & 15; mode = 2; break; case 2: // we have 4 bits and get 6, we keep 2 vchRet.push_back((left<<4) | (dec>>2)); left = dec & 3; mode = 3; break; case 3: // we have 2 bits and get 6 vchRet.push_back((left<<6) | dec); mode = 0; break; } } if (pfInvalid) switch (mode) { case 0: // 4n base64 characters processed: ok break; case 1: // 4n+1 base64 character processed: impossible *pfInvalid = true; break; case 2: // 4n+2 base64 characters processed: require '==' if (left || p[0] != '=' || p[1] != '=' || decode64_table[(unsigned char)p[2]] != -1) *pfInvalid = true; break; case 3: // 4n+3 base64 characters processed: require '=' if (left || p[0] != '=' || decode64_table[(unsigned char)p[1]] != -1) *pfInvalid = true; break; } return vchRet; } string DecodeBase64(const string& str) { vector<unsigned char> vchRet = DecodeBase64(str.c_str()); return string((const char*)&vchRet[0], vchRet.size()); } string EncodeBase32(const unsigned char* pch, size_t len) { static const char *pbase32 = "abcdefghijklmnopqrstuvwxyz234567"; string strRet=""; strRet.reserve((len+4)/5*8); int mode=0, left=0; const unsigned char *pchEnd = pch+len; while (pch<pchEnd) { int enc = *(pch++); switch (mode) { case 0: // we have no bits strRet += pbase32[enc >> 3]; left = (enc & 7) << 2; mode = 1; break; case 1: // we have three bits strRet += pbase32[left | (enc >> 6)]; strRet += pbase32[(enc >> 1) & 31]; left = (enc & 1) << 4; mode = 2; break; case 2: // we have one bit strRet += pbase32[left | (enc >> 4)]; left = (enc & 15) << 1; mode = 3; break; case 3: // we have four bits strRet += pbase32[left | (enc >> 7)]; strRet += pbase32[(enc >> 2) & 31]; left = (enc & 3) << 3; mode = 4; break; case 4: // we have two bits strRet += pbase32[left | (enc >> 5)]; strRet += pbase32[enc & 31]; mode = 0; } } static const int nPadding[5] = {0, 6, 4, 3, 1}; if (mode) { strRet += pbase32[left]; for (int n=0; n<nPadding[mode]; n++) strRet += '='; } return strRet; } string EncodeBase32(const string& str) { return EncodeBase32((const unsigned char*)str.c_str(), str.size()); } vector<unsigned char> DecodeBase32(const char* p, bool* pfInvalid) { static const int decode32_table[256] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; if (pfInvalid) *pfInvalid = false; vector<unsigned char> vchRet; vchRet.reserve((strlen(p))*5/8); int mode = 0; int left = 0; while (1) { int dec = decode32_table[(unsigned char)*p]; if (dec == -1) break; p++; switch (mode) { case 0: // we have no bits and get 5 left = dec; mode = 1; break; case 1: // we have 5 bits and keep 2 vchRet.push_back((left<<3) | (dec>>2)); left = dec & 3; mode = 2; break; case 2: // we have 2 bits and keep 7 left = left << 5 | dec; mode = 3; break; case 3: // we have 7 bits and keep 4 vchRet.push_back((left<<1) | (dec>>4)); left = dec & 15; mode = 4; break; case 4: // we have 4 bits, and keep 1 vchRet.push_back((left<<4) | (dec>>1)); left = dec & 1; mode = 5; break; case 5: // we have 1 bit, and keep 6 left = left << 5 | dec; mode = 6; break; case 6: // we have 6 bits, and keep 3 vchRet.push_back((left<<2) | (dec>>3)); left = dec & 7; mode = 7; break; case 7: // we have 3 bits, and keep 0 vchRet.push_back((left<<5) | dec); mode = 0; break; } } if (pfInvalid) switch (mode) { case 0: // 8n base32 characters processed: ok break; case 1: // 8n+1 base32 characters processed: impossible case 3: // +3 case 6: // +6 *pfInvalid = true; break; case 2: // 8n+2 base32 characters processed: require '======' if (left || p[0] != '=' || p[1] != '=' || p[2] != '=' || p[3] != '=' || p[4] != '=' || p[5] != '=' || decode32_table[(unsigned char)p[6]] != -1) *pfInvalid = true; break; case 4: // 8n+4 base32 characters processed: require '====' if (left || p[0] != '=' || p[1] != '=' || p[2] != '=' || p[3] != '=' || decode32_table[(unsigned char)p[4]] != -1) *pfInvalid = true; break; case 5: // 8n+5 base32 characters processed: require '===' if (left || p[0] != '=' || p[1] != '=' || p[2] != '=' || decode32_table[(unsigned char)p[3]] != -1) *pfInvalid = true; break; case 7: // 8n+7 base32 characters processed: require '=' if (left || p[0] != '=' || decode32_table[(unsigned char)p[1]] != -1) *pfInvalid = true; break; } return vchRet; } string DecodeBase32(const string& str) { vector<unsigned char> vchRet = DecodeBase32(str.c_str()); return string((const char*)&vchRet[0], vchRet.size()); } bool WildcardMatch(const char* psz, const char* mask) { while (true) { switch (*mask) { case '\0': return (*psz == '\0'); case '*': return WildcardMatch(psz, mask+1) || (*psz && WildcardMatch(psz+1, mask)); case '?': if (*psz == '\0') return false; break; default: if (*psz != *mask) return false; break; } psz++; mask++; } } bool WildcardMatch(const string& str, const string& mask) { return WildcardMatch(str.c_str(), mask.c_str()); } static std::string FormatException(std::exception* pex, const char* pszThread) { #ifdef WIN32 char pszModule[MAX_PATH] = ""; GetModuleFileNameA(NULL, pszModule, sizeof(pszModule)); #else const char* pszModule = "ProfitCoin"; #endif if (pex) return strprintf( "EXCEPTION: %s \n%s \n%s in %s \n", typeid(*pex).name(), pex->what(), pszModule, pszThread); else return strprintf( "UNKNOWN EXCEPTION \n%s in %s \n", pszModule, pszThread); } void LogException(std::exception* pex, const char* pszThread) { std::string message = FormatException(pex, pszThread); printf("\n%s", message.c_str()); } void PrintException(std::exception* pex, const char* pszThread) { std::string message = FormatException(pex, pszThread); printf("\n\n************************\n%s\n", message.c_str()); fprintf(stderr, "\n\n************************\n%s\n", message.c_str()); strMiscWarning = message; throw; } void LogStackTrace() { printf("\n\n******* exception encountered *******\n"); if (fileout) { #ifndef WIN32 void* pszBuffer[32]; size_t size; size = backtrace(pszBuffer, 32); backtrace_symbols_fd(pszBuffer, size, fileno(fileout)); #endif } } void PrintExceptionContinue(std::exception* pex, const char* pszThread) { std::string message = FormatException(pex, pszThread); printf("\n\n************************\n%s\n", message.c_str()); fprintf(stderr, "\n\n************************\n%s\n", message.c_str()); strMiscWarning = message; } boost::filesystem::path GetDefaultDataDir() { namespace fs = boost::filesystem; // Windows < Vista: C:\Documents and Settings\Username\Application Data\ProfitCoin // Windows >= Vista: C:\Users\Username\AppData\Roaming\ProfitCoin // Mac: ~/Library/Application Support/ProfitCoin // Unix: ~/.ProfitCoin #ifdef WIN32 // Windows return GetSpecialFolderPath(CSIDL_APPDATA) / "ProfitCoin"; #else fs::path pathRet; char* pszHome = getenv("HOME"); if (pszHome == NULL || strlen(pszHome) == 0) pathRet = fs::path("/"); else pathRet = fs::path(pszHome); #ifdef MAC_OSX // Mac pathRet /= "Library/Application Support"; fs::create_directory(pathRet); return pathRet / "ProfitCoin"; #else // Unix return pathRet / ".ProfitCoin"; #endif #endif } const boost::filesystem::path &GetDataDir(bool fNetSpecific) { namespace fs = boost::filesystem; static fs::path pathCached[2]; static CCriticalSection csPathCached; static bool cachedPath[2] = {false, false}; fs::path &path = pathCached[fNetSpecific]; // This can be called during exceptions by printf, so we cache the // value so we don't have to do memory allocations after that. if (cachedPath[fNetSpecific]) return path; LOCK(csPathCached); if (mapArgs.count("-datadir")) { path = fs::system_complete(mapArgs["-datadir"]); if (!fs::is_directory(path)) { path = ""; return path; } } else { path = GetDefaultDataDir(); } if (fNetSpecific && fTestNet) path /= "testnet"; fs::create_directory(path); cachedPath[fNetSpecific]=true; return path; } boost::filesystem::path GetConfigFile() { boost::filesystem::path pathConfigFile(GetArg("-conf", "ProfitCoin.conf")); if (!pathConfigFile.is_complete()) pathConfigFile = GetDataDir(false) / pathConfigFile; return pathConfigFile; } void ReadConfigFile(map<string, string>& mapSettingsRet, map<string, vector<string> >& mapMultiSettingsRet) { boost::filesystem::ifstream streamConfig(GetConfigFile()); if (!streamConfig.good()) return; // No bitcoin.conf file is OK set<string> setOptions; setOptions.insert("*"); for (boost::program_options::detail::config_file_iterator it(streamConfig, setOptions), end; it != end; ++it) { // Don't overwrite existing settings so command line settings override bitcoin.conf string strKey = string("-") + it->string_key; if (mapSettingsRet.count(strKey) == 0) { mapSettingsRet[strKey] = it->value[0]; // interpret nofoo=1 as foo=0 (and nofoo=0 as foo=1) as long as foo not set) InterpretNegativeSetting(strKey, mapSettingsRet); } mapMultiSettingsRet[strKey].push_back(it->value[0]); } } boost::filesystem::path GetPidFile() { boost::filesystem::path pathPidFile(GetArg("-pid", "ProfitCoind.pid")); if (!pathPidFile.is_complete()) pathPidFile = GetDataDir() / pathPidFile; return pathPidFile; } #ifndef WIN32 void CreatePidFile(const boost::filesystem::path &path, pid_t pid) { FILE* file = fopen(path.string().c_str(), "w"); if (file) { fprintf(file, "%d\n", pid); fclose(file); } } #endif bool RenameOver(boost::filesystem::path src, boost::filesystem::path dest) { #ifdef WIN32 return MoveFileExA(src.string().c_str(), dest.string().c_str(), MOVEFILE_REPLACE_EXISTING); #else int rc = std::rename(src.string().c_str(), dest.string().c_str()); return (rc == 0); #endif /* WIN32 */ } void FileCommit(FILE *fileout) { fflush(fileout); // harmless if redundantly called #ifdef WIN32 _commit(_fileno(fileout)); #else fsync(fileno(fileout)); #endif } void ShrinkDebugFile() { // Scroll debug.log if it's getting too big boost::filesystem::path pathLog = GetDataDir() / "debug.log"; FILE* file = fopen(pathLog.string().c_str(), "r"); if (file && boost::filesystem::file_size(pathLog) > 10 * 1000000) { // Restart the file with some of the end char pch[200000]; fseek(file, -sizeof(pch), SEEK_END); int nBytes = fread(pch, 1, sizeof(pch), file); fclose(file); file = fopen(pathLog.string().c_str(), "w"); if (file) { fwrite(pch, 1, nBytes, file); fclose(file); } } } // // "Never go to sea with two chronometers; take one or three." // Our three time sources are: // - System clock // - Median of other nodes clocks // - The user (asking the user to fix the system clock if the first two disagree) // static int64_t nMockTime = 0; // For unit testing int64_t GetTime() { if (nMockTime) return nMockTime; return time(NULL); } void SetMockTime(int64_t nMockTimeIn) { nMockTime = nMockTimeIn; } static int64_t nTimeOffset = 0; int64_t GetTimeOffset() { return nTimeOffset; } int64_t GetAdjustedTime() { return GetTime() + GetTimeOffset(); } void AddTimeData(const CNetAddr& ip, int64_t nTime) { int64_t nOffsetSample = nTime - GetTime(); // Ignore duplicates static set<CNetAddr> setKnown; if (!setKnown.insert(ip).second) return; // Add data vTimeOffsets.input(nOffsetSample); printf("Added time data, samples %d, offset %+"PRId64" (%+"PRId64" minutes)\n", vTimeOffsets.size(), nOffsetSample, nOffsetSample/60); if (vTimeOffsets.size() >= 5 && vTimeOffsets.size() % 2 == 1) { int64_t nMedian = vTimeOffsets.median(); std::vector<int64_t> vSorted = vTimeOffsets.sorted(); // Only let other nodes change our time by so much if (abs64(nMedian) < 70 * 60) { nTimeOffset = nMedian; } else { nTimeOffset = 0; static bool fDone; if (!fDone) { // If nobody has a time different than ours but within 5 minutes of ours, give a warning bool fMatch = false; BOOST_FOREACH(int64_t nOffset, vSorted) if (nOffset != 0 && abs64(nOffset) < 5 * 60) fMatch = true; if (!fMatch) { fDone = true; string strMessage = _("Warning: Please check that your computer's date and time are correct! If your clock is wrong ProfitCoin will not work properly."); strMiscWarning = strMessage; printf("*** %s\n", strMessage.c_str()); uiInterface.ThreadSafeMessageBox(strMessage+" ", string("ProfitCoin"), CClientUIInterface::OK | CClientUIInterface::ICON_EXCLAMATION); } } } if (fDebug) { BOOST_FOREACH(int64_t n, vSorted) printf("%+"PRId64" ", n); printf("| "); } printf("nTimeOffset = %+"PRId64" (%+"PRId64" minutes)\n", nTimeOffset, nTimeOffset/60); } } string FormatVersion(int nVersion) { if (nVersion%100 == 0) return strprintf("%d.%d.%d", nVersion/1000000, (nVersion/10000)%100, (nVersion/100)%100); else return strprintf("%d.%d.%d.%d", nVersion/1000000, (nVersion/10000)%100, (nVersion/100)%100, nVersion%100); } string FormatFullVersion() { return CLIENT_BUILD; } // Format the subversion field according to BIP 14 spec (https://en.bitcoin.it/wiki/BIP_0014) std::string FormatSubVersion(const std::string& name, int nClientVersion, const std::vector<std::string>& comments) { std::ostringstream ss; ss << "/"; ss << name << ":" << FormatVersion(nClientVersion); if (!comments.empty()) ss << "(" << boost::algorithm::join(comments, "; ") << ")"; ss << "/"; return ss.str(); } #ifdef WIN32 boost::filesystem::path GetSpecialFolderPath(int nFolder, bool fCreate) { namespace fs = boost::filesystem; char pszPath[MAX_PATH] = ""; if(SHGetSpecialFolderPathA(NULL, pszPath, nFolder, fCreate)) { return fs::path(pszPath); } printf("SHGetSpecialFolderPathA() failed, could not obtain requested path.\n"); return fs::path(""); } #endif void runCommand(std::string strCommand) { int nErr = ::system(strCommand.c_str()); if (nErr) printf("runCommand error: system(%s) returned %d\n", strCommand.c_str(), nErr); } void RenameThread(const char* name) { #if defined(PR_SET_NAME) // Only the first 15 characters are used (16 - NUL terminator) ::prctl(PR_SET_NAME, name, 0, 0, 0); #elif 0 && (defined(__FreeBSD__) || defined(__OpenBSD__)) // TODO: This is currently disabled because it needs to be verified to work // on FreeBSD or OpenBSD first. When verified the '0 &&' part can be // removed. pthread_set_name_np(pthread_self(), name); // This is XCode 10.6-and-later; bring back if we drop 10.5 support: // #elif defined(MAC_OSX) // pthread_setname_np(name); #else // Prevent warnings for unused parameters... (void)name; #endif } bool NewThread(void(*pfn)(void*), void* parg) { try { boost::thread(pfn, parg); // thread detaches when out of scope } catch(boost::thread_resource_error &e) { printf("Error creating thread: %s\n", e.what()); return false; } return true; }
hashprofit/profitcoin
src/util.cpp
C++
mit
37,873
package pl.java.scalatech.domain; import static com.mysema.query.types.PathMetadataFactory.*; import com.mysema.query.types.path.*; import com.mysema.query.types.PathMetadata; import javax.annotation.Generated; import com.mysema.query.types.Path; /** * QRole is a Querydsl query type for Role */ @Generated("com.mysema.query.codegen.EntitySerializer") public class QRole extends EntityPathBase<Role> { private static final long serialVersionUID = 945184212L; public static final QRole role = new QRole("role"); public final QPKEntity _super = new QPKEntity(this); //inherited public final DatePath<java.time.LocalDate> dateAdded = _super.dateAdded; //inherited public final DatePath<java.time.LocalDate> dateModification = _super.dateModification; public final StringPath desc = createString("desc"); //inherited public final BooleanPath disabled = _super.disabled; public final StringPath id = createString("id"); public QRole(String variable) { super(Role.class, forVariable(variable)); } public QRole(Path<? extends Role> path) { super(path.getType(), path.getMetadata()); } public QRole(PathMetadata<?> metadata) { super(Role.class, metadata); } }
przodownikR1/springSecurityKata
src/main/generated/pl/java/scalatech/domain/QRole.java
Java
mit
1,264
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import <iWorkImport/TSKAVPlayerController.h> @class NSArray; // Not exported @interface TSKAVQueuePlayerController : TSKAVPlayerController { NSArray *mAssets; } - (void)p_enqueueAssetsFromIndex:(unsigned long long)arg1; - (void)skipToAssetAtIndex:(unsigned long long)arg1; - (void)playerItemDidPlayToEndTimeAtRate:(float)arg1; - (void)dealloc; - (id)initWithQueuePlayer:(id)arg1 delegate:(id)arg2 assets:(id)arg3 initialAssetIndex:(unsigned long long)arg4; - (id)initWithQueuePlayer:(id)arg1 delegate:(id)arg2 assets:(id)arg3; @end
matthewsot/CocoaSharp
Headers/PrivateFrameworks/iWorkImport/TSKAVQueuePlayerController.h
C
mit
684
function cs() { cd $1 && ls . } # renames tmux pane to cwd # this executes on every tmux commands precmd () { tmux set -qg status-left "#S #P $(pwd)" }
willhs/dotfiles
zsh/functions.zsh
Shell
mit
160
require 'rubygems' unless ENV['NO_RUBYGEMS'] $:.unshift(File.dirname(__FILE__) + '/../lib') require 'riakrest' include RiakRest SERVER_URI = 'http://localhost:8002/jiak'
wcpr/riakrest
examples/example_helper.rb
Ruby
mit
173
number-game =========== This is a refactoring project: I'm taking one of my oldest projects and I'll fix it. The project is a simple numbers game and it was probably a simple programming course assignment during my engineering studies. To build: * scons To run: * ./bin/release/numbergame
denarced/number-game
README.md
Markdown
mit
295
import random rand = random.SystemRandom() def rabinMiller(num): if num % 2 == 0: return False s = num - 1 t = 0 while s % 2 == 0: s = s // 2 t += 1 for trials in range(64): a = rand.randrange(2, num - 1) v = pow(a, s, num) if v != 1: i = 0 while v != (num - 1): if i == t - 1: return False else: i = i + 1 v = (v ** 2) % num return True
Fitzgibbons/Cryptograpy
rabinmiller.py
Python
mit
526
#include "input.h" #include <unistd.h> typedef enum KEY_CODE { ASCII_NULL = 0x00, ASCII_LOWER_Q = 0x71, ASCII_LOWER_P = 0x70, ASCII_LOWER_R = 0x72, ASCII_LOWER_G = 0x67, ASCII_UPPER_A = 0x41, ASCII_UPPER_B = 0x42, ASCII_UPPER_C = 0x43, ASCII_UPPER_D = 0x44, ASCII_SPACE = 0x20, ASCII_ESCAPE = 0x1B, ASCII_SQUARE_BRACKET_LEFT = 0x5B, ASCII_CONTROL_C = 0x03, } KEY_CODE; static KEY_ALIAS get_key_alias(int key_code) { switch (key_code) { case ASCII_LOWER_Q: return KEY_Q; case ASCII_LOWER_P: return KEY_P; case ASCII_LOWER_R: return KEY_R; case ASCII_LOWER_G: return KEY_G; case ASCII_SPACE: return KEY_SPACE; case ASCII_CONTROL_C: return KEY_CONTROL_C; default: return KEY_NONE; } } KEY_ALIAS Input_get_key(int *key_sequence) { int i; for (i = 0; i < 3; ++i) { key_sequence[i] = ASCII_NULL; read(0, &key_sequence[i], 1); key_sequence[i] &= 255; } if (key_sequence[1] == ASCII_NULL && key_sequence[2] == ASCII_NULL ) { return get_key_alias(key_sequence[0]); } else if (key_sequence[0] == ASCII_ESCAPE && key_sequence[1] == ASCII_SQUARE_BRACKET_LEFT ) { if (key_sequence[2] == ASCII_UPPER_D) { return KEY_LEFT; } else if (key_sequence[2] == ASCII_UPPER_C) { return KEY_RIGHT; } else if (key_sequence[2] == ASCII_UPPER_A) { return KEY_UP; } else if (key_sequence[2] == ASCII_UPPER_B) { return KEY_DOWN; } } return KEY_NONE; }
lite-plate/CTetris
input.c
C
mit
1,888
require 'chef/knife/cloud/server/delete_command' require 'chef/knife/oraclepaas_helpers' require 'chef/knife/cloud/oraclepaas_storage_service' class Chef class Knife class Cloud class OraclepaasStorageDelete < ServerDeleteCommand include OraclepaasHelpers banner "knife oraclepaas storage delete (options)" def create_service_instance StorageService.new end def execute_command @name_args.each do |name| service.delete_container(name) puts "Storage container #{name} requested to be deleted\n" end end def validate_params! super errors = check_for_missing_config_values!(:oraclepaas_domain, :oraclepaas_username, :oraclepaas_password) if errors.any? error_message = "The following required parameters are missing: #{errors.join(', ')}" ui.error(error_message) raise CloudExceptions::ValidationError, error_message end end end end end end
Joelith/knife-oraclepaas-0.1.0
lib/chef/knife/oraclepaas_storage_delete.rb
Ruby
mit
1,061
package subscription // 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. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/tracing" "net/http" ) // OperationClient is the the subscription client type OperationClient struct { BaseClient } // NewOperationClient creates an instance of the OperationClient client. func NewOperationClient() OperationClient { return NewOperationClientWithBaseURI(DefaultBaseURI) } // NewOperationClientWithBaseURI creates an instance of the OperationClient client using a custom endpoint. Use this // when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). func NewOperationClientWithBaseURI(baseURI string) OperationClient { return OperationClient{NewWithBaseURI(baseURI)} } // Get get the status of the pending Microsoft.Subscription API operations. // Parameters: // operationID - the operation ID, which can be found from the Location field in the generate recommendation // response header. func (client OperationClient) Get(ctx context.Context, operationID string) (result CreationResult, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OperationClient.Get") defer func() { sc := -1 if result.Response.Response != nil { sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } req, err := client.GetPreparer(ctx, operationID) if err != nil { err = autorest.NewErrorWithError(err, "subscription.OperationClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "subscription.OperationClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "subscription.OperationClient", "Get", resp, "Failure responding to request") return } return } // GetPreparer prepares the Get request. func (client OperationClient) GetPreparer(ctx context.Context, operationID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "operationId": autorest.Encode("path", operationID), } const APIVersion = "2019-10-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/providers/Microsoft.Subscription/subscriptionOperations/{operationId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client OperationClient) GetSender(req *http.Request) (*http.Response, error) { return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. func (client OperationClient) GetResponder(resp *http.Response) (result CreationResult, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return }
Azure/azure-sdk-for-go
services/preview/subscription/mgmt/2019-10-01-preview/subscription/operation.go
GO
mit
3,784
package hudson.plugins.dry.parser.simian; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Random; import hudson.plugins.analysis.util.PackageDetectors; import hudson.plugins.analysis.util.SecureDigester; import hudson.plugins.dry.parser.AbstractDigesterParser; import hudson.plugins.dry.parser.DuplicateCode; /** * A parser for Simian XML files. * * @author Ulli Hafner */ public class SimianParser extends AbstractDigesterParser<Set> { /** Unique ID of this class. */ private static final long serialVersionUID = 6507147028628714706L; /** * Creates a new instance of {@link SimianParser}. * * @param highThreshold * minimum number of duplicate lines for high priority warnings * @param normalThreshold * minimum number of duplicate lines for normal priority warnings */ public SimianParser(final int highThreshold, final int normalThreshold) { super(highThreshold, normalThreshold); } @Override protected String getMatchingPattern() { return "*/simian"; } @Override protected void configureParser(final SecureDigester digester) { String duplicationXPath = "*/simian/check/set"; digester.addObjectCreate(duplicationXPath, Set.class); digester.addSetProperties(duplicationXPath); digester.addSetNext(duplicationXPath, "add"); String fileXPath = duplicationXPath + "/block"; digester.addObjectCreate(fileXPath, Block.class); digester.addSetProperties(fileXPath); digester.addSetNext(fileXPath, "addBlock", Block.class.getName()); } @Override protected Collection<DuplicateCode> convertWarnings(final List<Set> duplications, final String moduleName) { List<DuplicateCode> annotations = new ArrayList<DuplicateCode>(); Random random = new Random(); int number = random.nextInt(); for (Set duplication : duplications) { List<DuplicateCode> codeBlocks = new ArrayList<DuplicateCode>(); for (Block file : duplication.getBlocks()) { DuplicateCode annotation = new DuplicateCode(getPriority(duplication.getLineCount()), file.getStartLineNumber(), duplication.getLineCount(), file.getSourceFile()); annotation.setModuleName(moduleName); codeBlocks.add(annotation); } for (DuplicateCode block : codeBlocks) { block.linkTo(codeBlocks); block.setNumber(number); String packageName = PackageDetectors.detectPackageName(block.getFileName()); block.setPackageName(packageName); } annotations.addAll(codeBlocks); number++; } return annotations; } }
jenkinsci/dry-plugin
src/main/java/hudson/plugins/dry/parser/simian/SimianParser.java
Java
mit
2,831
// This file was generated based on 'C:\ProgramData\Uno\Packages\Outracks.Simulator.Protocol.Uno\0.1.0\Common\$.uno'. // WARNING: Changes might be lost if you edit this file directly. #ifndef __APP_OUTRACKS_SIMULATOR_I_EQUATABLE__OUTRACKS_SIMULATOR_BYTECODE_OPTI_68E3A32D_H__ #define __APP_OUTRACKS_SIMULATOR_I_EQUATABLE__OUTRACKS_SIMULATOR_BYTECODE_OPTI_68E3A32D_H__ #include <app/Uno.Object.h> #include <Uno.h> namespace app { namespace Outracks { namespace Simulator { ::uInterfaceType* IEquatable__Outracks_Simulator_Bytecode_Optional_Outracks_Simulator_Bytecode_NamespaceName___typeof(); struct IEquatable__Outracks_Simulator_Bytecode_Optional_Outracks_Simulator_Bytecode_NamespaceName_ { }; }}} #endif
blyk/BlackCode-Fuse
AndroidUI/.build/Simulator/Android/include/app/Outracks.Simulator.IEquatable__Outracks_Simulator_Bytecode_Opti-68e3a32d.h
C
mit
716
module ProducedItemWarehousex VERSION = "3.2.12.01" end
emclab/produced_item_warehousex
lib/produced_item_warehousex/version.rb
Ruby
mit
58
<?php /* * * * */ namespace pfp\components { require_once 'CaptchaException.php'; require_once 'SimpleCaptcha/SimpleCaptcha.php'; /** * Description of Captcha * * @author Zeakis George <zeageorge@gmail.com> */ class Captcha extends Captcha\SimpleCaptcha { public function __construct(array $config = []) { parent::__construct($config); } } }
zeageorge/phpFrameworkProject
pfp/framework/components/Captcha/Captcha.php
PHP
mit
457
<?php namespace AppBundle\Tests; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Component\HttpFoundation\Response; class CategoryEntityTest extends WebTestCase { public function testListViewPageTitle() { $client = static::createClient(); $crawler = $client->request('GET', '/admin/?entity=Category&action=list&view=list'); $this->assertEquals('Product Categories', trim($crawler->filter('h1.title')->text())); } public function testListViewSearchAction() { $this->markTestSkipped("It requires the latest not-yet-released stable version"); $hiddenParameters = array( 'view' => 'list', 'action' => 'search', 'entity' => 'Category', 'sortField' => 'id', 'sortDirection' => 'DESC', ); $client = static::createClient(); $crawler = $client->request('GET', '/admin/?entity=Category&action=list&view=list'); $this->assertEquals('Look for Categories', $crawler->filter('#content-search input[type=search]')->attr('placeholder')); $i = 0; foreach ($hiddenParameters as $name => $value) { $this->assertEquals($name, $crawler->filter('#content-search input[type=hidden]')->eq($i)->attr('name')); $this->assertEquals($value, $crawler->filter('#content-search input[type=hidden]')->eq($i)->attr('value')); $i++; } } public function testListViewNewAction() { $client = static::createClient(); $crawler = $client->request('GET', '/admin/?entity=Category&action=list&view=list'); $this->assertEquals('New Categories', trim($crawler->filter('#content-actions a.btn')->text())); $this->assertEquals('fa fa-plus-circle', $crawler->filter('#content-actions a.btn i')->attr('class')); $this->assertEquals('/admin/?entity=Category&action=new&view=list', $crawler->filter('#content-actions a.btn')->attr('href')); } public function testListViewTableIdColumn() { $client = static::createClient(); $crawler = $client->request('GET', '/admin/?entity=Category&action=list&view=list'); $this->assertEquals('ID', trim($crawler->filter('table th[data-property-name="id"]')->text()), 'The ID entity property is very special and we uppercase it automatically to improve its readability.' ); } public function testListViewTableColumnLabels() { $columnLabels = array('ID', 'Label', 'Parent category', 'Actions'); $client = static::createClient(); $crawler = $client->request('GET', '/admin/?entity=Category&action=list&view=list'); foreach ($columnLabels as $i => $label) { $this->assertEquals($label, trim($crawler->filter('.table thead th')->eq($i)->text())); } } public function testListViewTableColumnAttributes() { $columnAttributes = array('id', 'name', 'parent'); $client = static::createClient(); $crawler = $client->request('GET', '/admin/?entity=Category&action=list&view=list'); foreach ($columnAttributes as $i => $attribute) { $this->assertEquals($attribute, trim($crawler->filter('.table thead th')->eq($i)->attr('data-property-name'))); } } public function testListViewDefaultTableSorting() { $client = static::createClient(); $crawler = $client->request('GET', '/admin/?entity=Category&action=list&view=list'); $this->assertCount(1, $crawler->filter('.table thead th[class*="sorted"]'), 'Table is sorted only by one column.'); $this->assertEquals('ID', trim($crawler->filter('.table thead th[class*="sorted"]')->text()), 'By default, table is soreted by ID column.'); $this->assertEquals('fa fa-caret-down', $crawler->filter('.table thead th[class*="sorted"] i')->attr('class'), 'The column used to sort results shows the right icon.'); } public function testListViewTableContents() { $client = static::createClient(); $crawler = $client->request('GET', '/admin/?entity=Category&action=list&view=list'); $this->assertCount(15, $crawler->filter('.table tbody tr')); } public function testListViewTableRowAttributes() { $columnAttributes = array('ID', 'Label', 'Parent category'); $client = static::createClient(); $crawler = $client->request('GET', '/admin/?entity=Category&action=list&view=list'); foreach ($columnAttributes as $i => $attribute) { $this->assertEquals($attribute, trim($crawler->filter('.table tbody tr td')->eq($i)->attr('data-label'))); } } public function testListViewPagination() { $client = static::createClient(); $crawler = $client->request('GET', '/admin/?entity=Category&action=list&view=list'); $this->assertContains('1 - 15 of 200', $crawler->filter('.list-pagination')->text()); $this->assertEquals('disabled', $crawler->filter('.list-pagination li:contains("First")')->attr('class')); $this->assertEquals('disabled', $crawler->filter('.list-pagination li:contains("Previous")')->attr('class')); $this->assertEquals('/admin/?view=list&action=list&entity=Category&sortDirection=DESC&sortField=id&page=2', $crawler->filter('.list-pagination li a:contains("Next")')->attr('href')); $this->assertEquals('/admin/?view=list&action=list&entity=Category&sortDirection=DESC&sortField=id&page=14', $crawler->filter('.list-pagination li a:contains("Last")')->attr('href')); } }
ogizanagi/easy-admin-demo
src/AppBundle/Tests/CategoryEntityTest.php
PHP
mit
5,599
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> #import "GADBannerViewDelegate.h" #import "GADInterstitialDelegate.h" #import "GADBannerView.h" #import "GADInterstitial.h" #import "GADAdMobExtras.h" #import "GADAdSize.h" #define OPT_BANNER_ID @"bannerId" #define OPT_AD_SIZE @"adSize" #define OPT_AD_WIDTH @"width" #define OPT_AD_HEIGHT @"height" #define OPT_POSITION @"position" #define OPT_X @"x" #define OPT_Y @"y" #define OPT_INTERSTITIAL_ID @"interstitialId" #define OPT_IS_TESTING @"isTesting" #define OPT_AUTO_SHOW @"autoShow" #define OPT_AD_EXTRAS @"adExtras" #define OPT_ORIENTATION_RENEW @"orientationRenew" #define OPT_OVERLAP @"overlap" enum { POS_NO_CHANGE = 0, POS_TOP_LEFT = 1, POS_TOP_CENTER = 2, POS_TOP_RIGHT = 3, POS_LEFT = 4, POS_CENTER = 5, POS_RIGHT = 6, POS_BOTTOM_LEFT = 7, POS_BOTTOM_CENTER = 8, POS_BOTTOM_RIGHT = 9, POS_XY = 10 }; @protocol AdMobEventDelegate <NSObject> @required -(UIView*) getView; -(UIViewController*) getViewController; -(void) onEvent:(NSString*) eventType withData:(NSString*) jsonString; @end @interface AdMobAds : NSObject<GADBannerViewDelegate, GADInterstitialDelegate> - (AdMobAds*) init:(id<AdMobEventDelegate>) theDelegate; - (void) setOptions:(NSDictionary*) options; - (void) createBanner:(NSString*)adId; - (void) showBanner:(int)position; - (void) showBannerAtX:(int)x withY:(int)y; - (void) hideBanner; - (void) removeBanner; - (void) prepareInterstitial:(NSString*)adId; - (BOOL) isInterstitialReady; - (void) showInterstitial; @end
floatinghotpot/cordova-admob-xdk
src/ios/AdMobAds.framework/Headers/AdMobAds.h
C
mit
1,762
using System; using CompositeC1Contrib.Email.GoogleAnalytics; namespace CompositeC1Contrib.Email { public static class BootstrapperConfigurationExtensions { private static GoogleAnalyticsEventsProcessor _processor; public static void UseGoogleAnalytics(this IBootstrapperConfiguration config, GoogleAnalyticsEventsProcessorOptions options) { if (_processor != null) { throw new InvalidOperationException("Processor already initialized"); } _processor = new GoogleAnalyticsEventsProcessor(config, options); } } }
burningice2866/CompositeC1Contrib.Email
Email.GoogleAnalytics/BootstrapperConfigurationExtensions.cs
C#
mit
648
const concat = require('concat-stream') const test = require('tape') const fs = require('fs') const gherkin = require('../') test('should assert input types', function (t) { t.plan(3) const rs = fs.createReadStream(__dirname + '/file.feature') const ts = gherkin() const ws = concat({ object: true }, function (buf) { const ast = JSON.parse(buf.toString()) t.equal(typeof ast, 'object') t.deepEqual(ast, [ { perspective: 'drinker', feature: 'Can drink beer when thirsty', desire: 'to take beer off the wall', reason: 'to satisfy my thirst', scenarios: [ { given: [ '100 bottles of beer on the wall' ], scenario: 'Can take a single beer', then: [ 'there are 99 bottles of beer on the wall' ], when: [ 'a bottle is taken down' ] } ] } ]) }) ts.on('end', t.pass.bind('null', 'stream ended')) rs.pipe(ts).pipe(ws) })
yoshuawuyts/gherkin-parser
test/index.js
JavaScript
mit
916
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package kroki.app.action.style; import java.awt.Font; import java.awt.event.ActionEvent; import javax.swing.AbstractAction; import javax.swing.ImageIcon; import kroki.app.KrokiMockupToolApp; import kroki.app.model.SelectionModel; import kroki.app.utils.ImageResource; import kroki.app.utils.StringResource; import kroki.app.view.Canvas; import kroki.profil.VisibleElement; /** * * @author Vladan Marsenić (vladan.marsenic@gmail.com) */ public class FontBoldAction extends AbstractAction { public FontBoldAction() { ImageIcon smallIcon = new ImageIcon(ImageResource.getImageResource("action.bold.smallImage")); putValue(SMALL_ICON, smallIcon); //putValue(NAME, StringResource.getStringResource("action.openColorText.name")); putValue(SHORT_DESCRIPTION, StringResource.getStringResource("action.bold.description")); } public void actionPerformed(ActionEvent e) { Canvas c = KrokiMockupToolApp.getInstance().getTabbedPaneController().getCurrentTabContent(); if (c == null) { return; } SelectionModel selectionModel = c.getSelectionModel(); for (VisibleElement visibleElement : selectionModel.getVisibleElementList()) { Font oldFont = visibleElement.getComponent().getFont(); if (oldFont.isBold()) { visibleElement.getComponent().setFont(new Font(oldFont.getFamily(), Font.PLAIN, oldFont.getSize())); } else { visibleElement.getComponent().setFont(new Font(oldFont.getFamily(), Font.BOLD, oldFont.getSize())); } visibleElement.update(); } c.repaint(); } }
VladimirRadojcic/Master
KrokiMockupTool/src/kroki/app/action/style/FontBoldAction.java
Java
mit
1,769
"""Tests exceptions and DB-API exception wrapping.""" from sqlalchemy import exc as sa_exceptions from sqlalchemy.test import TestBase # Py3K #StandardError = BaseException # Py2K from exceptions import StandardError, KeyboardInterrupt, SystemExit # end Py2K class Error(StandardError): """This class will be old-style on <= 2.4 and new-style on >= 2.5.""" class DatabaseError(Error): pass class OperationalError(DatabaseError): pass class ProgrammingError(DatabaseError): def __str__(self): return "<%s>" % self.bogus class OutOfSpec(DatabaseError): pass class WrapTest(TestBase): def test_db_error_normal(self): try: raise sa_exceptions.DBAPIError.instance( '', [], OperationalError()) except sa_exceptions.DBAPIError: self.assert_(True) def test_tostring(self): try: raise sa_exceptions.DBAPIError.instance( 'this is a message', None, OperationalError()) except sa_exceptions.DBAPIError, exc: assert str(exc) == "(OperationalError) 'this is a message' None" def test_tostring_large_dict(self): try: raise sa_exceptions.DBAPIError.instance( 'this is a message', {'a':1, 'b':2, 'c':3, 'd':4, 'e':5, 'f':6, 'g':7, 'h':8, 'i':9, 'j':10, 'k':11}, OperationalError()) except sa_exceptions.DBAPIError, exc: assert str(exc).startswith("(OperationalError) 'this is a message' {") def test_tostring_large_list(self): try: raise sa_exceptions.DBAPIError.instance( 'this is a message', [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], OperationalError()) except sa_exceptions.DBAPIError, exc: assert str(exc).startswith("(OperationalError) 'this is a message' [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]") def test_tostring_large_executemany(self): try: raise sa_exceptions.DBAPIError.instance( 'this is a message', [{1:1},{1:1},{1:1},{1:1},{1:1},{1:1},{1:1},{1:1},{1:1},{1:1},], OperationalError()) except sa_exceptions.DBAPIError, exc: assert str(exc) == "(OperationalError) 'this is a message' [{1: 1}, {1: 1}, {1: 1}, {1: 1}, {1: 1}, {1: 1}, {1: 1}, {1: 1}, {1: 1}, {1: 1}]", str(exc) try: raise sa_exceptions.DBAPIError.instance( 'this is a message', [{1:1},{1:1},{1:1},{1:1},{1:1},{1:1},{1:1},{1:1},{1:1},{1:1},{1:1},], OperationalError()) except sa_exceptions.DBAPIError, exc: assert str(exc) == "(OperationalError) 'this is a message' [{1: 1}, {1: 1}] ... and a total of 11 bound parameter sets" try: raise sa_exceptions.DBAPIError.instance( 'this is a message', [(1,), (1,), (1,), (1,), (1,), (1,), (1,), (1,), (1,), (1,)], OperationalError()) except sa_exceptions.DBAPIError, exc: assert str(exc) == "(OperationalError) 'this is a message' [(1,), (1,), (1,), (1,), (1,), (1,), (1,), (1,), (1,), (1,)]" try: raise sa_exceptions.DBAPIError.instance( 'this is a message', [(1,), (1,), (1,), (1,), (1,), (1,), (1,), (1,), (1,), (1,), (1,), ], OperationalError()) except sa_exceptions.DBAPIError, exc: assert str(exc) == "(OperationalError) 'this is a message' [(1,), (1,)] ... and a total of 11 bound parameter sets" def test_db_error_busted_dbapi(self): try: raise sa_exceptions.DBAPIError.instance( '', [], ProgrammingError()) except sa_exceptions.DBAPIError, e: self.assert_(True) self.assert_('Error in str() of DB-API' in e.args[0]) def test_db_error_noncompliant_dbapi(self): try: raise sa_exceptions.DBAPIError.instance( '', [], OutOfSpec()) except sa_exceptions.DBAPIError, e: self.assert_(e.__class__ is sa_exceptions.DBAPIError) except OutOfSpec: self.assert_(False) # Make sure the DatabaseError recognition logic is limited to # subclasses of sqlalchemy.exceptions.DBAPIError try: raise sa_exceptions.DBAPIError.instance( '', [], sa_exceptions.ArgumentError()) except sa_exceptions.DBAPIError, e: self.assert_(e.__class__ is sa_exceptions.DBAPIError) except sa_exceptions.ArgumentError: self.assert_(False) def test_db_error_keyboard_interrupt(self): try: raise sa_exceptions.DBAPIError.instance( '', [], KeyboardInterrupt()) except sa_exceptions.DBAPIError: self.assert_(False) except KeyboardInterrupt: self.assert_(True) def test_db_error_system_exit(self): try: raise sa_exceptions.DBAPIError.instance( '', [], SystemExit()) except sa_exceptions.DBAPIError: self.assert_(False) except SystemExit: self.assert_(True)
obeattie/sqlalchemy
test/base/test_except.py
Python
mit
5,046
/* DASHBOARDS */ Router.route('/', { name: 'sitesIndex', controller: SitesController, action: 'index', }); /* EOF DASHBOARDS */
ShawnSantiago/BlogApp
packages/meteoris-core/client/routers/sites.js
JavaScript
mit
139
// // file : pipeline_multisample_state.hpp // in : file:///home/tim/projects/hydra/hydra/vulkan/pipeline_multisample_state.hpp // // created by : Timothée Feuillet // date: Sat Aug 13 2016 13:55:53 GMT+0200 (CEST) // // // Copyright (c) 2016 Timothée Feuillet // // 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. // #ifndef __N_16252281432830929027_2391312862_PIPELINE_MULTISAMPLE_STATE_HPP__ #define __N_16252281432830929027_2391312862_PIPELINE_MULTISAMPLE_STATE_HPP__ #include <vulkan/vulkan.h> namespace neam { namespace hydra { namespace vk { /// \brief Wraps VkPipelineMultisampleStateCreateInfo class pipeline_multisample_state { public: /// \brief Default constructor disables multisampling pipeline_multisample_state() : vk_pmsci { VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO, nullptr, 0, VK_SAMPLE_COUNT_1_BIT, // rasterizationSamples VK_FALSE, // sampleShadingEnable 1.f, // minSampleShading nullptr, // pSampleMask VK_FALSE, // alphaToCoverageEnable VK_FALSE, // alphaToOneEnable } { } /// \brief Construct a multisample state object with multisampling activated explicit pipeline_multisample_state(VkSampleCountFlagBits samples) : vk_pmsci { VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO, nullptr, 0, samples, // rasterizationSamples VK_FALSE, // sampleShadingEnable 0.f, // minSampleShading nullptr, // pSampleMask VK_FALSE, // alphaToCoverageEnable VK_FALSE, // alphaToOneEnable } { } /// \brief Copy constructor pipeline_multisample_state(const pipeline_multisample_state &o) : vk_pmsci(o.vk_pmsci) {} /// \brief Copy operator pipeline_multisample_state &operator = (const pipeline_multisample_state &o) { vk_pmsci = o.vk_pmsci; return *this; } /// \brief Copy constructor pipeline_multisample_state(const VkPipelineMultisampleStateCreateInfo &o) : vk_pmsci(o) { vk_pmsci.sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO; vk_pmsci.pNext = nullptr; vk_pmsci.flags = 0; } /// \brief Copy operator pipeline_multisample_state &operator = (const VkPipelineMultisampleStateCreateInfo &o) { vk_pmsci = o; vk_pmsci.sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO; vk_pmsci.pNext = nullptr; vk_pmsci.flags = 0; return *this; } /// \brief Disable the multisampling void disable_multisampling() { vk_pmsci.minSampleShading = 1.f; // FIXME: does that mean anything ?? vk_pmsci.rasterizationSamples = VK_SAMPLE_COUNT_1_BIT; } /// \brief Set the multisampling sample count (enable multisampling if samples != VK_SAMPLE_COUNT_1_BIT) void set_sample_count(VkSampleCountFlagBits samples) { vk_pmsci.minSampleShading = samples == VK_SAMPLE_COUNT_1_BIT ? 0.f : 1.f; // FIXME: does that mean anything ?? vk_pmsci.rasterizationSamples = samples; } /// \brief Return the multisampling sample count VkSampleCountFlagBits get_sample_count() const { return vk_pmsci.rasterizationSamples; } public: // advanced /// \brief Yield a VkPipelineMultisampleStateCreateInfo operator const VkPipelineMultisampleStateCreateInfo &() { return vk_pmsci; } private: VkPipelineMultisampleStateCreateInfo vk_pmsci; }; } // namespace vk } // namespace hydra } // namespace neam #endif // __N_16252281432830929027_2391312862_PIPELINE_MULTISAMPLE_STATE_HPP__
tim42/hydra
hydra/vulkan/pipeline_multisample_state.hpp
C++
mit
5,076
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Tydeus.Data; using System.Data; using System.Data.SqlClient; namespace Tydeus.Test { class Program { static void Main(string[] args) { Import import = new Import(); //import.ImportTeacherToUser(); import.ImportTeacherToTeacher(); } } }
robertzml/Tydeus
Tydeus.Test/Program.cs
C#
mit
435
/* * 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 org.jcodings.specific; public final class NonStrictSJISEncoding extends BaseSJISEncoding { protected NonStrictSJISEncoding() { super("Shift_JIS", null); } @Override public int length(byte[]bytes, int p, int end) { return length(bytes[p]); } public static final NonStrictSJISEncoding INSTANCE = new NonStrictSJISEncoding(); }
jruby/jcodings
src/org/jcodings/specific/NonStrictSJISEncoding.java
Java
mit
1,456
<?php namespace buycraft; use buycraft\commands\BuyCommand; use buycraft\commands\BuyCraftCommand; use buycraft\packages\PackageManager; use buycraft\task\AuthenticateTask; use buycraft\task\CommandDeleteTask; use buycraft\task\CommandExecuteTask; use buycraft\task\PendingPlayerCheckerTask; use buycraft\util\BuycraftCommandSender; use pocketmine\plugin\PluginBase; class BuyCraft extends PluginBase{ /* * If you want to turn debugging on set this to true. */ const IS_DEBUGGING = false; private $isAuthenticated = false; /** @var CommandExecuteTask */ private $commandExecuteTask; /** @var PendingPlayerCheckerTask */ private $pendingPlayerCheckerTask; /** @var CommandDeleteTask */ private $commandDeleteTask; /** @var BuyCraftCommand */ private $buycraftCommand; /** @var BuyCommand */ private $buyCommand; /** @var BuycraftCommandSender */ private $commandSender; /** @var PackageManager */ private $packageManager; /** @var array */ private $authPayload = []; public function onEnable(){ $this->saveDefaultConfig(); $this->saveResource("README.md"); $this->getConfig(); //Fetch the config so no blocking later $this->commandSender = new BuycraftCommandSender; $this->commandExecuteTask = new CommandExecuteTask($this); $this->pendingPlayerCheckerTask = new PendingPlayerCheckerTask($this); $this->commandDeleteTask = new CommandDeleteTask($this); $this->commandExecuteTask->call(); $this->pendingPlayerCheckerTask->call(); $this->commandDeleteTask->call(); $this->packageManager = new PackageManager($this); $this->buyCommand = new BuyCommand($this); $this->buycraftCommand = new BuyCraftCommand($this); $this->getServer()->getCommandMap()->register("buycraft", $this->buycraftCommand); $this->getServer()->getCommandMap()->register("buycraft", $this->buyCommand); if($this->getConfig()->get('secret') !== ""){ $auth = new AuthenticateTask($this); $auth->call(); } else{ $this->getLogger()->info("You still need to configure BuyCraft. Use /buycraft secret or the config.yml to set your secret."); } } public function onDisable(){ $this->commandDeleteTask->onRun(0); } /** * @return CommandDeleteTask */ public function getCommandDeleteTask(){ return $this->commandDeleteTask; } /** * @return CommandExecuteTask */ public function getCommandExecuteTask(){ return $this->commandExecuteTask; } /** * @return PendingPlayerCheckerTask */ public function getPendingPlayerCheckerTask(){ return $this->pendingPlayerCheckerTask; } /** * @return BuyCommand */ public function getBuyCommand(){ return $this->buyCommand; } /** * @return BuyCraftCommand */ public function getBuycraftCommand(){ return $this->buycraftCommand; } /** * @return BuycraftCommandSender */ public function getCommandSender(){ return $this->commandSender; } /** * @return PackageManager */ public function getPackageManager(){ return $this->packageManager; } /** * @return bool */ public function isAuthenticated(){ return $this->isAuthenticated; } public function setAuthenticated(){ $this->isAuthenticated = true; } public function setUnAuthenticated(){ $this->isAuthenticated = false; } public function setAuthPayload(array $authPayload){ if(isset($authPayload["buyCommand"])){ $this->buyCommand->updateCommand($authPayload["buyCommand"]); } $this->authPayload = $authPayload; } public function getAuthPayload(){ return $this->authPayload; } public function getAuthPayloadSetting($name){ return (isset($this->authPayload[$name]) ? $this->authPayload[$name] : false); } }
Falkirks/BuyCraft
src/buycraft/BuyCraft.php
PHP
mit
4,109
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("InsuranceApp.Core")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("InsuranceApp.Core")] [assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("ab7a076a-3075-4c32-a074-9781c2c94564")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
davidlubomirov/Black-Russian
InsuranceApp/InsuranceApp.Core/Properties/AssemblyInfo.cs
C#
mit
1,410
/*====================================================================* - Copyright (C) 2001 Leptonica. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. 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. - - 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 ANY - 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. *====================================================================*/ /* * sharptest.c * * sharptest filein smooth fract fileout * * (1) Use smooth = 1 for 3x3 smoothing filter * smooth = 2 for 5x5 smoothing filter, etc. * (2) Use fract in typical range (0.2 - 0.7) */ #include "allheaders.h" int main(int argc, char **argv) { PIX *pixs, *pixd; l_int32 smooth; l_float32 fract; char *filein, *fileout; static char mainName[] = "sharptest"; if (argc != 5) return ERROR_INT(" Syntax: sharptest filein smooth fract fileout", mainName, 1); filein = argv[1]; smooth = atoi(argv[2]); fract = atof(argv[3]); fileout = argv[4]; setLeptDebugOK(1); if ((pixs = pixRead(filein)) == NULL) return ERROR_INT("pixs not made", mainName, 1); pixd = pixUnsharpMasking(pixs, smooth, fract); pixWrite(fileout, pixd, IFF_JFIF_JPEG); pixDestroy(&pixs); pixDestroy(&pixd); return 0; }
doo/Tesseract-OCR-iOS
TesseractOCR/Leptonica/leptonica-sources/prog/sharptest.c
C
mit
2,476
/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the Qt Quick Templates 2 module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL3$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see http://www.qt.io/terms-conditions. For further ** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPLv3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or later as published by the Free ** Software Foundation and appearing in the file LICENSE.GPL included in ** the packaging of this file. Please review the following information to ** ensure the GNU General Public License version 2.0 requirements will be ** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QQUICKROUNDBUTTON_P_H #define QQUICKROUNDBUTTON_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include <QtQuickTemplates2/private/qquickbutton_p.h> QT_BEGIN_NAMESPACE class QQuickRoundButtonPrivate; class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickRoundButton : public QQuickButton { Q_OBJECT Q_PROPERTY(qreal radius READ radius WRITE setRadius RESET resetRadius NOTIFY radiusChanged FINAL) public: explicit QQuickRoundButton(QQuickItem *parent = nullptr); qreal radius() const; void setRadius(qreal radius); void resetRadius(); Q_SIGNALS: void radiusChanged(); protected: void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override; private: Q_DISABLE_COPY(QQuickRoundButton) Q_DECLARE_PRIVATE(QQuickRoundButton) }; QT_END_NAMESPACE QML_DECLARE_TYPE(QQuickRoundButton) #endif // QQUICKROUNDBUTTON_P_H
kecho/Pegasus
Lib/Qt/5.8/include/QtQuickTemplates2/5.8.0/QtQuickTemplates2/private/qquickroundbutton_p.h
C
mit
2,824
namespace AuthenticodeLint.Core { public enum SignatureAlgorithm { Rsa, Ecc } }
vcsjones/AuthenticodeLint.Core
src/AuthenticodeLint.Core/SignatureAlgorithm.cs
C#
mit
107
<!DOCTYPE html> <html xmlns:msxsl="urn:schemas-microsoft-com:xslt"> <head> <meta content="en-us" http-equiv="Content-Language" /> <meta content="text/html; charset=utf-16" http-equiv="Content-Type" /> <title _locid="PortabilityAnalysis0">.NET Portability Report</title> <style> /* Body style, for the entire document */ body { background: #F3F3F4; color: #1E1E1F; font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; padding: 0; margin: 0; } /* Header1 style, used for the main title */ h1 { padding: 10px 0px 10px 10px; font-size: 21pt; background-color: #E2E2E2; border-bottom: 1px #C1C1C2 solid; color: #201F20; margin: 0; font-weight: normal; } /* Header2 style, used for "Overview" and other sections */ h2 { font-size: 18pt; font-weight: normal; padding: 15px 0 5px 0; margin: 0; } /* Header3 style, used for sub-sections, such as project name */ h3 { font-weight: normal; font-size: 15pt; margin: 0; padding: 15px 0 5px 0; background-color: transparent; } h4 { font-weight: normal; font-size: 12pt; margin: 0; padding: 0 0 0 0; background-color: transparent; } /* Color all hyperlinks one color */ a { color: #1382CE; } /* Paragraph text (for longer informational messages) */ p { font-size: 10pt; } /* Table styles */ table { border-spacing: 0 0; border-collapse: collapse; font-size: 10pt; } table th { background: #E7E7E8; text-align: left; text-decoration: none; font-weight: normal; padding: 3px 6px 3px 6px; } table td { vertical-align: top; padding: 3px 6px 5px 5px; margin: 0px; border: 1px solid #E7E7E8; background: #F7F7F8; } .NoBreakingChanges { color: darkgreen; font-weight:bold; } .FewBreakingChanges { color: orange; font-weight:bold; } .ManyBreakingChanges { color: red; font-weight:bold; } .BreakDetails { margin-left: 30px; } .CompatMessage { font-style: italic; font-size: 10pt; } .GoodMessage { color: darkgreen; } /* Local link is a style for hyperlinks that link to file:/// content, there are lots so color them as 'normal' text until the user mouse overs */ .localLink { color: #1E1E1F; background: #EEEEED; text-decoration: none; } .localLink:hover { color: #1382CE; background: #FFFF99; text-decoration: none; } /* Center text, used in the over views cells that contain message level counts */ .textCentered { text-align: center; } /* The message cells in message tables should take up all avaliable space */ .messageCell { width: 100%; } /* Padding around the content after the h1 */ #content { padding: 0px 12px 12px 12px; } /* The overview table expands to width, with a max width of 97% */ #overview table { width: auto; max-width: 75%; } /* The messages tables are always 97% width */ #messages table { width: 97%; } /* All Icons */ .IconSuccessEncoded, .IconInfoEncoded, .IconWarningEncoded, .IconErrorEncoded { min-width: 18px; min-height: 18px; background-repeat: no-repeat; background-position: center; } /* Success icon encoded */ .IconSuccessEncoded { /* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */ /* [---XsltValidateInternal-Base64EncodedImage:IconSuccess#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABPElEQVR4Xp1Tv0vDUBi8FqeA4NpBcBLcWnQSApncOnTo4FSnjP0DsnXpH5CxiwbHDg4Zuj4oOEXiJgiC4FDcCkLWmIMc1Pfw+eMgQ77v3Xf3Pe51YKGqqisAEwCR1TIAsiAIblSo6xrdHeJR85Xle3mdmCQKb0PsfqyxxzM8K15HZADl/H5+sHpZwYfxyRjTs+kWwKBx8yoHd2mRiuzF8mkJniWH/13u3Fjrs/EdhsdDFHGB/DLXEJBDLh1MWPAhPo1BLB4WX5yQywHR+m3tVe/t97D52CB/ziG0nIgD/qDuYg8WuCcVZ2YGwlJ3YDugkpR/VNcAEx6GEKhERSr71FuO4YCM4XBdwKvecjIlkSnsO0Hyp/GxSeJAdzBKzpOtnPwyyiPdAZhpZptT04tU+zk7s8czeges//s5C5+CwqrR4/gw+AAAAABJRU5ErkJggg==); } /* Information icon encoded */ .IconInfoEncoded { /* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */ /* [---XsltValidateInternal-Base64EncodedImage:IconInformation#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABHElEQVR4Xs2TsUoDQRRF7wwoziokjZUKadInhdhukR9YP8DMX1hYW+QvdsXa/QHBbcXC7W0CamWTQnclFutceIQJwwaWNLlwm5k5d94M76mmaeCrrmsLYOocY12FcxZFUeozCqKqqgYA8uevv1H6VuPxcwlfk5N92KHBxfFeCSAxxswlYAW/Xr989x/mv9gkhtyMDhcAxgzRsp7flj8B/HF1RsMXq+NZMkopaHe7lbKxQUEIGbKsYNoGn969060hZBkQex/W8oRQwsQaW2o3Ago2SVcJUzAgY3N0lTCZZm+zPS8HB51gMmS1DEYyOz9acKO1D8JWTlafKIMxdhvlfdyT94Vv5h7P8Ky7nQzACmhvKq3zk3PjW9asz9D/1oigecsioooAAAAASUVORK5CYII=); } /* Warning icon encoded */ .IconWarningEncoded { /* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */ /* [---XsltValidateInternal-Base64EncodedImage:IconWarning#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAx0lEQVR4XpWSMQ7CMAxFf4xAyBMLCxMrO8dhaBcuwdCJS3RJBw7SA/QGTCxdWJgiQYWKXJWKIXHIlyw5lqr34tQgEOdcBsCOx5yZK3hCCKdYXneQkh4pEfqzLfu+wVDSyyzFoJjfz9NB+pAF+eizx2Vruts0k15mPgvS6GYvpVtQhB61IB/dk6AF6fS4Ben0uIX5odtFe8Q/eW1KvFeH4e8khT6+gm5B+t3juyDt7n0jpe+CANTd+oTUjN/U3yVaABnSUjFz/gFq44JaVSCXeQAAAABJRU5ErkJggg==); } /* Error icon encoded */ .IconErrorEncoded { /* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */ /* [---XsltValidateInternal-Base64EncodedImage:IconError#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABQElEQVR4XqWTvUoEQRCE6wYPZUA80AfwAQz23uCMjA7MDRQEIzPBVEyNTQUFIw00vcQTTMzuAh/AxEQQT8HF/3G/oGGnEUGuoNnd6qoZuqltyKEsyzVJq5I6rnUp6SjGeGhESikzzlc1eL7opfuVbrqbU1Zw9NCgtQMaZpY0eNnaaL2fHusvTK5vKu7sjSS1Y4y3QUA6K3e3Mau5UFDyMP7tYF9o8cAHZv68vipoIJg971PZIZ5HiwdvYGGvFVFHmGmZ2MxwmQYPXubPl9Up0tfoMQGetXd6mRbvhBw+boZ6WF7Mbv1+GsHRk0fQmPAH1GfmZirbCfDJ61tw3Px8/8pZsPAG4jlVhcPgZ7adwNWBB68lkRQWFiTgFlbnLY3DGGM7izIJIyT/jjIvEJw6fdJTc6krDzh6aMwMP9bvDH4ADSsa9uSWVJkAAAAASUVORK5CYII=); } </style> </head> <body> <h1 _locid="PortabilityReport">.NET Portability Report</h1> <div id="content"> <div id="submissionId" style="font-size:8pt;"> <p> <i> Submission Id&nbsp; cd4a1026-a948-43d5-b0cf-dbb5484c0c9d </i> </p> </div> <h2 _locid="SummaryTitle"> <a name="Portability Summary"></a>Portability Summary </h2> <div id="summary"> <table> <tbody> <tr> <th>Assembly</th> <th>ASP.NET 5,Version=v1.0</th> <th>Windows,Version=v8.1</th> <th>.NET Framework,Version=v4.6</th> <th>Windows Phone,Version=v8.1</th> </tr> <tr> <td><strong><a href="#TCD.Commerce">TCD.Commerce</a></strong></td> <td class="text-center">97.38 %</td> <td class="text-center">100.00 %</td> <td class="text-center">98.69 %</td> <td class="text-center">100.00 %</td> </tr> </tbody> </table> </div> <div id="details"> <a name="TCD.Commerce"><h3>TCD.Commerce</h3></a> <table> <tbody> <tr> <th>Target type</th> <th>ASP.NET 5,Version=v1.0</th> <th>Windows,Version=v8.1</th> <th>.NET Framework,Version=v4.6</th> <th>Windows Phone,Version=v8.1</th> <th>Recommended changes</th> </tr> <tr> <td>System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken</td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconSuccessEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal</td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconSuccessEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">AddEventHandler``1(System.Func{``0,System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken},System.Action{System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken},``0)</td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconSuccessEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.WindowsRuntimeSystemExtensions</td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">GetAwaiter``1(Windows.Foundation.IAsyncOperation{``0})</td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>Windows.Foundation.Rect</td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> </tbody> </table> <p> <a href="#Portability Summary">Back to Summary</a> </p> </div> </div> </body> </html>
kuhlenh/port-to-core
Reports/tc/tcd.commerce.0.0.4/TCD.Commerce-netcore45.html
HTML
mit
14,734
/// <reference path="../../dependencies.ts" /> /** * Business layer for tags */ interface ITagBusiness { isValueValid(value : string) : boolean; // compare(newLabel : string, exisitingLabel : string) : boolean; add(tag : Tag, callback? : Action<Tag>, errorHandler? : Action<string>) : void; /** * Adds a list of tags into DB * @param {IList<Tag>} tags [description] * @param {Action<IList<Tag>>} callback Callback with new tags as argument */ addList(tags : IList<Tag>, callback? : Action<IList<Tag>>, errorHandler? : Action<string>) : void; // TODO : test update(tag : Tag, callback? : Action<Tag>, errorHandler? : Action<string>) : void; /** * Deletes a tag from DB * @param {Tag} tag [description] * @param {Action<boolean>} callback Callback with a succeed arg */ delete(tag : Tag, callback? : Action0, errorHandler? : Action<string>) : void; // TODO : test find(id : string, callback : Action<Tag>, errorHandler? : Action<string>) : void; /** * From specified tag list, adds new ones into DB and do nothing * with other ones. Used labels to compare * @param {IList<Tag>} tags [description] * @param {Action<IList<Tag>>} callback Callback with new tags updated. All tags are into DB */ merge(tags : IList<Tag>, callback? : Action<IList<Tag>>, errorHandler? : Action<string>) : void; sortByLabelAsc(callback : Action<IList<Tag>>, errorHandler? : Action<string>) : void; }
acadet/yimello
app/models/business/ITagBusiness.ts
TypeScript
mit
1,464
logparser-php-elasticsearch ============================ Trying to make a log parser to push data to Elasticsearch
franckbrunet/logparser-php-elasticsearch
README.md
Markdown
mit
116
//this source code was auto-generated by tolua#, do not modify it using System; using LuaInterface; public class LuaFramework_PanelManagerWrap { public static void Register(LuaState L) { L.BeginClass(typeof(LuaFramework.PanelManager), typeof(Manager)); L.RegFunction("CreatePanel", CreatePanel); L.RegFunction("ClosePanel", ClosePanel); L.RegFunction("__eq", op_Equality); L.RegFunction("__tostring", ToLua.op_ToString); L.EndClass(); } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int CreatePanel(IntPtr L) { try { ToLua.CheckArgsCount(L, 3); LuaFramework.PanelManager obj = (LuaFramework.PanelManager)ToLua.CheckObject(L, 1, typeof(LuaFramework.PanelManager)); string arg0 = ToLua.CheckString(L, 2); LuaFunction arg1 = ToLua.CheckLuaFunction(L, 3); obj.CreatePanel(arg0, arg1); return 0; } catch(Exception e) { return LuaDLL.toluaL_exception(L, e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int ClosePanel(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); LuaFramework.PanelManager obj = (LuaFramework.PanelManager)ToLua.CheckObject(L, 1, typeof(LuaFramework.PanelManager)); string arg0 = ToLua.CheckString(L, 2); obj.ClosePanel(arg0); return 0; } catch(Exception e) { return LuaDLL.toluaL_exception(L, e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int op_Equality(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); UnityEngine.Object arg0 = (UnityEngine.Object)ToLua.ToObject(L, 1); UnityEngine.Object arg1 = (UnityEngine.Object)ToLua.ToObject(L, 2); bool o = arg0 == arg1; LuaDLL.lua_pushboolean(L, o); return 1; } catch(Exception e) { return LuaDLL.toluaL_exception(L, e); } } }
amostalong/SSFS
Assets/LuaFramework/ToLua/Source/Generate/LuaFramework_PanelManagerWrap.cs
C#
mit
1,838
export interface CubeTextureLoader { load( urls: string[], onLoad?: (texture?: THREE.Texture) => any, onProgress?: LoaderProgressHandler, onError?: (error?: any) => any, ): THREE.Texture; }
pchen66/panolens.js
src/loaders/CubeTextureLoader.d.ts
TypeScript
mit
210
import re from collections import OrderedDict import compiler.lang as lang doc_next = None doc_prev_component = None doc_root_component = None class CustomParser(object): def match(self, next): raise Exception("Expression should implement match method") escape_re = re.compile(r"[\0\n\r\v\t\b\f]") escape_map = { '\0': '\\0', '\n': '\\n', '\r': '\\r', '\v': '\\v', '\t': '\\t', '\b': '\\b', '\f': '\\f' } def escape(str): return escape_re.sub(lambda m: escape_map[m.group(0)], str) class StringParser(CustomParser): def match(self, next): n = len(next) if n < 2: return quote = next[0] if quote != "'" and quote != "\"": return pos = 1 while next[pos] != quote: if next[pos] == "\\": pos += 2 else: pos += 1 if pos >= n: raise Exception("Unexpected EOF while parsing string") return next[:pos + 1] skip_re = re.compile(r'(?:\s+|/\*.*?\*/|//[^\n]*(?:$|\n))', re.DOTALL) COMPONENT_NAME = r'(?:[a-z][a-zA-Z0-9._]*\.)?[A-Z][A-Za-z0-9]*' component_name = re.compile(COMPONENT_NAME) component_name_lookahead = re.compile(COMPONENT_NAME + r'\s*{') identifier_re = re.compile(r'[a-z_][A-Za-z0-9_]*') property_type_re = re.compile(r'[a-z][a-z0-9]*', re.IGNORECASE) nested_identifier_re = re.compile(r'[a-z_][A-Za-z0-9_\.]*') function_name_re = re.compile(r'[a-z_][a-z0-9_\.]*', re.IGNORECASE) string_re = StringParser() kw_re = re.compile(r'(?:true|false|null)') NUMBER_RE = r"(?:\d+\.\d+(e[+-]?\d+)?|(?:0x)?[0-9]+)" number_re = re.compile(NUMBER_RE, re.IGNORECASE) percent_number_re = re.compile(NUMBER_RE + r'%', re.IGNORECASE) scale_number_re = re.compile(NUMBER_RE + r's', re.IGNORECASE) rest_of_the_line_re = re.compile(r".*$", re.MULTILINE) json_object_value_delimiter_re = re.compile(r"[,;]") dep_var = re.compile(r"\${(.*?)}") class Expression(object): __slots__ = ('op', 'args') def __init__(self, op, *args): self.op, self.args = op, args def __repr__(self): return "Expression %s { %s }" %(self.op, ", ".join(map(repr, self.args))) def __str__(self): args = self.args n = len(args) if n == 1: return "(%s %s)" %(self.op, args[0]) elif n == 2: return "(%s %s %s)" %(args[0], self.op, args[1]) elif n == 3: op = self.op return "(%s %s %s %s %s)" %(args[0], op[0], args[1], op[1], args[2]) else: raise Exception("invalid argument counter") class Call(object): __slots__ = ('func', 'args') def __init__(self, func, args): self.func = func self.args = args def __repr__(self): return "Call %s { %s }" %(self.func, self.args) def __str__(self): if isinstance(self.func, Literal): name = self.func.term if name[0].islower(): if '.' in name: name = '${%s}' %name else: name = '$this._context.%s' %name else: name = str(self.func) #if lhs is not an literal, than we can't process deps, removing ${xxx} name = dep_var.sub(lambda m: m.group(1), name) return "%s(%s)" %(name, ",".join(map(str, self.args))) class Dereference(object): __slots__ = ('array', 'index') def __init__(self, array, index): self.array = array self.index = index def __str__(self): return "(%s[%s])" %(self.array, self.index) class Literal(object): __slots__ = ('lbp', 'term', 'identifier') def __init__(self, term, string = False, identifier = False): self.term = escape(term) if string else term self.lbp = 0 self.identifier = identifier def nud(self, state): return self def __repr__(self): return "Literal { %s }" %self.term def __str__(self): return "${%s}" %self.term if self.identifier and self.term[0].islower() else self.term class PrattParserState(object): def __init__(self, parent, parser, token): self.parent, self.parser, self.token = parent, parser, token class PrattParser(object): def __init__(self, ops): symbols = [(x.term, x) for x in ops] symbols.sort(key=lambda x: len(x[0]), reverse=True) self.symbols = symbols def next(self, parser): parser._skip() next = parser.next next_n = len(next) for term, sym in self.symbols: n = len(term) if n > next_n: continue keyword = term[-1].isalnum() if next.startswith(term): if keyword and n < next_n and next[n].isalnum(): continue parser.advance(len(term)) return sym next = parser.maybe(kw_re) if next: return Literal(next) next = parser.maybe(percent_number_re) if next: next = next[:-1] return Literal("((%s) / 100 * ${parent.<property-name>})" %next) if next != 100 else "(${parent.<property-name>})" next = parser.maybe(scale_number_re) if next: next = next[:-1] return Literal("((%s) * ${context.<scale-property-name>})" %next) next = parser.maybe(number_re) if next: return Literal(next) next = parser.maybe(function_name_re) if next: return Literal(next, identifier=True) next = parser.maybe(string_re) if next: return Literal(next, string=True) return None def advance(self, state, expect = None): if expect is not None: state.parser.read(expect, "Expected %s in expression" %expect) state.token = self.next(state.parser) def expression(self, state, rbp = 0): parser = state.parser t = state.token state.token = self.next(parser) if state.token is None: return t left = t.nud(state) while state.token is not None and rbp < state.token.lbp: t = state.token self.advance(state) left = t.led(state, left) return left def parse(self, parser): token = self.next(parser) if token is None: parser.error("Unexpected expression") state = PrattParserState(self, parser, token) return self.expression(state) class UnsupportedOperator(object): __slots__ = ('term', 'lbp', 'rbp') def __init__(self, term, lbp = 0, rbp = 0): self.term, self.lbp, self.rbp = term, lbp, rbp def nud(self, state): state.parser.error("Unsupported prefix operator %s" %self.term) def led(self, state, left): state.parser.error("Unsupported postfix operator %s" %self.term) def __repr__(self): return "UnsupportedOperator { %s %s }" %(self.term, self.lbp) class Operator(object): __slots__ = ('term', 'lbp', 'rbp') def __init__(self, term, lbp = 0, rbp = None): self.term, self.lbp, self.rbp = term, lbp, rbp def nud(self, state): if self.rbp is not None: return Expression(self.term, state.parent.expression(state, self.rbp)) state.parser.error("Unexpected token in infix expression: '%s'" %self.term) def led(self, state, left): if self.lbp is not None: return Expression(self.term, left, state.parent.expression(state, self.lbp)) else: state.parser.error("No left-associative operator defined") def __repr__(self): return "Operator { %s %s %s }" %(self.term, self.lbp, self.rbp) class Conditional(object): __slots__ = ('term', 'lbp') def __init__(self, lbp): self.term = '?' self.lbp = lbp def nud(self, state): state.parser.error("Conditional operator can't be used as unary") def led(self, state, left): true = state.parent.expression(state) state.parent.advance(state, ':') false = state.parent.expression(state) return Expression(('?', ':'), left, true, false) def __repr__(self): return "Conditional { }" class LeftParenthesis(object): __slots__ = ('term', 'lbp') def __init__(self, lbp): self.term = '(' self.lbp = lbp def nud(self, state): expr = state.parent.expression(state) state.parent.advance(state, ')') return expr def led(self, state, left): args = [] next = state.token if next.term != ')': while True: args.append(state.parent.expression(state)) if state.token is not None: state.parser.error("Unexpected token %s" %state.token) if not state.parser.maybe(','): break state.parent.advance(state) state.parent.advance(state, ')') return Call(left, args) def __repr__(self): return "LeftParenthesis { %d }" %self.lbp class LeftSquareBracket(object): __slots__ = ('term', 'lbp') def __init__(self, lbp): self.term = '[' self.lbp = lbp def nud(self, state): state.parser.error("Invalid [] expression") def led(self, state, left): arg = state.parent.expression(state) if state.token is not None: state.parser.error("Unexpected token %s" %state.token) state.parent.advance(state, ']') return Dereference(left, arg) def __repr__(self): return "LeftSquareBracket { %d }" %self.lbp infix_parser = PrattParser([ Operator('.', 19), LeftParenthesis(19), LeftSquareBracket(19), UnsupportedOperator('++', 17, 16), UnsupportedOperator('--', 17, 16), UnsupportedOperator('void', None, 16), UnsupportedOperator('delete', None, 16), UnsupportedOperator('await', None, 16), Operator('typeof', None, 16), Operator('!', None, 16), Operator('~', None, 16), Operator('+', 13, 16), Operator('-', 13, 16), Operator('typeof', None, 16), Operator('**', 15), Operator('*', 14), Operator('/', 14), Operator('%', 14), Operator('<<', 12), Operator('>>', 12), Operator('>>>', 12), Operator('<', 11), Operator('<=', 11), Operator('>', 11), Operator('>=', 11), Operator('in', 11), Operator('instanceof', 11), Operator('==', 10), Operator('!=', 10), Operator('===', 10), Operator('!==', 10), Operator('&', 9), Operator('^', 8), Operator('|', 7), Operator('&&', 6), Operator('||', 5), Conditional(4), ]) class Parser(object): def __init__(self, text): self.__text = text self.__pos = 0 self.__lineno = 1 self.__colno = 1 self.__last_object = None self.__next_doc = None @property def at_end(self): return self.__pos >= len(self.__text) @property def next(self): return self.__text[self.__pos:] @property def current_line(self): text = self.__text pos = self.__pos begin = text.rfind('\n', 0, pos) end = text.find('\n', pos) if begin < 0: begin = 0 else: begin += 1 if end < 0: end = len(text) return text[begin:end] def advance(self, n): text = self.__text pos = self.__pos for i in range(n): if text[pos] == '\n': self.__lineno += 1 self.__colno = 1 else: self.__colno += 1 pos += 1 self.__pos = pos def __docstring(self, text, prev): if prev: if self.__last_object: if self.__last_object.doc is not None: self.__last_object.doc = lang.DocumentationString(self.__last_object.doc.text + " " + text) else: self.__last_object.doc = lang.DocumentationString(text) else: self.error("Found docstring without previous object") else: if self.__next_doc is not None: self.__next_doc += " " + text else: self.__next_doc = text def __get_next_doc(self): if self.__next_doc is None: return doc = lang.DocumentationString(self.__next_doc) self.__next_doc = None return doc def __return(self, object, doc): if doc: if object.doc: object.doc = lang.DocumentationString(object.doc.text + " " + doc.text) else: object.doc = doc self.__last_object = object return object def _skip(self): while True: m = skip_re.match(self.next) if m is not None: text = m.group(0).strip() if text.startswith('///<'): self.__docstring(text[4:], True) elif text.startswith('///'): self.__docstring(text[3:], False) elif text.startswith('/**'): end = text.rfind('*/') self.__docstring(text[3:end], False) self.advance(m.end()) else: break def error(self, msg): lineno, col, line = self.__lineno, self.__colno, self.current_line pointer = re.sub(r'\S', ' ', line)[:col - 1] + '^-- ' + msg raise Exception("at line %d:%d:\n%s\n%s" %(lineno, col, self.current_line, pointer)) def lookahead(self, exp): if self.at_end: return self._skip() next = self.next if isinstance(exp, str): keyword = exp[-1].isalnum() n, next_n = len(exp), len(next) if n > next_n: return if next.startswith(exp): #check that exp ends on word boundary if keyword and n < next_n and next[n].isalnum(): return else: return exp elif isinstance(exp, CustomParser): return exp.match(next) else: m = exp.match(next) if m: return m.group(0) def maybe(self, exp): value = self.lookahead(exp) if value is not None: self.advance(len(value)) return value def read(self, exp, error): value = self.maybe(exp) if value is None: self.error(error) return value def __read_statement_end(self): self.read(';', "Expected ; at the end of the statement") def __read_list(self, exp, delimiter, error): result = [] result.append(self.read(exp, error)) while self.maybe(delimiter): result.append(self.read(exp, error)) return result def __read_nested(self, begin, end, error): begin_off = self.__pos self.read(begin, error) counter = 1 while not self.at_end: if self.maybe(begin): counter += 1 elif self.maybe(end): counter -= 1 if counter == 0: end_off = self.__pos value = self.__text[begin_off: end_off] return value else: if not self.maybe(string_re): self.advance(1) def __read_code(self): return self.__read_nested('{', '}', "Expected code block") def __read_expression(self, terminate = True): if self.maybe('['): values = [] while not self.maybe(']'): values.append(self.__read_expression(terminate = False)) if self.maybe(']'): break self.read(',', "Expected ',' as an array delimiter") if terminate: self.__read_statement_end() return "[%s]" % (",".join(map(str, values))) else: value = infix_parser.parse(self) if terminate: self.__read_statement_end() return str(value) def __read_property(self): if self.lookahead(':'): return self.__read_rules_with_id(["property"]) doc = self.__get_next_doc() type = self.read(property_type_re, "Expected type after property keyword") if type == 'enum': type = self.read(identifier_re, "Expected type after enum keyword") self.read('{', "Expected { after property enum") values = self.__read_list(component_name, ',', "Expected capitalised enum element") self.read('}', "Expected } after enum element declaration") if self.maybe(':'): def_value = self.read(component_name, "Expected capitalised default enum value") else: def_value = None self.__read_statement_end() return self.__return(lang.EnumProperty(type, values, def_value), doc) if type == 'const': name = self.read(identifier_re, "Expected const property name") self.read(':', "Expected : before const property code") code = self.__read_code() return self.__return(lang.Property("const", [(name, code)]), doc) if type == 'alias': name = self.read(identifier_re, "Expected alias property name") self.read(':', "Expected : before alias target") target = self.read(nested_identifier_re, "Expected identifier as an alias target") self.__read_statement_end() return self.__return(lang.AliasProperty(name, target), doc) names = self.__read_list(identifier_re, ',', "Expected identifier in property list") if len(names) == 1: #Allow initialisation for the single property def_value = None if self.maybe(':'): if self.lookahead(component_name_lookahead): def_value = self.__read_comp() else: def_value = self.__read_expression() else: self.__read_statement_end() name = names[0] return self.__return(lang.Property(type, [(name, def_value)]), doc) else: self.read(';', 'Expected ; at the end of property declaration') return self.__return(lang.Property(type, map(lambda name: (name, None), names)), doc) def __read_rules_with_id(self, identifiers): args = [] doc = self.__get_next_doc() if self.maybe('('): if not self.maybe(')'): args = self.__read_list(identifier_re, ',', "Expected argument list") self.read(')', "Expected () as an argument list") if self.maybe(':'): if self.lookahead('{'): code = self.__read_code() return self.__return(lang.Method(identifiers, args, code, True, False), doc) if len(identifiers) > 1: self.error("Multiple identifiers are not allowed in assignment") if self.lookahead(component_name_lookahead): return self.__return(lang.Assignment(identifiers[0], self.__read_comp()), doc) value = self.__read_expression() return self.__return(lang.Assignment(identifiers[0], value), doc) elif self.maybe('{'): if len(identifiers) > 1: self.error("Multiple identifiers are not allowed in assignment scope") values = [] while not self.maybe('}'): name = self.read(nested_identifier_re, "Expected identifier in assignment scope") self.read(':', "Expected : after identifier in assignment scope") value = self.__read_expression() values.append(lang.Assignment(name, value)) return self.__return(lang.AssignmentScope(identifiers[0], values), doc) else: self.error("Unexpected identifier(s): %s" %",".join(identifiers)) def __read_function(self, async_f = False): doc = self.__get_next_doc() name = self.read(identifier_re, "Expected identifier") args = [] self.read('(', "Expected (argument-list) in function declaration") if not self.maybe(')'): args = self.__read_list(identifier_re, ',', "Expected argument list") self.read(')', "Expected ) at the end of argument list") code = self.__read_code() return self.__return(lang.Method([name], args, code, False, async_f), doc) def __read_json_value(self): value = self.maybe(kw_re) if value is not None: return value value = self.maybe(number_re) if value is not None: return value value = self.maybe(string_re) if value is not None: return lang.unescape_string(value[1:-1]) if self.lookahead('{'): return self.__read_json_object() if self.lookahead('['): return self.__read_json_list def __read_json_list(self): self.read('[', "Expect JSON list starts with [") result = [] while not self.maybe(']'): result.append(self.__read_json_value) if self.maybe(']'): break self.read(',', "Expected , as a JSON list delimiter") return result def __read_json_object(self): self.read('{', "Expected JSON object starts with {") object = OrderedDict() while not self.maybe('}'): name = self.maybe(identifier_re) if not name: name = self.read(string_re, "Expected string or identifier as property name") self.read(':', "Expected : after property name") value = self.__read_json_value() object[name] = value self.maybe(json_object_value_delimiter_re) return object def __read_scope_decl(self): if self.maybe('ListElement'): doc = self.__get_next_doc() return self.__return(lang.ListElement(self.__read_json_object()), doc) elif self.maybe('Behavior'): self.read("on", "Expected on keyword after Behavior declaration") doc = self.__get_next_doc() targets = self.__read_list(nested_identifier_re, ",", "Expected identifier list after on keyword") self.read("{", "Expected { after identifier list in behavior declaration") comp = self.__read_comp() self.read("}", "Expected } after behavior animation declaration") return self.__return(lang.Behavior(targets, comp), doc) elif self.maybe('signal'): doc = self.__get_next_doc() name = self.read(identifier_re, "Expected identifier in signal declaration") self.__read_statement_end() return self.__return(lang.Signal(name), doc) elif self.maybe('property'): return self.__read_property() elif self.maybe('id'): doc = self.__get_next_doc() self.read(':', "Expected : after id keyword") name = self.read(identifier_re, "Expected identifier in id assignment") self.__read_statement_end() return self.__return(lang.IdAssignment(name), doc) elif self.maybe('const'): doc = self.__get_next_doc() type = self.read(property_type_re, "Expected type after const keyword") name = self.read(component_name, "Expected Capitalised const name") self.read(':', "Expected : after const identifier") value = self.__read_json_value() self.__read_statement_end() return self.__return(lang.Const(type, name, value), doc) elif self.maybe('async'): self.error("async fixme") elif self.maybe('function'): return self.__read_function() elif self.maybe('async'): self.read('function', "Expected function after async") return self.__read_function(async_f = True) elif self.lookahead(component_name_lookahead): return self.__read_comp() else: identifiers = self.__read_list(nested_identifier_re, ",", "Expected identifier (or identifier list)") return self.__read_rules_with_id(identifiers) def __read_comp(self): doc = self.__get_next_doc() comp_name = self.read(component_name, "Expected component name") self.read(r'{', "Expected {") children = [] while not self.maybe('}'): children.append(self.__read_scope_decl()) return self.__return(lang.Component(comp_name, children), doc) def parse(self, parse_all = True): while self.maybe('import'): self.read(rest_of_the_line_re, "Skip to the end of the line failed") r = [self.__read_comp()] self._skip() if parse_all: if self.__pos < len(self.__text): self.error("Extra text after component declaration") return r def parse(data): global doc_root_component doc_root_component = None parser = Parser(data) return parser.parse()
pureqml/qmlcore
compiler/grammar2.py
Python
mit
21,146
package util.crypto; /** * This class provides a RuntimeException (tagged to indicate exceptions stem from use of this library). * It's intended to provide a wrapper around the checked exception prevelant to the JCA Architecture. * I.e. The judicious NoSuchAlgorithm typically shouldn't be occurring outside of testing, because you * should have tested that the algorithms your code is using are actually available on the targeted platform. * <p> * Also, the selection of provided algorithms is conservative enough that they should be available anywhere. * <p> * Use of wrapped exceptions will be noted in the Javadoc of any function potentially throwing them. * <p> * Created by a2800276 on 2015-11-15. */ public class WrappedException extends RuntimeException { public WrappedException(String message) { super(message); } public WrappedException(String message, Throwable cause) { super(message, cause); } public WrappedException(Throwable cause) { super(cause); } }
a2800276/javautils
crypto/src/util/crypto/WrappedException.java
Java
mit
995
# Use `hub` as our git wrapper: # http://defunkt.github.com/hub/ hub_path=$(which hub) if (( $+commands[hub] )) then alias git=$hub_path fi # The rest of my fun git aliases alias gl='git pull --prune' alias glog="git log --graph --pretty=format:'%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative" alias gp='git push origin HEAD' # Remove `+` and `-` from start of diff lines; just rely upon color. alias gd='git diff --color | sed "s/^\([^-+ ]*\)[-+ ]/\\1/" | less -r' alias gc='git commit' alias gca='git commit -a' alias gco='git checkout' alias gcb='git copy-branch-name' alias gb='git branch' alias gs='git status -sb' # upgrade your git if -sb breaks for you. it's fun. alias gac='git add -A && git commit -m' # Will's added alias gpull="git pull"
willhs/dotfiles
git/aliases.zsh
Shell
mit
818
<?php namespace ZfcUserForgotPassword\Model; use Zend\InputFilter\InputFilterAwareInterface; use Zend\InputFilter\InputFilterAwareTrait; use Zend\Stdlib\Parameters; class ForgotPassword implements InputFilterAwareInterface { use InputFilterAwareTrait; /** * @var string */ protected $email; public function init() { if ($this->getInputFilter()->count()) { return; } $factory = $this->inputFilter->getFactory(); $this->inputFilter->add($factory->createInput([ 'name' => 'email', 'required' => true, 'allow_empty' => false, 'validators' => [['name' => 'EmailAddress']], ])); } public function setEmail($email) { $this->email = $email; } public function getEmail() { return $this->email; } public function getArrayCopy() { return [ 'email' => $this->email ]; } public function exchangeArray($data) { $params = new Parameters($data); $this->email = $params->email; } }
dillchuk/ZfcUserForgotPassword
src/Model/ForgotPassword.php
PHP
mit
1,099
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.6.0_18) on Thu Dec 18 17:18:35 PST 2014 --> <title>Uses of Class java.nio.LongBuffer (Java Platform SE 7 )</title> <meta name="date" content="2014-12-18"> <link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class java.nio.LongBuffer (Java Platform SE 7 )"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../java/nio/LongBuffer.html" title="class in java.nio">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../index-files/index-1.html">Index</a></li> <li><a href="../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage"><em><strong>Java&trade;&nbsp;Platform<br>Standard&nbsp;Ed.&nbsp;7</strong></em></div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../index.html?java/nio/class-use/LongBuffer.html" target="_top">Frames</a></li> <li><a href="LongBuffer.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class java.nio.LongBuffer" class="title">Uses of Class<br>java.nio.LongBuffer</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../java/nio/LongBuffer.html" title="class in java.nio">LongBuffer</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#java.nio">java.nio</a></td> <td class="colLast"> <div class="block">Defines buffers, which are containers for data, and provides an overview of the other NIO packages.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="#java.util">java.util</a></td> <td class="colLast"> <div class="block">Contains the collections framework, legacy collection classes, event model, date and time facilities, internationalization, and miscellaneous utility classes (a string tokenizer, a random-number generator, and a bit array).</div> </td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="java.nio"> <!-- --> </a> <h3>Uses of <a href="../../../java/nio/LongBuffer.html" title="class in java.nio">LongBuffer</a> in <a href="../../../java/nio/package-summary.html">java.nio</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../java/nio/package-summary.html">java.nio</a> that return <a href="../../../java/nio/LongBuffer.html" title="class in java.nio">LongBuffer</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../java/nio/LongBuffer.html" title="class in java.nio">LongBuffer</a></code></td> <td class="colLast"><span class="strong">LongBuffer.</span><code><strong><a href="../../../java/nio/LongBuffer.html#allocate(int)">allocate</a></strong>(int&nbsp;capacity)</code> <div class="block">Allocates a new long buffer.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>abstract <a href="../../../java/nio/LongBuffer.html" title="class in java.nio">LongBuffer</a></code></td> <td class="colLast"><span class="strong">ByteBuffer.</span><code><strong><a href="../../../java/nio/ByteBuffer.html#asLongBuffer()">asLongBuffer</a></strong>()</code> <div class="block">Creates a view of this byte buffer as a long buffer.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>abstract <a href="../../../java/nio/LongBuffer.html" title="class in java.nio">LongBuffer</a></code></td> <td class="colLast"><span class="strong">LongBuffer.</span><code><strong><a href="../../../java/nio/LongBuffer.html#asReadOnlyBuffer()">asReadOnlyBuffer</a></strong>()</code> <div class="block">Creates a new, read-only long buffer that shares this buffer's content.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>abstract <a href="../../../java/nio/LongBuffer.html" title="class in java.nio">LongBuffer</a></code></td> <td class="colLast"><span class="strong">LongBuffer.</span><code><strong><a href="../../../java/nio/LongBuffer.html#compact()">compact</a></strong>()</code> <div class="block">Compacts this buffer&nbsp;&nbsp;<i>(optional operation)</i>.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>abstract <a href="../../../java/nio/LongBuffer.html" title="class in java.nio">LongBuffer</a></code></td> <td class="colLast"><span class="strong">LongBuffer.</span><code><strong><a href="../../../java/nio/LongBuffer.html#duplicate()">duplicate</a></strong>()</code> <div class="block">Creates a new long buffer that shares this buffer's content.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../java/nio/LongBuffer.html" title="class in java.nio">LongBuffer</a></code></td> <td class="colLast"><span class="strong">LongBuffer.</span><code><strong><a href="../../../java/nio/LongBuffer.html#get(long[])">get</a></strong>(long[]&nbsp;dst)</code> <div class="block">Relative bulk <i>get</i> method.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../java/nio/LongBuffer.html" title="class in java.nio">LongBuffer</a></code></td> <td class="colLast"><span class="strong">LongBuffer.</span><code><strong><a href="../../../java/nio/LongBuffer.html#get(long[],%20int,%20int)">get</a></strong>(long[]&nbsp;dst, int&nbsp;offset, int&nbsp;length)</code> <div class="block">Relative bulk <i>get</i> method.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>abstract <a href="../../../java/nio/LongBuffer.html" title="class in java.nio">LongBuffer</a></code></td> <td class="colLast"><span class="strong">LongBuffer.</span><code><strong><a href="../../../java/nio/LongBuffer.html#put(int,%20long)">put</a></strong>(int&nbsp;index, long&nbsp;l)</code> <div class="block">Absolute <i>put</i> method&nbsp;&nbsp;<i>(optional operation)</i>.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>abstract <a href="../../../java/nio/LongBuffer.html" title="class in java.nio">LongBuffer</a></code></td> <td class="colLast"><span class="strong">LongBuffer.</span><code><strong><a href="../../../java/nio/LongBuffer.html#put(long)">put</a></strong>(long&nbsp;l)</code> <div class="block">Relative <i>put</i> method&nbsp;&nbsp;<i>(optional operation)</i>.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../java/nio/LongBuffer.html" title="class in java.nio">LongBuffer</a></code></td> <td class="colLast"><span class="strong">LongBuffer.</span><code><strong><a href="../../../java/nio/LongBuffer.html#put(long[])">put</a></strong>(long[]&nbsp;src)</code> <div class="block">Relative bulk <i>put</i> method&nbsp;&nbsp;<i>(optional operation)</i>.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../java/nio/LongBuffer.html" title="class in java.nio">LongBuffer</a></code></td> <td class="colLast"><span class="strong">LongBuffer.</span><code><strong><a href="../../../java/nio/LongBuffer.html#put(long[],%20int,%20int)">put</a></strong>(long[]&nbsp;src, int&nbsp;offset, int&nbsp;length)</code> <div class="block">Relative bulk <i>put</i> method&nbsp;&nbsp;<i>(optional operation)</i>.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../java/nio/LongBuffer.html" title="class in java.nio">LongBuffer</a></code></td> <td class="colLast"><span class="strong">LongBuffer.</span><code><strong><a href="../../../java/nio/LongBuffer.html#put(java.nio.LongBuffer)">put</a></strong>(<a href="../../../java/nio/LongBuffer.html" title="class in java.nio">LongBuffer</a>&nbsp;src)</code> <div class="block">Relative bulk <i>put</i> method&nbsp;&nbsp;<i>(optional operation)</i>.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>abstract <a href="../../../java/nio/LongBuffer.html" title="class in java.nio">LongBuffer</a></code></td> <td class="colLast"><span class="strong">LongBuffer.</span><code><strong><a href="../../../java/nio/LongBuffer.html#slice()">slice</a></strong>()</code> <div class="block">Creates a new long buffer whose content is a shared subsequence of this buffer's content.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="../../../java/nio/LongBuffer.html" title="class in java.nio">LongBuffer</a></code></td> <td class="colLast"><span class="strong">LongBuffer.</span><code><strong><a href="../../../java/nio/LongBuffer.html#wrap(long[])">wrap</a></strong>(long[]&nbsp;array)</code> <div class="block">Wraps a long array into a buffer.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../java/nio/LongBuffer.html" title="class in java.nio">LongBuffer</a></code></td> <td class="colLast"><span class="strong">LongBuffer.</span><code><strong><a href="../../../java/nio/LongBuffer.html#wrap(long[],%20int,%20int)">wrap</a></strong>(long[]&nbsp;array, int&nbsp;offset, int&nbsp;length)</code> <div class="block">Wraps a long array into a buffer.</div> </td> </tr> </tbody> </table> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../java/nio/package-summary.html">java.nio</a> with parameters of type <a href="../../../java/nio/LongBuffer.html" title="class in java.nio">LongBuffer</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><span class="strong">LongBuffer.</span><code><strong><a href="../../../java/nio/LongBuffer.html#compareTo(java.nio.LongBuffer)">compareTo</a></strong>(<a href="../../../java/nio/LongBuffer.html" title="class in java.nio">LongBuffer</a>&nbsp;that)</code> <div class="block">Compares this buffer to another.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../java/nio/LongBuffer.html" title="class in java.nio">LongBuffer</a></code></td> <td class="colLast"><span class="strong">LongBuffer.</span><code><strong><a href="../../../java/nio/LongBuffer.html#put(java.nio.LongBuffer)">put</a></strong>(<a href="../../../java/nio/LongBuffer.html" title="class in java.nio">LongBuffer</a>&nbsp;src)</code> <div class="block">Relative bulk <i>put</i> method&nbsp;&nbsp;<i>(optional operation)</i>.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"><a name="java.util"> <!-- --> </a> <h3>Uses of <a href="../../../java/nio/LongBuffer.html" title="class in java.nio">LongBuffer</a> in <a href="../../../java/util/package-summary.html">java.util</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../java/util/package-summary.html">java.util</a> with parameters of type <a href="../../../java/nio/LongBuffer.html" title="class in java.nio">LongBuffer</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../java/util/BitSet.html" title="class in java.util">BitSet</a></code></td> <td class="colLast"><span class="strong">BitSet.</span><code><strong><a href="../../../java/util/BitSet.html#valueOf(java.nio.LongBuffer)">valueOf</a></strong>(<a href="../../../java/nio/LongBuffer.html" title="class in java.nio">LongBuffer</a>&nbsp;lb)</code> <div class="block">Returns a new bit set containing all the bits in the given long buffer between its position and limit.</div> </td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../java/nio/LongBuffer.html" title="class in java.nio">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../index-files/index-1.html">Index</a></li> <li><a href="../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage"><em><strong>Java&trade;&nbsp;Platform<br>Standard&nbsp;Ed.&nbsp;7</strong></em></div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../index.html?java/nio/class-use/LongBuffer.html" target="_top">Frames</a></li> <li><a href="LongBuffer.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small><font size="-1"> <a href="http://bugreport.sun.com/bugreport/">Submit a bug or feature</a> <br>For further API reference and developer documentation, see <a href="http://docs.oracle.com/javase/7/docs/index.html" target="_blank">Java SE Documentation</a>. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.<br> <a href="../../../../legal/cpyr.html">Copyright</a> &#x00a9; 1993, 2015, Oracle and/or its affiliates. All rights reserved. </font></small></p> </body> </html>
fbiville/annotation-processing-ftw
doc/java/jdk7/java/nio/class-use/LongBuffer.html
HTML
mit
15,767
using System.IO; using System.Text.RegularExpressions; namespace Advent_of_code.Day_4 { public class Runner { public void Run() { Part1(); Part2(); } private void Part1() { var sum = 0; using (var sr = new StreamReader("e:/Data/coding/Various/Advent of code 2016/Day 4/input.txt")) { string line; Room room; while ((line = sr.ReadLine()) != null) { room = new Room(line); sum += room.IsReal() ? room.Number : 0; } } System.Console.WriteLine($"Day 4, part 1: {sum}"); } private void Part2() { int realId = 0; using (var sr = new StreamReader("e:/Data/coding/Various/Advent of code 2016/Day 4/input.txt")) { string line; while ((line = sr.ReadLine()) != null) { var room = new Room(line); if (room.DecryptName().Contains("northpole object storage")) { realId = room.Number; break; } } } System.Console.WriteLine($"Day 4, part 2: {realId}"); } } }
Lameorc/advent-of-code-2016
Advent of code/Advent of code/Day 4/Runner.cs
C#
mit
1,391
import baseController from '../../shared/baseController'; export default class ngbGenomeAnnotationsController extends baseController{ static get UID() { return 'ngbGenomeAnnotationsController'; } projectContext; scope; showTrackOriginalName = true; constructor($scope, dispatcher, projectContext, trackNamingService, localDataService) { super(dispatcher); this.projectContext = projectContext; this.trackNamingService = trackNamingService; this.scope = $scope; this.localDataService = localDataService; this.showTrackOriginalName = localDataService.getSettings().showTrackOriginalName; this.annotationFiles = [ { name: 'Human_genome.fa' }, { name: 'Human_genome.bed' } ]; const globalSettingsChangedHandler = (state) => { this.showTrackOriginalName = state.showTrackOriginalName; }; this.dispatcher.on('settings:change', globalSettingsChangedHandler); // We must remove event listener when component is destroyed. $scope.$on('$destroy', () => { dispatcher.removeListener('settings:change', globalSettingsChangedHandler); }); } openMenu($mdOpenMenu, $event) { if (this.referenceContainsAnnotations) { $mdOpenMenu($event); } } get reference() { if (this.projectContext && this.projectContext.reference) { return this.projectContext.reference; } return { annotationFiles: null, name: null, }; } get referenceContainsAnnotations() { if (this.projectContext && this.projectContext.reference) { return this.projectContext.reference.annotationFiles && this.projectContext.reference.annotationFiles.length; } return false; } getCustomName(file) { return this.trackNamingService.getCustomName(file); } onAnnotationFileChanged(file) { if (file.selected) { const state = this.projectContext.reference.annotationFiles; const sortFn = (file1, file2) => { if (file1.selected !== file2.selected) { if (file1.selected) { return -1; } else { return 1; } } const index1 = state.indexOf(file1.name.toLowerCase()); const index2 = state.indexOf(file2.name.toLowerCase()); if (file1.name.toLowerCase() === file2.name.toLowerCase()) { return 0; } if (file1.name.toLowerCase() === file.name.toLowerCase()) { return 1; } if (file2.name.toLowerCase() === file.name.toLowerCase()) { return -1; } if (index1 < index2) { return -1; } else if (index1 > index2) { return 1; } return 0; }; this.projectContext.reference.annotationFiles.sort(sortFn); const tracks = this.projectContext.tracks; file.projectId = ''; file.isLocal = true; tracks.push(file); const tracksState = this.projectContext.tracksState; const savedState = this.projectContext.getTrackState((file.name || '').toLowerCase(), file.projectId); if (savedState) { tracksState.push(Object.assign(savedState,{ bioDataItemId: file.name, format: file.format, isLocal: true, projectId: '', })); } else { tracksState.push({ bioDataItemId: file.name, format: file.format, isLocal: true, projectId: '', }); } this.projectContext.changeState({tracks, tracksState}); } else { const tracks = this.projectContext.tracks; const tracksToRemove = tracks.filter( (t) => t.name.toLowerCase() === file.name.toLowerCase() && t.format.toLowerCase() === file.format.toLowerCase() && t.projectId === '' ); tracksToRemove.forEach(track => { const index = tracks.indexOf(track); tracks.splice(index, 1); }); const tracksState = this.projectContext.tracksState; const trackStateToRemove = tracksState.filter( (t) => t.bioDataItemId.toLowerCase() === file.name.toLowerCase() && t.format.toLowerCase() === file.format.toLowerCase() && t.projectId === '' ); trackStateToRemove.forEach(trackState => { tracksState.splice(tracksState.indexOf(trackState), 1); }); this.projectContext.changeState({tracks, tracksState}); } this.projectContext.saveAnnotationFilesState(); } }
epam/NGB
client/client/app/components/ngbGenomeAnnotations/ngbGenomeAnnotations.controller.js
JavaScript
mit
5,287
<!DOCTYPE html> <html> <head lang="ru"> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <title>Template</title> <link href="http://themesanytime.com/startui/demo/img/favicon.144x144.png" rel="apple-touch-icon" type="image/png" sizes="144x144"> <link href="http://themesanytime.com/startui/demo/img/favicon.114x114.png" rel="apple-touch-icon" type="image/png" sizes="114x114"> <link href="http://themesanytime.com/startui/demo/img/favicon.72x72.png" rel="apple-touch-icon" type="image/png" sizes="72x72"> <link href="http://themesanytime.com/startui/demo/img/favicon.57x57.png" rel="apple-touch-icon" type="image/png"> <link href="http://themesanytime.com/startui/demo/img/favicon.png" rel="icon" type="image/png"> <link href="http://themesanytime.com/startui/demo/img/favicon.ico" rel="shortcut icon"> <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> <script src="js/plugins.js"></script> <script src="js/app.js"></script> <link rel="stylesheet" href="css/lib/font-awesome/font-awesome.min.css"> <link rel="stylesheet" href="css/main.css"> </head> <body class="with-side-menu"> <header class="site-header"> <div class="container-fluid"> <a href="documentation.html#" class="site-logo"> <img class="hidden-md-down" src="img/logo-2.png" alt=""> <img class="hidden-lg-up" src="img/logo-2-mob.png" alt=""> </a> <button class="hamburger hamburger--htla"> <span>toggle menu</span> </button> <div class="site-header-content"> <div class="site-header-content-in"> <div class="site-header-shown"> <div class="dropdown dropdown-notification notif"> <a href="documentation.html#" class="header-alarm dropdown-toggle active" id="dd-notification" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="font-icon-alarm"></i> </a> <div class="dropdown-menu dropdown-menu-right dropdown-menu-notif" aria-labelledby="dd-notification"> <div class="dropdown-menu-notif-header"> Notifications <span class="label label-pill label-danger">4</span> </div> <div class="dropdown-menu-notif-list"> <div class="dropdown-menu-notif-item"> <div class="photo"> <img src="img/photo-64-1.jpg" alt=""> </div> <div class="dot"></div> <a href="documentation.html#">Morgan</a> was bothering about something <div class="color-blue-grey-lighter">7 hours ago</div> </div> <div class="dropdown-menu-notif-item"> <div class="photo"> <img src="img/photo-64-2.jpg" alt=""> </div> <div class="dot"></div> <a href="documentation.html#">Lioneli</a> had commented on this <a href="documentation.html#">Super Important Thing</a> <div class="color-blue-grey-lighter">7 hours ago</div> </div> <div class="dropdown-menu-notif-item"> <div class="photo"> <img src="img/photo-64-3.jpg" alt=""> </div> <div class="dot"></div> <a href="documentation.html#">Xavier</a> had commented on the <a href="documentation.html#">Movie title</a> <div class="color-blue-grey-lighter">7 hours ago</div> </div> <div class="dropdown-menu-notif-item"> <div class="photo"> <img src="img/photo-64-4.jpg" alt=""> </div> <a href="documentation.html#">Lionely</a> wants to go to <a href="documentation.html#">Cinema</a> with you to see <a href="documentation.html#">This Movie</a> <div class="color-blue-grey-lighter">7 hours ago</div> </div> </div> <div class="dropdown-menu-notif-more"> <a href="documentation.html#">See more</a> </div> </div> </div> <div class="dropdown dropdown-notification messages"> <a href="documentation.html#" class="header-alarm dropdown-toggle active" id="dd-messages" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="font-icon-mail"></i> </a> <div class="dropdown-menu dropdown-menu-right dropdown-menu-messages" aria-labelledby="dd-messages"> <div class="dropdown-menu-messages-header"> <ul class="nav" role="tablist"> <li class="nav-item"> <a class="nav-link active" data-toggle="tab" href="documentation.html#tab-incoming" role="tab"> Inbox <span class="label label-pill label-danger">8</span> </a> </li> <li class="nav-item"> <a class="nav-link" data-toggle="tab" href="documentation.html#tab-outgoing" role="tab">Outbox</a> </li> </ul> <!--<button type="button" class="create"> <i class="font-icon font-icon-pen-square"></i> </button>--> </div> <div class="tab-content"> <div class="tab-pane active" id="tab-incoming" role="tabpanel"> <div class="dropdown-menu-messages-list"> <a href="documentation.html#" class="mess-item"> <span class="avatar-preview avatar-preview-32"><img src="img/photo-64-2.jpg" alt=""></span> <span class="mess-item-name">Tim Collins</span> <span class="mess-item-txt">Morgan was bothering about something!</span> </a> <a href="documentation.html#" class="mess-item"> <span class="avatar-preview avatar-preview-32"><img src="img/avatar-2-64.png" alt=""></span> <span class="mess-item-name">Christian Burton</span> <span class="mess-item-txt">Morgan was bothering about something! Morgan was bothering about something.</span> </a> <a href="documentation.html#" class="mess-item"> <span class="avatar-preview avatar-preview-32"><img src="img/photo-64-2.jpg" alt=""></span> <span class="mess-item-name">Tim Collins</span> <span class="mess-item-txt">Morgan was bothering about something!</span> </a> <a href="documentation.html#" class="mess-item"> <span class="avatar-preview avatar-preview-32"><img src="img/avatar-2-64.png" alt=""></span> <span class="mess-item-name">Christian Burton</span> <span class="mess-item-txt">Morgan was bothering about something...</span> </a> </div> </div> <div class="tab-pane" id="tab-outgoing" role="tabpanel"> <div class="dropdown-menu-messages-list"> <a href="documentation.html#" class="mess-item"> <span class="avatar-preview avatar-preview-32"><img src="img/avatar-2-64.png" alt=""></span> <span class="mess-item-name">Christian Burton</span> <span class="mess-item-txt">Morgan was bothering about something! Morgan was bothering about something...</span> </a> <a href="documentation.html#" class="mess-item"> <span class="avatar-preview avatar-preview-32"><img src="img/photo-64-2.jpg" alt=""></span> <span class="mess-item-name">Tim Collins</span> <span class="mess-item-txt">Morgan was bothering about something! Morgan was bothering about something.</span> </a> <a href="documentation.html#" class="mess-item"> <span class="avatar-preview avatar-preview-32"><img src="img/avatar-2-64.png" alt=""></span> <span class="mess-item-name">Christian Burtons</span> <span class="mess-item-txt">Morgan was bothering about something!</span> </a> <a href="documentation.html#" class="mess-item"> <span class="avatar-preview avatar-preview-32"><img src="img/photo-64-2.jpg" alt=""></span> <span class="mess-item-name">Tim Collins</span> <span class="mess-item-txt">Morgan was bothering about something!</span> </a> </div> </div> </div> <div class="dropdown-menu-notif-more"> <a href="documentation.html#">See more</a> </div> </div> </div> <div class="dropdown dropdown-lang"> <button class="dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <span class="flag-icon flag-icon-us"></span> </button> <div class="dropdown-menu dropdown-menu-right"> <div class="dropdown-menu-col"> <a class="dropdown-item" href="documentation.html#"><span class="flag-icon flag-icon-ru"></span>Русский</a> <a class="dropdown-item" href="documentation.html#"><span class="flag-icon flag-icon-de"></span>Deutsch</a> <a class="dropdown-item" href="documentation.html#"><span class="flag-icon flag-icon-it"></span>Italiano</a> <a class="dropdown-item" href="documentation.html#"><span class="flag-icon flag-icon-es"></span>Español</a> <a class="dropdown-item" href="documentation.html#"><span class="flag-icon flag-icon-pl"></span>Polski</a> <a class="dropdown-item" href="documentation.html#"><span class="flag-icon flag-icon-li"></span>Lietuviu</a> </div> <div class="dropdown-menu-col"> <a class="dropdown-item current" href="documentation.html#"><span class="flag-icon flag-icon-us"></span>English</a> <a class="dropdown-item" href="documentation.html#"><span class="flag-icon flag-icon-fr"></span>Français</a> <a class="dropdown-item" href="documentation.html#"><span class="flag-icon flag-icon-by"></span>Беларускi</a> <a class="dropdown-item" href="documentation.html#"><span class="flag-icon flag-icon-ua"></span>Українська</a> <a class="dropdown-item" href="documentation.html#"><span class="flag-icon flag-icon-cz"></span>Česky</a> <a class="dropdown-item" href="documentation.html#"><span class="flag-icon flag-icon-ch"></span>中國</a> </div> </div> </div> <div class="dropdown user-menu"> <button class="dropdown-toggle" id="dd-user-menu" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <img src="img/avatar-2-64.png" alt=""> </button> <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dd-user-menu"> <a class="dropdown-item" href="documentation.html#"><span class="font-icon glyphicon glyphicon-user"></span>Profile</a> <a class="dropdown-item" href="documentation.html#"><span class="font-icon glyphicon glyphicon-cog"></span>Settings</a> <a class="dropdown-item" href="documentation.html#"><span class="font-icon glyphicon glyphicon-question-sign"></span>Help</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="documentation.html#"><span class="font-icon glyphicon glyphicon-log-out"></span>Logout</a> </div> </div> <button type="button" class="burger-right"> <i class="font-icon-menu-addl"></i> </button> </div><!--.site-header-shown--> <div class="mobile-menu-right-overlay"></div> <div class="site-header-collapsed"> <div class="site-header-collapsed-in"> <div class="dropdown dropdown-typical"> <a class="dropdown-toggle" id="dd-header-sales" data-target="#" href="http://example.com" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <span class="font-icon font-icon-wallet"></span> <span class="lbl">Sales</span> </a> <div class="dropdown-menu" aria-labelledby="dd-header-sales"> <a class="dropdown-item" href="documentation.html#"><span class="font-icon font-icon-home"></span>Quant and Verbal</a> <a class="dropdown-item" href="documentation.html#"><span class="font-icon font-icon-cart"></span>Real Gmat Test</a> <a class="dropdown-item" href="documentation.html#"><span class="font-icon font-icon-speed"></span>Prep Official App</a> <a class="dropdown-item" href="documentation.html#"><span class="font-icon font-icon-users"></span>CATprer Test</a> <a class="dropdown-item" href="documentation.html#"><span class="font-icon font-icon-comments"></span>Third Party Test</a> </div> </div> <div class="dropdown dropdown-typical"> <a class="dropdown-toggle" id="dd-header-marketing" data-target="#" href="http://example.com" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <span class="font-icon font-icon-cogwheel"></span> <span class="lbl">Marketing automation</span> </a> <div class="dropdown-menu" aria-labelledby="dd-header-marketing"> <a class="dropdown-item" href="documentation.html#">Current Search</a> <a class="dropdown-item" href="documentation.html#">Search for Issues</a> <div class="dropdown-divider"></div> <div class="dropdown-header">Recent issues</div> <a class="dropdown-item" href="documentation.html#"><span class="font-icon font-icon-home"></span>Quant and Verbal</a> <a class="dropdown-item" href="documentation.html#"><span class="font-icon font-icon-cart"></span>Real Gmat Test</a> <a class="dropdown-item" href="documentation.html#"><span class="font-icon font-icon-speed"></span>Prep Official App</a> <a class="dropdown-item" href="documentation.html#"><span class="font-icon font-icon-users"></span>CATprer Test</a> <a class="dropdown-item" href="documentation.html#"><span class="font-icon font-icon-comments"></span>Third Party Test</a> <div class="dropdown-more"> <div class="dropdown-more-caption padding">more...</div> <div class="dropdown-more-sub"> <div class="dropdown-more-sub-in"> <a class="dropdown-item" href="documentation.html#"><span class="font-icon font-icon-home"></span>Quant and Verbal</a> <a class="dropdown-item" href="documentation.html#"><span class="font-icon font-icon-cart"></span>Real Gmat Test</a> <a class="dropdown-item" href="documentation.html#"><span class="font-icon font-icon-speed"></span>Prep Official App</a> <a class="dropdown-item" href="documentation.html#"><span class="font-icon font-icon-users"></span>CATprer Test</a> <a class="dropdown-item" href="documentation.html#"><span class="font-icon font-icon-comments"></span>Third Party Test</a> </div> </div> </div> <div class="dropdown-divider"></div> <a class="dropdown-item" href="documentation.html#">Import Issues from CSV</a> <div class="dropdown-divider"></div> <div class="dropdown-header">Filters</div> <a class="dropdown-item" href="documentation.html#">My Open Issues</a> <a class="dropdown-item" href="documentation.html#">Reported by Me</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="documentation.html#">Manage filters</a> <div class="dropdown-divider"></div> <div class="dropdown-header">Timesheet</div> <a class="dropdown-item" href="documentation.html#">Subscribtions</a> </div> </div> <div class="dropdown dropdown-typical"> <a class="dropdown-toggle" id="dd-header-social" data-target="#" href="http://example.com" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <span class="font-icon font-icon-share"></span> <span class="lbl">Social media</span> </a> <div class="dropdown-menu" aria-labelledby="dd-header-social"> <a class="dropdown-item" href="documentation.html#"><span class="font-icon font-icon-home"></span>Quant and Verbal</a> <a class="dropdown-item" href="documentation.html#"><span class="font-icon font-icon-cart"></span>Real Gmat Test</a> <a class="dropdown-item" href="documentation.html#"><span class="font-icon font-icon-speed"></span>Prep Official App</a> <a class="dropdown-item" href="documentation.html#"><span class="font-icon font-icon-users"></span>CATprer Test</a> <a class="dropdown-item" href="documentation.html#"><span class="font-icon font-icon-comments"></span>Third Party Test</a> </div> </div> <div class="dropdown dropdown-typical"> <a href="documentation.html#" class="dropdown-toggle no-arr"> <span class="font-icon font-icon-page"></span> <span class="lbl">Projects</span> <span class="label label-pill label-danger">35</span> </a> </div> <div class="dropdown dropdown-typical"> <a class="dropdown-toggle" id="dd-header-form-builder" data-target="#" href="http://example.com" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <span class="font-icon font-icon-pencil"></span> <span class="lbl">Form builder</span> </a> <div class="dropdown-menu" aria-labelledby="dd-header-form-builder"> <a class="dropdown-item" href="documentation.html#"><span class="font-icon font-icon-home"></span>Quant and Verbal</a> <a class="dropdown-item" href="documentation.html#"><span class="font-icon font-icon-cart"></span>Real Gmat Test</a> <a class="dropdown-item" href="documentation.html#"><span class="font-icon font-icon-speed"></span>Prep Official App</a> <a class="dropdown-item" href="documentation.html#"><span class="font-icon font-icon-users"></span>CATprer Test</a> <a class="dropdown-item" href="documentation.html#"><span class="font-icon font-icon-comments"></span>Third Party Test</a> </div> </div> <div class="dropdown"> <button class="btn btn-rounded dropdown-toggle" id="dd-header-add" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> Add </button> <div class="dropdown-menu" aria-labelledby="dd-header-add"> <a class="dropdown-item" href="documentation.html#">Quant and Verbal</a> <a class="dropdown-item" href="documentation.html#">Real Gmat Test</a> <a class="dropdown-item" href="documentation.html#">Prep Official App</a> <a class="dropdown-item" href="documentation.html#">CATprer Test</a> <a class="dropdown-item" href="documentation.html#">Third Party Test</a> </div> </div> <div class="help-dropdown"> <button type="button"> <i class="font-icon font-icon-help"></i> </button> <div class="help-dropdown-popup"> <div class="help-dropdown-popup-side"> <ul> <li><a href="documentation.html#">Getting Started</a></li> <li><a href="documentation.html#" class="active">Creating a new project</a></li> <li><a href="documentation.html#">Adding customers</a></li> <li><a href="documentation.html#">Settings</a></li> <li><a href="documentation.html#">Importing data</a></li> <li><a href="documentation.html#">Exporting data</a></li> </ul> </div> <div class="help-dropdown-popup-cont"> <div class="help-dropdown-popup-cont-in"> <div class="jscroll"> <a href="documentation.html#" class="help-dropdown-popup-item"> Lorem Ipsum is simply <span class="describe">Lorem Ipsum has been the industry's standard dummy text </span> </a> <a href="documentation.html#" class="help-dropdown-popup-item"> Contrary to popular belief <span class="describe">Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC</span> </a> <a href="documentation.html#" class="help-dropdown-popup-item"> The point of using Lorem Ipsum <span class="describe">Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text</span> </a> <a href="documentation.html#" class="help-dropdown-popup-item"> Lorem Ipsum <span class="describe">There are many variations of passages of Lorem Ipsum available</span> </a> <a href="documentation.html#" class="help-dropdown-popup-item"> Lorem Ipsum is simply <span class="describe">Lorem Ipsum has been the industry's standard dummy text </span> </a> <a href="documentation.html#" class="help-dropdown-popup-item"> Contrary to popular belief <span class="describe">Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC</span> </a> <a href="documentation.html#" class="help-dropdown-popup-item"> The point of using Lorem Ipsum <span class="describe">Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text</span> </a> <a href="documentation.html#" class="help-dropdown-popup-item"> Lorem Ipsum <span class="describe">There are many variations of passages of Lorem Ipsum available</span> </a> <a href="documentation.html#" class="help-dropdown-popup-item"> Lorem Ipsum is simply <span class="describe">Lorem Ipsum has been the industry's standard dummy text </span> </a> <a href="documentation.html#" class="help-dropdown-popup-item"> Contrary to popular belief <span class="describe">Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC</span> </a> <a href="documentation.html#" class="help-dropdown-popup-item"> The point of using Lorem Ipsum <span class="describe">Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text</span> </a> <a href="documentation.html#" class="help-dropdown-popup-item"> Lorem Ipsum <span class="describe">There are many variations of passages of Lorem Ipsum available</span> </a> </div> </div> </div> </div> </div><!--.help-dropdown--> <div class="site-header-search-container"> <form class="site-header-search closed"> <input type="text" placeholder="Search"/> <button type="submit"> <span class="font-icon-search"></span> </button> <div class="overlay"></div> </form> </div> </div><!--.site-header-collapsed-in--> </div><!--.site-header-collapsed--> </div><!--site-header-content-in--> </div><!--.site-header-content--> </div><!--.container-fluid--> </header><!--.site-header--> <div class="mobile-menu-left-overlay"></div> <nav class="side-menu"> <section> <header class="side-menu-title">Documentation</header> <ul class="side-table-of-contents"> <li><a href="documentation.html#">Index page</a> <ul> <li><a href="documentation.html#">Getting Started</a></li> <li><a href="documentation.html#" class="active">Creating a new project</a></li> <li><a href="documentation.html#">Adding customers</a></li> <li><a href="documentation.html#">Settings</a></li> <li><a href="documentation.html#">Importing data</a></li> <li><a href="documentation.html#">Exporting data</a></li> </ul> </li> <li><a href="documentation.html#">Getting Started</a> <ul> <li><a href="documentation.html#">Installing on OSX</a></li> <li><a href="documentation.html#">Installing on Windows</a></li> <li><a href="documentation.html#">Working on the SuperDocs cloud</a></li> <li><a href="documentation.html#">Troubleshooting</a></li> </ul> </li> <li><a href="documentation.html#">Creating New Projects</a></li> <li><a href="documentation.html#">Managing Users</a></li> <li><a href="documentation.html#">Authors, Editors &amp; Permissions</a></li> </ul> </section> </nav><!--.side-menu--> <div class="page-content"> <div class="container-fluid"> <div class="box-typical box-typical-padding documentation"> <footer class="documentation-meta"> <p class="inline"> <span class="color-blue-grey-lighter">Created:</span> August 27, 2015 (12 days ago) </p> <p class="inline"> <span class="color-blue-grey-lighter">Last updated:</span> November 27, 2015 (12 days ago) </p> <p> <span class="color-blue-grey-lighter">Tags:</span> <a href="documentation.html#">Basic,</a> <a href="documentation.html#">Getting Started,</a> <a href="documentation.html#">v2</a> </p> </footer> <ol class="breadcrumb breadcrumb-clean"> <li><a href="documentation.html#">Documentation</a></li> <li><a href="documentation.html#">Creating a new project</a></li> <li class="active">Getting started with SuperDoc &amp; creating a project</li> </ol> <header class="documentation-header"> <h2>Getting started with SuperDoc &amp; creating a project</h2> <p class="lead color-blue-grey">An overview of the editor and it's usage for new users</p> <div class="documentation-header-by"> By: <div class="avatar-preview avatar-preview-24"> <a href="documentation.html#"><img src="img/avatar-1-48.png" alt=""></a> </div> <a href="documentation.html#">Kaylee Harper</a>, published August 20th, at 12:35pm </div> </header> <div class="text-block text-block-typical"> <p> It is a long established fact that a <mark>reader</mark> will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like). </p> <p>It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).</p> <p>It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).</p> <p> It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like). </p> <h4>Lorem Ipsum</h4> <p> It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like). </p> <p> It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like). </p> </div> </div><!--.box-typical--> </div><!--.container-fluid--> </div><!--.page-content--> <div class="modal fade" id="uploadModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="modal-close" data-dismiss="modal" aria-label="Close"> <i class="font-icon-close-2"></i> </button> <h4 class="modal-title" id="myModalLabel">Upload File</h4> </div> <div class="modal-upload"> <div class="modal-upload-cont"> <div class="modal-upload-cont-in"> <div class="tab-content"> <div role="tabpanel" class="tab-pane active" id="tab-upload"> <div class="modal-upload-body scrollable-block"> <div class="uploading-container"> <div class="uploading-container-left"> <div class="drop-zone"> <!-- при перетаскиваении добавляем класс .dragover <div class="drop-zone dragover"> --> <i class="font-icon font-icon-cloud-upload-2"></i> <div class="drop-zone-caption">Drag file to upload</div> <span class="btn btn-rounded btn-file"> <span>Choose file</span> <input type="file" name="files[]" multiple> </span> </div> </div><!--.uploading-container-left--> <div class="uploading-container-right"> <div class="uploading-container-right-in"> <h6 class="uploading-list-title">Uploading</h6> <ul class="uploading-list"> <li class="uploading-list-item"> <div class="uploading-list-item-wrapper"> <div class="uploading-list-item-name"> <i class="font-icon font-icon-cam-photo"></i> photo.png </div> <div class="uploading-list-item-size">7,5 mb</div> <button type="button" class="uploading-list-item-close"> <i class="font-icon-close-2"></i> </button> </div> <progress class="progress" value="25" max="100"> <div class="progress"> <span class="progress-bar" style="width: 25%;">25%</span> </div> </progress> <div class="uploading-list-item-progress">37% done</div> <div class="uploading-list-item-speed">90KB/sec</div> </li> <li class="uploading-list-item"> <div class="uploading-list-item-wrapper"> <div class="uploading-list-item-name"> <i class="font-icon font-icon-page"></i> task.doc </div> <div class="uploading-list-item-size">7,5 mb</div> <button type="button" class="uploading-list-item-close"> <i class="font-icon-close-2"></i> </button> </div> <progress class="progress" value="50" max="100"> <div class="progress"> <span class="progress-bar" style="width: 50%;">50%</span> </div> </progress> <div class="uploading-list-item-progress">37% done</div> <div class="uploading-list-item-speed">90KB/sec</div> </li> <li class="uploading-list-item"> <div class="uploading-list-item-wrapper"> <div class="uploading-list-item-name"> <i class="font-icon font-icon-cam-photo"></i> dashboard.png </div> <div class="uploading-list-item-size">7,5 mb</div> <button type="button" class="uploading-list-item-close"> <i class="font-icon-close-2"></i> </button> </div> <progress class="progress" value="100" max="100"> <div class="progress"> <span class="progress-bar" style="width: 100%;">100%</span> </div> </progress> <div class="uploading-list-item-progress">Completed</div> <div class="uploading-list-item-speed">90KB/sec</div> </li> </ul> </div> </div><!--.uploading-container-right--> </div><!--.uploading-container--> </div><!--.modal-upload-body--> <div class="modal-upload-bottom"> <button type="button" class="btn btn-rounded btn-default">Cancel</button> <button type="button" class="btn btn-rounded">Done</button> </div><!--.modal-upload-bottom--> </div><!--.tab-pane--> <div role="tabpanel" class="tab-pane" id="tab-dropbox"> <div class="upload-dropbox"> <h3>Upload a file from Dropbox</h3> <p> Get files your Dropbox account.<br/> We play nice. You just need to login. </p> <button type="button" class="btn btn-rounded">Connect to Dropbox</button> <div class="text-muted">We will open a new page to connect your Dropbox account.</div> </div> </div><!--.tab-pane--> <div role="tabpanel" class="tab-pane" id="tab-google-drive"> <div class="modal-upload-body scrollable-block"> <div class="upload-gd-header"> <div class="tbl-row"> <div class="tbl-cell"> <input type="text" class="form-control form-control-rounded" placeholder="Search"/> </div> <div class="tbl-cell tbl-cell-btns"> <button type="button"> <i class="font-icon font-icon-cam-photo"></i> </button> <button type="button"> <i class="font-icon font-icon-cam-video"></i> </button> <button type="button"> <i class="font-icon font-icon-sound"></i> </button> <button type="button"> <i class="font-icon font-icon-page"></i> </button> </div> </div> </div> <div class="gd-doc-grid"> <div class="gd-doc-col"> <div class="gd-doc"> <div class="gd-doc-preview"> <a href="documentation.html#"> <img src="img/doc.jpg" alt=""> </a> </div> <div class="gd-doc-title">History Class Final</div> <div class="gd-doc-date">05/30/2014</div> </div> </div> <div class="gd-doc-col"> <div class="gd-doc"> <div class="gd-doc-preview"> <a href="documentation.html#"> <img src="img/doc.jpg" alt=""> </a> </div> <div class="gd-doc-title">History Class Final</div> <div class="gd-doc-date">05/30/2014</div> </div> </div> <div class="gd-doc-col"> <div class="gd-doc"> <div class="gd-doc-preview"> <a href="documentation.html#"> <img src="img/doc.jpg" alt=""> </a> </div> <div class="gd-doc-title">History Class Final</div> <div class="gd-doc-date">05/30/2014</div> </div> </div> <div class="gd-doc-col"> <div class="gd-doc"> <div class="gd-doc-preview"> <a href="documentation.html#"> <img src="img/doc.jpg" alt=""> </a> </div> <div class="gd-doc-title">History Class Final</div> <div class="gd-doc-date">05/30/2014</div> </div> </div> <div class="gd-doc-col"> <div class="gd-doc"> <div class="gd-doc-preview"> <a href="documentation.html#"> <img src="img/doc.jpg" alt=""> </a> </div> <div class="gd-doc-title">History Class Final</div> <div class="gd-doc-date">05/30/2014</div> </div> </div> <div class="gd-doc-col"> <div class="gd-doc"> <div class="gd-doc-preview"> <a href="documentation.html#"> <img src="img/doc.jpg" alt=""> </a> </div> <div class="gd-doc-title">History Class Final</div> <div class="gd-doc-date">05/30/2014</div> </div> </div> <div class="gd-doc-col"> <div class="gd-doc"> <div class="gd-doc-preview"> <a href="documentation.html#"> <img src="img/doc.jpg" alt=""> </a> </div> <div class="gd-doc-title">History Class Final</div> <div class="gd-doc-date">05/30/2014</div> </div> </div> <div class="gd-doc-col"> <div class="gd-doc"> <div class="gd-doc-preview"> <a href="documentation.html#"> <img src="img/doc.jpg" alt=""> </a> </div> <div class="gd-doc-title">History Class Final</div> <div class="gd-doc-date">05/30/2014</div> </div> </div> <div class="gd-doc-col"> <div class="gd-doc"> <div class="gd-doc-preview"> <a href="documentation.html#"> <img src="img/doc.jpg" alt=""> </a> </div> <div class="gd-doc-title">History Class Final</div> <div class="gd-doc-date">05/30/2014</div> </div> </div> <div class="gd-doc-col"> <div class="gd-doc"> <div class="gd-doc-preview"> <a href="documentation.html#"> <img src="img/doc.jpg" alt=""> </a> </div> <div class="gd-doc-title">History Class Final</div> <div class="gd-doc-date">05/30/2014</div> </div> </div> <div class="gd-doc-col"> <div class="gd-doc"> <div class="gd-doc-preview"> <a href="documentation.html#"> <img src="img/doc.jpg" alt=""> </a> </div> <div class="gd-doc-title">History Class Final</div> <div class="gd-doc-date">05/30/2014</div> </div> </div> <div class="gd-doc-col"> <div class="gd-doc"> <div class="gd-doc-preview"> <a href="documentation.html#"> <img src="img/doc.jpg" alt=""> </a> </div> <div class="gd-doc-title">History Class Final</div> <div class="gd-doc-date">05/30/2014</div> </div> </div> <div class="gd-doc-col"> <div class="gd-doc"> <div class="gd-doc-preview"> <a href="documentation.html#"> <img src="img/doc.jpg" alt=""> </a> </div> <div class="gd-doc-title">History Class Final</div> <div class="gd-doc-date">05/30/2014</div> </div> </div> <div class="gd-doc-col"> <div class="gd-doc"> <div class="gd-doc-preview"> <a href="documentation.html#"> <img src="img/doc.jpg" alt=""> </a> </div> <div class="gd-doc-title">History Class Final</div> <div class="gd-doc-date">05/30/2014</div> </div> </div> </div> </div> <div class="modal-upload-bottom"> <button type="button" class="btn btn-rounded">Select</button> <button type="button" class="btn btn-rounded btn-default">Cancel</button> </div> </div><!--.tab-pane--> <div role="tabpanel" class="tab-pane" id="tab-yandex-disk"> Yandex Disk </div><!--.tab-pane--> <div role="tabpanel" class="tab-pane" id="tab-box"> Box </div><!--.tab-pane--> <div role="tabpanel" class="tab-pane" id="tab-one-drive"> One drive </div><!--.tab-pane--> </div><!--.tab-content--> </div><!--.modal-upload-cont-in--> </div><!--.modal-upload-cont--> <div class="modal-upload-side"> <ul class="upload-list" role="tablist"> <li class="nav-item"> <a href="documentation.html#tab-upload" role="tab" data-toggle="tab" class="active"> <i class="font-icon font-icon-cloud-upload-2"></i> <span>Upload</span> </a> </li> <li class="nav-item"> <a href="documentation.html#tab-dropbox" role="tab" data-toggle="tab"> <i class="font-icon font-icon-dropbox"></i> <span>Dropbox</span> </a> </li> <li class="nav-item"> <a href="documentation.html#tab-google-drive" role="tab" data-toggle="tab"> <i class="font-icon font-icon-google-drive"></i> <span>Google Drive</span> </a> </li> <li class="nav-item"> <a href="documentation.html#tab-yandex-disk" role="tab" data-toggle="tab"> <i class="font-icon font-icon-yandex-disk"></i> <span>Yandex Disk</span> </a> </li> <li class="nav-item"> <a href="documentation.html#tab-box" role="tab" data-toggle="tab"> <i class="font-icon font-icon-box"></i> <span>Box</span> </a> </li> <li class="nav-item"> <a href="documentation.html#tab-one-drive" role="tab" data-toggle="tab"> <i class="font-icon font-icon-one-drive"></i> <span>One Drive</span> </a> </li> </ul> </div> </div> </div> </div> </div><!--.modal--> <div class="modal fade" id="upload2Modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="modal-close" data-dismiss="modal" aria-label="Close"> <i class="font-icon-close-2"></i> </button> <h4 class="modal-title" id="myModalLabel">Upload File</h4> </div> <div class="modal-upload menu-bottom"> <div class="modal-upload-cont"> <div class="modal-upload-cont-in"> <div class="tab-content"> <div role="tabpanel" class="tab-pane active" id="tab-upload-2"> <div class="modal-upload-body scrollable-block"> <div class="uploading-container"> <div class="uploading-container-left"> <div class="drop-zone"> <!-- при перетаскиваении добавляем класс .dragover <div class="drop-zone dragover"> --> <i class="font-icon font-icon-cloud-upload-2"></i> <div class="drop-zone-caption">Drag file to upload</div> <span class="btn btn-rounded btn-file"> <span>Choose file</span> <input type="file" name="files[]" multiple> </span> </div> </div><!--.uploading-container-left--> <div class="uploading-container-right"> <div class="uploading-container-right-in"> <h6 class="uploading-list-title">Uploading</h6> <ul class="uploading-list"> <li class="uploading-list-item"> <div class="uploading-list-item-wrapper"> <div class="uploading-list-item-name"> <i class="font-icon font-icon-cam-photo"></i> photo.png </div> <div class="uploading-list-item-size">7,5 mb</div> <button type="button" class="uploading-list-item-close"> <i class="font-icon-close-2"></i> </button> </div> <progress class="progress" value="25" max="100"> <div class="progress"> <span class="progress-bar" style="width: 25%;">25%</span> </div> </progress> <div class="uploading-list-item-progress">37% done</div> <div class="uploading-list-item-speed">90KB/sec</div> </li> <li class="uploading-list-item"> <div class="uploading-list-item-wrapper"> <div class="uploading-list-item-name"> <i class="font-icon font-icon-page"></i> task.doc </div> <div class="uploading-list-item-size">7,5 mb</div> <button type="button" class="uploading-list-item-close"> <i class="font-icon-close-2"></i> </button> </div> <progress class="progress" value="50" max="100"> <div class="progress"> <span class="progress-bar" style="width: 50%;">50%</span> </div> </progress> <div class="uploading-list-item-progress">37% done</div> <div class="uploading-list-item-speed">90KB/sec</div> </li> <li class="uploading-list-item"> <div class="uploading-list-item-wrapper"> <div class="uploading-list-item-name"> <i class="font-icon font-icon-cam-photo"></i> dashboard.png </div> <div class="uploading-list-item-size">7,5 mb</div> <button type="button" class="uploading-list-item-close"> <i class="font-icon-close-2"></i> </button> </div> <progress class="progress" value="100" max="100"> <div class="progress"> <span class="progress-bar" style="width: 100%;">100%</span> </div> </progress> <div class="uploading-list-item-progress">Completed</div> <div class="uploading-list-item-speed">90KB/sec</div> </li> </ul> </div> </div><!--.uploading-container-right--> </div><!--.uploading-container--> </div><!--.modal-upload-body--> <div class="modal-upload-bottom"> <button type="button" class="btn btn-rounded btn-default">Cancel</button> <button type="button" class="btn btn-rounded">Done</button> </div><!--.modal-upload-bottom--> </div><!--.tab-pane--> <div role="tabpanel" class="tab-pane" id="tab-dropbox-2"> <div class="upload-dropbox"> <h3>Upload a file from Dropbox</h3> <p> Get files your Dropbox account.<br/> We play nice. You just need to login. </p> <button type="button" class="btn btn-rounded">Connect to Dropbox</button> <div class="text-muted">We will open a new page to connect your Dropbox account.</div> </div> </div><!--.tab-pane--> <div role="tabpanel" class="tab-pane" id="tab-google-drive-2"> <div class="modal-upload-body scrollable-block"> <div class="upload-gd-header"> <div class="tbl-row"> <div class="tbl-cell"> <input type="text" class="form-control form-control-rounded" placeholder="Search"/> </div> <div class="tbl-cell tbl-cell-btns"> <button type="button"> <i class="font-icon font-icon-cam-photo"></i> </button> <button type="button"> <i class="font-icon font-icon-cam-video"></i> </button> <button type="button"> <i class="font-icon font-icon-sound"></i> </button> <button type="button"> <i class="font-icon font-icon-page"></i> </button> </div> </div> </div> <div class="gd-doc-grid"> <div class="gd-doc-col"> <div class="gd-doc"> <div class="gd-doc-preview"> <a href="documentation.html#"> <img src="img/doc.jpg" alt=""> </a> </div> <div class="gd-doc-title">History Class Final</div> <div class="gd-doc-date">05/30/2014</div> </div> </div> <div class="gd-doc-col"> <div class="gd-doc"> <div class="gd-doc-preview"> <a href="documentation.html#"> <img src="img/doc.jpg" alt=""> </a> </div> <div class="gd-doc-title">History Class Final</div> <div class="gd-doc-date">05/30/2014</div> </div> </div> <div class="gd-doc-col"> <div class="gd-doc"> <div class="gd-doc-preview"> <a href="documentation.html#"> <img src="img/doc.jpg" alt=""> </a> </div> <div class="gd-doc-title">History Class Final</div> <div class="gd-doc-date">05/30/2014</div> </div> </div> <div class="gd-doc-col"> <div class="gd-doc"> <div class="gd-doc-preview"> <a href="documentation.html#"> <img src="img/doc.jpg" alt=""> </a> </div> <div class="gd-doc-title">History Class Final</div> <div class="gd-doc-date">05/30/2014</div> </div> </div> <div class="gd-doc-col"> <div class="gd-doc"> <div class="gd-doc-preview"> <a href="documentation.html#"> <img src="img/doc.jpg" alt=""> </a> </div> <div class="gd-doc-title">History Class Final</div> <div class="gd-doc-date">05/30/2014</div> </div> </div> <div class="gd-doc-col"> <div class="gd-doc"> <div class="gd-doc-preview"> <a href="documentation.html#"> <img src="img/doc.jpg" alt=""> </a> </div> <div class="gd-doc-title">History Class Final</div> <div class="gd-doc-date">05/30/2014</div> </div> </div> <div class="gd-doc-col"> <div class="gd-doc"> <div class="gd-doc-preview"> <a href="documentation.html#"> <img src="img/doc.jpg" alt=""> </a> </div> <div class="gd-doc-title">History Class Final</div> <div class="gd-doc-date">05/30/2014</div> </div> </div> <div class="gd-doc-col"> <div class="gd-doc"> <div class="gd-doc-preview"> <a href="documentation.html#"> <img src="img/doc.jpg" alt=""> </a> </div> <div class="gd-doc-title">History Class Final</div> <div class="gd-doc-date">05/30/2014</div> </div> </div> <div class="gd-doc-col"> <div class="gd-doc"> <div class="gd-doc-preview"> <a href="documentation.html#"> <img src="img/doc.jpg" alt=""> </a> </div> <div class="gd-doc-title">History Class Final</div> <div class="gd-doc-date">05/30/2014</div> </div> </div> <div class="gd-doc-col"> <div class="gd-doc"> <div class="gd-doc-preview"> <a href="documentation.html#"> <img src="img/doc.jpg" alt=""> </a> </div> <div class="gd-doc-title">History Class Final</div> <div class="gd-doc-date">05/30/2014</div> </div> </div> <div class="gd-doc-col"> <div class="gd-doc"> <div class="gd-doc-preview"> <a href="documentation.html#"> <img src="img/doc.jpg" alt=""> </a> </div> <div class="gd-doc-title">History Class Final</div> <div class="gd-doc-date">05/30/2014</div> </div> </div> <div class="gd-doc-col"> <div class="gd-doc"> <div class="gd-doc-preview"> <a href="documentation.html#"> <img src="img/doc.jpg" alt=""> </a> </div> <div class="gd-doc-title">History Class Final</div> <div class="gd-doc-date">05/30/2014</div> </div> </div> <div class="gd-doc-col"> <div class="gd-doc"> <div class="gd-doc-preview"> <a href="documentation.html#"> <img src="img/doc.jpg" alt=""> </a> </div> <div class="gd-doc-title">History Class Final</div> <div class="gd-doc-date">05/30/2014</div> </div> </div> <div class="gd-doc-col"> <div class="gd-doc"> <div class="gd-doc-preview"> <a href="documentation.html#"> <img src="img/doc.jpg" alt=""> </a> </div> <div class="gd-doc-title">History Class Final</div> <div class="gd-doc-date">05/30/2014</div> </div> </div> </div> </div> <div class="modal-upload-bottom"> <button type="button" class="btn btn-rounded">Select</button> <button type="button" class="btn btn-rounded btn-default">Cancel</button> </div> </div><!--.tab-pane--> <div role="tabpanel" class="tab-pane" id="tab-yandex-disk-2"> Yandex Disk </div><!--.tab-pane--> <div role="tabpanel" class="tab-pane" id="tab-box-2"> Box </div><!--.tab-pane--> <div role="tabpanel" class="tab-pane" id="tab-one-drive-2"> One drive </div><!--.tab-pane--> </div><!--.tab-content--> </div><!--.modal-upload-cont-in--> </div><!--.modal-upload-cont--> <div class="modal-upload-side"> <ul class="upload-list" role="tablist"> <li class="nav-item"> <a href="documentation.html#tab-upload-2" role="tab" data-toggle="tab" class="active"> <i class="font-icon font-icon-cloud-upload-2"></i> <span>Upload</span> </a> </li> <li class="nav-item"> <a href="documentation.html#tab-dropbox-2" role="tab" data-toggle="tab"> <i class="font-icon font-icon-dropbox"></i> <span>Dropbox</span> </a> </li> <li class="nav-item"> <a href="documentation.html#tab-google-drive-2" role="tab" data-toggle="tab"> <i class="font-icon font-icon-google-drive"></i> <span>Google Drive</span> </a> </li> <li class="nav-item"> <a href="documentation.html#tab-yandex-disk-2" role="tab" data-toggle="tab"> <i class="font-icon font-icon-yandex-disk"></i> <span>Yandex Disk</span> </a> </li> <li class="nav-item"> <a href="documentation.html#tab-box-2" role="tab" data-toggle="tab"> <i class="font-icon font-icon-box"></i> <span>Box</span> </a> </li> <li class="nav-item"> <a href="documentation.html#tab-one-drive-2" role="tab" data-toggle="tab"> <i class="font-icon font-icon-one-drive"></i> <span>One Drive</span> </a> </li> </ul> </div> </div> </div> </div> </div><!--.modal--> <!--Progress bar--> <!--<div class="circle-progress-bar pieProgress" role="progressbar" data-goal="100" data-barcolor="#ac6bec" data-barsize="10" aria-valuemin="0" aria-valuemax="100">--> <!--<span class="pie_progress__number">0%</span>--> <!--</div>--> </body> </html>
racerx2000/ne_stenka
application/demo/documentation.html
HTML
mit
90,630
using System; using NetMining.Data; namespace NetMining.SOM { public class SOMNeuron { public KPoint position; // This is a map to the public KPoint weights; public int id; //Initialize tyhe weights with a randon between min and max public SOMNeuron(KPoint min, KPoint max, Random rng, KPoint position, int id) { weights = new KPoint(min, max, rng); this.position = position; this.id = id; } //This updates the weights of the neuron to pull towards public void updateWeights(KPoint target, double learningRate, double influence) { for (int i = 0; i < weights.Dimensions; i++) weights[i] += (target[i] - weights[i]) * learningRate * influence; } } }
JeffBorwey/GraphClustering
NetMining/SOM/SOMNeuron.cs
C#
mit
820
<p id=a><b><p id=b></b>TEST
robashton/zombify
src/node_modules/zombie/node_modules/html5/data/tree-construction/tests1.dat-52/input.html
HTML
mit
29
/** * Usage: 程序配置项 * Author: Spikef < Spikef@Foxmail.com > * Copyright: Envirs Team < http://envirs.com > */ var fs = require('fs'); var program = require('commander'); var prompts = require('inquirer').prompt; program .command('config <option>') .description('修改配置') .action(function(option) { var site = process.site(); var configs = require(site + '/config.json'); if ( !configs[option] ) configs[option] = {}; var questions = []; switch(option) { case 'ftp': questions = [ { type: 'input', name: 'address', message: 'FTP地址' }, { type: 'input', name: 'port', message: '端口地址,如果不知道则跳过', default: 21, filter: Number }, { type: 'input', name: 'username', message: '登录用户' }, { type: 'password', name: 'username', message: '登录密码' }, { type: 'input', name: 'folder', message: '子目录,如果没有则跳过' } ]; break; case 'blog': questions = [ { type: 'input', name: 'name', message: '博客名称' }, { type: 'input', name: 'title', message: '博客标题' }, { type: 'input', name: 'author', message: '博主名称' }, { type: 'input', name: 'username', message: '登录用户' }, { type: 'password', name: 'password', message: '管理密码,' }, { type: 'input', name: 'keywords', message: '博客整站关键字' }, { type: 'input', name: 'description', message: '博客整站描述' }, { type: 'input', name: 'copyright', message: '博客版权信息' }, { type: 'input', name: 'pageSize', message: '每页显示日志条数', filter: Number } ]; break; } if ( questions.length > 0 ) { for (var i=0;i<questions.length;i++) { questions[i].default = configs[option][questions[i].name]; } prompts(questions, function(answers) { for (var i in answers) { configs[option][i] = answers[i] } fs.writeFileSync(site + '/config.json', JSON.format(configs)); }); } else { console.log('未知命令'); } });
Spikef/justshow
bin/commands/config.js
JavaScript
mit
3,870
NetJoint UI is based on [Bootstrap3](http://getbootstrap.com). ## Quick start Three quick start options are available: - Clone the repo: `git clone https://github.com/NetJoint/NetJoint-UI.git`. Run `npm install` to install dependencies. Examples: ### What's included Within the download you'll find the following directories and files, logically grouping common assets and providing both compiled and minified variations. You'll see something like this: ``` NetJoint-UI/ ├── dist/ | ├── css/ │ | ├── netjoint-ui.css │ | └── netjoint-ui.min.css | ├── js/ │ | ├── netjoint-ui.js │ | └── netjoint-ui.min.js | ├── fonts/ | └── img/ ├── examples/ └── src/ ├── components/ ├── plugins/ ├── js/ └── sass/ ``` We provide compiled CSS and JS (`netjoint-ui.*`), as well as compiled and minified CSS and JS (`netjoint-ui.min.*`). Examples forked [Bootstrap TLDR](https://github.com/anvoz/bootstrap-tldr) ## License [MIT license](http://opensource.org/licenses/MIT).
NetJoint/NetJoint-UI
README.md
Markdown
mit
1,108
Strength validation =================== The PasswordStrength constraint computes a password strength based on the following rules: * Does the password contain an alpha character? * Does the password contain both lowercase and uppercase alpha characters? * Does the password contain a digit? * Does the password contain a special character (non-alpha/digit)? * Does the password have a length of at least 13 characters. When a rules matches with the supplied password, 1 point is added to the total password strength. The minimum strength is 1 and the maximum strength is 5. The textual representation of the strength levels are as follows: * 1: Very Weak (matches one rule) * 2: Weak * 3: Medium * 4: Strong (recommended for most usages) * 5: Very Strong (matches all rules, recommended for admin or finance related services) The validator adds tips as parameter to the validation message. See the [translation files](https://github.com/rollerworks/PasswordStrengthValidator/tree/master/src/Resources/translations) for the available tips. ## Options You can use the `Rollerworks\Component\PasswordStrength\Validator\Constraints\PasswordStrength` constraint with the following options. | Option | Type | Description | | --------------- | -------- | --------------------------------------------------------------------------------------- | | message | `string` | The validation message (default: `password_too_weak`) | | minLength | `int` | Minimum length of the password, should be at least 6 (or 8 for better security) | | minStrength | `int` | Minimum required strength of the password. | | unicodeEquality | `bool` | Consider characters from other scripts (unicode) as equal (default: `false`). | | | | When set to false `²` will seen as a special character rather then 2 in another script. | ## Annotations If you are using annotations for validation, include the constraints namespace: ```php use Rollerworks\Component\PasswordStrength\Validator\Constraints as RollerworksPassword; ``` and then add the PasswordStrength constraint to the relevant field: ```php /** * @RollerworksPassword\PasswordStrength(minLength=7, minStrength=3) */ protected $password; ```
rollerworks/PasswordStrengthValidator
docs/strength-validation.md
Markdown
mit
2,425
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import datetime class Migration(migrations.Migration): dependencies = [ ('app', '0008_playlistitem_network'), ] operations = [ migrations.AddField( model_name='playlistitem', name='created_at', field=models.DateTimeField(default=datetime.datetime(2014, 10, 6, 10, 0, 29, 893833), auto_now_add=True), preserve_default=False, ), ]
m-vdb/ourplaylists
ourplaylists/app/migrations/0009_playlistitem_created_at.py
Python
mit
527
;( function( d3 ) { /** * Get parent of dom element with * given class * * @param {Object} el element * @param {String} className className * @return {Object} parent element with given class */ function getParent( el, className ) { var parent = null; var p = el.parentNode; while ( p !== null ) { var o = p; if ( o.classList.contains( className ) ) { parent = o; break; } p = o.parentNode; } return parent; // returns an Array [] } var id = window.location.href.split( '/' ).pop(); var keysToRender = [ { key : 'render', label : 'Start Render', timing : true }, { key : 'SpeedIndex', label : 'SpeedIndex' }, { key : 'domElements', label : 'Number of DOM Elements' }, { key : 'docTime', label : 'Document Complete', timing : true }, { key : 'fullyLoaded', label : 'Fully loaded', timing : true }, { key : 'requests', label : 'Number of Requests' } ]; var loading = document.getElementById( 'loading' ); var table = document.getElementById( 'resultTable' ); var template = document.getElementById( 'resultTableEachTpl' ); var status = document.getElementById( 'status' ); function _getNormalizedData( data ) { var normalizedData = []; function getNormalizedDate( date, key, type ) { var returnValue; if ( key.key !== 'requests' ) { returnValue = { value : date.response.data.median[ type ] ? date.response.data.median[ type ][ key.key ] : 0, allowed : date.allowedUrl }; } else { returnValue = { value : date.response.data.median[ type ] ? date.response.data.median[ type ][ key.key ][ 0 ] : 0, allowed : date.allowedUrl }; } if ( key.timing ) { returnValue.withoutTTFB = returnValue.value - date.response.data.median[ type ].TTFB; } return returnValue; } keysToRender.forEach( function( key ) { normalizedData.push( { name : key.label, key : key.key, timing : !! key.timing, data : [ data.map( function( date ) { return getNormalizedDate( date, key, 'firstView' ); } ), data.map( function( date ) { return getNormalizedDate( date, key, 'repeatView' ); } ) ] } ); } ) return normalizedData; } function showBarHelp( data ) { d3.selectAll( '.resultGraphs--help' ).remove(); var bar = this; var bBox = bar.getBBox(); var detailBox = document.createElement( 'div' ); var listContainer = getParent( bar, 'resultGraphs--item--container' ); detailBox.classList.add( 'resultGraphs--help' ); detailBox.innerHTML = 'Allowed 3rd Party URL(s):<br><strong>' + bar.dataset.allowed + '</strong>'; listContainer.appendChild( detailBox ); detailBox.style.left = ( bBox.x + bBox.width / 2 - detailBox.getBoundingClientRect().width / 2 ) + 'px'; detailBox.style.top = ( bBox.y + bBox.height + detailBox.getBoundingClientRect().height ) + 'px'; } function renderTable( container, data ) { var table = document.querySelector( container ); table.innerHTML = nunjucks.renderString( template.innerHTML, { data : data } ); } function renderGraphs( container, data ) { var resultGraphs = d3.select( container ); var normalizedData = _getNormalizedData( data ); var items = resultGraphs.selectAll( '.resultGraphs--item' ) .data( normalizedData ); items.enter() .append( 'li' ) .attr( 'class', 'resultGraphs--item' ) .attr( 'id', function( d ) { return 'resultGraph--item-' + d.key; } ) .html( function( d ) { return '<h4 class="resultGraphs--item--headline">' + d.name + '</h4>' + '<div class="resultGraphs--legend">' + '<span class="resultGraphs--legend__first">First</span>' + '<span class="resultGraphs--legend__repeat">Repeat</span>' + '</div>' + '<div class="resultGraphs--item--container"></div>'; } ); items.each( renderGraph ); items.exit().remove() } function renderGraph( data ) { var containerEl = this.querySelector( '.resultGraphs--item--container' ); var margin = { top : 25, right : 0, bottom : 30, left : 0 }; var width = containerEl.clientWidth - margin.left - margin.right; var height = width * 0.6 - margin.top - margin.bottom; var y = d3.scale.linear() .domain( [ 0, d3.max( [ d3.max( data.data[ 0 ].map( function( d ) { return d.value; } ) ), d3.max( data.data[ 1 ].map( function( d ) { return d.value; } ) ) ] ) ] ) .range( [ height, 0 ] ) var x = d3.scale.linear() .domain( [ 0, data.data[ 0 ].length + 1 ] ) .range( [ 0, width ] ); var xAxis = d3.svg.axis() .scale( x ) .tickFormat( function( d ) { return ( d % 1 !== 0 || ! d || d === data.data[ 0 ].length + 1 ) ? '' : d; } ) .orient( 'bottom' ); var yAxis = d3.svg.axis() .scale( y ) .tickSize( width ) .orient( 'right' ); var line = d3.svg.line() .x( function( d, i ) { return x( i + 1 ); } ) .y( function( d ) { return y( d.value ); } ) .interpolate( 'cardinal' ); var container = d3.select( containerEl ).html( '<svg></svg>' ); var svg = container.select( 'svg' ) .attr( 'width', width + margin.left + margin.right ) .attr( 'height', height + margin.top + margin.bottom ) .append( 'g' ) .attr( 'transform', 'translate(' + margin.left + ',' + margin.top + ')'); var barChartWidth = 12; var marks = svg.append( 'g' ) .attr( 'class', 'resultGraphs--marks' ); var bgBars = svg.append( 'g' ) .attr( 'class', 'resultGraphs--bgBars' ); bgBars.selectAll( '.resultGraphs--bgBar' ) .data( data.data[ 0 ] ) .enter().append( 'rect' ) .attr( 'class', 'resultGraphs--bgBar' ) .attr( 'x', function( d, i ) { return x( i + .5 ); } ) .attr( 'width', function( d, i ) { return x( i + .5 ) - x( i - .5 ) } ) .attr( 'y', function( d ) { return 0; } ) .attr( 'height', function( d ) { return height; } ) .attr( 'data-allowed', function( d ) { return d.allowed } ) .on( 'mouseenter', showBarHelp ); var gy = svg.append( 'g' ) .attr( 'class', 'resultGraphs--yAxisTicks' ) .call( yAxis ) .call( customAxis ); var gx = svg.append( 'g' ) .attr( 'class', 'resultGraphs--xAxisTicks' ) .attr( 'transform', 'translate(0,' + height + ')' ) .call( xAxis ); var circles = svg.append( 'g' ) .attr( 'class', 'resultGraphs--circles' ); drawLineWithCircles( data.data[ 0 ], 'first', svg, circles ); drawLineWithCircles( data.data[ 1 ], 'repeat', svg, circles ); // TODO implement this in a different way // if ( data.timing ) { // drawLineWithCircles( data.data[ 0 ].map( function( date ) { // return { // allowed : date.allowed, // value : date.withoutTTFB // }; // } ), 'firstWithoutTTFB', svg, circles ); // drawLineWithCircles( data.data[ 1 ].map( function( date ) { // return { // allowed : date.allowed, // value : date.withoutTTFB // }; // } ), 'repeatWithoutTTFB', svg, circles ); // } function drawLineWithCircles( data, type, svg, circleContainer ) { svg.append( 'path' ) .datum( data ) .attr( 'class', 'resultGraphs--line__' + type ) .attr( 'd', line ); circleContainer.selectAll( '.resultGraphs--circle__' + type ) .data( data ) .enter().append( 'circle' ) .attr( 'r', 5 ) .attr( 'class', 'resultGraphs--circle__' + type ) .attr( 'cx', function( d, i ) { return x( i + 1 ); } ) .attr( 'cy', function( d ) { return y( d.value ); }); } function customAxis( g ) { g.selectAll( 'text' ) .attr( 'x', 4 ) .attr( 'dy', -4 ); } } function fetchData() { fetch( '/results/data/' + id ) .then( function( response ) { return response.json(); } ) .then( function( result ) { if ( result.data.length > 1 && ! result.error ) { var allVsNoneData = [ result.data[ 0 ], result.data[ 1 ] ]; renderTable( '#resultTable--allVsNone', allVsNoneData ); renderGraphs( '#resultGraphs--allVsNone', allVsNoneData ); var noneVsEachData = result.data.slice( 1 ); renderTable( '#resultTable--noneVsEach', noneVsEachData ); renderGraphs( '#resultGraphs--noneVsEach', noneVsEachData ); } if ( ! result.finished ) { loading.innerText = result.runsToGo ? result.runsToGo + ' run(s) to go' : 'Processing...'; setTimeout( fetchData, 7500 ); } else { status.classList.remove( 'is-processing' ); if ( ! result.error ) { status.classList.add( 'is-done' ); loading.innerText = 'DONE!'; } else { status.classList.add( 'is-failed' ); loading.innerText = 'FAILED...'; } } } ); } fetchData(); } )( d3 );
3rd-party-bouncer/bouncer-www
assets/scripts/results.js
JavaScript
mit
9,905
package au.com.acegi.hashbench.hashers; import java.nio.ByteBuffer; import java.util.Map; import net.jpountz.xxhash.XXHash64; import net.jpountz.xxhash.XXHashFactory; public class Jp64Hasher implements Hasher { public static final String XXH64_JNI = "xxh64-jpountz-jni"; public static final String XXH64_SAFE = "xxh64-jpountz-safe"; public static final String XXH64_UNSAFE = "xxh64-jpountz-unsafe"; public static final void register(final Map<String, Hasher> hashers) { hashers.put(Jp64Hasher.XXH64_JNI, new Jp64Hasher(XXHashFactory.nativeInstance().hash64())); hashers.put(Jp64Hasher.XXH64_UNSAFE, new Jp64Hasher(XXHashFactory.unsafeInstance().hash64())); hashers.put(Jp64Hasher.XXH64_SAFE, new Jp64Hasher(XXHashFactory.safeInstance().hash64())); } private final XXHash64 delegate; private Jp64Hasher(final XXHash64 delegate) { this.delegate = delegate; } @Override public long hash(final byte[] in, final int off, final int len) { return this.delegate.hash(in, off, len, 0); } @Override public long hash(final ByteBuffer bb, final int off, final int len) { return this.delegate.hash(bb, off, len, 0); } }
benalexau/hash-bench
src/main/java/au/com/acegi/hashbench/hashers/Jp64Hasher.java
Java
mit
1,203
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>pts: Not compatible 👼</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.15.0 / pts - 8.7.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> pts <small> 8.7.0 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-02-18 08:58:34 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-02-18 08:58:34 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils conf-gmp 4 Virtual package relying on a GMP lib system installation coq 8.15.0 Formal proof management system dune 2.9.3 Fast, portable, and opinionated build system ocaml 4.13.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.13.1 Official release 4.13.1 ocaml-config 2 OCaml Switch Configuration ocaml-options-vanilla 1 Ensure that OCaml is compiled with no special options enabled ocamlfind 1.9.3 A library manager for OCaml zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;Hugo.Herbelin@inria.fr&quot; homepage: &quot;https://github.com/coq-contribs/pts&quot; license: &quot;Unknown&quot; build: [make &quot;-j%{jobs}%&quot;] install: [make &quot;install&quot;] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/PTS&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.7&quot; &amp; &lt; &quot;8.8~&quot;} ] tags: [ &quot;keyword: pure type systems&quot; &quot;keyword: metatheory&quot; &quot;category: Computer Science/Lambda Calculi&quot; &quot;date: 2007-03&quot; ] authors: [ &quot;Bruno Barras&quot; ] bug-reports: &quot;https://github.com/coq-contribs/pts/issues&quot; dev-repo: &quot;git+https://github.com/coq-contribs/pts.git&quot; synopsis: &quot;A formalisation of Pure Type Systems&quot; description: &quot;&quot;&quot; This contrib is a formalization of Pure Type Systems. It includes most of the basic metatheoretical properties: weakening, substitution, subject-reduction, decidability of type-checking (for strongly normalizing PTSs). Strengtheningis not proven here. The kernel of a very simple proof checker is automatically generated from the proofs. A small interface allows interacting with this kernel, making up a standalone proof system. The Makefile has a special target &quot;html&quot; that produces html files from the sources and main.html that gives a short overview.&quot;&quot;&quot; flags: light-uninstall url { src: &quot;https://github.com/coq-contribs/pts/archive/v8.7.0.tar.gz&quot; checksum: &quot;md5=ca1af1e28c05f1cc931b3c371a3d1c5a&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install 🏜️</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-pts.8.7.0 coq.8.15.0</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.15.0). The following dependencies couldn&#39;t be met: - coq-pts -&gt; coq &lt; 8.8~ -&gt; ocaml &lt; 4.10 base of this switch (use `--unlock-base&#39; to force) No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-pts.8.7.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
coq-bench/coq-bench.github.io
clean/Linux-x86_64-4.13.1-2.0.10/released/8.15.0/pts/8.7.0.html
HTML
mit
7,417
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>plouffe: Not compatible</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.11.2 / plouffe - 1.3.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> plouffe <small> 1.3.0 <span class="label label-info">Not compatible</span> </small> </h1> <p><em><script>document.write(moment("2021-03-31 05:27:10 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2021-03-31 05:27:10 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils coq 8.11.2 Formal proof management system num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic ocaml 4.10.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.10.1 Official release 4.10.1 ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.1 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;Laurent.Thery@inria.fr&quot; homepage: &quot;https://github.com/thery/Plouffe&quot; bug-reports: &quot;https://github.com/thery/Plouffe/issues&quot; license: &quot;MIT&quot; build: [ [&quot;./configure.sh&quot;] [make &quot;-j%{jobs}%&quot;] ] install: [make &quot;install&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.6&quot; &amp; &lt; &quot;8.7~&quot;} &quot;coq-mathcomp-ssreflect&quot; &quot;coq-coquelicot&quot; {&gt;= &quot;3.0.0&quot;} ] tags: [ &quot;logpath:Plouffe&quot; ] synopsis: &quot;A Coq formalization of Plouffe formula&quot; authors: &quot;Laurent Thery&quot; url { src: &quot;https://github.com/thery/Plouffe/archive/v1.3.0.zip&quot; checksum: &quot;md5=0492dd6ce8fa84ffb75c9e6af34aac89&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-plouffe.1.3.0 coq.8.11.2</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.11.2). The following dependencies couldn&#39;t be met: - coq-plouffe -&gt; coq &lt; 8.7~ -&gt; ocaml &lt; 4.06.0 base of this switch (use `--unlock-base&#39; to force) No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-plouffe.1.3.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> <small>Sources are on <a href="https://github.com/coq-bench">GitHub</a>. © Guillaume Claret.</small> </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
coq-bench/coq-bench.github.io
clean/Linux-x86_64-4.10.1-2.0.6/released/8.11.2/plouffe/1.3.0.html
HTML
mit
6,331
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>metacoq-template: Not compatible</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.9.1 / metacoq-template - 1.0~alpha+8.8</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> metacoq-template <small> 1.0~alpha+8.8 <span class="label label-info">Not compatible</span> </small> </h1> <p><em><script>document.write(moment("2020-03-13 06:10:22 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2020-03-13 06:10:22 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base camlp5 7.11 Preprocessor-pretty-printer of OCaml conf-findutils 1 Virtual package relying on findutils conf-m4 1 Virtual package relying on m4 coq 8.9.1 Formal proof management system num 1.3 The legacy Num library for arbitrary-precision integer and rational arithmetic ocaml 4.09.0 The OCaml compiler (virtual package) ocaml-base-compiler 4.09.0 Official release 4.09.0 ocaml-config 1 OCaml Switch Configuration ocamlfind 1.8.1 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;matthieu.sozeau@inria.fr&quot; homepage: &quot;https://metacoq.github.io/metacoq&quot; dev-repo: &quot;git+https://github.com/MetaCoq/metacoq.git#coq-8.8&quot; bug-reports: &quot;https://github.com/MetaCoq/metacoq/issues&quot; authors: [&quot;Abhishek Anand &lt;aa755@cs.cornell.edu&gt;&quot; &quot;Simon Boulier &lt;simon.boulier@inria.fr&gt;&quot; &quot;Cyril Cohen &lt;cyril.cohen@inria.fr&gt;&quot; &quot;Yannick Forster &lt;forster@ps.uni-saarland.de&gt;&quot; &quot;Fabian Kunze &lt;fkunze@fakusb.de&gt;&quot; &quot;Gregory Malecha &lt;gmalecha@gmail.com&gt;&quot; &quot;Matthieu Sozeau &lt;matthieu.sozeau@inria.fr&gt;&quot; &quot;Nicolas Tabareau &lt;nicolas.tabareau@inria.fr&gt;&quot; &quot;Théo Winterhalter &lt;theo.winterhalter@inria.fr&gt;&quot; ] license: &quot;MIT&quot; build: [ [&quot;sh&quot; &quot;./configure.sh&quot;] [make &quot;-j%{jobs}%&quot; &quot;template-coq&quot;] ] install: [ [make &quot;-C&quot; &quot;template-coq&quot; &quot;install&quot;] ] depends: [ &quot;ocaml&quot; {&gt; &quot;4.02.3&quot;} &quot;coq&quot; {&gt;= &quot;8.8&quot; &amp; &lt; &quot;8.9~&quot;} ] synopsis: &quot;A quoting and unquoting library for Coq in Coq&quot; description: &quot;&quot;&quot; MetaCoq is a meta-programming framework for Coq. Template Coq is a quoting library for Coq. It takes Coq terms and constructs a representation of their syntax tree as a Coq inductive data type. The representation is based on the kernel&#39;s term representation. In addition to a complete reification and denotation of CIC terms, Template Coq includes: - Reification of the environment structures, for constant and inductive declarations. - Denotation of terms and global declarations - A monad for manipulating global declarations, calling the type checker, and inserting them in the global environment, in the style of MetaCoq/MTac. &quot;&quot;&quot; url { src: &quot;https://github.com/MetaCoq/metacoq/archive/1.0-alpha+8.8.tar.gz&quot; checksum: &quot;sha256=c2fe122ad30849e99c1e5c100af5490cef0e94246f8eb83f6df3f2ccf9edfc04&quot; }</pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-metacoq-template.1.0~alpha+8.8 coq.8.9.1</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.9.1). The following dependencies couldn&#39;t be met: - coq-metacoq-template -&gt; coq &lt; 8.9~ -&gt; ocaml &lt; 4.06.0 base of this switch (use `--unlock-base&#39; to force) Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-metacoq-template.1.0~alpha+8.8</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> <small>Sources are on <a href="https://github.com/coq-bench">GitHub</a>. © Guillaume Claret.</small> </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
coq-bench/coq-bench.github.io
clean/Linux-x86_64-4.09.0-2.0.5/released/8.9.1/metacoq-template/1.0~alpha+8.8.html
HTML
mit
8,023
<?php /** * Released under the MIT License. * * Copyright (c) 2017 Miha Vrhovnik <miha.vrhovnik@gmail.com> * * 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. */ namespace mvrhov\PhinxBundle\Command; use Phinx\Console\Command\AbstractCommand; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; class RollbackCommand extends AbstractCommand { use CommonTrait; /** * {@inheritdoc} */ protected function configure() { $this->setName('phinx:rollback') ->setDescription('Rollback the last or to a specific migration') ->addOption('--target', '-t', InputOption::VALUE_REQUIRED, 'The version number to rollback to') ->addOption('--date', '-d', InputOption::VALUE_REQUIRED, 'The date to rollback to') ->addOption('--force', '-f', InputOption::VALUE_NONE, 'Force rollback to ignore breakpoints') ->setHelp( <<<EOT The <info>rollback</info> command reverts the last migration, or optionally up to a specific version <info>phinx rollback</info> <info>phinx rollback -t 20111018185412</info> <info>phinx rollback -d 20111018</info> <info>phinx rollback -v</info> <info>phinx rollback -t 20111018185412 -f</info> If you have a breakpoint set, then you can rollback to target 0 and the rollbacks will stop at the breakpoint. <info>phinx rollback -t 0 </info> EOT ); } /** * Rollback the migration. * * @param InputInterface $input * @param OutputInterface $output * * @return void */ protected function execute(InputInterface $input, OutputInterface $output) { $this->initialize($input, $output); $version = $input->getOption('target'); $date = $input->getOption('date'); $force = !!$input->getOption('force'); $envOptions = $this->getConfig()->getEnvironment('default'); if (isset($envOptions['adapter'])) { $output->writeln('<info>using adapter</info> ' . $envOptions['adapter']); } if (isset($envOptions['wrapper'])) { $output->writeln('<info>using wrapper</info> ' . $envOptions['wrapper']); } if (isset($envOptions['name'])) { $output->writeln('<info>using database</info> ' . $envOptions['name']); } // rollback the specified environment $start = microtime(true); if (null !== $date) { $this->getManager()->rollbackToDateTime('default', new \DateTime($date), $force); } else { $this->getManager()->rollback('default', $version, $force); } $end = microtime(true); $output->writeln(''); $output->writeln('<comment>All Done. Took ' . sprintf('%.4fs', $end - $start) . '</comment>'); } }
mvrhov/mvrhovPhinxBundle
Command/RollbackCommand.php
PHP
mit
3,894
require "priam/command/cql/create" module Priam::Command module Cql def self.run(argv, input_stream=$stdin, output_stream=$stdout) command = argv.shift case command when "create" exit_code = Priam::Command::Cql::Create.run(argv) || 0 else STDERR.puts "Invalid cql command: '#{command}'" exit_code = 1 end return exit_code end end end
haracane/priam
lib/priam/command/cql.rb
Ruby
mit
406
package cc.ferreira.gcal2slack.rules import java.time.LocalDateTime import java.time.LocalDateTime.now import java.time.ZoneOffset.UTC import cc.ferreira.gcal2slack.calendar.CalendarEvent import cc.ferreira.gcal2slack.messaging.MessagingStatus object StatusCalculator { def chooseStatus(events: Seq[CalendarEvent], rules: Seq[MappingRule], time: LocalDateTime = now): Option[MessagingStatus] = { def distance(begin: LocalDateTime, end: LocalDateTime) = math.abs(end.toEpochSecond(UTC) - begin.toEpochSecond(UTC)) events .filter(_.contains(time)) .sortBy(e => distance(e.begin, time)) .sortBy(_.allDay) // false < true .flatMap(e => rules.find(r => e.contains(r.matchText))) .headOption .map(MessagingStatus(_)) } }
hugocf/gcal-slack-update
src/main/scala/cc/ferreira/gcal2slack/rules/StatusCalculator.scala
Scala
mit
775
#!/usr/bin/env python from math import pi, sin, log, exp, atan DEG_TO_RAD = pi / 180 RAD_TO_DEG = 180 / pi def minmax (a,b,c): a = max(a,b) a = min(a,c) return a class GoogleProjection: """ Google projection transformations. Sourced from the OSM. Have not taken the time to figure out how this works. """ def __init__(self, levels=18): self.Bc = [] self.Cc = [] self.zc = [] self.Ac = [] c = 256 for d in range(levels + 1): e = c/2; self.Bc.append(c/360.0) self.Cc.append(c/(2 * pi)) self.zc.append((e,e)) self.Ac.append(c) c *= 2 def fromLLtoPixel(self, ll, zoom): d = self.zc[zoom] e = round(d[0] + ll[0] * self.Bc[zoom]) f = minmax(sin(DEG_TO_RAD * ll[1]),-0.9999,0.9999) g = round(d[1] + 0.5*log((1+f)/(1-f))*-self.Cc[zoom]) return (e,g) def fromPixelToLL(self, px, zoom): e = self.zc[zoom] f = (px[0] - e[0])/self.Bc[zoom] g = (px[1] - e[1])/-self.Cc[zoom] h = RAD_TO_DEG * ( 2 * atan(exp(g)) - 0.5 * pi) return (f,h)
onyxfish/invar
invar/projections.py
Python
mit
1,202
module.exports = function (Clase) { Clase.saluda = function (msg, cb) { cb(null, 'Hola pos... ' + msg); }; Clase.remoteMethod( 'saluda', { accepts: { arg: 'msg', type: 'string' }, returns: { arg: 'greeting', type: 'string' } } ); Clase.getcomuna = function (idcomuna, callback) { Clase.find({ //include: ['deporte', 'establecimiento', 'entrenador'], include: ['deporte', { establecimiento: ['comuna'], }], where: { idComuna: idcomuna } }, function (err, clases) { callback(null, clases); }); }; Clase.remoteMethod( 'getcomuna', { accepts: { art: 'idcomuna', type: 'integer' }, returns: { arg: 'comuna', type: 'string' } }); };
amenadiel/craack
common/models/clase.js
JavaScript
mit
750
using System.Data; using VentaElectrodomesticos.Core.Model.Entities; namespace VentaElectrodomesticos.Core.Repositories { /// <summary> /// Define metodos para el repositorio de categorias de productos. /// </summary> internal interface ICategoriasRepository { /// <summary> /// Retorna las categorias del sistema. /// </summary> /// <returns></returns> Categoria[] List(); /// <summary> /// Retorna los datos de las mejores categorias del Año y Sucursal. /// </summary> /// <param name="sucursalId">Sucursal a analizar.</param> /// <param name="anio">Año a analizar.</param> /// <returns>Datos de las mejores categorias.</returns> DataTable GetMejoresCategorias(int sucursalId, int anio); } }
navarroaxel/VentaElectrodomesticos
VentaElectrodomesticosCore/Repositories/ICategoriasRepository.cs
C#
mit
820
<html> <head> <style> #pubcloud{ position: relative; border: 2pt solid gray; margin-left: auto; margin-right: auto; border-collapse: collapse; } #pubcloud tr{ height: 5px; } #pubcloud td{ border: 1pt solid gray; /*border: none;*/ max-width: 10px; margin: 0px; padding: 0px; width: 5px; height: 5px; font-family: Rockwell; font-weight: bold; overflow: content; vertical-align: top; } .tag{ position: relative; box-sizing: border-box; padding: 0; margin: 0; } .small{ font-size: 2em; line-height: 30px; height: 30px; } .medium{ font-size: 3em; line-height: 30px; height: 30px; } .large{ font-size: 4em; line-height: 30px; height: 30px; } .huge{ font-size: 4.5em; line-height: .7; } </style> <script> function showframe(){ document.getElementById("huckframe").style.display = "block"; } function hideframe(){ document.getElementById("huckframe").style.display = "none"; } </script> </head> <body> <table id=pubcloud> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> </table> </body> </html>
andymeneely/pubcloud
eg/example4.html
HTML
mit
16,439
package madgik.exareme.master.gateway.async.handler; import com.google.gson.Gson; import madgik.exareme.master.gateway.ExaremeGatewayUtils; import madgik.exareme.master.gateway.OptiqueStreamQueryMetadata.StreamRegisterQuery; import madgik.exareme.master.registry.Registry; import org.apache.http.*; import org.apache.http.message.BasicHttpResponse; import org.apache.http.nio.entity.NStringEntity; import org.apache.http.nio.protocol.*; import org.apache.http.protocol.HttpContext; import org.apache.http.util.EntityUtils; import org.apache.log4j.Logger; import java.io.IOException; import java.util.HashMap; import java.util.Locale; public class HttpAsyncTablesMetadataHandler implements HttpAsyncRequestHandler<HttpRequest> { private static final Logger log = Logger.getLogger(HttpAsyncStreamQueryInfoHandler.class); public HttpAsyncTablesMetadataHandler() { } @Override public HttpAsyncRequestConsumer<HttpRequest> processRequest(HttpRequest request, HttpContext context) throws HttpException, IOException { return new BasicAsyncRequestConsumer(); } @Override public void handle(HttpRequest httpRequest, HttpAsyncExchange httpExchange, HttpContext context) throws HttpException, IOException { HttpResponse httpResponse = httpExchange.getResponse(); log.info("Validating request .."); String method = httpRequest.getRequestLine().getMethod().toUpperCase(Locale.ENGLISH); if (!"GET".equals(method) && !"POST".equals(method)) { throw new UnsupportedHttpVersionException(method + "not supported."); } // parse content String content = ""; if (httpRequest instanceof HttpEntityEnclosingRequest) { log.debug("Stream ..."); HttpEntity entity = ((HttpEntityEnclosingRequest) httpRequest).getEntity(); content = EntityUtils.toString(entity); } HashMap<String, String> inputContent = new HashMap<String, String>(); ExaremeGatewayUtils.getValues(content, inputContent); log.trace("Content: " + inputContent.toString()); String dbname = inputContent.get(ExaremeGatewayUtils.REQUEST_DATABASE); log.debug("--DB " + dbname); String infoJson = null; try { Gson gson = new Gson(); StreamRegisterQuery registerQuery = StreamRegisterQuery.getInstance(); infoJson = gson.toJson(Registry.getInstance(dbname).getMetadata()); } catch (Exception ex) { log.error(ex); HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_INTERNAL_SERVER_ERROR, ex.getMessage()); httpExchange.submitResponse(new BasicAsyncResponseProducer(response)); return; } HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK"); HttpEntity entity = new NStringEntity(infoJson); response.setEntity(entity); httpExchange.submitResponse(new BasicAsyncResponseProducer(response)); } }
madgik/exareme
Exareme-Docker/src/exareme/exareme-master/src/main/java/madgik/exareme/master/gateway/async/handler/HttpAsyncTablesMetadataHandler.java
Java
mit
3,187
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Konichiwa - Blog</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css"> <link href='https://fonts.googleapis.com/css?family=Ubuntu' rel='stylesheet' type='text/css'> <link href="../css/default.css" rel="stylesheet"> <link href="../css/blog.css" rel="stylesheet"> </head> <body> <nav> <ul class="list-inline"> <li> <a href="../index.html">Home</a> </li> <li> <a href="../projects/projects-index.html">Projects</a> </li> <li> <a href="blog-index.html" class="active-tab">Blogs</a> </li> <li> <a href="../about.html">About</a> </li> </ul> </nav> <header> <div id="title"> Ruby Enumerable Group By Method </div> </header> <main> <h1>Posted on January 30, 2016</h1> <hr class="date-posted"> <h1>Definition</h1> <p> The <strong>group_by</strong> method performs an operation on every element of an array and groups them based on the result of the calculation. The method returns a result as a hash, where the keys are the result of the evaluation and the values are the inputs. </p> <h1>Analysis</h1> <p> In order for the method to work properly, the condition that is being applied must be valid to all the elements in the array. If an element in the array does not have the method, or can not perform the passed operation, an error will result. The best way to explore this is through code examples. </p> <h1>String Arrays</h1> <br> <pre> string_array = ["this", "is", "a", "string", "array"] string_array.group_by {|str| str.length} => {4=>["this"], 2=>["is"], 1=>["a"], 6=>["string"], 5=>["array"]} string_array.group_by {|str| str * 3} => {"thisthisthis"=>["this"], "isisis"=>["is"], "aaa"=>["a"], "stringstringstring"=>["string"], "arrayarrayarray"=>["array"]} string_array.group_by {|str| str / 3} NoMethodError: undefined method `/' for "this":String from (irb):734:in `block in irb_binding' from (irb):734:in `each' from (irb):734:in `group_by' from (irb):734 </pre> <br> <h1>Integer Arrays</h1> <br> <pre> int_array = [1,2,3,4,5] int_array.group_by {|int| int % 2} => {1=>[1, 3, 5], 0=>[2, 4]} int_array.group_by {|int| int.even?} => {false=>[1, 3, 5], true=>[2, 4]} int_array.group_by {|int| int.length} NoMethodError: undefined method `length' for 1:Fixnum from (irb):737:in `block in irb_binding' from (irb):737:in `each' from (irb):737:in `group_by' from (irb):737 </pre> <br> <h1>Mixed Arrays</h1> <br> <pre> mixed_array = [1, 2, 3, "one", "two", "three", :one, :two, :three] mixed_array.group_by {|element| element} => {1=>[1], 2=>[2], 3=>[3], "one"=>["one"], "two"=>["two"], "three"=>["three"], :one=>[:one], :two=>[:two], :three=>[:three]} mixed_array.group_by {|element| element * 2} NoMethodError: undefined method `*' for :one:Symbol from (irb):740:in `block in irb_binding' from (irb):740:in `each' from (irb):740:in `group_by' from (irb):740 mixed_array.group_by {|element| element.odd?} NoMethodError: undefined method `odd?' for "one":String from (irb):741:in `block in irb_binding' from (irb):741:in `each' from (irb):741:in `group_by' from (irb):741 mixed_array.group_by {|element| element.size} => {8=>[1, 2, 3], 3=>["one", "two", :one, :two], 5=>["three", :three]} </pre> <br> <h1>Resources</h1> <section class="resources"> <a href="http://ruby-doc.org/core-2.3.0/Enumerable.html#method-i-group_by"> Ruby Enumerable: Group By method </a><br> </section> </main> <footer> <div class="footer-social"> <ul class="footer-inline"> <li> <a href="https://twitter.com/konichiwa12001"> <span class="fa-stack fa-lg"> <i class="fa fa-circle fa-stack-2x"></i> <i class="fa fa-twitter fa-stack-1x"></i> </span> </a> </li> <li> <a href="mailto: konichiwa1200@gmail.com"> <span class="fa-stack fa-lg"> <i class="fa fa-circle fa-stack-2x"></i> <i class="fa fa-envelope fa-stack-1x"></i> </span> </a> </li> <li> <a href="https://github.com/konichiwa1200"> <span class="fa-stack fa-lg"> <i class="fa fa-circle fa-stack-2x"></i> <i class="fa fa-github fa-stack-1x"></i> </span> </a> </li> <li> <a href="https://linkedin.com"> <span class="fa-stack fa-lg"> <i class="fa fa-circle fa-stack-2x"></i> <i class="fa fa-linkedin fa-stack-1x"></i> </span> </a> </li> </ul> <p class="copyright text-muted">Copyright &copy; Konichiwa Inc. 2016</p> </div> </footer> </body> </html>
konichiwa1200/konichiwa1200.github.io
blog/enumerable-methods.html
HTML
mit
5,864
<?php /** @noinspection PhpDocSignatureInspection */ namespace App\Tests\Functional\Services\TaskExaminer\WebPageTask; use App\Entity\Task\Output; use App\Entity\Task\Task; use App\Event\TaskEvent; use App\Model\Source; use App\Services\SourceFactory; use App\Services\TaskExaminer\WebPageTask\InvalidSourceExaminer; use App\Tests\Functional\AbstractBaseTestCase; use App\Tests\Services\TestTaskFactory; class WebPageTaskInvalidSourceExaminerTest extends AbstractBaseTestCase { /** * @var InvalidSourceExaminer */ private $examiner; /** * {@inheritdoc} */ protected function setUp() { parent::setUp(); $this->examiner = self::$container->get(InvalidSourceExaminer::class); } /** * @dataProvider examineNoChangesDataProvider */ public function testInvokeNoChanges(callable $taskCreator, bool $expectedPropagationIsStopped) { /* @var Task $task */ $task = $taskCreator(); $taskEvent = new TaskEvent($task); $this->examiner->__invoke($taskEvent); $this->assertEquals($expectedPropagationIsStopped, $taskEvent->isPropagationStopped()); } /** * @dataProvider examineNoChangesDataProvider */ public function testExamineNoChanges(callable $taskCreator, bool $expectedPropagationIsStopped) { /* @var Task $task */ $task = $taskCreator(); $taskState = $task->getState(); $expectedReturnValue = !$expectedPropagationIsStopped; $returnValue = $this->examiner->examine($task); $this->assertEquals($expectedReturnValue, $returnValue); $this->assertEquals($taskState, $task->getState()); $this->assertNull($task->getOutput()); } public function examineNoChangesDataProvider() { return [ 'no sources' => [ 'taskCreator' => function (): Task { $testTaskFactory = self::$container->get(TestTaskFactory::class); return $testTaskFactory->create( TestTaskFactory::createTaskValuesFromDefaults() ); }, 'expectedPropagationIsStopped' => true, ], 'no primary source' => [ 'taskCreator' => function (): Task { $testTaskFactory = self::$container->get(TestTaskFactory::class); $sourceFactory = self::$container->get(SourceFactory::class); $task = $testTaskFactory->create( TestTaskFactory::createTaskValuesFromDefaults() ); $task->addSource( $sourceFactory->createHttpFailedSource('http://example.com/404', 404) ); return $task; }, 'expectedPropagationIsStopped' => true, ], 'invalid primary source, not invalid content type' => [ 'taskCreator' => function (): Task { $testTaskFactory = self::$container->get(TestTaskFactory::class); $sourceFactory = self::$container->get(SourceFactory::class); $task = $testTaskFactory->create( TestTaskFactory::createTaskValuesFromDefaults() ); $task->addSource( $sourceFactory->createHttpFailedSource($task->getUrl(), 404) ); return $task; }, 'expectedPropagationIsStopped' => false, ], 'non-empty cached resource' => [ 'taskCreator' => function (): Task { $testTaskFactory = self::$container->get(TestTaskFactory::class); $task = $testTaskFactory->create( TestTaskFactory::createTaskValuesFromDefaults() ); $testTaskFactory->addPrimaryCachedResourceSourceToTask($task, 'non-empty content'); return $task; }, 'expectedPropagationIsStopped' => false, ], ]; } /** * @dataProvider examineSetsTaskAsSkippedDataProvider */ public function testInvokeSetsTaskAsSkipped(callable $taskCreator) { /* @var Task $task */ $task = $taskCreator(); $taskEvent = new TaskEvent($task); $this->examiner->__invoke($taskEvent); $this->assertTrue($taskEvent->isPropagationStopped()); } /** * @dataProvider examineSetsTaskAsSkippedDataProvider */ public function testExamineSetsTaskAsSkipped(callable $taskCreator) { /* @var Task $task */ $task = $taskCreator(); $this->assertEquals(Task::STATE_QUEUED, $task->getState()); $this->assertNull($task->getOutput()); $this->examiner->examine($task); $this->assertEquals(Task::STATE_SKIPPED, $task->getState()); $taskOutput = $task->getOutput(); $this->assertInstanceOf(Output::class, $taskOutput); $this->assertEquals(0, $taskOutput->getErrorCount()); $this->assertEquals(0, $taskOutput->getWarningCount()); $this->assertEquals('', $taskOutput->getContent()); } public function examineSetsTaskAsSkippedDataProvider() { return [ 'invalid primary source, is invalid content type' => [ 'taskCreator' => function (): Task { $testTaskFactory = self::$container->get(TestTaskFactory::class); $sourceFactory = self::$container->get(SourceFactory::class); $task = $testTaskFactory->create( TestTaskFactory::createTaskValuesFromDefaults() ); $source = $sourceFactory->createInvalidSource( $task->getUrl(), Source::MESSAGE_INVALID_CONTENT_TYPE ); $task->addSource($source); return $task; }, ], 'empty cached resource' => [ 'taskCreator' => function (): Task { $testTaskFactory = self::$container->get(TestTaskFactory::class); $task = $testTaskFactory->create( TestTaskFactory::createTaskValuesFromDefaults() ); $testTaskFactory->addPrimaryCachedResourceSourceToTask($task, ''); return $task; }, ], ]; } /** * @dataProvider examineCompleteTaskDataProvider */ public function testExamineCompleteTask(string $state) { $task = new Task(); $task->setState($state); $this->assertFalse($this->examiner->examine($task)); } public function examineCompleteTaskDataProvider(): array { return [ 'completed' => [ 'state' => Task::STATE_COMPLETED, ], 'cancelled' => [ 'state' => Task::STATE_CANCELLED, ], 'failed no retry available' => [ 'state' => Task::STATE_FAILED_NO_RETRY_AVAILABLE, ], 'failed retry available' => [ 'state' => Task::STATE_FAILED_RETRY_AVAILABLE, ], 'failed retry limit reached' => [ 'state' => Task::STATE_FAILED_RETRY_LIMIT_REACHED, ], 'skipped' => [ 'state' => Task::STATE_SKIPPED, ], ]; } protected function tearDown() { parent::tearDown(); \Mockery::close(); } }
webignition/worker.simplytestable.com
tests/Functional/Services/TaskExaminer/WebPageTask/WebPageTaskInvalidSourceExaminerTest.php
PHP
mit
7,779
var util = require('util'); var path = require('path'); var chalk = require('chalk'); var BaseReporter = require('./base'); var Match = require('../match'); /** * A PMD CPD XML reporter, which tries to fit jsinspect's output to something * CI tools might expect from PMD. * * @constructor * * @param {Inspector} inspector The instance on which to register its listeners * @param {object} opts Options to set for the reporter */ function PMDReporter(inspector, opts) { var self, enabled; self = this; enabled = chalk.enabled; opts = opts || {}; BaseReporter.call(this, inspector, opts); this._diff = opts.diff; inspector.on('start', function() { chalk.enabled = false; self._writableStream.write( '<?xml version="1.0" encoding="utf-8"?>\n' + '<pmd-cpd>\n' ); }); inspector.on('end', function() { chalk.enabled = enabled; self._writableStream.write('</pmd-cpd>\n'); }); } util.inherits(PMDReporter, BaseReporter); module.exports = PMDReporter; /** * Returns an XML string containing a <duplication> element, with <file> * children indicating the instance locations, and <codefragment> to hold the * diff. * * @private * * @param {Match} match The inspector match to output * @returns {string} The formatted output */ PMDReporter.prototype._getOutput = function(match) { var self, output, diff, i, nodes, files; self = this; output = ''; diff = ''; nodes = match.nodes; if (this._found > 1) { output += '\n'; } output += '<duplication lines="' + this._getTotalLines(nodes) + '">\n'; nodes.forEach(function(node) { output += self._getFile(node); }); output += '<codefragment>'; if (this._diff) { for (i = 0; i < match.diffs.length; i++) { diff += '\n- ' + this._getFormattedLocation(nodes[0]) + '\n+ ' + this._getFormattedLocation(nodes[i + 1]) + '\n\n' + this._getFormattedDiff(match.diffs[i]); } } output += this._escape(diff) + '</codefragment>\n</duplication>\n'; return output; }; /** * Returns the total number of lines spanned by each node in an array. * * @param {[]Node} nodes The nodes for which to get the total * @returns {int} Total number of lines */ PMDReporter.prototype._getTotalLines = function(nodes) { return nodes.reduce(function(prev, curr) { return prev + curr.loc.end.line - curr.loc.start.line + 1; }, 0); }; /** * Returns an XML string containing the path to the file in which the node is * located, as well as its starting line. Absolute paths are required for * Jenkins. * * @param {Node} node The node from which to get a formatted location * @returns {string} The formatted string */ PMDReporter.prototype._getFile = function(node) { var filePath = node.loc.source; // Convert any relative paths to absolute if (filePath.charAt(0) !== '/') { filePath = path.resolve(process.cwd(), filePath); } return '<file path="' + filePath + '" line="' + node.loc.start.line + '"/>\n'; }; /** * Returns an escaped string for use within XML. * * @param {string} string The string to escape * @returns {string} The escaped string */ PMDReporter.prototype._escape = function(string) { var escaped = { "'": '&apos;', '"': '&quot;', '&': '&amp;', '>': '&gt;', '<': '&lt;' }; return string.replace(/(['"&><])/g, function(string, char) { return escaped[char]; }); };
beni55/jsinspect
lib/reporters/pmd.js
JavaScript
mit
3,451
import pytest import pandas as pd from lcdblib.pandas import utils @pytest.fixture(scope='session') def sample_table(): metadata = { 'sample': ['one', 'two'], 'tissue': ['ovary', 'testis'] } return pd.DataFrame(metadata) def test_cartesian_df(sample_table): df2 = pd.DataFrame({'num': [100, 200]}) result = utils.cartesian_product(sample_table, df2) # Compare a slice sf = result.iloc[0, :].sort_index() sf.name = '' test_sf = pd.Series({'sample': 'one', 'tissue': 'ovary', 'num': 100}, name='').sort_index() assert sf.equals(test_sf) assert result.shape == (4, 3) def test_cartesian_sf(sample_table): sf2 = pd.Series([100, 200], name='num') result = utils.cartesian_product(sample_table, sf2) # Compare a slice sf = result.iloc[0, :].sort_index() sf.name = '' test_sf = pd.Series({'sample': 'one', 'tissue': 'ovary', 'num': 100}, name='').sort_index() assert sf.equals(test_sf) assert result.shape == (4, 3) def test_cartesian_dict(sample_table): df2 = {'num': [100, 200]} result = utils.cartesian_product(sample_table, df2) # Compare a slice sf = result.iloc[0, :].sort_index() sf.name = '' test_sf = pd.Series({'sample': 'one', 'tissue': 'ovary', 'num': 100}, name='').sort_index() assert sf.equals(test_sf) assert result.shape == (4, 3)
lcdb/lcdblib
tests/test_pandas_utils.py
Python
mit
1,376
import io import tempfile import unittest from zipencrypt import ZipFile, ZipInfo, ZIP_DEFLATED from zipencrypt.zipencrypt2 import _ZipEncrypter, _ZipDecrypter class TestEncryption(unittest.TestCase): def setUp(self): self.plain = "plaintext" * 3 self.pwd = b"password" def test_roundtrip(self): encrypt = _ZipEncrypter(self.pwd) encrypted = map(encrypt, self.plain) decrypt = _ZipDecrypter(self.pwd) decrypted = "".join(map(decrypt, encrypted)) self.assertEqual(self.plain, decrypted) class TestZipfile(unittest.TestCase): def setUp(self): self.zipfile = io.BytesIO() self.plain = "plaintext" * 3 self.pwd = "password" def test_writestr(self): with ZipFile(self.zipfile, mode="w") as zipfd: zipfd.writestr("file1.txt", self.plain, pwd=self.pwd) with ZipFile(self.zipfile) as zipfd: content = zipfd.read("file1.txt", pwd=self.pwd) self.assertEqual(self.plain, content) def test_writestr_keep_file_open(self): with ZipFile(self.zipfile, mode="w") as zipfd: zipfd.writestr("file1.txt", self.plain, pwd=self.pwd) content = zipfd.read("file1.txt", pwd=self.pwd) self.assertEqual(self.plain, content) def test_writestr_with_zipinfo(self): zinfo = ZipInfo(filename="file1.txt") zinfo.flag_bits |= 0x8 with ZipFile(self.zipfile, mode="w") as zipfd: zipfd.writestr(zinfo, self.plain, pwd=self.pwd) with ZipFile(self.zipfile) as zipfd: content = zipfd.read("file1.txt", pwd=self.pwd) self.assertEqual(self.plain, content) def test_writestr_with_zipinfo_keep_file_open(self): zinfo = ZipInfo(filename="file1.txt") zinfo.flag_bits |= 0x8 with ZipFile(self.zipfile, mode="w") as zipfd: zipfd.writestr(zinfo, self.plain, pwd=self.pwd) content = zipfd.read("file1.txt", pwd=self.pwd) self.assertEqual(self.plain, content) def test_write_with_password(self): with tempfile.NamedTemporaryFile(bufsize=0) as fd: fd.write(self.plain) with ZipFile(self.zipfile, mode="w") as zipfd: zipfd.write(fd.name, arcname="file1.txt", pwd=self.pwd) with ZipFile(self.zipfile) as zipfd: content = zipfd.read("file1.txt", pwd=self.pwd) self.assertEqual(self.plain, content) def test_write_with_password_keep_file_open(self): with tempfile.NamedTemporaryFile(bufsize=0) as fd: fd.write(self.plain) with ZipFile(self.zipfile, mode="w") as zipfd: zipfd.write(fd.name, arcname="file1.txt", pwd=self.pwd) content = zipfd.read("file1.txt", pwd=self.pwd) self.assertEqual(self.plain, content) def test_setcompressiontype(self): with ZipFile(self.zipfile, mode="w") as zipfd: zipfd.writestr("file1.txt", self.plain, compress_type=ZIP_DEFLATED, pwd=self.pwd) with ZipFile(self.zipfile) as zipfd: content = zipfd.read("file1.txt", pwd=self.pwd) self.assertEqual(self.plain, content) if __name__ == '__main__': unittest.main()
devthat/zipencrypt
tests/python2/test_encryption.py
Python
mit
3,249
<!-- Unsafe sample input : get the $_GET['userData'] in an array SANITIZE : use of mysql_real_escape string File : use of untrusted data in a div tag --> <!--Copyright 2015 Bertrand STIVALET Permission is hereby granted, without written agreement or royalty fee, to use, copy, modify, and distribute this software and its documentation for any purpose, provided that the above copyright notice and the following three paragraphs appear in all copies of this software. IN NO EVENT SHALL AUTHORS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. AUTHORS SPECIFICALLY DISCLAIM ANY WARRANTIES INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THE SOFTWARE IS PROVIDED ON AN "AS-IS" BASIS AND AUTHORS HAVE NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.--> <!DOCTYPE html> <html> <head/> <body> <div> <?php $array = array(); $array[] = 'safe' ; $array[] = $_GET['userData'] ; $array[] = 'safe' ; $tainted = $array[1] ; $tainted = mysql_real_escape_string($tainted); //flaw echo $tainted ; ?> </div> <h1>Hello World!</h1> </body> </html>
stivalet/PHP-Vulnerability-test-suite
XSS/CWE_79/unsafe/CWE_79__array-GET__func_mysql_real_escape_string__Use_untrusted_data-div.php
PHP
mit
1,348
package guard import ( "time" "gopkg.in/workanator/go-floc.v2" "gopkg.in/workanator/go-floc.v2/errors" ) // TimeoutTrigger triggers when the execution of the job timed out. type TimeoutTrigger func(ctx floc.Context, ctrl floc.Control, id interface{}) // Timeout protects the job from taking too much time on execution. // The job is run in it's own goroutine while the current goroutine waits // until the job finished or time went out or the flow is finished. func Timeout(when WhenTimeoutFunc, id interface{}, job floc.Job) floc.Job { return OnTimeout(when, id, job, nil) } // OnTimeout protects the job from taking too much time on execution. // In addition it takes TimeoutTrigger func which called if time is out. // The job is run in it's own goroutine while the current goroutine waits // until the job finished or time went out or the flow is finished. func OnTimeout(when WhenTimeoutFunc, id interface{}, job floc.Job, timeoutTrigger TimeoutTrigger) floc.Job { return func(ctx floc.Context, ctrl floc.Control) error { // Create the channel to read the result error done := make(chan error) defer close(done) // Create timer timer := time.NewTimer(when(ctx, id)) defer timer.Stop() // Run the job go func() { var err error defer func() { done <- err }() err = job(ctx, ctrl) }() // Wait for one of possible events select { case <-ctx.Done(): // The execution finished case err := <-done: // The job finished. Return the result immediately. return err case <-timer.C: // The execution is timed out if timeoutTrigger != nil { timeoutTrigger(ctx, ctrl, id) } else { ctrl.Fail(id, errors.NewErrTimeout(id, time.Now().UTC())) } } // Wait until the job is finished and return the result. return <-done } }
workanator/go-floc
guard/timeout.go
GO
mit
1,797
<?php /* * This file is part of PHPExifTool. * * (c) 2012 Romain Neutron <imprec@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPExiftool\Driver\Tag\XMPDex; use JMS\Serializer\Annotation\ExclusionPolicy; use PHPExiftool\Driver\AbstractTag; /** * @ExclusionPolicy("all") */ class CRC32 extends AbstractTag { protected $Id = 'crc32'; protected $Name = 'CRC32'; protected $FullName = 'XMP::dex'; protected $GroupName = 'XMP-dex'; protected $g0 = 'XMP'; protected $g1 = 'XMP-dex'; protected $g2 = 'Image'; protected $Type = 'integer'; protected $Writable = true; protected $Description = 'CRC32'; }
romainneutron/PHPExiftool
lib/PHPExiftool/Driver/Tag/XMPDex/CRC32.php
PHP
mit
764
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> <title>TqBitTorrentWebUI.Password</title> <link rel="stylesheet" href="../fpdoc.css" type="text/css"> </head> <body> <table class="bar" width="100%" border="0" cellpadding="4" cellspacing="0"> <tr> <td align="left"><span class="bartitle">Unit 'qBitTorrentWebUI'</span></td> <td align="right"><span class="bartitle">Package</span></td> </tr> <tr> <td align="left"><span class="bartitle">[<a href="../qbittorrentwebui/index.html">Overview</a>][<a href="../qbittorrentwebui/index-2.html">Constants</a>][<a href="../qbittorrentwebui/index-4.html">Classes</a>][<a href="../qbittorrentwebui/index-8.html">Index</a>]</span></td> <td align="right"><span class="bartitle">[<a href="../index.html">#lazqBitTorrentWebUI</a>]</span></td> </tr> </table> <h1>TqBitTorrentWebUI.Password</h1> <p>Password to login to the qBittorrent client.</p> <h2>Declaration</h2> <p>Source position: qBitTorrentWebUI.pas line 122</p> <table cellpadding="0" cellspacing="0"> <tr> <td><p><tt><span class="code"> <span class="kw">published</span> <span class="kw">property </span><a href="../qbittorrentwebui/tqbittorrentwebui.html">TqBitTorrentWebUI</a><span class="sym">.</span>Password<span class="sym"> : </span>string<br>&nbsp;&nbsp;<span class="kw">read </span>FPassword<br>&nbsp;&nbsp;<span class="kw">write </span>FPassword<span class="sym">;</span></span></tt></p></td> </tr> </table> </body> </html>
gcarreno/laz-qBitTorrent-WebUI
docs/html/qbittorrentwebui/tqbittorrentwebui.password.html
HTML
mit
1,563
/* * @(#)Move.java 2005/11/01 * * Part of the strategy game framework. * Copyright (c) Michael Patricios, lurgee.net. * */ package net.lurgee.sgf; /** * Marker interface that a class representing a move in the game must implement. A marker interface is used to * convey <b>intention</b> throughout the rest of the framework, which would not be evident if simple Objects were * passed around. * @author mpatric */ public interface Move { }
mpatric/lurgee
sgf/src/net/lurgee/sgf/Move.java
Java
mit
471
Pattern: Model does not explicitly define `__unicode__` Issue: - ## Description Django models should implement a `__unicode__` method for string representation. A parent class of this model does, but ideally all models should be explicit.
Adroiti/docs-for-code-review-tools
Pylint/model-no-explicit-unicode.md
Markdown
mit
247
@extends((isset($package) ? $package . '::' : '') . 'layouts.master') @section('content') <div class="col-sm-12 translation-manager"> <div class="row"> <div class="col-sm-8"> <div class="row"> <div class="col-sm-12"> <h1>@lang($package . '::messages.translation-manager')</h1> {{-- csrf_token() --}} {{--{!! $userLocales !!}--}} </div> </div> <div class="row"> <div class="col-sm-12"> <p>@lang($package . '::messages.export-warning-text')</p> <div class="alert alert-danger alert-dismissible" style="display:none;"> <button type="button" class="close" data-hide="alert" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> <div class="errors-alert"> </div> </div> <?= ifInPlaceEdit("@lang('$package::messages.import-all-done')") ?> <div class="alert alert-success alert-dismissible" style="display:none;"> <button type="button" class="close" data-hide="alert" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> <div class="success-import-all"> <p>@lang($package . '::messages.import-all-done')</p> </div> </div> <?= ifInPlaceEdit("@lang('$package::messages.import-group-done')", ['group' => $group]) ?> <div class="alert alert-success alert-dismissible" style="display:none;"> <button type="button" class="close" data-hide="alert" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> <div class="success-import-group"> <p>@lang($package . '::messages.import-group-done', ['group' => $group]) </p> </div> </div> <?= ifInPlaceEdit("@lang('$package::messages.search-done')") ?> <div class="alert alert-success alert-dismissible" style="display:none;"> <button type="button" class="close" data-hide="alert" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> <div class="success-find"> <p>@lang($package . '::messages.search-done')</p> </div> </div> <?= ifInPlaceEdit("@lang('$package::messages.done-publishing')", ['group' => $group]) ?> <div class="alert alert-success alert-dismissible" style="display:none;"> <button type="button" class="close" data-hide="alert" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> <div class="success-publish"> <p>@lang($package . '::messages.done-publishing', ['group'=> $group])</p> </div> </div> <?= ifInPlaceEdit("@lang('$package::messages.done-publishing-all')") ?> <div class="alert alert-success alert-dismissible" style="display:none;"> <button type="button" class="close" data-hide="alert" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> <div class="success-publish-all"> <p>@lang($package . '::messages.done-publishing-all')</p> </div> </div> <?php if(Session::has('successPublish')) : ?> <div class="alert alert-info alert-dismissible"> <button type="button" class="close" data-hide="alert" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> <?php echo Session::get('successPublish'); ?> </div> <?php endif; ?> </div> </div> <div class="row"> <div class="col-sm-12"> @if($adminEnabled) <div class="row"> <div class="col-sm-12"> <form id="form-import-all" class="form-import-all" method="POST" action="<?= action($controller . '@postImport', ['group' => '*']) ?>" data-remote="true" role="form"> <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>"> <div class="row"> <div class="col-sm-6"> <?= ifEditTrans($package . '::messages.import-add') ?> <?= ifEditTrans($package . '::messages.import-replace') ?> <?= ifEditTrans($package . '::messages.import-fresh') ?> <div class="input-group-sm"> <select name="replace" class="import-select form-control"> <option value="0"><?= noEditTrans($package . '::messages.import-add') ?></option> <option value="1"><?= noEditTrans($package . '::messages.import-replace') ?></option> <option value="2"><?= noEditTrans($package . '::messages.import-fresh') ?></option> </select> </div> </div> <div class="col-sm-6"> <?= ifEditTrans($package . '::messages.import-groups') ?> <?= ifEditTrans($package . '::messages.loading') ?> <button id="submit-import-all" type="submit" form="form-import-all" class="btn btn-sm btn-success" data-disable-with="<?= noEditTrans($package . '::messages.loading') ?>"> <?= noEditTrans($package . '::messages.import-groups') ?> </button> <?= ifEditTrans($package . '::messages.zip-all') ?> <a href="<?= action($controller . '@getZippedTranslations', ['group' => '*']) ?>" role="button" class="btn btn-primary btn-sm"> <?= noEditTrans($package . '::messages.zip-all') ?> </a> <div class="input-group" style="float:right; display:inline"> <?= ifEditTrans($package . '::messages.publish-all') ?> <?= ifEditTrans($package . '::messages.publishing') ?> <button type="submit" form="form-publish-all" class="btn btn-sm btn-warning input-control" data-disable-with="<?= noEditTrans($package . '::messages.publishing') ?>"> <?= noEditTrans($package . '::messages.publish-all') ?> </button><?= ifEditTrans($package . '::messages.publish-all') ?> <?= ifEditTrans($package . '::messages.find-in-files') ?> <?= ifEditTrans($package . '::messages.searching') ?> <button type="submit" form="form-find" class="btn btn-sm btn-danger" data-disable-with="<?= noEditTrans($package . '::messages.searching') ?>"> <?= noEditTrans($package . '::messages.find-in-files') ?> </button> </div> </div> </div> </form> <?= ifEditTrans($package . '::messages.confirm-find') ?> <form id="form-find" class="form-inline form-find" method="POST" action="<?= action($controller . '@postFind') ?>" data-remote="true" role="form" data-confirm="<?= noEditTrans($package . '::messages.confirm-find') ?>"> <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>"> </form> </div> </div> @endif </div> </div> <div style="min-height: 10px"></div> <div class="row"> <div class="col-sm-12"> <div class="row"> <div class="col-sm-12"> <div class="row"> <div class="col-sm-6"> <?= ifEditTrans($package . '::messages.choose-group'); ?> <div class="input-group-sm"> <?= Form::select('group', $groups, $group, array( 'form' => 'form-select', 'class' => 'group-select form-control' )) ?> </div> </div> <div class="col-sm-6"> <?php if ($adminEnabled): ?> <?php if ($group): ?> <?= ifEditTrans($package . '::messages.publishing') ?> <?= ifEditTrans($package . '::messages.publish') ?> <button type="submit" form="form-publish-group" class="btn btn-sm btn-info input-control" data-disable-with="<?= noEditTrans($package . '::messages.publishing') ?>"> <?= noEditTrans($package . '::messages.publish') ?> </button> <?= ifEditTrans($package . '::messages.zip-group') ?> <a href="<?= action($controller . '@getZippedTranslations', ['group' => $group]) ?>" role="button" class="btn btn-primary btn-sm"> <?= noEditTrans($package . '::messages.zip-group') ?> </a> <?= ifEditTrans($package . '::messages.search'); ?> <button type="button" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#searchModal"><?= noEditTrans($package . '::messages.search') ?></button> <?php endif; ?> <div class="input-group" style="float:right; display:inline"> <?php if ($group): ?> <?= ifEditTrans($package . '::messages.import-group') ?> <?= ifEditTrans($package . '::messages.loading') ?> <button type="submit" form="form-import-group" class="btn btn-sm btn-success" data-disable-with="<?= noEditTrans($package . '::messages.loading') ?>"> <?= noEditTrans($package . '::messages.import-group') ?> </button> <?= ifEditTrans($package . '::messages.delete') ?> <?= ifEditTrans($package . '::messages.deleting') ?> <button type="submit" form="form-delete-group" class="btn btn-sm btn-danger" data-disable-with="<?= noEditTrans($package . '::messages.deleting') ?>"> <?= noEditTrans($package . '::messages.delete') ?> </button> <?php endif; ?> </div> <?php else: ?> <?php if ($group): ?> <?= ifEditTrans($package . '::messages.search'); ?> <button type="button" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#searchModal"><?= noEditTrans($package . '::messages.search') ?></button> <?php endif; ?> <?php endif; ?> </div> <?= ifEditTrans($package . '::messages.confirm-delete') ?> <form id="form-delete-group" class="form-inline form-delete-group" method="POST" action="<?= action($controller . '@postDeleteAll', $group) ?>" data-remote="true" role="form" data-confirm="<?= noEditTrans($package . '::messages.confirm-delete', ['group' => $group]) ?>"> <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>"> </form> <form id="form-import-group" class="form-inline form-import-group" method="POST" action="<?= action($controller . '@postImport', $group) ?>" data-remote="true" role="form"> <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>"> </form> <form role="form" class="form" id="form-select"></form> <form id="form-publish-group" class="form-inline form-publish-group" method="POST" action="<?= action($controller . '@postPublish', $group) ?>" data-remote="true" role="form"> <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>"> </form> <form id="form-publish-all" class="form-inline form-publish-all" method="POST" action="<?= action($controller . '@postPublish', '*') ?>" data-remote="true" role="form"> <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>"> </form> </div> </div> </div> <div style="min-height: 10px"></div> <div class="row"> <?php if(!$group): ?> <div class="col-sm-10"> <p>@lang($package . '::messages.choose-group-text')</p> </div> <div class="col-sm-2"> <button type="button" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#searchModal" style="float:right; display:inline"> <?= noEditTrans($package . '::messages.search') ?> </button> <?= ifEditTrans($package . '::messages.search') ?> </div> <?php endif; ?> </div> <div style="min-height: 10px"></div> </div> </div> </div> <div class="col-sm-4"> <div class="row"> <div class="col-sm-12"> <div style="min-height: 10px"></div> <form class="form-inline" id="form-interface-locale" method="GET" action="<?= action($controller . '@getInterfaceLocale') ?>"> <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>"> <div class="row"> <div class=" col-sm-3"> @if($adminEnabled && count($connection_list) > 1) <div class="input-group-sm"> <label for="db-connection"><?= trans($package . '::messages.db-connection') ?>:</label> <br> <select name="c" id="db-connection" class="form-control"> @foreach($connection_list as $connection => $description) <option value="<?=$connection?>"<?= $connection_name === $connection ? ' selected="selected"' : ''?>><?= $description ?></option> @endforeach </select> </div> @else &nbsp; @endif </div> <div class=" col-sm-2"> <div class="input-group-sm"> <label for="interface-locale"><?= trans($package . '::messages.interface-locale') ?>:</label> <br> <select name="l" id="interface-locale" class="form-control"> @foreach($locales as $locale) <option value="<?=$locale?>"<?= $currentLocale === $locale ? ' selected="selected"' : ''?>><?= $locale ?></option> @endforeach </select> </div> </div> <div class=" col-sm-2"> <div class="input-group-sm"> <label for="translating-locale"><?= trans($package . '::messages.translating-locale') ?>:</label> <br> <select name="t" id="translating-locale" class="form-control"> @foreach($locales as $locale) @if($locale !== $primaryLocale) <option value="<?=$locale?>"<?= $translatingLocale === $locale ? ' selected="selected"' : ''?>><?= $locale ?></option> @endif @endforeach </select> </div> </div> <div class=" col-sm-2"> <div class="input-group-sm"> <label for="primary-locale"><?= trans($package . '::messages.primary-locale') ?>:</label> <br> <select name="p" id="primary-locale" class="form-control"> @foreach($locales as $locale) <option value="<?=$locale?>"<?= $primaryLocale === $locale ? ' selected="selected"' : ''?>><?= $locale ?></option> @endforeach </select> </div> </div> <div class=" col-sm-3"> <?php if(str_contains($userLocales, ',' . $currentLocale . ',')): ?> <div class="input-group input-group-sm" style="float:right; display:inline"> <?= ifEditTrans($package . '::messages.in-place-edit') ?> <label for="edit-in-place">&nbsp;</label> <br> <a class="btn btn-sm btn-primary" role="button" id="edit-in-place" href="<?= action($controller . '@getToggleInPlaceEdit') ?>"> <?= noEditTrans($package . '::messages.in-place-edit') ?> </a> </div> <?php endif ?> </div> </div> <div style="min-height: 10px"></div> <div class="row"> <div class=" col-sm-4"> <div class="row"> <div class=" col-sm-12"> <?= formSubmit(trans($package . '::messages.display-locales') , ['class' => "btn btn-sm btn-primary"]) ?>&nbsp;&nbsp; </div> </div> <div class="row"> <div class=" col-sm-12"> <div style="min-height: 10px"></div> <?= ifEditTrans($package . '::messages.check-all') ?> <button id="display-locale-all" class="btn btn-sm btn-default"><?= noEditTrans($package . '::messages.check-all')?></button> <?= ifEditTrans($package . '::messages.check-none') ?> <button id="display-locale-none" class="btn btn-sm btn-default"><?= noEditTrans($package . '::messages.check-none')?></button> </div> </div> </div> <div class=" col-sm-8"> <div class="input-group-sm"> @foreach($locales as $locale) <?php $isLocaleEnabled = str_contains($userLocales, ',' . $locale . ','); ?> <label> <input <?= $locale !== $primaryLocale && $locale !== $translatingLocale ? ' class="display-locale" ' : '' ?> name="d[]" type="checkbox" value="<?=$locale?>" <?= ($locale === $primaryLocale || $locale === $translatingLocale || array_key_exists($locale, $displayLocales)) ? 'checked' : '' ?> <?= $locale === $primaryLocale ? ' disabled' : '' ?>><?= $locale ?> </label> @endforeach </div> </div> </div> </form> </div> </div> @if($usage_info_enabled) <div class="row"> <div class="col-sm-12"> <div style="min-height: 10px"></div> <form class="form-inline" id="form-usage-info" method="GET" action="<?= action($controller . '@getUsageInfo') ?>"> <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>"> <input type="hidden" name="group" value="<?php echo $group ? $group : '*'; ?>"> <div class="row"> <div class=" col-sm-12"> <div class="row"> <div class=" col-sm-4"> <div class="row"> <div class=" col-sm-12"> <?= formSubmit(trans($package . '::messages.set-usage-info'), ['class' => "btn btn-sm btn-primary"]) ?>&nbsp;&nbsp; <br> </div> </div> </div> <div class=" col-sm-8"> <label> <input id="show-usage-info" name="show-usage-info" type="checkbox" value="1" {!! $show_usage ? 'checked' : '' !!}> {!! trans($package . '::messages.show-usage-info') !!} </label> <label> <input id="reset-usage-info" name="reset-usage-info" type="checkbox" value="1"> {!! trans($package . '::messages.reset-usage-info') !!} </label> </div> </div> </div> </div> <div class="row"> <br> </div> </form> </div> </div> @endif </div> </div> <div class="row"> <div class="col-sm-12"> <div class="row"> <div class="col-sm-12"> @include($package . '::dashboard') </div> </div> <div class="row"> <div class="col-sm-12"> @if($mismatchEnabled && !empty($mismatches)) @include($package . '::mismatched') @endif </div> </div> <div class="row"> <div class="col-sm-12"> @if($adminEnabled && $userLocalesEnabled && !$group) <div class="panel panel-primary"> <div class="panel-heading"> <h3 class="panel-title">@lang($package . '::messages.user-admin')</h3> </div> <div class="panel-body"> @include($package . '::user_locales') </div> </div> @endif </div> </div> </div> </div> <?= ifEditTrans($package . '::messages.enter-translation') ?> <?= ifEditTrans($package . '::messages.missmatched-quotes') ?> <script> var MISSMATCHED_QUOTES_MESSAGE = "<?= noEditTrans(($package . '::messages.missmatched-quotes'))?>"; </script> <?php if($group): ?> <div class="row"> <div class="col-sm-12 "> <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true"> @if($adminEnabled && $userLocalesEnabled) <div class="panel panel-default"> <div class="panel-heading" role="tab" id="headingUserAdmin"> <?= ifEditTrans($package . '::messages.user-admin') ?> <h4 class="panel-title"> <a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseUserAdmin" aria-expanded="false" aria-controls="collapseUserAdmin"> <?= noEditTrans($package . '::messages.user-admin') ?> </a> </h4> </div> <div id="collapseUserAdmin" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingUserAdmin"> <div class="panel-body"> <div class="col-sm-12"> @include($package . '::user_locales') </div> </div> </div> </div> <?php endif; ?> <?php if($adminEnabled): ?> <div class="panel panel-default"> <div class="panel-heading" role="tab" id="headingOne"> <?= ifEditTrans($package . '::messages.suffixed-keyops') ?> <h4 class="panel-title"> <a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="false" aria-controls="collapseOne"> <?= noEditTrans($package . '::messages.suffixed-keyops') ?> </a> </h4> </div> <div id="collapseOne" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne"> <div class="panel-body"> <!-- Add Keys Form --> <div class="col-sm-12"> <?= Form::open(['id' => 'form-addkeys', 'method' => 'POST', 'action' => [$controller . '@postAdd', $group]]) ?> <div class="row"> <div class="col-sm-6"> <label for="keys">@lang($package . '::messages.keys'):</label><?= ifEditTrans($package . '::messages.addkeys-placeholder') ?> <?= Form::textarea('keys', Request::old('keys'), [ 'class' => "form-control", 'rows' => "4", 'style' => "resize: vertical", 'placeholder' => noEditTrans($package . '::messages.addkeys-placeholder') ]) ?> </div> <div class="col-sm-6"> <label for="suffixes">@lang($package . '::messages.suffixes'):</label><?= ifEditTrans($package . '::messages.addsuffixes-placeholder') ?> <?= Form::textarea('suffixes', Request::old('suffixes'), [ 'class' => "form-control", 'rows' => "4", 'style' => "resize: vertical", 'placeholder' => noEditTrans($package . '::messages.addsuffixes-placeholder') ]) ?> </div> </div> <div style="min-height: 10px"></div> <script> var currentGroup = '{{$group}}'; function addStandardSuffixes(event) { event.preventDefault(); $("#form-addkeys").first().find("textarea[name='suffixes']")[0].value = "-type\n-header\n-heading\n-description\n-footer" + (currentGroup === 'systemmessage-texts' ? '\n-footing' : ''); } function clearSuffixes(event) { event.preventDefault(); $("#form-addkeys").first().find("textarea[name='suffixes']")[0].value = ""; } function clearKeys(event) { event.preventDefault(); $("#form-addkeys").first().find("textarea[name='keys']")[0].value = ""; } function postDeleteSuffixedKeys(event) { event.preventDefault(); var elem = $("#form-addkeys").first(); elem[0].action = "<?= action($controller . '@postDeleteSuffixedKeys', $group)?>"; elem[0].submit(); } </script> <div class="row"> <div class="col-sm-6"> <?= formSubmit(trans($package . '::messages.addkeys'), ['class' => "btn btn-sm btn-primary"]) ?> <?= ifEditTrans($package . '::messages.clearkeys') ?> <button class="btn btn-sm btn-primary" onclick="clearKeys(event)"><?= noEditTrans($package . '::messages.clearkeys') ?> </button> <div class="input-group" style="float:right; display:inline"> <?= ifEditTrans($package . '::messages.deletekeys') ?> <button class="btn btn-sm btn-danger" onclick="postDeleteSuffixedKeys(event)"> <?= noEditTrans($package . '::messages.deletekeys') ?> </button> </div> </div> <div class="col-sm-4"> <?= ifEditTrans($package . '::messages.addsuffixes') ?> <button class="btn btn-sm btn-primary" onclick="addStandardSuffixes(event)"><?= noEditTrans($package . '::messages.addsuffixes') ?></button> <?= ifEditTrans($package . '::messages.clearsuffixes') ?> <button class="btn btn-sm btn-primary" onclick="clearSuffixes(event)"><?= noEditTrans($package . '::messages.clearsuffixes') ?></button> </div> <div class="col-sm-2"> <span style="float:right; display:inline"> <?= ifEditTrans($package . '::messages.search'); ?> <button type="button" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#searchModal"><?= noEditTrans($package . '::messages.search') ?></button> </span> </div> </div> <?= Form::close() ?> </div> </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading" role="tab" id="headingTwo"> <?= ifEditTrans($package . '::messages.wildcard-keyops') ?> <h4 class="panel-title"> <a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo"> <?= noEditTrans($package . '::messages.wildcard-keyops') ?> </a> </h4> </div> <div id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo"> <div class="panel-body"> <div class="col-sm-12"> <!-- Key Ops Form --> <div id="wildcard-keyops-results" class="results"></div> <?= Form::open([ 'id' => 'form-keyops', 'data-remote' => "true", 'method' => 'POST', 'action' => [$controller . '@postPreviewKeys', $group] ]) ?> <div class="row"> <div class="col-sm-6"> <label for="srckeys">@lang($package . '::messages.srckeys'):</label><?= ifEditTrans($package . '::messages.srckeys-placeholder') ?> <?= Form::textarea('srckeys', Request::old('srckeys'), [ 'id' => 'srckeys', 'class' => "form-control", 'rows' => "4", 'style' => "resize: vertical", 'placeholder' => noEditTrans($package . '::messages.srckeys-placeholder') ]) ?> </div> <div class="col-sm-6"> <label for="dstkeys">@lang($package . '::messages.dstkeys'):</label><?= ifEditTrans($package . '::messages.dstkeys-placeholder') ?> <?= Form::textarea('dstkeys', Request::old('dstkeys'), [ 'id' => 'dstkeys', 'class' => "form-control", 'rows' => "4", 'style' => "resize: vertical", 'placeholder' => noEditTrans($package . '::messages.dstkeys-placeholder') ]) ?> </div> </div> <div style="min-height: 10px"></div> <script> var currentGroup = '{{$group}}'; function clearDstKeys(event) { event.preventDefault(); $("#form-keyops").first().find("textarea[name='dstkeys']")[0].value = ""; } function clearSrcKeys(event) { event.preventDefault(); $("#form-keyops").first().find("textarea[name='srckeys']")[0].value = ""; } function postPreviewKeys(event) { //event.preventDefault(); var elem = $("#form-keyops").first(); elem[0].action = "<?= action($controller . '@postPreviewKeys', $group)?>"; //elem[0].submit(); } function postMoveKeys(event) { //event.preventDefault(); var elem = $("#form-keyops").first(); elem[0].action = "<?= action($controller . '@postMoveKeys', $group)?>"; //elem[0].submit(); } function postCopyKeys(event) { //event.preventDefault(); var elem = $("#form-keyops").first(); elem[0].action = "<?= action($controller . '@postCopyKeys', $group)?>"; //elem[0].submit(); } function postDeleteKeys(event) { //event.preventDefault(); var elem = $("#form-keyops").first(); elem[0].action = "<?= action($controller . '@postDeleteKeys', $group)?>"; //elem[0].submit(); } </script> <div class="row"> <div class="col-sm-6"> <?= ifEditTrans($package . '::messages.clearsrckeys') ?> <button class="btn btn-sm btn-primary" onclick="clearSrcKeys(event)"><?= noEditTrans($package . '::messages.clearsrckeys') ?></button> <div class="input-group" style="float:right; display:inline"> <?= formSubmit(trans($package . '::messages.preview'), [ 'class' => "btn btn-sm btn-primary", 'onclick' => 'postPreviewKeys(event)' ]) ?> <?= ifEditTrans($package . '::messages.copykeys'); ?> <button class="btn btn-sm btn-primary" onclick="postCopyKeys(event)"> <?= noEditTrans($package . '::messages.copykeys') ?> </button> </div> </div> <div class="col-sm-6"> <?= ifEditTrans($package . '::messages.cleardstkeys') ?> <button class="btn btn-sm btn-primary" onclick="clearDstKeys(event)"><?= noEditTrans($package . '::messages.cleardstkeys') ?></button> <div class="input-group" style="float:right; display:inline"> <?= ifEditTrans($package . '::messages.movekeys') ?> <button class="btn btn-sm btn-warning" onclick="postMoveKeys(event)"> <?= noEditTrans($package . '::messages.movekeys') ?> </button> <?= ifEditTrans($package . '::messages.deletekeys') ?> <button class="btn btn-sm btn-danger" onclick="postDeleteKeys(event)"> <?= noEditTrans($package . '::messages.deletekeys') ?> </button> </div> </div> </div> <?= Form::close() ?> </div> </div> </div> </div> <?php endif ?> @if($yandex_key) <div class="panel panel-default"> <div class="panel-heading" role="tab" id="headingThree"> <?= ifEditTrans($package . '::messages.translation-ops') ?> <h4 class="panel-title"> <a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseThree" aria-expanded="false" aria-controls="collapseThree"> <?= noEditTrans($package . '::messages.translation-ops') ?> </a> </h4> </div> <div id="collapseThree" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingThree"> <div class="panel-body"> <div class="row"> <div class="col-sm-6"> <textarea id="primary-text" class="form-control" rows="3" name="keys" style="resize: vertical;" placeholder="<?= $primaryLocale ?>"></textarea> <div style="min-height: 10px"></div> <span style="float:right; display:inline"> <button id="translate-primary-current" type="button" class="btn btn-sm btn-primary"> <?= $primaryLocale ?>&nbsp;<i class="glyphicon glyphicon-share-alt"></i>&nbsp;<?= $translatingLocale ?> </button> </span> </div> <div class="col-sm-6"> <textarea id="current-text" class="form-control" rows="3" name="keys" style="resize: vertical;" placeholder="<?= $translatingLocale ?>"></textarea> <div style="min-height: 10px"></div> <button id="translate-current-primary" type="button" class="btn btn-sm btn-primary"> <?= $translatingLocale ?>&nbsp;<i class="glyphicon glyphicon-share-alt"></i>&nbsp;<?= $primaryLocale ?> </button> </div> </div> </div> </div> </div> @endif </div> </div> </div> <div class="row"> <div class="col-sm-12 "> <label for="show-matching-text" id="show-matching-text-label" class="regex-error">&nbsp;</label> <div class="form-inline"> <?= ifEditTrans($package . '::messages.show-matching-text') ?> <div class="input-group input-group-sm"> <input class="form-control" style="width: 200px;" id="show-matching-text" type="text" placeholder="{{noEditTrans($package . '::messages.show-matching-text')}}"> <span class="input-group-btn"> <button type="button" class="btn btn-default" id="show-matching-clear" style="margin-right: 15px;"> &times; </button> </span> </div> <div class="input-group input-group-sm translation-filter"> {{--<label>@lang($package . '::messages.show'):&nbsp;</label>--}} <label class="radio-inline"> <input id="show-all" type="radio" name="show-options" value="show-all"> @lang($package . '::messages.show-all') </label> </div> <div class="input-group input-group-sm translation-filter"> <label class="radio-inline"> <input id="show-new" type="radio" name="show-options" value="show-new"> @lang($package . '::messages.show-new') </label> </div> <div class="input-group input-group-sm translation-filter"> <label class="radio-inline"> <input id="show-need-attention" type="radio" name="show-options" value="show-need-attention"> @lang($package . '::messages.show-need-attention') </label> </div> <div class="input-group input-group-sm translation-filter"> <label class="radio-inline"> <input id="show-nonempty" type="radio" name="show-options" value="show-nonempty"> @lang($package . '::messages.show-nonempty') </label> </div> <div class="input-group input-group-sm translation-filter"> <label class="radio-inline"> <input id="show-used" type="radio" name="show-options" value="show-used"> @lang($package . '::messages.show-used') </label> </div> <div class="input-group input-group-sm translation-filter"> <label class="radio-inline"> <input id="show-unpublished" type="radio" name="show-options" value="show-unpublished"> @lang($package . '::messages.show-unpublished') </label> </div> <div class="input-group input-group-sm translation-filter"> <label class="radio-inline"> <input id="show-empty" type="radio" name="show-options" value="show-empty"> @lang($package . '::messages.show-empty') </label> </div> <div class="input-group input-group-sm translation-filter"> <label class="radio-inline"> <input id="show-changed" type="radio" name="show-options" value="show-changed"> @lang($package . '::messages.show-changed') </label> </div> <div class="input-group input-group-sm translation-filter"> <label class="radio-inline"> <input id="show-deleted" type="radio" name="show-options" value="show-deleted"> @lang($package . '::messages.show-deleted') </label> </div> </div> </div> </div> <div class="row"> <div class="col-sm-12 "> <div style="min-height: 10px"></div> </div> </div> <div class="row"> <div class="col-sm-12 "> @include($package . '::translations-table') </div> </div> <?php endif; ?> <!-- Search Modal --> <div class="modal fade" id="searchModal" tabindex="-1" role="dialog" aria-labelledby="searchModalLabel" aria-hidden="true"> <div class="modal-dialog modal-lg" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> <h4 class="modal-title" id="searchModalLabel">@lang($package . '::messages.search-translations')</h4> </div> <div class="modal-body"> <form id="search-form" method="GET" action="<?= action($controller . '@getSearch') ?>" data-remote="true"> <div class="form-group"> <div class="input-group"> <input id="search-form-text" type="search" name="q" class="form-control"> <span class="input-group-btn"> <?= formSubmit(trans($package . '::messages.search'), ['class' => "btn btn-default"]) ?> </span> </div> </div> </form> <div class="results"></div> </div> <div class="modal-footer"> <?= ifEditTrans($package . '::messages.close') ?> <button type="button" class="btn btn-sm btn-default" data-dismiss="modal"><?= noEditTrans($package . '::messages.close') ?></button> </div> </div> </div> </div> <!-- KeyOp Modal --> <div class="modal fade" id="keyOpModal" tabindex="-1" role="dialog" aria-labelledby="keyOpModalLabel" aria-hidden="true"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-header modal-primary"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> <h4 class="modal-title" id="keyOpModalLabel">@lang($package . '::messages.keyop-header')</h4> </div> <div class="modal-body"> <div class="results"></div> </div> <div class="modal-footer"> <?= ifEditTrans($package . '::messages.close') ?> <button type="button" class="btn btn-sm btn-default" data-dismiss="modal"><?= noEditTrans($package . '::messages.close') ?></button> </div> </div> </div> </div> <!-- Source Refs Modal --> <div class="modal fade" id="sourceRefsModal" tabindex="-1" role="dialog" aria-labelledby="keySourceRefsModal" aria-hidden="true"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-header modal-primary"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> <h4 class="modal-title" id="keySourceRefsModal">@lang($package . '::messages.source-refs-header')<code style="color:white">'<span id="key-name"></span>'</code></h4> </div> <div class="modal-body"> <div class="results"></div> </div> <div class="modal-footer"> <?= ifEditTrans($package . '::messages.close') ?> <button type="button" class="btn btn-sm btn-default" data-dismiss="modal"><?= noEditTrans($package . '::messages.close') ?></button> </div> </div> </div> </div> </div> @stop @section('body-bottom') <script> var URL_YANDEX_TRANSLATOR_KEY = '<?= action($controller . '@postYandexKey') ?>'; var PRIMARY_LOCALE = '{{$primaryLocale}}'; var CURRENT_LOCALE = '{{$currentLocale}}'; var TRANSLATING_LOCALE = '{{$translatingLocale}}'; var URL_TRANSLATOR_GROUP = '<?= action($controller . '@getView') ?>/'; var URL_TRANSLATOR_ALL = '<?= action($controller . '@getIndex') ?>'; var URL_TRANSLATOR_FILTERS = '<?= action($controller . '@getTransFilters') ?>'; var CURRENT_GROUP = '<?= $group ?>'; var MARKDOWN_KEY_SUFFIX = '<?= $markdownKeySuffix ?>'; </script> <!-- Moved out to allow auto-format in PhpStorm w/o screwing up HTML format --> <script src="<?= $public_prefix . $package ?>/js/xregexp-all.js"></script> <script src="<?= $public_prefix . $package ?>/js/translations_page.js"></script> <?php $userLocaleList = []; foreach ($userList as $user) { if ($user->locales) { foreach (explode(",", $user->locales) as $userLocale) { $userLocale = trim($userLocale); if ($userLocale) $userLocaleList[$userLocale] = $userLocale; } } } foreach ($displayLocales as $userLocale) { $userLocaleList[$userLocale] = $userLocale; } natsort($userLocaleList); ?> <script> var TRANS_FILTERS = ({ filter: "<?= isset($transFilters['filter']) ? $transFilters['filter'] :"" ?>", regex: "<?= isset($transFilters['regex']) ? $transFilters['regex']:"" ?>" }); var USER_LOCALES = [ <?php $addComma = false; ?> <?php foreach ($userLocaleList as $locale): ?> <?php if ($addComma) echo ","; else $addComma = true; ?> { value: '<?= $locale ?>', text: '<?= $locale ?>' } <?php endforeach; ?> ]; </script> @stop
isbkch/laravel5-translator
resources/views/index.blade.php
PHP
mit
63,677
package com.stuffwithstuff.lark; public enum ExprType { BOOL, CALL, FUNCTION, LIST, NAME, NUMBER, STRING }
munificent/lark
src/com/stuffwithstuff/lark/ExprType.java
Java
mit
136
AsyncImageView version 1.6, June 21st, 2016 Copyright (C) 2011 Charcoal Design This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution.
ITSVision/Neodius
Pods/AsyncImageView/LICENCE.md
Markdown
mit
907
import React from 'react' import './blocks.scss' export default class Block extends React.Component { render() { let {title, secondary, content, additional, style} = this.props; return( <div className={"amazo-tile " + (style ? style : 'default')}> <div className="tile-heading"> <div className="title">{title ? title : 'TITLE'}</div> <div className="secondary">{secondary ? secondary : 'SECONDARY'}</div> </div> <div className="tile-body"> <span className="content">{content ? content : 'CONTENT'}</span> </div> <div className="tile-footer text-center"> <span className="info-text text-right">{additional ? additional : 'ADDITIONAL'}</span> </div> </div>) } }
WapGeaR/react-redux-boilerplate-auth
src/skeletons/firstIter/components/blocks/Block.js
JavaScript
mit
778
{ jestExpect(value).toBe(false); }
stas-vilchik/bdd-ml
data/4649.js
JavaScript
mit
37
<?php /** * Magento * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/osl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@magento.com so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade Magento to newer * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magento.com for more information. * * @category Tests * @package Tests_Functional * @copyright Copyright (c) 2006-2019 Magento, Inc. (http://www.magento.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ namespace Mage\Catalog\Test\TestStep; use Magento\Mtf\Fixture\FixtureFactory; use Magento\Mtf\Fixture\FixtureInterface; use Magento\Mtf\TestStep\TestStepInterface; /** * Create product using handler. */ class CreateProductStep implements TestStepInterface { /** * Product fixture from dataset. * * @var string */ protected $product; /** * Factory for Fixtures. * * @var FixtureFactory */ protected $fixtureFactory; /** * Product data. * * @var array */ protected $data = []; /** * @constructor * @param FixtureFactory $fixtureFactory * @param string $product * @param array $data [optional] */ public function __construct(FixtureFactory $fixtureFactory, $product, array $data = []) { $this->product = $product; $this->fixtureFactory = $fixtureFactory; $this->data = $data; } /** * Create product. * * @return array */ public function run() { list($fixtureClass, $dataset) = explode('::', $this->product); /** @var FixtureInterface $product */ $product = $this->fixtureFactory->createByCode( trim($fixtureClass), ['dataset' => trim($dataset), 'data' => $this->data] ); if ($product->hasData('id') === false) { $product->persist(); } return ['product' => $product]; } }
portchris/NaturalRemedyCompany
src/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/CreateProductStep.php
PHP
mit
2,403
import * as React from "react"; import {Hand} from "../models/Hand"; export interface HandPickProps { hands: Hand []; onPick: (hand: Hand) => void; }; export class HandPick extends React.Component<HandPickProps, {}> { render() { return ( <ul className="HandPick"> { this.props.hands.map(hand => { return <li key={"li_" + hand.id}><button key={hand.id} ref={hand.id} class={hand.id} onClick={this.props.onPick.bind(null,hand)}>{hand.name}</button></li>; }) } </ul> ); } }
felicienfrancois/PFCLS
src/components/HandPick.tsx
TypeScript
mit
621
Oxford Flood Network Sensor Code ================================= Version 3.1.4 - Codename: Bulstake Features: * Variable Node ID with jumpers * Variable wake timer with jumpers * Variable poling during startup phase to test device is working * Dallas DS18B20 Temperature sensor for speed of sound compensation * Compatible with Maxbotix ultrasonic sensor range using PWM interface * STARTvvv message sent 5 times at start, vvv indicates firmware version * Battery message sent every 10 readings Issues: * >Max reading leads to no LLAP message being sent instead of error * After programming unplug FTDI cable before trying normal operation (TX/RX get diverted) OxFloodNet sensor V3.1 uses Arduino code. It's written for the Ciseco RFu328 which uses an ATMega328. The code uses some register settings, so is not directly compatible with other boards without modification. It relies on the Ciseco RFu328 which includes the Ciseco SRF radio transceiver. This is needed to manage the very low-power sleep modes, with the SRF waking the 328 up using an interrupt pin after a sleep timer completes. The code is intended to be generic, with parameters being set by jumpers on the PCB. These are directly connected to ATMega328 pins which are read at setup() and converted into parameters for "Node ID" and "Wakeup Period". The board has no FTDI chip which means an FTDI programming cable is needed to update the code (must be removed again for board to operate properly) ![OxFloodNet v3.1 PCB Jumper Layout](https://raw.githubusercontent.com/OxFloodNet/sensor-device/master/OxFloodNet_Sensor/2014-09-11%2020.52.24.jpg "Jumper Layout") In the image above, the jumpers should be read from left to right: <pre> A5 ,A4 ,A3 ,A2 - Node ID high digit A1 ,A0 ,D13,D12 - Node ID low digit D10, D9 - Wakeup Period (backwards?) The first eight represent the *Node ID* as two nibbles, four jumpers each: <pre> High Hex Digit: 8 4 2 1 (binary digit) A5 A4 A3 A2 (ATMega328 pin) Low Hex Digit: 8 4 2 1 (binary digit) A1 A0 D13 D12 (ATMega328 pin) Examples: Node ID 0x21 would be a jumper on A3 (2) and D12. Jumper A4&A3&A0 would make 0x64. Jumper D13&A5&A4 would make high digit: (8+4 = B) and low digit: (2) = 0xB2 </pre> The 9th & 10th jumpers from the left represent *Wakeup Period* and has four possible values mapped to a number of minutes to sleep for: <pre> D9 D10 Value [ ] [ ] 0 - 15 Minutes (default) [ ] [x] 1 - 10 Minutes [x] [ ] 2 - 5 Minutes [x] [x] 3 - 1 Minute </pre> The last jumper on the right is unused but is marked PWR. This for possible expanstion and additional sensors. <pre> Pin usage on ATMega328: D3 - Sensor input D5 - Temperature sensor, One Wire bus D6 - Sensor Enable - Low to enable D8 - SRF Radio enable - High to enable D9 - Wakeup period 0 D10 - Wakeup period 1 D12 - First Node ID digit bit 0 D13 - First Node ID digit bit 1 A0 - First Node ID digit bit 2 A1 - First Node ID digit bit 3 A2 - Second Node ID digit bit 0 A3 - Second Node ID digit bit 1 A4 - Second Node ID digit bit 2 A5 - Second Node ID digit bit 3 AVR mapping A0-5 - PC0 - PC5 D12, D13 - PB4, PB5 D9,D10 - PB1, PB2 Board type in Arduino IDE should be set to "Arduino Uno" </pre>
OxFloodNet/sensor-device
OxFloodNet_Sensor/README.md
Markdown
mit
3,263
"use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var DelegateFolderPermissionLevel_1 = require("../Enumerations/DelegateFolderPermissionLevel"); var AltDictionary_1 = require("../AltDictionary"); var ServiceValidationException_1 = require('../Exceptions/ServiceValidationException'); var Strings_1 = require("../Strings"); var XmlElementNames_1 = require("../Core/XmlElementNames"); var XmlNamespace_1 = require("../Enumerations/XmlNamespace"); var ComplexProperty_1 = require("./ComplexProperty"); /** * Represents the permissions of a delegate user. * * @sealed */ var DelegatePermissions = (function (_super) { __extends(DelegatePermissions, _super); /** * @internal Initializes a new instance of the **DelegatePermissions** class. */ function DelegatePermissions() { _super.call(this); this.delegateFolderPermissions = null; var dictionary = new AltDictionary_1.DictionaryWithStringKey(); dictionary.Add(XmlElementNames_1.XmlElementNames.CalendarFolderPermissionLevel, new DelegateFolderPermission()); dictionary.Add(XmlElementNames_1.XmlElementNames.TasksFolderPermissionLevel, new DelegateFolderPermission()); dictionary.Add(XmlElementNames_1.XmlElementNames.InboxFolderPermissionLevel, new DelegateFolderPermission()); dictionary.Add(XmlElementNames_1.XmlElementNames.ContactsFolderPermissionLevel, new DelegateFolderPermission()); dictionary.Add(XmlElementNames_1.XmlElementNames.NotesFolderPermissionLevel, new DelegateFolderPermission()); dictionary.Add(XmlElementNames_1.XmlElementNames.JournalFolderPermissionLevel, new DelegateFolderPermission()); this.delegateFolderPermissions = dictionary; } Object.defineProperty(DelegatePermissions.prototype, "CalendarFolderPermissionLevel", { /** * Gets or sets the delegate user's permission on the principal's calendar. */ get: function () { return this.delegateFolderPermissions.get(XmlElementNames_1.XmlElementNames.CalendarFolderPermissionLevel).PermissionLevel; }, set: function (value) { this.delegateFolderPermissions.get(XmlElementNames_1.XmlElementNames.CalendarFolderPermissionLevel).PermissionLevel = value; }, enumerable: true, configurable: true }); Object.defineProperty(DelegatePermissions.prototype, "TasksFolderPermissionLevel", { /** * Gets or sets the delegate user's permission on the principal's tasks folder. */ get: function () { return this.delegateFolderPermissions.get(XmlElementNames_1.XmlElementNames.TasksFolderPermissionLevel).PermissionLevel; }, set: function (value) { this.delegateFolderPermissions.get(XmlElementNames_1.XmlElementNames.TasksFolderPermissionLevel).PermissionLevel = value; }, enumerable: true, configurable: true }); Object.defineProperty(DelegatePermissions.prototype, "InboxFolderPermissionLevel", { /** * Gets or sets the delegate user's permission on the principal's inbox. */ get: function () { return this.delegateFolderPermissions.get(XmlElementNames_1.XmlElementNames.InboxFolderPermissionLevel).PermissionLevel; }, set: function (value) { this.delegateFolderPermissions.get(XmlElementNames_1.XmlElementNames.InboxFolderPermissionLevel).PermissionLevel = value; }, enumerable: true, configurable: true }); Object.defineProperty(DelegatePermissions.prototype, "ContactsFolderPermissionLevel", { /** * Gets or sets the delegate user's permission on the principal's contacts folder. */ get: function () { return this.delegateFolderPermissions.get(XmlElementNames_1.XmlElementNames.ContactsFolderPermissionLevel).PermissionLevel; }, set: function (value) { this.delegateFolderPermissions.get(XmlElementNames_1.XmlElementNames.ContactsFolderPermissionLevel).PermissionLevel = value; }, enumerable: true, configurable: true }); Object.defineProperty(DelegatePermissions.prototype, "NotesFolderPermissionLevel", { /** * Gets or sets the delegate user's permission on the principal's notes folder. */ get: function () { return this.delegateFolderPermissions.get(XmlElementNames_1.XmlElementNames.NotesFolderPermissionLevel).PermissionLevel; }, set: function (value) { this.delegateFolderPermissions.get(XmlElementNames_1.XmlElementNames.NotesFolderPermissionLevel).PermissionLevel = value; }, enumerable: true, configurable: true }); Object.defineProperty(DelegatePermissions.prototype, "JournalFolderPermissionLevel", { /** * Gets or sets the delegate user's permission on the principal's journal folder. */ get: function () { return this.delegateFolderPermissions.get(XmlElementNames_1.XmlElementNames.JournalFolderPermissionLevel).PermissionLevel; }, set: function (value) { this.delegateFolderPermissions.get(XmlElementNames_1.XmlElementNames.JournalFolderPermissionLevel).PermissionLevel = value; }, enumerable: true, configurable: true }); /** * @internal Loads service object from XML. * * @param {any} jsObject Json Object converted from XML. * @param {ExchangeService} service The service. */ DelegatePermissions.prototype.LoadFromXmlJsObject = function (jsObject, service) { for (var key in jsObject) { var delegateFolderPermission = null; if (this.delegateFolderPermissions.containsKey(key)) { delegateFolderPermission = this.delegateFolderPermissions.get(key); delegateFolderPermission.Initialize(DelegateFolderPermissionLevel_1.DelegateFolderPermissionLevel[jsObject[key]]); } } }; /** * @internal Resets this instance. */ DelegatePermissions.prototype.Reset = function () { for (var _i = 0, _a = this.delegateFolderPermissions.Values; _i < _a.length; _i++) { var delegateFolderPermission = _a[_i]; delegateFolderPermission.Reset(); } }; /** * @internal Validates this instance for AddDelegate. */ DelegatePermissions.prototype.ValidateAddDelegate = function () { // If any folder permission is Custom, throw // this.delegateFolderPermissions.Values.forEach(function (permission) { if (permission.PermissionLevel == DelegateFolderPermissionLevel_1.DelegateFolderPermissionLevel.Custom) { throw new ServiceValidationException_1.ServiceValidationException(Strings_1.Strings.CannotSetDelegateFolderPermissionLevelToCustom); } }); }; /** * @internal Validates this instance for UpdateDelegate. */ DelegatePermissions.prototype.ValidateUpdateDelegate = function () { // If any folder permission was changed to custom, throw // this.delegateFolderPermissions.Values.forEach(function (permission) { if (permission.PermissionLevel == DelegateFolderPermissionLevel_1.DelegateFolderPermissionLevel.Custom && !permission.IsExistingPermissionLevelCustom) { throw new ServiceValidationException_1.ServiceValidationException(Strings_1.Strings.CannotSetDelegateFolderPermissionLevelToCustom); } }); }; /** * @internal Writes the elements to XML. * * @param {EwsServiceXmlWriter} writer The writer. */ DelegatePermissions.prototype.WriteElementsToXml = function (writer) { this.WritePermissionToXml(writer, XmlElementNames_1.XmlElementNames.CalendarFolderPermissionLevel); this.WritePermissionToXml(writer, XmlElementNames_1.XmlElementNames.TasksFolderPermissionLevel); this.WritePermissionToXml(writer, XmlElementNames_1.XmlElementNames.InboxFolderPermissionLevel); this.WritePermissionToXml(writer, XmlElementNames_1.XmlElementNames.ContactsFolderPermissionLevel); this.WritePermissionToXml(writer, XmlElementNames_1.XmlElementNames.NotesFolderPermissionLevel); this.WritePermissionToXml(writer, XmlElementNames_1.XmlElementNames.JournalFolderPermissionLevel); }; /** * Write permission to Xml. * * @param {EwsServiceXmlWriter} writer The writer. * @param {string} xmlElementName The element name. */ DelegatePermissions.prototype.WritePermissionToXml = function (writer, xmlElementName) { var delegateFolderPermissionLevel = this.delegateFolderPermissions.get(xmlElementName).PermissionLevel; // UpdateDelegate fails if Custom permission level is round tripped // if (delegateFolderPermissionLevel != DelegateFolderPermissionLevel_1.DelegateFolderPermissionLevel.Custom) { writer.WriteElementValue(XmlNamespace_1.XmlNamespace.Types, xmlElementName, DelegateFolderPermissionLevel_1.DelegateFolderPermissionLevel[delegateFolderPermissionLevel]); } }; return DelegatePermissions; }(ComplexProperty_1.ComplexProperty)); exports.DelegatePermissions = DelegatePermissions; /** * @internal Represents a folder's DelegateFolderPermissionLevel */ var DelegateFolderPermission = (function () { function DelegateFolderPermission() { /** * @internal Gets or sets the delegate user's permission on a principal's folder. */ this.PermissionLevel = DelegateFolderPermissionLevel_1.DelegateFolderPermissionLevel.None; /** * @internal Gets IsExistingPermissionLevelCustom. */ this.IsExistingPermissionLevelCustom = false; } /** * Intializes this DelegateFolderPermission. * * @param {DelegateFolderPermissionLevel} permissionLevel The DelegateFolderPermissionLevel */ DelegateFolderPermission.prototype.Initialize = function (permissionLevel) { this.PermissionLevel = permissionLevel; this.IsExistingPermissionLevelCustom = (permissionLevel === DelegateFolderPermissionLevel_1.DelegateFolderPermissionLevel.Custom); }; /** * @internal Resets this DelegateFolderPermission. */ DelegateFolderPermission.prototype.Reset = function () { this.Initialize(DelegateFolderPermissionLevel_1.DelegateFolderPermissionLevel.None); }; return DelegateFolderPermission; }());
guderkar/MExInt
mexint@karel.gudera/server/node_modules/ews-javascript-api/js/ComplexProperties/DelegatePermissions.js
JavaScript
mit
11,141
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_112-google-v7) on Thu Feb 08 16:33:18 PST 2018 --> <title>ShadowTextUtils</title> <meta name="date" content="2018-02-08"> <link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="ShadowTextUtils"; } } catch(err) { } //--> var methods = {"i0":9}; var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../index-all.html">Index</a></li> <li><a href="../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../org/robolectric/shadows/ShadowTextToSpeech.html" title="class in org.robolectric.shadows"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../org/robolectric/shadows/ShadowTextView.html" title="class in org.robolectric.shadows"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../index.html?org/robolectric/shadows/ShadowTextUtils.html" target="_top">Frames</a></li> <li><a href="ShadowTextUtils.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">org.robolectric.shadows</div> <h2 title="Class ShadowTextUtils" class="title">Class ShadowTextUtils</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li>org.robolectric.shadows.ShadowTextUtils</li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <hr> <br> <pre><a href="../../../org/robolectric/annotation/Implements.html" title="annotation in org.robolectric.annotation">@Implements</a>(<a href="../../../org/robolectric/annotation/Implements.html#value--">value</a>=android.text.TextUtils.class) public class <span class="typeNameLabel">ShadowTextUtils</span> extends java.lang.Object</pre> <div class="block"><p>Implement by truncating the text.</p></div> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><span class="memberNameLink"><a href="../../../org/robolectric/shadows/ShadowTextUtils.html#ShadowTextUtils--">ShadowTextUtils</a></span>()</code>&nbsp;</td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code>static java.lang.CharSequence</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/robolectric/shadows/ShadowTextUtils.html#ellipsize-java.lang.CharSequence-android.text.TextPaint-float-android.text.TextUtils.TruncateAt-">ellipsize</a></span>(java.lang.CharSequence&nbsp;text, android.text.TextPaint&nbsp;p, float&nbsp;avail, android.text.TextUtils.TruncateAt&nbsp;where)</code>&nbsp;</td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.Object</h3> <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="ShadowTextUtils--"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>ShadowTextUtils</h4> <pre>public&nbsp;ShadowTextUtils()</pre> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="ellipsize-java.lang.CharSequence-android.text.TextPaint-float-android.text.TextUtils.TruncateAt-"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>ellipsize</h4> <pre><a href="../../../org/robolectric/annotation/Implementation.html" title="annotation in org.robolectric.annotation">@Implementation</a> public static&nbsp;java.lang.CharSequence&nbsp;ellipsize(java.lang.CharSequence&nbsp;text, android.text.TextPaint&nbsp;p, float&nbsp;avail, android.text.TextUtils.TruncateAt&nbsp;where)</pre> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../index-all.html">Index</a></li> <li><a href="../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage"><script type="text/javascript" src="../../../highlight.pack.js"></script> <script type="text/javascript"><!-- hljs.initHighlightingOnLoad(); //--></script></div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../org/robolectric/shadows/ShadowTextToSpeech.html" title="class in org.robolectric.shadows"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../org/robolectric/shadows/ShadowTextView.html" title="class in org.robolectric.shadows"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../index.html?org/robolectric/shadows/ShadowTextUtils.html" target="_top">Frames</a></li> <li><a href="ShadowTextUtils.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
robolectric/robolectric.github.io
javadoc/3.7/org/robolectric/shadows/ShadowTextUtils.html
HTML
mit
10,297
# frozen_string_literal: true require 'simplecov' require 'active_support/core_ext/numeric/time' require_relative '../lib/gitlab/utils' module SimpleCovEnv extend self def start! return unless ENV['SIMPLECOV'] configure_profile configure_job SimpleCov.start end def configure_job SimpleCov.configure do if ENV['CI_JOB_NAME'] job_name = Gitlab::Utils.slugify(ENV['CI_JOB_NAME']) coverage_dir "coverage/#{job_name}" command_name job_name end if ENV['CI'] SimpleCov.at_exit do # In CI environment don't generate formatted reports # Only generate .resultset.json SimpleCov.result end end end end def configure_profile SimpleCov.configure do load_profile 'test_frameworks' track_files '{app,lib}/**/*.rb' add_filter '/vendor/ruby/' add_filter 'app/controllers/sherlock/' add_filter 'config/initializers/' add_filter 'db/fixtures/' add_filter 'lib/gitlab/sidekiq_middleware/' add_filter 'lib/system_check/' add_group 'Controllers', 'app/controllers' add_group 'Finders', 'app/finders' add_group 'Helpers', 'app/helpers' add_group 'Libraries', 'lib' add_group 'Mailers', 'app/mailers' add_group 'Models', 'app/models' add_group 'Policies', 'app/policies' add_group 'Presenters', 'app/presenters' add_group 'Serializers', 'app/serializers' add_group 'Services', 'app/services' add_group 'Uploaders', 'app/uploaders' add_group 'Validators', 'app/validators' add_group 'Workers', %w(app/jobs app/workers) merge_timeout 365.days end end end
stoplightio/gitlabhq
spec/simplecov_env.rb
Ruby
mit
1,746
package info.histei.monitor; import org.apache.commons.vfs2.FileChangeEvent; import org.apache.commons.vfs2.FileListener; /** * Created by mike on 2/1/14. */ public class FileListenerAdaptor implements FileListener { /** * Called when a file is created. * * @param event The FileChangeEvent. * @throws Exception if an error occurs. */ @Override public void fileCreated(FileChangeEvent event) throws Exception { } /** * Called when a file is deleted. * * @param event The FileChangeEvent. * @throws Exception if an error occurs. */ @Override public void fileDeleted(FileChangeEvent event) throws Exception { } /** * Called when a file is changed.<br /> * This will only happen if you monitor the file using {@link org.apache.commons.vfs2.FileMonitor}. * * @param event The FileChangeEvent. * @throws Exception if an error occurs. */ @Override public void fileChanged(FileChangeEvent event) throws Exception { } }
odaata/HisTEI
src/info/histei/monitor/FileListenerAdaptor.java
Java
mit
1,049
import Element from './Element' import Text from './Text' import RunFormat from './RunFormat' import Run from './Run' import ParagraphFormat from './ParagraphFormat' import Paragraph from './Paragraph' import TableFormat from './TableFormat' import Table from './Table' import Section from './Section' import File from './File' import Document from './Document' import { version } from '../package.json' export { Element, Text, RunFormat, Run, ParagraphFormat, Paragraph, TableFormat, Table, Section, File, Document, version }
zuck/jsdocx
src/index.js
JavaScript
mit
552
""" Abstract base for a specific IP transports (TCP or UDP). * It starts and stops a socket * It handles callbacks for incoming frame service types """ from __future__ import annotations from abc import ABC, abstractmethod import asyncio import logging from typing import Callable, cast from xknx.exceptions import CommunicationError from xknx.knxip import HPAI, KNXIPFrame, KNXIPServiceType TransportCallbackType = Callable[[KNXIPFrame, HPAI, "KNXIPTransport"], None] knx_logger = logging.getLogger("xknx.knx") class KNXIPTransport(ABC): """Abstract base class for KNX/IP transports.""" callbacks: list[KNXIPTransport.Callback] local_hpai: HPAI remote_addr: tuple[str, int] transport: asyncio.BaseTransport | None class Callback: """Callback class for handling callbacks for different 'KNX service types' of received packets.""" def __init__( self, callback: TransportCallbackType, service_types: list[KNXIPServiceType] | None = None, ): """Initialize Callback class.""" self.callback = callback self.service_types = service_types or [] def has_service(self, service_type: KNXIPServiceType) -> bool: """Test if callback is listening for given service type.""" return not self.service_types or service_type in self.service_types def register_callback( self, callback: TransportCallbackType, service_types: list[KNXIPServiceType] | None = None, ) -> KNXIPTransport.Callback: """Register callback.""" if service_types is None: service_types = [] callb = KNXIPTransport.Callback(callback, service_types) self.callbacks.append(callb) return callb def unregister_callback(self, callb: KNXIPTransport.Callback) -> None: """Unregister callback.""" self.callbacks.remove(callb) def handle_knxipframe(self, knxipframe: KNXIPFrame, source: HPAI) -> None: """Handle KNXIP Frame and call all callbacks matching the service type ident.""" handled = False for callback in self.callbacks: if callback.has_service(knxipframe.header.service_type_ident): callback.callback(knxipframe, source, self) handled = True if not handled: knx_logger.debug( "Unhandled: %s from: %s", knxipframe.header.service_type_ident, source, ) @abstractmethod async def connect(self) -> None: """Connect transport.""" @abstractmethod def send(self, knxipframe: KNXIPFrame, addr: tuple[str, int] | None = None) -> None: """Send KNXIPFrame via transport.""" def getsockname(self) -> tuple[str, int]: """Return socket IP and port.""" if self.transport is None: raise CommunicationError( "No transport defined. Socket information not resolveable" ) return cast(tuple[str, int], self.transport.get_extra_info("sockname")) def getremote(self) -> str | None: """Return peername.""" return ( self.transport.get_extra_info("peername") if self.transport is not None else None ) def stop(self) -> None: """Stop socket.""" if self.transport is not None: self.transport.close()
XKNX/xknx
xknx/io/transport/ip_transport.py
Python
mit
3,449
// // CCJsonBodyEncoder.h // CCURLConnection // // Created by Kondratyev, Pavel on 3/19/14. // // #import <Foundation/Foundation.h> #import "CCBodyEncoder.h" @interface CCJsonBodyEncoder : NSObject <CCBodyEncoder> + (instancetype)sharedEncoder; @end
KondratyevPavel/CCURLConnection
CCURLConnection/Encoders/CCJsonBodyEncoder.h
C
mit
257
<!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="refresh" content="0;URL=../../../openssl/ssl/struct.SslAcceptor.html"> </head> <body> <p>Redirecting to <a href="../../../openssl/ssl/struct.SslAcceptor.html">../../../openssl/ssl/struct.SslAcceptor.html</a>...</p> <script>location.replace("../../../openssl/ssl/struct.SslAcceptor.html" + location.search + location.hash);</script> </body> </html>
malept/guardhaus
main/openssl/ssl/connector/struct.SslAcceptor.html
HTML
mit
417
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; class CreateSocialsTable extends Migration { public function up() { Schema::create('socials', function(Blueprint $table) { $table->increments('id'); $table->integer('user_id')->unsigned(); $table->string('type'); $table->integer('social_id'); $table->string('username')->nullable(); $table->text('url')->nullable(); $table->text('extra')->nullable(); $table->timestamps(); $table->softDeletes(); }); } public function down() { Schema::drop('socials'); } }
jwaver/hhoCebu
database/migrations/2015_05_11_091112_create_socials_table.php
PHP
mit
592
--- header: cache example: ModelStore.cache --- An object of models that stores data in memory to reduce the number of round trips to the API. Overriding data or modifying the cache is not recommended, but it is helpful for inspecting the data.
rendrjs/rendrjs.github.io
_model-store/cache.md
Markdown
mit
248
-- phpMyAdmin SQL Dump -- version 3.5.1 -- http://www.phpmyadmin.net -- -- Client: localhost -- Généré le: Dim 04 Août 2013 à 11:11 -- Version du serveur: 5.5.24-log -- Version de PHP: 5.4.3 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Base de données: `mots_a_la_pelle` -- -- -------------------------------------------------------- -- -- Structure de la table `atelier` -- CREATE TABLE IF NOT EXISTS `atelier` ( `idAtelier` int(10) NOT NULL AUTO_INCREMENT, `nom` varchar(255) NOT NULL DEFAULT '', `sujet` text NOT NULL, `deadline` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `dateCreation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `idUtilisateur` int(11) NOT NULL, PRIMARY KEY (`idAtelier`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ; -- -------------------------------------------------------- -- -- Structure de la table `cadavre` -- CREATE TABLE IF NOT EXISTS `cadavre` ( `idCadavre` int(10) NOT NULL AUTO_INCREMENT, `phraseFinale` text NOT NULL, `dateDebut` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `dateFin` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `isEnCours` tinyint(1) NOT NULL DEFAULT '0', `idUtilisateur` int(10) NOT NULL, PRIMARY KEY (`idCadavre`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ; -- -------------------------------------------------------- -- -- Structure de la table `news` -- CREATE TABLE IF NOT EXISTS `news` ( `idNews` int(10) NOT NULL AUTO_INCREMENT, `titreN` varchar(255) NOT NULL DEFAULT '', `contenuN` text NOT NULL, `idUtilisateur` int(10) NOT NULL, PRIMARY KEY (`idNews`), KEY `idUtilisateur` (`idUtilisateur`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ; -- -------------------------------------------------------- -- -- Structure de la table `participantsatelier` -- CREATE TABLE IF NOT EXISTS `participantsatelier` ( `idAtelier` int(10) NOT NULL, `idUtilisateur` int(10) NOT NULL, PRIMARY KEY (`idAtelier`,`idUtilisateur`), KEY `idUtilisateur` (`idUtilisateur`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Structure de la table `phrase` -- CREATE TABLE IF NOT EXISTS `phrase` ( `idPhrase` int(10) NOT NULL AUTO_INCREMENT, `phrase` varchar(255) NOT NULL DEFAULT '', `idCadavre` int(10) NOT NULL, `idUtilisateur` int(10) NOT NULL, PRIMARY KEY (`idPhrase`), KEY `idCadavre` (`idCadavre`), KEY `idCadavre_2` (`idCadavre`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Structure de la table `retour` -- CREATE TABLE IF NOT EXISTS `retour` ( `idRetour` int(10) NOT NULL AUTO_INCREMENT, `commentaire` varchar(1024) NOT NULL DEFAULT '', `isValide` tinyint(1) NOT NULL DEFAULT '0', `datePoste` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `idUtilisateur` int(10) NOT NULL, `idTexte` int(10) NOT NULL, PRIMARY KEY (`idRetour`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ; -- -------------------------------------------------------- -- -- Structure de la table `texte` -- CREATE TABLE IF NOT EXISTS `texte` ( `idTexte` int(10) NOT NULL AUTO_INCREMENT, `titre` varchar(255) NOT NULL DEFAULT '', `contenu` text NOT NULL, `dateAjout` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `isPublic` tinyint(1) NOT NULL DEFAULT '0', `idUtilisateur` int(10) NOT NULL, `idTheme` int(10) NOT NULL, `idAtelier` int(10) DEFAULT NULL, `isBrouillon` tinyint(1) NOT NULL DEFAULT '1', `isValide` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`idTexte`), KEY `idUtilisateur` (`idUtilisateur`), KEY `idTheme` (`idTheme`), KEY `idAtelier` (`idAtelier`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=14 ; -- -- Contenu de la table `texte` -- -- -- Structure de la table `textemelange` -- CREATE TABLE IF NOT EXISTS `textemelange` ( `idTexteMelange` int(10) NOT NULL AUTO_INCREMENT, `texteOriginal` text NOT NULL, `texteFinal` text NOT NULL, `dateDebut` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `dateFin` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `isEnCours` tinyint(1) NOT NULL DEFAULT '0', `idUtilisateur` int(10) NOT NULL, PRIMARY KEY (`idTexteMelange`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Structure de la table `theme` -- CREATE TABLE IF NOT EXISTS `theme` ( `idTheme` int(10) NOT NULL AUTO_INCREMENT, `intitule` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`idTheme`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ; -- -- Contenu de la table `theme` -- INSERT INTO `theme` (`idTheme`, `intitule`) VALUES (1, 'Histoire'), (2, 'Poésie'), (3, 'Philosophie'), (4, 'Politique'), (5, 'Humour'); -- -------------------------------------------------------- -- -- Structure de la table `utilisateur` -- CREATE TABLE IF NOT EXISTS `utilisateur` ( `idUtilisateur` int(10) NOT NULL AUTO_INCREMENT, `nom` varchar(255) NOT NULL DEFAULT '', `prenom` varchar(255) NOT NULL DEFAULT '', `mail` varchar(255) NOT NULL DEFAULT '', `login` varchar(255) NOT NULL DEFAULT '', `mdp` varchar(255) NOT NULL DEFAULT '', `codeP` varchar(10) NOT NULL DEFAULT '', `adresse` varchar(255) NOT NULL DEFAULT '', `ville` varchar(255) NOT NULL DEFAULT '', `tel` varchar(20) NOT NULL DEFAULT '', `rang` int(2) NOT NULL DEFAULT '0', `dateContribution` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `dateAdherence` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`idUtilisateur`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ; -- -- Contenu de la table `utilisateur` -- INSERT INTO `utilisateur` (`idUtilisateur`, `nom`, `prenom`, `mail`, `login`, `mdp`, `codeP`, `adresse`, `ville`, `tel`, `rang`, `dateContribution`, `dateAdherence`) VALUES (1, 'DEMO', 'Démo', 'guillaume.sainthillier@gmail.com', 'demo', 'demo', '', '', '', '', 5, '2013-03-13 16:26:52', '0000-00-00 00:00:00'), -- -- Contraintes pour les tables exportées -- -- -- Contraintes pour la table `news` -- ALTER TABLE `news` ADD CONSTRAINT `news_ibfk_1` FOREIGN KEY (`idUtilisateur`) REFERENCES `utilisateur` (`idUtilisateur`); -- -- Contraintes pour la table `participantsatelier` -- ALTER TABLE `participantsatelier` ADD CONSTRAINT `participantsatelier_ibfk_1` FOREIGN KEY (`idUtilisateur`) REFERENCES `utilisateur` (`idUtilisateur`), ADD CONSTRAINT `participantsatelier_ibfk_2` FOREIGN KEY (`idAtelier`) REFERENCES `atelier` (`idAtelier`); -- -- Contraintes pour la table `texte` -- ALTER TABLE `texte` ADD CONSTRAINT `texte_ibfk_1` FOREIGN KEY (`idUtilisateur`) REFERENCES `utilisateur` (`idUtilisateur`), ADD CONSTRAINT `texte_ibfk_2` FOREIGN KEY (`idTheme`) REFERENCES `theme` (`idTheme`), ADD CONSTRAINT `texte_ibfk_3` FOREIGN KEY (`idAtelier`) REFERENCES `atelier` (`idAtelier`); /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
guillaume-sainthillier/malp
mots_a_la_pelle.sql
SQL
mit
7,364
class Base: def meth(self): print("in Base meth") class Sub(Base): def meth(self): print("in Sub meth") return super().meth() a = Sub() a.meth()
aitjcize/micropython
tests/basics/class-super.py
Python
mit
181
using System; using System.Collections.Generic; using System.Linq; using AutoMapper; using Sautom.Domain.Entities; using Sautom.Services.Dto; using Sautom.Services.Repositories; using Sautom.Services.UnitOfWork; namespace Sautom.Services { public sealed class ProposalService { #region Constructors public ProposalService(IMapper mapper, IUnitOfWorkFactory unitOfWorkFactory, IProposalRepository proposalRepository, ICountryRepository countryRepository, ICityRepository cityRepository, IEmbassyDocumentRepository documentRepository, IRateRepository rateRepository) { Mapper = mapper; ProposalRepository = proposalRepository; CountryRepository = countryRepository; CityRepository = cityRepository; DocumentRepository = documentRepository; RateRepository = rateRepository; UnitOfWorkFactory = unitOfWorkFactory; } #endregion public ICommandState EditOrAddProposal(ProposalEditDto data) { using (IUnitOfWork uow = UnitOfWorkFactory.Create()) { if (data.Id == Guid.Empty) { CreateProposal(data); } else { Proposal proposal = ProposalRepository.Get(data.Id); if (proposal == null) { CreateProposal(data); } else { UpdateProposal(proposal, data); } } uow.Commit(); return new DefaultCommandState { IsValid = true, State = new Dictionary<string, object>() }; } } public ICommandState EditOrAddCountry(CounrtyEditDto data) { using (IUnitOfWork uow = UnitOfWorkFactory.Create()) { if (data.Id == Guid.Empty) { CreateCountryInternal(data); } else { Country country = CountryRepository.Get(data.Id); if (country == null) { CreateCountryInternal(data); } else { UpdateCountryInternal(country, data); } } uow.Commit(); return new DefaultCommandState { IsValid = true, State = new Dictionary<string, object>() }; } } public ICommandState EditOrAddRate(RateItemDto data) { using (IUnitOfWork uow = UnitOfWorkFactory.Create()) { Rate rate = RateRepository.Get(data.Id); if (rate == null) { rate = Mapper.Map<Rate>(data); RateRepository.Add(rate); } else { rate = Mapper.Map(data, rate); RateRepository.Update(rate); } uow.Commit(); return new DefaultCommandState { IsValid = true, State = new Dictionary<string, object>() }; } } #region Properties private IMapper Mapper { get; } private IProposalRepository ProposalRepository { get; } private ICountryRepository CountryRepository { get; } private ICityRepository CityRepository { get; } private IEmbassyDocumentRepository DocumentRepository { get; } private IRateRepository RateRepository { get; } private IUnitOfWorkFactory UnitOfWorkFactory { get; } #endregion #region Private members private void UpdateProposal(Proposal proposal, ProposalEditDto data) { Mapper.Map(data, proposal); proposal.City = CityRepository.Get(data.CityId); proposal.AvailableHouseTypes.Clear(); proposal.AvailableHouseTypes = ProposalRepository.GetHousingTypes(data.HouseTypes.ToArray()); proposal.AvailableIntensities.Clear(); proposal.AvailableIntensities = ProposalRepository.GetIntensityTypes(data.Intensities.ToArray()); ProposalRepository.Update(proposal); } private void CreateProposal(ProposalEditDto data) { Proposal proposal = Mapper.Map<Proposal>(data); proposal.City = CityRepository.Get(data.CityId); proposal.AvailableHouseTypes = ProposalRepository.GetHousingTypes(data.HouseTypes.ToArray()); proposal.AvailableIntensities = ProposalRepository.GetIntensityTypes(data.Intensities.ToArray()); ProposalRepository.Add(proposal); } private void UpdateCountryInternal(Country country, CounrtyEditDto data) { Mapper.Map(data, country); //Cities List<CityItemDto> newCities = data.Cities.Where(rec => rec.Id == Guid.Empty).ToList(); newCities.ForEach(city => CityRepository.Add(new City { CityName = city.CityName, Country = country })); List<City> editedCities = country.Cities.Where(rec => !newCities.Any(cc => cc.Id == rec.Id)).ToList(); editedCities.ForEach(doc => doc.CityName = data.Cities.First(rec => rec.Id == doc.Id).CityName); //Embassy docs List<EmbassyDocumentItemDto> newDocs = data.EmbassyDocuments.Where(rec => rec.Id == Guid.Empty).ToList(); List<EmbassyDocument> delectedDocs = country.EmbassyDocuments .Where(rec => rec.Id != Guid.Empty && !data.EmbassyDocuments.Any(dd => dd.Id == rec.Id)).ToList(); List<EmbassyDocument> editedDocs = country.EmbassyDocuments.Where(rec => !delectedDocs.Contains(rec)).ToList(); newDocs.ForEach(doc => DocumentRepository.Add(new EmbassyDocument { DocumentName = doc.DocumentName, Country = country })); editedDocs.ForEach(doc => { EmbassyDocumentItemDto d = data.EmbassyDocuments.First(rec => rec.Id == doc.Id); doc.DocumentName =d.DocumentName; doc.IsArchival = d.IsArchival; }); delectedDocs.ForEach(DocumentRepository.Delete); CountryRepository.Update(country); } private void CreateCountryInternal(CounrtyEditDto data) { Country country = Mapper.Map<Country>(data); CountryRepository.Add(country); } #endregion } }
nikaburu/sautom-wpf
src/Sautom.Services/ProposalService.cs
C#
mit
7,141
/* * This file is part of NucleusFramework for Bukkit, licensed under the MIT License (MIT). * * Copyright (c) JCThePants (www.jcwhatever.com) * * 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 com.jcwhatever.nucleus.managed.astar.nodes; import com.jcwhatever.nucleus.managed.astar.IAStarContext; import com.jcwhatever.nucleus.managed.astar.score.IAStarScore; import com.jcwhatever.nucleus.utils.coords.ICoords3Di; import javax.annotation.Nullable; import java.util.Collection; /** * AStar node coordinate. */ public interface IAStarNode<N extends IAStarNode<N>> extends Comparable<N>, ICoords3Di { /** * Get the nodes search context. */ IAStarContext<N> getContext(); /** * Set the nodes search context. * * @param context The context. */ <T extends IAStarContext<N>> void setContext(T context); /** * Get the nodes current parent. */ N getParent(); /** * Set the nodes parent and score. * * @param parent The parent. * @param score The nodes score. */ void setParent(@Nullable N parent, IAStarScore<N> score); /** * Get all adjacent nodes. */ Collection<N> getAdjacent(); /** * Add all adjacent nodes to the specified output collection. * * @param output The output collection. * * @return The output collection. */ <T extends Collection<N>> T getAdjacent(T output); /** * Determine if a node is adjacent on the X and Z axis. * * @param node The node to check. */ boolean isAdjacent(N node); /** * Get the nodes current score. */ @Nullable IAStarScore<N> getScore(); /** * Get X coordinates relative to parent. */ int getOffsetX(); /** * Get Y coordinates relative to parent. */ int getOffsetY(); /** * Get Z coordinates relative to parent. */ int getOffsetZ(); /** * Get a node relative to this node. * * @param offsetX The X offset value. * @param offsetY The Y offset value. * @param offsetZ The Z offset value. */ N getRelative(int offsetX, int offsetY, int offsetZ); }
JCThePants/NucleusFramework
src/com/jcwhatever/nucleus/managed/astar/nodes/IAStarNode.java
Java
mit
3,238