text
stringlengths
2
100k
meta
dict
name: q version: 0.1.0.0 license: BSD3 author: Edward Z. Yang maintainer: [email protected] build-type: Simple cabal-version: >=1.10 executable q main-is: Main.hs build-depends: base default-language: Haskell2010
{ "pile_set_name": "Github" }
/** * * Copyright (c) 2009-2020 Freedomotic Team http://www.freedomotic-iot.com * * This file is part of Freedomotic * * This Program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; either version 2, or (at your option) any later version. * * This Program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * Freedomotic; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. */ package com.freedomotic.bus; import com.freedomotic.api.EventTemplate; import com.freedomotic.app.Freedomotic; import com.freedomotic.reactions.Command; import com.freedomotic.settings.AppConfig; import com.google.inject.Injector; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.inject.Inject; import javax.jms.DeliveryMode; import javax.jms.Destination; import javax.jms.JMSException; import javax.jms.Message; import javax.jms.MessageConsumer; import javax.jms.MessageProducer; import javax.jms.ObjectMessage; import javax.jms.Queue; import javax.jms.Session; import javax.jms.TemporaryQueue; import javax.jms.Topic; import org.apache.activemq.command.ActiveMQQueue; /** * Bus services implementation. * <p> * It is life cycle managed, see {@link LifeCycle} * * @author Freedomotic Team * */ final class BusServiceImpl extends LifeCycle implements BusService { private static final Logger LOG = LoggerFactory.getLogger(BusServiceImpl.class.getName()); private BusBroker brokerHolder; private BusConnection connectionHolder; private AppConfig conf; private Session receiveSession; private Session sendSession; private Session unlistenedSession; private Injector injector; protected MessageProducer messageProducer; @Inject public BusServiceImpl(AppConfig config, Injector inj) { if (BootStatus.getCurrentStatus() == BootStatus.STOPPED) { conf = config; injector = inj; init(); if (sendSession == null) { throw new IllegalStateException("Messaging bus has not yet a valid send session"); } } LOG.info("Messaging bus is {}", BootStatus.getCurrentStatus().name()); } /** * {@inheritDoc} * * @throws java.lang.Exception */ @Override protected void start() throws Exception { BootStatus.setCurrentStatus(BootStatus.BOOTING); brokerHolder = new BusBroker(); brokerHolder.init(); connectionHolder = injector.getInstance(BusConnection.class); connectionHolder.init(); receiveSession = createSession(); // an unlistened session unlistenedSession = createSession(); sendSession = createSession(); // null parameter creates a producer with no specified destination messageProducer = createMessageProducer(); BootStatus.setCurrentStatus(BootStatus.STARTED); } /** * * * @return @throws JMSException */ private MessageProducer createMessageProducer() throws JMSException { // null parameter creates a producer with no specified destination final MessageProducer createdProducer = sendSession.createProducer(null); // configure createdProducer.setDeliveryMode(DeliveryMode.NON_PERSISTENT); return createdProducer; } /** * {@inheritDoc} * * @throws java.lang.Exception */ @Override protected void stop() throws Exception { BootStatus.setCurrentStatus(BootStatus.STOPPING); messageProducer.close(); closeSession(sendSession); closeSession(unlistenedSession); closeSession(receiveSession); connectionHolder.destroy(); brokerHolder.destroy(); BootStatus.setCurrentStatus(BootStatus.STOPPED); } /** * {@inheritDoc} */ // TODO Freedomotic.java needs this method publicy visible. A whole repackage is needed. @Override public void destroy() { super.destroy(); } /** * {@inheritDoc} */ // TODO Freedomotic.java needs this method publicy visible. A whole repackage is needed. @Override public void init() { super.init(); } private void closeSession(final Session session) throws Exception { session.close(); } @Override public Session createSession() throws Exception { return connectionHolder.createSession(); } /** * * * @return */ private MessageProducer getMessageProducer() { return messageProducer; } /** * {@inheritDoc} * * @return */ @Override public Session getReceiveSession() { return receiveSession; } /** * {@inheritDoc} * * @return */ @Override public Session getSendSession() { return sendSession; } /** * {@inheritDoc} * * @return */ @Override public Session getUnlistenedSession() { return unlistenedSession; } private ObjectMessage createObjectMessage() throws JMSException { return getSendSession().createObjectMessage(); } /** * {@inheritDoc} */ @Override public void reply(Command command, Destination destination, String correlationID) { if (destination == null) { throw new IllegalArgumentException("Null reply destination " + "for command " + command.getName() + " " + "(reply timeout: " + command.getReplyTimeout() + ")"); } try { ObjectMessage msg = createObjectMessage(); msg.setObject(command); msg.setJMSDestination(destination); msg.setJMSCorrelationID(correlationID); msg.setStringProperty("provenance", Freedomotic.getInstanceID()); LOG.info("Sending reply to command \"{}\" on {}", new Object[]{command.getName(), msg.getJMSDestination()}); getMessageProducer().send(destination, msg); //Always pass the destination, otherwise it complains } catch (JMSException jmse) { LOG.error(Freedomotic.getStackTraceInfo(jmse)); } } /** * {@inheritDoc} */ @Override public Command send(final Command command) { if (command == null) { throw new IllegalArgumentException("Cannot send a null command"); } if (command.getReceiver() == null || command.getReceiver().isEmpty()) { throw new IllegalArgumentException("Cannot send command '" + command + "', the receiver channel is not specified"); } LOG.info("Sending command \"{}\" to destination \"{}\" with reply timeout {}", new Object[]{command.getName(), command.getReceiver(), command.getReplyTimeout()}); try { ObjectMessage msg = createObjectMessage(); msg.setObject(command); msg.setStringProperty("provenance", Freedomotic.getInstanceID()); Queue currDestination = new ActiveMQQueue(command.getReceiver()); if (command.getReplyTimeout() > 0) { return sendAndWaitReply(command, currDestination, msg); } else { return sendAndForget(command, currDestination, msg); } } catch (JMSException ex) { LOG.error(Freedomotic.getStackTraceInfo(ex)); command.setExecuted(false); return command; } } /** * * * @param command * @param currDestination * @param msg * @return * @throws JMSException */ private Command sendAndForget(final Command command, Queue currDestination, ObjectMessage msg) throws JMSException { // send the message immediately without creating temporary // queues and consumers on it // this increments perfornances if no reply is expected final MessageProducer messageProducer = this.getMessageProducer(); messageProducer.send(currDestination, msg); command.setExecuted(true); // always say it is executed (it's not sure but the caller is // not interested: best effort) return command; } /** * * * @param command * @param currDestination * @param msg * @return * @throws JMSException */ private Command sendAndWaitReply(final Command command, Queue currDestination, ObjectMessage msg) throws JMSException { // we have to wait an execution reply for an hardware device or // an external client final Session currUnlistenedSession = this.getUnlistenedSession(); TemporaryQueue temporaryQueue = currUnlistenedSession .createTemporaryQueue(); msg.setJMSReplyTo(temporaryQueue); // a temporary consumer on a temporary queue MessageConsumer temporaryConsumer = currUnlistenedSession .createConsumer(temporaryQueue); final MessageProducer currMessageProducer = this.getMessageProducer(); currMessageProducer.send(currDestination, msg); // the receive() call is blocking LOG.info("Send and await reply to command \"{}\" for {} ms", command.getName(), command.getReplyTimeout()); Message jmsResponse = temporaryConsumer.receive(command.getReplyTimeout()); //cleanup after receiving //temporaryConsumer.close(); //temporaryQueue.delete(); //TODO: commented as sometimes generates a "cannot publish on deleted queue" exception //check n the documentation if a temporary queue with no consumers //is automatically deleted if (jmsResponse != null) { // TODO unchecked cast! ObjectMessage objMessage = (ObjectMessage) jmsResponse; // a command is sent, we expect a command as reply // TODO unchecked cast! Command reply = (Command) objMessage.getObject(); LOG.info("Reply to command \"" + command.getName() + "\" is received. Result property inside this command is " + reply.getProperty("result") + ". It is used to pass data to the next command, can be empty or even null."); return reply; } else { LOG.info("Command \"" + command.getName() + "\" timed out after " + command.getReplyTimeout() + "ms"); } // mark as failed command.setExecuted(false); // returns back the original inaltered command return command; } /** * {@inheritDoc} */ @Override public void send(EventTemplate ev) { send(ev, ev.getDefaultDestination()); } /** * {@inheritDoc} */ @Override public void send(final EventTemplate ev, final String to) { if (ev == null) { throw new IllegalArgumentException("Cannot send a null event"); } try { ObjectMessage msg = createObjectMessage(); msg.setObject(ev); msg.setStringProperty("provenance", Freedomotic.getInstanceID()); // Generate a new topic if not already exists, otherwise returns the old topic instance Topic topic = getReceiveSession().createTopic("VirtualTopic." + to); getMessageProducer().send(topic, msg); } catch (JMSException ex) { LOG.error(Freedomotic.getStackTraceInfo(ex)); } } }
{ "pile_set_name": "Github" }
// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University // Copyright (c) 2011, 2012 Open Networking Foundation // Copyright (c) 2012, 2013 Big Switch Networks, Inc. // This library was generated by the LoxiGen Compiler. // See the file LICENSE.txt which should have been included in the source distribution // Automatically generated by LOXI from template of_class.java // Do not modify package org.projectfloodlight.openflow.protocol.ver13; import org.projectfloodlight.openflow.protocol.*; import org.projectfloodlight.openflow.protocol.action.*; import org.projectfloodlight.openflow.protocol.actionid.*; import org.projectfloodlight.openflow.protocol.bsntlv.*; import org.projectfloodlight.openflow.protocol.errormsg.*; import org.projectfloodlight.openflow.protocol.meterband.*; import org.projectfloodlight.openflow.protocol.instruction.*; import org.projectfloodlight.openflow.protocol.instructionid.*; import org.projectfloodlight.openflow.protocol.match.*; import org.projectfloodlight.openflow.protocol.oxm.*; import org.projectfloodlight.openflow.protocol.queueprop.*; import org.projectfloodlight.openflow.types.*; import org.projectfloodlight.openflow.util.*; import org.projectfloodlight.openflow.exceptions.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.jboss.netty.buffer.ChannelBuffer; import com.google.common.hash.PrimitiveSink; import com.google.common.hash.Funnel; class OFActionIdCopyTtlOutVer13 implements OFActionIdCopyTtlOut { private static final Logger logger = LoggerFactory.getLogger(OFActionIdCopyTtlOutVer13.class); // version: 1.3 final static byte WIRE_VERSION = 4; final static int LENGTH = 4; // OF message fields // // Immutable default instance final static OFActionIdCopyTtlOutVer13 DEFAULT = new OFActionIdCopyTtlOutVer13( ); final static OFActionIdCopyTtlOutVer13 INSTANCE = new OFActionIdCopyTtlOutVer13(); // private empty constructor - use shared instance! private OFActionIdCopyTtlOutVer13() { } // Accessors for OF message fields @Override public OFActionType getType() { return OFActionType.COPY_TTL_OUT; } @Override public OFVersion getVersion() { return OFVersion.OF_13; } // no data members - do not support builder public OFActionIdCopyTtlOut.Builder createBuilder() { throw new UnsupportedOperationException("OFActionIdCopyTtlOutVer13 has no mutable properties -- builder unneeded"); } final static Reader READER = new Reader(); static class Reader implements OFMessageReader<OFActionIdCopyTtlOut> { @Override public OFActionIdCopyTtlOut readFrom(ChannelBuffer bb) throws OFParseError { int start = bb.readerIndex(); // fixed value property type == 11 short type = bb.readShort(); if(type != (short) 0xb) throw new OFParseError("Wrong type: Expected=OFActionType.COPY_TTL_OUT(11), got="+type); int length = U16.f(bb.readShort()); if(length != 4) throw new OFParseError("Wrong length: Expected=4(4), got="+length); if(bb.readableBytes() + (bb.readerIndex() - start) < length) { // Buffer does not have all data yet bb.readerIndex(start); return null; } if(logger.isTraceEnabled()) logger.trace("readFrom - length={}", length); if(logger.isTraceEnabled()) logger.trace("readFrom - returning shared instance={}", INSTANCE); return INSTANCE; } } public void putTo(PrimitiveSink sink) { FUNNEL.funnel(this, sink); } final static OFActionIdCopyTtlOutVer13Funnel FUNNEL = new OFActionIdCopyTtlOutVer13Funnel(); static class OFActionIdCopyTtlOutVer13Funnel implements Funnel<OFActionIdCopyTtlOutVer13> { private static final long serialVersionUID = 1L; @Override public void funnel(OFActionIdCopyTtlOutVer13 message, PrimitiveSink sink) { // fixed value property type = 11 sink.putShort((short) 0xb); // fixed value property length = 4 sink.putShort((short) 0x4); } } public void writeTo(ChannelBuffer bb) { WRITER.write(bb, this); } final static Writer WRITER = new Writer(); static class Writer implements OFMessageWriter<OFActionIdCopyTtlOutVer13> { @Override public void write(ChannelBuffer bb, OFActionIdCopyTtlOutVer13 message) { // fixed value property type = 11 bb.writeShort((short) 0xb); // fixed value property length = 4 bb.writeShort((short) 0x4); } } @Override public String toString() { StringBuilder b = new StringBuilder("OFActionIdCopyTtlOutVer13("); b.append(")"); return b.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; return true; } @Override public int hashCode() { int result = 1; return result; } }
{ "pile_set_name": "Github" }
ENV['RAILS_ENV'] ||= 'test' require_relative '../config/environment' require 'rails/test_help' class ActiveSupport::TestCase # Run tests in parallel with specified workers parallelize(workers: :number_of_processors) # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. fixtures :all # Add more helper methods to be used by all tests here... end
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <Workspace version = "1.0"> <FileRef location = "self:PSOperations.xcodeproj"> </FileRef> </Workspace>
{ "pile_set_name": "Github" }
import Container from '../../src/container/Base.mjs'; import TableContainer from '../../src/table/Container.mjs'; /** * @class TestApp2.MainContainer2 * @extends Neo.container.Base */ class MainContainer2 extends Container { static getConfig() {return { className: 'TestApp2.MainContainer2', ntype : 'main-container2', autoMount: true, layout: { ntype: 'vbox', align: 'stretch' }, items: [ { ntype: 'toolbar', flex : '0 1 auto', itemDefaults: { ntype: 'button', style: { margin: '0 10px 0 0' } }, style: { marginBottom: '10px', padding : 0 }, items: [ { ntype: 'label', text : 'TableContainer App2', style: { margin: '4px 10px 0 5px' } }, { ntype: 'component', flex : 5 }, { ntype : 'numberfield', clearable : false, id : 'amountRows2', labelText : 'Rows:', labelWidth: 50, maxValue : 1500, minValue : 1, value : 50, width : 120 }, { ntype : 'numberfield', clearable : false, id : 'interval2', labelText : 'Interval:', labelWidth: 62, maxValue : 5000, minValue : 10, value : 30, width : 130 }, { iconCls : 'fa fa-sync-alt', text : 'Refresh Data', domListeners: { click: { fn: function () { let rows = Neo.getComponent('amountRows2').value; Neo.getComponent('myTableContainer2').createRandomViewData(rows); } } } }, { iconCls : 'fa fa-sync-alt', style : {margin:0}, text : 'Refresh 100x', domListeners: { click: { fn: function () { let interval = Neo.getComponent('interval2').value, rows = Neo.getComponent('amountRows2').value, maxRefreshs = 100, intervalId = setInterval(function(){ if (maxRefreshs < 1) { clearInterval(intervalId); } Neo.getComponent('myTableContainer2').createRandomViewData(rows); maxRefreshs--; }, interval); } } } } ] }, { ntype : 'table-container', id : 'myTableContainer2', amountRows : 50, // testing var createRandomData: true, width : '100%', columnDefaults: { renderer: function(data) { return { html : data.value, style: { backgroundColor: data.record[data.dataField + 'style'] } } } }, wrapperStyle: { height: '300px' }, columns: [ { text : 'Dock Left 1', dataField: 'column0', dock : 'left', width : 200 }, { text : 'Dock Left 2', dataField: 'column1', dock : 'left', width : 200 }, { text : 'Header 3', dataField: 'column2' }, { text : 'Header 4', dataField: 'column3' }, { text : 'Header 5', dataField: 'column4' }, { text : 'Header 6', dataField: 'column5' }, { text : 'Header 7', dataField: 'column6' }, { text : 'Header 8', dataField: 'column7' }, { text : 'Header 9', dataField: 'column8' }, { text : 'Header 10', dataField: 'column9' } ] } ] }} } Neo.applyClassConfig(MainContainer2); export {MainContainer2 as default};
{ "pile_set_name": "Github" }
package kingpin // Default usage template. var DefaultUsageTemplate = `{{define "FormatCommand"}}\ {{if .FlagSummary}} {{.FlagSummary}}{{end}}\ {{range .Args}} {{if not .Required}}[{{end}}<{{.Name}}>{{if .Value|IsCumulative}}...{{end}}{{if not .Required}}]{{end}}{{end}}\ {{end}}\ {{define "FormatCommands"}}\ {{range .FlattenedCommands}}\ {{if not .Hidden}}\ {{.FullCommand}}{{if .Default}}*{{end}}{{template "FormatCommand" .}} {{.Help|Wrap 4}} {{end}}\ {{end}}\ {{end}}\ {{define "FormatUsage"}}\ {{template "FormatCommand" .}}{{if .Commands}} <command> [<args> ...]{{end}} {{if .Help}} {{.Help|Wrap 0}}\ {{end}}\ {{end}}\ {{if .Context.SelectedCommand}}\ usage: {{.App.Name}} {{.Context.SelectedCommand}}{{template "FormatUsage" .Context.SelectedCommand}} {{else}}\ usage: {{.App.Name}}{{template "FormatUsage" .App}} {{end}}\ {{if .Context.Flags}}\ Flags: {{.Context.Flags|FlagsToTwoColumns|FormatTwoColumns}} {{end}}\ {{if .Context.Args}}\ Args: {{.Context.Args|ArgsToTwoColumns|FormatTwoColumns}} {{end}}\ {{if .Context.SelectedCommand}}\ {{if len .Context.SelectedCommand.Commands}}\ Subcommands: {{template "FormatCommands" .Context.SelectedCommand}} {{end}}\ {{else if .App.Commands}}\ Commands: {{template "FormatCommands" .App}} {{end}}\ ` // Usage template where command's optional flags are listed separately var SeparateOptionalFlagsUsageTemplate = `{{define "FormatCommand"}}\ {{if .FlagSummary}} {{.FlagSummary}}{{end}}\ {{range .Args}} {{if not .Required}}[{{end}}<{{.Name}}>{{if .Value|IsCumulative}}...{{end}}{{if not .Required}}]{{end}}{{end}}\ {{end}}\ {{define "FormatCommands"}}\ {{range .FlattenedCommands}}\ {{if not .Hidden}}\ {{.FullCommand}}{{if .Default}}*{{end}}{{template "FormatCommand" .}} {{.Help|Wrap 4}} {{end}}\ {{end}}\ {{end}}\ {{define "FormatUsage"}}\ {{template "FormatCommand" .}}{{if .Commands}} <command> [<args> ...]{{end}} {{if .Help}} {{.Help|Wrap 0}}\ {{end}}\ {{end}}\ {{if .Context.SelectedCommand}}\ usage: {{.App.Name}} {{.Context.SelectedCommand}}{{template "FormatUsage" .Context.SelectedCommand}} {{else}}\ usage: {{.App.Name}}{{template "FormatUsage" .App}} {{end}}\ {{if .Context.Flags|RequiredFlags}}\ Required flags: {{.Context.Flags|RequiredFlags|FlagsToTwoColumns|FormatTwoColumns}} {{end}}\ {{if .Context.Flags|OptionalFlags}}\ Optional flags: {{.Context.Flags|OptionalFlags|FlagsToTwoColumns|FormatTwoColumns}} {{end}}\ {{if .Context.Args}}\ Args: {{.Context.Args|ArgsToTwoColumns|FormatTwoColumns}} {{end}}\ {{if .Context.SelectedCommand}}\ Subcommands: {{if .Context.SelectedCommand.Commands}}\ {{template "FormatCommands" .Context.SelectedCommand}} {{end}}\ {{else if .App.Commands}}\ Commands: {{template "FormatCommands" .App}} {{end}}\ ` // Usage template with compactly formatted commands. var CompactUsageTemplate = `{{define "FormatCommand"}}\ {{if .FlagSummary}} {{.FlagSummary}}{{end}}\ {{range .Args}} {{if not .Required}}[{{end}}<{{.Name}}>{{if .Value|IsCumulative}}...{{end}}{{if not .Required}}]{{end}}{{end}}\ {{end}}\ {{define "FormatCommandList"}}\ {{range .}}\ {{if not .Hidden}}\ {{.Depth|Indent}}{{.Name}}{{if .Default}}*{{end}}{{template "FormatCommand" .}} {{end}}\ {{template "FormatCommandList" .Commands}}\ {{end}}\ {{end}}\ {{define "FormatUsage"}}\ {{template "FormatCommand" .}}{{if .Commands}} <command> [<args> ...]{{end}} {{if .Help}} {{.Help|Wrap 0}}\ {{end}}\ {{end}}\ {{if .Context.SelectedCommand}}\ usage: {{.App.Name}} {{.Context.SelectedCommand}}{{template "FormatUsage" .Context.SelectedCommand}} {{else}}\ usage: {{.App.Name}}{{template "FormatUsage" .App}} {{end}}\ {{if .Context.Flags}}\ Flags: {{.Context.Flags|FlagsToTwoColumns|FormatTwoColumns}} {{end}}\ {{if .Context.Args}}\ Args: {{.Context.Args|ArgsToTwoColumns|FormatTwoColumns}} {{end}}\ {{if .Context.SelectedCommand}}\ {{if .Context.SelectedCommand.Commands}}\ Commands: {{.Context.SelectedCommand}} {{template "FormatCommandList" .Context.SelectedCommand.Commands}} {{end}}\ {{else if .App.Commands}}\ Commands: {{template "FormatCommandList" .App.Commands}} {{end}}\ ` var ManPageTemplate = `{{define "FormatFlags"}}\ {{range .Flags}}\ {{if not .Hidden}}\ .TP \fB{{if .Short}}-{{.Short|Char}}, {{end}}--{{.Name}}{{if not .IsBoolFlag}}={{.FormatPlaceHolder}}{{end}}\\fR {{.Help}} {{end}}\ {{end}}\ {{end}}\ {{define "FormatCommand"}}\ {{if .FlagSummary}} {{.FlagSummary}}{{end}}\ {{range .Args}} {{if not .Required}}[{{end}}<{{.Name}}{{if .Default}}*{{end}}>{{if .Value|IsCumulative}}...{{end}}{{if not .Required}}]{{end}}{{end}}\ {{end}}\ {{define "FormatCommands"}}\ {{range .FlattenedCommands}}\ {{if not .Hidden}}\ .SS \fB{{.FullCommand}}{{template "FormatCommand" .}}\\fR .PP {{.Help}} {{template "FormatFlags" .}}\ {{end}}\ {{end}}\ {{end}}\ {{define "FormatUsage"}}\ {{template "FormatCommand" .}}{{if .Commands}} <command> [<args> ...]{{end}}\\fR {{end}}\ .TH {{.App.Name}} 1 {{.App.Version}} "{{.App.Author}}" .SH "NAME" {{.App.Name}} .SH "SYNOPSIS" .TP \fB{{.App.Name}}{{template "FormatUsage" .App}} .SH "DESCRIPTION" {{.App.Help}} .SH "OPTIONS" {{template "FormatFlags" .App}}\ {{if .App.Commands}}\ .SH "COMMANDS" {{template "FormatCommands" .App}}\ {{end}}\ ` // Default usage template. var LongHelpTemplate = `{{define "FormatCommand"}}\ {{if .FlagSummary}} {{.FlagSummary}}{{end}}\ {{range .Args}} {{if not .Required}}[{{end}}<{{.Name}}>{{if .Value|IsCumulative}}...{{end}}{{if not .Required}}]{{end}}{{end}}\ {{end}}\ {{define "FormatCommands"}}\ {{range .FlattenedCommands}}\ {{if not .Hidden}}\ {{.FullCommand}}{{template "FormatCommand" .}} {{.Help|Wrap 4}} {{with .Flags|FlagsToTwoColumns}}{{FormatTwoColumnsWithIndent . 4 2}}{{end}} {{end}}\ {{end}}\ {{end}}\ {{define "FormatUsage"}}\ {{template "FormatCommand" .}}{{if .Commands}} <command> [<args> ...]{{end}} {{if .Help}} {{.Help|Wrap 0}}\ {{end}}\ {{end}}\ usage: {{.App.Name}}{{template "FormatUsage" .App}} {{if .Context.Flags}}\ Flags: {{.Context.Flags|FlagsToTwoColumns|FormatTwoColumns}} {{end}}\ {{if .Context.Args}}\ Args: {{.Context.Args|ArgsToTwoColumns|FormatTwoColumns}} {{end}}\ {{if .App.Commands}}\ Commands: {{template "FormatCommands" .App}} {{end}}\ ` var BashCompletionTemplate = ` _{{.App.Name}}_bash_autocomplete() { local cur prev opts base COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" opts=$( ${COMP_WORDS[0]} --completion-bash ${COMP_WORDS[@]:1:$COMP_CWORD} ) COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) return 0 } complete -F _{{.App.Name}}_bash_autocomplete {{.App.Name}} ` var ZshCompletionTemplate = ` #compdef {{.App.Name}} autoload -U compinit && compinit autoload -U bashcompinit && bashcompinit _{{.App.Name}}_bash_autocomplete() { local cur prev opts base COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" opts=$( ${COMP_WORDS[0]} --completion-bash ${COMP_WORDS[@]:1:$COMP_CWORD} ) COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) return 0 } complete -F _{{.App.Name}}_bash_autocomplete {{.App.Name}} `
{ "pile_set_name": "Github" }
// -*- C++ -*- // Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the terms // of the GNU General Public License as published by the Free Software // Foundation; either version 3, or (at your option) any later // version. // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // <http://www.gnu.org/licenses/>. // Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL. // Permission to use, copy, modify, sell, and distribute this software // is hereby granted without fee, provided that the above copyright // notice appears in all copies, and that both that copyright notice // and this permission notice appear in supporting documentation. None // of the above authors, nor IBM Haifa Research Laboratories, make any // representation about the suitability of this software for any // purpose. It is provided "as is" without express or implied // warranty. /** * @file constructors_destructor_fn_imps.hpp * Contains an implementation class for bin_search_tree_. */ PB_DS_CLASS_T_DEC typename PB_DS_CLASS_C_DEC::head_allocator PB_DS_CLASS_C_DEC::s_head_allocator; PB_DS_CLASS_T_DEC typename PB_DS_CLASS_C_DEC::internal_node_allocator PB_DS_CLASS_C_DEC::s_internal_node_allocator; PB_DS_CLASS_T_DEC typename PB_DS_CLASS_C_DEC::leaf_allocator PB_DS_CLASS_C_DEC::s_leaf_allocator; PB_DS_CLASS_T_DEC PB_DS_CLASS_C_DEC:: PB_DS_CLASS_NAME() : m_p_head(s_head_allocator.allocate(1)), m_size(0) { initialize(); _GLIBCXX_DEBUG_ONLY(assert_valid();) } PB_DS_CLASS_T_DEC PB_DS_CLASS_C_DEC:: PB_DS_CLASS_NAME(const e_access_traits& r_e_access_traits) : synth_e_access_traits(r_e_access_traits), m_p_head(s_head_allocator.allocate(1)), m_size(0) { initialize(); _GLIBCXX_DEBUG_ONLY(assert_valid();) } PB_DS_CLASS_T_DEC PB_DS_CLASS_C_DEC:: PB_DS_CLASS_NAME(const PB_DS_CLASS_C_DEC& other) : #ifdef _GLIBCXX_DEBUG debug_base(other), #endif synth_e_access_traits(other), node_update(other), m_p_head(s_head_allocator.allocate(1)), m_size(0) { initialize(); m_size = other.m_size; _GLIBCXX_DEBUG_ONLY(other.assert_valid();) if (other.m_p_head->m_p_parent == NULL) { _GLIBCXX_DEBUG_ONLY(assert_valid();) return; } __try { m_p_head->m_p_parent = recursive_copy_node(other.m_p_head->m_p_parent); } __catch(...) { s_head_allocator.deallocate(m_p_head, 1); __throw_exception_again; } m_p_head->m_p_min = leftmost_descendant(m_p_head->m_p_parent); m_p_head->m_p_max = rightmost_descendant(m_p_head->m_p_parent); m_p_head->m_p_parent->m_p_parent = m_p_head; _GLIBCXX_DEBUG_ONLY(assert_valid();) } PB_DS_CLASS_T_DEC void PB_DS_CLASS_C_DEC:: swap(PB_DS_CLASS_C_DEC& other) { _GLIBCXX_DEBUG_ONLY(assert_valid();) _GLIBCXX_DEBUG_ONLY(other.assert_valid();) value_swap(other); std::swap((e_access_traits& )(*this), (e_access_traits& )other); _GLIBCXX_DEBUG_ONLY(assert_valid();) _GLIBCXX_DEBUG_ONLY(other.assert_valid();) } PB_DS_CLASS_T_DEC void PB_DS_CLASS_C_DEC:: value_swap(PB_DS_CLASS_C_DEC& other) { _GLIBCXX_DEBUG_ONLY(debug_base::swap(other);) std::swap(m_p_head, other.m_p_head); std::swap(m_size, other.m_size); } PB_DS_CLASS_T_DEC PB_DS_CLASS_C_DEC:: ~PB_DS_CLASS_NAME() { clear(); s_head_allocator.deallocate(m_p_head, 1); } PB_DS_CLASS_T_DEC void PB_DS_CLASS_C_DEC:: initialize() { new (m_p_head) head(); m_p_head->m_p_parent = NULL; m_p_head->m_p_min = m_p_head; m_p_head->m_p_max = m_p_head; m_size = 0; } PB_DS_CLASS_T_DEC template<typename It> void PB_DS_CLASS_C_DEC:: copy_from_range(It first_it, It last_it) { while (first_it != last_it) insert(*(first_it++)); } PB_DS_CLASS_T_DEC typename PB_DS_CLASS_C_DEC::node_pointer PB_DS_CLASS_C_DEC:: recursive_copy_node(const_node_pointer p_other_nd) { _GLIBCXX_DEBUG_ASSERT(p_other_nd != NULL); if (p_other_nd->m_type == pat_trie_leaf_node_type) { const_leaf_pointer p_other_leaf = static_cast<const_leaf_pointer>(p_other_nd); leaf_pointer p_new_lf = s_leaf_allocator.allocate(1); cond_dealtor cond(p_new_lf); new (p_new_lf) leaf(p_other_leaf->value()); apply_update(p_new_lf, (node_update* )this); cond.set_no_action_dtor(); return (p_new_lf); } _GLIBCXX_DEBUG_ASSERT(p_other_nd->m_type == pat_trie_internal_node_type); node_pointer a_p_children[internal_node::arr_size]; size_type child_i = 0; const_internal_node_pointer p_other_internal_nd = static_cast<const_internal_node_pointer>(p_other_nd); typename internal_node::const_iterator child_it = p_other_internal_nd->begin(); internal_node_pointer p_ret; __try { while (child_it != p_other_internal_nd->end()) a_p_children[child_i++] = recursive_copy_node(*(child_it++)); p_ret = s_internal_node_allocator.allocate(1); } __catch(...) { while (child_i-- > 0) clear_imp(a_p_children[child_i]); __throw_exception_again; } new (p_ret) internal_node(p_other_internal_nd->get_e_ind(), pref_begin(a_p_children[0])); --child_i; _GLIBCXX_DEBUG_ASSERT(child_i > 1); do p_ret->add_child(a_p_children[child_i], pref_begin(a_p_children[child_i]), pref_end(a_p_children[child_i]), this); while (child_i-- > 0); apply_update(p_ret, (node_update* )this); return p_ret; }
{ "pile_set_name": "Github" }
macro_rules! m { ($pat: pat) => { trait Tr { fn trait_method($pat: u8); } type A = fn($pat: u8); extern "C" { fn foreign_fn($pat: u8); } }; } mod good_pat { m!(good_pat); // OK } mod bad_pat { m!((bad, pat)); //~^ ERROR patterns aren't allowed in function pointer types //~| ERROR patterns aren't allowed in foreign function declarations //~| ERROR patterns aren't allowed in functions without bodies } fn main() {}
{ "pile_set_name": "Github" }
# default word break at hyphens and n-dashes SET UTF-8 MAXNGRAMSUGS 0 WORDCHARS - TRY ot
{ "pile_set_name": "Github" }
m4trace:aclocal.m4:172: -1- m4_include([support/ocaml.m4]) m4trace:configure.ac:1: -1- AC_INIT([CAIRO_OCAML], [1.2.0]) m4trace:configure.ac:1: -1- m4_pattern_forbid([^_?A[CHUM]_]) m4trace:configure.ac:1: -1- m4_pattern_forbid([_AC_]) m4trace:configure.ac:1: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) m4trace:configure.ac:1: -1- m4_pattern_allow([^AS_FLAGS$]) m4trace:configure.ac:1: -1- m4_pattern_forbid([^_?m4_]) m4trace:configure.ac:1: -1- m4_pattern_forbid([^dnl$]) m4trace:configure.ac:1: -1- m4_pattern_forbid([^_?AS_]) m4trace:configure.ac:1: -1- AC_SUBST([SHELL]) m4trace:configure.ac:1: -1- AC_SUBST_TRACE([SHELL]) m4trace:configure.ac:1: -1- m4_pattern_allow([^SHELL$]) m4trace:configure.ac:1: -1- AC_SUBST([PATH_SEPARATOR]) m4trace:configure.ac:1: -1- AC_SUBST_TRACE([PATH_SEPARATOR]) m4trace:configure.ac:1: -1- m4_pattern_allow([^PATH_SEPARATOR$]) m4trace:configure.ac:1: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])]) m4trace:configure.ac:1: -1- AC_SUBST_TRACE([PACKAGE_NAME]) m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_NAME$]) m4trace:configure.ac:1: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])]) m4trace:configure.ac:1: -1- AC_SUBST_TRACE([PACKAGE_TARNAME]) m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) m4trace:configure.ac:1: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])]) m4trace:configure.ac:1: -1- AC_SUBST_TRACE([PACKAGE_VERSION]) m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_VERSION$]) m4trace:configure.ac:1: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])]) m4trace:configure.ac:1: -1- AC_SUBST_TRACE([PACKAGE_STRING]) m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_STRING$]) m4trace:configure.ac:1: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])]) m4trace:configure.ac:1: -1- AC_SUBST_TRACE([PACKAGE_BUGREPORT]) m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) m4trace:configure.ac:1: -1- AC_SUBST([PACKAGE_URL], [m4_ifdef([AC_PACKAGE_URL], ['AC_PACKAGE_URL'])]) m4trace:configure.ac:1: -1- AC_SUBST_TRACE([PACKAGE_URL]) m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_URL$]) m4trace:configure.ac:1: -1- AC_SUBST([exec_prefix], [NONE]) m4trace:configure.ac:1: -1- AC_SUBST_TRACE([exec_prefix]) m4trace:configure.ac:1: -1- m4_pattern_allow([^exec_prefix$]) m4trace:configure.ac:1: -1- AC_SUBST([prefix], [NONE]) m4trace:configure.ac:1: -1- AC_SUBST_TRACE([prefix]) m4trace:configure.ac:1: -1- m4_pattern_allow([^prefix$]) m4trace:configure.ac:1: -1- AC_SUBST([program_transform_name], [s,x,x,]) m4trace:configure.ac:1: -1- AC_SUBST_TRACE([program_transform_name]) m4trace:configure.ac:1: -1- m4_pattern_allow([^program_transform_name$]) m4trace:configure.ac:1: -1- AC_SUBST([bindir], ['${exec_prefix}/bin']) m4trace:configure.ac:1: -1- AC_SUBST_TRACE([bindir]) m4trace:configure.ac:1: -1- m4_pattern_allow([^bindir$]) m4trace:configure.ac:1: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin']) m4trace:configure.ac:1: -1- AC_SUBST_TRACE([sbindir]) m4trace:configure.ac:1: -1- m4_pattern_allow([^sbindir$]) m4trace:configure.ac:1: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec']) m4trace:configure.ac:1: -1- AC_SUBST_TRACE([libexecdir]) m4trace:configure.ac:1: -1- m4_pattern_allow([^libexecdir$]) m4trace:configure.ac:1: -1- AC_SUBST([datarootdir], ['${prefix}/share']) m4trace:configure.ac:1: -1- AC_SUBST_TRACE([datarootdir]) m4trace:configure.ac:1: -1- m4_pattern_allow([^datarootdir$]) m4trace:configure.ac:1: -1- AC_SUBST([datadir], ['${datarootdir}']) m4trace:configure.ac:1: -1- AC_SUBST_TRACE([datadir]) m4trace:configure.ac:1: -1- m4_pattern_allow([^datadir$]) m4trace:configure.ac:1: -1- AC_SUBST([sysconfdir], ['${prefix}/etc']) m4trace:configure.ac:1: -1- AC_SUBST_TRACE([sysconfdir]) m4trace:configure.ac:1: -1- m4_pattern_allow([^sysconfdir$]) m4trace:configure.ac:1: -1- AC_SUBST([sharedstatedir], ['${prefix}/com']) m4trace:configure.ac:1: -1- AC_SUBST_TRACE([sharedstatedir]) m4trace:configure.ac:1: -1- m4_pattern_allow([^sharedstatedir$]) m4trace:configure.ac:1: -1- AC_SUBST([localstatedir], ['${prefix}/var']) m4trace:configure.ac:1: -1- AC_SUBST_TRACE([localstatedir]) m4trace:configure.ac:1: -1- m4_pattern_allow([^localstatedir$]) m4trace:configure.ac:1: -1- AC_SUBST([includedir], ['${prefix}/include']) m4trace:configure.ac:1: -1- AC_SUBST_TRACE([includedir]) m4trace:configure.ac:1: -1- m4_pattern_allow([^includedir$]) m4trace:configure.ac:1: -1- AC_SUBST([oldincludedir], ['/usr/include']) m4trace:configure.ac:1: -1- AC_SUBST_TRACE([oldincludedir]) m4trace:configure.ac:1: -1- m4_pattern_allow([^oldincludedir$]) m4trace:configure.ac:1: -1- AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME], ['${datarootdir}/doc/${PACKAGE_TARNAME}'], ['${datarootdir}/doc/${PACKAGE}'])]) m4trace:configure.ac:1: -1- AC_SUBST_TRACE([docdir]) m4trace:configure.ac:1: -1- m4_pattern_allow([^docdir$]) m4trace:configure.ac:1: -1- AC_SUBST([infodir], ['${datarootdir}/info']) m4trace:configure.ac:1: -1- AC_SUBST_TRACE([infodir]) m4trace:configure.ac:1: -1- m4_pattern_allow([^infodir$]) m4trace:configure.ac:1: -1- AC_SUBST([htmldir], ['${docdir}']) m4trace:configure.ac:1: -1- AC_SUBST_TRACE([htmldir]) m4trace:configure.ac:1: -1- m4_pattern_allow([^htmldir$]) m4trace:configure.ac:1: -1- AC_SUBST([dvidir], ['${docdir}']) m4trace:configure.ac:1: -1- AC_SUBST_TRACE([dvidir]) m4trace:configure.ac:1: -1- m4_pattern_allow([^dvidir$]) m4trace:configure.ac:1: -1- AC_SUBST([pdfdir], ['${docdir}']) m4trace:configure.ac:1: -1- AC_SUBST_TRACE([pdfdir]) m4trace:configure.ac:1: -1- m4_pattern_allow([^pdfdir$]) m4trace:configure.ac:1: -1- AC_SUBST([psdir], ['${docdir}']) m4trace:configure.ac:1: -1- AC_SUBST_TRACE([psdir]) m4trace:configure.ac:1: -1- m4_pattern_allow([^psdir$]) m4trace:configure.ac:1: -1- AC_SUBST([libdir], ['${exec_prefix}/lib']) m4trace:configure.ac:1: -1- AC_SUBST_TRACE([libdir]) m4trace:configure.ac:1: -1- m4_pattern_allow([^libdir$]) m4trace:configure.ac:1: -1- AC_SUBST([localedir], ['${datarootdir}/locale']) m4trace:configure.ac:1: -1- AC_SUBST_TRACE([localedir]) m4trace:configure.ac:1: -1- m4_pattern_allow([^localedir$]) m4trace:configure.ac:1: -1- AC_SUBST([mandir], ['${datarootdir}/man']) m4trace:configure.ac:1: -1- AC_SUBST_TRACE([mandir]) m4trace:configure.ac:1: -1- m4_pattern_allow([^mandir$]) m4trace:configure.ac:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME]) m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_NAME$]) m4trace:configure.ac:1: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */ @%:@undef PACKAGE_NAME]) m4trace:configure.ac:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME]) m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) m4trace:configure.ac:1: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */ @%:@undef PACKAGE_TARNAME]) m4trace:configure.ac:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION]) m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_VERSION$]) m4trace:configure.ac:1: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */ @%:@undef PACKAGE_VERSION]) m4trace:configure.ac:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING]) m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_STRING$]) m4trace:configure.ac:1: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */ @%:@undef PACKAGE_STRING]) m4trace:configure.ac:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT]) m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) m4trace:configure.ac:1: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */ @%:@undef PACKAGE_BUGREPORT]) m4trace:configure.ac:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_URL]) m4trace:configure.ac:1: -1- m4_pattern_allow([^PACKAGE_URL$]) m4trace:configure.ac:1: -1- AH_OUTPUT([PACKAGE_URL], [/* Define to the home page for this package. */ @%:@undef PACKAGE_URL]) m4trace:configure.ac:1: -1- AC_SUBST([DEFS]) m4trace:configure.ac:1: -1- AC_SUBST_TRACE([DEFS]) m4trace:configure.ac:1: -1- m4_pattern_allow([^DEFS$]) m4trace:configure.ac:1: -1- AC_SUBST([ECHO_C]) m4trace:configure.ac:1: -1- AC_SUBST_TRACE([ECHO_C]) m4trace:configure.ac:1: -1- m4_pattern_allow([^ECHO_C$]) m4trace:configure.ac:1: -1- AC_SUBST([ECHO_N]) m4trace:configure.ac:1: -1- AC_SUBST_TRACE([ECHO_N]) m4trace:configure.ac:1: -1- m4_pattern_allow([^ECHO_N$]) m4trace:configure.ac:1: -1- AC_SUBST([ECHO_T]) m4trace:configure.ac:1: -1- AC_SUBST_TRACE([ECHO_T]) m4trace:configure.ac:1: -1- m4_pattern_allow([^ECHO_T$]) m4trace:configure.ac:1: -1- AC_SUBST([LIBS]) m4trace:configure.ac:1: -1- AC_SUBST_TRACE([LIBS]) m4trace:configure.ac:1: -1- m4_pattern_allow([^LIBS$]) m4trace:configure.ac:1: -1- AC_SUBST([build_alias]) m4trace:configure.ac:1: -1- AC_SUBST_TRACE([build_alias]) m4trace:configure.ac:1: -1- m4_pattern_allow([^build_alias$]) m4trace:configure.ac:1: -1- AC_SUBST([host_alias]) m4trace:configure.ac:1: -1- AC_SUBST_TRACE([host_alias]) m4trace:configure.ac:1: -1- m4_pattern_allow([^host_alias$]) m4trace:configure.ac:1: -1- AC_SUBST([target_alias]) m4trace:configure.ac:1: -1- AC_SUBST_TRACE([target_alias]) m4trace:configure.ac:1: -1- m4_pattern_allow([^target_alias$]) m4trace:configure.ac:3: -1- AC_CONFIG_AUX_DIR([support]) m4trace:configure.ac:6: -1- AC_SUBST([OCAMLC]) m4trace:configure.ac:6: -1- AC_SUBST_TRACE([OCAMLC]) m4trace:configure.ac:6: -1- m4_pattern_allow([^OCAMLC$]) m4trace:configure.ac:6: -1- AC_SUBST([OCAMLOPT]) m4trace:configure.ac:6: -1- AC_SUBST_TRACE([OCAMLOPT]) m4trace:configure.ac:6: -1- m4_pattern_allow([^OCAMLOPT$]) m4trace:configure.ac:6: -1- AC_SUBST([OCAMLCDOTOPT]) m4trace:configure.ac:6: -1- AC_SUBST_TRACE([OCAMLCDOTOPT]) m4trace:configure.ac:6: -1- m4_pattern_allow([^OCAMLCDOTOPT$]) m4trace:configure.ac:6: -1- AC_SUBST([OCAMLOPTDOTOPT]) m4trace:configure.ac:6: -1- AC_SUBST_TRACE([OCAMLOPTDOTOPT]) m4trace:configure.ac:6: -1- m4_pattern_allow([^OCAMLOPTDOTOPT$]) m4trace:configure.ac:6: -1- AC_SUBST([OCAMLDEP]) m4trace:configure.ac:6: -1- AC_SUBST_TRACE([OCAMLDEP]) m4trace:configure.ac:6: -1- m4_pattern_allow([^OCAMLDEP$]) m4trace:configure.ac:6: -1- AC_SUBST([OCAMLMKTOP]) m4trace:configure.ac:6: -1- AC_SUBST_TRACE([OCAMLMKTOP]) m4trace:configure.ac:6: -1- m4_pattern_allow([^OCAMLMKTOP$]) m4trace:configure.ac:6: -1- AC_SUBST([OCAMLMKLIB]) m4trace:configure.ac:6: -1- AC_SUBST_TRACE([OCAMLMKLIB]) m4trace:configure.ac:6: -1- m4_pattern_allow([^OCAMLMKLIB$]) m4trace:configure.ac:6: -1- AC_SUBST([OCAMLDOC]) m4trace:configure.ac:6: -1- AC_SUBST_TRACE([OCAMLDOC]) m4trace:configure.ac:6: -1- m4_pattern_allow([^OCAMLDOC$]) m4trace:configure.ac:6: -1- AC_SUBST([OCAMLC]) m4trace:configure.ac:6: -1- AC_SUBST_TRACE([OCAMLC]) m4trace:configure.ac:6: -1- m4_pattern_allow([^OCAMLC$]) m4trace:configure.ac:6: -1- AC_SUBST([OCAMLOPT]) m4trace:configure.ac:6: -1- AC_SUBST_TRACE([OCAMLOPT]) m4trace:configure.ac:6: -1- m4_pattern_allow([^OCAMLOPT$]) m4trace:configure.ac:6: -1- AC_SUBST([OCAMLDEP]) m4trace:configure.ac:6: -1- AC_SUBST_TRACE([OCAMLDEP]) m4trace:configure.ac:6: -1- m4_pattern_allow([^OCAMLDEP$]) m4trace:configure.ac:6: -1- AC_SUBST([OCAMLBEST]) m4trace:configure.ac:6: -1- AC_SUBST_TRACE([OCAMLBEST]) m4trace:configure.ac:6: -1- m4_pattern_allow([^OCAMLBEST$]) m4trace:configure.ac:6: -1- AC_SUBST([OCAMLVERSION]) m4trace:configure.ac:6: -1- AC_SUBST_TRACE([OCAMLVERSION]) m4trace:configure.ac:6: -1- m4_pattern_allow([^OCAMLVERSION$]) m4trace:configure.ac:6: -1- AC_SUBST([OCAMLLIB]) m4trace:configure.ac:6: -1- AC_SUBST_TRACE([OCAMLLIB]) m4trace:configure.ac:6: -1- m4_pattern_allow([^OCAMLLIB$]) m4trace:configure.ac:6: -1- AC_SUBST([OCAMLMKLIB]) m4trace:configure.ac:6: -1- AC_SUBST_TRACE([OCAMLMKLIB]) m4trace:configure.ac:6: -1- m4_pattern_allow([^OCAMLMKLIB$]) m4trace:configure.ac:6: -1- AC_SUBST([OCAMLMKTOP]) m4trace:configure.ac:6: -1- AC_SUBST_TRACE([OCAMLMKTOP]) m4trace:configure.ac:6: -1- m4_pattern_allow([^OCAMLMKTOP$]) m4trace:configure.ac:6: -1- AC_SUBST([OCAMLDOC]) m4trace:configure.ac:6: -1- AC_SUBST_TRACE([OCAMLDOC]) m4trace:configure.ac:6: -1- m4_pattern_allow([^OCAMLDOC$]) m4trace:configure.ac:9: -1- m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4trace:configure.ac:9: -1- m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) m4trace:configure.ac:9: -1- AC_SUBST([PKG_CONFIG]) m4trace:configure.ac:9: -1- AC_SUBST_TRACE([PKG_CONFIG]) m4trace:configure.ac:9: -1- m4_pattern_allow([^PKG_CONFIG$]) m4trace:configure.ac:9: -1- AC_SUBST([PKG_CONFIG_PATH]) m4trace:configure.ac:9: -1- AC_SUBST_TRACE([PKG_CONFIG_PATH]) m4trace:configure.ac:9: -1- m4_pattern_allow([^PKG_CONFIG_PATH$]) m4trace:configure.ac:9: -1- AC_SUBST([PKG_CONFIG_LIBDIR]) m4trace:configure.ac:9: -1- AC_SUBST_TRACE([PKG_CONFIG_LIBDIR]) m4trace:configure.ac:9: -1- m4_pattern_allow([^PKG_CONFIG_LIBDIR$]) m4trace:configure.ac:9: -1- AC_SUBST([PKG_CONFIG]) m4trace:configure.ac:9: -1- AC_SUBST_TRACE([PKG_CONFIG]) m4trace:configure.ac:9: -1- m4_pattern_allow([^PKG_CONFIG$]) m4trace:configure.ac:9: -1- AC_SUBST([CAIRO_CFLAGS]) m4trace:configure.ac:9: -1- AC_SUBST_TRACE([CAIRO_CFLAGS]) m4trace:configure.ac:9: -1- m4_pattern_allow([^CAIRO_CFLAGS$]) m4trace:configure.ac:9: -1- AC_SUBST([CAIRO_LIBS]) m4trace:configure.ac:9: -1- AC_SUBST_TRACE([CAIRO_LIBS]) m4trace:configure.ac:9: -1- m4_pattern_allow([^CAIRO_LIBS$]) m4trace:configure.ac:15: -1- AC_SUBST([LABLGTKDIR]) m4trace:configure.ac:15: -1- AC_SUBST_TRACE([LABLGTKDIR]) m4trace:configure.ac:15: -1- m4_pattern_allow([^LABLGTKDIR$]) m4trace:configure.ac:19: -1- AC_SUBST([LABLGTKDIR]) m4trace:configure.ac:19: -1- AC_SUBST_TRACE([LABLGTKDIR]) m4trace:configure.ac:19: -1- m4_pattern_allow([^LABLGTKDIR$]) m4trace:configure.ac:23: -1- AC_SUBST([GDK_CFLAGS]) m4trace:configure.ac:23: -1- AC_SUBST_TRACE([GDK_CFLAGS]) m4trace:configure.ac:23: -1- m4_pattern_allow([^GDK_CFLAGS$]) m4trace:configure.ac:23: -1- AC_SUBST([GDK_LIBS]) m4trace:configure.ac:23: -1- AC_SUBST_TRACE([GDK_LIBS]) m4trace:configure.ac:23: -1- m4_pattern_allow([^GDK_LIBS$]) m4trace:configure.ac:30: -1- AC_SUBST([LIBSVG_CAIRO_CFLAGS]) m4trace:configure.ac:30: -1- AC_SUBST_TRACE([LIBSVG_CAIRO_CFLAGS]) m4trace:configure.ac:30: -1- m4_pattern_allow([^LIBSVG_CAIRO_CFLAGS$]) m4trace:configure.ac:30: -1- AC_SUBST([LIBSVG_CAIRO_LIBS]) m4trace:configure.ac:30: -1- AC_SUBST_TRACE([LIBSVG_CAIRO_LIBS]) m4trace:configure.ac:30: -1- m4_pattern_allow([^LIBSVG_CAIRO_LIBS$]) m4trace:configure.ac:37: -1- AC_CONFIG_FILES([config.make]) m4trace:configure.ac:37: -1- _m4_warn([obsolete], [AC_OUTPUT should be used without arguments. You should run autoupdate.], []) m4trace:configure.ac:37: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs]) m4trace:configure.ac:37: -1- AC_SUBST_TRACE([LIB@&t@OBJS]) m4trace:configure.ac:37: -1- m4_pattern_allow([^LIB@&t@OBJS$]) m4trace:configure.ac:37: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs]) m4trace:configure.ac:37: -1- AC_SUBST_TRACE([LTLIBOBJS]) m4trace:configure.ac:37: -1- m4_pattern_allow([^LTLIBOBJS$]) m4trace:configure.ac:37: -1- AC_SUBST_TRACE([top_builddir]) m4trace:configure.ac:37: -1- AC_SUBST_TRACE([top_build_prefix]) m4trace:configure.ac:37: -1- AC_SUBST_TRACE([srcdir]) m4trace:configure.ac:37: -1- AC_SUBST_TRACE([abs_srcdir]) m4trace:configure.ac:37: -1- AC_SUBST_TRACE([top_srcdir]) m4trace:configure.ac:37: -1- AC_SUBST_TRACE([abs_top_srcdir]) m4trace:configure.ac:37: -1- AC_SUBST_TRACE([builddir]) m4trace:configure.ac:37: -1- AC_SUBST_TRACE([abs_builddir]) m4trace:configure.ac:37: -1- AC_SUBST_TRACE([abs_top_builddir])
{ "pile_set_name": "Github" }
<clr-spinner [clrInverse]="true">Loading ...</clr-spinner>
{ "pile_set_name": "Github" }
//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// int main(int, char**) { return 0; }
{ "pile_set_name": "Github" }
#!/bin/bash -e # # This script rebuilds the generated code for the protocol buffers. # To run this you will need protoc and goprotobuf installed; # see https://github.com/golang/protobuf for instructions. PKG=google.golang.org/appengine function die() { echo 1>&2 $* exit 1 } # Sanity check that the right tools are accessible. for tool in go protoc protoc-gen-go; do q=$(which $tool) || die "didn't find $tool" echo 1>&2 "$tool: $q" done echo -n 1>&2 "finding package dir... " pkgdir=$(go list -f '{{.Dir}}' $PKG) echo 1>&2 $pkgdir base=$(echo $pkgdir | sed "s,/$PKG\$,,") echo 1>&2 "base: $base" cd $base # Run protoc once per package. for dir in $(find $PKG/internal -name '*.proto' | xargs dirname | sort | uniq); do echo 1>&2 "* $dir" protoc --go_out=. $dir/*.proto done for f in $(find $PKG/internal -name '*.pb.go'); do # Remove proto.RegisterEnum calls. # These cause duplicate registration panics when these packages # are used on classic App Engine. proto.RegisterEnum only affects # parsing the text format; we don't care about that. # https://code.google.com/p/googleappengine/issues/detail?id=11670#c17 sed -i '/proto.RegisterEnum/d' $f done
{ "pile_set_name": "Github" }
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package http2 implements the HTTP/2 protocol. // // This package is low-level and intended to be used directly by very // few people. Most users will use it indirectly through the automatic // use by the net/http package (from Go 1.6 and later). // For use in earlier Go versions see ConfigureServer. (Transport support // requires Go 1.6 or later) // // See https://http2.github.io/ for more information on HTTP/2. // // See https://http2.golang.org/ for a test server running this code. // package http2 // import "golang.org/x/net/http2" import ( "bufio" "crypto/tls" "fmt" "io" "net/http" "os" "sort" "strconv" "strings" "sync" "golang.org/x/net/http/httpguts" ) var ( VerboseLogs bool logFrameWrites bool logFrameReads bool inTests bool ) func init() { e := os.Getenv("GODEBUG") if strings.Contains(e, "http2debug=1") { VerboseLogs = true } if strings.Contains(e, "http2debug=2") { VerboseLogs = true logFrameWrites = true logFrameReads = true } } const ( // ClientPreface is the string that must be sent by new // connections from clients. ClientPreface = "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n" // SETTINGS_MAX_FRAME_SIZE default // http://http2.github.io/http2-spec/#rfc.section.6.5.2 initialMaxFrameSize = 16384 // NextProtoTLS is the NPN/ALPN protocol negotiated during // HTTP/2's TLS setup. NextProtoTLS = "h2" // http://http2.github.io/http2-spec/#SettingValues initialHeaderTableSize = 4096 initialWindowSize = 65535 // 6.9.2 Initial Flow Control Window Size defaultMaxReadFrameSize = 1 << 20 ) var ( clientPreface = []byte(ClientPreface) ) type streamState int // HTTP/2 stream states. // // See http://tools.ietf.org/html/rfc7540#section-5.1. // // For simplicity, the server code merges "reserved (local)" into // "half-closed (remote)". This is one less state transition to track. // The only downside is that we send PUSH_PROMISEs slightly less // liberally than allowable. More discussion here: // https://lists.w3.org/Archives/Public/ietf-http-wg/2016JulSep/0599.html // // "reserved (remote)" is omitted since the client code does not // support server push. const ( stateIdle streamState = iota stateOpen stateHalfClosedLocal stateHalfClosedRemote stateClosed ) var stateName = [...]string{ stateIdle: "Idle", stateOpen: "Open", stateHalfClosedLocal: "HalfClosedLocal", stateHalfClosedRemote: "HalfClosedRemote", stateClosed: "Closed", } func (st streamState) String() string { return stateName[st] } // Setting is a setting parameter: which setting it is, and its value. type Setting struct { // ID is which setting is being set. // See http://http2.github.io/http2-spec/#SettingValues ID SettingID // Val is the value. Val uint32 } func (s Setting) String() string { return fmt.Sprintf("[%v = %d]", s.ID, s.Val) } // Valid reports whether the setting is valid. func (s Setting) Valid() error { // Limits and error codes from 6.5.2 Defined SETTINGS Parameters switch s.ID { case SettingEnablePush: if s.Val != 1 && s.Val != 0 { return ConnectionError(ErrCodeProtocol) } case SettingInitialWindowSize: if s.Val > 1<<31-1 { return ConnectionError(ErrCodeFlowControl) } case SettingMaxFrameSize: if s.Val < 16384 || s.Val > 1<<24-1 { return ConnectionError(ErrCodeProtocol) } } return nil } // A SettingID is an HTTP/2 setting as defined in // http://http2.github.io/http2-spec/#iana-settings type SettingID uint16 const ( SettingHeaderTableSize SettingID = 0x1 SettingEnablePush SettingID = 0x2 SettingMaxConcurrentStreams SettingID = 0x3 SettingInitialWindowSize SettingID = 0x4 SettingMaxFrameSize SettingID = 0x5 SettingMaxHeaderListSize SettingID = 0x6 ) var settingName = map[SettingID]string{ SettingHeaderTableSize: "HEADER_TABLE_SIZE", SettingEnablePush: "ENABLE_PUSH", SettingMaxConcurrentStreams: "MAX_CONCURRENT_STREAMS", SettingInitialWindowSize: "INITIAL_WINDOW_SIZE", SettingMaxFrameSize: "MAX_FRAME_SIZE", SettingMaxHeaderListSize: "MAX_HEADER_LIST_SIZE", } func (s SettingID) String() string { if v, ok := settingName[s]; ok { return v } return fmt.Sprintf("UNKNOWN_SETTING_%d", uint16(s)) } // validWireHeaderFieldName reports whether v is a valid header field // name (key). See httpguts.ValidHeaderName for the base rules. // // Further, http2 says: // "Just as in HTTP/1.x, header field names are strings of ASCII // characters that are compared in a case-insensitive // fashion. However, header field names MUST be converted to // lowercase prior to their encoding in HTTP/2. " func validWireHeaderFieldName(v string) bool { if len(v) == 0 { return false } for _, r := range v { if !httpguts.IsTokenRune(r) { return false } if 'A' <= r && r <= 'Z' { return false } } return true } func httpCodeString(code int) string { switch code { case 200: return "200" case 404: return "404" } return strconv.Itoa(code) } // from pkg io type stringWriter interface { WriteString(s string) (n int, err error) } // A gate lets two goroutines coordinate their activities. type gate chan struct{} func (g gate) Done() { g <- struct{}{} } func (g gate) Wait() { <-g } // A closeWaiter is like a sync.WaitGroup but only goes 1 to 0 (open to closed). type closeWaiter chan struct{} // Init makes a closeWaiter usable. // It exists because so a closeWaiter value can be placed inside a // larger struct and have the Mutex and Cond's memory in the same // allocation. func (cw *closeWaiter) Init() { *cw = make(chan struct{}) } // Close marks the closeWaiter as closed and unblocks any waiters. func (cw closeWaiter) Close() { close(cw) } // Wait waits for the closeWaiter to become closed. func (cw closeWaiter) Wait() { <-cw } // bufferedWriter is a buffered writer that writes to w. // Its buffered writer is lazily allocated as needed, to minimize // idle memory usage with many connections. type bufferedWriter struct { _ incomparable w io.Writer // immutable bw *bufio.Writer // non-nil when data is buffered } func newBufferedWriter(w io.Writer) *bufferedWriter { return &bufferedWriter{w: w} } // bufWriterPoolBufferSize is the size of bufio.Writer's // buffers created using bufWriterPool. // // TODO: pick a less arbitrary value? this is a bit under // (3 x typical 1500 byte MTU) at least. Other than that, // not much thought went into it. const bufWriterPoolBufferSize = 4 << 10 var bufWriterPool = sync.Pool{ New: func() interface{} { return bufio.NewWriterSize(nil, bufWriterPoolBufferSize) }, } func (w *bufferedWriter) Available() int { if w.bw == nil { return bufWriterPoolBufferSize } return w.bw.Available() } func (w *bufferedWriter) Write(p []byte) (n int, err error) { if w.bw == nil { bw := bufWriterPool.Get().(*bufio.Writer) bw.Reset(w.w) w.bw = bw } return w.bw.Write(p) } func (w *bufferedWriter) Flush() error { bw := w.bw if bw == nil { return nil } err := bw.Flush() bw.Reset(nil) bufWriterPool.Put(bw) w.bw = nil return err } func mustUint31(v int32) uint32 { if v < 0 || v > 2147483647 { panic("out of range") } return uint32(v) } // bodyAllowedForStatus reports whether a given response status code // permits a body. See RFC 7230, section 3.3. func bodyAllowedForStatus(status int) bool { switch { case status >= 100 && status <= 199: return false case status == 204: return false case status == 304: return false } return true } type httpError struct { _ incomparable msg string timeout bool } func (e *httpError) Error() string { return e.msg } func (e *httpError) Timeout() bool { return e.timeout } func (e *httpError) Temporary() bool { return true } var errTimeout error = &httpError{msg: "http2: timeout awaiting response headers", timeout: true} type connectionStater interface { ConnectionState() tls.ConnectionState } var sorterPool = sync.Pool{New: func() interface{} { return new(sorter) }} type sorter struct { v []string // owned by sorter } func (s *sorter) Len() int { return len(s.v) } func (s *sorter) Swap(i, j int) { s.v[i], s.v[j] = s.v[j], s.v[i] } func (s *sorter) Less(i, j int) bool { return s.v[i] < s.v[j] } // Keys returns the sorted keys of h. // // The returned slice is only valid until s used again or returned to // its pool. func (s *sorter) Keys(h http.Header) []string { keys := s.v[:0] for k := range h { keys = append(keys, k) } s.v = keys sort.Sort(s) return keys } func (s *sorter) SortStrings(ss []string) { // Our sorter works on s.v, which sorter owns, so // stash it away while we sort the user's buffer. save := s.v s.v = ss sort.Sort(s) s.v = save } // validPseudoPath reports whether v is a valid :path pseudo-header // value. It must be either: // // *) a non-empty string starting with '/' // *) the string '*', for OPTIONS requests. // // For now this is only used a quick check for deciding when to clean // up Opaque URLs before sending requests from the Transport. // See golang.org/issue/16847 // // We used to enforce that the path also didn't start with "//", but // Google's GFE accepts such paths and Chrome sends them, so ignore // that part of the spec. See golang.org/issue/19103. func validPseudoPath(v string) bool { return (len(v) > 0 && v[0] == '/') || v == "*" } // incomparable is a zero-width, non-comparable type. Adding it to a struct // makes that struct also non-comparable, and generally doesn't add // any size (as long as it's first). type incomparable [0]func()
{ "pile_set_name": "Github" }
# -*- mode: python; encoding: utf-8 -*- # # Copyright 2015 the Critic contributors, Opera Software ASA # # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy of # the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations under # the License. import api class ModifyAccessToken(object): def __init__(self, transaction, access_token): self.transaction = transaction self.access_token = access_token def setTitle(self, value): self.transaction.tables.add("accesstokens") self.transaction.items.append( api.transaction.Query( """UPDATE accesstokens SET title=%s WHERE id=%s""", (value, self.access_token.id))) def delete(self): self.transaction.tables.add("accesstokens") self.transaction.items.append( api.transaction.Query( """DELETE FROM accesstokens WHERE id=%s""", (self.access_token.id,))) def modifyProfile(self): from accesscontrolprofile import ModifyAccessControlProfile assert self.access_token.profile return ModifyAccessControlProfile( self.transaction, self.access_token.profile) class CreatedAccessToken(api.transaction.LazyAPIObject): def __init__(self, critic, user, callback=None): from accesscontrolprofile import CreatedAccessControlProfile super(CreatedAccessToken, self).__init__( critic, api.accesstoken.fetch, callback) self.user = user self.profile = CreatedAccessControlProfile(critic, self)
{ "pile_set_name": "Github" }
/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import { ChangeDetectorRef, OnDestroy, PipeTransform } from '@angular/core'; import { Observable } from 'rxjs/Observable'; /** * @ngModule CommonModule * @whatItDoes Unwraps a value from an asynchronous primitive. * @howToUse `observable_or_promise_expression | async` * @description * The `async` pipe subscribes to an `Observable` or `Promise` and returns the latest value it has * emitted. When a new value is emitted, the `async` pipe marks the component to be checked for * changes. When the component gets destroyed, the `async` pipe unsubscribes automatically to avoid * potential memory leaks. * * * ## Examples * * This example binds a `Promise` to the view. Clicking the `Resolve` button resolves the * promise. * * {@example common/pipes/ts/async_pipe.ts region='AsyncPipePromise'} * * It's also possible to use `async` with Observables. The example below binds the `time` Observable * to the view. The Observable continuously updates the view with the current time. * * {@example common/pipes/ts/async_pipe.ts region='AsyncPipeObservable'} * * @stable */ export declare class AsyncPipe implements OnDestroy, PipeTransform { private _ref; private _latestValue; private _latestReturnedValue; private _subscription; private _obj; private _strategy; constructor(_ref: ChangeDetectorRef); ngOnDestroy(): void; transform<T>(obj: null): null; transform<T>(obj: undefined): undefined; transform<T>(obj: Observable<T>): T | null; transform<T>(obj: Promise<T>): T | null; private _subscribe(obj); private _selectStrategy(obj); private _dispose(); private _updateLatestValue(async, value); }
{ "pile_set_name": "Github" }
.tabs, .tabs2, .tabs3 { background-image: url('tab_b.png'); width: 100%; z-index: 101; font-size: 13px; } .tabs2 { font-size: 10px; } .tabs3 { font-size: 9px; } .tablist { margin: 0; padding: 0; display: table; } .tablist li { float: left; display: table-cell; background-image: url('tab_b.png'); line-height: 36px; list-style: none; } .tablist a { display: block; padding: 0 20px; font-weight: bold; background-image:url('tab_s.png'); background-repeat:no-repeat; background-position:right; color: #283A5D; text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); text-decoration: none; outline: none; } .tabs3 .tablist a { padding: 0 10px; } .tablist a:hover { background-image: url('tab_h.png'); background-repeat:repeat-x; color: #fff; text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); text-decoration: none; } .tablist li.current a { background-image: url('tab_a.png'); background-repeat:repeat-x; color: #fff; text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); }
{ "pile_set_name": "Github" }
\ @(#) trace.fth 98/01/28 1.2 \ TRACE ( <name> -- , trace pForth word ) \ \ Single step debugger. \ TRACE ( i*x <name> -- , setup trace for Forth word ) \ S ( -- , step over ) \ SM ( many -- , step over many times ) \ SD ( -- , step down ) \ G ( -- , go to end of word ) \ GD ( n -- , go down N levels from current level, stop at end of this level ) \ \ This debugger works by emulating the inner interpreter of pForth. \ It executes code and maintains a separate return stack for the \ program under test. Thus all primitives that operate on the return \ stack, such as DO and R> must be trapped. Local variables must \ also be handled specially. Several state variables are also \ saved and restored to establish the context for the program being \ tested. \ \ Copyright 1997 Phil Burk \ \ Modifications: \ 19990930 John Providenza - Fixed stack bugs in GD anew task-trace.fth : SPACE.TO.COLUMN ( col -- ) out @ - spaces ; : IS.PRIMITIVE? ( xt -- flag , true if kernel primitive ) ['] first_colon < ; 0 value TRACE_IP \ instruction pointer 0 value TRACE_LEVEL \ level of descent for inner interpreter 0 value TRACE_LEVEL_MAX \ maximum level of descent private{ \ use fake return stack 128 cells constant TRACE_RETURN_SIZE \ size of return stack in bytes create TRACE-RETURN-STACK TRACE_RETURN_SIZE 16 + allot variable TRACE-RSP : TRACE.>R ( n -- ) trace-rsp @ cell- dup trace-rsp ! ! ; \ *(--rsp) = n : TRACE.R> ( -- n ) trace-rsp @ dup @ swap cell+ trace-rsp ! ; \ n = *rsp++ : TRACE.R@ ( -- n ) trace-rsp @ @ ; ; \ n = *rsp : TRACE.RPICK ( index -- n ) cells trace-rsp @ + @ ; ; \ n = rsp[index] : TRACE.0RP ( -- n ) trace-return-stack trace_return_size + 8 + trace-rsp ! ; : TRACE.RDROP ( -- ) cell trace-rsp +! ; : TRACE.RCHECK ( -- , abort if return stack out of range ) trace-rsp @ trace-return-stack u< abort" TRACE return stack OVERFLOW!" trace-rsp @ trace-return-stack trace_return_size + 12 + u> abort" TRACE return stack UNDERFLOW!" ; \ save and restore several state variables 10 cells constant TRACE_STATE_SIZE create TRACE-STATE-1 TRACE_STATE_SIZE allot create TRACE-STATE-2 TRACE_STATE_SIZE allot variable TRACE-STATE-PTR : TRACE.SAVE++ ( addr -- , save next thing ) @ trace-state-ptr @ ! cell trace-state-ptr +! ; : TRACE.SAVE.STATE ( -- ) state trace.save++ hld trace.save++ base trace.save++ ; : TRACE.SAVE.STATE1 ( -- , save normal state ) trace-state-1 trace-state-ptr ! trace.save.state ; : TRACE.SAVE.STATE2 ( -- , save state of word being debugged ) trace-state-2 trace-state-ptr ! trace.save.state ; : TRACE.RESTORE++ ( addr -- , restore next thing ) trace-state-ptr @ @ swap ! cell trace-state-ptr +! ; : TRACE.RESTORE.STATE ( -- ) state trace.restore++ hld trace.restore++ base trace.restore++ ; : TRACE.RESTORE.STATE1 ( -- ) trace-state-1 trace-state-ptr ! trace.restore.state ; : TRACE.RESTORE.STATE2 ( -- ) trace-state-2 trace-state-ptr ! trace.restore.state ; \ The implementation of these pForth primitives is specific to pForth. variable TRACE-LOCALS-PTR \ point to top of local frame \ create a return stack frame for NUM local variables : TRACE.(LOCAL.ENTRY) ( x0 x1 ... xn n -- ) { num | lp -- } trace-locals-ptr @ trace.>r trace-rsp @ trace-locals-ptr ! trace-rsp @ num cells - trace-rsp ! \ make room for locals trace-rsp @ -> lp num 0 DO lp ! cell +-> lp \ move data into locals frame on return stack LOOP ; : TRACE.(LOCAL.EXIT) ( -- ) trace-locals-ptr @ trace-rsp ! trace.r> trace-locals-ptr ! ; : TRACE.(LOCAL@) ( l# -- n , fetch from local frame ) trace-locals-ptr @ swap cells - @ ; : TRACE.(1_LOCAL@) ( -- n ) 1 trace.(local@) ; : TRACE.(2_LOCAL@) ( -- n ) 2 trace.(local@) ; : TRACE.(3_LOCAL@) ( -- n ) 3 trace.(local@) ; : TRACE.(4_LOCAL@) ( -- n ) 4 trace.(local@) ; : TRACE.(5_LOCAL@) ( -- n ) 5 trace.(local@) ; : TRACE.(6_LOCAL@) ( -- n ) 6 trace.(local@) ; : TRACE.(7_LOCAL@) ( -- n ) 7 trace.(local@) ; : TRACE.(8_LOCAL@) ( -- n ) 8 trace.(local@) ; : TRACE.(LOCAL!) ( n l# -- , store into local frame ) trace-locals-ptr @ swap cells - ! ; : TRACE.(1_LOCAL!) ( -- n ) 1 trace.(local!) ; : TRACE.(2_LOCAL!) ( -- n ) 2 trace.(local!) ; : TRACE.(3_LOCAL!) ( -- n ) 3 trace.(local!) ; : TRACE.(4_LOCAL!) ( -- n ) 4 trace.(local!) ; : TRACE.(5_LOCAL!) ( -- n ) 5 trace.(local!) ; : TRACE.(6_LOCAL!) ( -- n ) 6 trace.(local!) ; : TRACE.(7_LOCAL!) ( -- n ) 7 trace.(local!) ; : TRACE.(8_LOCAL!) ( -- n ) 8 trace.(local!) ; : TRACE.(LOCAL+!) ( n l# -- , store into local frame ) trace-locals-ptr @ swap cells - +! ; : TRACE.(?DO) { limit start ip -- ip' } limit start = IF ip @ +-> ip \ BRANCH ELSE start trace.>r limit trace.>r cell +-> ip THEN ip ; : TRACE.(LOOP) { ip | limit indx -- ip' } trace.r> -> limit trace.r> 1+ -> indx limit indx = IF cell +-> ip ELSE indx trace.>r limit trace.>r ip @ +-> ip THEN ip ; : TRACE.(+LOOP) { delta ip | limit indx oldindx -- ip' } trace.r> -> limit trace.r> -> oldindx oldindx delta + -> indx \ /* Do indices cross boundary between LIMIT-1 and LIMIT ? */ \ if( ( (OldIndex - Limit) & ((Limit-1) - NewIndex) & 0x80000000 ) || \ ( (NewIndex - Limit) & ((Limit-1) - OldIndex) & 0x80000000 ) ) oldindx limit - limit 1- indx - AND $ 80000000 AND indx limit - limit 1- oldindx - AND $ 80000000 AND OR IF cell +-> ip ELSE indx trace.>r limit trace.>r ip @ +-> ip THEN ip ; : TRACE.CHECK.IP { ip -- } ip ['] first_colon u< ip here u> OR IF ." TRACE - IP out of range = " ip .hex cr abort THEN ; : TRACE.SHOW.IP { ip -- , print name and offset } ip code> >name dup id. name> >code ip swap - ." +" . ; : TRACE.SHOW.STACK { | mdepth -- } base @ >r ." <" base @ decimal 1 .r ." :" depth 1 .r ." > " r> base ! depth 5 min -> mdepth depth mdepth - IF ." ... " \ if we don't show entire stack THEN mdepth 0 ?DO mdepth i 1+ - pick . \ show numbers in current base LOOP ; : TRACE.SHOW.NEXT { ip -- } >newline ip trace.check.ip \ show word name and offset ." << " ip trace.show.ip 16 space.to.column \ show data stack trace.show.stack 40 space.to.column ." ||" trace_level 2* spaces ip code@ cell +-> ip \ show primitive about to be executed dup .xt space \ trap any primitives that are followed by inline data CASE ['] (LITERAL) OF ip @ . ENDOF ['] (ALITERAL) OF ip a@ . ENDOF [ exists? (FLITERAL) [IF] ] ['] (FLITERAL) OF ip f@ f. ENDOF [ [THEN] ] ['] BRANCH OF ip @ . ENDOF ['] 0BRANCH OF ip @ . ENDOF ['] (.") OF ip count type .' "' ENDOF ['] (C") OF ip count type .' "' ENDOF ['] (S") OF ip count type .' "' ENDOF ENDCASE 65 space.to.column ." >> " ; : TRACE.DO.PRIMITIVE { ip xt | oldhere -- ip' , perform code at ip } xt CASE 0 OF -1 +-> trace_level trace.r> -> ip ENDOF \ EXIT ['] (CREATE) OF ip cell- body_offset + ENDOF ['] (LITERAL) OF ip @ cell +-> ip ENDOF ['] (ALITERAL) OF ip a@ cell +-> ip ENDOF [ exists? (FLITERAL) [IF] ] ['] (FLITERAL) OF ip f@ 1 floats +-> ip ENDOF [ [THEN] ] ['] BRANCH OF ip @ +-> ip ENDOF ['] 0BRANCH OF 0= IF ip @ +-> ip ELSE cell +-> ip THEN ENDOF ['] >R OF trace.>r ENDOF ['] R> OF trace.r> ENDOF ['] R@ OF trace.r@ ENDOF ['] RDROP OF trace.rdrop ENDOF ['] 2>R OF trace.>r trace.>r ENDOF ['] 2R> OF trace.r> trace.r> ENDOF ['] 2R@ OF trace.r@ 1 trace.rpick ENDOF ['] i OF 1 trace.rpick ENDOF ['] j OF 3 trace.rpick ENDOF ['] (LEAVE) OF trace.rdrop trace.rdrop ip @ +-> ip ENDOF ['] (LOOP) OF ip trace.(loop) -> ip ENDOF ['] (+LOOP) OF ip trace.(+loop) -> ip ENDOF ['] (DO) OF trace.>r trace.>r ENDOF ['] (?DO) OF ip trace.(?do) -> ip ENDOF ['] (.") OF ip count type ip count + aligned -> ip ENDOF ['] (C") OF ip ip count + aligned -> ip ENDOF ['] (S") OF ip count ip count + aligned -> ip ENDOF ['] (LOCAL.ENTRY) OF trace.(local.entry) ENDOF ['] (LOCAL.EXIT) OF trace.(local.exit) ENDOF ['] (LOCAL@) OF trace.(local@) ENDOF ['] (1_LOCAL@) OF trace.(1_local@) ENDOF ['] (2_LOCAL@) OF trace.(2_local@) ENDOF ['] (3_LOCAL@) OF trace.(3_local@) ENDOF ['] (4_LOCAL@) OF trace.(4_local@) ENDOF ['] (5_LOCAL@) OF trace.(5_local@) ENDOF ['] (6_LOCAL@) OF trace.(6_local@) ENDOF ['] (7_LOCAL@) OF trace.(7_local@) ENDOF ['] (8_LOCAL@) OF trace.(8_local@) ENDOF ['] (LOCAL!) OF trace.(local!) ENDOF ['] (1_LOCAL!) OF trace.(1_local!) ENDOF ['] (2_LOCAL!) OF trace.(2_local!) ENDOF ['] (3_LOCAL!) OF trace.(3_local!) ENDOF ['] (4_LOCAL!) OF trace.(4_local!) ENDOF ['] (5_LOCAL!) OF trace.(5_local!) ENDOF ['] (6_LOCAL!) OF trace.(6_local!) ENDOF ['] (7_LOCAL!) OF trace.(7_local!) ENDOF ['] (8_LOCAL!) OF trace.(8_local!) ENDOF ['] (LOCAL+!) OF trace.(local+!) ENDOF >r xt EXECUTE r> ENDCASE ip ; : TRACE.DO.NEXT { ip | xt oldhere -- ip' , perform code at ip } ip trace.check.ip \ set context for word under test trace.save.state1 here -> oldhere trace.restore.state2 oldhere 256 + dp ! \ get execution token ip code@ -> xt cell +-> ip \ execute token xt is.primitive? IF \ primitive ip xt trace.do.primitive -> ip ELSE \ secondary trace_level trace_level_max < IF ip trace.>r \ threaded execution 1 +-> trace_level xt codebase + -> ip ELSE \ treat it as a primitive ip xt trace.do.primitive -> ip THEN THEN \ restore original context trace.rcheck trace.save.state2 trace.restore.state1 oldhere dp ! ip ; : TRACE.NEXT { ip | xt -- ip' } trace_level 0> IF ip trace.do.next -> ip THEN trace_level 0> IF ip trace.show.next ELSE trace-stack on ." Finished." cr THEN ip ; }private : TRACE ( i*x <name> -- i*x , setup trace environment ) ' dup is.primitive? IF drop ." Sorry. You can't trace a primitive." cr ELSE 1 -> trace_level trace_level -> trace_level_max trace.0rp >code -> trace_ip trace_ip trace.show.next trace-stack off trace.save.state2 THEN ; : s ( -- , step over ) trace_level -> trace_level_max trace_ip trace.next -> trace_ip ; : sd ( -- , step down ) trace_level 1+ -> trace_level_max trace_ip trace.next -> trace_ip ; : sm ( many -- , step many times ) trace_level -> trace_level_max 0 ?DO trace_ip trace.next -> trace_ip LOOP ; defer trace.user ( IP -- stop? ) ' 0= is trace.user : gd { more_levels | stop_level -- } here what's trace.user u< \ has it been forgotten? IF ." Resetting TRACE.USER !!!" cr ['] 0= is trace.user THEN more_levels 0< more_levels 10 > or \ 19990930 - OR was missing IF ." GD level out of range (0-10), = " more_levels . cr ELSE trace_level more_levels + -> trace_level_max trace_level 1- -> stop_level BEGIN trace_ip trace.user \ call deferred user word ?dup \ leave flag for UNTIL \ 19990930 - was DUP IF ." TRACE.USER returned " dup . ." so stopping execution." cr ELSE trace_ip trace.next -> trace_ip trace_level stop_level > not THEN UNTIL THEN ; : g ( -- , execute until end of word ) 0 gd ; : TRACE.HELP ( -- ) ." TRACE ( i*x <name> -- , setup trace for Forth word )" cr ." S ( -- , step over )" cr ." SM ( many -- , step over many times )" cr ." SD ( -- , step down )" cr ." G ( -- , go to end of word )" cr ." GD ( n -- , go down N levels from current level," cr ." stop at end of this level )" cr ; privatize 0 [IF] variable var1 100 var1 ! : FOO dup IF 1 + . THEN 77 var1 @ + . ; : ZOO 29 foo 99 22 + . ; : ROO 92 >r 1 r@ + . r> . ; : MOO c" hello" count type ." This is a message." cr s" another message" type cr ; : KOO 7 FOO ." DONE" ; : TR.DO 4 0 DO i . LOOP ; : TR.?DO 0 ?DO i . LOOP ; : TR.LOC1 { aa bb } aa bb + . ; : TR.LOC2 789 >r 4 5 tr.loc1 r> . ; [THEN]
{ "pile_set_name": "Github" }
# frozen_string_literal: true require "spec_helper" module Decidim::Accountability describe Admin::CreateTimelineEntry do subject { described_class.new(form) } let(:organization) { create :organization, available_locales: [:en] } let(:participatory_process) { create :participatory_process, organization: organization } let(:current_component) { create :accountability_component, participatory_space: participatory_process } let(:result) { create :result, component: current_component } let(:date) { "2017-8-23" } let(:description) { "description" } let(:form) do double( invalid?: invalid, decidim_accountability_result_id: result.id, entry_date: date, description: { en: description } ) end let(:invalid) { false } context "when the form is not valid" do let(:invalid) { true } it "is not valid" do expect { subject.call }.to broadcast(:invalid) end end context "when everything is ok" do let(:timeline_entry) { TimelineEntry.last } it "creates the timeline entry" do expect { subject.call }.to change(TimelineEntry, :count).by(1) end it "sets the entry date" do subject.call expect(timeline_entry.entry_date).to eq(Date.new(2017, 8, 23)) end it "sets the description" do subject.call expect(translated(timeline_entry.description)).to eq description end it "sets the result" do subject.call expect(timeline_entry.result).to eq(result) end end end end
{ "pile_set_name": "Github" }
/***************************************************************************** * * PROJECT: Multi Theft Auto v1.0 * LICENSE: See LICENSE in the top level directory * FILE: mods/deathmatch/logic/CDatabaseConnectionSqlite.cpp * PURPOSE: Sqlite connection handler * * Multi Theft Auto is available from http://www.multitheftauto.com/ * *****************************************************************************/ #include "StdInc.h" #include "CDatabaseType.h" /////////////////////////////////////////////////////////////// // // CDatabaseConnectionSqlite // // /////////////////////////////////////////////////////////////// class CDatabaseConnectionSqlite : public CDatabaseConnection { public: ZERO_ON_NEW CDatabaseConnectionSqlite(CDatabaseType* pManager, const SString& strPath, const SString& strOptions); virtual ~CDatabaseConnectionSqlite(); // CDatabaseConnection virtual bool IsValid(); virtual const SString& GetLastErrorMessage(); virtual uint GetLastErrorCode(); virtual void AddRef(); virtual void Release(); virtual bool Query(const SString& strQuery, CRegistryResult& registryResult); virtual void Flush(); virtual int GetShareCount() { return m_iRefCount; } // CDatabaseConnectionSqlite void SetLastError(uint uiCode, const SString& strMessage); bool QueryInternal(const SString& strQuery, CRegistryResult& registryResult); void BeginAutomaticTransaction(); void EndAutomaticTransaction(); int m_iRefCount; CDatabaseType* m_pManager; sqlite3* m_handle; bool m_bOpened; SString m_strLastErrorMessage; uint m_uiLastErrorCode; bool m_bAutomaticTransactionsEnabled; bool m_bInAutomaticTransaction; CTickCount m_AutomaticTransactionStartTime; bool m_bMultipleStatements; }; /////////////////////////////////////////////////////////////// // Object creation /////////////////////////////////////////////////////////////// CDatabaseConnection* NewDatabaseConnectionSqlite(CDatabaseType* pManager, const SString& strPath, const SString& strOptions) { return new CDatabaseConnectionSqlite(pManager, strPath, strOptions); } /////////////////////////////////////////////////////////////// // // CDatabaseConnectionSqlite::CDatabaseConnectionSqlite // // // /////////////////////////////////////////////////////////////// CDatabaseConnectionSqlite::CDatabaseConnectionSqlite(CDatabaseType* pManager, const SString& strPath, const SString& strOptions) : m_iRefCount(1), m_pManager(pManager) { g_pStats->iDbConnectionCount++; // Parse options string GetOption<CDbOptionsMap>(strOptions, "batch", m_bAutomaticTransactionsEnabled, 1); GetOption<CDbOptionsMap>(strOptions, "multi_statements", m_bMultipleStatements, 0); MakeSureDirExists(strPath); if (sqlite3_open(strPath, &m_handle)) { SetLastError(sqlite3_errcode(m_handle), sqlite3_errmsg(m_handle)); } else { m_bOpened = true; } } /////////////////////////////////////////////////////////////// // // CDatabaseConnectionSqlite::CDatabaseConnectionSqlite // // // /////////////////////////////////////////////////////////////// CDatabaseConnectionSqlite::~CDatabaseConnectionSqlite() { Flush(); if (m_bOpened) sqlite3_close(m_handle); m_pManager->NotifyConnectionDeleted(this); g_pStats->iDbConnectionCount--; } /////////////////////////////////////////////////////////////// // // CDatabaseConnectionSqlite::AddRef // // // /////////////////////////////////////////////////////////////// void CDatabaseConnectionSqlite::AddRef() { m_iRefCount++; } /////////////////////////////////////////////////////////////// // // CDatabaseConnectionSqlite::Release // // // /////////////////////////////////////////////////////////////// void CDatabaseConnectionSqlite::Release() { if (--m_iRefCount > 0) { m_pManager->NotifyConnectionChanged(this); return; } // Do disconnect delete this; } /////////////////////////////////////////////////////////////// // // CDatabaseConnectionSqlite::IsValid // // Returns false if connection created all wrong // /////////////////////////////////////////////////////////////// bool CDatabaseConnectionSqlite::IsValid() { return m_bOpened; } /////////////////////////////////////////////////////////////// // // CDatabaseConnectionSqlite::GetLastErrorMessage // // Only valid when IsValid() or Query() returns false // /////////////////////////////////////////////////////////////// const SString& CDatabaseConnectionSqlite::GetLastErrorMessage() { return m_strLastErrorMessage; } /////////////////////////////////////////////////////////////// // // CDatabaseConnectionSqlite::GetLastErrorMessage // // Only valid when IsValid() or Query() returns false // /////////////////////////////////////////////////////////////// uint CDatabaseConnectionSqlite::GetLastErrorCode() { return m_uiLastErrorCode; } /////////////////////////////////////////////////////////////// // // CDatabaseConnectionSqlite::SetLastError // // // /////////////////////////////////////////////////////////////// void CDatabaseConnectionSqlite::SetLastError(uint uiCode, const SString& strMessage) { m_uiLastErrorCode = uiCode; m_strLastErrorMessage = strMessage; } /////////////////////////////////////////////////////////////// // // CDatabaseConnectionSqlite::Query // // // /////////////////////////////////////////////////////////////// bool CDatabaseConnectionSqlite::Query(const SString& strQuery, CRegistryResult& registryResult) { // VACUUM query does not work with transactions if (strQuery.BeginsWithI("VACUUM")) EndAutomaticTransaction(); else BeginAutomaticTransaction(); return QueryInternal(strQuery, registryResult); } /////////////////////////////////////////////////////////////// // // CDatabaseConnectionSqlite::QueryInternal // // Return false on error // Return true with datum in registryResult on success // /////////////////////////////////////////////////////////////// bool CDatabaseConnectionSqlite::QueryInternal(const SString& strQuery, CRegistryResult& registryResult) { const char* szQuery = strQuery; CRegistryResultData* pResult = registryResult->GetThis(); while (true) { // Prepare the query sqlite3_stmt* pStmt; if (sqlite3_prepare(m_handle, szQuery, strlen(szQuery) + 1, &pStmt, &szQuery) != SQLITE_OK) { SetLastError(sqlite3_errcode(m_handle), sqlite3_errmsg(m_handle)); return false; } // Get column names pResult->nColumns = sqlite3_column_count(pStmt); pResult->ColNames.clear(); for (int i = 0; i < pResult->nColumns; i++) { pResult->ColNames.push_back(sqlite3_column_name(pStmt, i)); } // Fetch the rows pResult->nRows = 0; pResult->Data.clear(); int status; while ((status = sqlite3_step(pStmt)) == SQLITE_ROW) { pResult->Data.push_back(vector<CRegistryResultCell>(pResult->nColumns)); vector<CRegistryResultCell>& row = pResult->Data.back(); for (int i = 0; i < pResult->nColumns; i++) { CRegistryResultCell& cell = row[i]; cell.nType = sqlite3_column_type(pStmt, i); switch (cell.nType) { case SQLITE_NULL: break; case SQLITE_INTEGER: cell.nVal = sqlite3_column_int64(pStmt, i); break; case SQLITE_FLOAT: cell.fVal = (float)sqlite3_column_double(pStmt, i); break; case SQLITE_BLOB: cell.nLength = sqlite3_column_bytes(pStmt, i); if (cell.nLength == 0) { cell.pVal = NULL; } else { cell.pVal = new unsigned char[cell.nLength]; memcpy(cell.pVal, sqlite3_column_blob(pStmt, i), cell.nLength); } break; default: cell.nLength = sqlite3_column_bytes(pStmt, i) + 1; cell.pVal = new unsigned char[cell.nLength]; memcpy(cell.pVal, sqlite3_column_text(pStmt, i), cell.nLength); break; } } pResult->nRows++; } // Did we leave the fetching loop because of an error? if (status != SQLITE_DONE) { SetLastError(sqlite3_errcode(m_handle), sqlite3_errmsg(m_handle)); sqlite3_finalize(pStmt); return false; } // All done sqlite3_finalize(pStmt); // Number of affects rows/num of rows like MySql pResult->uiNumAffectedRows = pResult->nRows ? pResult->nRows : sqlite3_changes(m_handle); // Last insert id pResult->ullLastInsertId = sqlite3_last_insert_rowid(m_handle); // See if should process next statement if (!m_bMultipleStatements || !szQuery || strlen(szQuery) < 2) break; pResult->pNextResult = new CRegistryResultData(); pResult = pResult->pNextResult; } return true; } /////////////////////////////////////////////////////////////// // // CDatabaseConnectionSqlite::BeginAutomaticTransaction // // // /////////////////////////////////////////////////////////////// void CDatabaseConnectionSqlite::BeginAutomaticTransaction() { if (m_bInAutomaticTransaction) { // If it's been a little while since this transaction was started, consider renewing it if ((CTickCount::Now() - m_AutomaticTransactionStartTime).ToLongLong() > 1500) EndAutomaticTransaction(); } if (!m_bInAutomaticTransaction && m_bAutomaticTransactionsEnabled) { m_bInAutomaticTransaction = true; m_AutomaticTransactionStartTime = CTickCount::Now(); CRegistryResult dummy; QueryInternal("BEGIN TRANSACTION", dummy); } } /////////////////////////////////////////////////////////////// // // CDatabaseConnectionSqlite::EndAutomaticTransaction // // // /////////////////////////////////////////////////////////////// void CDatabaseConnectionSqlite::EndAutomaticTransaction() { if (m_bInAutomaticTransaction) { m_bInAutomaticTransaction = false; CRegistryResult dummy; QueryInternal("END TRANSACTION", dummy); } } /////////////////////////////////////////////////////////////// // // CDatabaseConnectionSqlite::Flush // // Flush caches // /////////////////////////////////////////////////////////////// void CDatabaseConnectionSqlite::Flush() { EndAutomaticTransaction(); } /////////////////////////////////////////////////////////////// // // SqliteEscape // // Apply Sqlite escapement to a string // /////////////////////////////////////////////////////////////// static void SqliteEscape(SString& strOutput, const char* szContent, uint uiLength) { for (uint i = 0; i < uiLength; i++) { const char c = szContent[i]; if (c == '\'') strOutput += '\''; strOutput += c; } } /////////////////////////////////////////////////////////////// // // InsertQueryArgumentsSqlite // // Insert arguments and apply Sqlite escapement // /////////////////////////////////////////////////////////////// SString InsertQueryArgumentsSqlite(const SString& strQuery, CLuaArguments* pArgs) { SString strParsedQuery; // Walk through the query and replace the variable placeholders with the actual variables unsigned int uiLen = strQuery.length(); unsigned int a = 0; for (unsigned int i = 0; i < uiLen; i++) { if (strQuery[i] != SQL_VARIABLE_PLACEHOLDER) { // If we found a normal character, copy it into the destination buffer strParsedQuery += strQuery[i]; } else { // Use ?? for unquoted strings bool bUnquotedStrings = strQuery[i + 1] == SQL_VARIABLE_PLACEHOLDER; if (bUnquotedStrings) i++; // If the placeholder is found, replace it with the variable CLuaArgument* pArgument = (*pArgs)[a++]; // Check the type of the argument and convert it to a string we can process uint type = pArgument ? pArgument->GetType() : LUA_TNONE; if (type == LUA_TBOOLEAN) { strParsedQuery += (pArgument->GetBoolean()) ? "1" : "0"; } else if (type == LUA_TNUMBER) { double dNumber = pArgument->GetNumber(); if (dNumber == floor(dNumber)) strParsedQuery += SString("%lld", (long long)dNumber); else strParsedQuery += SString("%f", dNumber); } else if (type == LUA_TSTRING) { // Copy the string into the query, and escape ' if (!bUnquotedStrings) strParsedQuery += '\''; SqliteEscape(strParsedQuery, pArgument->GetString().c_str(), pArgument->GetString().length()); if (!bUnquotedStrings) strParsedQuery += '\''; } else if (type == LUA_TNIL) { // Nil becomes NULL strParsedQuery += "NULL"; } else { // If we don't have any content, put just output 2 quotes to indicate an empty variable strParsedQuery += "\'\'"; } } } return strParsedQuery; } /////////////////////////////////////////////////////////////// // // InsertQueryArgumentsSqlite // // Insert arguments and apply Sqlite escapement // /////////////////////////////////////////////////////////////// SString InsertQueryArgumentsSqlite(const char* szQuery, va_list vl) { SString strParsedQuery; for (unsigned int i = 0; szQuery[i] != '\0'; i++) { if (szQuery[i] != SQL_VARIABLE_PLACEHOLDER) { strParsedQuery += szQuery[i]; } else { // Use ?? for unquoted strings bool bUnquotedStrings = szQuery[i + 1] == SQL_VARIABLE_PLACEHOLDER; if (bUnquotedStrings) i++; switch (va_arg(vl, int)) { case SQLITE_INTEGER: { int iValue = va_arg(vl, int); strParsedQuery += SString("%d", iValue); } break; case SQLITE_INTEGER64: { long long int llValue = va_arg(vl, long long int); strParsedQuery += SString("%lld", llValue); } break; case SQLITE_FLOAT: { double fValue = va_arg(vl, double); strParsedQuery += SString("%f", fValue); } break; case SQLITE_TEXT: { const char* szValue = va_arg(vl, const char*); assert(szValue); if (!bUnquotedStrings) strParsedQuery += '\''; SqliteEscape(strParsedQuery, szValue, strlen(szValue)); if (!bUnquotedStrings) strParsedQuery += '\''; } break; case SQLITE_BLOB: { strParsedQuery += "CANT_DO_BLOBS_M8"; } break; case SQLITE_NULL: { strParsedQuery += "NULL"; } break; default: // someone passed a value without specifying its type assert(0); break; } } } va_end(vl); return strParsedQuery; }
{ "pile_set_name": "Github" }
/* global suite, test */ var assert = require('assert'); var sinon = require('sinon'); var readConfigDir = require('../lib/readconfigdir'); suite('readConfigDir', function() { test('read fixture directory', function() { var grunt = {}; var options = { data: {test: 1} }; var obj = readConfigDir(__dirname+'/config', grunt, options); assert.deepEqual(obj, require('./fixtures/output')); }); test('uses specified mergeFunction', function() { var grunt = {}; var spy = sinon.spy(); var options = { mergeFunction: spy }; readConfigDir(__dirname+'/config', grunt, options); assert.equal(spy.callCount, 8); }); test('multiconfig', function() { var grunt = {}; var obj = readConfigDir(__dirname+'/fixtures/multiconfig', grunt); var expected = require('./fixtures/output/multiconfig'); assert.deepEqual(obj, expected); }); });
{ "pile_set_name": "Github" }
require 'psych/helper' module Psych module Visitors class TestDepthFirst < TestCase class Collector < Struct.new(:calls) def initialize(calls = []) super end def call obj calls << obj end end def test_scalar collector = Collector.new visitor = Visitors::DepthFirst.new collector visitor.accept Psych.parse_stream '--- hello' assert_equal 3, collector.calls.length end def test_sequence collector = Collector.new visitor = Visitors::DepthFirst.new collector visitor.accept Psych.parse_stream "---\n- hello" assert_equal 4, collector.calls.length end def test_mapping collector = Collector.new visitor = Visitors::DepthFirst.new collector visitor.accept Psych.parse_stream "---\nhello: world" assert_equal 5, collector.calls.length end def test_alias collector = Collector.new visitor = Visitors::DepthFirst.new collector visitor.accept Psych.parse_stream "--- &yay\n- foo\n- *yay\n" assert_equal 5, collector.calls.length end end end end
{ "pile_set_name": "Github" }
namespace Perfolizer.Simulator.RqqPelt { public static class Program { public static void Main(string[] args) { using var runner = new Runner(); runner.Run(args); } } }
{ "pile_set_name": "Github" }
/* * Copyright 2015-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.rsocket.kotlin.payload import io.ktor.utils.io.core.* class Payload( val data: ByteReadPacket, val metadata: ByteReadPacket? = null ) { companion object { val Empty = Payload(ByteReadPacket.Empty) } } fun Payload.copy(): Payload = Payload(data.copy(), metadata?.copy()) fun Payload.release() { data.release() metadata?.release() } @Suppress("FunctionName") fun Payload(data: String, metadata: String? = null): Payload = Payload( data = buildPacket { writeText(data) }, metadata = metadata?.let { buildPacket { writeText(it) } } ) @Suppress("FunctionName") fun Payload(data: ByteArray, metadata: ByteArray? = null): Payload = Payload( data = ByteReadPacket(data), metadata = metadata?.let { ByteReadPacket(it) } )
{ "pile_set_name": "Github" }
<Alloy> <View id="Wrapper"> <View id="Background" /> <View id="Modal"> <ImageView id="Loading" /> <Label id="Label" text="Loading" /> </View> </View> </Alloy>
{ "pile_set_name": "Github" }
--- archs: [ armv7, armv7s, arm64 ] platform: ios install-name: /System/Library/CoreServices/Encodings/libTraditionalChineseConverter.dylib current-version: 70 compatibility-version: 1 exports: - archs: [ armv7, armv7s, arm64 ] symbols: [ ___CFStringEncodingGetTraditionalChineseConverterDefinition ] ...
{ "pile_set_name": "Github" }
/* * * * * * * * * * * * * Author's note * * * * * * * * * * * *\ * _ _ _ _ _ _ _ _ _ _ _ _ * * |_| |_| |_| |_| |_|_ _|_| |_| |_| _|_|_|_|_| * * |_|_ _ _|_| |_| |_| |_|_|_|_|_| |_| |_| |_|_ _ _ * * |_|_|_|_|_| |_| |_| |_| |_| |_| |_| |_| |_|_|_|_ * * |_| |_| |_|_ _ _|_| |_| |_| |_|_ _ _|_| _ _ _ _|_| * * |_| |_| |_|_|_| |_| |_| |_|_|_| |_|_|_|_| * * * * http://www.humus.name * * * * This file is a part of the work done by Humus. You are free to * * use the code in any way you like, modified, unmodified or copied * * into your own work. However, I expect you to respect these points: * * - If you use this file and its contents unmodified, or use a major * * part of this file, please credit the author and leave this note. * * - For use in anything commercial, please request my approval. * * - Share your work and ideas too as much as you can. * * * \* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef _SIMD_H_ #define _SIMD_H_ #include "Vector.h" /* #undef pfacc #undef pfmul __forceinline void planeDistance3DNow(const vec4 *plane, const vec4 *point, int *result){ __asm { mov eax, plane mov ebx, point mov ecx, result movq mm0, [eax] // [nx, ny] movq mm1, [eax + 8] // [nz, d] movq mm2, [ebx] // [px, py] movq mm3, [ebx + 8] // [pz, 1] pfmul mm0, mm2 // [nx * px, ny * py] pfmul mm1, mm3 // [nz * pz, d] pfacc mm0, mm1 pfacc mm0, mm0 movd [ecx], mm0 } } */ #include "../CPU.h" forceinline v4sf dot4(v4sf u, v4sf v){ v4sf m = mulps(u, v); v4sf f = shufps(m, m, SHUFFLE(2, 3, 0, 1)); m = addps(m, f); f = shufps(m, m, SHUFFLE(1, 0, 3, 2)); return addps(m, f); } #endif
{ "pile_set_name": "Github" }
<?php declare(strict_types=1); namespace Shopware\Core\Framework\DataAbstractionLayer\FieldSerializer; use Shopware\Core\Framework\DataAbstractionLayer\Exception\InvalidSerializerFieldException; use Shopware\Core\Framework\DataAbstractionLayer\Field\Field; use Shopware\Core\Framework\DataAbstractionLayer\Field\IntField; use Shopware\Core\Framework\DataAbstractionLayer\Write\DataStack\KeyValuePair; use Shopware\Core\Framework\DataAbstractionLayer\Write\EntityExistence; use Shopware\Core\Framework\DataAbstractionLayer\Write\WriteParameterBag; use Symfony\Component\Validator\Constraints\NotBlank; use Symfony\Component\Validator\Constraints\Range; use Symfony\Component\Validator\Constraints\Type; class IntFieldSerializer extends AbstractFieldSerializer { public function encode( Field $field, EntityExistence $existence, KeyValuePair $data, WriteParameterBag $parameters ): \Generator { if (!$field instanceof IntField) { throw new InvalidSerializerFieldException(IntField::class, $field); } $this->validateIfNeeded($field, $existence, $data, $parameters); yield $field->getStorageName() => $data->getValue(); } public function decode(Field $field, $value): ?int { return $value === null ? null : (int) $value; } /** * @param IntField $field */ protected function getConstraints(Field $field): array { $constraints = [ new Type('int'), new NotBlank(), ]; if ($field->getMinValue() !== null || $field->getMaxValue() !== null) { $constraints[] = new Range(['min' => $field->getMinValue(), 'max' => $field->getMaxValue()]); } return $constraints; } }
{ "pile_set_name": "Github" }
class openstack::neutron::l3_agent::rocky::buster( ) { require openstack::serverpackages::rocky::buster package { 'neutron-l3-agent': ensure => 'present', } }
{ "pile_set_name": "Github" }
<?php /* * FCKeditor - The text editor for Internet - http://www.fckeditor.net * Copyright (C) 2003-2009 Frederico Caldeira Knabben * * == BEGIN LICENSE == * * Licensed under the terms of any of the following licenses at your * choice: * * - GNU General Public License Version 2 or later (the "GPL") * http://www.gnu.org/licenses/gpl.html * * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") * http://www.gnu.org/licenses/lgpl.html * * - Mozilla Public License Version 1.1 or later (the "MPL") * http://www.mozilla.org/MPL/MPL-1.1.html * * == END LICENSE == * * These functions define the base of the XML response sent by the PHP * connector. */ function SetXmlHeaders() { ob_end_clean() ; // Prevent the browser from caching the result. // Date in the past header('Expires: Mon, 26 Jul 1997 05:00:00 GMT') ; // always modified header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT') ; // HTTP/1.1 header('Cache-Control: no-store, no-cache, must-revalidate') ; header('Cache-Control: post-check=0, pre-check=0', false) ; // HTTP/1.0 header('Pragma: no-cache') ; // Set the response format. header( 'Content-Type: text/xml; charset=utf-8' ) ; } function CreateXmlHeader( $command, $resourceType, $currentFolder ) { SetXmlHeaders() ; // Create the XML document header. echo '<?xml version="1.0" encoding="utf-8" ?>' ; // Create the main "Connector" node. echo '<Connector command="' . $command . '" resourceType="' . $resourceType . '">' ; // Add the current folder node. echo '<CurrentFolder path="' . ConvertToXmlAttribute( $currentFolder ) . '" url="' . ConvertToXmlAttribute( GetUrlFromPath( $resourceType, $currentFolder, $command ) ) . '" />' ; $GLOBALS['HeaderSent'] = true ; } function CreateXmlFooter() { echo '</Connector>' ; } function SendError( $number, $text ) { if ( isset( $GLOBALS['HeaderSent'] ) && $GLOBALS['HeaderSent'] ) { SendErrorNode( $number, $text ) ; CreateXmlFooter() ; } else { SetXmlHeaders() ; // Create the XML document header echo '<?xml version="1.0" encoding="utf-8" ?>' ; echo '<Connector>' ; SendErrorNode( $number, $text ) ; echo '</Connector>' ; } exit ; } function SendErrorNode( $number, $text ) { echo '<Error number="' . $number . '" text="' . htmlspecialchars( $text ) . '" />' ; } ?>
{ "pile_set_name": "Github" }
var baseUniq = require('./_baseUniq'); /** * This method is like `_.uniq` except that it accepts `comparator` which * is invoked to compare elements of `array`. The order of result values is * determined by the order they occur in the array.The comparator is invoked * with two arguments: (arrVal, othVal). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new duplicate free array. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; * * _.uniqWith(objects, _.isEqual); * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] */ function uniqWith(array, comparator) { comparator = typeof comparator == 'function' ? comparator : undefined; return (array && array.length) ? baseUniq(array, undefined, comparator) : []; } module.exports = uniqWith;
{ "pile_set_name": "Github" }
Value VRP_VERSION (\S+) Value PRODUCT_VERSION (.+) Value MODEL (.+) Value UPTIME (.+) Start ^.*software,\s+Version\s+${VRP_VERSION}\s+\(${PRODUCT_VERSION}\) ^HUAWEI\s+${MODEL}\s+uptime\s+is\s+${UPTIME}$$
{ "pile_set_name": "Github" }
/* Name: Tomorrow Night - Eighties Author: Chris Kempson CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror) Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */ .cm-s-tomorrow-night-eighties.CodeMirror {background: #000000; color: #CCCCCC;} .cm-s-tomorrow-night-eighties div.CodeMirror-selected {background: #2D2D2D !important;} .cm-s-tomorrow-night-eighties.CodeMirror ::selection { background: rgba(45, 45, 45, 0.99); } .cm-s-tomorrow-night-eighties.CodeMirror ::-moz-selection { background: rgba(45, 45, 45, 0.99); } .cm-s-tomorrow-night-eighties .CodeMirror-gutters {background: #000000; border-right: 0px;} .cm-s-tomorrow-night-eighties .CodeMirror-guttermarker { color: #f2777a; } .cm-s-tomorrow-night-eighties .CodeMirror-guttermarker-subtle { color: #777; } .cm-s-tomorrow-night-eighties .CodeMirror-linenumber {color: #515151;} .cm-s-tomorrow-night-eighties .CodeMirror-cursor {border-left: 1px solid #6A6A6A !important;} .cm-s-tomorrow-night-eighties span.cm-comment {color: #d27b53;} .cm-s-tomorrow-night-eighties span.cm-atom {color: #a16a94;} .cm-s-tomorrow-night-eighties span.cm-number {color: #a16a94;} .cm-s-tomorrow-night-eighties span.cm-property, .cm-s-tomorrow-night-eighties span.cm-attribute {color: #99cc99;} .cm-s-tomorrow-night-eighties span.cm-keyword {color: #f2777a;} .cm-s-tomorrow-night-eighties span.cm-string {color: #ffcc66;} .cm-s-tomorrow-night-eighties span.cm-variable {color: #99cc99;} .cm-s-tomorrow-night-eighties span.cm-variable-2 {color: #6699cc;} .cm-s-tomorrow-night-eighties span.cm-def {color: #f99157;} .cm-s-tomorrow-night-eighties span.cm-bracket {color: #CCCCCC;} .cm-s-tomorrow-night-eighties span.cm-tag {color: #f2777a;} .cm-s-tomorrow-night-eighties span.cm-link {color: #a16a94;} .cm-s-tomorrow-night-eighties span.cm-error {background: #f2777a; color: #6A6A6A;} .cm-s-tomorrow-night-eighties .CodeMirror-activeline-background {background: #343600 !important;} .cm-s-tomorrow-night-eighties .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;}
{ "pile_set_name": "Github" }
{ "name": "vakata/jstree", "description": "jsTree is jquery plugin, that provides interactive trees.", "type": "component", "homepage": "http://jstree.com", "license": "MIT", "support": { "issues": "https://github.com/vakata/jstree/issues", "forum": "https://groups.google.com/forum/#!forum/jstree", "source": "https://github.com/vakata/jstree" }, "authors": [ { "name": "Ivan Bozhanov", "email": "[email protected]" } ], "require": { "components/jquery": ">=1.9.1" }, "suggest": { "robloach/component-installer": "Allows installation of Components via Composer" }, "extra": { "component": { "scripts": [ "dist/jstree.js" ], "styles": [ "dist/themes/default/style.css" ], "images": [ "dist/themes/default/32px.png", "dist/themes/default/40px.png", "dist/themes/default/throbber.gif" ], "files": [ "dist/jstree.min.js", "dist/themes/default/style.min.css", "dist/themes/default/32px.png", "dist/themes/default/40px.png", "dist/themes/default/throbber.gif" ] } } }
{ "pile_set_name": "Github" }
# CookIM - 一个基于akka的分布式websocket聊天程序 - 支持私聊、群聊 - 支持分布式多个服务端通信 - 支持文本消息、文件消息、语音消息(感谢[ft115637850](https://github.com/ft115637850)的PR) ![CookIM logo](docs/cookim.png) - [中文文档](README_CN.md) - [English document](README.md) --- - [GitHub项目地址](https://github.com/cookeem/CookIM/) - [OSChina项目地址](https://git.oschina.net/cookeem/CookIM/) --- ### 目录 1. [演示](#演示) 1. [PC演示](#PC演示) 1. [手机演示](#手机演示) 1. [演示地址](#演示地址) 1. [以Docker-Compose方式启动CookIM集群](#以docker-compose方式启动cookim集群) 1. [启动集群](#启动集群) 1. [增加节点](#增加节点) 1. [调试容器](#调试容器) 1. [停止集群](#停止集群) 1. [运行](#运行) 1. [本地运行需求](#本地运行需求) 1. [获取源代码](#获取源代码) 1. [配置与打包](#配置与打包) 1. [启动CookIM服务](#启动cookim服务) 1. [打开浏览器,访问以下网址8080](#打开浏览器访问以下网址8080) 1. [启动另一个CookIM服务](#启动另一个cookim服务) 1. [打开浏览器,访问以下网址8081](#打开浏览器访问以下网址8081) 1. [架构](#架构) 1. [整体服务架构](#整体服务架构) 1. [akka stream websocket graph](#akka-stream-websocket-graph) 1. [MongoDB数据库说明](#mongodb数据库说明) 1. [消息类型](#消息类型) 1. [ChangeLog](#ChangeLog) 1. [0.1.0-SNAPSHOT](#010-snapshot) 1. [0.2.0-SNAPSHOT](#020-snapshot) 1. [0.2.4-SNAPSHOT](#024-snapshot) --- [返回目录](#目录) ###演示 #### PC演示 ![screen snapshot](docs/screen.png) #### 手机演示 ![screen snapshot](docs/screen2.png) #### 演示地址 [https://im.cookeem.com](https://im.cookeem.com) --- ### 以Docker-Compose方式启动CookIM集群 #### 启动集群 进入CookIM所在目录,运行以下命令,以docker-compose方式启动CookIM集群,该集群启动了三个容器:mongo、cookim1、cookim2 ```sh $ git clone https://github.com/cookeem/CookIM.git $ cd CookIM $ sudo docker-compose up -d Creating mongo Creating cookim1 Creating cookim2 ``` 成功启动集群后,浏览器分别访问以下网址,对应不同的CookIM服务 > http://localhost:8080 > http://localhost:8081 --- [返回目录](#目录) #### 增加节点 可以通过修改docker-compose.yml文件增加CookIM服务节点,例如增加第三个节点cookim3: ```yaml cookim3: image: cookeem/cookim container_name: cookim3 hostname: cookim3 environment: HOST_NAME: cookim3 WEB_PORT: 8080 AKKA_PORT: 2551 SEED_NODES: cookim1:2551 MONGO_URI: mongodb://mongo:27017/local ports: - "8082:8080" depends_on: - mongo - cookim1 ``` --- [返回目录](#目录) #### 调试容器 查看cookim1容器日志输出 ```sh $ sudo docker logs -f cookim1 ``` 进入cookim1容器进行调试 ```sh $ sudo docker exec -ti cookim1 bash ``` --- [返回目录](#目录) #### 停止集群 ```sh $ sudo docker-compose stop $ sudo docker-compose rm -f ``` --- [返回目录](#目录) ### 运行 #### 本地运行需求 * JDK 8+ * Scala 2.11+ * SBT 0.13.15 * MongoDB 2.6 - 3.4 --- [返回目录](#目录) #### 获取源代码 ```sh git clone https://github.com/cookeem/CookIM.git cd CookIM ``` --- [返回目录](#目录) #### 配置与打包 配置文件位于```conf/application.conf```,请务必配置mongodb的uri配置 ```sh mongodb { dbname = "cookim" uri = "mongodb://mongo:27017/local" } ``` 对CookIM进行打包fatjar,打包后文件位于```target/scala-2.11/CookIM-assembly-0.2.0-SNAPSHOT.jar``` ```sh sbt clean assembly ``` --- [返回目录](#目录) #### 启动CookIM服务 CookIM的数据保存在MongoDB中,启动CookIM前务必先启动MongoDB a. 调试方式启动服务: ```sh $ sbt "run-main com.cookeem.chat.CookIM -h localhost -w 8080 -a 2551 -s localhost:2551" ``` b. 打包编译: ```sh $ sbt assembly ``` c. 产品方式启动服务: ```sh $ java -classpath "target/scala-2.11/CookIM-assembly-0.2.4-SNAPSHOT.jar" com.cookeem.chat.CookIM -h localhost -w 8080 -a 2551 -s localhost:2551 ``` 以上命令启动了一个监听8080端口的WEB服务,akka system的监听端口为2551 参数说明: -a <AKKA-PORT> -h <HOST-NAME> [-m <MONGO-URI>] [-n] -s <SEED-NODES> -w <WEB-PORT> -a,--akka-port <AKKA-PORT> akka cluster node port -h,--host-name <HOST-NAME> current web service external host name -m,--mongo-uri <MONGO-URI> mongodb connection uri, example: mongodb://localhost:27017/local -n,--nat is nat network or in docker -s,--seed-nodes <SEED-NODES> akka cluster seed nodes, seperate with comma, example: localhost:2551,localhost:2552 -w,--web-port <WEB-PORT> web service port --- [返回目录](#目录) #### 打开浏览器,访问以下网址8080 > http://localhost:8080 --- [返回目录](#目录) #### 启动另一个CookIM服务 打开另外一个终端,启动另一个CookIM服务,测试服务间的消息通讯功能。 a. 调试方式启动服务: ```sh $ sbt "run-main com.cookeem.chat.CookIM -h localhost -w 8081 -a 2552 -s localhost:2551" ``` b. 产品方式启动服务: ```sh $ java -classpath "target/scala-2.11/CookIM-assembly-0.2.0-SNAPSHOT.jar" com.cookeem.chat.CookIM -h localhost -w 8081 -a 2552 -s localhost:2551 ``` 以上命令启动了一个监听8081端口的WEB服务,akka system的监听端口为2552 --- [返回目录](#目录) #### 打开浏览器,访问以下网址8081 > http://localhost:8081 该演示启动了两个CookIM服务,访问地址分别为8080端口以及8081端口,用户通过两个浏览器分别访问不同的的CookIM服务,用户在浏览器中通过websocket发送消息到akka集群,akka集群通过分布式的消息订阅与发布,把消息推送到集群中相应的节点,实现消息在不同服务间的分布式通讯。 --- [返回目录](#目录) ### 架构 #### 整体服务架构 ![CookIM architecture](docs/CookIM-Flow.png) **CookIM服务由三部分组成,基础原理如下:** > 1. akka http:用于提供web服务,浏览器通过websocket连接akka http来访问分布式聊天应用; > 2. akka stream:akka http在接收websocket发送的消息之后(消息包括文本消息:TextMessage以及二进制文件消息:BinaryMessage),把消息放到chatService流中进行流式处理。websocket消息中包含JWT(Javascript web token),如果JWT校验不通过,chatService流会直接返回reject消息;如果JWT校验通过,chatService流会把消息发送到ChatSessionActor中; > 3. akka cluster:akka stream把用户消息发送到akka cluster,CookIM使用到akka cluster的DistributedPubSub,当用户进入会话的时候,订阅(Subscribe)对应的会话;当用户向会话发送消息的时候,会把消息发布(Publish)到订阅的actor中,此时,群聊中的用户就可以收到消息。 --- [返回目录](#目录) #### akka stream websocket graph ![CookIM stream](docs/CookIM-ChatStream.png) - akka http在接收到websocket发送的消息之后,会把消息发送到chatService流里边进行处理,这里使用到akka stream graph: > 1. websocket发送的消息体包含JWT,flowFromWS用于接收websocket消息,并把消息里边的JWT进行解码,验证有效性; > 2. 对于JWT校验失败的消息,会经过filterFailure进行过滤;对于JWT校验成功的消息,会经过filterSuccess进行过滤; > 3. builder.materializedValue为akka stream的物化值,在akka stream创建的时候,会自动向connectedWs发送消息,connectedWs把消息转换成UserOnline消息,通过chatSinkActor发送给ChatSessionActor; > 4. chatActorSink向chatSessionActor发送消息,在akka stream结束的时候,向down stream发送UserOffline消息; > 5. chatSource用于接收从ChatSessionActor中回送的消息,并且把消息发送给flowAcceptBack; > 6. flowAcceptBack提供keepAlive,保证连接不中断; > 7. flowReject和flowAcceptBack的消息最后统一通过flowBackWs处理成websocket形式的Message通过websocket回送给用户; --- [返回目录](#目录) #### MongoDB数据库说明 - users: 用户表 ``` *login(登录邮箱) nickname(昵称) password(密码SHA1) gender(性别:未知:0,男生:1,女生:2) avatar(头像,绝对路径,/upload/avatar/201610/26/xxxx.JPG) lastLogin(最后登录时间,timstamp) loginCount(登录次数) sessionsStatus(用户相关的会话状态列表) [{sessionid: 会话id, newCount: 未读的新消息数量}] friends(用户的好友列表:[好友uuid]) dateline(注册时间,timstamp) ``` - sessions: 会话表(记录所有群聊私聊的会话信息) ``` *createuid(创建者的uid) *ouid(接收者的uid,只有当私聊的时候才有效) sessionIcon(会话的icon,对于群聊有效) sessionType(会话类型:0:私聊,1:群聊) publicType(可见类型:0:不公开邀请才能加入,1:公开) sessionName(群描述) dateline(创建日期,timestamp) usersStatus(会话对应的用户uuid数组) [{uid: 用户uuid, online: 是否在线(true:在线,false:离线}] lastMsgid(最新发送的消息id) lastUpdate(最后更新时间,timstamp) ``` - messages: 消息表(记录会话中的消息记录) ``` *uid(消息发送者的uid) *sessionid(所在的会话id) msgType(消息类型:) content(消息内容) fileInfo(文件内容) { filePath(文件路径) fileName(文件名) fileType(文件mimetype) fileSize(文件大小) fileThumb(缩略图) } *dateline(创建日期,timestamp) ``` - onlines:(在线用户表) ``` *id(唯一标识) *uid(在线用户uid) dateline(更新时间戳) ``` - notifications:(接收通知表) ``` noticeType:通知类型("joinFriend", "removeFriend", "inviteSession") senduid:操作方uid *recvuid:接收方uid sessionid:对应的sessionid isRead:是否已读(0:未读,1:已读) dateline(更新时间戳) ``` --- [返回目录](#目录) #### 消息类型 有两个websocket信道:ws-push和ws-chat > ws-push向用户下发消息提醒,当用户不在会话中,可以提醒用户有哪些会话有新消息 /ws-push channel ``` 上行消息,用于订阅推送消息: { userToken: "xxx" } 下行消息: acceptMsg: { uid: "xxx", nickname: "xxx", avatar: "xxx", sessionid: "xxx", sessionName: "xxx", sessionIcon: "xxx", msgType: "accept", content: "xxx", dateline: "xxx" } rejectMsg: { uid: "", nickname: "", avatar: "", sessionid: "", sessionName: "", sessionIcon: "", msgType: "reject", content: "xxx", dateline: "xxx" } keepAlive: { uid: "", nickname: "", avatar: "", sessionid: "", sessionName: "", sessionIcon: "", msgType: "keepalive", content: "", dateline: "xxx" } textMsg: { uid: "xxx", nickname: "xxx", avatar: "xxx", sessionid: "xxx", sessionName: "xxx", sessionIcon: "xxx", msgType: "text", content: "xxx", dateline: "xxx" } fileMsg: { uid: "xxx", nickname: "xxx", avatar: "xxx", sessionid: "xxx", sessionName: "xxx", sessionIcon: "xxx", msgType: "file", fileName: "xxx", fileType: "xxx", fileid: "xxx", thumbid: "xxx", dateline: "xxx" } onlineMsg: { uid: "xxx", nickname: "xxx", avatar: "xxx", sessionid: "xxx", sessionName: "xxx", sessionIcon: "xxx", msgType: "online", content: "xxx", dateline: "xxx" } offlineMsg: { uid: "xxx", nickname: "xxx", avatar: "xxx", sessionid: "xxx", sessionName: "xxx", sessionIcon: "xxx", msgType: "offline", content: "xxx", dateline: "xxx" } joinSessionMsg: { uid: "xxx", nickname: "xxx", avatar: "xxx", sessionid: "xxx", sessionName: "xxx", sessionIcon: "xxx", msgType: "join", content: "xxx", dateline: "xxx" } leaveSessionMsg:{ uid: "xxx", nickname: "xxx", avatar: "xxx", sessionid: "xxx", sessionName: "xxx", sessionIcon: "xxx", msgType: "leave", content: "xxx", dateline: "xxx" } noticeMsg: { uid: "", nickname: "", avatar: "", sessionid: "", sessionName: "xxx", sessionIcon: "xxx", msgType: "system", content: "xxx", dateline: "xxx" } 下行到浏览器消息格式: pushMsg: { uid: "xxx", nickname: "xxx", avatar: "xxx", sessionid: "xxx", sessionName: "xxx", sessionIcon: "xxx", msgType: "xxx", content: "xxx", fileName: "xxx", fileType: "xxx", fileid: "xxx", thumbid: "xxx", dateline: "xxx" } ``` --- [返回目录](#目录) > ws-chat为用户在会话中的聊天信道,用户在会话中发送消息以及接收消息用 ``` /ws-chat channel 上行消息: onlineMsg: { userToken: "xxx", sessionToken: "xxx", msgType:"online", content:"" } textMsg: { userToken: "xxx", sessionToken: "xxx", msgType:"text", content:"xxx" } fileMsg: { userToken: "xxx", sessionToken: "xxx", msgType:"file", fileName:"xxx", fileSize: 999, fileType: "xxx" }<#BinaryInfo#>binary_file_array_buffer 下行消息: rejectMsg: { uid: "", nickname: "", avatar: "", sessionid: "", sessionName: "", sessionIcon: "", msgType: "reject", content: "xxx", dateline: "xxx" } keepAlive: { uid: "", nickname: "", avatar: "", sessionid: "", sessionName: "", sessionIcon: "", msgType: "keepalive", content: "", dateline: "xxx" } textMsg: { uid: "xxx", nickname: "xxx", avatar: "xxx", sessionid: "xxx", sessionName: "xxx", sessionIcon: "xxx", msgType: "text", content: "xxx", dateline: "xxx" } fileMsg: { uid: "xxx", nickname: "xxx", avatar: "xxx", sessionid: "xxx", sessionName: "xxx", sessionIcon: "xxx", msgType: "file", fileName: "xxx", fileType: "xxx", fileid: "xxx", thumbid: "xxx", dateline: "xxx" } onlineMsg: { uid: "xxx", nickname: "xxx", avatar: "xxx", sessionid: "xxx", sessionName: "xxx", sessionIcon: "xxx", msgType: "online", content: "xxx", dateline: "xxx" } offlineMsg: { uid: "xxx", nickname: "xxx", avatar: "xxx", sessionid: "xxx", sessionName: "xxx", sessionIcon: "xxx", msgType: "offline", content: "xxx", dateline: "xxx" } joinSessionMsg:{ uid: "xxx", nickname: "xxx", avatar: "xxx", sessionid: "xxx", sessionName: "xxx", sessionIcon: "xxx", msgType: "join", content: "xxx", dateline: "xxx" } leaveSessionMsg:{ uid: "xxx", nickname: "xxx", avatar: "xxx", sessionid: "xxx", sessionName: "xxx", sessionIcon: "xxx", msgType: "leave", content: "xxx", dateline: "xxx" } noticeMsg: { uid: "", nickname: "", avatar: "", sessionid: "", sessionName: "xxx", sessionIcon: "xxx", msgType: "system", content: "xxx", dateline: "xxx" } 下行到浏览器消息格式: chatMsg: { uid: "xxx", nickname: "xxx", avatar: "xxx", msgType: "xxx", content: "xxx", fileName: "xxx", fileType: "xxx", fileid: "xxx", thumbid: "xxx", dateline: "xxx" } ``` --- [返回目录](#目录) ### ChangeLog #### 0.1.0-SNAPSHOT --- [返回目录](#目录) #### 0.2.0-SNAPSHOT * CookIM支持MongoDB 3.4.4 * 更新akka版本为2.5.2 * 更新容器启动方式,只保留docker-compose方式启动集群 --- [返回目录](#目录) #### 0.2.4-SNAPSHOT * 支持发送语音消息,chrome和firefox以及最新的safari11支持 * 支持命令行设置mongodb连接参数设置 * 更新docker启动方式 --- [返回目录](#目录)
{ "pile_set_name": "Github" }
// Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package internal contains support packages for oauth2 package. package internal
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!-- /** * Copyright (c) 2010, The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ --> <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="status_bar_clear_all_button" msgid="4661583896803349732">"Esborra-ho"</string> <string name="notifications_off_title" msgid="1860117696034775851">"Notificacions desactivades"</string> <string name="notifications_off_text" msgid="1439152806320786912">"Pica aquí per tornar a activar les notificacions."</string> </resources>
{ "pile_set_name": "Github" }
/** * box-sizing Polyfill * * A polyfill for box-sizing: border-box for IE6 & IE7. * * JScript * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * See <http://www.gnu.org/licenses/lgpl-3.0.txt> * * @category JScript * @package box-sizing-polyfill * @author Christian Schepp Schaefer <[email protected]> <http://twitter.com/derSchepp> * @copyright 2012 Christian Schepp Schaefer * @license http://www.gnu.org/copyleft/lesser.html The GNU LESSER GENERAL PUBLIC LICENSE, Version 3.0 * @link http://github.com/Schepp/box-sizing-polyfill * * PREFACE: * * This box-sizing polyfill is based on previous work done by Erik Arvidsson, * which he published in 2002 on http://webfx.eae.net/dhtml/boxsizing/boxsizing.html. * * USAGE: * * Add the behavior/HTC after every `box-sizing: border-box;` that you assign: * * box-sizing: border-box; * *behavior: url(/scripts/boxsizing.htc);` * * Prefix the `behavior` property with a star, like seen above, so it will only be seen by * IE6 & IE7, not by IE8+ who already implement box-sizing. * * The URL to the HTC file must be relative to your HTML(!) document, not relative to your CSS. * That's why I'd advise you to use absolute paths like in the example. * */ <component lightWeight="true"> <attach event="onpropertychange" onevent="checkPropertyChange()" /> <attach event="ondetach" onevent="restore()" /> <attach event="onresize" for="window" onevent="update()" /> <script type="text/javascript"> //<![CDATA[ var viewportwidth = (typeof window.innerWidth != 'undefined' ? window.innerWidth : element.document.documentElement.clientWidth); // Shortcut for the document object var doc = element.document; // Buffer for multiple resize events var resizetimeout = null; // Don't apply box-sizing to certain elements var apply = false; switch(element.nodeName){ case '#comment': case 'HTML': case 'HEAD': case 'TITLE': case 'SCRIPT': case 'STYLE': case 'LINK': case 'META': break; default: apply = true; break; } /* * update gets called during resize events, then waits until there are no further resize events, and finally triggers a recalculation */ function update(){ if(resizetimeout !== null){ window.clearTimeout(resizetimeout); } resizetimeout = window.setTimeout(function(){ restore(); init(); resizetimeout = null; },100); } /* * restore gets called when the behavior is being detached (see event binding at the top), * resets everything like it was before applying the behavior */ function restore(){ if(apply){ element.runtimeStyle.removeAttribute("width"); element.runtimeStyle.removeAttribute("height"); } } /* * init gets called once at the start and then never again, * triggers box-sizing calculations and updates width and height */ function init(){ if(apply){ updateBorderBoxWidth(); updateBorderBoxHeight(); } } /* * checkPropertyChange gets called as soon as an element property changes * (see event binding at the top), it then checks if any property influencing its * dimensions was changed and if yes recalculates width and height */ function checkPropertyChange(){ if(apply){ var pn = event.propertyName; if(pn === "style.boxSizing" && element.style.boxSizing === ""){ element.style.removeAttribute("boxSizing"); element.runtimeStyle.removeAttribute("boxSizing"); element.runtimeStyle.removeAttribute("width"); element.runtimeStyle.removeAttribute("height"); } switch (pn){ case "style.width": case "style.borderLeftWidth": case "style.borderLeftStyle": case "style.borderRightWidth": case "style.borderRightStyle": case "style.paddingLeft": case "style.paddingRight": updateBorderBoxWidth(); break; case "style.height": case "style.borderTopWidth": case "style.borderTopStyle": case "style.borderBottomWidth": case "style.borderBottomStyle": case "style.paddingTop": case "style.paddingBottom": updateBorderBoxHeight(); break; case "className": case "style.boxSizing": updateBorderBoxWidth(); updateBorderBoxHeight(); break; } } } /* * Helper function, taken from Dean Edward's IE7 framework, * added by Schepp on 12.06.2010. * http://code.google.com/p/ie7-js/ * * Allows us to convert from relative to pixel-values. */ function getPixelValue(value){ var PIXEL = /^\d+(px)?$/i; if (PIXEL.test(value)) return parseInt(value); var style = element.style.left; var runtimeStyle = element.runtimeStyle.left; element.runtimeStyle.left = element.currentStyle.left; element.style.left = value || 0; value = parseInt(element.style.pixelLeft); element.style.left = style; element.runtimeStyle.left = runtimeStyle; return value; } function getPixelWidth(object, value){ // For Pixel Values var PIXEL = /^\d+(px)?$/i; if (PIXEL.test(value)) return parseInt(value); // For Percentage Values var PERCENT = /^[\d\.]+%$/i; if (PERCENT.test(value)){ try{ parentWidth = getPixelWidth(object.parentElement,(object.parentElement.currentStyle.width != "auto" ? object.parentElement.currentStyle.width : "100%")); value = (parseFloat(value) / 100) * parentWidth; } catch(e){ value = (parseFloat(value) / 100) * element.document.documentElement.clientWidth; } return parseInt(value); } // For EM Values var style = object.style.left; var runtimeStyle = object.runtimeStyle.left; object.runtimeStyle.left = object.currentStyle.left; object.style.left = value || 0; value = parseInt(object.style.pixelLeft); object.style.left = style; object.runtimeStyle.left = runtimeStyle; return value; } function getPixelHeight(object, value){ // For Pixel Values var PIXEL = /^\d+(px)?$/i; if (PIXEL.test(value)) return parseInt(value); // For Percentage Values var PERCENT = /^[\d\.]+%$/i; if (PERCENT.test(value)){ try{ if(object.parentElement.currentStyle.height != "auto"){ switch(object.parentElement.nodeName){ default: parentHeight = getPixelHeight(object.parentElement,object.parentElement.currentStyle.height); if(parentHeight !== "auto"){ value = (parseFloat(value) / 100) * parentHeight; } else { value = "auto"; } break; case 'HTML': parentHeight = element.document.documentElement.clientHeight; if(parentHeight !== "auto"){ value = (parseFloat(value) / 100) * parentHeight; } else { value = "auto"; } break; } if(value !== "auto") value = parseInt(value); } else { value = "auto"; } } catch(e){ value = "auto"; } return value; } // For EM Values var style = object.style.left; var runtimeStyle = object.runtimeStyle.left; object.runtimeStyle.left = object.currentStyle.left; object.style.left = value || 0; value = parseInt(object.style.pixelLeft); object.style.left = style; object.runtimeStyle.left = runtimeStyle; return value; } /* * getBorderWidth & friends * Border width getters */ function getBorderWidth(sSide){ if(element.currentStyle["border" + sSide + "Style"] == "none"){ return 0; } var n = getPixelValue(element.currentStyle["border" + sSide + "Width"]); return n || 0; } function getBorderLeftWidth() { return getBorderWidth("Left"); } function getBorderRightWidth() { return getBorderWidth("Right"); } function getBorderTopWidth() { return getBorderWidth("Top"); } function getBorderBottomWidth() { return getBorderWidth("Bottom"); } /* * getPadding & friends * Padding width getters */ function getPadding(sSide) { var n = getPixelValue(element.currentStyle["padding" + sSide]); return n || 0; } function getPaddingLeft() { return getPadding("Left"); } function getPaddingRight() { return getPadding("Right"); } function getPaddingTop() { return getPadding("Top"); } function getPaddingBottom() { return getPadding("Bottom"); } /* * getBoxSizing * Get the box-sizing value for the current element */ function getBoxSizing(){ var s = element.style; var cs = element.currentStyle if(typeof s.boxSizing != "undefined" && s.boxSizing != ""){ return s.boxSizing; } if(typeof s["box-sizing"] != "undefined" && s["box-sizing"] != ""){ return s["box-sizing"]; } if(typeof cs.boxSizing != "undefined" && cs.boxSizing != ""){ return cs.boxSizing; } if(typeof cs["box-sizing"] != "undefined" && cs["box-sizing"] != ""){ return cs["box-sizing"]; } return getDocumentBoxSizing(); } /* * getDocumentBoxSizing * Get the default document box sizing (check for quirks mode) */ function getDocumentBoxSizing(){ if(doc.compatMode === null || doc.compatMode === "BackCompat"){ return "border-box"; } return "content-box" } /* * setBorderBoxWidth & friends * Width and height setters */ function setBorderBoxWidth(n){ element.runtimeStyle.width = Math.max(0, n - getBorderLeftWidth() - getPaddingLeft() - getPaddingRight() - getBorderRightWidth()) + "px"; } function setBorderBoxHeight(n){ element.runtimeStyle.height = Math.max(0, n - getBorderTopWidth() - getPaddingTop() - getPaddingBottom() - getBorderBottomWidth()) + "px"; } function setContentBoxWidth(n){ element.runtimeStyle.width = Math.max(0, n + getBorderLeftWidth() + getPaddingLeft() + getPaddingRight() + getBorderRightWidth()) + "px"; } function setContentBoxHeight(n){ element.runtimeStyle.height = Math.max(0, n + getBorderTopWidth() + getPaddingTop() + getPaddingBottom() + getBorderBottomWidth()) + "px"; } /* * updateBorderBoxWidth & updateBorderBoxHeight * */ function updateBorderBoxWidth() { if(getDocumentBoxSizing() == getBoxSizing()){ return; } var csw = element.currentStyle.width; if(csw != "auto"){ csw = getPixelWidth(element,csw); if(getBoxSizing() == "border-box"){ setBorderBoxWidth(parseInt(csw)); } else{ setContentBoxWidth(parseInt(csw)); } } } function updateBorderBoxHeight() { if(getDocumentBoxSizing() == getBoxSizing()){ return; } var csh = element.currentStyle.height; if(csh != "auto"){ csh = getPixelHeight(element,csh); if(csh !== "auto"){ if(getBoxSizing() == "border-box"){ setBorderBoxHeight(parseInt(csh)); } else{ setContentBoxHeight(parseInt(csh)); } } } } // Run the calculations init(); //]]> </script> </component>
{ "pile_set_name": "Github" }
========================================================================================================================== How to install InstallESD.dmg to GPT with 10.7.x and 10.8.x. (since rev. 480) ---------------------------------------------------------------- First, you need to Restore InstallESD.dmg to disk by using Disk Utility. Then, follow the stage 1 and stage 2 to install 10.7.x or 10.8.x to GPT, and auto-create the Recovery HD used for iCloud. Stage 1 --------- 1.Remove kernelcache in InstallESD.dmg/Library/Preferences/SystemConfiguration/com.apple.Boot.plist. <key>Kernel Cache</key> remove this line. <string>xxxxxxxxxxxxx</string> remove this line. 2.Copy BaseSystem.dmg/System/Library/Extensions to partition of InstallESD.dmg and add other kexts (FakeSMC.kext). 3.Clover select to "Boot Mac OS X with extra kexts (skips cache)", and follow the installation with restart first time. Stage 2 --------- 1.Remove kernelcache in target partition's /OS X Install Data/com.apple.Boot.plist. <key>Kernel Cache</key> remove this line. <string>xxxxxxxxxxxxx</string> remove this line. ( 10.7.x is /Mac OS X Install Data/com.apple.Boot.plist ) 2.Copy InstallESD.dmg/System/Library/CoreServices and /mach_kernel to target partition's / . 3.Copy BaseSystem.dmg/System/Library/Extensions to target partition's / and add other kexts (FakeSMC.kext). 4.Boot to "OS X Install" with "Boot Mac OS X with extra kexts (skips cache)" and finish the installation. (10.7.x is "Mac OS X Install") ==========================================================================================================================
{ "pile_set_name": "Github" }
import torch.nn as nn import torch.utils.model_zoo as model_zoo __all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101', 'resnet152'] model_urls = { 'resnet18': 'https://download.pytorch.org/models/resnet18-5c106cde.pth', 'resnet34': 'https://download.pytorch.org/models/resnet34-333f7ec4.pth', 'resnet50': 'https://download.pytorch.org/models/resnet50-19c8e357.pth', 'resnet101': 'https://download.pytorch.org/models/resnet101-5d3b4d8f.pth', 'resnet152': 'https://download.pytorch.org/models/resnet152-b121ed2d.pth', } def conv3x3(in_planes, out_planes, stride=1): """3x3 convolution with padding""" return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=1, bias=False) def conv1x1(in_planes, out_planes, stride=1): """1x1 convolution""" return nn.Conv2d(in_planes, out_planes, kernel_size=1, stride=stride, bias=False) class BasicBlock(nn.Module): expansion = 1 def __init__(self, inplanes, planes, stride=1, downsample=None): super(BasicBlock, self).__init__() self.conv1 = conv3x3(inplanes, planes, stride) self.bn1 = nn.BatchNorm2d(planes) self.relu = nn.ReLU(inplace=True) self.conv2 = conv3x3(planes, planes) self.bn2 = nn.BatchNorm2d(planes) self.downsample = downsample self.stride = stride def forward(self, x): identity = x out = self.conv1(x) out = self.bn1(out) out = self.relu(out) out = self.conv2(out) out = self.bn2(out) if self.downsample is not None: identity = self.downsample(x) out += identity out = self.relu(out) return out class Bottleneck(nn.Module): expansion = 4 def __init__(self, inplanes, planes, stride=1, downsample=None): super(Bottleneck, self).__init__() self.conv1 = conv1x1(inplanes, planes) self.bn1 = nn.BatchNorm2d(planes) self.conv2 = conv3x3(planes, planes, stride) self.bn2 = nn.BatchNorm2d(planes) self.conv3 = conv1x1(planes, planes * self.expansion) self.bn3 = nn.BatchNorm2d(planes * self.expansion) self.relu = nn.ReLU(inplace=True) self.downsample = downsample self.stride = stride def forward(self, x): identity = x out = self.conv1(x) out = self.bn1(out) out = self.relu(out) out = self.conv2(out) out = self.bn2(out) out = self.relu(out) out = self.conv3(out) out = self.bn3(out) if self.downsample is not None: identity = self.downsample(x) out += identity out = self.relu(out) return out class ResNet(nn.Module): def __init__(self, block, layers, num_classes=1000, zero_init_residual=False): super(ResNet, self).__init__() self.inplanes = 64 self.conv1 = nn.Conv2d(3, 64, kernel_size=7, stride=2, padding=3, bias=False) self.bn1 = nn.BatchNorm2d(64) self.relu = nn.ReLU(inplace=True) self.maxpool = nn.MaxPool2d(kernel_size=3, stride=2, padding=1) self.layer1 = self._make_layer(block, 64, layers[0]) self.layer2 = self._make_layer(block, 128, layers[1], stride=2) self.layer3 = self._make_layer(block, 256, layers[2], stride=2) self.layer4 = self._make_layer(block, 512, layers[3], stride=2) self.avgpool = nn.AdaptiveAvgPool2d((1, 1)) self.fc = nn.Linear(512 * block.expansion, num_classes) for m in self.modules(): if isinstance(m, nn.Conv2d): nn.init.kaiming_normal_(m.weight, mode='fan_out', nonlinearity='relu') elif isinstance(m, nn.BatchNorm2d): nn.init.constant_(m.weight, 1) nn.init.constant_(m.bias, 0) # Zero-initialize the last BN in each residual branch, # so that the residual branch starts with zeros, and each residual block behaves like an identity. # This improves the model by 0.2~0.3% according to https://arxiv.org/abs/1706.02677 if zero_init_residual: for m in self.modules(): if isinstance(m, Bottleneck): nn.init.constant_(m.bn3.weight, 0) elif isinstance(m, BasicBlock): nn.init.constant_(m.bn2.weight, 0) def _make_layer(self, block, planes, blocks, stride=1): downsample = None if stride != 1 or self.inplanes != planes * block.expansion: downsample = nn.Sequential( conv1x1(self.inplanes, planes * block.expansion, stride), nn.BatchNorm2d(planes * block.expansion), ) layers = [] layers.append(block(self.inplanes, planes, stride, downsample)) self.inplanes = planes * block.expansion for _ in range(1, blocks): layers.append(block(self.inplanes, planes)) return nn.Sequential(*layers) def forward(self, x): x = self.conv1(x) x = self.bn1(x) x = self.relu(x) x = self.maxpool(x) x = self.layer1(x) x = self.layer2(x) x = self.layer3(x) x = self.layer4(x) x = self.avgpool(x) x = x.view(x.size(0), -1) x = self.fc(x) return x def resnet18(pretrained=False, **kwargs): """Constructs a ResNet-18 model. Args: pretrained (bool): If True, returns a model pre-trained on ImageNet """ model = ResNet(BasicBlock, [2, 2, 2, 2], **kwargs) if pretrained: model.load_state_dict(model_zoo.load_url(model_urls['resnet18'])) return model def resnet34(pretrained=False, **kwargs): """Constructs a ResNet-34 model. Args: pretrained (bool): If True, returns a model pre-trained on ImageNet """ model = ResNet(BasicBlock, [3, 4, 6, 3], **kwargs) if pretrained: model.load_state_dict(model_zoo.load_url(model_urls['resnet34'])) return model def resnet50(pretrained=False, **kwargs): """Constructs a ResNet-50 model. Args: pretrained (bool): If True, returns a model pre-trained on ImageNet """ model = ResNet(Bottleneck, [3, 4, 6, 3], **kwargs) if pretrained: model.load_state_dict(model_zoo.load_url(model_urls['resnet50'])) return model def resnet101(pretrained=False, **kwargs): """Constructs a ResNet-101 model. Args: pretrained (bool): If True, returns a model pre-trained on ImageNet """ model = ResNet(Bottleneck, [3, 4, 23, 3], **kwargs) if pretrained: model.load_state_dict(model_zoo.load_url(model_urls['resnet101'])) return model def resnet152(pretrained=False, **kwargs): """Constructs a ResNet-152 model. Args: pretrained (bool): If True, returns a model pre-trained on ImageNet """ model = ResNet(Bottleneck, [3, 8, 36, 3], **kwargs) if pretrained: model.load_state_dict(model_zoo.load_url(model_urls['resnet152'])) return model
{ "pile_set_name": "Github" }
{ "images" : [ { "idiom" : "universal", "filename" : "checkerboard.jpg", "scale" : "1x" }, { "idiom" : "universal", "scale" : "2x" }, { "idiom" : "universal", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } }
{ "pile_set_name": "Github" }
""" TextLayer ======== Names of various public transit stops within San Francisco, plotted at the location of that stop """ import pydeck as pdk import pandas as pd TEXT_LAYER_DATA = "https://raw.githubusercontent.com/visgl/deck.gl-data/master/website/bart-stations.json" # noqa df = pd.read_json(TEXT_LAYER_DATA) # Define a layer to display on a map layer = pdk.Layer( "TextLayer", df, pickable=True, get_position="coordinates", get_text="name", get_size=16, get_color=[255, 255, 255], get_angle=0, # Note that string constants in pydeck are explicitly passed as strings # This distinguishes them from columns in a data set get_text_anchor="'middle'", get_alignment_baseline="'center'", ) # Set the viewport location view_state = pdk.ViewState(latitude=37.7749295, longitude=-122.4194155, zoom=10, bearing=0, pitch=45) # Render r = pdk.Deck( layers=[layer], initial_view_state=view_state, tooltip={"text": "{name}\n{address}"}, map_style=pdk.map_styles.SATELLITE, ) r.to_html("text_layer.html", notebook_display=False)
{ "pile_set_name": "Github" }
/** * author Christopher Blum * - based on the idea of Remy Sharp, http://remysharp.com/2009/01/26/element-in-view-event-plugin/ * - forked from http://github.com/zuk/jquery.inview/ */ (function (factory) { if (typeof define == 'function' && define.amd) { // AMD define(['jquery'], factory); } else if (typeof exports === 'object') { // Node, CommonJS module.exports = factory(require('jquery')); } else { // Browser globals factory(jQuery); } }(function ($) { var inviewObjects = {}, viewportSize, viewportOffset, d = document, w = window, documentElement = d.documentElement, expando = $.expando, timer; $.event.special.inview = { add: function(data) { inviewObjects[data.guid + "-" + this[expando]] = { data: data, $element: $(this) }; // Use setInterval in order to also make sure this captures elements within // "overflow:scroll" elements or elements that appeared in the dom tree due to // dom manipulation and reflow // old: $(window).scroll(checkInView); // // By the way, iOS (iPad, iPhone, ...) seems to not execute, or at least delays // intervals while the user scrolls. Therefore the inview event might fire a bit late there // // Don't waste cycles with an interval until we get at least one element that // has bound to the inview event. if (!timer && !$.isEmptyObject(inviewObjects)) { timer = setInterval(checkInView, 250); } }, remove: function(data) { try { delete inviewObjects[data.guid + "-" + this[expando]]; } catch(e) {} // Clear interval when we no longer have any elements listening if ($.isEmptyObject(inviewObjects)) { clearInterval(timer); timer = null; } } }; function getViewportSize() { var mode, domObject, size = { height: w.innerHeight, width: w.innerWidth }; // if this is correct then return it. iPad has compat Mode, so will // go into check clientHeight/clientWidth (which has the wrong value). if (!size.height) { mode = d.compatMode; if (mode || !$.support.boxModel) { // IE, Gecko domObject = mode === 'CSS1Compat' ? documentElement : // Standards d.body; // Quirks size = { height: domObject.clientHeight, width: domObject.clientWidth }; } } return size; } function getViewportOffset() { return { top: w.pageYOffset || documentElement.scrollTop || d.body.scrollTop, left: w.pageXOffset || documentElement.scrollLeft || d.body.scrollLeft }; } function checkInView() { var $elements = [], elementsLength, i = 0; $.each(inviewObjects, function(i, inviewObject) { var selector = inviewObject.data.selector, $element = inviewObject.$element; $elements.push(selector ? $element.find(selector) : $element); }); elementsLength = $elements.length; if (elementsLength) { viewportSize = viewportSize || getViewportSize(); viewportOffset = viewportOffset || getViewportOffset(); for (; i<elementsLength; i++) { // Ignore elements that are not in the DOM tree if (!$.contains(documentElement, $elements[i][0])) { continue; } var $element = $($elements[i]), elementSize = { height: $element.height(), width: $element.width() }, elementOffset = $element.offset(), inView = $element.data('inview'), visiblePartX, visiblePartY, visiblePartsMerged; // Don't ask me why because I haven't figured out yet: // viewportOffset and viewportSize are sometimes suddenly null in Firefox 5. // Even though it sounds weird: // It seems that the execution of this function is interferred by the onresize/onscroll event // where viewportOffset and viewportSize are unset if (!viewportOffset || !viewportSize) { return; } if (elementOffset.top + elementSize.height > viewportOffset.top && elementOffset.top < viewportOffset.top + viewportSize.height && elementOffset.left + elementSize.width > viewportOffset.left && elementOffset.left < viewportOffset.left + viewportSize.width) { visiblePartX = (viewportOffset.left > elementOffset.left ? 'right' : (viewportOffset.left + viewportSize.width) < (elementOffset.left + elementSize.width) ? 'left' : 'both'); visiblePartY = (viewportOffset.top > elementOffset.top ? 'bottom' : (viewportOffset.top + viewportSize.height) < (elementOffset.top + elementSize.height) ? 'top' : 'both'); visiblePartsMerged = visiblePartX + "-" + visiblePartY; if (!inView || inView !== visiblePartsMerged) { $element.data('inview', visiblePartsMerged).trigger('inview', [true, visiblePartX, visiblePartY]); } } else if (inView) { $element.data('inview', false).trigger('inview', [false]); } } } } $(w).bind("scroll resize scrollstop", function() { viewportSize = viewportOffset = null; }); // IE < 9 scrolls to focused elements without firing the "scroll" event if (!documentElement.addEventListener && documentElement.attachEvent) { documentElement.attachEvent("onfocusin", function() { viewportOffset = null; }); } }));
{ "pile_set_name": "Github" }
--- id: version-7.x-accessing-store title: Accessing the Store hide_title: true sidebar_label: Accessing the Store original_id: accessing-store --- # Accessing the Store React Redux provides APIs that allow your components to dispatch actions and subscribe to data updates from the store. As part of that, React Redux abstracts away the details of which store you are using, and the exact details of how that store interaction is handled. In typical usage, your own components should never need to care about those details, and won't ever reference the store directly. React Redux also internally handles the details of how the store and state are propagated to connected components, so that this works as expected by default. However, there may be certain use cases where you may need to customize how the store and state are propagated to connected components, or access the store directly. Here are some examples of how to do this. ## Understanding Context Usage Internally, React Redux uses [React's "context" feature](https://reactjs.org/docs/context.html) to make the Redux store accessible to deeply nested connected components. As of React Redux version 6, this is normally handled by a single default context object instance generated by `React.createContext()`, called `ReactReduxContext`. React Redux's `<Provider>` component uses `<ReactReduxContext.Provider>` to put the Redux store and the current store state into context, and `connect` uses `<ReactReduxContext.Consumer>` to read those values and handle updates. ## Providing Custom Context Instead of using the default context instance from React Redux, you may supply your own custom context instance. ```js <Provider context={MyContext} store={store}> <App /> </Provider> ``` If you supply a custom context, React Redux will use that context instance instead of the one it creates and exports by default. After you’ve supplied the custom context to `<Provider />`, you will need to supply this context instance to all of your connected components that are expected to connect to the same store: ```js // You can pass the context as an option to connect export default connect( mapState, mapDispatch, null, { context: MyContext } )(MyComponent) // or, call connect as normal to start const ConnectedComponent = connect( mapState, mapDispatch )(MyComponent) // Later, pass the custom context as a prop to the connected component ;<ConnectedComponent context={MyContext} /> ``` The following runtime error occurs when React Redux does not find a store in the context it is looking. For example: - You provided a custom context instance to `<Provider />`, but did not provide the same instance (or did not provide any) to your connected components. - You provided a custom context to your connected component, but did not provide the same instance (or did not provide any) to `<Provider />`. > Invariant Violation > > Could not find "store" in the context of "Connect(MyComponent)". Either wrap the root component in a `<Provider>`, or pass a custom React context provider to `<Provider>` and the corresponding React context consumer to Connect(Todo) in connect options. ## Multiple Stores [Redux was designed to use a single store](https://redux.js.org/api/store#a-note-for-flux-users). However, if you are in an unavoidable position of needing to use multiple stores, with v6 you may do so by providing (multiple) custom contexts. This also provides a natural isolation of the stores as they live in separate context instances. ```js // a naive example const ContextA = React.createContext(); const ContextB = React.createContext(); // assuming reducerA and reducerB are proper reducer functions const storeA = createStore(reducerA); const storeB = createStore(reducerB); // supply the context instances to Provider function App() { return ( <Provider store={storeA} context={ContextA} /> <Provider store={storeB} context={ContextB}> <RootModule /> </Provider> </Provider> ); } // fetch the corresponding store with connected components // you need to use the correct context connect(mapStateA, null, null, { context: ContextA })(MyComponentA) // You may also pass the alternate context instance directly to the connected component instead <ConnectedMyComponentA context={ContextA} /> // it is possible to chain connect() // in this case MyComponent will receive merged props from both stores compose( connect(mapStateA, null, null, { context: ContextA }), connect(mapStateB, null, null, { context: ContextB }) )(MyComponent); ``` ## Using `ReactReduxContext` Directly In rare cases, you may need to access the Redux store directly in your own components. This can be done by rendering the appropriate context consumer yourself, and accessing the `store` field out of the context value. > **Note**: This is **_not_ considered part of the React Redux public API, and may break without notice**. We do recognize > that the community has use cases where this is necessary, and will try to make it possible for users to build additional > functionality on top of React Redux, but our specific use of context is considered an implementation detail. > If you have additional use cases that are not sufficiently covered by the current APIs, please file an issue to discuss > possible API improvements. ```js import { ReactReduxContext } from 'react-redux' // in your connected component function MyConnectedComponent() { return ( <ReactReduxContext.Consumer> {({ store }) => { // do something useful with the store, like passing it to a child // component where it can be used in lifecycle methods }} </ReactReduxContext.Consumer> ) } ``` ## Further Resources - CodeSandbox example: [A reading list app with theme using a separate store](https://codesandbox.io/s/92pm9n2kl4), implemented by providing (multiple) custom context(s). - Related issues: - [#1132: Update docs for using a different store key](https://github.com/reduxjs/react-redux/issues/1132) - [#1126: `<Provider>` misses state changes that occur between when its constructor runs and when it mounts](https://github.com/reduxjs/react-redux/issues/1126)
{ "pile_set_name": "Github" }
{ "name": "webauthn-tutorial", "version": "0.0.1", "description": "", "main": "app.js", "dependencies": { "@fidm/x509": "^1.2.0", "base64url": "^2.0.0", "body-parser": "^1.15.2", "cbor": "^3.0.3", "cookie-parser": "^1.4.3", "cookie-session": "^2.0.0-beta.3", "express": "^4.15.4", "iso-3166-1": "^1.1.0" }, "repository": { "type": "git", "url": "git+https://github.com/fido-alliance/" }, "private": true, "author": "Yuriy Ackermann <[email protected]> (https://jeman.de/)", "bugs": { "url": "https://github.com/fido-alliance//issues", "email": "[email protected]" }, "homepage": "https://github.com/fido-alliance/#readme" }
{ "pile_set_name": "Github" }
# Copyright 2019 LinkedIn Corp. Licensed under the BSD 2-Clause License (the "License"). # See License in the project root for license information. import setuptools LONG_DESCRIPTION ='''`cruise-control-client` is an API-complete Python client for [`cruise-control`](https://github.com/linkedin/cruise-control). It comes with a command-line interface to the client (`cccli`) (see [README](https://github.com/linkedin/cruise-control/tree/master/docs/wiki/Python%20Client)). `cruise-control-client` can also be used in Python applications needing programmatic access to `cruise-control`.''' setuptools.setup( name='cruise-control-client', version='1.1.0', author='mgrubent', author_email='[email protected]', description='A Python client for cruise-control', long_description=LONG_DESCRIPTION, long_description_content_type='text/markdown', url='https://github.com/linkedin/cruise-control', entry_points={ 'console_scripts': [ 'cccli = cruisecontrolclient.client.cccli:main' ] }, packages=setuptools.find_packages(), install_requires=[ 'requests' ], license='Copyright 2019 LinkedIn Corp. Licensed under the BSD 2-Clause License (the "License").' ' See License in the project root for license information.', )
{ "pile_set_name": "Github" }
github.com/dependabot/gomodules-extracted v0.0.0-20181020215834-1b2f850478a3 h1:Xj2leY0FVyZuo+p59vkIWG3dIqo+QtjskT5O1iTiywA= github.com/dependabot/gomodules-extracted v0.0.0-20181020215834-1b2f850478a3/go.mod h1:+dRXSrUymjpT4yzKtn1QmeknT1S/yAHRr35en18dHp8=
{ "pile_set_name": "Github" }
# # Copyright (C) 2015 Alon Bar-Lev <[email protected]> # SPDX-License-Identifier: GPL-3.0-or-later # AC_PREREQ(2.60) # We do not use m4_esyscmd_s to support older autoconf. define([VERSION_STRING], m4_esyscmd([git describe 2>/dev/null | tr -d '\n'])) define([VERSION_FROM_FILE], m4_esyscmd([cat packaging/version | tr -d '\n'])) m4_ifval(VERSION_STRING, [], [define([VERSION_STRING], VERSION_FROM_FILE)]) AC_INIT([netdata], VERSION_STRING[]) AM_MAINTAINER_MODE([disable]) if test x"$USE_MAINTAINER_MODE" = xyes; then AC_MSG_NOTICE(***************** MAINTAINER MODE *****************) fi PACKAGE_RPM_VERSION="VERSION_STRING" AC_SUBST([PACKAGE_RPM_VERSION]) # ----------------------------------------------------------------------------- # autoconf initialization AC_CONFIG_AUX_DIR([.]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([build/m4]) AC_CONFIG_SRCDIR([daemon/main.c]) define([AUTOMATE_INIT_OPTIONS], [tar-pax subdir-objects]) m4_ifdef([AM_SILENT_RULES], [ define([AUTOMATE_INIT_OPTIONS], [tar-pax silent-rules subdir-objects]) ]) AM_INIT_AUTOMAKE(AUTOMATE_INIT_OPTIONS) m4_ifdef([AM_SILENT_RULES], [ AM_SILENT_RULES([yes]) ]) AC_CANONICAL_HOST AC_PROG_CC AC_PROG_CC_C99 AM_PROG_CC_C_O AC_PROG_CXX AC_PROG_INSTALL PKG_PROG_PKG_CONFIG AC_USE_SYSTEM_EXTENSIONS # ----------------------------------------------------------------------------- # configurable options AC_ARG_ENABLE( [plugin-nfacct], [AS_HELP_STRING([--enable-plugin-nfacct], [enable nfacct plugin @<:@default autodetect@:>@])], , [enable_plugin_nfacct="detect"] ) AC_ARG_ENABLE( [plugin-freeipmi], [AS_HELP_STRING([--enable-plugin-freeipmi], [enable freeipmi plugin @<:@default autodetect@:>@])], , [enable_plugin_freeipmi="detect"] ) AC_ARG_ENABLE( [plugin-cups], [AS_HELP_STRING([--enable-plugin-cups], [enable cups plugin @<:@default autodetect@:>@])], , [enable_plugin_cups="detect"] ) AC_ARG_ENABLE( [plugin-xenstat], [AS_HELP_STRING([--enable-plugin-xenstat], [enable xenstat plugin @<:@default autodetect@:>@])], , [enable_plugin_xenstat="detect"] ) AC_ARG_ENABLE( [backend-kinesis], [AS_HELP_STRING([--enable-backend-kinesis], [enable kinesis backend @<:@default autodetect@:>@])], , [enable_backend_kinesis="detect"] ) AC_ARG_ENABLE( [exporting-pubsub], [AS_HELP_STRING([--enable-exporting-pubsub], [enable pubsub exporting connector @<:@default autodetect@:>@])], , [enable_exporting_pubsub="detect"] ) AC_ARG_ENABLE( [backend-prometheus-remote-write], [AS_HELP_STRING([--enable-backend-prometheus-remote-write], [enable prometheus remote write backend @<:@default autodetect@:>@])], , [enable_backend_prometheus_remote_write="detect"] ) AC_ARG_ENABLE( [backend-mongodb], [AS_HELP_STRING([--enable-backend-mongodb], [enable mongodb backend @<:@default autodetect@:>@])], , [enable_backend_mongodb="detect"] ) AC_ARG_ENABLE( [pedantic], [AS_HELP_STRING([--enable-pedantic], [enable pedantic compiler warnings @<:@default disabled@:>@])], , [enable_pedantic="no"] ) AC_ARG_ENABLE( [accept4], [AS_HELP_STRING([--disable-accept4], [System does not have accept4 @<:@default autodetect@:>@])], , [enable_accept4="detect"] ) AC_ARG_WITH( [webdir], [AS_HELP_STRING([--with-webdir], [location of webdir @<:@PKGDATADIR/web@:>@])], [webdir="${withval}"], [webdir="\$(pkgdatadir)/web"] ) AC_ARG_WITH( [libcap], [AS_HELP_STRING([--with-libcap], [build with libcap @<:@default autodetect@:>@])], , [with_libcap="detect"] ) AC_ARG_WITH( [zlib], [AS_HELP_STRING([--without-zlib], [build without zlib @<:@default enabled@:>@])], , [with_zlib="yes"] ) AC_ARG_WITH( [math], [AS_HELP_STRING([--without-math], [build without math @<:@default enabled@:>@])], , [with_math="yes"] ) AC_ARG_WITH( [user], [AS_HELP_STRING([--with-user], [use this user to drop privilege @<:@default nobody@:>@])], , [with_user="nobody"] ) AC_ARG_ENABLE( [x86-sse], [AS_HELP_STRING([--disable-x86-sse], [SSE/SS2 optimizations on x86 @<:@default enabled@:>@])], , [enable_x86_sse="yes"] ) AC_ARG_ENABLE( [lto], [AS_HELP_STRING([--disable-lto], [Link Time Optimizations @<:@default autodetect@:>@])], , [enable_lto="detect"] ) AC_ARG_ENABLE( [https], [AS_HELP_STRING([--enable-https], [Enable SSL support @<:@default autodetect@:>@])], , [enable_https="detect"] ) AC_ARG_ENABLE( [dbengine], [AS_HELP_STRING([--disable-dbengine], [disable netdata dbengine @<:@default autodetect@:>@])], , [enable_dbengine="detect"] ) AC_ARG_ENABLE( [jsonc], [AS_HELP_STRING([--enable-jsonc], [Enable JSON-C support @<:@default autodetect@:>@])], , [enable_jsonc="detect"] ) AC_ARG_ENABLE( [ebpf], [AS_HELP_STRING([--disable-ebpf], [Disable eBPF support @<:@default autodetect@:>@])], , [enable_ebpf="detect"] ) # ----------------------------------------------------------------------------- # Enforce building with C99, bail early if we can't. test "${ac_cv_prog_cc_c99}" = "no" && AC_MSG_ERROR([Netdata rquires a compiler that supports C99 to build]) # ----------------------------------------------------------------------------- # Check if cloud is enabled and if the functionality is available AC_ARG_ENABLE( [cloud], [AS_HELP_STRING([--disable-cloud], [Disables all cloud functionality])], [ enable_cloud="$enableval" ], [ enable_cloud="detect" ] ) if test "${enable_cloud}" = "no"; then AC_DEFINE([DISABLE_CLOUD], [1], [disable netdata cloud functionality]) fi # ----------------------------------------------------------------------------- # netdata required checks # fails on centos6 #AX_CHECK_ENABLE_DEBUG() AX_GCC_FUNC_ATTRIBUTE([returns_nonnull]) AX_GCC_FUNC_ATTRIBUTE([malloc]) AX_GCC_FUNC_ATTRIBUTE([noreturn]) AX_GCC_FUNC_ATTRIBUTE([noinline]) AX_GCC_FUNC_ATTRIBUTE([format]) AX_GCC_FUNC_ATTRIBUTE([warn_unused_result]) AC_CHECK_TYPES([struct timespec, clockid_t], [], [], [[#include <time.h>]]) AC_SEARCH_LIBS([clock_gettime], [rt posix4]) AC_CHECK_FUNCS([clock_gettime]) AC_CHECK_FUNCS([sched_setscheduler sched_getscheduler sched_getparam sched_get_priority_min sched_get_priority_max getpriority setpriority nice]) AC_CHECK_FUNCS([recvmmsg]) AC_TYPE_INT8_T AC_TYPE_INT16_T AC_TYPE_INT32_T AC_TYPE_INT64_T AC_TYPE_UINT8_T AC_TYPE_UINT16_T AC_TYPE_UINT32_T AC_TYPE_UINT64_T AC_C_INLINE AC_FUNC_STRERROR_R AC_C__GENERIC AC_C___ATOMIC # AC_C_STMT_EXPR AC_CHECK_SIZEOF([void *]) AC_CANONICAL_HOST AC_HEADER_MAJOR AC_HEADER_RESOLV AC_CHECK_HEADERS_ONCE([sys/prctl.h]) AC_CHECK_HEADERS_ONCE([sys/vfs.h]) AC_CHECK_HEADERS_ONCE([sys/statfs.h]) AC_CHECK_HEADERS_ONCE([sys/statvfs.h]) AC_CHECK_HEADERS_ONCE([sys/mount.h]) if test "${enable_accept4}" != "no"; then AC_CHECK_FUNCS_ONCE(accept4) fi # ----------------------------------------------------------------------------- # operating system detection AC_MSG_CHECKING([operating system]) case "$host_os" in freebsd*) build_target=freebsd build_target_id=2 CFLAGS="${CFLAGS} -I/usr/local/include -L/usr/local/lib" ;; darwin*) build_target=macos build_target_id=3 LDFLAGS="${LDFLAGS} -framework CoreFoundation -framework IOKit" ;; *) build_target=linux build_target_id=1 ;; esac AM_CONDITIONAL([FREEBSD], [test "${build_target}" = "freebsd"]) AM_CONDITIONAL([MACOS], [test "${build_target}" = "macos"]) AM_CONDITIONAL([LINUX], [test "${build_target}" = "linux"]) AC_MSG_RESULT([${build_target} with id ${build_target_id}]) # ----------------------------------------------------------------------------- # pthreads ACX_PTHREAD(, [AC_MSG_ERROR([Cannot initialize pthread environment])]) LIBS="${PTHREAD_LIBS} ${LIBS}" CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}" CC="${PTHREAD_CC}" AC_CHECK_LIB( [pthread], [pthread_getname_np], [AC_DEFINE([HAVE_PTHREAD_GETNAME_NP], [1], [Is set if pthread_getname_np is available])] ) # ----------------------------------------------------------------------------- # libm AC_ARG_VAR([MATH_CFLAGS], [C compiler flags for math]) AC_ARG_VAR([MATH_LIBS], [linker flags for math]) if test -z "${MATH_LIBS}"; then AC_CHECK_LIB( [m], [sin], [MATH_LIBS="-lm"] ) fi test "${with_math}" = "yes" -a -z "${MATH_LIBS}" && AC_MSG_ERROR([math required but not found]) AC_MSG_CHECKING([if libm should be used]) if test "${with_math}" != "no" -a ! -z "${MATH_LIBS}"; then with_math="yes" AC_DEFINE([STORAGE_WITH_MATH], [1], [math usability]) OPTIONAL_MATH_CFLAGS="${MATH_CFLAGS}" OPTIONAL_MATH_LIBS="${MATH_LIBS}" else with_math="no" fi AC_MSG_RESULT([${with_math}]) # ----------------------------------------------------------------------------- # libuv multi-platform support library with a focus on asynchronous I/O # TODO: check version, uv_fs_scandir_next only available in version >= 1.0 AC_CHECK_LIB( [uv], [uv_fs_scandir_next], [UV_LIBS="-luv"] ) test -z "${UV_LIBS}" && \ AC_MSG_ERROR([libuv required but not found. Try installing 'libuv1-dev' or 'libuv-devel'.]) OPTIONAL_UV_CFLAGS="${UV_CFLAGS}" OPTIONAL_UV_LIBS="${UV_LIBS}" # ----------------------------------------------------------------------------- # lz4 Extremely Fast Compression algorithm AC_CHECK_LIB( [lz4], [LZ4_compress_default], [LZ4_LIBS="-llz4"] ) # ----------------------------------------------------------------------------- # zlib PKG_CHECK_MODULES( [ZLIB], [zlib], [have_zlib=yes], [have_zlib=no] ) test "${with_zlib}" = "yes" -a "${have_zlib}" != "yes" && AC_MSG_ERROR([zlib required but not found. Try installing 'zlib1g-dev' or 'zlib-devel'.]) AC_MSG_CHECKING([if zlib should be used]) if test "${with_zlib}" != "no" -a "${have_zlib}" = "yes"; then with_zlib="yes" AC_DEFINE([NETDATA_WITH_ZLIB], [1], [zlib usability]) OPTIONAL_ZLIB_CFLAGS="${ZLIB_CFLAGS}" OPTIONAL_ZLIB_LIBS="${ZLIB_LIBS}" else with_zlib="no" fi AC_MSG_RESULT([${with_zlib}]) # ----------------------------------------------------------------------------- # libuuid PKG_CHECK_MODULES( [UUID], [uuid], [have_uuid=yes], [AC_MSG_ERROR([libuuid required but not found. Try installing 'uuid-dev' or 'libuuid-devel'.])] ) AC_DEFINE([NETDATA_WITH_UUID], [1], [uuid usability]) OPTIONAL_UUID_CFLAGS="${UUID_CFLAGS}" OPTIONAL_UUID_LIBS="${UUID_LIBS}" # ----------------------------------------------------------------------------- # OpenSSL Cryptography and SSL/TLS Toolkit AC_CHECK_LIB( [crypto], [SHA256_Init], [SSL_LIBS="-lcrypto -lssl"] ) AC_CHECK_LIB( [crypto], [X509_VERIFY_PARAM_set1_host], [ssl_host_validation="yes"], [ssl_host_validation="no"] ) test -z "${SSL_LIBS}" || \ AC_DEFINE([HAVE_CRYPTO], [1], [libcrypto availability]) if test "${ssl_host_validation}" = "no"; then AC_DEFINE([HAVE_X509_VERIFY_PARAM_set1_host], [0], [ssl host validation]) AC_MSG_WARN([DISABLING SSL HOSTNAME VALIDATION BECAUSE IT IS NOT AVAILABLE ON THIS SYSTEM.]) else AC_DEFINE([HAVE_X509_VERIFY_PARAM_set1_host], [1], [ssl host validation]) fi # ----------------------------------------------------------------------------- # JSON-C library PKG_CHECK_MODULES([JSON],[json-c],AC_CHECK_LIB( [json-c], [json_object_get_type], [JSONC_LIBS="-ljson-c"]),AC_CHECK_LIB( [json], [json_object_get_type], [JSONC_LIBS="-ljson"]) ) OPTIONAL_JSONC_LIBS="${JSONC_LIBS}" # ----------------------------------------------------------------------------- # DB engine and HTTPS test "${enable_dbengine}" = "yes" -a -z "${LZ4_LIBS}" && \ AC_MSG_ERROR([liblz4 required but not found. Try installing 'liblz4-dev' or 'lz4-devel'.]) AC_ARG_WITH([libJudy], [AS_HELP_STRING([--with-libJudy=PREFIX],[Use a specific Judy library (default is system-library)])], [ libJudy_dir="$withval" AC_MSG_CHECKING(for libJudy in $withval) if test -f "${libJudy_dir}/libJudy.a" -a -f "${libJudy_dir}/Judy.h"; then LIBS_BACKUP="${LIBS}" LIBS="${libJudy_dir}/libJudy.a" AC_LINK_IFELSE([AC_LANG_SOURCE([[#include "${libJudy_dir}/Judy.h" int main (int argc, char **argv) { Pvoid_t PJLArray = (Pvoid_t) NULL; Word_t * PValue; Word_t Index; JLI(PValue, PJLArray, Index); }]])], [HAVE_libJudy_a="yes"], [HAVE_libJudy_a="no"]) LIBS="${LIBS_BACKUP}" JUDY_LIBS="${libJudy_dir}/libJudy.a" JUDY_CFLAGS="-I${libJudy_dir}" AC_MSG_RESULT([$HAVE_libJudy_a]) else libjudy_dir="" HAVE_libJudy_a="no" AC_MSG_RESULT([$HAVE_libJudy_a]) fi ], [HAVE_libJudy_a="no"]) if test "${HAVE_libJudy_a}" = "no"; then AC_CHECK_LIB( [Judy], [JudyLIns], [JUDY_LIBS="-lJudy"] ) fi test "${enable_dbengine}" = "yes" -a -z "${JUDY_LIBS}" && \ AC_MSG_ERROR([libJudy required but not found. Try installing 'libjudy-dev' or 'Judy-devel'.]) test "${enable_https}" = "yes" -a -z "${SSL_LIBS}" && \ AC_MSG_ERROR([OpenSSL required for HTTPS but not found. Try installing 'libssl-dev' or 'openssl-devel'.]) test "${enable_dbengine}" = "yes" -a -z "${SSL_LIBS}" && \ AC_MSG_ERROR([OpenSSL required for DBENGINE but not found. Try installing 'libssl-dev' or 'openssl-devel'.]) AC_MSG_CHECKING([if netdata dbengine should be used]) if test "${enable_dbengine}" != "no" -a "${UV_LIBS}" -a "${LZ4_LIBS}" -a "${JUDY_LIBS}" -a "${SSL_LIBS}"; then enable_dbengine="yes" AC_DEFINE([ENABLE_DBENGINE], [1], [netdata dbengine usability]) OPTIONAL_LZ4_CFLAGS="${LZ4_CFLAGS}" OPTIONAL_LZ4_LIBS="${LZ4_LIBS}" OPTIONAL_JUDY_CFLAGS="${JUDY_CFLAGS}" OPTIONAL_JUDY_LIBS="${JUDY_LIBS}" OPTIONAL_SSL_CFLAGS="${SSL_CFLAGS}" OPTIONAL_SSL_LIBS="${SSL_LIBS}" else enable_dbengine="no" fi AC_MSG_RESULT([${enable_dbengine}]) AM_CONDITIONAL([ENABLE_DBENGINE], [test "${enable_dbengine}" = "yes"]) AC_MSG_CHECKING([if netdata https should be used]) if test "${enable_https}" != "no" -a "${SSL_LIBS}"; then enable_https="yes" AC_DEFINE([ENABLE_HTTPS], [1], [netdata HTTPS usability]) OPTIONAL_SSL_CFLAGS="${SSL_CFLAGS}" OPTIONAL_SSL_LIBS="${SSL_LIBS}" else enable_https="no" fi AC_MSG_RESULT([${enable_https}]) AM_CONDITIONAL([ENABLE_HTTPS], [test "${enable_https}" = "yes"]) # ----------------------------------------------------------------------------- # JSON-C if test "${enable_jsonc}" != "no" -a -z "${JSONC_LIBS}"; then # Try and detect manual static build presence (from netdata-installer.sh) AC_MSG_CHECKING([if statically built json-c is present]) HAVE_libjson_c_a="no" if test -f "externaldeps/jsonc/libjson-c.a"; then LIBS_BKP="${LIBS}" LIBS="externaldeps/jsonc/libjson-c.a" AC_LINK_IFELSE([AC_LANG_SOURCE([[#include "externaldeps/jsonc/json-c/json.h" int main (int argc, char **argv) { struct json_object *jobj; char *str = "{ \"msg-type\": \"random\" }"; jobj = json_tokener_parse(str); json_object_get_type(jobj); }]])], [HAVE_libjson_c_a="yes"], [HAVE_libjson_c_a="no"]) LIBS="${LIBS_BKP}" fi if test "${HAVE_libjson_c_a}" = "yes"; then AC_DEFINE([LINK_STATIC_JSONC], [1], [static json-c should be used]) JSONC_LIBS="static" OPTIONAL_JSONC_STATIC_CFLAGS="-I externaldeps/jsonc" fi AC_MSG_RESULT([${HAVE_libjson_c_a}]) fi AM_CONDITIONAL([LINK_STATIC_JSONC], [test "${JSONC_LIBS}" = "static"]) test "${enable_jsonc}" = "yes" -a -z "${JSONC_LIBS}" && \ AC_MSG_ERROR([JSON-C required but not found. Try installing 'libjson-c-dev' or 'json-c'.]) AC_MSG_CHECKING([if json-c should be used]) if test "${enable_jsonc}" != "no" -a "${JSONC_LIBS}"; then enable_jsonc="yes" AC_DEFINE([ENABLE_JSONC], [1], [netdata json-c usability]) else enable_jsonc="no" fi AC_MSG_RESULT([${enable_jsonc}]) AM_CONDITIONAL([ENABLE_JSONC], [test "${enable_jsonc}" = "yes"]) # ----------------------------------------------------------------------------- # compiler options AC_ARG_VAR([SSE_CANDIDATE], [C compiler flags for SSE]) AS_CASE([$host_cpu], [i?86], [SSE_CANDIDATE="yes"] ) AC_SUBST([SSE_CANDIDATE]) if test "${SSE_CANDIDATE}" = "yes" -a "${enable_x86_sse}" = "yes"; then opt="-msse2 -mfpmath=sse" AX_CHECK_COMPILE_FLAG(${opt}, [CFLAGS="${CFLAGS} ${opt}"], []) fi if test "${GCC}" = "yes"; then AC_DEFINE_UNQUOTED([likely(x)], [__builtin_expect(!!(x), 1)], [gcc branch optimization]) AC_DEFINE_UNQUOTED([unlikely(x)], [__builtin_expect(!!(x), 0)], [gcc branch optimization]) else AC_DEFINE_UNQUOTED([likely(x)], [(x)], [gcc branch optimization]) AC_DEFINE_UNQUOTED([unlikely(x)], [(x)], [gcc branch optimization]) fi if test "${GCC}" = "yes"; then AC_DEFINE([__always_unused], [__attribute__((unused))], [gcc unused attribute]) AC_DEFINE([__maybe_unused], [__attribute__((unused))], [gcc unused attribute]) else AC_DEFINE([__always_unused], [], [dummy unused attribute]) AC_DEFINE([__maybe_unused], [], [dummy unused attribute]) fi if test "${enable_pedantic}" = "yes"; then enable_strict="yes" CFLAGS="${CFLAGS} -pedantic -Wall -Wextra -Wno-long-long" fi # ----------------------------------------------------------------------------- # memory allocation library AC_MSG_CHECKING([for memory allocator]) TS_CHECK_JEMALLOC if test "$has_jemalloc" = "1"; then AC_DEFINE([ENABLE_JEMALLOC], [1], [compile and link with jemalloc]) AC_MSG_RESULT([jemalloc]) else TS_CHECK_TCMALLOC if test "$has_tcmalloc" = "1"; then AC_DEFINE([ENABLE_TCMALLOC], [1], [compile and link with tcmalloc]) AC_MSG_RESULT([tcmalloc]) else AC_MSG_RESULT([system]) AC_C_MALLOPT AC_C_MALLINFO fi fi # ----------------------------------------------------------------------------- # libcap PKG_CHECK_MODULES( [LIBCAP], [libcap], [AC_CHECK_LIB([cap], [cap_get_proc, cap_set_proc], [AC_CHECK_HEADER( [sys/capability.h], [have_libcap=yes], [have_libcap=no] )], [have_libcap=no] )], [have_libcap=no] ) test "${with_libcap}" = "yes" -a "${have_libcap}" != "yes" && AC_MSG_ERROR([libcap required but not found.]) AC_MSG_CHECKING([if libcap should be used]) if test "${with_libcap}" != "no" -a "${have_libcap}" = "yes"; then with_libcap="yes" AC_DEFINE([HAVE_CAPABILITY], [1], [libcap usability]) OPTIONAL_LIBCAP_CFLAGS="${LIBCAP_CFLAGS}" OPTIONAL_LIBCAP_LIBS="${LIBCAP_LIBS}" else with_libcap="no" fi AC_MSG_RESULT([${with_libcap}]) AM_CONDITIONAL([ENABLE_CAPABILITY], [test "${with_libcap}" = "yes"]) # ----------------------------------------------------------------------------- # ACLK AC_MSG_CHECKING([if cloud functionality should be enabled]) AC_MSG_RESULT([${enable_cloud}]) if test "$enable_cloud" != "no"; then # just to have all messages that can fail ACLK build in one place # so it is easier to see why it can't be built if test -n "${SSL_LIBS}"; then OPTIONAL_SSL_CFLAGS="${SSL_CFLAGS}" OPTIONAL_SSL_LIBS="${SSL_LIBS}" else AC_MSG_WARN([OpenSSL required for agent-cloud-link but not found. Try installing 'libssl-dev' or 'openssl-devel'.]) fi AC_MSG_CHECKING([if libmosquitto static lib is present (and builds)]) if test -f "externaldeps/mosquitto/libmosquitto.a"; then LIBS_BKP="${LIBS}" LIBS="externaldeps/mosquitto/libmosquitto.a ${OPTIONAL_SSL_LIBS} ${LIBS_BKP}" AC_LINK_IFELSE([AC_LANG_SOURCE([[#include "externaldeps/mosquitto/mosquitto.h" int main (int argc, char **argv) { int m,mm,r; mosquitto_lib_version(&m, &mm, &r); }]])], [HAVE_libmosquitto_a="yes"], [HAVE_libmosquitto_a="no"]) LIBS="${LIBS_BKP}" else HAVE_libmosquitto_a="no" AC_DEFINE([ACLK_NO_LIBMOSQ], [1], [Libmosquitto.a was not found during build.]) fi AC_MSG_RESULT([${HAVE_libmosquitto_a}]) AC_MSG_CHECKING([if libwebsockets static lib is present]) if test -f "externaldeps/libwebsockets/libwebsockets.a"; then LWS_CFLAGS="-I externaldeps/libwebsockets/include" HAVE_libwebsockets_a="yes" else HAVE_libwebsockets_a="no" AC_DEFINE([ACLK_NO_LWS], [1], [libwebsockets.a was not found during build.]) fi AC_MSG_RESULT([${HAVE_libwebsockets_a}]) if test "${build_target}" = "linux" -a "${enable_cloud}" != "no"; then if test "${have_libcap}" = "yes" -a "${with_libcap}" = "no"; then AC_MSG_ERROR([agent-cloud-link can't be built without libcap. Disable it by --disable-cloud or enable libcap]) fi if test "${with_libcap}" = "yes"; then LWS_CFLAGS+=" ${LIBCAP_CFLAGS}" fi fi # next 2 lines are just to have info for ACLK dependencies in common place AC_MSG_CHECKING([if json-c available for ACLK]) AC_MSG_RESULT([${enable_jsonc}]) test "${enable_cloud}" = "yes" -a "${enable_jsonc}" = "no" && \ AC_MSG_ERROR([You have asked for ACLK to be built but no json-c available. ACLK requires json-c]) AC_MSG_CHECKING([if netdata agent-cloud-link can be enabled]) if test "${HAVE_libmosquitto_a}" = "yes" -a "${HAVE_libwebsockets_a}" = "yes" -a -n "${SSL_LIBS}" -a "${enable_jsonc}" = "yes"; then can_enable_aclk="yes" else can_enable_aclk="no" fi AC_MSG_RESULT([${can_enable_aclk}]) test "${enable_cloud}" = "yes" -a "${can_enable_aclk}" = "no" && \ AC_MSG_ERROR([User required agent-cloud-link but it can't be built!]) AC_MSG_CHECKING([if netdata agent-cloud-link should/will be enabled]) if test "${enable_cloud}" = "detect"; then enable_aclk=$can_enable_aclk else enable_aclk=$enable_cloud fi AC_SUBST([can_enable_aclk]) if test "${enable_aclk}" = "yes"; then AC_DEFINE([ENABLE_ACLK], [1], [netdata ACLK]) fi AC_MSG_RESULT([${enable_aclk}]) fi AC_SUBST([enable_cloud]) AM_CONDITIONAL([ENABLE_ACLK], [test "${enable_aclk}" = "yes"]) # ----------------------------------------------------------------------------- # apps.plugin AC_MSG_CHECKING([if apps.plugin should be enabled]) if test "${build_target}" != "macos"; then AC_DEFINE([ENABLE_APPS_PLUGIN], [1], [apps.plugin]) enable_plugin_apps="yes" else enable_plugin_apps="no" fi AC_MSG_RESULT([${enable_plugin_apps}]) AM_CONDITIONAL([ENABLE_PLUGIN_APPS], [test "${enable_plugin_apps}" = "yes"]) # ----------------------------------------------------------------------------- # freeipmi.plugin - libipmimonitoring PKG_CHECK_MODULES( [IPMIMONITORING], [libipmimonitoring], [AC_CHECK_LIB([ipmimonitoring], [ ipmi_monitoring_sensor_readings_by_record_id, ipmi_monitoring_sensor_readings_by_sensor_type, ipmi_monitoring_sensor_read_sensor_number, ipmi_monitoring_sensor_read_sensor_name, ipmi_monitoring_sensor_read_sensor_state, ipmi_monitoring_sensor_read_sensor_units, ipmi_monitoring_sensor_iterator_next, ipmi_monitoring_ctx_sensor_config_file, ipmi_monitoring_ctx_sdr_cache_directory, ipmi_monitoring_ctx_errormsg, ipmi_monitoring_ctx_create ], [AC_CHECK_HEADER( [ipmi_monitoring.h], [AC_CHECK_HEADER( [ipmi_monitoring_bitmasks.h], [have_ipmimonitoring=yes], [have_ipmimonitoring=no] )], [have_ipmimonitoring=no] )], [have_ipmimonitoring=no] )], [have_ipmimonitoring=no] ) test "${enable_plugin_freeipmi}" = "yes" -a "${have_ipmimonitoring}" != "yes" && \ AC_MSG_ERROR([ipmimonitoring required but not found. Try installing 'libipmimonitoring-dev' or 'libipmimonitoring-devel']) AC_MSG_CHECKING([if freeipmi.plugin should be enabled]) if test "${enable_plugin_freeipmi}" != "no" -a "${have_ipmimonitoring}" = "yes"; then enable_plugin_freeipmi="yes" AC_DEFINE([HAVE_FREEIPMI], [1], [ipmimonitoring usability]) OPTIONAL_IPMIMONITORING_CFLAGS="${IPMIMONITORING_CFLAGS}" OPTIONAL_IPMIMONITORING_LIBS="${IPMIMONITORING_LIBS}" else enable_plugin_freeipmi="no" fi AC_MSG_RESULT([${enable_plugin_freeipmi}]) AM_CONDITIONAL([ENABLE_PLUGIN_FREEIPMI], [test "${enable_plugin_freeipmi}" = "yes"]) # ----------------------------------------------------------------------------- # cups.plugin - libcups # Only check most recently added method of cups AC_CHECK_LIB([cups], [httpConnect2], [AC_CHECK_HEADER( [cups/cups.h], [have_cups=yes], [have_cups=no] )], [have_cups=no] ) test "${enable_plugin_cups}" = "yes" -a "${have_cups}" != "yes" && \ AC_MSG_ERROR([cups required but not found. Try installing 'cups']) AC_ARG_WITH([cups-config], [AS_HELP_STRING([--with-cups-config=path], [Specify path to cups-config executable.])], [with_cups_config="$withval"], [with_cups_config=system] ) AS_IF([test "x$with_cups_config" != "xsystem"], [ CUPSCONFIG=$with_cups_config ], [ AC_PATH_TOOL(CUPSCONFIG, [cups-config]) AS_IF([test -z "$CUPSCONFIG"], [ have_cups=no ]) ]) AC_MSG_CHECKING([if cups.plugin should be enabled]) if test "${enable_plugin_cups}" != "no" -a "${have_cups}" = "yes"; then enable_plugin_cups="yes" AC_DEFINE([HAVE_CUPS], [1], [cups usability]) CUPS_CFLAGS="${CUPS_CFLAGS} `$CUPSCONFIG --cflags`" CUPS_LIBS="${CUPS_LIBS} `$CUPSCONFIG --libs`" OPTIONAL_CUPS_CFLAGS="${CUPS_CFLAGS}" OPTIONAL_CUPS_LIBS="${CUPS_LIBS}" else enable_plugin_cups="no" fi AC_MSG_RESULT([${enable_plugin_cups}]) AM_CONDITIONAL([ENABLE_PLUGIN_CUPS], [test "${enable_plugin_cups}" = "yes"]) # ----------------------------------------------------------------------------- # nfacct.plugin - libmnl, libnetfilter_acct AC_CHECK_HEADER( [linux/netfilter/nfnetlink_conntrack.h], [AC_CHECK_DECL( [CTA_STATS_MAX], [have_nfnetlink_conntrack=yes], [have_nfnetlink_conntrack=no], [#include <linux/netfilter/nfnetlink_conntrack.h>] )], [have_nfnetlink_conntrack=no] ) PKG_CHECK_MODULES( [NFACCT], [libnetfilter_acct], [AC_CHECK_LIB( [netfilter_acct], [nfacct_alloc], [have_libnetfilter_acct=yes], [have_libnetfilter_acct=no] )], [have_libnetfilter_acct=no] ) PKG_CHECK_MODULES( [LIBMNL], [libmnl], [AC_CHECK_LIB( [mnl], [mnl_socket_open], [have_libmnl=yes], [have_libmnl=no] )], [have_libmnl=no] ) test "${enable_plugin_nfacct}" = "yes" -a "${have_nfnetlink_conntrack}" != "yes" && \ AC_MSG_ERROR([nfnetlink_conntrack.h required but not found or too old]) test "${enable_plugin_nfacct}" = "yes" -a "${have_libnetfilter_acct}" != "yes" && \ AC_MSG_ERROR([netfilter_acct required but not found]) test "${enable_plugin_nfacct}" = "yes" -a "${have_libmnl}" != "yes" && \ AC_MSG_ERROR([libmnl required but not found. Try installing 'libmnl-dev' or 'libmnl-devel']) AC_MSG_CHECKING([if nfacct.plugin should be enabled]) if test "${enable_plugin_nfacct}" != "no" -a "${have_libnetfilter_acct}" = "yes" \ -a "${have_libmnl}" = "yes" \ -a "${have_nfnetlink_conntrack}" = "yes"; then enable_plugin_nfacct="yes" AC_DEFINE([HAVE_LIBMNL], [1], [libmnl usability]) AC_DEFINE([HAVE_LIBNETFILTER_ACCT], [1], [libnetfilter_acct usability]) AC_DEFINE([HAVE_LINUX_NETFILTER_NFNETLINK_CONNTRACK_H], [1], [libnetfilter_nfnetlink_conntrack header usability]) OPTIONAL_NFACCT_CFLAGS="${NFACCT_CFLAGS} ${LIBMNL_CFLAGS}" OPTIONAL_NFACCT_LIBS="${NFACCT_LIBS} ${LIBMNL_LIBS}" else enable_plugin_nfacct="no" fi AC_MSG_RESULT([${enable_plugin_nfacct}]) AM_CONDITIONAL([ENABLE_PLUGIN_NFACCT], [test "${enable_plugin_nfacct}" = "yes"]) # ----------------------------------------------------------------------------- # xenstat.plugin - libxenstat PKG_CHECK_MODULES( [YAJL], [yajl], [AC_CHECK_LIB( [yajl], [yajl_tree_get], [have_libyajl=yes], [have_libyajl=no] )], [have_libyajl=no] ) AC_CHECK_LIB( [xenstat], [xenstat_init], [AC_CHECK_HEADER( [xenstat.h], [have_libxenstat=yes], [have_libxenstat=no] )], [have_libxenstat=no], [-lyajl] ) PKG_CHECK_MODULES( [XENLIGHT], [xenlight], [AC_CHECK_LIB( [xenlight], [libxl_domain_info], [AC_CHECK_HEADER( [libxl.h], [have_libxenlight=yes], [have_libxenlight=no] )], [have_libxenlight=no] )], [have_libxenlight=no] ) test "${enable_plugin_xenstat}" = "yes" -a "${have_libxenstat}" != "yes" && \ AC_MSG_ERROR([libxenstat required but not found. try installing 'xen-dom0-libs-devel']) test "${enable_plugin_xenstat}" = "yes" -a "${have_libxenlight}" != "yes" && \ AC_MSG_ERROR([libxenlight required but not found. try installing 'xen-dom0-libs-devel']) test "${enable_plugin_xenstat}" = "yes" -a "${have_libyajl}" != "yes" && \ AC_MSG_ERROR([libyajl required but not found. Try installing 'yajl-devel']) AC_MSG_CHECKING([if xenstat.plugin should be enabled]) if test "${enable_plugin_xenstat}" != "no" -a "${have_libxenstat}" = "yes" -a "${have_libxenlight}" = "yes" -a "${have_libyajl}" = "yes"; then enable_plugin_xenstat="yes" AC_DEFINE([HAVE_LIBXENSTAT], [1], [libxenstat usability]) AC_DEFINE([HAVE_LIBXENLIGHT], [1], [libxenlight usability]) AC_DEFINE([HAVE_LIBYAJL], [1], [libyajl usability]) OPTIONAL_XENSTAT_CFLAGS="${XENLIGHT_CFLAGS} ${YAJL_CFLAGS}" OPTIONAL_XENSTAT_LIBS="-lxenstat ${XENLIGHT_LIBS} ${YAJL_LIBS}" else enable_plugin_xenstat="no" fi AC_MSG_RESULT([${enable_plugin_xenstat}]) AM_CONDITIONAL([ENABLE_PLUGIN_XENSTAT], [test "${enable_plugin_xenstat}" = "yes"]) if test "${enable_plugin_xenstat}" == "yes"; then AC_MSG_CHECKING([for xenstat_vbd_error in -lxenstat]) AC_TRY_LINK( [ #include <xenstat.h> ], [ xenstat_vbd * vbd; int out = xenstat_vbd_error(vbd); ], [ have_xenstat_vbd_error=yes AC_DEFINE([HAVE_XENSTAT_VBD_ERROR], [1], [xenstat_vbd_error usability]) ], [ have_xenstat_vbd_error=no ] ) AC_MSG_RESULT([${have_xenstat_vbd_error}]) fi # ----------------------------------------------------------------------------- # perf.plugin AC_CHECK_HEADER( [linux/perf_event.h], [AC_CHECK_DECL( [PERF_COUNT_HW_REF_CPU_CYCLES], [have_perf_event=yes], [have_perf_event=no], [#include <linux/perf_event.h>] )], [have_perf_event=no] ) AC_MSG_CHECKING([if perf.plugin should be enabled]) if test "${build_target}" == "linux" -a "${have_perf_event}" = "yes"; then AC_DEFINE([ENABLE_PERF_PLUGIN], [1], [perf.plugin]) enable_plugin_perf="yes" else enable_plugin_perf="no" fi AC_MSG_RESULT([${enable_plugin_perf}]) AM_CONDITIONAL([ENABLE_PLUGIN_PERF], [test "${enable_plugin_perf}" = "yes"]) # ----------------------------------------------------------------------------- # ebpf.plugin PKG_CHECK_MODULES( [LIBELF], [libelf], [have_libelf=yes], [have_libelf=no] ) AC_CHECK_TYPE( [struct bpf_prog_info], [have_bpf=yes], [have_bpf=no], [#include <linux/bpf.h>] ) AC_CHECK_FILE( externaldeps/libbpf/libbpf.a, [have_libbpf=yes], [have_libbpf=no] ) AC_MSG_CHECKING([if ebpf.plugin should be enabled]) if test "${build_target}" = "linux" -a \ "${enable_ebpf}" != "no" -a \ "${have_libelf}" = "yes" -a \ "${have_bpf}" = "yes" -a \ "${have_libbpf}" = "yes"; then OPTIONAL_BPF_CFLAGS="${LIBELF_CFLAGS} -I externaldeps/libbpf/include" OPTIONAL_BPF_LIBS="externaldeps/libbpf/libbpf.a ${LIBELF_LIBS}" AC_DEFINE([HAVE_LIBBPF], [1], [libbpf usability]) enable_ebpf="yes" else enable_ebpf="no" fi AC_MSG_RESULT([${enable_ebpf}]) AM_CONDITIONAL([ENABLE_PLUGIN_EBPF], [test "${enable_ebpf}" = "yes"]) # ----------------------------------------------------------------------------- # slabinfo.plugin AC_MSG_CHECKING([if slabinfo.plugin should be enabled]) if test "${build_target}" == "linux"; then AC_DEFINE([ENABLE_SLABINFO], [1], [slabinfo plugin]) enable_plugin_slabinfo="yes" else enable_plugin_slabinfo="no" fi AC_MSG_RESULT([${enable_plugin_slabinfo}]) AM_CONDITIONAL([ENABLE_PLUGIN_SLABINFO], [test "${enable_plugin_slabinfo}" = "yes"]) # ----------------------------------------------------------------------------- # AWS Kinesis backend - libaws-cpp-sdk-kinesis, libaws-cpp-sdk-core, libssl, libcrypto, libcurl PKG_CHECK_MODULES( [LIBCRYPTO], [libcrypto], [AC_CHECK_LIB( [crypto], [CRYPTO_new_ex_data], [have_libcrypto=yes], [have_libcrypto=no] )], [have_libcrypto=no] ) PKG_CHECK_MODULES( [LIBSSL], [libssl], [AC_CHECK_LIB( [ssl], [SSL_connect], [have_libssl=yes], [have_libssl=no] )], [have_libssl=no] ) PKG_CHECK_MODULES( [LIBCURL], [libcurl], [AC_CHECK_LIB( [curl], [curl_easy_init], [have_libcurl=yes], [have_libcurl=no] )], [have_libcurl=no] ) PKG_CHECK_MODULES( [AWS_CPP_SDK_CORE], [aws-cpp-sdk-core], [AC_CHECK_LIB( [aws-cpp-sdk-core], [cJSON_free], [have_libaws_cpp_sdk_core=yes], [have_libaws_cpp_sdk_core=no] )], [have_libaws_cpp_sdk_core=no] ) PKG_CHECK_MODULES( [AWS_CPP_SDK_KINESIS], [aws-cpp-sdk-kinesis], [have_libaws_cpp_sdk_kinesis=yes], [have_libaws_cpp_sdk_kinesis=no] ) AC_CHECK_LIB( [aws-checksums], [aws_checksums_crc32], [have_libaws_checksums=yes], [have_libaws_checksums=no] ) AC_CHECK_LIB( [aws-c-common], [aws_default_allocator], [have_libaws_c_common=yes], [have_libaws_c_common=no] ) AC_CHECK_LIB( [aws-c-event-stream], [aws_event_stream_library_init], [have_libaws_c_event_stream=yes], [have_libaws_c_event_stream=no] ) test "${enable_backend_kinesis}" = "yes" -a "${have_libaws_cpp_sdk_kinesis}" != "yes" && \ AC_MSG_ERROR([libaws-cpp-sdk-kinesis required but not found. try installing AWS C++ SDK]) test "${enable_backend_kinesis}" = "yes" -a "${have_libaws_cpp_sdk_core}" != "yes" && \ AC_MSG_ERROR([libaws-cpp-sdk-core required but not found. try installing AWS C++ SDK]) test "${enable_backend_kinesis}" = "yes" -a "${have_libcurl}" != "yes" && \ AC_MSG_ERROR([libcurl required but not found]) test "${enable_backend_kinesis}" = "yes" -a "${have_libssl}" != "yes" && \ AC_MSG_ERROR([libssl required but not found]) test "${enable_backend_kinesis}" = "yes" -a "${have_libcrypto}" != "yes" && \ AC_MSG_ERROR([libcrypto required but not found]) test "${enable_backend_kinesis}" = "yes" -a "${have_libaws_checksums}" != "yes" \ -a "${have_libaws_c_common}" != "yes" \ -a "${have_libaws_c_event_stream}" != "yes" && \ AC_MSG_ERROR([AWS SKD third party dependencies required but not found]) AC_MSG_CHECKING([if kinesis backend should be enabled]) if test "${enable_backend_kinesis}" != "no" -a "${have_libaws_cpp_sdk_kinesis}" = "yes" \ -a "${have_libaws_cpp_sdk_core}" = "yes" \ -a "${have_libaws_checksums}" = "yes" \ -a "${have_libaws_c_common}" = "yes" \ -a "${have_libaws_c_event_stream}" = "yes" \ -a "${have_libcurl}" = "yes" \ -a "${have_libssl}" = "yes" \ -a "${have_libcrypto}" = "yes"; then enable_backend_kinesis="yes" AC_DEFINE([HAVE_KINESIS], [1], [libaws-cpp-sdk-kinesis usability]) OPTIONAL_KINESIS_CFLAGS="${LIBCRYPTO_CFLAGS} ${LIBSSL_CFLAGS} ${LIBCURL_CFLAGS}" CXX11FLAG="${AWS_CPP_SDK_KINESIS_CFLAGS} ${AWS_CPP_SDK_CORE_CFLAGS}" OPTIONAL_KINESIS_LIBS="${AWS_CPP_SDK_KINESIS_LIBS} ${AWS_CPP_SDK_CORE_LIBS} \ ${LIBCRYPTO_LIBS} ${LIBSSL_LIBS} ${LIBCURL_LIBS}" else enable_backend_kinesis="no" fi AC_MSG_RESULT([${enable_backend_kinesis}]) AM_CONDITIONAL([ENABLE_BACKEND_KINESIS], [test "${enable_backend_kinesis}" = "yes"]) # ----------------------------------------------------------------------------- # Pub/Sub exporting connector - googleapis PKG_CHECK_MODULES( [GRPC], [grpc], [have_libgrpc=yes], [have_libgrpc=no] ) PKG_CHECK_MODULES( [PUBSUB], [googleapis_cpp_pubsub_protos], [have_pubsub_protos=yes], [have_pubsub_protos=no] ) AC_PATH_PROG([CXX_BINARY], [${CXX}], [no]) AS_IF( [test x"${CXX_BINARY}" == x"no"], [have_CXX_compiler=no], [have_CXX_compiler=yes] ) test "${enable_pubsub}" = "yes" -a "${have_grpc}" != "yes" && \ AC_MSG_ERROR([libgrpc required but not found. try installing grpc]) test "${enable_pubsub}" = "yes" -a "${have_pubsub_protos}" != "yes" && \ AC_MSG_ERROR([libgoogleapis_cpp_pubsub_protos required but not found. try installing googleapis]) test "${enable_backend_prometheus_remote_write}" = "yes" -a "${have_CXX_compiler}" != "yes" && \ AC_MSG_ERROR([C++ compiler required but not found. try installing g++]) AC_MSG_CHECKING([if pubsub exporting connector should be enabled]) if test "${enable_exporting_pubsub}" != "no" -a "${have_pubsub_protos}" = "yes" -a "${have_CXX_compiler}" = "yes"; then enable_exporting_pubsub="yes" AC_DEFINE([ENABLE_EXPORTING_PUBSUB], [1], [Pub/Sub API usability]) OPTIONAL_PUBSUB_CFLAGS="${GRPC_CFLAGS} ${PUBSUB_CFLAGS}" CXX11FLAG="-std=c++11" OPTIONAL_PUBSUB_LIBS="${GRPC_LIBS} ${PUBSUB_LIBS}" else enable_pubsub="no" fi AC_MSG_RESULT([${enable_exporting_pubsub}]) AM_CONDITIONAL([ENABLE_EXPORTING_PUBSUB], [test "${enable_exporting_pubsub}" = "yes"]) # ----------------------------------------------------------------------------- # Prometheus remote write backend - libprotobuf, libsnappy, protoc PKG_CHECK_MODULES( [PROTOBUF], [protobuf >= 3], [have_libprotobuf=yes], [have_libprotobuf=no] ) AC_MSG_CHECKING([for snappy::RawCompress in -lsnappy]) AC_LANG_SAVE AC_LANG_CPLUSPLUS save_LIBS="${LIBS}" LIBS="-lsnappy" save_CXXFLAGS="${CXXFLAGS}" CXXFLAGS="${CXXFLAGS} -std=c++11" AC_TRY_LINK( [ #include <stdlib.h> #include <snappy.h> ], [ const char *input = "test"; size_t compressed_length; char *buffer = (char *)malloc(5 * sizeof(char)); snappy::RawCompress(input, 4, buffer, &compressed_length); free(buffer); ], [ have_libsnappy=yes SNAPPY_CFLAGS="" SNAPPY_LIBS="-lsnappy" ], [have_libsnappy=no] ) LIBS="${save_LIBS}" CXXFLAGS="${save_CXXFLAGS}" AC_LANG_RESTORE AC_MSG_RESULT([${have_libsnappy}]) AC_PATH_PROG([PROTOC], [protoc], [no]) AS_IF( [test x"${PROTOC}" == x"no"], [have_protoc=no], [have_protoc=yes] ) AC_PATH_PROG([CXX_BINARY], [${CXX}], [no]) AS_IF( [test x"${CXX_BINARY}" == x"no"], [have_CXX_compiler=no], [have_CXX_compiler=yes] ) test "${enable_backend_prometheus_remote_write}" = "yes" -a "${have_libprotobuf}" != "yes" && \ AC_MSG_ERROR([libprotobuf required but not found. try installing protobuf]) test "${enable_backend_prometheus_remote_write}" = "yes" -a "${have_libsnappy}" != "yes" && \ AC_MSG_ERROR([libsnappy required but not found. try installing snappy]) test "${enable_backend_prometheus_remote_write}" = "yes" -a "${have_protoc}" != "yes" && \ AC_MSG_ERROR([protoc compiler required but not found. try installing protobuf]) test "${enable_backend_prometheus_remote_write}" = "yes" -a "${have_CXX_compiler}" != "yes" && \ AC_MSG_ERROR([C++ compiler required but not found. try installing g++]) AC_MSG_CHECKING([if prometheus remote write backend should be enabled]) if test "${enable_backend_prometheus_remote_write}" != "no" -a "${have_libprotobuf}" = "yes" -a "${have_libsnappy}" = "yes" \ -a "${have_protoc}" = "yes" -a "${have_CXX_compiler}" = "yes"; then enable_backend_prometheus_remote_write="yes" AC_DEFINE([ENABLE_PROMETHEUS_REMOTE_WRITE], [1], [Prometheus remote write API usability]) OPTIONAL_PROMETHEUS_REMOTE_WRITE_CFLAGS="${PROTOBUF_CFLAGS} ${SNAPPY_CFLAGS} -Iexporting/prometheus/remote_write" CXX11FLAG="-std=c++11" OPTIONAL_PROMETHEUS_REMOTE_WRITE_LIBS="${PROTOBUF_LIBS} ${SNAPPY_LIBS}" else enable_backend_prometheus_remote_write="no" fi AC_MSG_RESULT([${enable_backend_prometheus_remote_write}]) AM_CONDITIONAL([ENABLE_BACKEND_PROMETHEUS_REMOTE_WRITE], [test "${enable_backend_prometheus_remote_write}" = "yes"]) # ----------------------------------------------------------------------------- # MongoDB backend - libmongoc PKG_CHECK_MODULES( [LIBMONGOC], [libmongoc-1.0 >= 1.7], [have_libmongoc=yes], [have_libmongoc=no] ) test "${enable_backend_mongodb}" = "yes" -a "${have_libmongoc}" != "yes" && \ AC_MSG_ERROR([libmongoc required but not found. Try installing `mongoc`.]) AC_MSG_CHECKING([if mongodb backend should be enabled]) if test "${enable_backend_mongodb}" != "no" -a "${have_libmongoc}" = "yes"; then enable_backend_mongodb="yes" AC_DEFINE([HAVE_MONGOC], [1], [libmongoc usability]) OPTIONAL_MONGOC_CFLAGS="${LIBMONGOC_CFLAGS}" OPTIONAL_MONGOC_LIBS="${LIBMONGOC_LIBS}" else enable_backend_mongodb="no" fi AC_MSG_RESULT([${enable_backend_mongodb}]) AM_CONDITIONAL([ENABLE_BACKEND_MONGODB], [test "${enable_backend_mongodb}" = "yes"]) # ----------------------------------------------------------------------------- # check for setns() - cgroup-network AC_CHECK_FUNC([setns]) AC_MSG_CHECKING([if cgroup-network can be enabled]) if test "$ac_cv_func_setns" = "yes" ; then have_setns="yes" AC_DEFINE([HAVE_SETNS], [1], [Define 1 if you have setns() function]) else have_setns="no" fi AC_MSG_RESULT([${have_setns}]) AM_CONDITIONAL([ENABLE_PLUGIN_CGROUP_NETWORK], [test "${have_setns}" = "yes"]) # ----------------------------------------------------------------------------- # Link-Time-Optimization if test "${enable_lto}" != "no"; then opt="-flto" AX_CHECK_COMPILE_FLAG(${opt}, [have_lto=yes], [have_lto=no]) fi if test "${have_lto}" = "yes"; then oCFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} -flto" ac_cv_c_lto_cross_compile="${enable_lto}" test "${ac_cv_c_lto_cross_compile}" != "yes" && ac_cv_c_lto_cross_compile="no" AC_C_LTO CFLAGS="${oCFLAGS}" test "${ac_cv_c_lto}" != "yes" && have_lto="no" fi test "${enable_lto}" = "yes" -a "${have_lto}" != "yes" && \ AC_MSG_ERROR([LTO is required but is not available.]) AC_MSG_CHECKING([if LTO should be enabled]) if test "${enable_lto}" != "no" -a "${have_lto}" = "yes"; then enable_lto="yes" CFLAGS="${CFLAGS} -flto" else enable_lto="no" fi AC_MSG_RESULT([${enable_lto}]) # ----------------------------------------------------------------------------- AM_CONDITIONAL([ENABLE_CXX_LINKER], [test "${enable_backend_kinesis}" = "yes" \ -o "${enable_exporting_pubsub}" = "yes" \ -o "${enable_backend_prometheus_remote_write}" = "yes"]) AC_DEFINE_UNQUOTED([NETDATA_USER], ["${with_user}"], [use this user to drop privileged]) varlibdir="${localstatedir}/lib/netdata" registrydir="${localstatedir}/lib/netdata/registry" cachedir="${localstatedir}/cache/netdata" chartsdir="${libexecdir}/netdata/charts.d" nodedir="${libexecdir}/netdata/node.d" pythondir="${libexecdir}/netdata/python.d" configdir="${sysconfdir}/netdata" libconfigdir="${libdir}/netdata/conf.d" logdir="${localstatedir}/log/netdata" pluginsdir="${libexecdir}/netdata/plugins.d" AC_SUBST([build_target]) AC_SUBST([varlibdir]) AC_SUBST([registrydir]) AC_SUBST([cachedir]) AC_SUBST([chartsdir]) AC_SUBST([nodedir]) AC_SUBST([pythondir]) AC_SUBST([configdir]) AC_SUBST([libconfigdir]) AC_SUBST([logdir]) AC_SUBST([pluginsdir]) AC_SUBST([webdir]) CFLAGS="${CFLAGS} ${OPTIONAL_MATH_CFLAGS} ${OPTIONAL_NFACCT_CFLAGS} ${OPTIONAL_ZLIB_CFLAGS} ${OPTIONAL_UUID_CFLAGS} \ ${OPTIONAL_LIBCAP_CFLAGS} ${OPTIONAL_IPMIMONITORING_CFLAGS} ${OPTIONAL_CUPS_CFLAGS} ${OPTIONAL_XENSTAT_FLAGS} \ ${OPTIONAL_KINESIS_CFLAGS} ${OPTIONAL_PUBSUB_CFLAGS} ${OPTIONAL_PROMETHEUS_REMOTE_WRITE_CFLAGS} \ ${OPTIONAL_MONGOC_CFLAGS} ${LWS_CFLAGS} ${OPTIONAL_JSONC_STATIC_CFLAGS} ${OPTIONAL_BPF_CFLAGS} ${OPTIONAL_JUDY_CFLAGS}" CXXFLAGS="${CFLAGS} ${CXX11FLAG}" CPPFLAGS="\ -DTARGET_OS=${build_target_id} \ -DVARLIB_DIR=\"\\\"${varlibdir}\\\"\" \ -DCACHE_DIR=\"\\\"${cachedir}\\\"\" \ -DCONFIG_DIR=\"\\\"${configdir}\\\"\" \ -DLIBCONFIG_DIR=\"\\\"${libconfigdir}\\\"\" \ -DLOG_DIR=\"\\\"${logdir}\\\"\" \ -DPLUGINS_DIR=\"\\\"${pluginsdir}\\\"\" \ -DRUN_DIR=\"\\\"${localstatedir}/run/netdata\\\"\" \ -DWEB_DIR=\"\\\"${webdir}\\\"\" \ " AC_SUBST([OPTIONAL_MATH_CFLAGS]) AC_SUBST([OPTIONAL_MATH_LIBS]) AC_SUBST([OPTIONAL_UV_LIBS]) AC_SUBST([OPTIONAL_LZ4_LIBS]) AC_SUBST([OPTIONAL_JUDY_CFLAGS]) AC_SUBST([OPTIONAL_JUDY_LIBS]) AC_SUBST([OPTIONAL_SSL_LIBS]) AC_SUBST([OPTIONAL_JSONC_LIBS]) AC_SUBST([OPTIONAL_NFACCT_CFLAGS]) AC_SUBST([OPTIONAL_NFACCT_LIBS]) AC_SUBST([OPTIONAL_ZLIB_CFLAGS]) AC_SUBST([OPTIONAL_ZLIB_LIBS]) AC_SUBST([OPTIONAL_UUID_CFLAGS]) AC_SUBST([OPTIONAL_UUID_LIBS]) AC_SUBST([OPTIONAL_BPF_CFLAGS]) AC_SUBST([OPTIONAL_BPF_LIBS]) AC_SUBST([OPTIONAL_MQTT_LIBS]) AC_SUBST([OPTIONAL_LIBCAP_CFLAGS]) AC_SUBST([OPTIONAL_LIBCAP_LIBS]) AC_SUBST([OPTIONAL_IPMIMONITORING_CFLAGS]) AC_SUBST([OPTIONAL_IPMIMONITORING_LIBS]) AC_SUBST([OPTIONAL_CUPS_CFLAGS]) AC_SUBST([OPTIONAL_CUPS_LIBS]) AC_SUBST([OPTIONAL_XENSTAT_CFLAGS]) AC_SUBST([OPTIONAL_XENSTAT_LIBS]) AC_SUBST([OPTIONAL_KINESIS_CFLAGS]) AC_SUBST([OPTIONAL_KINESIS_LIBS]) AC_SUBST([OPTIONAL_PUBSUB_CFLAGS]) AC_SUBST([OPTIONAL_PUBSUB_LIBS]) AC_SUBST([OPTIONAL_PROMETHEUS_REMOTE_WRITE_CFLAGS]) AC_SUBST([OPTIONAL_PROMETHEUS_REMOTE_WRITE_LIBS]) AC_SUBST([OPTIONAL_MONGOC_CFLAGS]) AC_SUBST([OPTIONAL_MONGOC_LIBS]) # ----------------------------------------------------------------------------- # Check if cmocka is available - needed for unit testing AC_ARG_ENABLE( [unit-tests], [AS_HELP_STRING([--disable-unit-tests], [Disables building and running the unit tests suite])], [], [enable_unit_tests="yes"] ) PKG_CHECK_MODULES( [CMOCKA], [cmocka], [have_cmocka="yes"], [AC_MSG_NOTICE([CMocka not found on the system. Unit tests disabled])] ) AM_CONDITIONAL([ENABLE_UNITTESTS], [test "${enable_unit_tests}" = "yes" -a "${have_cmocka}" = "yes" ]) AC_SUBST([ENABLE_UNITTESTS]) TEST_CFLAGS="${CFLAGS} ${CMOCKA_CFLAGS}" TEST_LIBS="${CMOCKA_LIBS}" AC_SUBST([TEST_CFLAGS]) AC_SUBST([TEST_LIBS]) # ----------------------------------------------------------------------------- # save configure options for build info AC_DEFINE_UNQUOTED( [CONFIGURE_COMMAND], ["$ac_configure_args"], [options passed to configure script] ) AC_CONFIG_FILES([ Makefile netdata.spec backends/graphite/Makefile backends/json/Makefile backends/Makefile backends/opentsdb/Makefile backends/prometheus/Makefile backends/prometheus/remote_write/Makefile backends/aws_kinesis/Makefile backends/mongodb/Makefile collectors/Makefile collectors/apps.plugin/Makefile collectors/cgroups.plugin/Makefile collectors/charts.d.plugin/Makefile collectors/checks.plugin/Makefile collectors/diskspace.plugin/Makefile collectors/fping.plugin/Makefile collectors/ioping.plugin/Makefile collectors/freebsd.plugin/Makefile collectors/freeipmi.plugin/Makefile collectors/cups.plugin/Makefile collectors/idlejitter.plugin/Makefile collectors/macos.plugin/Makefile collectors/nfacct.plugin/Makefile collectors/node.d.plugin/Makefile collectors/plugins.d/Makefile collectors/proc.plugin/Makefile collectors/python.d.plugin/Makefile collectors/slabinfo.plugin/Makefile collectors/statsd.plugin/Makefile collectors/ebpf.plugin/Makefile collectors/tc.plugin/Makefile collectors/xenstat.plugin/Makefile collectors/perf.plugin/Makefile daemon/Makefile database/Makefile database/engine/Makefile database/engine/metadata_log/Makefile database/engine/global_uuid_map/Makefile diagrams/Makefile exporting/Makefile exporting/graphite/Makefile exporting/json/Makefile exporting/opentsdb/Makefile exporting/prometheus/Makefile exporting/prometheus/remote_write/Makefile exporting/aws_kinesis/Makefile exporting/pubsub/Makefile exporting/mongodb/Makefile exporting/tests/Makefile health/Makefile health/notifications/Makefile libnetdata/Makefile libnetdata/tests/Makefile libnetdata/adaptive_resortable_list/Makefile libnetdata/avl/Makefile libnetdata/buffer/Makefile libnetdata/clocks/Makefile libnetdata/config/Makefile libnetdata/dictionary/Makefile libnetdata/ebpf/Makefile libnetdata/eval/Makefile libnetdata/locks/Makefile libnetdata/log/Makefile libnetdata/popen/Makefile libnetdata/procfile/Makefile libnetdata/simple_pattern/Makefile libnetdata/socket/Makefile libnetdata/statistical/Makefile libnetdata/storage_number/Makefile libnetdata/storage_number/tests/Makefile libnetdata/threads/Makefile libnetdata/url/Makefile libnetdata/json/Makefile libnetdata/health/Makefile registry/Makefile streaming/Makefile system/Makefile tests/Makefile web/Makefile web/api/Makefile web/api/badges/Makefile web/api/exporters/Makefile web/api/exporters/shell/Makefile web/api/exporters/prometheus/Makefile web/api/formatters/Makefile web/api/formatters/csv/Makefile web/api/formatters/json/Makefile web/api/formatters/ssv/Makefile web/api/formatters/value/Makefile web/api/queries/Makefile web/api/queries/average/Makefile web/api/queries/des/Makefile web/api/queries/incremental_sum/Makefile web/api/queries/max/Makefile web/api/queries/median/Makefile web/api/queries/min/Makefile web/api/queries/ses/Makefile web/api/queries/stddev/Makefile web/api/queries/sum/Makefile web/api/health/Makefile web/gui/Makefile web/server/Makefile web/server/static/Makefile claim/Makefile aclk/Makefile spawn/Makefile parser/Makefile ]) AC_OUTPUT test "${with_math}" != "yes" && AC_MSG_WARN([You are building without math. math allows accurate calculations. It should be enabled.]) || : test "${with_zlib}" != "yes" && AC_MSG_WARN([You are building without zlib. zlib allows netdata to transfer a lot less data with web clients. It should be enabled.]) || :
{ "pile_set_name": "Github" }
from django.db import models # Create your models here. """ sqlitebrowser db.sqlite3 python3 manage.py shell from dashboard.models import Techniques technique1 = Techniques(name="DLL hijacking", used=1) technique1.publish() """ class Techniques(models.Model): name = models.CharField(max_length=50) #text = models.TextField() #created_date = models.DateTimeField(default=timezone.now) used = models.BooleanField(default=False) def publish(self): #self.published_date = timezone.now() self.save() def __str__(self): return self.name
{ "pile_set_name": "Github" }
#!/bin/sh # SPDX-License-Identifier: GPL-2.0 echo "int foo(void) { char X[200]; return 3; }" | $* -S -x c -c -m64 -O0 -mcmodel=kernel -fno-PIE -fstack-protector - -o - 2> /dev/null | grep -q "%gs"
{ "pile_set_name": "Github" }
/* * Copyright (c) MuleSoft, Inc. All rights reserved. http://www.mulesoft.com * The software in this package is published under the terms of the CPAL v1.0 * license, a copy of which has been included with this distribution in the * LICENSE.txt file. */ package org.mule.runtime.module.extension.internal.loader.validation; import static java.util.Collections.singletonList; import static java.util.Optional.empty; import static org.hamcrest.CoreMatchers.allOf; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.Matchers.hasSize; import static org.junit.Assert.assertThat; import static org.mockito.Answers.RETURNS_DEEP_STUBS; import static org.mockito.Mockito.when; import static org.mule.test.module.extension.internal.util.ExtensionsTestUtils.mockImplementingType; import org.mule.runtime.api.component.location.ComponentLocation; import org.mule.runtime.api.exception.MuleException; import org.mule.runtime.api.meta.model.ExtensionModel; import org.mule.runtime.api.meta.model.source.SourceModel; import org.mule.runtime.extension.api.loader.ProblemsReporter; import org.mule.runtime.extension.api.runtime.source.Source; import org.mule.runtime.extension.api.runtime.source.SourceCallback; import org.mule.runtime.module.extension.internal.loader.java.property.ImplementingTypeModelProperty; import org.mule.tck.junit4.AbstractMuleTestCase; import org.mule.tck.size.SmallTest; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; @SmallTest @RunWith(MockitoJUnitRunner.class) public class ComponentLocationModelValidatorTestCase extends AbstractMuleTestCase { @Mock private ExtensionModel extensionModel; @Mock(answer = RETURNS_DEEP_STUBS) private SourceModel sourceModel; private ComponentLocationModelValidator validator = new ComponentLocationModelValidator(); private ProblemsReporter reporter = new ProblemsReporter(extensionModel); @Before public void before() { when(extensionModel.getSourceModels()).thenReturn(singletonList(sourceModel)); when(sourceModel.getSuccessCallback()).thenReturn(empty()); when(sourceModel.getErrorCallback()).thenReturn(empty()); } @Test public void noImplementingType() { when(sourceModel.getModelProperty(ImplementingTypeModelProperty.class)).thenReturn(empty()); assertValid(); } @Test public void noLocationField() { mockImplementingType(sourceModel, NoLocation.class); assertValid(); } @Test public void oneLocationField() { mockImplementingType(sourceModel, OneLocation.class); assertValid(); } @Test public void twoLocationFields() { mockImplementingType(sourceModel, TwoLocation.class); validator.validate(extensionModel, reporter); assertThat(reporter.getErrors(), hasSize(1)); assertThat(reporter.getErrors().get(0).getMessage(), allOf( containsString(ComponentLocation.class.getSimpleName()), containsString("2"))); } private void assertValid() { validator.validate(extensionModel, reporter); assertThat(reporter.hasErrors(), is(false)); } private static abstract class TestSource extends Source<Void, Void> { @Override public void onStart(SourceCallback<Void, Void> sourceCallback) throws MuleException { } @Override public void onStop() { } } private static class NoLocation extends TestSource { } private static class OneLocation extends TestSource { private ComponentLocation location; } private static class TwoLocation extends OneLocation { private ComponentLocation secondLocation; } }
{ "pile_set_name": "Github" }
/* * * Copyright 2014 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package grpc import ( "context" ) // Invoke sends the RPC request on the wire and returns after response is // received. This is typically called by generated code. // // All errors returned by Invoke are compatible with the status package. func (cc *ClientConn) Invoke(ctx context.Context, method string, args, reply interface{}, opts ...CallOption) error { // allow interceptor to see all applicable call options, which means those // configured as defaults from dial option as well as per-call options opts = combine(cc.dopts.callOptions, opts) if cc.dopts.unaryInt != nil { return cc.dopts.unaryInt(ctx, method, args, reply, cc, invoke, opts...) } return invoke(ctx, method, args, reply, cc, opts...) } func combine(o1 []CallOption, o2 []CallOption) []CallOption { // we don't use append because o1 could have extra capacity whose // elements would be overwritten, which could cause inadvertent // sharing (and race conditions) between concurrent calls if len(o1) == 0 { return o2 } else if len(o2) == 0 { return o1 } ret := make([]CallOption, len(o1)+len(o2)) copy(ret, o1) copy(ret[len(o1):], o2) return ret } // Invoke sends the RPC request on the wire and returns after response is // received. This is typically called by generated code. // // DEPRECATED: Use ClientConn.Invoke instead. func Invoke(ctx context.Context, method string, args, reply interface{}, cc *ClientConn, opts ...CallOption) error { return cc.Invoke(ctx, method, args, reply, opts...) } var unaryStreamDesc = &StreamDesc{ServerStreams: false, ClientStreams: false} func invoke(ctx context.Context, method string, req, reply interface{}, cc *ClientConn, opts ...CallOption) error { cs, err := newClientStream(ctx, unaryStreamDesc, cc, method, opts...) if err != nil { return err } if err := cs.SendMsg(req); err != nil { return err } return cs.RecvMsg(reply) }
{ "pile_set_name": "Github" }
# Load the rails application require File.expand_path('../application', __FILE__) # Initialize the rails application Dummy::Application.initialize!
{ "pile_set_name": "Github" }
#region File Description //----------------------------------------------------------------------------- // StoreCategory.cs // // Microsoft XNA Community Game Platform // Copyright (C) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- #endregion #region Using Statements using System; using System.Collections.Generic; using Microsoft.Xna.Framework.Content; #endregion namespace RolePlayingGameData { /// <summary> /// A category of gear for sale in a store. /// </summary> public class StoreCategory { /// <summary> /// The display name of this store category. /// </summary> private string name; /// <summary> /// The display name of this store category. /// </summary> public string Name { get { return name; } set { name = value; } } /// <summary> /// The content names for the gear available in this category. /// </summary> private List<string> availableContentNames = new List<string>(); /// <summary> /// The content names for the gear available in this category. /// </summary> public List<string> AvailableContentNames { get { return availableContentNames; } set { availableContentNames = value; } } /// <summary> /// The gear available in this category. /// </summary> private List<Gear> availableGear = new List<Gear>(); /// <summary> /// The gear available in this category. /// </summary> [ContentSerializerIgnore] public List<Gear> AvailableGear { get { return availableGear; } set { availableGear = value; } } #region Content Type Reader /// <summary> /// Reads a StoreCategory object from the content pipeline. /// </summary> public class StoreCategoryReader : ContentTypeReader<StoreCategory> { /// <summary> /// Reads a StoreCategory object from the content pipeline. /// </summary> protected override StoreCategory Read(ContentReader input, StoreCategory existingInstance) { StoreCategory storeCategory = existingInstance; if (storeCategory == null) { storeCategory = new StoreCategory(); } storeCategory.Name = input.ReadString(); storeCategory.AvailableContentNames.AddRange( input.ReadObject<List<string>>()); // populate the gear list based on the content names foreach (string gearName in storeCategory.AvailableContentNames) { storeCategory.AvailableGear.Add(input.ContentManager.Load<Gear>( System.IO.Path.Combine("Gear", gearName))); } return storeCategory; } } #endregion } }
{ "pile_set_name": "Github" }
#include <global.h> s32 osEPiReadIo(OSPiHandle* handle, u32 devAddr, u32* data) { register s32 ret; __osPiGetAccess(); ret = __osEPiRawReadIo(handle, devAddr, data); __osPiRelAccess(); return ret; }
{ "pile_set_name": "Github" }
/** Copyright (c) 2015-present, Facebook, Inc. All rights reserved. This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree. */ #ifndef _LIBCAR_READER_H #define _LIBCAR_READER_H #include <car/AttributeList.h> #include <bom/bom.h> #include <ext/optional> #include <functional> #include <memory> #include <string> #include <vector> #include <unordered_map> namespace car { class Facet; class Rendition; /* * An archive within a BOM file holding facets and their renditions. */ class Reader { public: typedef std::unique_ptr<struct bom_context, decltype(&bom_free)> unique_ptr_bom; typedef std::unique_ptr<struct bom_tree_context, decltype(&bom_tree_free)> unique_ptr_bom_tree; private: typedef struct { void *key; size_t key_len; void *value; size_t value_len; } KeyValuePair; private: unique_ptr_bom _bom; ext::optional<struct car_key_format *> _keyfmt; std::unordered_map<std::string, void *> _facetValues; std::unordered_multimap<uint16_t, KeyValuePair> _renditionValues; private: Reader(unique_ptr_bom bom); public: void facetFastIterate(std::function<void(void *key, size_t key_len, void *value, size_t value_len)> const &facet) const; void renditionFastIterate(std::function<void(void *key, size_t key_len, void *value, size_t value_len)> const &iterator) const; public: /* * The BOM backing this archive. */ struct bom_context *bom() const { return _bom.get(); } /* * The key format */ struct car_key_format *keyfmt() const { return *_keyfmt; } /* * The number of Facets read */ int facetCount() const { return _facetValues.size(); } /* * The number of Renditions read */ int renditionCount() const { return _renditionValues.size(); } public: /* * Iterate all facets. */ void facetIterate(std::function<void(Facet const &)> const &facet) const; /* * Iterate all renditions. */ void renditionIterate(std::function<void(Rendition const &)> const &iterator) const; public: /* * Lookup a Facet by name */ ext::optional<car::Facet> lookupFacet(std::string name) const; /* * Lookup Rendition list for a Facet */ std::vector<car::Rendition> lookupRenditions(Facet const &) const; public: /* * Print debug information about the archive. */ void dump() const; public: /* * Load an existing archive from a BOM. */ static ext::optional<Reader> Load(unique_ptr_bom bom); }; } #endif /* _LIBCAR_READER_H */
{ "pile_set_name": "Github" }
/* * Copyright 2020. the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package group.idealworld.dew.devops.it.verify; import com.ecfront.dew.common.$; import group.idealworld.dew.devops.it.BasicProcessor; import org.junit.Assert; import java.io.File; /** * Hello world backend verify. * * @author gudaoxuri */ public class HelloWorldBackendVerify extends BasicProcessor implements Verify { @Override public void doVerify(String buildPath, String expectedResPath) throws Exception { Assert.assertTrue("exist dockerFile", new File(buildPath + "dew_release" + File.separator + "Dockerfile").exists()); Assert.assertTrue("exist run-java.sh", new File(buildPath + "dew_release" + File.separator + "run-java.sh").exists()); Assert.assertTrue("exist serv.jar", new File(buildPath + "dew_release" + File.separator + "serv.jar").exists()); Assert.assertTrue("serv.jar length > 30MB", new File(buildPath + "dew_release" + File.separator + "serv.jar").length() / 1024 / 1024 > 30); Assert.assertTrue("exist Deployment.yaml", new File(buildPath + "dew_release" + File.separator + "Deployment.yaml").exists()); Assert.assertTrue("exist Service.yaml", new File(buildPath + "dew_release" + File.separator + "Service.yaml").exists()); verifyResourceDescriptors("match Deployment.yaml", $.file.readAllByPathName(expectedResPath + "Deployment.yaml", "UTF-8"), $.file.readAllByPathName(buildPath + "dew_release" + File.separator + "Deployment.yaml", "UTF-8")); verifyResourceDescriptors("match Service.yaml", $.file.readAllByPathName(expectedResPath + "Service.yaml", "UTF-8"), $.file.readAllByPathName(buildPath + "dew_release" + File.separator + "Service.yaml", "UTF-8")); } }
{ "pile_set_name": "Github" }
/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ // THIS CODE IS GENERATED - DO NOT MODIFY // See angular/tools/gulp-tasks/cldr/extract.js export default [ [ ['فجرًا', 'صباحًا', 'ظهرًا', 'بعد الظهر', 'مساءً', 'منتصف الليل', 'ليلاً'], ['فجرا', 'ص', 'ظهرًا', 'بعد الظهر', 'مساءً', 'منتصف الليل', 'ل'], ['فجرًا', 'صباحًا', 'ظهرًا', 'بعد الظهر', 'مساءً', 'منتصف الليل', 'ليلاً'] ], [ ['فجرا', 'صباحًا', 'ظهرًا', 'بعد الظهر', 'مساءً', 'منتصف الليل', 'ليلاً'], ['فجرا', 'ص', 'ظهرًا', 'بعد الظهر', 'مساءً', 'منتصف الليل', 'ليلاً'], ['فجرًا', 'صباحًا', 'ظهرًا', 'بعد الظهر', 'مساءً', 'منتصف الليل', 'ليلاً'] ], [ ['03:00', '06:00'], ['06:00', '12:00'], ['12:00', '13:00'], ['13:00', '18:00'], ['18:00', '24:00'], ['00:00', '01:00'], ['01:00', '03:00'] ] ]; //# sourceMappingURL=ar-OM.js.map
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <!-- $Id$ --> <!-- This stylesheet extracts the FO part from the testcase so it can be passed to FOP for layout. --> <!-- Variable substitution: For any attribute value that starts with a "##" the stylesheet looks for an element with the variable name under /testcase/variables, ex. "##img" looks for /testcase/variables/img and uses its element value as subsitution value. --> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"> <xsl:template match="testcase"> <xsl:apply-templates select="fo/*" mode="copy"/> </xsl:template> <xsl:template match="node()" mode="copy"> <xsl:copy> <xsl:apply-templates select="@*|node()" mode="copy"/> </xsl:copy> </xsl:template> <xsl:template match="@*" mode="copy"> <xsl:choose> <xsl:when test="starts-with(., '##')"> <!-- variable substitution --> <xsl:variable name="nodename" select="name()"/> <xsl:variable name="varname" select="substring(., 3)"/> <xsl:choose> <xsl:when test="boolean(//variables/child::*[local-name() = $varname])"> <xsl:attribute name="{name(.)}"> <xsl:value-of select="//variables/child::*[local-name() = $varname]"/> </xsl:attribute> </xsl:when> <xsl:otherwise> <!-- if variable isn't defined, just copy --> <xsl:copy-of select="." /> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:copy-of select="." /> </xsl:otherwise> </xsl:choose> </xsl:template> </xsl:stylesheet>
{ "pile_set_name": "Github" }
--- title: Run and view insights on dashboard tiles description: As a Power BI end user, learn how to get insights about your dashboard tiles. author: mihart ms.reviewer: mihart featuredvideoid: et_MLSL2sA8 ms.service: powerbi ms.subservice: powerbi-consumer ms.topic: conceptual ms.date: 09/09/2020 ms.author: mihart # As a Power BI end user, I want to learn how to get insights about my dashboard tiles. LocalizationGroup: Dashboards --- # View data insights on dashboard tiles with Power BI [!INCLUDE[consumer-appliesto-yyny](../includes/consumer-appliesto-yyny.md)] Each visual [tile](end-user-tiles.md) on your dashboard is a doorway into data exploration. When you select a tile, it opens a report or [opens Q&A](end-user-q-and-a.md) where you can filter and sort and dig into the dataset behind the report. And when you run insights, Power BI does the data exploration for you. ![ellipsis menu mode showing View insights as an option](./media/end-user-insights/power-bi-insight.png) Run insights to generate interesting interactive visuals based on your data. Insights can be run on a specific dashboard tile and you can even run insights on an insight! The insights feature is built on a growing [set of advanced analytical algorithms](end-user-insight-types.md) developed in conjunction with Microsoft Research that we'll continue to use to allow more people to find insights in their data in new and intuitive ways. ## Run insights on a dashboard tile When you run insights on a dashboard tile, Power BI searches just the data used to create that single dashboard tile. 1. [Open a dashboard](end-user-dashboards.md). 2. Hover over a tile. select **More options** (...), and choose **View insights**. ![Screenshot showing selection of ellipsis displays dropdown](./media/end-user-insights/power-bi-hover.png) 3. The tile opens in [Focus mode](end-user-focus.md) with the insights cards displayed along the right. ![Focus mode](./media/end-user-insights/power-bi-insights-tiles.png) 4. Does one insight pique your interest? Select that insight card to dig further. The selected insight appears on the left and new insight cards, based solely on the data in that single insight, display along the right. ## Interact with the insight cards Once you have an insight open, continue exploring. * Filter the visual on the canvas. To display the filters, in the upper right corner, select the arrow to expand the Filters pane. ![insight with Filters menu expanded](./media/end-user-insights/power-bi-filter.png) * Run insights on the insight card itself. This is often referred to as **related insights**. Select an insight card to make it active. It will move to the left side of the report canvas, and new cards, based solely on the data in that single insight,will display along the right. ![Related insight and Filters menu expanded](./media/end-user-insights/power-bi-insights-card.png) To return to your report, from the upper left corner, select **Exit Focus mode**. ## Considerations and troubleshooting - **View insights** doesn't work with all dashboard tile types. For example, it is not available for Power BI custom visuals.<!--[Power BI visuals](end-user-custom-visuals.md)--> ## Next steps Run insights on report visuals [using the Analyze feature](end-user-analyze-visuals.md) Learn about the [types of Insights available](end-user-insight-types.md)
{ "pile_set_name": "Github" }
<?php class TextNodeTest extends PHPUnit_Framework_TestCase { /** @var JBBCode\TextNode */ private $_textNode; protected function setUp() { $this->_textNode = new JBBCode\TextNode(''); } public function accept() { $mock = $this->getMock('JBBCode\NodeVisitor', array('visitDocumentElement', 'visitTextNode', 'visitElementNode')); $mock->expects($this->never()) ->method('visitDocumentElement'); $mock->expects($this->once()) ->method('visitTextNode') ->with($this->equalTo($this->_textNode)); $mock->expects($this->never()) ->method('visitElementNode'); $this->_textNode->accept($mock); } public function testIsTextNode() { $this->assertTrue($this->_textNode->isTextNode()); } }
{ "pile_set_name": "Github" }
# Source Map This is a library to generate and consume the source map format [described here][format]. This library is written in the Asynchronous Module Definition format, and works in the following environments: * Modern Browsers supporting ECMAScript 5 (either after the build, or with an AMD loader such as RequireJS) * Inside Firefox (as a JSM file, after the build) * With NodeJS versions 0.8.X and higher ## Node $ npm install source-map ## Building from Source (for everywhere else) Install Node and then run $ git clone https://[email protected]/mozilla/source-map.git $ cd source-map $ npm link . Next, run $ node Makefile.dryice.js This should spew a bunch of stuff to stdout, and create the following files: * `dist/source-map.js` - The unminified browser version. * `dist/source-map.min.js` - The minified browser version. * `dist/SourceMap.jsm` - The JavaScript Module for inclusion in Firefox source. ## Examples ### Consuming a source map var rawSourceMap = { version: 3, file: 'min.js', names: ['bar', 'baz', 'n'], sources: ['one.js', 'two.js'], sourceRoot: 'http://example.com/www/js/', mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA' }; var smc = new SourceMapConsumer(rawSourceMap); console.log(smc.sources); // [ 'http://example.com/www/js/one.js', // 'http://example.com/www/js/two.js' ] console.log(smc.originalPositionFor({ line: 2, column: 28 })); // { source: 'http://example.com/www/js/two.js', // line: 2, // column: 10, // name: 'n' } console.log(smc.generatedPositionFor({ source: 'http://example.com/www/js/two.js', line: 2, column: 10 })); // { line: 2, column: 28 } smc.eachMapping(function (m) { // ... }); ### Generating a source map In depth guide: [**Compiling to JavaScript, and Debugging with Source Maps**](https://hacks.mozilla.org/2013/05/compiling-to-javascript-and-debugging-with-source-maps/) #### With SourceNode (high level API) function compile(ast) { switch (ast.type) { case 'BinaryExpression': return new SourceNode( ast.location.line, ast.location.column, ast.location.source, [compile(ast.left), " + ", compile(ast.right)] ); case 'Literal': return new SourceNode( ast.location.line, ast.location.column, ast.location.source, String(ast.value) ); // ... default: throw new Error("Bad AST"); } } var ast = parse("40 + 2", "add.js"); console.log(compile(ast).toStringWithSourceMap({ file: 'add.js' })); // { code: '40 + 2', // map: [object SourceMapGenerator] } #### With SourceMapGenerator (low level API) var map = new SourceMapGenerator({ file: "source-mapped.js" }); map.addMapping({ generated: { line: 10, column: 35 }, source: "foo.js", original: { line: 33, column: 2 }, name: "christopher" }); console.log(map.toString()); // '{"version":3,"file":"source-mapped.js","sources":["foo.js"],"names":["christopher"],"mappings":";;;;;;;;;mCAgCEA"}' ## API Get a reference to the module: // NodeJS var sourceMap = require('source-map'); // Browser builds var sourceMap = window.sourceMap; // Inside Firefox let sourceMap = {}; Components.utils.import('resource:///modules/devtools/SourceMap.jsm', sourceMap); ### SourceMapConsumer A SourceMapConsumer instance represents a parsed source map which we can query for information about the original file positions by giving it a file position in the generated source. #### new SourceMapConsumer(rawSourceMap) The only parameter is the raw source map (either as a string which can be `JSON.parse`'d, or an object). According to the spec, source maps have the following attributes: * `version`: Which version of the source map spec this map is following. * `sources`: An array of URLs to the original source files. * `names`: An array of identifiers which can be referrenced by individual mappings. * `sourceRoot`: Optional. The URL root from which all sources are relative. * `sourcesContent`: Optional. An array of contents of the original source files. * `mappings`: A string of base64 VLQs which contain the actual mappings. * `file`: Optional. The generated filename this source map is associated with. #### SourceMapConsumer.prototype.originalPositionFor(generatedPosition) Returns the original source, line, and column information for the generated source's line and column positions provided. The only argument is an object with the following properties: * `line`: The line number in the generated source. * `column`: The column number in the generated source. and an object is returned with the following properties: * `source`: The original source file, or null if this information is not available. * `line`: The line number in the original source, or null if this information is not available. * `column`: The column number in the original source, or null or null if this information is not available. * `name`: The original identifier, or null if this information is not available. #### SourceMapConsumer.prototype.generatedPositionFor(originalPosition) Returns the generated line and column information for the original source, line, and column positions provided. The only argument is an object with the following properties: * `source`: The filename of the original source. * `line`: The line number in the original source. * `column`: The column number in the original source. and an object is returned with the following properties: * `line`: The line number in the generated source, or null. * `column`: The column number in the generated source, or null. #### SourceMapConsumer.prototype.sourceContentFor(source) Returns the original source content for the source provided. The only argument is the URL of the original source file. #### SourceMapConsumer.prototype.eachMapping(callback, context, order) Iterate over each mapping between an original source/line/column and a generated line/column in this source map. * `callback`: The function that is called with each mapping. Mappings have the form `{ source, generatedLine, generatedColumn, originalLine, originalColumn, name }` * `context`: Optional. If specified, this object will be the value of `this` every time that `callback` is called. * `order`: Either `SourceMapConsumer.GENERATED_ORDER` or `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to iterate over the mappings sorted by the generated file's line/column order or the original's source/line/column order, respectively. Defaults to `SourceMapConsumer.GENERATED_ORDER`. ### SourceMapGenerator An instance of the SourceMapGenerator represents a source map which is being built incrementally. #### new SourceMapGenerator([startOfSourceMap]) You may pass an object with the following properties: * `file`: The filename of the generated source that this source map is associated with. * `sourceRoot`: A root for all relative URLs in this source map. #### SourceMapGenerator.fromSourceMap(sourceMapConsumer) Creates a new SourceMapGenerator based on a SourceMapConsumer * `sourceMapConsumer` The SourceMap. #### SourceMapGenerator.prototype.addMapping(mapping) Add a single mapping from original source line and column to the generated source's line and column for this source map being created. The mapping object should have the following properties: * `generated`: An object with the generated line and column positions. * `original`: An object with the original line and column positions. * `source`: The original source file (relative to the sourceRoot). * `name`: An optional original token name for this mapping. #### SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent) Set the source content for an original source file. * `sourceFile` the URL of the original source file. * `sourceContent` the content of the source file. #### SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]]) Applies a SourceMap for a source file to the SourceMap. Each mapping to the supplied source file is rewritten using the supplied SourceMap. Note: The resolution for the resulting mappings is the minimium of this map and the supplied map. * `sourceMapConsumer`: The SourceMap to be applied. * `sourceFile`: Optional. The filename of the source file. If omitted, sourceMapConsumer.file will be used, if it exists. Otherwise an error will be thrown. * `sourceMapPath`: Optional. The dirname of the path to the SourceMap to be applied. If relative, it is relative to the SourceMap. This parameter is needed when the two SourceMaps aren't in the same directory, and the SourceMap to be applied contains relative source paths. If so, those relative source paths need to be rewritten relative to the SourceMap. If omitted, it is assumed that both SourceMaps are in the same directory, thus not needing any rewriting. (Supplying `'.'` has the same effect.) #### SourceMapGenerator.prototype.toString() Renders the source map being generated to a string. ### SourceNode SourceNodes provide a way to abstract over interpolating and/or concatenating snippets of generated JavaScript source code, while maintaining the line and column information associated between those snippets and the original source code. This is useful as the final intermediate representation a compiler might use before outputting the generated JS and source map. #### new SourceNode([line, column, source[, chunk[, name]]]) * `line`: The original line number associated with this source node, or null if it isn't associated with an original line. * `column`: The original column number associated with this source node, or null if it isn't associated with an original column. * `source`: The original source's filename; null if no filename is provided. * `chunk`: Optional. Is immediately passed to `SourceNode.prototype.add`, see below. * `name`: Optional. The original identifier. #### SourceNode.fromStringWithSourceMap(code, sourceMapConsumer) Creates a SourceNode from generated code and a SourceMapConsumer. * `code`: The generated code * `sourceMapConsumer` The SourceMap for the generated code #### SourceNode.prototype.add(chunk) Add a chunk of generated JS to this source node. * `chunk`: A string snippet of generated JS code, another instance of `SourceNode`, or an array where each member is one of those things. #### SourceNode.prototype.prepend(chunk) Prepend a chunk of generated JS to this source node. * `chunk`: A string snippet of generated JS code, another instance of `SourceNode`, or an array where each member is one of those things. #### SourceNode.prototype.setSourceContent(sourceFile, sourceContent) Set the source content for a source file. This will be added to the `SourceMap` in the `sourcesContent` field. * `sourceFile`: The filename of the source file * `sourceContent`: The content of the source file #### SourceNode.prototype.walk(fn) Walk over the tree of JS snippets in this node and its children. The walking function is called once for each snippet of JS and is passed that snippet and the its original associated source's line/column location. * `fn`: The traversal function. #### SourceNode.prototype.walkSourceContents(fn) Walk over the tree of SourceNodes. The walking function is called for each source file content and is passed the filename and source content. * `fn`: The traversal function. #### SourceNode.prototype.join(sep) Like `Array.prototype.join` except for SourceNodes. Inserts the separator between each of this source node's children. * `sep`: The separator. #### SourceNode.prototype.replaceRight(pattern, replacement) Call `String.prototype.replace` on the very right-most source snippet. Useful for trimming whitespace from the end of a source node, etc. * `pattern`: The pattern to replace. * `replacement`: The thing to replace the pattern with. #### SourceNode.prototype.toString() Return the string representation of this source node. Walks over the tree and concatenates all the various snippets together to one string. ### SourceNode.prototype.toStringWithSourceMap([startOfSourceMap]) Returns the string representation of this tree of source nodes, plus a SourceMapGenerator which contains all the mappings between the generated and original sources. The arguments are the same as those to `new SourceMapGenerator`. ## Tests [![Build Status](https://travis-ci.org/mozilla/source-map.png?branch=master)](https://travis-ci.org/mozilla/source-map) Install NodeJS version 0.8.0 or greater, then run `node test/run-tests.js`. To add new tests, create a new file named `test/test-<your new test name>.js` and export your test functions with names that start with "test", for example exports["test doing the foo bar"] = function (assert, util) { ... }; The new test will be located automatically when you run the suite. The `util` argument is the test utility module located at `test/source-map/util`. The `assert` argument is a cut down version of node's assert module. You have access to the following assertion functions: * `doesNotThrow` * `equal` * `ok` * `strictEqual` * `throws` (The reason for the restricted set of test functions is because we need the tests to run inside Firefox's test suite as well and so the assert module is shimmed in that environment. See `build/assert-shim.js`.) [format]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit [feature]: https://wiki.mozilla.org/DevTools/Features/SourceMap [Dryice]: https://github.com/mozilla/dryice
{ "pile_set_name": "Github" }
<?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Wireless\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CommandPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return CommandInstance \Twilio\Rest\Wireless\V1\CommandInstance */ public function buildInstance(array $payload): CommandInstance { return new CommandInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Wireless.V1.CommandPage]'; } }
{ "pile_set_name": "Github" }
{ "Name": "HDG-Mixed-Poisson coupled with an OpenModelica circuit model", "ShortName":"MP_LC", "Models": { "equations":"hdg"}, "Materials": { "omega": { "name":"simulation_domain", "k":"1" } }, "BoundaryConditions": { "potential": { "InitialSolution": { "omega": { "expr":"-3*x*x*(10-t):x:t" } }, "SourceTerm": { "omega": { "expr":"3*x*x+6*1*(10-t):x:y:t" } }, "Dirichlet": { "top": { "expr":"-3*x*x*(10-t):x:t" }, "bottom": { "expr":"-3*x*x*(10-t):x:t" } }, "Neumann": { "lateral": { "expr":"0.0" } } }, "Exact solution": { "p_exact": { "omega": { "expr":"-3*x*x*(10-t):x:t" } } } }, "PostProcess": { "Exports": { "fields":["potential","flux"] } } }
{ "pile_set_name": "Github" }
/* * * Copyright 2017 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #ifndef GRPC_CORE_EXT_TRANSPORT_INPROC_INPROC_TRANSPORT_H #define GRPC_CORE_EXT_TRANSPORT_INPROC_INPROC_TRANSPORT_H #include "src/core/lib/transport/transport_impl.h" #ifdef __cplusplus extern "C" { #endif grpc_channel *grpc_inproc_channel_create(grpc_server *server, grpc_channel_args *args, void *reserved); extern grpc_tracer_flag grpc_inproc_trace; void grpc_inproc_transport_init(void); void grpc_inproc_transport_shutdown(void); #ifdef __cplusplus } #endif #endif /* GRPC_CORE_EXT_TRANSPORT_INPROC_INPROC_TRANSPORT_H */
{ "pile_set_name": "Github" }
// // SectionModelType.swift // RxDataSources // // Created by Krunoslav Zaher on 6/28/15. // Copyright © 2015 Krunoslav Zaher. All rights reserved. // import Foundation public protocol SectionModelType { associatedtype Item var items: [Item] { get } init(original: Self, items: [Item]) }
{ "pile_set_name": "Github" }
/* Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ CKEDITOR.plugins.setLang("uicolor","lv",{title:"UI krāsas izvēle",options:"Color Options",highlight:"Highlight",selected:"Selected Color",predefined:"Predefinēti krāsu komplekti",config:"Ielīmējiet šo rindu jūsu config.js failā"});
{ "pile_set_name": "Github" }
/******************************************************************************* * Copyright (c) 2019 Eclipse RDF4J contributors. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Distribution License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/org/documents/edl-v10.php. *******************************************************************************/ package org.eclipse.rdf4j.federated.endpoint; /** * Classify endpoints into remote or local ones. * * @author Andreas Schwarte */ public enum EndpointClassification { Local, Remote; }
{ "pile_set_name": "Github" }
require_relative '../../spec_helper' require_relative 'shared/getgm' describe "Time#getgm" do it_behaves_like :time_getgm, :getgm end
{ "pile_set_name": "Github" }
/* Copyright (C) 1994-1995 Apogee Software, Ltd. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /********************************************************************** module: PAS16.C author: James R. Dose date: March 27, 1994 Low level routines to support Pro AudioSpectrum and compatible sound cards. (c) Copyright 1994 James R. Dose. All Rights Reserved. **********************************************************************/ #include <dos.h> #include <conio.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include "dpmi.h" #include "dma.h" #include "interrup.h" #include "irq.h" #include "pas16.h" #include "_pas16.h" #define USESTACK static const int PAS_Interrupts[ PAS_MaxIrq + 1 ] = { INVALID, INVALID, 0xa, 0xb, INVALID, 0xd, INVALID, 0xf, INVALID, INVALID, 0x72, 0x73, 0x74, INVALID, INVALID, 0x77 }; static void ( interrupt far *PAS_OldInt )( void ); static int PAS_IntController1Mask; static int PAS_IntController2Mask; static int PAS_Installed = FALSE; static int PAS_TranslateCode = DEFAULT_BASE; static int PAS_OriginalPCMLeftVolume = 75; static int PAS_OriginalPCMRightVolume = 75; static int PAS_OriginalFMLeftVolume = 75; static int PAS_OriginalFMRightVolume = 75; unsigned int PAS_DMAChannel; static int PAS_Irq; static MVState *PAS_State = NULL; static MVFunc *PAS_Func = NULL; static MVState PAS_OriginalState; static int PAS_SampleSizeConfig; static char *PAS_DMABuffer; static char *PAS_DMABufferEnd; static char *PAS_CurrentDMABuffer; static int PAS_TotalDMABufferSize; static int PAS_TransferLength = 0; static int PAS_MixMode = PAS_DefaultMixMode; static unsigned PAS_SampleRate = PAS_DefaultSampleRate; static int PAS_TimeInterval = 0; volatile int PAS_SoundPlaying; void ( *PAS_CallBack )( void ); // adequate stack size #define kStackSize 2048 static unsigned short StackSelector = NULL; static unsigned long StackPointer; static unsigned short oldStackSelector; static unsigned long oldStackPointer; // This is defined because we can't create local variables in a // function that switches stacks. static int irqstatus; // These declarations are necessary to use the inline assembly pragmas. extern void GetStack(unsigned short *selptr,unsigned long *stackptr); extern void SetStack(unsigned short selector,unsigned long stackptr); // This function will get the current stack selector and pointer and save // them off. #pragma aux GetStack = \ "mov [edi],esp" \ "mov ax,ss" \ "mov [esi],ax" \ parm [esi] [edi] \ modify [eax esi edi]; // This function will set the stack selector and pointer to the specified // values. #pragma aux SetStack = \ "mov ss,ax" \ "mov esp,edx" \ parm [ax] [edx] \ modify [eax edx]; int PAS_ErrorCode = PAS_Ok; #define PAS_SetErrorCode( status ) \ PAS_ErrorCode = ( status ); /*--------------------------------------------------------------------- Function: PAS_ErrorString Returns a pointer to the error message associated with an error number. A -1 returns a pointer the current error. ---------------------------------------------------------------------*/ char *PAS_ErrorString ( int ErrorNumber ) { char *ErrorString; switch( ErrorNumber ) { case PAS_Warning : case PAS_Error : ErrorString = PAS_ErrorString( PAS_ErrorCode ); break; case PAS_Ok : ErrorString = "Pro AudioSpectrum ok."; break; case PAS_DriverNotFound : ErrorString = "MVSOUND.SYS not loaded."; break; case PAS_DmaError : ErrorString = DMA_ErrorString( DMA_Error ); break; case PAS_InvalidIrq : ErrorString = "Invalid Pro AudioSpectrum Irq."; break; case PAS_UnableToSetIrq : ErrorString = "Unable to set Pro AudioSpectrum IRQ. Try selecting an IRQ of 7 or below."; break; case PAS_Dos4gwIrqError : ErrorString = "Unsupported Pro AudioSpectrum Irq."; break; case PAS_NoSoundPlaying : ErrorString = "No sound playing on Pro AudioSpectrum."; break; case PAS_CardNotFound : ErrorString = "Could not find Pro AudioSpectrum."; break; case PAS_DPMI_Error : ErrorString = "DPMI Error in PAS16."; break; case PAS_OutOfMemory : ErrorString = "Out of conventional memory in PAS16."; break; default : ErrorString = "Unknown Pro AudioSpectrum error code."; break; } return( ErrorString ); } /********************************************************************** Memory locked functions: **********************************************************************/ #define PAS_LockStart PAS_CheckForDriver /*--------------------------------------------------------------------- Function: PAS_CheckForDriver Checks to see if MVSOUND.SYS is installed. ---------------------------------------------------------------------*/ int PAS_CheckForDriver ( void ) { union REGS regs; unsigned result; regs.w.ax = MV_CheckForDriver; regs.w.bx = 0x3f3f; #ifdef __386__ int386( MV_SoundInt, &regs, &regs ); #else int86( MV_SoundInt, &regs, &regs ); #endif if ( regs.w.ax != MV_CheckForDriver ) { PAS_SetErrorCode( PAS_DriverNotFound ); return( PAS_Error ); } result = regs.w.bx ^ regs.w.cx ^ regs.w.dx; if ( result != MV_Signature ) { PAS_SetErrorCode( PAS_DriverNotFound ); return( PAS_Error ); } return( PAS_Ok ); } /*--------------------------------------------------------------------- Function: PAS_GetStateTable Returns a pointer to the state table containing hardware state information. The state table is necessary because the Pro Audio- Spectrum contains only write-only registers. ---------------------------------------------------------------------*/ MVState *PAS_GetStateTable ( void ) { union REGS regs; MVState *ptr; regs.w.ax = MV_GetPointerToStateTable; #ifdef __386__ int386( MV_SoundInt, &regs, &regs ); #else int86( MV_SoundInt, &regs, &regs ); #endif if ( regs.w.ax != MV_Signature ) { PAS_SetErrorCode( PAS_DriverNotFound ); return( NULL ); } #if defined(__WATCOMC__) && defined(__FLAT__) ptr = ( MVState * )( ( ( ( unsigned )regs.w.dx ) << 4 ) + ( ( unsigned )regs.w.bx ) ); #else ptr = MK_FP( regs.w.dx, regs.w.bx ); #endif return( ptr ); } /*--------------------------------------------------------------------- Function: PAS_GetFunctionTable Returns a pointer to the function table containing addresses of driver functions. ---------------------------------------------------------------------*/ MVFunc *PAS_GetFunctionTable ( void ) { union REGS regs; MVFunc *ptr; regs.w.ax = MV_GetPointerToFunctionTable; #ifdef __386__ int386( MV_SoundInt, &regs, &regs ); #else int86( MV_SoundInt, &regs, &regs ); #endif if ( regs.w.ax != MV_Signature ) { PAS_SetErrorCode( PAS_DriverNotFound ); return( NULL ); } #if defined(__WATCOMC__) && defined(__FLAT__) ptr = ( MVFunc * )( ( ( ( unsigned )regs.w.dx ) << 4 ) + ( ( unsigned )regs.w.bx ) ); #else ptr = MK_FP( regs.w.dx, regs.w.bx ); #endif return( ptr ); } /*--------------------------------------------------------------------- Function: PAS_GetCardSettings Returns the DMA and the IRQ channels of the sound card. ---------------------------------------------------------------------*/ int PAS_GetCardSettings ( void ) { union REGS regs; int status; regs.w.ax = MV_GetDmaIrqInt; #ifdef __386__ int386( MV_SoundInt, &regs, &regs ); #else int86( MV_SoundInt, &regs, &regs ); #endif if ( regs.w.ax != MV_Signature ) { PAS_SetErrorCode( PAS_DriverNotFound ); return( PAS_Error ); } PAS_DMAChannel = regs.w.bx; PAS_Irq = regs.w.cx; if ( PAS_Irq > PAS_MaxIrq ) { PAS_SetErrorCode( PAS_Dos4gwIrqError ); return( PAS_Error ); } if ( !VALID_IRQ( PAS_Irq ) ) { PAS_SetErrorCode( PAS_InvalidIrq ); return( PAS_Error ); } if ( PAS_Interrupts[ PAS_Irq ] == INVALID ) { PAS_SetErrorCode( PAS_InvalidIrq ); return( PAS_Error ); } status = DMA_VerifyChannel( PAS_DMAChannel ); if ( status == DMA_Error ) { PAS_SetErrorCode( PAS_DmaError ); return( PAS_Error ); } return( PAS_Ok ); } /*--------------------------------------------------------------------- Function: PAS_EnableInterrupt Enables the triggering of the sound card interrupt. ---------------------------------------------------------------------*/ void PAS_EnableInterrupt ( void ) { int mask; int data; unsigned flags; flags = DisableInterrupts(); if ( PAS_Irq < 8 ) { mask = inp( 0x21 ) & ~( 1 << PAS_Irq ); outp( 0x21, mask ); } else { mask = inp( 0xA1 ) & ~( 1 << ( PAS_Irq - 8 ) ); outp( 0xA1, mask ); mask = inp( 0x21 ) & ~( 1 << 2 ); outp( 0x21, mask ); } // Flush any pending interrupts PAS_Write( InterruptStatus, PAS_Read( InterruptStatus ) & 0x40 ); // Enable the interrupt on the PAS data = PAS_State->intrctlr; data |= SampleBufferInterruptFlag; PAS_Write( InterruptControl, data ); PAS_State->intrctlr = data; RestoreInterrupts( flags ); } /*--------------------------------------------------------------------- Function: PAS_DisableInterrupt Disables the triggering of the sound card interrupt. ---------------------------------------------------------------------*/ void PAS_DisableInterrupt ( void ) { int mask; int data; unsigned flags; flags = DisableInterrupts(); // Disable the interrupt on the PAS data = PAS_State->intrctlr; data &= ~( SampleRateInterruptFlag | SampleBufferInterruptFlag ); PAS_Write( InterruptControl, data ); PAS_State->intrctlr = data; // Restore interrupt mask if ( PAS_Irq < 8 ) { mask = inp( 0x21 ) & ~( 1 << PAS_Irq ); mask |= PAS_IntController1Mask & ( 1 << PAS_Irq ); outp( 0x21, mask ); } else { mask = inp( 0x21 ) & ~( 1 << 2 ); mask |= PAS_IntController1Mask & ( 1 << 2 ); outp( 0x21, mask ); mask = inp( 0xA1 ) & ~( 1 << ( PAS_Irq - 8 ) ); mask |= PAS_IntController2Mask & ( 1 << ( PAS_Irq - 8 ) ); outp( 0xA1, mask ); } RestoreInterrupts( flags ); } /*--------------------------------------------------------------------- Function: PAS_ServiceInterrupt Handles interrupt generated by sound card at the end of a voice transfer. Calls the user supplied callback function. ---------------------------------------------------------------------*/ void interrupt far PAS_ServiceInterrupt ( void ) { #ifdef USESTACK // save stack GetStack( &oldStackSelector, &oldStackPointer ); // set our stack SetStack( StackSelector, StackPointer ); #endif irqstatus = PAS_Read( InterruptStatus ); if ( ( irqstatus & SampleBufferInterruptFlag ) == 0 ) { #ifdef USESTACK // restore stack SetStack( oldStackSelector, oldStackPointer ); #endif _chain_intr( PAS_OldInt ); } // Clear the interrupt irqstatus &= ~SampleBufferInterruptFlag; PAS_Write( InterruptStatus, irqstatus ); // send EOI to Interrupt Controller if ( PAS_Irq > 7 ) { outp( 0xA0, 0x20 ); } outp( 0x20, 0x20 ); // Keep track of current buffer PAS_CurrentDMABuffer += PAS_TransferLength; if ( PAS_CurrentDMABuffer >= PAS_DMABufferEnd ) { PAS_CurrentDMABuffer = PAS_DMABuffer; } // Call the caller's callback function if ( PAS_CallBack != NULL ) { PAS_CallBack(); } #ifdef USESTACK // restore stack SetStack( oldStackSelector, oldStackPointer ); #endif } /*--------------------------------------------------------------------- Function: PAS_Write Writes a byte of data to the sound card. ---------------------------------------------------------------------*/ void PAS_Write ( int Register, int Data ) { int port; port = Register ^ PAS_TranslateCode; outp( port, Data ); } /*--------------------------------------------------------------------- Function: PAS_Read Reads a byte of data from the sound card. ---------------------------------------------------------------------*/ int PAS_Read ( int Register ) { int port; int data; port = Register ^ PAS_TranslateCode; data = inp( port ); return( data ); } /*--------------------------------------------------------------------- Function: PAS_SetSampleRateTimer Programs the Sample Rate Timer. ---------------------------------------------------------------------*/ void PAS_SetSampleRateTimer ( void ) { int LoByte; int HiByte; int data; unsigned flags; flags = DisableInterrupts(); // Disable the Sample Rate Timer data = PAS_State->audiofilt; data &= ~SampleRateTimerGateFlag; PAS_Write( AudioFilterControl, data ); PAS_State->audiofilt = data; // Select the Sample Rate Timer data = SelectSampleRateTimer; PAS_Write( LocalTimerControl, data ); PAS_State->tmrctlr = data; LoByte = lobyte( PAS_TimeInterval ); HiByte = hibyte( PAS_TimeInterval ); // Program the Sample Rate Timer PAS_Write( SampleRateTimer, LoByte ); PAS_Write( SampleRateTimer, HiByte ); PAS_State->samplerate = PAS_TimeInterval; RestoreInterrupts( flags ); } /*--------------------------------------------------------------------- Function: PAS_SetSampleBufferCount Programs the Sample Buffer Count. ---------------------------------------------------------------------*/ void PAS_SetSampleBufferCount ( void ) { int LoByte; int HiByte; int count; int data; unsigned flags; flags = DisableInterrupts(); // Disable the Sample Buffer Count data = PAS_State->audiofilt; data &= ~SampleBufferCountGateFlag; PAS_Write( AudioFilterControl, data ); PAS_State->audiofilt = data; // Select the Sample Buffer Count data = SelectSampleBufferCount; PAS_Write( LocalTimerControl, data ); PAS_State->tmrctlr = data; count = PAS_TransferLength; // Check if we're using a 16-bit DMA channel if ( PAS_DMAChannel > 3 ) { count >>= 1; } LoByte = lobyte( count ); HiByte = hibyte( count ); // Program the Sample Buffer Count PAS_Write( SampleBufferCount, LoByte ); PAS_Write( SampleBufferCount, HiByte ); PAS_State->samplecnt = count; RestoreInterrupts( flags ); } /*--------------------------------------------------------------------- Function: PAS_SetPlaybackRate Sets the rate at which the digitized sound will be played in hertz. ---------------------------------------------------------------------*/ void PAS_SetPlaybackRate ( unsigned rate ) { if ( rate < PAS_MinSamplingRate ) { rate = PAS_MinSamplingRate; } if ( rate > PAS_MaxSamplingRate ) { rate = PAS_MaxSamplingRate; } PAS_TimeInterval = ( unsigned )CalcTimeInterval( rate ); if ( PAS_MixMode & STEREO ) { PAS_TimeInterval /= 2; } // Keep track of what the actual rate is PAS_SampleRate = CalcSamplingRate( PAS_TimeInterval ); if ( PAS_MixMode & STEREO ) { PAS_SampleRate /= 2; } } /*--------------------------------------------------------------------- Function: PAS_GetPlaybackRate Returns the rate at which the digitized sound will be played in hertz. ---------------------------------------------------------------------*/ unsigned PAS_GetPlaybackRate ( void ) { return( PAS_SampleRate ); } /*--------------------------------------------------------------------- Function: PAS_SetMixMode Sets the sound card to play samples in mono or stereo. ---------------------------------------------------------------------*/ int PAS_SetMixMode ( int mode ) { mode &= PAS_MaxMixMode; // Check board revision. Revision # 0 can't play 16-bit data. if ( ( PAS_State->intrctlr & 0xe0 ) == 0 ) { // Force the mode to 8-bit data. mode &= ~SIXTEEN_BIT; } PAS_MixMode = mode; PAS_SetPlaybackRate( PAS_SampleRate ); return( mode ); } /*--------------------------------------------------------------------- Function: PAS_StopPlayback Ends the DMA transfer of digitized sound to the sound card. ---------------------------------------------------------------------*/ void PAS_StopPlayback ( void ) { int data; // Don't allow anymore interrupts PAS_DisableInterrupt(); // Stop the transfer of digital data data = PAS_State->crosschannel; data &= PAS_PCMStopMask; PAS_Write( CrossChannelControl, data ); PAS_State->crosschannel = data; // Turn off 16-bit unsigned data data = PAS_Read( SampleSizeConfiguration ); data &= PAS_SampleSizeMask; PAS_Write( SampleSizeConfiguration, data ); // Disable the DMA channel DMA_EndTransfer( PAS_DMAChannel ); PAS_SoundPlaying = FALSE; PAS_DMABuffer = NULL; } /*--------------------------------------------------------------------- Function: PAS_SetupDMABuffer Programs the DMAC for sound transfer. ---------------------------------------------------------------------*/ int PAS_SetupDMABuffer ( char *BufferPtr, int BufferSize, int mode ) { int DmaStatus; int data; // Enable PAS Dma data = PAS_State->crosschannel; data |= PAS_DMAEnable; PAS_Write( CrossChannelControl, data ); PAS_State->crosschannel = data; DmaStatus = DMA_SetupTransfer( PAS_DMAChannel, BufferPtr, BufferSize, mode ); if ( DmaStatus == DMA_Error ) { PAS_SetErrorCode( PAS_DmaError ); return( PAS_Error ); } PAS_DMABuffer = BufferPtr; PAS_CurrentDMABuffer = BufferPtr; PAS_TotalDMABufferSize = BufferSize; PAS_DMABufferEnd = BufferPtr + BufferSize; return( PAS_Ok ); } /*--------------------------------------------------------------------- Function: PAS_GetCurrentPos Returns the offset within the current sound being played. ---------------------------------------------------------------------*/ int PAS_GetCurrentPos ( void ) { char *CurrentAddr; int offset; if ( !PAS_SoundPlaying ) { PAS_SetErrorCode( PAS_NoSoundPlaying ); return( PAS_Error ); } CurrentAddr = DMA_GetCurrentPos( PAS_DMAChannel ); if ( CurrentAddr == NULL ) { PAS_SetErrorCode( PAS_DmaError ); return( PAS_Error ); } offset = ( int )( ( ( unsigned long )CurrentAddr ) - ( ( unsigned long )PAS_CurrentDMABuffer ) ); if ( PAS_MixMode & SIXTEEN_BIT ) { offset >>= 1; } if ( PAS_MixMode & STEREO ) { offset >>= 1; } return( offset ); } /*--------------------------------------------------------------------- Function: PAS_GetFilterSetting Returns the bit settings for the appropriate filter level. ---------------------------------------------------------------------*/ int PAS_GetFilterSetting ( int rate ) { /* CD Quality 17897hz */ if ( ( unsigned long )rate > ( unsigned long )17897L * 2 ) { /* 00001b 20hz to 17.8khz */ return( 0x01 ); } /* Cassette Quality 15090hz */ if ( ( unsigned long )rate > ( unsigned long )15909L * 2 ) { /* 00010b 20hz to 15.9khz */ return( 0x02 ); } /* FM Radio Quality 11931hz */ if ( ( unsigned long )rate > ( unsigned long )11931L * 2 ) { /* 01001b 20hz to 11.9khz */ return( 0x09 ); } /* AM Radio Quality 8948hz */ if ( ( unsigned long )rate > ( unsigned long )8948L * 2 ) { /* 10001b 20hz to 8.9khz */ return( 0x11 ); } /* Telphone Quality 5965hz */ if ( ( unsigned long )rate > ( unsigned long )5965L * 2 ) { /* 00100b 20hz to 5.9khz */ return( 0x19 ); } /* Male voice quality 2982hz */ /* 111001b 20hz to 2.9khz */ return( 0x04 ); } /*--------------------------------------------------------------------- Function: PAS_BeginTransfer Starts playback of digitized sound on the sound card. ---------------------------------------------------------------------*/ void PAS_BeginTransfer ( int mode ) { int data; PAS_SetSampleRateTimer(); PAS_SetSampleBufferCount(); PAS_EnableInterrupt(); // Get sample size configuration data = PAS_Read( SampleSizeConfiguration ); // Check board revision. Revision # 0 can't play 16-bit data. if ( PAS_State->intrctlr & 0xe0 ) { data &= PAS_SampleSizeMask; // set sample size bit if ( PAS_MixMode & SIXTEEN_BIT ) { data |= PAS_16BitSampleFlag; } } // set oversampling rate data &= PAS_OverSamplingMask; data |= PAS_4xOverSampling; // Set sample size configuration PAS_Write( SampleSizeConfiguration, data ); // Get Cross channel setting data = PAS_State->crosschannel; data &= PAS_ChannelConnectMask; if ( mode == RECORD ) { data |= PAS_PCMStartADC; } else { data |= PAS_PCMStartDAC; } // set stereo mode bit if ( !( PAS_MixMode & STEREO ) ) { data |= PAS_StereoFlag; } PAS_Write( CrossChannelControl, data ); PAS_State->crosschannel = data; // Get the filter appropriate filter setting data = PAS_GetFilterSetting( PAS_SampleRate ); // Enable the Sample Rate Timer and Sample Buffer Count data |= SampleRateTimerGateFlag | SampleBufferCountGateFlag; if ( mode != RECORD ) { // Enable audio (not Audio Mute) data |= PAS_AudioMuteFlag; } PAS_Write( AudioFilterControl, data ); PAS_State->audiofilt = data; PAS_SoundPlaying = TRUE; } /*--------------------------------------------------------------------- Function: PAS_BeginBufferedPlayback Begins multibuffered playback of digitized sound on the sound card. ---------------------------------------------------------------------*/ int PAS_BeginBufferedPlayback ( char *BufferStart, int BufferSize, int NumDivisions, unsigned SampleRate, int MixMode, void ( *CallBackFunc )( void ) ) { int DmaStatus; PAS_StopPlayback(); PAS_SetMixMode( MixMode ); PAS_SetPlaybackRate( SampleRate ); PAS_TransferLength = BufferSize / NumDivisions; PAS_SetCallBack( CallBackFunc ); DmaStatus = PAS_SetupDMABuffer( BufferStart, BufferSize, DMA_AutoInitRead ); if ( DmaStatus == PAS_Error ) { return( PAS_Error ); } PAS_BeginTransfer( PLAYBACK ); return( PAS_Ok ); } /*--------------------------------------------------------------------- Function: PAS_BeginBufferedRecord Begins multibuffered recording of digitized sound on the sound card. ---------------------------------------------------------------------*/ int PAS_BeginBufferedRecord ( char *BufferStart, int BufferSize, int NumDivisions, unsigned SampleRate, int MixMode, void ( *CallBackFunc )( void ) ) { int DmaStatus; PAS_StopPlayback(); PAS_SetMixMode( MixMode ); PAS_SetPlaybackRate( SampleRate ); PAS_TransferLength = BufferSize / NumDivisions; PAS_SetCallBack( CallBackFunc ); DmaStatus = PAS_SetupDMABuffer( BufferStart, BufferSize, DMA_AutoInitWrite ); if ( DmaStatus == PAS_Error ) { return( PAS_Error ); } PAS_BeginTransfer( RECORD ); return( PAS_Ok ); } /*--------------------------------------------------------------------- Function: PAS_CallInt Calls interrupt 2fh. ---------------------------------------------------------------------*/ int PAS_CallInt( int ebx, int ecx, int edx ); #pragma aux PAS_CallInt = \ "int 2fh", \ parm [ ebx ] [ ecx ] [ edx ] modify exact [ eax ebx ecx edx esi edi ] value [ ebx ]; /*--------------------------------------------------------------------- Function: PAS_CallMVFunction Performs a call to a real mode function. ---------------------------------------------------------------------*/ int PAS_CallMVFunction ( unsigned long function, int ebx, int ecx, int edx ) { dpmi_regs callregs; int status; callregs.EBX = ebx; callregs.ECX = ecx; callregs.EDX = edx; callregs.SS = 0; callregs.SP = 0; callregs.DS = 0; callregs.ES = 0; callregs.FS = 0; callregs.GS = 0; callregs.IP = function; callregs.CS = function >> 16; status = DPMI_CallRealModeFunction( &callregs ); if ( status != DPMI_Ok ) { return( PAS_Error ); } return( callregs.EBX & 0xff ); } /*--------------------------------------------------------------------- Function: PAS_SetPCMVolume Sets the volume of digitized sound playback. ---------------------------------------------------------------------*/ int PAS_SetPCMVolume ( int volume ) { int status; volume = max( 0, volume ); volume = min( volume, 255 ); volume *= 100; volume /= 255; status = PAS_CallMVFunction( PAS_Func->SetMixer, volume, OUTPUTMIXER, L_PCM ); if ( status == PAS_Error ) { return( status ); } status = PAS_CallMVFunction( PAS_Func->SetMixer, volume, OUTPUTMIXER, R_PCM ); if ( status == PAS_Error ) { return( status ); } return( PAS_Ok ); } /*--------------------------------------------------------------------- Function: PAS_GetPCMVolume Returns the current volume of digitized sound playback. ---------------------------------------------------------------------*/ int PAS_GetPCMVolume ( void ) { int leftvolume; int rightvolume; int totalvolume; if ( PAS_Func == NULL ) { return( PAS_Error ); } leftvolume = PAS_CallMVFunction( PAS_Func->GetMixer, 0, OUTPUTMIXER, L_PCM ); rightvolume = PAS_CallMVFunction( PAS_Func->GetMixer, 0, OUTPUTMIXER, R_PCM ); if ( ( leftvolume == PAS_Error ) || ( rightvolume == PAS_Error ) ) { return( PAS_Error ); } leftvolume &= 0xff; rightvolume &= 0xff; totalvolume = ( rightvolume + leftvolume ) / 2; totalvolume *= 255; totalvolume /= 100; return( totalvolume ); } /*--------------------------------------------------------------------- Function: PAS_SetFMVolume Sets the volume of FM sound playback. ---------------------------------------------------------------------*/ void PAS_SetFMVolume ( int volume ) { volume = max( 0, volume ); volume = min( volume, 255 ); volume *= 100; volume /= 255; if ( PAS_Func ) { PAS_CallMVFunction( PAS_Func->SetMixer, volume, OUTPUTMIXER, L_FM ); PAS_CallMVFunction( PAS_Func->SetMixer, volume, OUTPUTMIXER, R_FM ); } } /*--------------------------------------------------------------------- Function: PAS_GetFMVolume Returns the current volume of FM sound playback. ---------------------------------------------------------------------*/ int PAS_GetFMVolume ( void ) { int leftvolume; int rightvolume; int totalvolume; if ( PAS_Func == NULL ) { return( 255 ); } leftvolume = PAS_CallMVFunction( PAS_Func->GetMixer, 0, OUTPUTMIXER, L_FM ) & 0xff; rightvolume = PAS_CallMVFunction( PAS_Func->GetMixer, 0, OUTPUTMIXER, R_FM ) & 0xff; totalvolume = ( rightvolume + leftvolume ) / 2; totalvolume *= 255; totalvolume /= 100; totalvolume = min( 255, totalvolume ); return( totalvolume ); } /*--------------------------------------------------------------------- Function: PAS_GetCardInfo Returns the maximum number of bits that can represent a sample (8 or 16) and the number of channels (1 for mono, 2 for stereo). ---------------------------------------------------------------------*/ int PAS_GetCardInfo ( int *MaxSampleBits, int *MaxChannels ) { int status; if ( PAS_State == NULL ) { status = PAS_CheckForDriver(); if ( status != PAS_Ok ) { return( status ); } PAS_State = PAS_GetStateTable(); if ( PAS_State == NULL ) { return( PAS_Error ); } } *MaxChannels = 2; // Check board revision. Revision # 0 can't play 16-bit data. if ( ( PAS_State->intrctlr & 0xe0 ) == 0 ) { *MaxSampleBits = 8; } else { *MaxSampleBits = 16; } return( PAS_Ok ); } /*--------------------------------------------------------------------- Function: PAS_SetCallBack Specifies the user function to call at the end of a sound transfer. ---------------------------------------------------------------------*/ void PAS_SetCallBack ( void ( *func )( void ) ) { PAS_CallBack = func; } /*--------------------------------------------------------------------- Function: PAS_FindCard Auto-detects the port the Pro AudioSpectrum is set for. ---------------------------------------------------------------------*/ int PAS_FindCard ( void ) { int status; status = PAS_TestAddress( DEFAULT_BASE ); if ( status == 0 ) { PAS_TranslateCode = DEFAULT_BASE; return( PAS_Ok ); } status = PAS_TestAddress( ALT_BASE_1 ); if ( status == 0 ) { PAS_TranslateCode = ALT_BASE_1; return( PAS_Ok ); } status = PAS_TestAddress( ALT_BASE_2 ); if ( status == 0 ) { PAS_TranslateCode = ALT_BASE_2; return( PAS_Ok ); } status = PAS_TestAddress( ALT_BASE_3 ); if ( status == 0 ) { PAS_TranslateCode = ALT_BASE_3; return( PAS_Ok ); } PAS_SetErrorCode( PAS_CardNotFound ); return( PAS_Error ); } /*--------------------------------------------------------------------- Function: PAS_SaveMusicVolume Saves the user's FM mixer settings. ---------------------------------------------------------------------*/ int PAS_SaveMusicVolume ( void ) { int status; int data; if ( !PAS_Installed ) { status = PAS_CheckForDriver(); if ( status != PAS_Ok ) { return( status ); } PAS_State = PAS_GetStateTable(); if ( PAS_State == NULL ) { return( PAS_Error ); } PAS_Func = PAS_GetFunctionTable(); if ( PAS_Func == NULL ) { return( PAS_Error ); } status = PAS_GetCardSettings(); if ( status != PAS_Ok ) { return( status ); } status = PAS_FindCard(); if ( status != PAS_Ok ) { return( status ); } // Enable PAS Sound data = PAS_State->audiofilt; data |= PAS_AudioMuteFlag; PAS_Write( AudioFilterControl, data ); PAS_State->audiofilt = data; } status = PAS_CallMVFunction( PAS_Func->GetMixer, 0, OUTPUTMIXER, L_FM ); if ( status != PAS_Error ) { PAS_OriginalFMLeftVolume = PAS_CallMVFunction( PAS_Func->GetMixer, 0, OUTPUTMIXER, L_FM ) & 0xff; PAS_OriginalFMRightVolume = PAS_CallMVFunction( PAS_Func->GetMixer, 0, OUTPUTMIXER, R_FM ) & 0xff; return( PAS_Ok ); } return( PAS_Warning ); } /*--------------------------------------------------------------------- Function: PAS_RestoreMusicVolume Restores the user's FM mixer settings. ---------------------------------------------------------------------*/ void PAS_RestoreMusicVolume ( void ) { if ( PAS_Func ) { PAS_CallMVFunction( PAS_Func->SetMixer, PAS_OriginalFMLeftVolume, OUTPUTMIXER, L_FM ); PAS_CallMVFunction( PAS_Func->SetMixer, PAS_OriginalFMRightVolume, OUTPUTMIXER, R_FM ); } } /*--------------------------------------------------------------------- Function: PAS_SaveState Saves the original state of the PAS prior to use. ---------------------------------------------------------------------*/ void PAS_SaveState ( void ) { PAS_OriginalState.intrctlr = PAS_State->intrctlr; PAS_OriginalState.audiofilt = PAS_State->audiofilt; PAS_OriginalState.tmrctlr = PAS_State->tmrctlr; PAS_OriginalState.samplerate = PAS_State->samplerate; PAS_OriginalState.samplecnt = PAS_State->samplecnt; PAS_OriginalState.crosschannel = PAS_State->crosschannel; PAS_SampleSizeConfig = PAS_Read( SampleSizeConfiguration ); } /*--------------------------------------------------------------------- Function: PAS_RestoreState Restores the original state of the PAS after use. ---------------------------------------------------------------------*/ void PAS_RestoreState ( void ) { int LoByte; int HiByte; // Select the Sample Rate Timer PAS_Write( LocalTimerControl, SelectSampleRateTimer ); PAS_State->tmrctlr = SelectSampleRateTimer; PAS_Write( SampleRateTimer, PAS_OriginalState.samplerate ); PAS_State->samplerate = PAS_OriginalState.samplerate; // Select the Sample Buffer Count PAS_Write( LocalTimerControl, SelectSampleBufferCount ); PAS_State->tmrctlr = SelectSampleBufferCount; LoByte = lobyte( PAS_OriginalState.samplecnt ); HiByte = hibyte( PAS_OriginalState.samplecnt ); PAS_Write( SampleRateTimer, LoByte ); PAS_Write( SampleRateTimer, HiByte ); PAS_State->samplecnt = PAS_OriginalState.samplecnt; PAS_Write( CrossChannelControl, PAS_OriginalState.crosschannel ); PAS_State->crosschannel = PAS_OriginalState.crosschannel; PAS_Write( SampleSizeConfiguration, PAS_SampleSizeConfig ); PAS_Write( InterruptControl, PAS_OriginalState.intrctlr ); PAS_State->intrctlr = PAS_OriginalState.intrctlr; PAS_Write( AudioFilterControl, PAS_OriginalState.audiofilt ); PAS_State->audiofilt = PAS_OriginalState.audiofilt; PAS_Write( LocalTimerControl, PAS_OriginalState.tmrctlr ); PAS_State->tmrctlr = PAS_OriginalState.tmrctlr; } /*--------------------------------------------------------------------- Function: PAS_LockEnd Used for determining the length of the functions to lock in memory. ---------------------------------------------------------------------*/ static void PAS_LockEnd ( void ) { } /*--------------------------------------------------------------------- Function: allocateTimerStack Allocate a block of memory from conventional (low) memory and return the selector (which can go directly into a segment register) of the memory block or 0 if an error occured. ---------------------------------------------------------------------*/ static unsigned short allocateTimerStack ( unsigned short size ) { union REGS regs; // clear all registers memset( &regs, 0, sizeof( regs ) ); // DPMI allocate conventional memory regs.w.ax = 0x100; // size in paragraphs regs.w.bx = ( size + 15 ) / 16; int386( 0x31, &regs, &regs ); if (!regs.w.cflag) { // DPMI call returns selector in dx // (ax contains real mode segment // which is ignored here) return( regs.w.dx ); } // Couldn't allocate memory. return( NULL ); } /*--------------------------------------------------------------------- Function: deallocateTimerStack Deallocate a block of conventional (low) memory given a selector to it. Assumes the block was allocated with DPMI function 0x100. ---------------------------------------------------------------------*/ static void deallocateTimerStack ( unsigned short selector ) { union REGS regs; if ( selector != NULL ) { // clear all registers memset( &regs, 0, sizeof( regs ) ); regs.w.ax = 0x101; regs.w.dx = selector; int386( 0x31, &regs, &regs ); } } /*--------------------------------------------------------------------- Function: PAS_Init Initializes the sound card and prepares the module to play digitized sounds. ---------------------------------------------------------------------*/ int PAS_Init ( void ) { int Interrupt; int status; int data; if ( PAS_Installed ) { return( PAS_Ok ); } PAS_IntController1Mask = inp( 0x21 ); PAS_IntController2Mask = inp( 0xA1 ); status = PAS_CheckForDriver(); if ( status != PAS_Ok ) { return( status ); } PAS_State = PAS_GetStateTable(); if ( PAS_State == NULL ) { return( PAS_Error ); } PAS_Func = PAS_GetFunctionTable(); if ( PAS_Func == NULL ) { return( PAS_Error ); } status = PAS_GetCardSettings(); if ( status != PAS_Ok ) { return( status ); } status = PAS_FindCard(); if ( status != PAS_Ok ) { return( status ); } PAS_SaveState(); PAS_OriginalPCMLeftVolume = PAS_CallMVFunction( PAS_Func->GetMixer, 0, OUTPUTMIXER, L_PCM ) & 0xff; PAS_OriginalPCMRightVolume = PAS_CallMVFunction( PAS_Func->GetMixer, 0, OUTPUTMIXER, R_PCM ) & 0xff; PAS_SoundPlaying = FALSE; PAS_SetCallBack( NULL ); PAS_DMABuffer = NULL; status = PAS_LockMemory(); if ( status != PAS_Ok ) { PAS_UnlockMemory(); return( status ); } StackSelector = allocateTimerStack( kStackSize ); if ( StackSelector == NULL ) { PAS_UnlockMemory(); PAS_SetErrorCode( PAS_OutOfMemory ); return( PAS_Error ); } // Leave a little room at top of stack just for the hell of it... StackPointer = kStackSize - sizeof( long ); // Install our interrupt handler Interrupt = PAS_Interrupts[ PAS_Irq ]; PAS_OldInt = _dos_getvect( Interrupt ); if ( PAS_Irq < 8 ) { _dos_setvect( Interrupt, PAS_ServiceInterrupt ); } else { status = IRQ_SetVector( Interrupt, PAS_ServiceInterrupt ); if ( status != IRQ_Ok ) { PAS_UnlockMemory(); deallocateTimerStack( StackSelector ); StackSelector = NULL; PAS_SetErrorCode( PAS_UnableToSetIrq ); return( PAS_Error ); } } // Enable PAS Sound data = PAS_State->audiofilt; data |= PAS_AudioMuteFlag; PAS_Write( AudioFilterControl, data ); PAS_State->audiofilt = data; PAS_SetPlaybackRate( PAS_DefaultSampleRate ); PAS_SetMixMode( PAS_DefaultMixMode ); PAS_Installed = TRUE; PAS_SetErrorCode( PAS_Ok ); return( PAS_Ok ); } /*--------------------------------------------------------------------- Function: PAS_Shutdown Ends transfer of sound data to the sound card and restores the system resources used by the card. ---------------------------------------------------------------------*/ void PAS_Shutdown ( void ) { int Interrupt; if ( PAS_Installed ) { // Halt the DMA transfer PAS_StopPlayback(); // Restore the original interrupt Interrupt = PAS_Interrupts[ PAS_Irq ]; if ( PAS_Irq >= 8 ) { IRQ_RestoreVector( Interrupt ); } _dos_setvect( Interrupt, PAS_OldInt ); PAS_SoundPlaying = FALSE; PAS_DMABuffer = NULL; PAS_SetCallBack( NULL ); PAS_CallMVFunction( PAS_Func->SetMixer, PAS_OriginalPCMLeftVolume, OUTPUTMIXER, L_PCM ); PAS_CallMVFunction( PAS_Func->SetMixer, PAS_OriginalPCMRightVolume, OUTPUTMIXER, R_PCM ); // DEBUG // PAS_RestoreState(); PAS_UnlockMemory(); deallocateTimerStack( StackSelector ); StackSelector = NULL; PAS_Installed = FALSE; } } /*--------------------------------------------------------------------- Function: PAS_UnlockMemory Unlocks all neccessary data. ---------------------------------------------------------------------*/ void PAS_UnlockMemory ( void ) { DPMI_UnlockMemoryRegion( PAS_LockStart, PAS_LockEnd ); DPMI_Unlock( PAS_Interrupts ); DPMI_Unlock( PAS_OldInt ); DPMI_Unlock( PAS_IntController1Mask ); DPMI_Unlock( PAS_IntController2Mask ); DPMI_Unlock( PAS_Installed ); DPMI_Unlock( PAS_TranslateCode ); DPMI_Unlock( PAS_OriginalPCMLeftVolume ); DPMI_Unlock( PAS_OriginalPCMRightVolume ); DPMI_Unlock( PAS_OriginalFMLeftVolume ); DPMI_Unlock( PAS_OriginalFMRightVolume ); DPMI_Unlock( PAS_DMAChannel ); DPMI_Unlock( PAS_Irq ); DPMI_Unlock( PAS_State ); DPMI_Unlock( PAS_Func ); DPMI_Unlock( PAS_OriginalState ); DPMI_Unlock( PAS_SampleSizeConfig ); DPMI_Unlock( PAS_DMABuffer ); DPMI_Unlock( PAS_DMABufferEnd ); DPMI_Unlock( PAS_CurrentDMABuffer ); DPMI_Unlock( PAS_TotalDMABufferSize ); DPMI_Unlock( PAS_TransferLength ); DPMI_Unlock( PAS_MixMode ); DPMI_Unlock( PAS_SampleRate ); DPMI_Unlock( PAS_TimeInterval ); DPMI_Unlock( PAS_SoundPlaying ); DPMI_Unlock( PAS_CallBack ); DPMI_Unlock( PAS_ErrorCode ); DPMI_Unlock( irqstatus ); } /*--------------------------------------------------------------------- Function: PAS_LockMemory Locks all neccessary data. ---------------------------------------------------------------------*/ int PAS_LockMemory ( void ) { int status; status = DPMI_LockMemoryRegion( PAS_LockStart, PAS_LockEnd ); status |= DPMI_Lock( PAS_Interrupts ); status |= DPMI_Lock( PAS_OldInt ); status |= DPMI_Lock( PAS_IntController1Mask ); status |= DPMI_Lock( PAS_IntController2Mask ); status |= DPMI_Lock( PAS_Installed ); status |= DPMI_Lock( PAS_TranslateCode ); status |= DPMI_Lock( PAS_OriginalPCMLeftVolume ); status |= DPMI_Lock( PAS_OriginalPCMRightVolume ); status |= DPMI_Lock( PAS_OriginalFMLeftVolume ); status |= DPMI_Lock( PAS_OriginalFMRightVolume ); status |= DPMI_Lock( PAS_DMAChannel ); status |= DPMI_Lock( PAS_Irq ); status |= DPMI_Lock( PAS_State ); status |= DPMI_Lock( PAS_Func ); status |= DPMI_Lock( PAS_OriginalState ); status |= DPMI_Lock( PAS_SampleSizeConfig ); status |= DPMI_Lock( PAS_DMABuffer ); status |= DPMI_Lock( PAS_DMABufferEnd ); status |= DPMI_Lock( PAS_CurrentDMABuffer ); status |= DPMI_Lock( PAS_TotalDMABufferSize ); status |= DPMI_Lock( PAS_TransferLength ); status |= DPMI_Lock( PAS_MixMode ); status |= DPMI_Lock( PAS_SampleRate ); status |= DPMI_Lock( PAS_TimeInterval ); status |= DPMI_Lock( PAS_SoundPlaying ); status |= DPMI_Lock( PAS_CallBack ); status |= DPMI_Lock( PAS_ErrorCode ); status |= DPMI_Lock( irqstatus ); if ( status != DPMI_Ok ) { PAS_UnlockMemory(); PAS_SetErrorCode( PAS_DPMI_Error ); return( PAS_Error ); } return( PAS_Ok ); }
{ "pile_set_name": "Github" }
/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // +k8s:deepcopy-gen=package // +k8s:protobuf-gen=package // +groupName=storage.k8s.io // +k8s:openapi-gen=true package v1 // import "k8s.io/api/storage/v1"
{ "pile_set_name": "Github" }
$Title = "VMs restarted due to Guest OS Error" $Header = "HA: VM restarted due to Guest OS Error: [count]" $Display = "Table" $Author = "Alan Renouf" $PluginVersion = 1.4 $PluginCategory = "vSphere" # Start of Settings # HA VM reset day(s) number due to Guest OS error $HAVMresetold = 5 # End of Settings # Update settings where there is an override $HAVMresetold = Get-vCheckSetting $Title "HAVMresetold" $HAVMresetold Get-VIEventPlus -Start ($Date).AddDays(-$HAVMresetold) -EventType "VmDasBeingResetEvent","VmDasBeingResetWithScreenshotEvent" | Select-Object CreatedTime,FullFormattedMessage | Sort-Object CreatedTime -Descending $Comments = ("The following VMs have been restarted by HA in the last {0} days" -f $HAVMresetold) # Change Log ## 1.4 : Let Get-VIEventPlus search for VmDasBeingResetEvent events ## 1.3 : Add Get-vCheckSetting and switch to Get-VIEventPlus
{ "pile_set_name": "Github" }
# typed: true %w[]
{ "pile_set_name": "Github" }
/* * Copyright (C) 2008 Martin Willi * HSR Hochschule fuer Technik Rapperswil * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. */ #include "database_factory.h" #include <collections/linked_list.h> #include <threading/mutex.h> typedef struct private_database_factory_t private_database_factory_t; /** * private data of database_factory */ struct private_database_factory_t { /** * public functions */ database_factory_t public; /** * list of registered database_t implementations */ linked_list_t *databases; /** * mutex to lock access to databases */ mutex_t *mutex; }; METHOD(database_factory_t, create, database_t*, private_database_factory_t *this, char *uri) { enumerator_t *enumerator; database_t *database = NULL; database_constructor_t create; this->mutex->lock(this->mutex); enumerator = this->databases->create_enumerator(this->databases); while (enumerator->enumerate(enumerator, &create)) { database = create(uri); if (database) { break; } } enumerator->destroy(enumerator); this->mutex->unlock(this->mutex); return database; } METHOD(database_factory_t, add_database, void, private_database_factory_t *this, database_constructor_t create) { this->mutex->lock(this->mutex); this->databases->insert_last(this->databases, create); this->mutex->unlock(this->mutex); } METHOD(database_factory_t, remove_database, void, private_database_factory_t *this, database_constructor_t create) { this->mutex->lock(this->mutex); this->databases->remove(this->databases, create, NULL); this->mutex->unlock(this->mutex); } METHOD(database_factory_t, destroy, void, private_database_factory_t *this) { this->databases->destroy(this->databases); this->mutex->destroy(this->mutex); free(this); } /* * see header file */ database_factory_t *database_factory_create() { private_database_factory_t *this; INIT(this, .public = { .create = _create, .add_database = _add_database, .remove_database = _remove_database, .destroy = _destroy, }, .databases = linked_list_create(), .mutex = mutex_create(MUTEX_TYPE_DEFAULT), ); return &this->public; }
{ "pile_set_name": "Github" }
sha256:6d7500c8441be486557b89110c17b80bb72128988ef1a5ae839a71e738dd7a82
{ "pile_set_name": "Github" }
console.log(module.id);
{ "pile_set_name": "Github" }
{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [], "source": [ "%matplotlib notebook \n", "\n", "import autograd.numpy as numpy\n", "import autograd.numpy.random as npr\n", "\n", "from autograd import grad\n", "from autograd.optimizers import sgd\n", "\n", "import matplotlib.pyplot as plot\n", "\n", "from emcee import EnsembleSampler, PTSampler\n", "from collections import OrderedDict" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": true }, "outputs": [], "source": [ "import matplotlib\n", "matplotlib.rc('text', usetex=True)" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": true }, "outputs": [], "source": [ "npr.seed(1234)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [], "source": [ "n_dim = 1\n", "n_hid = 10\n", "\n", "bias = npr.randn()\n", "noise_std = 1.\n", "tra_ratio = 0.5\n", "n_samples = 100\n", "\n", "x_ = 4. * npr.rand(n_samples) - 2.\n", "y_ = numpy.sin(10. * x_) + x_**2\n", "\n", "y_ += bias\n", "\n", "n_tra = numpy.round(n_samples * tra_ratio).astype('int')\n", "x_tra, y_tra = x_[:n_tra], y_[:n_tra]\n", "x_tes, y_tes = x_[:n_tra], y_[:n_tra]\n", "\n", "y_tra = y_tra + noise_std * npr.randn(*y_tra.shape)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": true }, "outputs": [], "source": [ "def init_params(n_dim, n_hid, scale=1.):\n", " w1 = scale * npr.randn(n_dim, n_hid)\n", " b1 = scale * npr.randn(n_hid)\n", " w2 = scale * npr.randn(n_hid)\n", " b2 = scale * npr.randn(1)\n", " \n", " params = OrderedDict({'w1': w1, 'b1': b1, 'w2': w2, 'b2': b2})\n", " shapes = [(nn,pp.shape) for nn, pp in params.items()]\n", " \n", " return params, shapes\n", "\n", "def flatten(p):\n", " return numpy.concatenate([pp.flatten() for nn, pp in p.items()])\n", "\n", "def unflatten(p, shapes):\n", " params = OrderedDict()\n", " idx = 0\n", " for shp in shapes:\n", " nn = shp[0]\n", " i1 = idx + numpy.prod(shp[1])\n", " params[nn] = p[idx:i1].reshape(shp[1])\n", " idx = i1\n", " return params" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": true }, "outputs": [], "source": [ "def tanh(a):\n", " return numpy.tanh(a)" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": false }, "outputs": [], "source": [ "def mlp(x, p): \n", " x = x[:, None] if len(x.shape) < 2 else x\n", " \n", " h = tanh(numpy.dot(x, p['w1']) + p['b1'][None,:])\n", " y = numpy.dot(h, p['w2']) + p['b2']\n", "\n", " return y" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "collapsed": true }, "outputs": [], "source": [ "def mlp_dist(y, x, p, avg=False):\n", " y_ = mlp(x, p)\n", " \n", " d = ((y - y_) ** 2)\n", " \n", " if not avg:\n", " return d\n", " return numpy.mean(d)" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "collapsed": true }, "outputs": [], "source": [ "def logprior(p): \n", " if numpy.sum(numpy.abs(p) > 10.) == 0:\n", " return 0.0\n", " return -numpy.inf\n", "\n", "def loglik(p, x, y, shapes):\n", " return -mlp_dist(y, x, p).sum()\n", "\n", "def logp(p, x, y, shapes):\n", " p_ = unflatten(p, shapes)\n", " return loglik(p_, x, y, shapes) + logprior(p)" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "collapsed": true }, "outputs": [], "source": [ "from multiprocess import Pool" ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "collapsed": false }, "outputs": [], "source": [ "def predict(xx, n=20, n_chains=4, interval=10, burnin=500):\n", " \n", " # importance sampling\n", " p0 = [init_params(n_dim, n_hid) for ii in xrange(n_chains)]\n", " shapes = p0[0][1]\n", " p_flater = [flatten(p[0]) for p in p0]\n", " p_params = numpy.concatenate([pf[None,:] for pf in p_flater], 0)\n", " sampler = EnsembleSampler(n_chains, p_params.shape[1], logp, a=2.0, \n", " args=[x_tra, y_tra, shapes], threads=3, live_dangerously=True)\n", " pos, _, _ = sampler.run_mcmc(p_params, burnin)\n", " sampler.reset()\n", " pos, _, _ = sampler.run_mcmc(pos, n * interval)\n", " \n", " ws_ = sampler.chain[:,::interval,:].reshape(-1, p_params.shape[1])\n", " \n", " p1_params = [unflatten(ws_[ii], shapes) for ii in xrange(n)]\n", " \n", " p = Pool(n_chains)\n", " tpred = p.map(lambda w_: mlp(xx, w_), p1_params)\n", " p.close()\n", "\n", " preds = numpy.concatenate([tp[:, None] for tp in tpred], 1)\n", " wpred = numpy.mean(preds, -1)\n", " wvar = numpy.var(preds, -1)\n", " \n", " return wpred, wvar, p1_params" ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Training error rate 1.33975318553, Test error rate 0.657119757094\n" ] } ], "source": [ "tra_er = ((predict(x_tra, n=50, n_chains=64)[0] - y_tra) ** 2).mean()\n", "tes_er = ((predict(x_tes, n=50, n_chains=64)[0] - y_tes) ** 2).mean()\n", "\n", "print 'Training error rate {}, Test error rate {}'.format(tra_er, tes_er)" ] }, { "cell_type": "code", "execution_count": 13, "metadata": { "collapsed": false }, "outputs": [], "source": [ "# visualize data \n", "def vis_data(x, y, c='r'):\n", " if y is None: \n", " y = [0] * len(x)\n", " plot.plot(x, y, 'x', markerfacecolor='none', markeredgecolor=c)\n", " plot.grid('on')" ] }, { "cell_type": "code", "execution_count": 14, "metadata": { "collapsed": true }, "outputs": [], "source": [ "def vis_pred(typ='k--'):\n", " plot.hold('on')\n", "\n", " lim0 = plot.gca().get_xlim()\n", " lim1 = plot.gca().get_ylim()\n", " m0, m1 = lim0[0], lim0[1]\n", " \n", " x_ = numpy.linspace(lim0[0], lim0[1], 100)\n", " y_, y_var, _ = predict(x_, n=100, n_chains=64)\n", " \n", " plt1, = plot.plot(x_, y_, typ)\n", " \n", " plot.fill(numpy.concatenate([x_, x_[::-1]]),\n", " numpy.concatenate([y_ - 3. * numpy.sqrt(y_var),\n", " (y_ + 3. * numpy.sqrt(y_var))[::-1]]),\n", " alpha=.5, fc='b', ec='None')\n", "\n", "\n", " plot.gca().set_xlim(lim0)\n", " plot.gca().set_ylim(lim1)\n", " \n", " return plt1" ] }, { "cell_type": "code", "execution_count": 15, "metadata": { "collapsed": false }, "outputs": [ { "data": { "application/javascript": [ "/* Put everything inside the global mpl namespace */\n", "window.mpl = {};\n", "\n", "mpl.get_websocket_type = function() {\n", " if (typeof(WebSocket) !== 'undefined') {\n", " return WebSocket;\n", " } else if (typeof(MozWebSocket) !== 'undefined') {\n", " return MozWebSocket;\n", " } else {\n", " alert('Your browser does not have WebSocket support.' +\n", " 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n", " 'Firefox 4 and 5 are also supported but you ' +\n", " 'have to enable WebSockets in about:config.');\n", " };\n", "}\n", "\n", "mpl.figure = function(figure_id, websocket, ondownload, parent_element) {\n", " this.id = figure_id;\n", "\n", " this.ws = websocket;\n", "\n", " this.supports_binary = (this.ws.binaryType != undefined);\n", "\n", " if (!this.supports_binary) {\n", " var warnings = document.getElementById(\"mpl-warnings\");\n", " if (warnings) {\n", " warnings.style.display = 'block';\n", " warnings.textContent = (\n", " \"This browser does not support binary websocket messages. \" +\n", " \"Performance may be slow.\");\n", " }\n", " }\n", "\n", " this.imageObj = new Image();\n", "\n", " this.context = undefined;\n", " this.message = undefined;\n", " this.canvas = undefined;\n", " this.rubberband_canvas = undefined;\n", " this.rubberband_context = undefined;\n", " this.format_dropdown = undefined;\n", "\n", " this.image_mode = 'full';\n", "\n", " this.root = $('<div/>');\n", " this._root_extra_style(this.root)\n", " this.root.attr('style', 'display: inline-block');\n", "\n", " $(parent_element).append(this.root);\n", "\n", " this._init_header(this);\n", " this._init_canvas(this);\n", " this._init_toolbar(this);\n", "\n", " var fig = this;\n", "\n", " this.waiting = false;\n", "\n", " this.ws.onopen = function () {\n", " fig.send_message(\"supports_binary\", {value: fig.supports_binary});\n", " fig.send_message(\"send_image_mode\", {});\n", " fig.send_message(\"refresh\", {});\n", " }\n", "\n", " this.imageObj.onload = function() {\n", " if (fig.image_mode == 'full') {\n", " // Full images could contain transparency (where diff images\n", " // almost always do), so we need to clear the canvas so that\n", " // there is no ghosting.\n", " fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n", " }\n", " fig.context.drawImage(fig.imageObj, 0, 0);\n", " };\n", "\n", " this.imageObj.onunload = function() {\n", " this.ws.close();\n", " }\n", "\n", " this.ws.onmessage = this._make_on_message_function(this);\n", "\n", " this.ondownload = ondownload;\n", "}\n", "\n", "mpl.figure.prototype._init_header = function() {\n", " var titlebar = $(\n", " '<div class=\"ui-dialog-titlebar ui-widget-header ui-corner-all ' +\n", " 'ui-helper-clearfix\"/>');\n", " var titletext = $(\n", " '<div class=\"ui-dialog-title\" style=\"width: 100%; ' +\n", " 'text-align: center; padding: 3px;\"/>');\n", " titlebar.append(titletext)\n", " this.root.append(titlebar);\n", " this.header = titletext[0];\n", "}\n", "\n", "\n", "\n", "mpl.figure.prototype._canvas_extra_style = function(canvas_div) {\n", "\n", "}\n", "\n", "\n", "mpl.figure.prototype._root_extra_style = function(canvas_div) {\n", "\n", "}\n", "\n", "mpl.figure.prototype._init_canvas = function() {\n", " var fig = this;\n", "\n", " var canvas_div = $('<div/>');\n", "\n", " canvas_div.attr('style', 'position: relative; clear: both; outline: 0');\n", "\n", " function canvas_keyboard_event(event) {\n", " return fig.key_event(event, event['data']);\n", " }\n", "\n", " canvas_div.keydown('key_press', canvas_keyboard_event);\n", " canvas_div.keyup('key_release', canvas_keyboard_event);\n", " this.canvas_div = canvas_div\n", " this._canvas_extra_style(canvas_div)\n", " this.root.append(canvas_div);\n", "\n", " var canvas = $('<canvas/>');\n", " canvas.addClass('mpl-canvas');\n", " canvas.attr('style', \"left: 0; top: 0; z-index: 0; outline: 0\")\n", "\n", " this.canvas = canvas[0];\n", " this.context = canvas[0].getContext(\"2d\");\n", "\n", " var rubberband = $('<canvas/>');\n", " rubberband.attr('style', \"position: absolute; left: 0; top: 0; z-index: 1;\")\n", "\n", " var pass_mouse_events = true;\n", "\n", " canvas_div.resizable({\n", " start: function(event, ui) {\n", " pass_mouse_events = false;\n", " },\n", " resize: function(event, ui) {\n", " fig.request_resize(ui.size.width, ui.size.height);\n", " },\n", " stop: function(event, ui) {\n", " pass_mouse_events = true;\n", " fig.request_resize(ui.size.width, ui.size.height);\n", " },\n", " });\n", "\n", " function mouse_event_fn(event) {\n", " if (pass_mouse_events)\n", " return fig.mouse_event(event, event['data']);\n", " }\n", "\n", " rubberband.mousedown('button_press', mouse_event_fn);\n", " rubberband.mouseup('button_release', mouse_event_fn);\n", " // Throttle sequential mouse events to 1 every 20ms.\n", " rubberband.mousemove('motion_notify', mouse_event_fn);\n", "\n", " rubberband.mouseenter('figure_enter', mouse_event_fn);\n", " rubberband.mouseleave('figure_leave', mouse_event_fn);\n", "\n", " canvas_div.on(\"wheel\", function (event) {\n", " event = event.originalEvent;\n", " event['data'] = 'scroll'\n", " if (event.deltaY < 0) {\n", " event.step = 1;\n", " } else {\n", " event.step = -1;\n", " }\n", " mouse_event_fn(event);\n", " });\n", "\n", " canvas_div.append(canvas);\n", " canvas_div.append(rubberband);\n", "\n", " this.rubberband = rubberband;\n", " this.rubberband_canvas = rubberband[0];\n", " this.rubberband_context = rubberband[0].getContext(\"2d\");\n", " this.rubberband_context.strokeStyle = \"#000000\";\n", "\n", " this._resize_canvas = function(width, height) {\n", " // Keep the size of the canvas, canvas container, and rubber band\n", " // canvas in synch.\n", " canvas_div.css('width', width)\n", " canvas_div.css('height', height)\n", "\n", " canvas.attr('width', width);\n", " canvas.attr('height', height);\n", "\n", " rubberband.attr('width', width);\n", " rubberband.attr('height', height);\n", " }\n", "\n", " // Set the figure to an initial 600x600px, this will subsequently be updated\n", " // upon first draw.\n", " this._resize_canvas(600, 600);\n", "\n", " // Disable right mouse context menu.\n", " $(this.rubberband_canvas).bind(\"contextmenu\",function(e){\n", " return false;\n", " });\n", "\n", " function set_focus () {\n", " canvas.focus();\n", " canvas_div.focus();\n", " }\n", "\n", " window.setTimeout(set_focus, 100);\n", "}\n", "\n", "mpl.figure.prototype._init_toolbar = function() {\n", " var fig = this;\n", "\n", " var nav_element = $('<div/>')\n", " nav_element.attr('style', 'width: 100%');\n", " this.root.append(nav_element);\n", "\n", " // Define a callback function for later on.\n", " function toolbar_event(event) {\n", " return fig.toolbar_button_onclick(event['data']);\n", " }\n", " function toolbar_mouse_event(event) {\n", " return fig.toolbar_button_onmouseover(event['data']);\n", " }\n", "\n", " for(var toolbar_ind in mpl.toolbar_items) {\n", " var name = mpl.toolbar_items[toolbar_ind][0];\n", " var tooltip = mpl.toolbar_items[toolbar_ind][1];\n", " var image = mpl.toolbar_items[toolbar_ind][2];\n", " var method_name = mpl.toolbar_items[toolbar_ind][3];\n", "\n", " if (!name) {\n", " // put a spacer in here.\n", " continue;\n", " }\n", " var button = $('<button/>');\n", " button.addClass('ui-button ui-widget ui-state-default ui-corner-all ' +\n", " 'ui-button-icon-only');\n", " button.attr('role', 'button');\n", " button.attr('aria-disabled', 'false');\n", " button.click(method_name, toolbar_event);\n", " button.mouseover(tooltip, toolbar_mouse_event);\n", "\n", " var icon_img = $('<span/>');\n", " icon_img.addClass('ui-button-icon-primary ui-icon');\n", " icon_img.addClass(image);\n", " icon_img.addClass('ui-corner-all');\n", "\n", " var tooltip_span = $('<span/>');\n", " tooltip_span.addClass('ui-button-text');\n", " tooltip_span.html(tooltip);\n", "\n", " button.append(icon_img);\n", " button.append(tooltip_span);\n", "\n", " nav_element.append(button);\n", " }\n", "\n", " var fmt_picker_span = $('<span/>');\n", "\n", " var fmt_picker = $('<select/>');\n", " fmt_picker.addClass('mpl-toolbar-option ui-widget ui-widget-content');\n", " fmt_picker_span.append(fmt_picker);\n", " nav_element.append(fmt_picker_span);\n", " this.format_dropdown = fmt_picker[0];\n", "\n", " for (var ind in mpl.extensions) {\n", " var fmt = mpl.extensions[ind];\n", " var option = $(\n", " '<option/>', {selected: fmt === mpl.default_extension}).html(fmt);\n", " fmt_picker.append(option)\n", " }\n", "\n", " // Add hover states to the ui-buttons\n", " $( \".ui-button\" ).hover(\n", " function() { $(this).addClass(\"ui-state-hover\");},\n", " function() { $(this).removeClass(\"ui-state-hover\");}\n", " );\n", "\n", " var status_bar = $('<span class=\"mpl-message\"/>');\n", " nav_element.append(status_bar);\n", " this.message = status_bar[0];\n", "}\n", "\n", "mpl.figure.prototype.request_resize = function(x_pixels, y_pixels) {\n", " // Request matplotlib to resize the figure. Matplotlib will then trigger a resize in the client,\n", " // which will in turn request a refresh of the image.\n", " this.send_message('resize', {'width': x_pixels, 'height': y_pixels});\n", "}\n", "\n", "mpl.figure.prototype.send_message = function(type, properties) {\n", " properties['type'] = type;\n", " properties['figure_id'] = this.id;\n", " this.ws.send(JSON.stringify(properties));\n", "}\n", "\n", "mpl.figure.prototype.send_draw_message = function() {\n", " if (!this.waiting) {\n", " this.waiting = true;\n", " this.ws.send(JSON.stringify({type: \"draw\", figure_id: this.id}));\n", " }\n", "}\n", "\n", "\n", "mpl.figure.prototype.handle_save = function(fig, msg) {\n", " var format_dropdown = fig.format_dropdown;\n", " var format = format_dropdown.options[format_dropdown.selectedIndex].value;\n", " fig.ondownload(fig, format);\n", "}\n", "\n", "\n", "mpl.figure.prototype.handle_resize = function(fig, msg) {\n", " var size = msg['size'];\n", " if (size[0] != fig.canvas.width || size[1] != fig.canvas.height) {\n", " fig._resize_canvas(size[0], size[1]);\n", " fig.send_message(\"refresh\", {});\n", " };\n", "}\n", "\n", "mpl.figure.prototype.handle_rubberband = function(fig, msg) {\n", " var x0 = msg['x0'];\n", " var y0 = fig.canvas.height - msg['y0'];\n", " var x1 = msg['x1'];\n", " var y1 = fig.canvas.height - msg['y1'];\n", " x0 = Math.floor(x0) + 0.5;\n", " y0 = Math.floor(y0) + 0.5;\n", " x1 = Math.floor(x1) + 0.5;\n", " y1 = Math.floor(y1) + 0.5;\n", " var min_x = Math.min(x0, x1);\n", " var min_y = Math.min(y0, y1);\n", " var width = Math.abs(x1 - x0);\n", " var height = Math.abs(y1 - y0);\n", "\n", " fig.rubberband_context.clearRect(\n", " 0, 0, fig.canvas.width, fig.canvas.height);\n", "\n", " fig.rubberband_context.strokeRect(min_x, min_y, width, height);\n", "}\n", "\n", "mpl.figure.prototype.handle_figure_label = function(fig, msg) {\n", " // Updates the figure title.\n", " fig.header.textContent = msg['label'];\n", "}\n", "\n", "mpl.figure.prototype.handle_cursor = function(fig, msg) {\n", " var cursor = msg['cursor'];\n", " switch(cursor)\n", " {\n", " case 0:\n", " cursor = 'pointer';\n", " break;\n", " case 1:\n", " cursor = 'default';\n", " break;\n", " case 2:\n", " cursor = 'crosshair';\n", " break;\n", " case 3:\n", " cursor = 'move';\n", " break;\n", " }\n", " fig.rubberband_canvas.style.cursor = cursor;\n", "}\n", "\n", "mpl.figure.prototype.handle_message = function(fig, msg) {\n", " fig.message.textContent = msg['message'];\n", "}\n", "\n", "mpl.figure.prototype.handle_draw = function(fig, msg) {\n", " // Request the server to send over a new figure.\n", " fig.send_draw_message();\n", "}\n", "\n", "mpl.figure.prototype.handle_image_mode = function(fig, msg) {\n", " fig.image_mode = msg['mode'];\n", "}\n", "\n", "mpl.figure.prototype.updated_canvas_event = function() {\n", " // Called whenever the canvas gets updated.\n", " this.send_message(\"ack\", {});\n", "}\n", "\n", "// A function to construct a web socket function for onmessage handling.\n", "// Called in the figure constructor.\n", "mpl.figure.prototype._make_on_message_function = function(fig) {\n", " return function socket_on_message(evt) {\n", " if (evt.data instanceof Blob) {\n", " /* FIXME: We get \"Resource interpreted as Image but\n", " * transferred with MIME type text/plain:\" errors on\n", " * Chrome. But how to set the MIME type? It doesn't seem\n", " * to be part of the websocket stream */\n", " evt.data.type = \"image/png\";\n", "\n", " /* Free the memory for the previous frames */\n", " if (fig.imageObj.src) {\n", " (window.URL || window.webkitURL).revokeObjectURL(\n", " fig.imageObj.src);\n", " }\n", "\n", " fig.imageObj.src = (window.URL || window.webkitURL).createObjectURL(\n", " evt.data);\n", " fig.updated_canvas_event();\n", " fig.waiting = false;\n", " return;\n", " }\n", " else if (typeof evt.data === 'string' && evt.data.slice(0, 21) == \"data:image/png;base64\") {\n", " fig.imageObj.src = evt.data;\n", " fig.updated_canvas_event();\n", " fig.waiting = false;\n", " return;\n", " }\n", "\n", " var msg = JSON.parse(evt.data);\n", " var msg_type = msg['type'];\n", "\n", " // Call the \"handle_{type}\" callback, which takes\n", " // the figure and JSON message as its only arguments.\n", " try {\n", " var callback = fig[\"handle_\" + msg_type];\n", " } catch (e) {\n", " console.log(\"No handler for the '\" + msg_type + \"' message type: \", msg);\n", " return;\n", " }\n", "\n", " if (callback) {\n", " try {\n", " // console.log(\"Handling '\" + msg_type + \"' message: \", msg);\n", " callback(fig, msg);\n", " } catch (e) {\n", " console.log(\"Exception inside the 'handler_\" + msg_type + \"' callback:\", e, e.stack, msg);\n", " }\n", " }\n", " };\n", "}\n", "\n", "// from http://stackoverflow.com/questions/1114465/getting-mouse-location-in-canvas\n", "mpl.findpos = function(e) {\n", " //this section is from http://www.quirksmode.org/js/events_properties.html\n", " var targ;\n", " if (!e)\n", " e = window.event;\n", " if (e.target)\n", " targ = e.target;\n", " else if (e.srcElement)\n", " targ = e.srcElement;\n", " if (targ.nodeType == 3) // defeat Safari bug\n", " targ = targ.parentNode;\n", "\n", " // jQuery normalizes the pageX and pageY\n", " // pageX,Y are the mouse positions relative to the document\n", " // offset() returns the position of the element relative to the document\n", " var x = e.pageX - $(targ).offset().left;\n", " var y = e.pageY - $(targ).offset().top;\n", "\n", " return {\"x\": x, \"y\": y};\n", "};\n", "\n", "/*\n", " * return a copy of an object with only non-object keys\n", " * we need this to avoid circular references\n", " * http://stackoverflow.com/a/24161582/3208463\n", " */\n", "function simpleKeys (original) {\n", " return Object.keys(original).reduce(function (obj, key) {\n", " if (typeof original[key] !== 'object')\n", " obj[key] = original[key]\n", " return obj;\n", " }, {});\n", "}\n", "\n", "mpl.figure.prototype.mouse_event = function(event, name) {\n", " var canvas_pos = mpl.findpos(event)\n", "\n", " if (name === 'button_press')\n", " {\n", " this.canvas.focus();\n", " this.canvas_div.focus();\n", " }\n", "\n", " var x = canvas_pos.x;\n", " var y = canvas_pos.y;\n", "\n", " this.send_message(name, {x: x, y: y, button: event.button,\n", " step: event.step,\n", " guiEvent: simpleKeys(event)});\n", "\n", " /* This prevents the web browser from automatically changing to\n", " * the text insertion cursor when the button is pressed. We want\n", " * to control all of the cursor setting manually through the\n", " * 'cursor' event from matplotlib */\n", " event.preventDefault();\n", " return false;\n", "}\n", "\n", "mpl.figure.prototype._key_event_extra = function(event, name) {\n", " // Handle any extra behaviour associated with a key event\n", "}\n", "\n", "mpl.figure.prototype.key_event = function(event, name) {\n", "\n", " // Prevent repeat events\n", " if (name == 'key_press')\n", " {\n", " if (event.which === this._key)\n", " return;\n", " else\n", " this._key = event.which;\n", " }\n", " if (name == 'key_release')\n", " this._key = null;\n", "\n", " var value = '';\n", " if (event.ctrlKey && event.which != 17)\n", " value += \"ctrl+\";\n", " if (event.altKey && event.which != 18)\n", " value += \"alt+\";\n", " if (event.shiftKey && event.which != 16)\n", " value += \"shift+\";\n", "\n", " value += 'k';\n", " value += event.which.toString();\n", "\n", " this._key_event_extra(event, name);\n", "\n", " this.send_message(name, {key: value,\n", " guiEvent: simpleKeys(event)});\n", " return false;\n", "}\n", "\n", "mpl.figure.prototype.toolbar_button_onclick = function(name) {\n", " if (name == 'download') {\n", " this.handle_save(this, null);\n", " } else {\n", " this.send_message(\"toolbar_button\", {name: name});\n", " }\n", "};\n", "\n", "mpl.figure.prototype.toolbar_button_onmouseover = function(tooltip) {\n", " this.message.textContent = tooltip;\n", "};\n", "mpl.toolbar_items = [[\"Home\", \"Reset original view\", \"fa fa-home icon-home\", \"home\"], [\"Back\", \"Back to previous view\", \"fa fa-arrow-left icon-arrow-left\", \"back\"], [\"Forward\", \"Forward to next view\", \"fa fa-arrow-right icon-arrow-right\", \"forward\"], [\"\", \"\", \"\", \"\"], [\"Pan\", \"Pan axes with left mouse, zoom with right\", \"fa fa-arrows icon-move\", \"pan\"], [\"Zoom\", \"Zoom to rectangle\", \"fa fa-square-o icon-check-empty\", \"zoom\"], [\"\", \"\", \"\", \"\"], [\"Download\", \"Download plot\", \"fa fa-floppy-o icon-save\", \"download\"]];\n", "\n", "mpl.extensions = [\"eps\", \"jpeg\", \"pdf\", \"png\", \"ps\", \"raw\", \"svg\", \"tif\"];\n", "\n", "mpl.default_extension = \"png\";var comm_websocket_adapter = function(comm) {\n", " // Create a \"websocket\"-like object which calls the given IPython comm\n", " // object with the appropriate methods. Currently this is a non binary\n", " // socket, so there is still some room for performance tuning.\n", " var ws = {};\n", "\n", " ws.close = function() {\n", " comm.close()\n", " };\n", " ws.send = function(m) {\n", " //console.log('sending', m);\n", " comm.send(m);\n", " };\n", " // Register the callback with on_msg.\n", " comm.on_msg(function(msg) {\n", " //console.log('receiving', msg['content']['data'], msg);\n", " // Pass the mpl event to the overriden (by mpl) onmessage function.\n", " ws.onmessage(msg['content']['data'])\n", " });\n", " return ws;\n", "}\n", "\n", "mpl.mpl_figure_comm = function(comm, msg) {\n", " // This is the function which gets called when the mpl process\n", " // starts-up an IPython Comm through the \"matplotlib\" channel.\n", "\n", " var id = msg.content.data.id;\n", " // Get hold of the div created by the display call when the Comm\n", " // socket was opened in Python.\n", " var element = $(\"#\" + id);\n", " var ws_proxy = comm_websocket_adapter(comm)\n", "\n", " function ondownload(figure, format) {\n", " window.open(figure.imageObj.src);\n", " }\n", "\n", " var fig = new mpl.figure(id, ws_proxy,\n", " ondownload,\n", " element.get(0));\n", "\n", " // Call onopen now - mpl needs it, as it is assuming we've passed it a real\n", " // web socket which is closed, not our websocket->open comm proxy.\n", " ws_proxy.onopen();\n", "\n", " fig.parent_element = element.get(0);\n", " fig.cell_info = mpl.find_output_cell(\"<div id='\" + id + \"'></div>\");\n", " if (!fig.cell_info) {\n", " console.error(\"Failed to find cell for figure\", id, fig);\n", " return;\n", " }\n", "\n", " var output_index = fig.cell_info[2]\n", " var cell = fig.cell_info[0];\n", "\n", "};\n", "\n", "mpl.figure.prototype.handle_close = function(fig, msg) {\n", " fig.root.unbind('remove')\n", "\n", " // Update the output cell to use the data from the current canvas.\n", " fig.push_to_output();\n", " var dataURL = fig.canvas.toDataURL();\n", " // Re-enable the keyboard manager in IPython - without this line, in FF,\n", " // the notebook keyboard shortcuts fail.\n", " IPython.keyboard_manager.enable()\n", " $(fig.parent_element).html('<img src=\"' + dataURL + '\">');\n", " fig.close_ws(fig, msg);\n", "}\n", "\n", "mpl.figure.prototype.close_ws = function(fig, msg){\n", " fig.send_message('closing', msg);\n", " // fig.ws.close()\n", "}\n", "\n", "mpl.figure.prototype.push_to_output = function(remove_interactive) {\n", " // Turn the data on the canvas into data in the output cell.\n", " var dataURL = this.canvas.toDataURL();\n", " this.cell_info[1]['text/html'] = '<img src=\"' + dataURL + '\">';\n", "}\n", "\n", "mpl.figure.prototype.updated_canvas_event = function() {\n", " // Tell IPython that the notebook contents must change.\n", " IPython.notebook.set_dirty(true);\n", " this.send_message(\"ack\", {});\n", " var fig = this;\n", " // Wait a second, then push the new image to the DOM so\n", " // that it is saved nicely (might be nice to debounce this).\n", " setTimeout(function () { fig.push_to_output() }, 1000);\n", "}\n", "\n", "mpl.figure.prototype._init_toolbar = function() {\n", " var fig = this;\n", "\n", " var nav_element = $('<div/>')\n", " nav_element.attr('style', 'width: 100%');\n", " this.root.append(nav_element);\n", "\n", " // Define a callback function for later on.\n", " function toolbar_event(event) {\n", " return fig.toolbar_button_onclick(event['data']);\n", " }\n", " function toolbar_mouse_event(event) {\n", " return fig.toolbar_button_onmouseover(event['data']);\n", " }\n", "\n", " for(var toolbar_ind in mpl.toolbar_items){\n", " var name = mpl.toolbar_items[toolbar_ind][0];\n", " var tooltip = mpl.toolbar_items[toolbar_ind][1];\n", " var image = mpl.toolbar_items[toolbar_ind][2];\n", " var method_name = mpl.toolbar_items[toolbar_ind][3];\n", "\n", " if (!name) { continue; };\n", "\n", " var button = $('<button class=\"btn btn-default\" href=\"#\" title=\"' + name + '\"><i class=\"fa ' + image + ' fa-lg\"></i></button>');\n", " button.click(method_name, toolbar_event);\n", " button.mouseover(tooltip, toolbar_mouse_event);\n", " nav_element.append(button);\n", " }\n", "\n", " // Add the status bar.\n", " var status_bar = $('<span class=\"mpl-message\" style=\"text-align:right; float: right;\"/>');\n", " nav_element.append(status_bar);\n", " this.message = status_bar[0];\n", "\n", " // Add the close button to the window.\n", " var buttongrp = $('<div class=\"btn-group inline pull-right\"></div>');\n", " var button = $('<button class=\"btn btn-mini btn-primary\" href=\"#\" title=\"Stop Interaction\"><i class=\"fa fa-power-off icon-remove icon-large\"></i></button>');\n", " button.click(function (evt) { fig.handle_close(fig, {}); } );\n", " button.mouseover('Stop Interaction', toolbar_mouse_event);\n", " buttongrp.append(button);\n", " var titlebar = this.root.find($('.ui-dialog-titlebar'));\n", " titlebar.prepend(buttongrp);\n", "}\n", "\n", "mpl.figure.prototype._root_extra_style = function(el){\n", " var fig = this\n", " el.on(\"remove\", function(){\n", "\tfig.close_ws(fig, {});\n", " });\n", "}\n", "\n", "mpl.figure.prototype._canvas_extra_style = function(el){\n", " // this is important to make the div 'focusable\n", " el.attr('tabindex', 0)\n", " // reach out to IPython and tell the keyboard manager to turn it's self\n", " // off when our div gets focus\n", "\n", " // location in version 3\n", " if (IPython.notebook.keyboard_manager) {\n", " IPython.notebook.keyboard_manager.register_events(el);\n", " }\n", " else {\n", " // location in version 2\n", " IPython.keyboard_manager.register_events(el);\n", " }\n", "\n", "}\n", "\n", "mpl.figure.prototype._key_event_extra = function(event, name) {\n", " var manager = IPython.notebook.keyboard_manager;\n", " if (!manager)\n", " manager = IPython.keyboard_manager;\n", "\n", " // Check for shift+enter\n", " if (event.shiftKey && event.which == 13) {\n", " this.canvas_div.blur();\n", " event.shiftKey = false;\n", " // Send a \"J\" for go to next cell\n", " event.which = 74;\n", " event.keyCode = 74;\n", " manager.command_mode();\n", " manager.handle_keydown(event);\n", " }\n", "}\n", "\n", "mpl.figure.prototype.handle_save = function(fig, msg) {\n", " fig.ondownload(fig, null);\n", "}\n", "\n", "\n", "mpl.find_output_cell = function(html_output) {\n", " // Return the cell and output element which can be found *uniquely* in the notebook.\n", " // Note - this is a bit hacky, but it is done because the \"notebook_saving.Notebook\"\n", " // IPython event is triggered only after the cells have been serialised, which for\n", " // our purposes (turning an active figure into a static one), is too late.\n", " var cells = IPython.notebook.get_cells();\n", " var ncells = cells.length;\n", " for (var i=0; i<ncells; i++) {\n", " var cell = cells[i];\n", " if (cell.cell_type === 'code'){\n", " for (var j=0; j<cell.output_area.outputs.length; j++) {\n", " var data = cell.output_area.outputs[j];\n", " if (data.data) {\n", " // IPython >= 3 moved mimebundle to data attribute of output\n", " data = data.data;\n", " }\n", " if (data['text/html'] == html_output) {\n", " return [cell, data, j];\n", " }\n", " }\n", " }\n", " }\n", "}\n", "\n", "// Register the function which deals with the matplotlib target/channel.\n", "// The kernel may be null if the page has been refreshed.\n", "if (IPython.notebook.kernel != null) {\n", " IPython.notebook.kernel.comm_manager.register_target('matplotlib', mpl.mpl_figure_comm);\n", "}\n" ], "text/plain": [ "<IPython.core.display.Javascript object>" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAYAAAA10dzkAAAgAElEQVR4Xux9CZgU1dX2y77DIIMMm6zCoAgiiGgGWQVFFNEoblGjRjSo5INEHJIv+ZI/YUIMGESig/uGssgiIg6yKCCOsiPIIIuyDzAswzrs/3O66Fma7q6qvlXVVV3vfZ4JTvou57znVs3b956lFNiIABEgAkSACBABIkAEfIVAKV9pS2WJABEgAkSACBABIkAEQALITUAEiAARIAJEgAgQAZ8hQALoM4NTXSJABIgAESACRIAIkAByDxABIkAEiAARIAJEwGcIkAD6zOBUlwgQASJABIgAESACJIDcA0SACBABIkAEiAAR8BkCJIA+MzjVJQJEgAgQASJABIgACSD3ABEgAkSACBABIkAEfIYACaDPDE51iQARIAJEgAgQASJAAsg9QASIABEgAkSACBABnyFAAugzg1NdIkAEiAARIAJEgAiQAHIPEAEiQASIABEgAkTAZwiQAPrM4FSXCBABIkAEiAARIAIkgNwDRIAIEAEiQASIABHwGQIkgD4zONUlAkSACBABIkAEiAAJIPcAESACRIAIEAEiQAR8hgAJoM8MTnWJABEgAkSACBABIkACyD1ABIgAESACRIAIEAGfIUAC6DODU10iQASIABEgAkSACJAAcg8QASJABIgAESACRMBnCJAA+szgVJcIEAEiQASIABEgAiSA3ANEgAgQASJABIgAEfAZAiSAPjM41SUCRIAIEAEiQASIAAkg9wARIAJEgAgQASJABHyGAAmgzwxOdYkAESACRIAIEAEiQALIPUAEiAARIAJEgAgQAZ8hQALoM4NTXSJABIgAESACRIAIkAByDxABIkAEiAARIAJEwGcIkAD6zOBUlwgQASJABIgAESACJIDcA0SACBABIkAEiAAR8BkCJIA+MzjVJQJEgAgQASJABIgACSD3ABEgAkSACBABIkAEfIYACaDPDE51iQARIAJEgAgQASJAAsg9QASIABEgAkSACBABnyFAAugzg1NdIkAEiAARIAJEgAiQAHIPEAEiQASIABEgAkTAZwiQAPrM4FSXCBABIkAEiAARIAIkgNwDRIAIEAEiQASIABHwGQIkgD4zONUlAkSACBABIkAEiAAJIPcAESACRIAIEAEiQAR8hgAJoM8MTnWJABEgAkSACBABIkACGHkPvArgHgDnAcwF8BsAh7lliAARIAJEgAgQASLgdQRIACNb8E4AU71uYMpPBIgAESACRIAIEIFQBEgAI++JuwB8zC1DBIgAESACRIAIEIFEQ4AEMLJF/wBgOYCaAJoCeCHRjE99iAARIAJEgAgQAX8iQAIY2e7Vi/n8if9fEkmgPx8Sak0EiAARIAJEINEQIAE0ZtEeAP4J4NqQ7oJfPQBHjE3DXkSACBABIkAEiIBLEKgGYNeFYE+XiOScGCSA4bFuByD9QhSw9BAC+ByA3iHd6wPY4Zy5uBIRIAJEgAgQASJgIQINAOy0cD7PTEUCGN5UTQAICQxGAcvp3yYAr4d0l2vi/O3bt6N6dflPm9vMmcANNwC1ahUttH8/sGQJcNttNi9ecvrevXsjKyvL0TXds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77752jXu7J8viO1AoDGInoQw0oqPjMiPCTAAbBT93oNQQgAIFIAhjASEQ0gAAEIAABCEAAAtkigAHMlp5kAwEIQAACEIAABCIJYAAjEdEAAhCAAAQgAAEIZIsABjBbepINBCAAAQhAAAIQiCSAAYxERAMIQAACEIAABCCQLQIYwGzpSTYQgAAEIAABCEAgkgAGMBIRDSAAAQhAAAIQgEC2CGAAs6Un2UAAAhCAAAQgAIFIAhjASEQ0gAAEIAABCEAAAtkigAHMlp5kAwEIQAACEIAABCIJYAAjEdEAAhCAAAQgAAEIZIsABjBbepINBCAAAQhAAAIQiCSAAYxERAMIQAACEIAABCCQLQIYwGzpSTYQgAAEIAABCEAgkgAGMBIRDSAAAQhAAAIQgEC2CGAAs6Un2UAAAhCAAAQgAIFIAhjASEQ0gAAEIAABCEAAAtkigAHMlp5kAwEIQAACEIAABCIJYAAjEdEAAhCAAAQgAAEIZIsABjBbepINBCAAAQhAAAIQiCSAAYxERAMIQAACEIAABCCQLQIYwGzpSTYQgAAEIAABCEAgkgAGMBIRDSAAAQhAAAIQgEC2CGAAs6Un2UAAAhCAAAQgAIFIAhjASEQ0gAAEIAABCEAAAtkigAHMlp5kAwEIQAACEIAABCIJYAAjEdEAAhCAAAQgAAEIZIsABjBbepINBCAAAQhAAAIQiCSAAYxERAMIQAACEIAABCCQLQIYwGzpSTYQgAAEIAABCEAgkgAGMBIRDSAAAQhAAAIQgEC2CGAAs6Un2UAAAhCAAAQgAIFIAhjASEQ0gAAEIAABCEAAAtki8P8B6bi/VYAKAS4AAAAASUVORK5CYII=\">" ], "text/plain": [ "<IPython.core.display.HTML object>" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "plot.figure()\n", "\n", "vis_data(x_tra, y_tra, c='r')\n", "vis_data(x_tes, y_tes, c='b')\n", "\n", "#plt0 = vis_pred(params0, 'k-.')\n", "plt1 = vis_pred('k--')\n", "#plot.legend([plt0, plt1], [\n", "# 'Initial',\n", "# 'Final'],\n", "# loc='best')\n", "\n", "plot.show()" ] }, { "cell_type": "code", "execution_count": 16, "metadata": { "collapsed": false }, "outputs": [], "source": [ "plot.savefig('../figures/bayes_linreg_mlp.pdf', dpi=100)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.11" } }, "nbformat": 4, "nbformat_minor": 0 }
{ "pile_set_name": "Github" }
<% /** * $RCSfile: systemAdmins.jsp,v $ * $Revision: 1.3 $ * $Date: 2000/12/18 02:06:21 $ */ %> <%@ page import="java.util.*, java.net.URLEncoder, com.Yasna.forum.*, com.Yasna.forum.util.*, com.Yasna.forum.util.admin.*" errorPage="error.jsp" %> <jsp:useBean id="adminBean" scope="session" class="com.Yasna.forum.util.admin.AdminBean"/> <% //////////////////////////////// // Yazd authorization check // check the bean for the existence of an authorization token. // Its existence proves the user is valid. If it's not found, redirect // to the login page Authorization authToken = adminBean.getAuthToken(); if( authToken == null ) { response.sendRedirect( "login.jsp" ); return; } %> <% //////////////////// // Security check // make sure the user is authorized to administer users: ForumFactory forumFactory = ForumFactory.getInstance(authToken); boolean isSystemAdmin = ((Boolean)session.getValue("yazdAdmin.systemAdmin")).booleanValue(); // redirect to error page if we're not a user admin or a system admin if( !isSystemAdmin ) { throw new UnauthorizedException("You don't have permission to work with system administrators."); } %> <% ////////////////////////////////// // error variables for parameters boolean errorEmail = false; boolean errorUsername = false; boolean errorNoPassword = false; boolean errorNoConfirmPassword = false; boolean errorPasswordsNotEqual = false; // error variables from user creation boolean errorUserAlreadyExists = false; boolean errorNoPermissionToCreate = false; // overall error variable boolean errors = false; // creation success variable: boolean success = false; %> <% //////////////////// // get parameters String name = ParamUtils.getParameter(request,"name"); String email = ParamUtils.getParameter(request,"email"); String username = ParamUtils.getParameter(request,"username"); String password = ParamUtils.getParameter(request,"password"); String confirmPassword = ParamUtils.getParameter(request,"confirmPassword"); boolean usernameIsEmail = ParamUtils.getCheckboxParameter(request,"usernameIsEmail"); boolean nameVisible = !ParamUtils.getCheckboxParameter(request,"hideName"); boolean emailVisible = !ParamUtils.getCheckboxParameter(request,"hideEmail"); boolean doCreate = ParamUtils.getBooleanParameter(request,"doCreate"); %> <% /////////////////////////////////////////////////////////////////// // trim up the passwords so no one can enter a password of spaces if( password != null ) { password = password.trim(); if( password.equals("") ) { password = null; } } if( confirmPassword != null ) { confirmPassword = confirmPassword.trim(); if( confirmPassword.equals("") ) { confirmPassword = null; } } %> <% ////////////////////// // check for errors if( doCreate ) { if( email == null ) { errorEmail = true; } if( username == null ) { errorUsername = true; } if( password == null ) { errorNoPassword = true; } if( confirmPassword == null ) { errorNoConfirmPassword = true; } if( password != null && confirmPassword != null && !password.equals(confirmPassword) ) { errorPasswordsNotEqual = true; } errors = errorEmail || errorUsername || errorNoPassword || errorNoConfirmPassword || errorPasswordsNotEqual; } %> <% //////////////////////////////////////////////////////////////// // if there are no errors at this point, start the process of // adding the user // get a profile manager to edit user properties ProfileManager manager = forumFactory.getProfileManager(); if( !errors && doCreate ) { try { User newUser = manager.createUser(username,password,email); newUser.setName( name ); newUser.setEmailVisible( emailVisible ); newUser.setNameVisible( nameVisible ); success = true; } catch( UserAlreadyExistsException uaee ) { errorUserAlreadyExists = true; errorUsername = true; errors = true; } catch( UnauthorizedException ue ) { errorNoPermissionToCreate = true; errors = true; } } %> <% ////////////////////////////////////////////////////////////////////// // if a user was successfully created, say so and return (to stop the // jsp from executing if( success ) { response.sendRedirect("users.jsp?msg=" + URLEncoder.encode("User was created successfully")); return; } %> <html> <head> <title></title> <link rel="stylesheet" href="style/global.css"> </head> <body background="images/shadowBack.gif" bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000"> <% /////////////////////// // pageTitleInfo variable (used by include/pageTitle.jsp) String[] pageTitleInfo = { "Users", "System Administrators" }; %> <% /////////////////// // pageTitle include %><%@ include file="include/pageTitle.jsp" %> <p> Current System Administrators: <p> <table bgcolor="#666666" border="0" cellpadding="0" cellspacing="0" width="100%"> <td> <table border="0" cellpadding="2" cellspacing="1" width="100%"> <tr bgcolor="#eeeeee"> <td class="userHeader" width="2%" nowrap>&nbsp;ID&nbsp;</td> <td width="25%"><b>Username</b></td> <td width="36%"><b>Name</b></td> <td width="25%"><b>Email</b></td> <td class="userHeader" width="4%" nowrap>Edit<br>Properties</td> <%--<td class="userHeader" width="4%" nowrap>Permissions</td>--%> <td class="userHeader" width="4%" nowrap>Remove</td> </tr> <% Iterator userIterator = manager.users(); %> <% if( !userIterator.hasNext() ) { %> <tr bgcolor="#ffffff"> <td colspan="5"> <i>No system administrators.</i> </td> </tr> <% } %> <% while( userIterator.hasNext() ) { %> <% User user = (User)userIterator.next(); //Authorization userAuth = authFactory.getAuthorization( // XXX fix this! boolean sysAdmin = user.hasPermission(ForumPermissions.SYSTEM_ADMIN); if( sysAdmin ) { int userID = user.getID(); username = user.getUsername(); name = user.getName(); email = user.getEmail(); %> <tr bgcolor="#ffffff"> <td align="center"><%= userID %></td> <td> <b><%= username %></b> </td> <td> <%= (name!=null&&!name.equals(""))?name:"&nbsp;" %> </td> <td> <%= (email!=null&&!email.equals(""))?email:"&nbsp;" %> </td> <td align="center"> <input type="radio" name="props" value="" onclick="location.href='editUser.jsp?user=<%= username %>';"> </td> <%-- <td align="center"> <input type="radio" name="props" value="" onclick="location.href='userProps.jsp?user=<%= username %>';"> </td> --%> <td align="center"> <input type="radio" name="props" value="" onclick="location.href='removeUser.jsp?user=<%= username %>';"> </td> </tr> <% } %> <% } %> </tr> </table> </td> </table> <p> <% // print error messages if( !success && errors ) { %> <p><font color="#ff0000"> <% if( errorUserAlreadyExists ) { %> The username "<%= username %>" is already taken. Please try another one. <% } else if( errorNoPermissionToCreate ) { %> You do not have user creation privileges. <% } else { %> An error occured. Please check the following fields and try again. <% } %> </font><p> <% } %> <p> <font size="-1"> This creates a system administrator. </font> <p> <%-- form --%> <form action="createUser.jsp" method="post" name="createForm"> <input type="hidden" name="doCreate" value="true"> <b>New System Administrator Properties</b> <p> <table bgcolor="#999999" cellspacing="0" cellpadding="0" border="0" width="95%" align="right"> <td> <table bgcolor="#999999" cellspacing="1" cellpadding="3" border="0" width="100%"> <%-- name row --%> <tr bgcolor="#ffffff"> <td><font size="-1">Name <i>(optional)</i></font></td> <td><input type="text" name="name" size="30" value="<%= (name!=null)?name:"" %>"> </td> </tr> <%-- user email --%> <tr bgcolor="#ffffff"> <td><font size="-1"<%= (errorEmail)?(" color=\"#ff0000\""):"" %>>Email</font></td> <td><input type="text" name="email" size="30" value="<%= (email!=null)?email:"" %>"> </td> </tr> <%-- username --%> <tr bgcolor="#ffffff"> <td><font size="-1"<%= (!usernameIsEmail&&errorUsername)?" color=\"#ff0000\"":"" %>> Username <br>&nbsp;(<input type="checkbox" name="usernameIsEmail" id="cb01"<%= (usernameIsEmail)?" checked":"" %> onclick="this.form.username.value=this.form.email.value;"> <label for="cb01">use email</label>) </font> </td> <td><input type="text" name="username" size="30" <% if( usernameIsEmail ) { %> value="<%= (email!=null)?email:"" %>"> <% } else { %> value="<%= (username!=null)?username:"" %>"> <% } %> </td> </tr> <%-- password --%> <tr bgcolor="#ffffff"> <td><font size="-1"<%= (errorNoPassword||errorPasswordsNotEqual)?" color=\"#ff0000\"":"" %> >Password</font></td> <td><input type="password" name="password" value="" size="20" maxlength="30"></td> </tr> <%-- confirm password --%> <tr bgcolor="#ffffff"> <td><font size="-1"<%= (errorNoConfirmPassword||errorPasswordsNotEqual)?" color=\"#ff0000\"":"" %> >Password (again)</font></td> <td><input type="password" name="confirmPassword" value="" size="20" maxlength="30"></td> </tr> </table> </td> </table> <br clear="all"><br> <input type="submit" value="Create Administrator"> &nbsp; <input type="submit" value="Cancel" onclick="location.href='users.jsp';return false;"> </form> <script language="JavaScript" type="text/javascript"> <!-- document.createForm.name.focus(); //--> </script> </body> </html>
{ "pile_set_name": "Github" }
/* lang-gl.js galician translation for SNAP! written by Jens Mönig Copyright (C) 2019 by Jens Mönig This file is part of Snap!. Snap! is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. Note to Translators: -------------------- At this stage of development, Snap! can be translated to any LTR language maintaining the current order of inputs (formal parameters in blocks). Translating Snap! is easy: 1. Download Download the sources and extract them into a local folder on your computer: <http://snap.berkeley.edu/snapsource/snap.zip> Use the German translation file (named 'lang-de.js') as template for your own translations. Start with editing the original file, because that way you will be able to immediately check the results in your browsers while you're working on your translation (keep the local copy of snap.html open in your web browser, and refresh it as you progress with your translation). 2. Edit Edit the translation file with a regular text editor, or with your favorite JavaScript editor. In the first non-commented line (the one right below this note) replace "de" with the two-letter ISO 639-1 code for your language, e.g. fr - French => SnapTranslator.dict.fr = { it - Italian => SnapTranslator.dict.it = { pl - Polish => SnapTranslator.dict.pl = { pt - Portuguese => SnapTranslator.dict.pt = { es - Spanish => SnapTranslator.dict.es = { el - Greek => => SnapTranslator.dict.el = { gl - Galician => => SnapTranslator.dict.gl = { etc. (see <http://en.wikipedia.org/wiki/ISO_639-1>) 3. Translate Then work through the dictionary, replacing the German strings against your translations. The dictionary is a straight-forward JavaScript ad-hoc object, for review purposes it should be formatted as follows: { 'English string': 'Translation string', 'last key': } 'last value' and you only edit the indented value strings. Note that each key-value pair needs to be delimited by a comma, but that there shouldn't be a comma after the last pair (again, just overwrite the template file and you'll be fine). If something doesn't work, or if you're unsure about the formalities you should check your file with <http://JSLint.com> This will inform you about any missed commas etc. 4. Accented characters Depending on which text editor and which file encoding you use you can directly enter special characters (e.g. Umlaut, accented characters) on your keyboard. However, I've noticed that some browsers may not display special characters correctly, even if other browsers do. So it's best to check your results in several browsers. If you want to be on the safe side, it's even better to escape these characters using Unicode. see: <http://0xcc.net/jsescape/> 5. Block specs: At this time your translation of block specs will only work correctly, if the order of formal parameters and their types are unchanged. Placeholders for inputs (formal parameters) are indicated by a preceding % prefix and followed by a type abbreviation. For example: 'say %s for %n secs' can currently not be changed into 'say %n secs long %s' and still work as intended. Similarly 'point towards %dst' cannot be changed into 'point towards %cst' without breaking its functionality. 6. Submit When you're done, rename the edited file by replacing the "de" part of the filename with the two-letter ISO 639-1 code for your language, e.g. fr - French => lang-fr.js it - Italian => lang-it.js pl - Polish => lang-pl.js pt - Portuguese => lang-pt.js es - Spanish => lang-es.js el - Greek => => lang-el.js gl - Galician => => lang-gl.js and send it to me emfor inclusion in the official Snap! distribution. Once your translation has been included, Your name will the shown in the "Translators" tab in the "About Snap!" dialog box, and you will be able to directly launch a translated version of Snap! in your browser by appending lang:xx to the URL, xx representing your translations two-letter code. 7. Known issues In some browsers accents or ornaments located in typographic ascenders above the cap height are currently (partially) cut-off. Enjoy! -Jens */ /*global SnapTranslator*/ SnapTranslator.dict.gl = { /* Special characters: (see <http://0xcc.net/jsescape/>) Ä, ä \u00c4, \u00e4 Ö, ö \u00d6, \u00f6 Ü, ü \u00dc, \u00fc ß \u00df */ // translations meta information 'language_name': 'Galego', // the name as it should appear in the language menu 'language_translator': 'tecnoloxia <2016>,Miguel A. Bouzada <2019>', // your name for the Translators tab 'translator_e-mail': '[email protected], ', // optional 'last_changed': '2019-07-29', // this, too, will appear in the Translators tab // GUI // control bar: 'untitled': 'sen título', 'development mode': 'modo de desenvolvemento', // categories: 'Motion': 'Movemento', 'Looks': 'Aparencia', 'Sound': 'Son', 'Pen': 'Lapis', 'Control': 'Control', 'Sensing': 'Sensores', 'Operators': 'Operadores', 'Variables': 'Variábeis', 'Lists': 'Listas', 'Other': 'Outros', // editor: 'draggable': 'arrastrábel', // tabs: 'Scripts': 'Programas', 'Costumes': 'Vestimentas', 'Backgrounds': 'Fondos', 'Sounds': 'Sons', // names: 'Sprite': 'Obxecto', 'Stage': 'Escenario', // rotation styles: 'don\'t rotate': 'non xira', 'can rotate': 'pode xirar', 'only face left/right': 'só mira á esquerda ou á dereita', // new sprite button: 'add a new sprite': 'engadir un novo obxecto', // tab help 'costumes tab help': 'Podes importar unha imaxe doutro sitio web ou do \n' + 'teu computador arrastrándoa aquí', 'import a sound from your computer\nby dragging it into here': 'Podes importar un son do teu computador arrastrándoo aquí', // primitive blocks: /* Attention Translators: ---------------------- At this time your translation of block specs will only work correctly, if the order of formal parameters and their types are unchanged. Placeholders for inputs (formal parameters) are indicated by a preceding % prefix and followed by a type abbreviation. For example: 'say %s for %n secs' can currently not be changed into 'say %n secs long %s' and still work as intended. Similarly 'point towards %dst' cannot be changed into 'point towards %cst' without breaking its functionality. */ // motion: 'Stage selected:\nno motion primitives': 'Escenario seleccionado:\nnon hai primitivas de movemento\n' + 'dispoñíbeis', 'move %n steps': 'mover %n pasos', 'turn %clockwise %n degrees': 'xirar %clockwise %n graos', 'turn %counterclockwise %n degrees': 'xirar %counterclockwise %n graos', 'point in direction %dir': 'apuntar na dirección %dir', 'point towards %dst': 'apuntar cara a %dst', 'go to x: %n y: %n': 'ir a x: %n y: %n', 'go to %dst': 'ir a %dst', 'glide %n secs to x: %n y: %n': 'esvarar %n seg cara a x: %n y: %n', 'change x by %n': 'engadir %n á coordenada x', 'set x to %n': 'fixar x en %n', 'change y by %n': 'engadir %n á coordenada y', 'set y to %n': 'fixar y en %n', 'if on edge, bounce': 'rebotar se toca nun bordo', 'x position': 'posición x', 'y position': 'posición y', 'direction': 'dirección', // #Osix@ 'switch to costume %cst': 'cambiar a vestimenta a %cst', 'next costume': 'seguinte vestimenta', 'costume #': 'vestimenta núm.', 'say %s for %n secs': 'dicir %s durante %n segs.', 'say %s': 'dicir %s', 'think %s for %n secs': 'pensar %s durante %n segs.', 'think %s': 'pensar %s', 'Hello!': 'Ola!', 'Hmm...': 'Mmm…', 'change %eff effect by %n': 'engadir ao efecto %eff o valor %n', 'set %eff effect to %n': 'fixar efecto %eff a %n', 'clear graphic effects': 'eliminar efectos gráficos', 'change size by %n': 'engadir %n % ao tamaño', 'set size to %n %': 'fixar o tamaño a %n %', 'size': 'tamaño', 'show': 'amosar', 'hide': 'agochar', 'shown?': 'visíbel?', 'go to %layer layer': 'enviar á capa %layer', 'go back %n layers': 'enviar atrás %n capas', 'development mode \ndebugging primitives:': 'Primitivas de depuración \ndo modo de desenvolvemento:', 'console log %mult%s': 'rexistrar %mult%s na consola', 'alert %mult%s': 'Amosar alerta con %mult%s', // sound: 'play sound %snd': 'reproducir son %snd', 'play sound %snd until done': 'reproducir son %snd ata rematar', 'stop all sounds': 'parar todos os sons', 'rest for %n beats': 'silencio durante %n pulsos', 'play note %n for %n beats': 'reproducir a nota %n durante %n pulsos', 'set instrument to %inst': 'fixar o instrumento a %inst', 'change tempo by %n': 'aumentar o tempo en %n', 'set tempo to %n bpm': 'fixar o tempo a %n bpm', 'tempo': 'tempo', // "instruments", i.e. wave forms '(1) sine': '(1) \u223F\u223F (onda sinusoidal)', '(2) square': '(2) \u238D\u238D (onda cadrada)', '(3) sawtooth': '(3) \u2A58\u2A58 (onda dente de serra)', '(4) triangle': '(4) \u22C0\u22C0 (onda triangular)', // pen: 'clear': 'limpar', 'pen down': 'baixar lapis', 'pen up': 'subir lapis', 'pen down?': 'lapis abaixo?', 'set pen color to %clr': 'fixar a cor do lapis a %clr', 'change pen color by %n': 'cambiar á cor do lapis a %n', 'set pen color to %n': 'fixar a cor do lapis a %n', 'change pen %hsva by %n': 'cambiar %hsva do lapis a %n', 'set pen %hsva to %n': 'fixar %hsva do lapis a %n', 'change pen shade by %n': 'cambiar á intensidade do lapis en %n', 'set pen shade to %n': 'fixar a intensidade en %n', 'change pen size by %n': 'cambiar o tamaño do lapis en %n', 'set pen size to %n': 'fixar o tamaño do lapis en %n', 'set background color to %clr': 'fixar a cor do fondo a %clr', 'change background %hsva by %n': 'cambiar %hsva do fondo en %n', 'set background %hsva to %n': 'fixar %hsva do fondo a %n', 'stamp': 'selar', 'fill': 'encher', // control: 'when %greenflag clicked': 'ao facer clic en %greenflag', 'when %keyHat key pressed': 'ao premer a tecla %keyHat', 'when I am %interaction': 'ao %interaction nesta personaxe', 'clicked': 'facer clic', 'pressed': 'premer', 'dropped': 'arrastrar e soltar', 'mouse-entered': 'tocar co rato', 'mouse-departed': 'separar o rato', 'when %b': 'cando %b', 'when I receive %msgHat': 'ao recibir %msgHat', 'broadcast %msg': 'enviar a todos %msg', 'broadcast %msg and wait': 'enviar a todos %msg e agardar', 'Message name': 'Nome da mensaxe', 'message': 'Mensaxe', 'any message': 'calquera mensaxe', 'wait %n secs': 'agardar %n s', 'wait until %b': 'agardar ata %b', 'forever %loop': 'por sempre %loop', 'repeat %n %loop': 'repetir %n %loop', 'repeat until %b %loop': 'repetir ata %b %loop', 'for %upvar = %n to %n %cla': 'para %upvar = %n ata %n %cla', 'if %b %c': 'se %b %c', 'if %b %c else %c': 'se %b %c se non %c', 'if %b then %s else %s': 'se %b entón %s se non %s', 'report %s': 'reportar %s', 'stop %stopChoices': 'parar %stopChoices', 'all': 'todo', 'this script': 'este programa', 'this block': 'este bloque', 'stop %stopOthersChoices': 'parar %stopOthersChoices', 'all but this script': 'todos os programas agás este', 'other scripts in sprite': 'outros programas no obxecto', 'pause all %pause': 'poñer en pausa todo %pause', 'run %cmdRing %inputs': 'executar %cmdRing %inputs', 'launch %cmdRing %inputs': 'iniciar %cmdRing %inputs', 'call %repRing %inputs': 'chamar %repRing %inputs', 'run %cmdRing w/continuation': 'executar %cmdRing con continuación', 'call %cmdRing w/continuation': 'chamar %cmdRing con continuación', 'warp %c': 'Executar %c de súpeto', 'when I start as a clone': 'cando comece como clon', 'create a clone of %cln': 'crear un clon de %cln', 'a new clone of %cln': 'un novo clon de %cln', 'myself': 'eu mesmo', 'delete this clone': 'eliminar este clon', 'tell %spr to %cmdRing %inputs': 'dicir a %spr que %cmdRing %inputs', 'ask %spr for %repRing %inputs': 'preguntar a %spr por %repRing %inputs', // sensing: 'touching %col ?': 'tocando %col ?', 'touching %clr ?': 'tocando na cor %clr ?', 'color %clr is touching %clr ?': 'a cor %clr está a tocar na cor %clr ?', 'ask %s and wait': 'preguntar %s e agardar pola resposta', 'what\'s your name?': 'como te chamas?', 'answer': 'resposta', 'mouse x': 'coordenada x do rato', 'mouse y': 'coordenada y do rato', 'mouse down?': 'botón do rato premido?', 'key %key pressed?': 'tecla %key premida?', 'distance to %dst': 'distancia ata %dst', 'reset timer': 'reiniciar o cronómetro', 'timer': 'cronómetro', '%att of %spr': '%att de %spr', 'my %get': 'o() meu(s) %get', 'http:// %s': 'o recurso http:// %s', 'turbo mode?': 'modo turbo?', 'set turbo mode to %b': 'cambiar o modo turbo a %b', 'is %setting on?': 'está o parámetro %setting activado?', 'set %setting to %b': 'fixar o parámetro %setting a %b', 'turbo mode': 'modo turbo', 'flat line ends': 'puntas do lapis rectas', 'video %vid on %self': '%vid do vídeo en %self', 'motion': 'movemento', 'snap': 'instantánea', 'set video transparency to %n': 'fixar a transparencia do vídeo a %n', 'video capture': 'captura de vídeo', 'mirror video': 'espello sobre o vídeo', 'filtered for %clr': 'filtrado para %clr', 'stack size': 'altura da morea', 'frames': 'marcos', 'object %self': 'obxecto %self', // operators: '%n mod %n': 'o resto de %n ao dividilo entre %n', 'round %n': 'arredondar %n', '%fun of %n': '%fun de %n', 'pick random %n to %n': 'número ao chou entre %n e %n', '%b and %b': '%b e %b', '%b or %b': '%b ou %b', 'not %b': 'non %b', 'true': 'verdadeiro', 'false': 'falso', 'join %words': 'xuntar %words', 'split %s by %delim': 'lista cos anacos de %s entre %delim', 'hello': 'ola', 'world': 'mundo', 'letter %idx of %s': 'letra %idx de %s', 'length of %s': 'lonxitude de %s', 'unicode of %s': 'código Unicode do carácter %s', 'unicode %n as letter': 'carácter cuxo código Unicode é %n', 'is %s a %typ ?': '%s é un/unha %typ ?', 'is %s identical to %s ?': '%s é idéntico a %s ?', 'type of %s': 'tipo de %s', // variables: 'Make a variable': 'Crear unha variábel', 'Variable name': 'Nome da variábel', 'Script variable name': 'Nome da variábel do programa', 'inherit %shd': 'herdar %shd', 'Delete a variable': 'Eliminar unha variábel', 'set %var to %s': 'fixar %var a %s', 'change %var by %n': 'aumentar %var en %n', 'show variable %var': 'amosar a variábel %var', 'hide variable %var': 'agochar a variábel %var', 'script variables %scriptVars': 'variábeis de programa %scriptVars', // lists: 'list %exp': 'lista %exp', 'numbers from %n to %n': 'números dende %n a %n', '%s in front of %l': 'inserir %s ao principio de %l', 'item %idx of %l': 'elemento %idx de %l', 'all but first of %l': '%l sen o primeiro elemento', 'length of %l': 'lonxitude de %l', '%l contains %s': '%l contén %s', 'thing': 'cousa', 'is %l empty?': '%l baleira?', 'map %repRing over %l': 'asignar %repRing sobre %l', 'keep items %predRing from %l': 'manter os elementos onde %predRing de %l', 'find first item %predRing in %l': 'primeiro elemento onde %predRing de %l', 'combine %l using %repRing': 'combina os elementos de %l con %repRing', '%blitz map %repRing over %l': '%blitz asignar %repRing sobre %l', '%blitz keep items %predRing from %l': '%blitz mantér os elementos onde %predRing de %l', '%blitz find first item %predRing in %l': '%blitz primeiro elemento onde %predRing de %l', '%blitz combine %l using %repRing': '%blitz combinar os elementos de %l con %repRing', 'for each %upvar in %l %cla': 'para cada %upvar de %l %cla', 'item': 'elemento', 'add %s to %l': 'engadir %s á lista %l', 'delete %ida of %l': 'eliminar %ida da lista %l', 'insert %s at %idx of %l': 'inserir %s na posición %idx de %l', 'replace item %idx of %l with %s': 'substituír %idx de %l por %s', // other 'Make a block': 'Crear un bloque', // menus // snap menu 'About...': 'Sobre…', 'Reference manual': 'Manual de referencia', 'Snap! website': 'Sitio web do Snap!', 'Download source': 'Descargar o código fonte', 'Switch back to user mode': 'Volver ao modo usuario/a', 'disable deep-Morphic\ncontext menus\nand show user-friendly ones': 'Desactivar os menús de\ncontextodo «Morphic»\nprofundo e amosar menús\namigábeis.', 'Switch to dev mode': 'Cambiar a modo de desenvolvemento', 'enable Morphic\ncontext menus\nand inspectors,\nnot user-friendly!': 'Activar os menús\nde contexto e\n os inspectores do «Morphic»,\nnon amigábeis.', // project menu 'Project notes...': 'Notas do proxecto…', 'New': 'Novo', 'Open...': 'Abrir…', 'Save': 'Gardar', 'Save to disk': 'Gardar no disco', 'store this project\nin the downloads folder\n(in supporting browsers)': 'Gardar este proxecto\nno cartafol de descargas\n' + '(nos navegadores que o admitan).', 'Save As...': 'Gardar como…', 'Import...': 'Importar…', 'file menu import hint': 'Importar proxectos, bloques,\nvestimentas ou sons', 'Export project as plain text...': 'Exportar o proxecto como texto…', 'Export project...': 'Exportar o proxecto…', 'show project data as XML\nin a new browser window': 'Amosar a información do proxecto\ncomo XML nunha nova xanela', 'Export blocks...': 'Exportar bloques…', 'show global custom block definitions as XML\nin a new browser window': 'Amosar definicións de bloques globais\npersonalizados como XML nunha\nnova xanela', 'Unused blocks...': 'Bloques non utilizados…', 'find unused global custom blocks\nand remove their definitions': 'Atopar bloques globais personalizados\nsen usar e retirar as súas definicións', 'Remove unused blocks': 'Retirar bloques non utilizados', 'there are currently no unused\nglobal custom blocks in this project': 'Actualmente non hai bloques globais\npersonalizados sen usar neste proxecto', 'unused block(s) removed': 'Retirados os bloques non utilizados', 'Export summary...': 'Exportar o resumo…', 'open a new browser browser window\n with a summary of this project': 'Abre unha xanela do navegador\n cun resumo deste proxecto', 'Contents': 'Contidos', 'Kind of': 'Do tipo de', 'Part of': 'Parte de', 'Parts': 'Partes', 'Blocks': 'Bloques', 'For all Sprites': 'Para todos os obxectos', 'Libraries...': 'Bibliotecas…', 'Import library': 'Importar biblioteca', // cloud menu 'Login...': 'Acceder…', 'Signup...': 'Rexistrar unha nova conta…', // settings menu 'Language...': 'Idioma…', 'Zoom blocks...': 'Ampliación dos bloques…', 'Stage size...': 'Tamaño do escenario…', 'Stage size': 'Tamaño do escenario', 'Stage width': 'Largura do escenario', 'Stage height': 'Altura do escenario', 'Default': 'Predeterminado', 'Blurred shadows': 'Sombras difusas', 'uncheck to use solid drop\nshadows and highlights': 'Desmarcar para usar sombras\ne realces nidios', 'check to use blurred drop\nshadows and highlights': 'Marcar para usar sombras\ne realces difusos', 'Zebra coloring': 'Coloración de cebra', 'check to enable alternating\ncolors for nested blocks': 'Marcar para alternar as\ncores dos bloques aniñados', 'uncheck to disable alternating\ncolors for nested block': 'Desmarcar para deixar de alternar\nas cores dos bloques aniñados', 'Dynamic input labels': 'Etiquetas de entrada dinámicas', 'uncheck to disable dynamic\nlabels for variadic inputs': 'Desmarcar para desactivar as etiquetas\ndinámicas para entradas de\nariedade variábel', 'check to enable dynamic\nlabels for variadic inputs': 'Marcar para activar etiquetas\ndinámicas para entradas de\nariedade variábel', 'Prefer empty slot drops': 'Dar preferencia ás rañuras baleiras', 'settings menu prefer empty slots hint': 'Marcar para impedir que os bloques poidan\nocupar o lugar doutros a seren soltados', 'uncheck to allow dropped\nreporters to kick out others': 'Desmarcar para permitir que os bloques poidan\nocupar o lugar doutros ao seren soltados', 'Long form input dialog': 'Forma longa da caixa de diálogo dos parámetros', 'Plain prototype labels': 'Etiquetas dos prototipos simples', 'uncheck to always show (+) symbols\nin block prototype labels': 'Desmarcar para amosar os símbolos (+)\nno texto dos prototipos dos bloques', 'check to hide (+) symbols\nin block prototype labels': 'Marcar para agochar os símbolos (+)\nno texto dos prototipos dos bloques', 'check to always show slot\ntypes in the input dialog': 'Marcar para amosar sempre os tipos de espazos na caixa de diálogo', 'uncheck to use the input\ndialog in short form': 'Desmarcar para usar a forma curta da caixa de diálogo', 'Virtual keyboard': 'Teclado virtual', 'uncheck to disable\nvirtual keyboard support\nfor mobile devices': 'Desmarcar para desactivar\na compatibilidade do teclado virtual\npara dispositivos móbiles', 'check to enable\nvirtual keyboard support\nfor mobile devices': 'Marcar para activar\na compatibilidade para teclado virtual\npara dispositivos móbiles', 'Input sliders': 'Potenciómetros de entrada', 'uncheck to disable\ninput sliders for\nentry fields': 'Desmarcar para desactivar\nos potenciómetros de entrada.', 'check to enable\ninput sliders for\nentry fields': 'Marcar para activar\nos potenciómetros de entrada.', 'Clicking sound': 'Son do clic', 'uncheck to turn\nblock clicking\nsound off': 'Desmarcar para desactivar\no son ao facer clic', 'check to turn\nblock clicking\nsound on': 'Marcar para activar o son\nao facer clic', 'Animations': 'Animacións', 'uncheck to disable\nIDE animations': 'Desmarcar para desactivar\n as animacións da interface', 'Turbo mode': 'Modo turbo', 'check to prioritize\nscript execution': 'Marcar para priorizar a\nexecución dos programa', 'uncheck to run scripts\nat normal speed': 'Desmarcar para executar os\nprogramas á velocidade normal', 'check to enable\nIDE animations': 'Marcar para activar\n as animacións da interface', 'Flat design': 'Deseño recto', 'Nested auto-wrapping': 'Encapsular bloques internos', 'Keyboard Editing': 'Edición usando teclado', 'Table support': 'Edición de táboas', 'Table lines': 'Liñas de táboas', 'Visible stepping': 'Trazado paso a paso visíbel', 'Thread safe scripts': 'Fíos de execución seguros', 'uncheck to allow\nscript reentrance': 'Desmarcar para permitir a reentrada nos programas', 'check to disallow\nscript reentrance': 'Marcar para denegar a reentrada nos programas', 'Prefer smooth animations': 'Preferir animacións suaves', 'uncheck for greater speed\nat variable frame rates': 'Desmarcar para aumentar a velocidade\na cadros por segundo variábeis', 'check for smooth, predictable\nanimations across computers': 'Marcar para obter animacións máis suaves\ne previsíbeis entre computadoras', 'Flat line ends': 'Extremos das liñas rectos', 'check for flat ends of lines': 'Marcar para facer que os\nextremos das liñas sexan rectos', 'uncheck for round ends of lines': 'Desmarcar para facer que os\nextremos das liñas sexan arredondados', 'Ternary Boolean slots': 'Tres opcións para as rañuras booleanas', 'Camera support': 'Compatibilidade coa cámara', 'Inheritance support': 'Compatibilidade coa a herdanza de obxectos', // inputs 'with inputs': 'con entradas', 'input names:': 'nomes de entradas:', 'Input Names:': 'Nomes de entradas:', 'input list:': 'Lista de entradas:', // context menus: 'help': 'Axuda', // palette: 'find blocks': 'Buscar bloques', 'hide primitives': 'Agochar os bloques primitivos', 'show primitives': 'Amosar os bloques primitivos', // blocks: 'help...': 'Axuda…', 'relabel...': 'volver etiquetar…', 'compile': 'compilar', 'experimental!\nmake this reporter fast and uninterruptable\nCAUTION: Errors in the ring\ncan break your Snap! session!': 'experimental!\nfaga este reporteiro rápido e ininterrompíbel\nPRECAUCIÓN: Os erros do anel poden\nquebrar a súa sesión do Snap!', 'uncompile': 'descompilar', 'duplicate': 'Duplicar', 'make a copy\nand pick it up': 'Facer unha copia do bloque\ne collela', 'only duplicate this block': 'Duplicar só este bloque', 'delete': 'Eliminar', 'script pic...': 'Imaxe do programa…', 'open a new window\nwith a picture of this script': 'Abrir unha nova xanela\ncunha imaxe deste programa', 'ringify': 'Engadir anel', 'unringify': 'Eliminar anel', 'transient': 'Transitorio', 'uncheck to save contents\nin the project': 'Desmarcar para gardar\no contido no proxecto', 'check to prevent contents\nfrom being saved': 'Marcar para non gardar\no contido no proxecto', 'new line': 'Nova liña', // custom blocks: 'delete block definition...': 'Eliminar a definición do bloque…', 'edit...': 'Editar…', 'duplicate block definition...': 'Duplicar a definición deste bloque…', 'Same Named Blocks': 'Bloques co mesmo nome', 'Another custom block with this name exists.\n': 'Xa existe outro bloque personalizado co mesmo nome.\n', 'Would you like to replace it?': 'Queres substituílo?', 'Local Block(s) in Global Definition': 'Bloques locais nunha definición global', 'This global block definition contains one or more\nlocal custom blocks which must be removed first.': 'Esta definición de bloque global contén un ou máis\nbloques personalizados locais que hai que\neliminar primeiro.', // sprites: 'edit': 'editar', 'clone': 'clonar', 'move': 'mover', 'pivot': 'pivotar', 'edit the costume\'s\nrotation center': 'Cambiar o centro de rotación da vestimenta', 'detach from': 'soltar de', 'detach all parts': 'soltar todas as partes', 'export...': 'exportar…', 'parent...': 'proxenitor…', 'current parent': 'proxenitor actual', 'release': 'liberar', 'make temporary and\nhide in the sprite corral': 'faino temporal e agóchao\nna área dos obxectos', // stage: 'show all': 'amosar todos', 'pic...': 'imaxe…', 'open a new window\nwith a picture of the stage': 'Abrir unha nova xanela cunha imaxe do escenario', // scripting area 'clean up': 'limpar', 'arrange scripts\nvertically': 'Organizar os programas\nverticalmente', 'add comment': 'Engadir un comentario', 'undrop': 'Desfacer', 'undo the last\nblock drop\nin this pane': 'Desfacer a última\nacción nun bloque\nneste panel', 'redrop': 'refacer', 'use the keyboard\nto enter blocks': 'Utilizar o teclado\npara escribir os bloques', 'scripts pic...': 'Imaxe de programas…', 'open a new window\nwith a picture of all scripts': 'Abre unha nova xanela\ncunha imaxe de todos\nos programas', 'make a block...': 'Crear un bloque…', // costumes 'rename': 'Renomear', 'export': 'Exportar', 'rename costume': 'Renomear a vestimenta', // sounds 'Play sound': 'Reproducir o son', 'Stop sound': 'Parar o son', 'Stop': 'Parar', 'Play': 'Reproducir', 'rename sound': 'Renomear o son', // lists and tables 'list view...': 'ver como lista…', 'table view...': 'ver como táboa…', 'open in dialog...': 'abrir nunha caixa de diálogo…', 'reset columns': 'reiniciar columnas', 'items': 'elementos', // dialogs // buttons 'OK': 'Aceptar', 'Ok': 'Aceptar', 'Cancel': 'Cancelar', 'Yes': 'Si', 'No': 'Non', // help 'Help': 'Axuda', // zoom blocks 'Zoom blocks': 'Ampliación dos bloques', 'build': 'Constrúe', 'your own': 'os teus propios', 'blocks': 'bloques', 'normal (1x)': 'normal (1x)', 'demo (1.2x)': 'demostración (1.2x)', 'presentation (1.4x)': 'presentación (1.4x)', 'big (2x)': 'grande (2x)', 'huge (4x)': 'enorme (4x)', 'giant (8x)': 'xigante (8x)', 'monstrous (10x)': 'monstruoso (10x)', // Project Manager 'Untitled': 'Sen título', 'Open Project': 'Abrir proxecto', '(empty)': '(baleiro)', 'Saved!': 'Gardado!', 'Delete Project': 'Eliminar proxecto', 'Are you sure you want to delete': 'Confirmas que queres eliminalo?', 'rename...': 'renomear…', 'Recover': 'Recuperar', 'Today, ': 'Hoxe, ', 'Yesterday, ': 'Onte, ', // costume editor 'Costume Editor': 'Editor de vestimentas', 'click or drag crosshairs to move the rotation center': 'facer clic e arrastrar a mira para alterar o centro de rotación', // project notes 'Project Notes': 'Notas do proxecto', // new project 'New Project': 'Novo proxecto', 'Replace the current project with a new one?': 'Substituír o proxecto actual por un novo?', // save project 'Save Project As...': 'Gardar o proxecto como…', // export blocks 'Export blocks': 'Exportar bloques', 'Import blocks': 'Importar bloques', 'this project doesn\'t have any\ncustom global blocks yet': 'Este proxecto aínda non ten\nningún bloque personalizado global', 'select': 'seleccionar', 'none': 'ningún', // variable dialog 'for all sprites': 'para todos os obxectos', 'for this sprite only': 'só para este obxecto', // variables refactoring 'rename only\nthis reporter': 'renomear só\neste reporteiro', 'rename all...': 'renomear todo…', 'rename all blocks that\naccess this variable': 'renomear todos os bloques\nque acceden a esta variábel', // block dialog 'Change block': 'Cambiar tipo de bloque', 'Command': 'Orde', 'Reporter': 'Reporteiro', 'Predicate': 'Predicado', // block editor 'Block Editor': 'Editor de bloques', 'Method Editor': 'Editor de métodos', 'Apply': 'Aplicar', // block deletion dialog 'Delete Custom Block': 'Eliminar o bloque personalizado', 'block deletion dialog text': 'Confirmas que queres eliminar\neste bloque personalizado e\ntodas as súas instancias?', // input dialog 'Create input name': 'Crear unha rañura', 'Edit input name': 'Editar a rañura', 'Edit label fragment': 'Editar fragmento de etiqueta', 'Title text': 'Texto do título', 'Input name': 'Nome da rañura', 'Delete': 'Eliminar', 'Object': 'Obxecto', 'Number': 'Número', 'Text': 'Texto', 'List': 'Lista', 'Any type': 'Calquera tipo', 'Boolean (T/F)': 'Booleano (V/F)', 'Command\n(inline)': 'Orde\n(en liña)', 'Command\n(C-shape)': 'Orde\n(forma C)', 'Any\n(unevaluated)': 'Calquera\n(sen avaliar)', 'Boolean\n(unevaluated)': 'Booleano\n(sen avaliar)', 'Single input.': 'Entrada única', 'Default Value:': 'Valor predeterminado:', 'Multiple inputs (value is list of inputs)': 'Entradas múltiples (o valor é unha lista de entradas)', 'Upvar - make internal variable visible to caller': 'Saída; fai visíbel unha variábel interna ao chamador', // About Snap 'About Snap': 'Sobre o Snap!', 'Back...': 'Atrás…', 'License...': 'Licenza…', 'Modules...': 'Módulos…', 'Credits...': 'Créditos…', 'Translators...': 'Tradutores…', 'License': 'Licenza', 'current module versions:': 'Versións actuais dos módulos', 'Contributors': 'Colaboradores', 'Translations': 'Traduccións', // variable watchers 'normal': 'normal', 'large': 'grande', 'slider': 'potenciómetro', 'slider min...': 'mínimo do potenciómetro…', 'slider max...': 'máximo do potenciómetro…', 'import...': 'importar…', 'Slider minimum value': 'Valor mínimo do potenciómetro', 'Slider maximum value': 'Valor máximo do potenciómetro', 'raw data...': 'datos en bruto…', 'import without attempting to\nparse or format data': 'Importar sen tentar analizar\nou formatar os datos', // list watchers 'length: ': 'lonxitude: ', // coments 'add comment here...': 'Engade aquí un comentario…', // drow downs // directions '(90) right': '(90) dereita', '(-90) left': '(-90) esquerda', '(0) up': '(0) arriba', '(180) down': '(180) abaixo', // collision detection 'mouse-pointer': 'punteiro do rato', 'edge': 'bordo', 'pen trails': 'riscos do lapis', // costumes 'Turtle': 'Tartaruga', 'Empty': 'baleiro', 'front': 'diante', 'back': 'atrás', // pen 'hue': 'tonalidade', 'transparency': 'transparencia', // graphical effects 'color': 'cor', 'fisheye': 'ollo de peixe', 'whirl': 'remuíño', 'pixelate': 'pixelado', 'mosaic': 'mosaico', 'saturation': 'saturación', 'brightness': 'brillo', 'ghost': 'pantasma', 'negative': 'negativo', 'comic': 'historieta', 'confetti': 'confeti', // keys 'space': 'espazo', 'any key': 'calquera tecla', 'up arrow': 'frecha arriba', 'down arrow': 'frecha abaixo', 'right arrow': 'frecha dereita', 'left arrow': 'frecha esquerda', 'a': 'a', 'b': 'b', 'c': 'c', 'd': 'd', 'e': 'e', 'f': 'f', 'g': 'g', 'h': 'h', 'i': 'i', 'j': 'j', 'k': 'k', 'l': 'l', 'm': 'm', 'n': 'n', 'o': 'o', 'p': 'p', 'q': 'q', 'r': 'r', 's': 's', 't': 't', 'u': 'u', 'v': 'v', 'w': 'w', 'x': 'x', 'y': 'y', 'z': 'z', '0': '0', '1': '1', '2': '2', '3': '3', '4': '4', '5': '5', '6': '6', '7': '7', '8': '8', '9': '9', // messages 'new...': 'Nova…', // math functions 'abs': 'abs (valor absoluto)', 'ceiling': 'arredondar por riba', 'floor': 'arredondar por abaixo', 'sqrt': 'sqrt (raíz cadrada)', 'sin': 'sin (seno)', 'cos': 'cos (coseno)', 'tan': 'tan (tanxente)', 'asin': 'asin (arco-seno)', 'acos': 'acos (arco-coseno)', 'atan': 'atan (arco-tanxente)', 'ln': 'ln (logaritmo neperiano)', 'e^': 'e^ (exponencial)', // Boolean expressions keyboard entry 'not': 'non', // delimiters 'letter': 'letra', 'word': 'palabra', 'whitespace': 'espazo en branco', 'line': 'liña', 'tab': 'tabulador', 'cr': 'retorno de carro', // data types 'number': 'número', 'text': 'texto', 'Boolean': 'Booleano', 'list': 'lista', 'command': 'orde', 'reporter': 'reporteiro', 'predicate': 'predicado', 'sprite': 'obxecto', // list indices 'last': 'último', 'any': 'calquera', // attributes 'neighbors': 'os veciños', 'self': 'eu mesmo', 'other sprites': 'outros obxectos', 'parts': 'as partes', 'anchor': 'a áncora', 'parent': 'o proxenitor', 'temporary?': 'temporal?', 'children': 'os descendentes', 'clones': 'os clons', 'other clones': 'outros clons', 'dangling?': 'pendurado doutro?', 'draggable': 'arrastrábel?', 'rotation style': 'estilo de rotación', 'rotation x': 'rotación x', 'rotation y': 'rotación y', 'center x': 'centro x', 'center y': 'centro y', 'name': 'nome', 'stage': 'escenario', 'costumes': 'vestimentas', 'sounds': 'sons', 'scripts': 'programas', // inheritance 'inherited': 'herdado', 'check to inherit\nfrom': 'Marcar para herdar\n de', 'uncheck to\ndisinherit': 'Desmarcar para\ndesherdar', // missing in lang-de.js - copied from lang-pt.js 'delete %shd': 'eliminar %shd', 'Retina display support': 'Compatibilidade para pantallas Retina', 'uncheck for lower resolution,\nsaves computing resources': 'Desmarcar para menor resolución;\nmellora os recursos computacionais.', 'check for higher resolution,\nuses more computing resources': 'Marcar para maior resolución;\nconsume máis recursos computacionais.', 'First-Class Sprites': 'Obxectos de primeira clase', 'uncheck to disable support\nfor first-class sprites': 'Desmarcar para desactivar a compatibilidade\nde obxectos de primeira clase.', 'check to enable support\n for first-class sprite': 'Marcar para activar a compatibilidade\n de obxectos de primeira clase.', 'Live coding support': 'Compatibilidade de programación ao vivo', 'EXPERIMENTAL! check to enable\n live custom control structures': 'EXPERIMENTAL! Marcar para activar estruturas\n de control personalizadas ao vivo.', 'EXPERIMENTAL! uncheck to disable live\ncustom control structures': 'EXPERIMENTAL! Desmarcar para desactivar estruturas\nde control personalizadas ao vivo.', 'Persist linked sublist IDs': 'Persistencia dos ID de sublistas ligadas', 'check to enable\nsaving linked sublist identities': 'Marcar para activar o\nalmacenamento das identidades de sublistas ligadas.', 'uncheck to disable\nsaving linked sublist identities': 'Desmarcar para desactivar o\nalmacenamento das identidades de sublistas ligadas.', 'grow': 'aumentar', 'shrink': 'reducir', 'flip ↔': 'inverter ↔', 'flip ↕': 'inverter ↕', 'Export all scripts as pic...': 'Exportar todos os obxectos como imaxe…', 'show a picture of all scripts\nand block definitions': 'Amosa unha imaxe con todos\nos obxectos e definicións de bloques', 'current %dates': '%dates actuais', 'year': 'ano', 'month': 'mes', 'date': 'día', 'day of week': 'día da semana', 'hour': 'hora', 'minute': 'minuto', 'second': 'segundo', 'time in milliseconds': 'tempo (en milisegundos)', 'find blocks...': 'buscar bloques…', 'costume name': 'nome da vestimenta', 'Open': 'Abrir', 'Share': 'Compartir', 'Snap!Cloud': 'NubeSnap!', 'Cloud': 'Nube', 'could not connect to:': 'Non foi posíbel conectar con:', 'Service:': 'Servizo:', 'login': 'acceso', 'ERROR: INVALID PASSWORD': 'ERRO: CONTRASINAL INCORRECTO', 'Browser': 'Navegador', 'Sign up': 'Rexistrar nova conta', 'Signup': 'Rexistro de nova conta', 'Sign in': 'Acceder', 'Logout': 'Saír', 'Change Password...': 'Cambiar o contrasinal…', 'Change Password': 'Cambiar o contrasinal', 'Account created.': 'Conta creada.', 'An e-mail with your password\nhas been sent to the address provided': 'Enviouseche un correo-e, ao enderezo\nfornecido, co teu contrasinal.', 'now connected.': 'estás conectado.', 'disconnected.': 'estás desconectado.', 'Reset password': 'Recuperar o contrasinal', 'Reset Password...': 'Recuperar o contrasinal…', 'User name:': 'Nome de usuario/a:', 'Password:': 'Contrasinal:', 'Old password:': 'Contrasinal actual:', 'New password:': 'Novo contrasinal:', 'Repeat new password:': 'Repita o contrasinal:', 'Birth date:': 'Data de nacemento:', 'January': 'xaneiro', 'February': 'febreiro', 'March': 'marzo', 'April': 'abril', 'May': 'maio', 'June': 'xuño', 'July': 'xullo', 'August': 'agosto', 'September': 'setembro', 'October': 'outubro', 'November': 'novembro', 'December': 'decembro', 'year:': 'ano:', ' or before': ' ou antes', 'E-mail address:': 'Enderezo de correo-e:', 'E-mail address of parent or guardian:': 'Enderezo de correo dos pais ou titores:', 'Terms of Service...': 'Termos do servizo…', 'Privacy...': 'Privacidade…', 'I have read and agree\nto the Terms of Service': 'Lin e declaro aceptar\nos Termos do servizo', 'stay signed in on this computer\nuntil logging out': 'Manterme autenticado neste\ncomputador ata que saia', 'please fill out\nthis field': 'Cubre este campo.', 'User name must be four\ncharacters or longer': 'O nome de usuario/a ten que ter\npolo menos catro caracteres.', 'please provide a valid\nemail address': 'Indica un enderezo\nde correo-e válido.', 'password must be six\ncharacters or longer': 'O contrasinal ten que ter\npolo menos seis caracteres.', 'passwords do\nnot match': 'os contrasinais\nnon coinciden.', 'please agree to\nthe TOS': 'Acepta os\nTermos do servizo.', 'Examples': 'Exemplos', 'You are not logged in': 'Aínda non te autenticaches', 'Updating\nproject list...': 'Actualizando a\nlista de proxectos…', 'Opening project...': 'Abrindo o proxecto…', 'Fetching project\nfrom the cloud...': 'Obtendo o proxecto\nda nube…', 'Saving project\nto the cloud...': 'Gardando o proxecto\nna nube…', 'Sprite Nesting': 'Obxectos compostos', 'uncheck to disable\nsprite composition': 'Desmarcar para desactivar\na composición de obxectos.', 'Codification support': 'Compatibilidade da produción de código', 'check for block\nto text mapping features': 'Desmarcar para funcionalidades\nde asignación entre bloques e texto.', 'saved.': 'gardado.', 'options...': 'opcións…', 'read-only': 'só lectura', 'Input Slot Options': 'Opcións de rañura de entrada', 'Enter one option per line.Optionally use "=" as key/value delimiter\ne.g.\n the answer=42': 'Introduce unha opción por liña. Opcionalmente, use «=» como separador\nentre chave e valor, e.g.\n a resposta=42', 'paint a new sprite': 'Pintar un novo obxecto.', 'Paint a new costume': 'Pintar unha nova vestimenta.', 'add a new Turtle sprite': 'Engadir un novo obxecto.', 'check for alternative\nGUI design': 'Marcar para obter unha\ninterface gráfica alternativa.', 'Rasterize SVGs': 'Transformar SVG en mapas de bits', 'check to rasterize\nSVGs on import': 'Marcar para transformar os ficheiros SVG\nen mapas de bits durante a importación.', 'comment pic...': 'imaxe do comentario…', 'open a new window\nwith a picture of this comment': 'Abrir unha nova xanela cunha\nimaxe deste comentario.', 'undo': 'desfacer', //Paint editors 'Vector Paint Editor': 'Editor vectorial de imaxes', 'Brush size': 'Tamaño do pincel', 'Constrain proportions of shapes?\n(you can also hold shift)': 'Preservar proporcións das formas?\n(tamén pode premer a tecla «maiúsculas»)', 'Eraser tool': 'Goma de borrar', 'Paintbrush tool\n(free draw)': 'Pincel\n(man alzada)', 'Line tool\n(shift: vertical/horizontal)': 'Liñas\n(maiúsculas: vertical/horizontal)', 'Line tool\n(shift: constrain to 45º)': 'Liñas\n(maiúsculas: só ángulos de 45º)', 'Stroked Rectangle\n(shift: square)': 'Rectángulo\n(maiúsculas: cadrado)', 'Filled Rectangle\n(shift: square)': 'Rectángulo cheo\n(maiúsculas: cadrado)', 'Rectangle\n(shift: square)': 'Rectángulo\n(maiúsculaa: cadrado)', 'Stroked Ellipse\n(shift: circle)': 'Elipse\n(maiúsculas: círculo)', 'Filled Ellipse\n(shift: circle)': 'Elipse chea\n(maiúsculas: círculo)', 'Ellipse\n(shift: circle)': 'Elipse\n(maiúsculas: círculo)', 'Selection tool': 'Ferramenta de selección', 'Closed brush\n(free draw)': 'Pincel pechado\n(man alzada)', 'Paint a shape\n(shift: edge color)': 'Pintar a forma\n(maiúsculas: cor do bordo)', 'Fill a region': 'Encher a área', 'Set the rotation center': 'Estabelecer o centro de rotación', 'Pipette tool\n(pick a color anywhere)': 'Pipeta\n(recoller unha cor en calquera sitio)', 'Polygon': 'Polígono', 'Paint Editor': 'Editor de pintura', 'square': 'cadrado' , 'pointRight': 'punteiro cara a dereita', 'gears': 'engrenaxes', 'file': 'ficheiro', 'fullScreen': 'pantalla completa', 'normalScreen': 'pantalla normal', 'smallStage': 'escenario pequeno', 'normalStage': 'escenario normal', 'turtle': 'tartaruga', 'turtleOutline': 'contorno de tartaruga', 'pause': 'pausa', 'flag': 'bandeira', 'octagon': 'octógono', 'cloud': 'nube', 'cloudOutline': 'contorno de nube', 'cloudGradient': 'nube con degradado', 'turnRight': 'xirar á dereita', 'turnLeft': 'xirar á esquerda', 'storage': 'almacenaxe', 'poster': 'póster', 'flash': 'flash', 'brush': 'pincel', 'rectangle': 'rectángulo', 'rectangleSolid': 'rectángulo cheo', 'circle': 'circunferencia', 'circleSolid': 'círculo', 'crosshairs': 'punto de mira', 'paintbucket': 'balde de tinta', 'eraser': 'borrador', 'pipette': 'pipeta', 'Pipette tool\n(pick a color from anywhere\nshift: fill color)': 'Recolector de cor\n(recolle unha cor de calquera lugar,\nmaiúsculas: para a cor de enchido)', 'Edge color\n(left click)': 'Cor do bordo\n(botón esquerdo)', 'Fill color\n(right click)': 'Cor de enchido\n(botón dereito)', 'Bitmap': 'Mapa de bits', 'Top': 'Arriba', 'Bottom': 'Abaixo', 'Up': 'Subir', 'Down': 'Baixar', 'This will erase your current drawing.\n': 'O cambio de editor borrará o debuxo actual.\n', 'Are you sure you want to continue?': 'Confirmas que queres continuar?', 'Switch to vector editor?': 'Queres cambiar para o editor vectorial?', 'This will convert your vector objects into\nbitmaps,': 'O cambio converterá os obxectos vectoriais nun\nmapa de bits,', ' and you will not be able to convert\nthem back into vector drawings.\n': ' e non poderás convertelos de novo a\ndebuxos vectoriais..\n', 'Convert to bitmap?': 'Queres cambiar a mapa de bits?', // more simbols 'speechBubble': 'globo (de diálogo)', 'speechBubbleOutline': 'contorno de globo (de diálogo)', 'arrowUp': 'frecha arriba', 'arrowUpOutline': 'contorno de frecha arriba', 'arrowLeft': 'frecha esquerda', 'arrowLeftOutline': 'contorno de frecha esquerda', 'arrowDown': 'frecha abaixo', 'arrowDownOutline': 'contorno de frecha abaixo', 'arrowRight': 'frecha dereita', 'arrowRightOutline': 'contorno de frecha dereita', 'robot': 'robot', 'globe': 'globo terráqueo', 'stepForward': 'paso adiante', 'cross': 'cruz', 'loop': 'bucle', 'turnBack': 'ir cara atrás', 'turnForward': 'ir cara adiante', 'magnifyingGlass': 'lupa', 'magnifierOutline': 'contorno de lupa', 'selection': 'selección', 'polygon': 'polígono', 'closedBrush': 'pincel pechado', 'camera': 'cámara', 'location': 'localización', 'footprints': 'pegadas', 'keyboard': 'teclado', 'keyboardFilled': 'teclado', // 'turn pen trails into new costume...': 'Transformar trazos do lapis nunha nova vestimenta...', 'turn all pen trails and stamps\ninto a new costume for the\ncurrently selected sprite': 'Transforma todos os trazos do lapis\ne selos nunha nova vestimenta\ndo obxecto seleccionado neste momento', 'pen': 'lapis', 'tip': 'punta', 'middle': 'medio', 'last changed': 'última modificación', 'Share Project': 'Compartir o proxecto', 'Unshare Project': 'Deixar de compartir o proxecto', 'sharing\nproject...': 'compartindo\no proxecto…', 'unsharing\nproject...': 'deixando de compartir\no proxecto…', 'shared.': 'compartido.', 'unshared.': 'non compartido.', 'Unshare': 'Deixar de compartir', 'Are you sure you want to unshare': 'Confirmas que queres deixar de compartir', 'Are you sure you want to share': 'Confirmas que queres compartir', 'Publish Project': 'Publicar o proxecto', 'publishing\nproject...': 'publicando\no proxecto…', 'published.': 'publicado.', 'Are you sure you want to publish': 'Confirmas que queres publicar?', 'Unpublish Project': 'Deixar de publicar o proxecto', 'unpublishing\nproject...': 'deixando de publicar\no proxecto…', 'unpublished.': 'non publicado', 'Publish': 'Publicar', 'Unpublish': 'Deixar de publicar', 'Are you sure you want to unpublish': 'Confirmas que queres deixar de publicar?', 'Replace Project': 'Substituír o proxecto', 'Are you sure you want to replace': 'Confirmas que queres substituír o proxecto orixinal?', 'Open Project': 'Abrir o proxecto', 'password has been changed.': 'o seu contrasinal foi cambiado.', 'SVG costumes are\nnot yet fully supported\nin every browser': 'As vestimentas SVG aínda non\nson totalmente compatíbeis en todos\nos navegadores', 'Save Project': 'Gardar proxecto', 'script pic with result...': 'imaxe do programa incluíndo o resultado…', 'open a new window\nwith a picture of both\nthis script and its result': 'Abrir unha nova xanela cunha\nimaxe tanto deste programa\ncomo do seu resultado.', 'JavaScript function ( %mult%s ) { %code }': 'función JavaScript ( %mult%s ) { %code }', 'Select categories of additional blocks to add to this project.': 'Seleccionar categorías de bloques adicionais a engadir a este proxecto.', 'Import sound': 'Importar son', 'Select a sound from the media library': 'Seleccionar un son da mediateca.', 'Import': 'Importar', 'Select a costume from the media library': 'Seleccionar unha vestimenta da mediateca.', 'edit rotation point only...': 'editar só o punto de rotación…', 'Export Project As...': 'Exportar o proxecto como…', 'a variable of name \'': 'A variábel chamada «', '\'\ndoes not exist in this context': '»\nnon existe neste contexto', '(temporary)': '(temporal)', 'expecting': 'Agardando', 'input(s), but getting': 'argumento(s), mais pasaron', 'parent...': 'proxenitor…', 'Dragging threshold...': 'Limiar de arrastre…', 'Cache Inputs': 'Entradas á memoria caché', 'uncheck to stop caching\ninputs (for debugging the evaluator)': 'Desmarcar para non memorizar\nentradas na caché (para depurar o avaliador).', 'check to cache inputs\nboosts recursion': 'Marcar para memorizar as entradas\nna caché (acelera a recursividade).', 'Project URLs': 'URL do proxectomostra', 'check to enable\nproject data in URLs': 'Marcar para activar os datos\ndo proxecto nos URL.', 'uncheck to disable\nproject data in URLs': 'Desmarcar para desactivar\nos datos do proxecto nos URL.', 'export project media only...': 'Exportar só os medios do proxecto…', 'export project without media...': 'Exportar proxecto sen os medios…', 'export project as cloud data...': 'Exportar proxecto como datos da nube…', 'open shared project from cloud...': 'Abrir proxecto compartido a partir da nube…', 'url...': 'URL…', 'Export summary with drop-shadows...': 'Exportar resumo coas imaxes sombreadas…', 'open a new browser browser window\nwith a summary of this project\nwith drop-shadows on all pictures.\nnot supported by all browsers': 'Abrir unha nova xanela no navegador\ncontendo un resumo deste proxecto\nco todas as imaxes sombreadas\n(non admitido en todos os navegadores)', 'specify the distance the hand has to move\nbefore it picks up an object': 'Especificar a distancia que ten que se mover\na man antes de coller algún obxecto', 'block variables...': 'variábeis de bloque…', 'remove block variables...': 'retirar variábeis de bloque…', 'block variables': 'variábeis de bloque', 'experimental -\nunder construction': 'Experimental – \nen construción', 'Table view': 'Ver como táboa', 'open in another dialog...': 'Abrir noutra caixa de diálogo…', 'check for multi-column\nlist view support': 'Marcar para a compatibilidade de\nvistas multicolumna de listas.', 'uncheck to disable\nmulti-column list views': 'Desmarcar para desactivar\nvistas multicolumna de listas.', 'check for higher contrast\ntable views': 'Marcar para vistas de\ntáboa con maior contraste.', 'uncheck for less contrast\nmulti-column list views': 'Desmarcar para vistas multicolumna\nde listas con menor contraste.', '(in a new window)': '(nunha nova xanela)', 'save project data as XML\nto your downloads folder': 'Gardar os datos do proxecto como\nXML no seu cartafol de descargas.', // producción de código // més cadenes... 'map %cmdRing to %codeKind %code': 'asignar %cmdRing no %codeKind %code', 'map String to code %code': 'asignar texto no código %code', 'map %codeListPart of %codeListKind to code %code': 'asignar %codeListPart de %codeListKind no código %code', 'code of %cmdRing': 'o código de %cmdRing', 'delimiter': 'delimitador', 'collection': 'colección', 'variables': 'variábeis', 'parameters': 'parámetros', 'code': 'código', 'header': 'encabezamento', 'header mapping...': 'asignando o encabezamento…', 'code mapping...': 'asignando o código…', 'Code mapping': 'Asignando o código', 'Header mapping': 'Asignando o encabezamento', 'Enter code that corresponds to the block\'s definition. Use the formal parameter\nnames as shown and <body> to reference the definition body\'s generated text code.': 'Introduce o código correspondente á definición do bloque. Use os nomes dos parámetros\ntal como son amosados e empregue <body> para referenciar o código xerado da definición do corpo', 'Enter code that corresponds to the block\'s definition. Choose your own\nformal parameter names (ignoring the ones shown).': 'Introduce o código correspondente á definición do bloque. Escolla os seus propios\nnomes para os parámetros (ignorando os nomes amosados).', 'Enter code that corresponds to the block\'s operation (usually a single\nfunction invocation). Use <#n> to reference actual arguments as shown.': 'Introduce o código que corresponda á operación do bloque (normalmente unha simple\ninvocación de rutina). Use <#n> para referenciar os argumentos tal como son amosados', 'uncheck to disable\nkeyboard editing support': 'Desmarcar para desactivar\na edición usando o teclado.', 'check to enable\nkeyboard editing support': 'Marcar para activar\na edición usando o teclado.', 'uncheck to disable\nsprite inheritance features': 'Desmarcar para desactivar\nfuncionalidades de herdanza de obxectos.', 'check for sprite\ninheritance features': 'Marcar para activar\nfuncionalidades de herdanza de obxectos.', //More strings missed in de and pt translations //Mode developer blocks 'wardrobe': 'vestimentas', 'jukebox': 'sons', 'save %imgsource as costume named %s': 'gardar %imgsource coma unha vestimenta co nome %s', 'screenshot': 'captura de pantalla', 'stage image': 'imaxe do escenario', 'processes': 'procesos', 'show table %l': 'a mosar a táboa %l', '%txtfun of %s': '%txtfun de %s', 'stick to': 'ancora a', //IDE Messages 'entering development mode.\n\nerror catching is turned off,\nuse the browser\'s web console\nto see error messages.': 'Entrando no modo de desenvolvemento.\n\nA captura de erros está desconectada,\nempregue a consola web do navegador\npara ver as mensaxes de erro.', 'entering user mode': 'Entrando no modo de usuario', 'dragging threshold': 'limiar para o arrastre', 'redo the last undone block drop in this pane': 'Refacer o último movemento de bloques desfeito', 'cloud unavailable without a web server.': 'A nube non está dispoñíbel sen un servidor web.', //costumes and backgrounds 'rename background': 'renomear o fondo', 'turn pen trails into new background...': 'Crear un novo fondo a partires da imaxe debuxada…', 'turn all pen trails and stamps\ninto a new background for the stage': 'Crea un novo fondo de escenario a partires da imaxe debuxada e dos selos', //Helping text for menu options 'uncheck for default\nGUI design': 'Desmarcar para o deseño \nda IGU predeterminada', 'uncheck to confine auto-wrapping\nto top-level block stacks': 'Desmarcar para limitar a envoltura automática\na moreas de bloques de nivel superior', 'check to enable auto-wrapping\ninside nested block stacks': 'Marcar para activar a envoltura\nautomática dentro de moreas aniñadas', 'check to turn on\n visible stepping (slow)': 'Marcar para activar a\nexecución paso a paso visíbel (lento)', 'uncheck to turn off\nvisible stepping': 'Desarcar para activar a\n execución paso a paso visíbel', 'check to allow\nempty Boolean slots': 'Marcar para permitir\nrañuras booleanas baleiras', 'uncheck to limit\nBoolean slots to true / false': 'Desmarcar para limitar as\nrañuras booleanas aos valores verdadeiro / falso', 'uncheck to disable\ncamera support': 'Desmarcar para desactivar\na compatibilidade da cámara', 'check to enable\ncamera support': 'Marcar para activar a\ncompatibilidade da cámara', 'uncheck to disable\nblock to text mapping features': 'Desmarcar para desactivar\nas funcións de asignación de bloque a texto', 'uncheck for smooth\nscaling of vector costumes': 'Desmarcar para un escalado\nsuave das vestimentas vectoriais', 'check to enable\nsprite composition': 'Marcar para activar a\ncomposición de obxectos', 'Execute on slider change': 'Executar cando hai cambios no potenciómetro', 'uncheck to suppress\nrunning scripts\nwhen moving the slider': 'Desmarcar para non iniciar\na execución dos programas\nao mover o potenciómetro', 'check to run\nthe edited script\nwhen moving the slider': 'Marcar para activar\na execución dos programas\ao mover o potenciómetro', 'Enable command drops in all rings': 'Activar o arrastre de ordes a todos os aneis', 'uncheck to disable\ndropping commands in reporter rings': 'Desmarcar para desactivar\no arrastre de ordes nos\naneis reporteiros', 'check to enable\ndropping commands in all rings': 'Marcar para activar\no arrastre de ordes en\ntodos os aneis', //Developer mode menus 'user features...': 'características do usuario…', 'color...': 'cor…', '\ncolor:': '\ncor:', 'choose another color \nfor this morph': 'Escolle outra cor para este «morph»', 'transparency...': 'transparencia…', '\nalpha\nvalue:': '\nvalor d\ncanle alfa:', 'set this morph\'s\nalpha value': 'Fixa o valor da canle\nalfa para este «morph»', 'resize...': 'redimensionar…', 'show a handle\nwhich can be dragged\nto change this morph\'s extent': 'Amosa un asa que\nse pode arrastrar para\ncambiar o límite deste «morph»', 'duplicate': 'duplicar', 'make a copy\nand pick it up': 'Facer unha copia\ne collela', 'pick up': 'coller este «morph»', 'detach and put \ninto the hand': 'Arrastrar e mover\nco punteiro', 'attach...': 'xuntar…', 'stick this morph\nto another one': 'Pega este morph»\na outro', 'move...': 'mover…', 'show a handle\nwhich can be dragged\nto move this morph': 'Amosa un asa que\nse pode arrastrar para\nmover este «morph»', 'inspect...': 'examinar…', 'open a window\non all properties': 'Abre unha xanela\ncon todas as propiedades', 'pic...': 'imaxe…', 'open a new window\nwith a picture of this morph': 'Abre unha xanela\ncunha imaxe deste «morph»', 'lock': 'bloquear', 'make this morph\nunmovable': 'Fai que este «morph»\nnon poida ser movido', 'unlock': 'desbloquear', 'make this morph\nmovable': 'Fai que este «morph»\npoida ser movido', 'World...': 'Mundo…', 'show the\nWorld\'s menu': 'Amosa o menú do Mundo', //World options 'demo...': 'exemplo…', 'sample morphs': 'Crea un «morph» de mostra', 'hide all...': 'agochalo todo…', 'show all...': 'amosalo todo…', 'move all inside...': 'mover todo para dentro…', 'keep all submorphs\nwithin and visible': 'Mantér todos os «submorph»\ndentro e deixalos visíbeis', 'open a window on\nall properties': 'Abre unha xanela con\ntodas as propiedades', 'screenshot...': 'captura de pantalla…', 'open a new window\nwith a picture of this morph': 'Abre unha xanela\ncunha imaxe deste «morph»', 'restore display': 'restabelecer a vista', 'redraw the\nscreen once': 'Volve debuxar a\npantalla unha vez', 'fill page...': 'encher a páxina…', 'let the World automatically\nadjust to browser resizing': 'Permite que o Mundo se axuste\nautomaticamente ao cambio de tamaño do navegador', 'sharp shadows...': 'sombras contrastadas…', 'sharp drop shadows\nuse for old browsers': 'Usar sombras contrastadas\npara navegadores antigos', 'blurred shadows...': 'sombras difusas…', 'blurry shades,\n use for new browsers': 'Usar sombras difusas\npara navegadores modernos', 'choose the World\'s\nbackground color': 'Escolle a cor de\nfondo do Mundo', 'touch screen settings': 'axustes para pantalla táctil', 'bigger menu fonts\nand sliders': 'Fai máis grandes os potenciómetros e os menús', 'standard settings': 'axustes estándar', 'smaller menu fonts\nand sliders': 'Fai máis pequenos os potenciómetros e os menús', 'user mode...': 'modo de usuario…', 'disable developers\'\ncontext menus': 'Desactiva os menús\ndo modo de desenvolvemento', 'development mode...': 'modo de desenvolvemento…', 'about morphic.js...': 'sobre o morphic.js…', //Make a Morph 'make a morph': 'crear un «morph»', 'rectangle': 'rectangulo', 'box': 'caixa', 'circle box': 'caixa circular', 'frame': 'marco', 'scroll frame': 'marco con desprazamento', 'handle': 'asa', 'string': 'cadea', 'Hello, World!': 'Ola mundo', 'speech bubble': 'globo (de diálogo)', 'gray scale palette': 'paleta de escala de grises', 'color palette': 'paleta de cores', 'color picker': 'selector de cor', 'sensor demo': 'exemplo de sensor', 'animation demo': 'exemplo de animación', //future JS options 'uncheck to disable support for\nnative JavaScript functions': 'Desmarcar para desactivar\na execución de Javascript', 'check to support\nnative JavaScript functions': 'Marcar para activar\na execución de Javascript', 'JavaScript is not enabled': 'A execución de Javascript está desactivada', //Libraries 'Loading': 'Cargando', 'Imported': 'Importado', 'Iteration, composition': 'Iteracións e composición', 'List utilities': 'Utilidades para listas', 'Streams (lazy lists)': 'Fluxos (listas preguizosas)', 'Variadic reporters': 'Reporteiros de ariedade variábel', 'Web services access (https)': 'Acceso a servizos web (https)', 'Words, sentences': 'Palabras e frases', 'Multi-branched conditional (switch)': 'Condicionais compostos (conmutador)', 'LEAP Motion controller': 'Controlador para LEAP Motion', 'Set RGB or HSV pen color': 'Estabelecer a cor RGB ou HSV do lapis', 'Save and restore pictures drawn by pen': 'Gardar e restaurar as imaxes debuxadas co lapis', 'Catch errors in a script': 'Capturar erros nun programa', 'Allow multi-line text input to a block': 'Permitir texto con múltiples liñas de entrada', // '(no matches)': '(sen resultados)', 'take a camera snapshot and\nimport it as a new sprite': 'tirar unha foto coa cámara\ne importala como un novo obxecto', 'Import a new costume from your webcam': 'Importar unha nova vestimenta coa webcam', 'random': 'ao chou', 'random position': 'posición ao chou', 'center': 'centro', '%rel to %dst': '%rel a %dst', 'distance': 'distancia', 'costume': 'vestimenta', 'sound': 'son', 'Record a new sound': 'Gravar un novo son', 'Sound Recorder': 'Gravadora de son', 'recording': 'gravación', 'JIT compiler support': 'Compatibilidade coa compilación JIT', 'EXPERIMENTAL! uncheck to disable live\nsupport for compiling': 'EXPERIMENTAL! Desmarque para desactivar\na compatibilidade coa compilación dinámica', 'EXPERIMENTAL! check to enable\nsupport for compiling': 'EXPERIMENTAL! Marcar para activar\na compatibilidade coa compilación', 'compile %repRing for %n args': 'compilar %repRing para %n argumentos', 'rotate': 'xirar', 'stopped': 'detido', 'scrolled-up': 'desprazar cara arriba', 'scrolled-down': 'desprazar cara abaixo', 'Resend Verification Email...': 'Enviar de novo o correo de verificación…', 'Resend verification email': 'Enviar de novo o correo de verificación', 'User name:': 'Nome do usuario:', 'Camera not supported': 'Cámara non compatíbel', 'Please make sure your web browser is up to date\nand your camera is properly configured. \n\nSome browsers also require you to access Snap!\nthrough HTTPS to use the camera.\n\nPlase replace the "http://" part of the address\nin your browser by "https://" and try again.': 'Comprobe que o navegador está actualizado\ne a webcam ben configurada.\n\nAlgúns navegadores tamén requiren\nHTTPS para empregar a cámara.\n\nPode probalo cambiando o enderezo «http://»\npor «https://»".', 'Uploading ': 'Enviando', 'Repeat Password:': 'Repite o contrasinal:', '%asp at %loc': '%asp en %loc' , 'sprites': 'obxectos', //Cloud messages 'Unverified account: ': 'Conta sen verificar: ', ' days left': ' días restantes', 'You are now logged in, and your account\nis enabled for three days.\n': 'Agora estás conectado e a túa conta estará\nactivada só durante tres días.\n', 'Please use the verification link that\nwas sent to your email address when you\nsigned up.\n\n': 'Utilice a ligazón de verificación que se lle\nenviou ao seu enderezo de correo-e cando se inscribiu.\n\n', 'If you cannot find that email, please\ncheck your spam folder.': 'Se non atopa o correo, comprobe\nprimeiro o cartafol do correo lixo.', 'If you still\ncannot find it, please use the "Resend\nVerification Email..." option in the cloud\nmenu.\n\n': 'E se non\npode atopalo, empregue a opción de «Enviar de\nnovo o correo de verificación…» nas opcións da\nnube do menú do Snap!\n\n', 'You have ': 'Ten ', ' days left.': ' dias restantes.', //micròfon 'microphone %audio': '%audio do micrófono', 'volume': 'volume', 'note': 'nota', 'pitch': 'ton', 'signals': 'sinais', 'frequencies': 'frecuencias', 'bins': 'compartimentos', 'Microphone resolution...': 'Resolución do micrófono…', 'low': 'baixa', 'normal': 'normal', 'high': 'alta', 'max': 'máxima', // 'play %n Hz for %n secs': 'reproducir %n Hz durante %n segundos', //bibliotecas 'Text Costumes': 'Traxes de texto', 'Provide getters and setters for all GUI-controlled global settings': 'Fornece «getters» e «setters» para todos os axustes globais controlados pola IGU', 'Infinite precision integers, exact rationals, complex': 'Números enteiros de precisión infinita, racionais exactos e complexos', 'Provide 100 selected colors': 'Fornece unha paleta de 100 cores\nseleccionadas', 'Text to speech': 'Texto a voz', 'Animation': 'Animacións', 'Pixels': 'Píxeles', 'Audio Comp': 'Composición de son', '"Bigger" Data': 'Traballando con «Big Data»', 'Frequency Distribution Analysis': 'Analise da distribución de frecuencias', 'World Map': 'Mapa do mundo', 'Create variables in program': 'Creando variábeis dende o programa', 'Deal with JSON data': 'Tratar con datos JSON', 'Parallelization': 'Paralelización', 'String processing': 'Procesamento de cadeas de texto', 'Standard library of powerful blocks (for, map, etc.)': 'Biblioteca estándar de potentes bloques (for, map, etc.)', 'Traditional loop constructs (while, until, etc.) plus the Lisp "named let" (a generalization of FOR) plus functional iteration (repeated invocation of a function) and function composition.': 'Construcción de bucles estándar (while, until, etc.), construcións «named let« propias de Lisp (unha xeneralización dos bucles «for»), iteración funcional (repeticións de chamadas a unha función) e composición de funcións.', 'Some standard functions on lists (append, reverse, etc.)': 'Algunhas funcións estándar para listas (append, reverse, etc.)', 'A variation on the list data type in which each list item aren\'t computed until it\'s needed, so you can construct million-item lists without really taking up all that time or memory, or even infinite-sized lists. (A block that reports all the prime numbers is included as an example.)': 'Unha variación do tipo de dato «lista» no que cada elemento calculase só cando é necesario. Deste xeito poden construírse listas dun millón de elementos sen gastar tempo ou memoria, ou incluso listas infinitas. (Inclúese un bloque de exemplo que informa de todos os números primos.)', 'Versions of +, x, AND, and OR that take more than two inputs.': 'Versións de +, x, AND, e OR que toman máis de dúas rañuras.', 'An extended version of the HTTP:// block that allows POST, PUT, and DELETE as well as GET requests, allows using the secure HTTPS protocol, and gives control over headers, etc.': 'Unha versión ampliada do bloque «HTTP://» que permite facer peticións «POST», «PUT», «DELETE» e «GET», utilizar o protocolo seguro «HTTPS» e controlar as cabeceiras, etc.', 'One of the big ideas in Logo that they left out of Scratch is thinking of text as structured into words and sentences, rather than just a string of characters. This library brings back that idea.': 'Unha das mellores ideas de Logo non incluída no Scratch é a de considerar un texto como unha secuencia de palabras e frases, no canto de simplemente unha cadea de caracteres. Esta biblioteca recupera esa idea.', 'Like "switch" in C-like languages or "cond" in Lisp. Thanks to Nathan Dinsmore for inventing the idea of a separate block for each branch!': 'Como o «switch» de C ou o «cond» de Lisp. Grazas a Nathan Dinsmore por desenvolver a idea dun bloque separado para cada rama!', 'Report hand positions from LEAP Motion controller (leapmotion.com).': 'Informa da posición das mans dende un controlador de movemento LEAP (leapmotion.com).', 'Generate costumes from letters or words of text.': 'Xerar traxes a partires de letras ou palabras… ou calquera texto.', 'Set or report pen color as RGB (red, green, blue) or HSV (hue, saturation, value).': 'Fixa ou informa da cor do lapis en RGB (vermello, verde e azul) ou en HSV (tonalidade, saturación e valor).', 'Run a script; if an error happens, instead of stopping the script with a red halo, run another script to handle the error. Also includes a block to cause an error with a message given as input. Also includes a block to create a script variable and give it a value.': 'Executa un programa; se ocorre un erro, no canto de deter o programa cun aviso vermello, permite executar outro programa para xestionar o erro. Inclúe tamén un bloque para enviar un erro cunha mensaxe dada como entrada e tamén un bloque para crear unha variábel do programa e darlle un valor.', 'In general, text inputs allow only a single line. The MULTILINE block accepts multi-line text input and can be used in text input slots of other blocks.': 'En xeral, as entradas de texto só aceptan unha única liña. O bloque MULTILIÑA acepta texto en varias liñas e pode empregarse como texto de entrada noutros bloques.', 'Eisenberg\'s Law: Anything that can be done from the GUI should be doable from the programming language, and vice versa.': 'A lei de Eisenberg di: Calquer cousa que poida facerse dende a interface gráfica tamén deberá poder facerse dende a linguaxe de programación e viceversa.', 'The full Scheme numeric tower. "USE BIGNUMS <True>" to enable.': 'A torre numérica completa do «Scheme». Empregar «USE BIGNUMS <True>>» para activala.', 'to use instead of hue for better selection': 'Para seleccionar unha cor polo nome e non polo matiz.', 'output text using speech synthesis.': 'Gracias á síntese de voz computerizada, podemos obter son a partires dun texto', 'glide, grow and rotate using easing functions.': 'Facer esvarar, medrar e xirar obxectos usando formas e filtros diferentes nas animacións', 'manipulate costumes pixel-wise.': 'Manipula vestimentas a nivel de píxel.', 'analyze, manipulate and generate sound samples.': 'Analiza, manipula e xera mostras de son', '[EXPERIMENTAL] crunch large lists very fast': '[EXPERIMENTAL] Procesar listas grandes de forma moi rápida.', '[EXPERIMENTAL] analyze data for frequency distribution': '[EXPERIMENTAL] Analizar datos para obter a súa distribución de frecuencias.', 'Create and manage global/sprite/script variables in a script': 'Crear e xestionar "global/sprite/script" variábeis a partires dun programa.', 'Turn JSON strings into lists with the listify block, then retrieve data out of them by using the value at key block.': 'Transforma as cadeas JSON en listas co bloque «listify» (listar), e após recupera datos delas usando o valor do bloque de chaves.', 'Run several scripts in parallel and wait until all are done.': 'Executar varios programas en paralelo e agardar que todos eles rematen.', 'Extract substrings of a string in various ways': 'Extrae subcadeas dunha cadea de varias formas', // 'translations...': 'traducions…', 'width': 'largo', 'height': 'alto', 'pixel': 'píxel', 'pixels': 'píxeles', '%img of costume %cst': '%img da vestimenta %cst', 'stretch %cst x: %n y: %n %': 'estricar %cst a x: %n y: %n %', '%eff effect': 'efecto %eff', 'current': 'actual', 'play sound %snd at %rate Hz': 'reproducir o son %snd a %rate Hz', '%aa of sound %snd': '%aa do son %snd', 'duration': 'duración', 'length': 'lonxitude', 'number of channels': 'número de canles', 'sample rate': 'frecuencia de mostraxe', 'samples': 'mostras', 'change volume by %n': 'aumentar o volume en %n', 'set volume to %n %': 'fixar o volume a %n %', 'change balance by %n': 'aumentar o balance en %n', 'set balance to %n': 'fixar o balance a %n', 'balance': 'balance', 'play frequency %n Hz': 'reproducir a frecuencia %n Hz', 'stop frequency': 'para a frecuencia', 'pen %pen': '%pen do lapis', 'write %s size %n': 'escribir %s de tamaño %n', 'draggable?': 'arrastrábel?', 'frequency': 'frecuencia', 'spectrum': 'espectro', 'resolution': 'resolución', 'neg': 'oposto' };
{ "pile_set_name": "Github" }
# Makefile.in generated by automake 1.11.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = librtmp DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/incarcerate.in $(srcdir)/install.sh.in \ $(srcdir)/uninstall.sh.in COPYING ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = incarcerate install.sh uninstall.sh CONFIG_CLEAN_VPATH_FILES = depcomp = am__depfiles_maybe = AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASFLAGS = @CCASFLAGS@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HOST_CPU = @HOST_CPU@ HOST_OS = @HOST_OS@ HOST_OS_C = @HOST_OS_C@ HOST_SO_LIBPATH = @HOST_SO_LIBPATH@ HOST_TYPE = @HOST_TYPE@ HOST_VENDOR = @HOST_VENDOR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIB_MAJOR_VERSION = @LIB_MAJOR_VERSION@ LIB_MINOR_VERSION = @LIB_MINOR_VERSION@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VS_CROSS_COMPILE = @VS_CROSS_COMPILE@ VS_CROSS_PREFIX = @VS_CROSS_PREFIX@ VS_DEBUG = @VS_DEBUG@ VS_ENABLE_GPL = @VS_ENABLE_GPL@ YASM = @YASM@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps librtmp/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu --ignore-deps librtmp/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): incarcerate: $(top_builddir)/config.status $(srcdir)/incarcerate.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install.sh: $(top_builddir)/config.status $(srcdir)/install.sh.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ uninstall.sh: $(top_builddir)/config.status $(srcdir)/uninstall.sh.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook check-am: all-am check: check-am all-am: Makefile all-local installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-local dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-am install-dvi-am: install-exec-am: @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-local .MAKE: install-am install-data-am install-exec-am install-strip .PHONY: all all-am all-local check check-am clean clean-generic \ clean-libtool clean-local dist-hook distclean \ distclean-generic distclean-libtool distclean-local distdir \ dvi dvi-am html html-am info info-am install install-am \ install-data install-data-am install-data-hook install-dvi \ install-dvi-am install-exec install-exec-am install-exec-hook \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am uninstall uninstall-am uninstall-local include $(abs_top_builddir)/Makefile.global # This file assume the container folder contains the following files: # README : A file saying (at least) what revision we have captive # csrc : The actual source we'll contingure and build # incarcerate : A wrapper script that configures the captive package # : NOTE that captive packages must support VPATH builds # : or the captive_configure needs to force that. # This is the main magic. An "all" build MUST install; otherwise # successive builds that depend on this captive project will fail. # But, we install into a fake DESTDIR, and the container for this # make file will then copy the fake install to the real install # later when we're asked to install for real. # This has the downside that every make does a captive install, but # them's the breaks. all-local: incarcerate-package @echo "Incarcerating package $(srcdir) to fake DESTDIR=$(vs_captive_prefix)" @cd csrc && \ ( $(MAKE) -q all || \ (echo "Out of date files; re-running make" && $(MAKE) all && \ DESTDIR="$(vs_captive_prefix)" $(MAKE) install && \ cd .. && if test -f install.sh; then \ DESTDIR="$(vs_captive_prefix)" sh install.sh; \ fi \ )\ ) @echo "Incarceration complete: $(srcdir)" dist-hook: cp -r $(srcdir)/csrc $(distdir)/csrc rm -rf `find $(distdir)/csrc -name '.svn'` install-exec-hook: incarcerate-package @echo "make install-exec-hook; DESTDIR=$(DESTDIR)" cd csrc && $(MAKE) install-exec install-data-hook: incarcerate-package @echo "make install-data-hook; DESTDIR=$(DESTDIR)" cd csrc && $(MAKE) install-data if test -f $(builddir)/install.sh; then \ DESTDIR="$(DESTDIR)" sh $(builddir)/install.sh; \ fi uninstall-local: incarcerate-package if test -f $(builddir)/uninstall.sh; then \ DESTDIR="$(DESTDIR)" sh $(builddir)/uninstall.sh; \ fi cd csrc && $(MAKE) uninstall check: incarcerate-package cd csrc && $(MAKE) check clean-local: incarcerate-package if test -f $(builddir)/uninstall.sh; then \ DESTDIR="$(vs_captive_prefix)" sh $(builddir)/uninstall.sh; \ fi cd csrc && $(MAKE) clean && DESTDIR="$(vs_captive_prefix)" $(MAKE) uninstall distclean-local: incarcerate-package cd csrc && $(MAKE) distclean # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT:
{ "pile_set_name": "Github" }
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE RankNTypes #-} module Database.Persist.Sql.Types.Internal ( HasPersistBackend (..) , IsPersistBackend (..) , SqlReadBackend (..) , SqlWriteBackend (..) , readToUnknown , readToWrite , writeToUnknown , LogFunc , InsertSqlResult (..) , Statement (..) , IsolationLevel (..) , makeIsolationLevelStatement , SqlBackend (..) , SqlBackendCanRead , SqlBackendCanWrite , SqlReadT , SqlWriteT , IsSqlBackend ) where import Data.List.NonEmpty (NonEmpty(..)) import Control.Monad.IO.Class (MonadIO (..)) import Control.Monad.Logger (LogSource, LogLevel, Loc) import Control.Monad.Trans.Class (lift) import Control.Monad.Trans.Reader (ReaderT, runReaderT, ask) import Data.Acquire (Acquire) import Data.Conduit (ConduitM) import Data.Int (Int64) import Data.IORef (IORef) import Data.Map (Map) import Data.Monoid ((<>)) import Data.String (IsString) import Data.Text (Text) import System.Log.FastLogger (LogStr) import Database.Persist.Class ( HasPersistBackend (..) , PersistQueryRead, PersistQueryWrite , PersistStoreRead, PersistStoreWrite , PersistUniqueRead, PersistUniqueWrite , BackendCompatible(..) ) import Database.Persist.Class.PersistStore (IsPersistBackend (..)) import Database.Persist.Types type LogFunc = Loc -> LogSource -> LogLevel -> LogStr -> IO () data InsertSqlResult = ISRSingle Text | ISRInsertGet Text Text | ISRManyKeys Text [PersistValue] data Statement = Statement { stmtFinalize :: IO () , stmtReset :: IO () , stmtExecute :: [PersistValue] -> IO Int64 , stmtQuery :: forall m. MonadIO m => [PersistValue] -> Acquire (ConduitM () [PersistValue] m ()) } -- | Please refer to the documentation for the database in question for a full -- overview of the semantics of the varying isloation levels data IsolationLevel = ReadUncommitted | ReadCommitted | RepeatableRead | Serializable deriving (Show, Eq, Enum, Ord, Bounded) makeIsolationLevelStatement :: (Monoid s, IsString s) => IsolationLevel -> s makeIsolationLevelStatement l = "SET TRANSACTION ISOLATION LEVEL " <> case l of ReadUncommitted -> "READ UNCOMMITTED" ReadCommitted -> "READ COMMITTED" RepeatableRead -> "REPEATABLE READ" Serializable -> "SERIALIZABLE" data SqlBackend = SqlBackend { connPrepare :: Text -> IO Statement -- | table name, column names, id name, either 1 or 2 statements to run , connInsertSql :: EntityDef -> [PersistValue] -> InsertSqlResult , connInsertManySql :: Maybe (EntityDef -> [[PersistValue]] -> InsertSqlResult) -- ^ SQL for inserting many rows and returning their primary keys, for -- backends that support this functionality. If 'Nothing', rows will be -- inserted one-at-a-time using 'connInsertSql'. , connUpsertSql :: Maybe (EntityDef -> NonEmpty (HaskellName,DBName) -> Text -> Text) -- ^ Some databases support performing UPSERT _and_ RETURN entity -- in a single call. -- -- This field when set will be used to generate the UPSERT+RETURN sql given -- * an entity definition -- * updates to be run on unique key(s) collision -- -- When left as 'Nothing', we find the unique key from entity def before -- * trying to fetch an entity by said key -- * perform an update when result found, else issue an insert -- * return new entity from db -- -- @since 2.6 , connPutManySql :: Maybe (EntityDef -> Int -> Text) -- ^ Some databases support performing bulk UPSERT, specifically -- "insert or replace many records" in a single call. -- -- This field when set, given -- * an entity definition -- * number of records to be inserted -- should produce a PUT MANY sql with placeholders for records -- -- When left as 'Nothing', we default to using 'defaultPutMany'. -- -- @since 2.8.1 , connStmtMap :: IORef (Map Text Statement) , connClose :: IO () , connMigrateSql :: [EntityDef] -> (Text -> IO Statement) -> EntityDef -> IO (Either [Text] [(Bool, Text)]) , connBegin :: (Text -> IO Statement) -> Maybe IsolationLevel -> IO () , connCommit :: (Text -> IO Statement) -> IO () , connRollback :: (Text -> IO Statement) -> IO () , connEscapeName :: DBName -> Text , connNoLimit :: Text , connRDBMS :: Text , connLimitOffset :: (Int,Int) -> Bool -> Text -> Text , connLogFunc :: LogFunc , connMaxParams :: Maybe Int -- ^ Some databases (probably only Sqlite) have a limit on how -- many question-mark parameters may be used in a statement -- -- @since 2.6.1 , connRepsertManySql :: Maybe (EntityDef -> Int -> Text) -- ^ Some databases support performing bulk an atomic+bulk INSERT where -- constraint conflicting entities can replace existing entities. -- -- This field when set, given -- * an entity definition -- * number of records to be inserted -- should produce a INSERT sql with placeholders for primary+record fields -- -- When left as 'Nothing', we default to using 'defaultRepsertMany'. -- -- @since 2.9.0 } instance HasPersistBackend SqlBackend where type BaseBackend SqlBackend = SqlBackend persistBackend = id instance IsPersistBackend SqlBackend where mkPersistBackend = id -- | An SQL backend which can only handle read queries -- -- The constructor was exposed in 2.10.0. newtype SqlReadBackend = SqlReadBackend { unSqlReadBackend :: SqlBackend } instance HasPersistBackend SqlReadBackend where type BaseBackend SqlReadBackend = SqlBackend persistBackend = unSqlReadBackend instance IsPersistBackend SqlReadBackend where mkPersistBackend = SqlReadBackend -- | An SQL backend which can handle read or write queries -- -- The constructor was exposed in 2.10.0 newtype SqlWriteBackend = SqlWriteBackend { unSqlWriteBackend :: SqlBackend } instance HasPersistBackend SqlWriteBackend where type BaseBackend SqlWriteBackend = SqlBackend persistBackend = unSqlWriteBackend instance IsPersistBackend SqlWriteBackend where mkPersistBackend = SqlWriteBackend -- | Useful for running a write query against an untagged backend with unknown capabilities. writeToUnknown :: Monad m => ReaderT SqlWriteBackend m a -> ReaderT SqlBackend m a writeToUnknown ma = do unknown <- ask lift . runReaderT ma $ SqlWriteBackend unknown -- | Useful for running a read query against a backend with read and write capabilities. readToWrite :: Monad m => ReaderT SqlReadBackend m a -> ReaderT SqlWriteBackend m a readToWrite ma = do write <- ask lift . runReaderT ma . SqlReadBackend $ unSqlWriteBackend write -- | Useful for running a read query against a backend with unknown capabilities. readToUnknown :: Monad m => ReaderT SqlReadBackend m a -> ReaderT SqlBackend m a readToUnknown ma = do unknown <- ask lift . runReaderT ma $ SqlReadBackend unknown -- | A constraint synonym which witnesses that a backend is SQL and can run read queries. type SqlBackendCanRead backend = ( BackendCompatible SqlBackend backend , PersistQueryRead backend, PersistStoreRead backend, PersistUniqueRead backend ) -- | A constraint synonym which witnesses that a backend is SQL and can run read and write queries. type SqlBackendCanWrite backend = ( SqlBackendCanRead backend , PersistQueryWrite backend, PersistStoreWrite backend, PersistUniqueWrite backend ) -- | Like @SqlPersistT@ but compatible with any SQL backend which can handle read queries. type SqlReadT m a = forall backend. (SqlBackendCanRead backend) => ReaderT backend m a -- | Like @SqlPersistT@ but compatible with any SQL backend which can handle read and write queries. type SqlWriteT m a = forall backend. (SqlBackendCanWrite backend) => ReaderT backend m a -- | A backend which is a wrapper around @SqlBackend@. type IsSqlBackend backend = (IsPersistBackend backend, BaseBackend backend ~ SqlBackend)
{ "pile_set_name": "Github" }
%%SITE_PERL%%/MRO/Compat.pm %%PERL5_MAN3%%/MRO::Compat.3.gz
{ "pile_set_name": "Github" }
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2020, Shoop Commerce Ltd. All rights reserved. # # This source code is licensed under the OSL-3.0 license found in the # LICENSE file in the root directory of this source tree. import pytest import random from shuup.core.models import Shipment, ShipmentStatus from shuup.testing.factories import ( create_order_with_product, create_product, get_default_shop ) from shuup_tests.simple_supplier.utils import get_simple_supplier @pytest.mark.django_db def test_simple_supplier(rf): supplier = get_simple_supplier() shop = get_default_shop() product = create_product("simple-test-product", shop) ss = supplier.get_stock_status(product.pk) assert ss.product == product assert ss.logical_count == 0 num = random.randint(100, 500) supplier.adjust_stock(product.pk, +num) assert supplier.get_stock_status(product.pk).logical_count == num # Create order order = create_order_with_product(product, supplier, 10, 3, shop=shop) quantities = order.get_product_ids_and_quantities() pss = supplier.get_stock_status(product.pk) assert pss.logical_count == (num - quantities[product.pk]) assert pss.physical_count == num # Create shipment shipment = order.create_shipment_of_all_products(supplier) assert isinstance(shipment, Shipment) pss = supplier.get_stock_status(product.pk) assert pss.logical_count == (num - quantities[product.pk]) assert pss.physical_count == (num - quantities[product.pk]) # Delete shipment with pytest.raises(NotImplementedError): shipment.delete() shipment.soft_delete() assert shipment.is_deleted() pss = supplier.get_stock_status(product.pk) assert pss.logical_count == (num - quantities[product.pk]) assert pss.physical_count == (num)
{ "pile_set_name": "Github" }
#' Get an emoji image from its codepoint #' #' @export #' @rdname emoji_get #' @param input either a codepoint (without \code{\\U} etc), or the result from \code{\link{emoji_search}} #' @param size the size of the resulting image (72, 36, 16) #' @return list of images #' #' @note Adapted from \code{rphylopic} code by Scott Chamberlain #' @importFrom png readPNG #' @importFrom RCurl getURLContent #' @importFrom methods is #' @author David L Miller emoji_get <- function(input, size=72, cdn="https://twemoji.maxcdn.com/2/"){ # set the size (default to biggest for best display) size <- match.arg(as.character(size), c("72", "36", "16")) size <- paste0(size, "x", size) # content delivery network #cdn <- "https://twemoji.maxcdn.com/" format <- ".png" if(is(input, "image_info")){ # if(!size %in% c('thumb','icon')){ # urls <- input[ as.character(input$height) == size , "url" ] # urls <- sapply(urls, function(x) file.path("http://phylopic.org", x), USE.NAMES = FALSE) # } else { # urls <- paste0(gsub("\\.64\\.png", "", unname(daply(input, .(uuid), function(x) x$url[1]))), sprintf(".%s.png", size)) # urls <- sapply(urls, function(x) file.path("http://phylopic.org", x), USE.NAMES = FALSE) # } # lapply(urls, function(x) readPNG(getURLContent(x))) stop("arg!") }else{ url <- paste0(cdn, size, "/", input, format) lapply(url, function(x) readPNG(getURLContent(x))) } }
{ "pile_set_name": "Github" }
################################################################################ # # eigen # ################################################################################ # version 3.2 EIGEN_VERSION = ffa86ffb5570 EIGEN_SITE = https://bitbucket.org/eigen/eigen EIGEN_SITE_METHOD = hg EIGEN_LICENSE = MPL2, BSD-3c, LGPLv2.1 EIGEN_LICENSE_FILES = COPYING.MPL2 COPYING.BSD COPYING.LGPL COPYING.README EIGEN_INSTALL_STAGING = YES EIGEN_INSTALL_TARGET = NO EIGEN_DEST_DIR = $(STAGING_DIR)/usr/include/eigen3 ifeq ($(BR2_PACKAGE_EIGEN_UNSUPPORTED_MODULES),y) define EIGEN_INSTALL_UNSUPPORTED_MODULES_CMDS mkdir -p $(EIGEN_DEST_DIR)/unsupported cp -a $(@D)/unsupported/Eigen $(EIGEN_DEST_DIR)/unsupported endef endif # This package only consists of headers that need to be # copied over to the sysroot for compile time use define EIGEN_INSTALL_STAGING_CMDS $(RM) -r $(EIGEN_DEST_DIR) mkdir -p $(EIGEN_DEST_DIR) cp -a $(@D)/Eigen $(EIGEN_DEST_DIR) $(EIGEN_INSTALL_UNSUPPORTED_MODULES_CMDS) endef $(eval $(generic-package))
{ "pile_set_name": "Github" }
[ new DamageIsDealtTrigger() { @Override public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicDamage damage) { return (damage.isSource(permanent) && damage.isTargetCreature() && damage.isCombat()) ? new MagicEvent( permanent, damage.getTarget().getController(), new MagicMayChoice( "Pay {2}?", new MagicPayManaCostChoice(MagicManaCost.create("{2}")) ), this, "PN may\$ pay {2}\$. If PN doesn't, PN loses 2 life." ): MagicEvent.NONE; } @Override public void executeEvent(final MagicGame game, final MagicEvent event) { if (event.isNo()) { game.doAction(new ChangeLifeAction(event.getPlayer(), -2)); } } } ]
{ "pile_set_name": "Github" }
import createEventHub from '~/helpers/event_hub_factory'; export default createEventHub();
{ "pile_set_name": "Github" }
import { context } from './utils'; const version = require('../package.json').version; import config from './config/config'; import setup from './config/setup'; import groups from './registry/registry'; import { create, load } from './data/parser'; import loadAnimation from './loadAnimation'; import debug from './utils/debug'; export { config, version, setup, groups, create, load, loadAnimation }; const spirit = { config, version, setup, groups, create, load, loadAnimation, }; export default spirit; if (context.isBrowser()) { if (window !== undefined) { // add to global namespace so Spirit Studio can reach it window.spirit = spirit; } if (debug()) { console.warn(`You are running the development build of Spirit v${version}.`); } }
{ "pile_set_name": "Github" }
package colorable import ( "bytes" "io" ) // NonColorable hold writer but remove escape sequence. type NonColorable struct { out io.Writer } // NewNonColorable return new instance of Writer which remove escape sequence from Writer. func NewNonColorable(w io.Writer) io.Writer { return &NonColorable{out: w} } // Write write data on console func (w *NonColorable) Write(data []byte) (n int, err error) { er := bytes.NewReader(data) var bw [1]byte loop: for { c1, err := er.ReadByte() if err != nil { break loop } if c1 != 0x1b { bw[0] = c1 w.out.Write(bw[:]) continue } c2, err := er.ReadByte() if err != nil { break loop } if c2 != 0x5b { continue } var buf bytes.Buffer for { c, err := er.ReadByte() if err != nil { break loop } if ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || c == '@' { break } buf.Write([]byte(string(c))) } } return len(data), nil }
{ "pile_set_name": "Github" }
// SPDX-License-Identifier: GPL-2.0 /* * File: portdrv_pci.c * Purpose: PCI Express Port Bus Driver * Author: Tom Nguyen <[email protected]> * Version: v1.0 * * Copyright (C) 2004 Intel * Copyright (C) Tom Long Nguyen ([email protected]) */ #include <linux/pci.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/pm.h> #include <linux/pm_runtime.h> #include <linux/init.h> #include <linux/pcieport_if.h> #include <linux/aer.h> #include <linux/dmi.h> #include <linux/pci-aspm.h> #include "../pci.h" #include "portdrv.h" /* If this switch is set, PCIe port native services should not be enabled. */ bool pcie_ports_disabled; /* * If this switch is set, ACPI _OSC will be used to determine whether or not to * enable PCIe port native services. */ bool pcie_ports_auto = true; static int __init pcie_port_setup(char *str) { if (!strncmp(str, "compat", 6)) { pcie_ports_disabled = true; } else if (!strncmp(str, "native", 6)) { pcie_ports_disabled = false; pcie_ports_auto = false; } else if (!strncmp(str, "auto", 4)) { pcie_ports_disabled = false; pcie_ports_auto = true; } return 1; } __setup("pcie_ports=", pcie_port_setup); /* global data */ /** * pcie_clear_root_pme_status - Clear root port PME interrupt status. * @dev: PCIe root port or event collector. */ void pcie_clear_root_pme_status(struct pci_dev *dev) { pcie_capability_set_dword(dev, PCI_EXP_RTSTA, PCI_EXP_RTSTA_PME); } static int pcie_portdrv_restore_config(struct pci_dev *dev) { int retval; retval = pci_enable_device(dev); if (retval) return retval; pci_set_master(dev); return 0; } #ifdef CONFIG_PM static int pcie_port_resume_noirq(struct device *dev) { struct pci_dev *pdev = to_pci_dev(dev); /* * Some BIOSes forget to clear Root PME Status bits after system wakeup * which breaks ACPI-based runtime wakeup on PCI Express, so clear those * bits now just in case (shouldn't hurt). */ if (pci_pcie_type(pdev) == PCI_EXP_TYPE_ROOT_PORT) pcie_clear_root_pme_status(pdev); return 0; } static int pcie_port_runtime_suspend(struct device *dev) { return to_pci_dev(dev)->bridge_d3 ? 0 : -EBUSY; } static int pcie_port_runtime_resume(struct device *dev) { return 0; } static int pcie_port_runtime_idle(struct device *dev) { /* * Assume the PCI core has set bridge_d3 whenever it thinks the port * should be good to go to D3. Everything else, including moving * the port to D3, is handled by the PCI core. */ return to_pci_dev(dev)->bridge_d3 ? 0 : -EBUSY; } static const struct dev_pm_ops pcie_portdrv_pm_ops = { .suspend = pcie_port_device_suspend, .resume = pcie_port_device_resume, .freeze = pcie_port_device_suspend, .thaw = pcie_port_device_resume, .poweroff = pcie_port_device_suspend, .restore = pcie_port_device_resume, .resume_noirq = pcie_port_resume_noirq, .runtime_suspend = pcie_port_runtime_suspend, .runtime_resume = pcie_port_runtime_resume, .runtime_idle = pcie_port_runtime_idle, }; #define PCIE_PORTDRV_PM_OPS (&pcie_portdrv_pm_ops) #else /* !PM */ #define PCIE_PORTDRV_PM_OPS NULL #endif /* !PM */ /* * pcie_portdrv_probe - Probe PCI-Express port devices * @dev: PCI-Express port device being probed * * If detected invokes the pcie_port_device_register() method for * this port device. * */ static int pcie_portdrv_probe(struct pci_dev *dev, const struct pci_device_id *id) { int status; if (!pci_is_pcie(dev) || ((pci_pcie_type(dev) != PCI_EXP_TYPE_ROOT_PORT) && (pci_pcie_type(dev) != PCI_EXP_TYPE_UPSTREAM) && (pci_pcie_type(dev) != PCI_EXP_TYPE_DOWNSTREAM))) return -ENODEV; status = pcie_port_device_register(dev); if (status) return status; pci_save_state(dev); if (pci_bridge_d3_possible(dev)) { /* * Keep the port resumed 100ms to make sure things like * config space accesses from userspace (lspci) will not * cause the port to repeatedly suspend and resume. */ pm_runtime_set_autosuspend_delay(&dev->dev, 100); pm_runtime_use_autosuspend(&dev->dev); pm_runtime_mark_last_busy(&dev->dev); pm_runtime_put_autosuspend(&dev->dev); pm_runtime_allow(&dev->dev); } return 0; } static void pcie_portdrv_remove(struct pci_dev *dev) { if (pci_bridge_d3_possible(dev)) { pm_runtime_forbid(&dev->dev); pm_runtime_get_noresume(&dev->dev); pm_runtime_dont_use_autosuspend(&dev->dev); } pcie_port_device_remove(dev); } static pci_ers_result_t pcie_portdrv_error_detected(struct pci_dev *dev, enum pci_channel_state error) { /* Root Port has no impact. Always recovers. */ return PCI_ERS_RESULT_CAN_RECOVER; } static pci_ers_result_t pcie_portdrv_mmio_enabled(struct pci_dev *dev) { return PCI_ERS_RESULT_RECOVERED; } static pci_ers_result_t pcie_portdrv_slot_reset(struct pci_dev *dev) { /* If fatal, restore cfg space for possible link reset at upstream */ if (dev->error_state == pci_channel_io_frozen) { dev->state_saved = true; pci_restore_state(dev); pcie_portdrv_restore_config(dev); pci_enable_pcie_error_reporting(dev); } return PCI_ERS_RESULT_RECOVERED; } static int resume_iter(struct device *device, void *data) { struct pcie_device *pcie_device; struct pcie_port_service_driver *driver; if (device->bus == &pcie_port_bus_type && device->driver) { driver = to_service_driver(device->driver); if (driver && driver->error_resume) { pcie_device = to_pcie_device(device); /* Forward error message to service drivers */ driver->error_resume(pcie_device->port); } } return 0; } static void pcie_portdrv_err_resume(struct pci_dev *dev) { device_for_each_child(&dev->dev, NULL, resume_iter); } /* * LINUX Device Driver Model */ static const struct pci_device_id port_pci_ids[] = { { /* handle any PCI-Express port */ PCI_DEVICE_CLASS(((PCI_CLASS_BRIDGE_PCI << 8) | 0x00), ~0), }, { /* end: all zeroes */ } }; static const struct pci_error_handlers pcie_portdrv_err_handler = { .error_detected = pcie_portdrv_error_detected, .mmio_enabled = pcie_portdrv_mmio_enabled, .slot_reset = pcie_portdrv_slot_reset, .resume = pcie_portdrv_err_resume, }; static struct pci_driver pcie_portdriver = { .name = "pcieport", .id_table = &port_pci_ids[0], .probe = pcie_portdrv_probe, .remove = pcie_portdrv_remove, .err_handler = &pcie_portdrv_err_handler, .driver.pm = PCIE_PORTDRV_PM_OPS, }; static int __init dmi_pcie_pme_disable_msi(const struct dmi_system_id *d) { pr_notice("%s detected: will not use MSI for PCIe PME signaling\n", d->ident); pcie_pme_disable_msi(); return 0; } static const struct dmi_system_id pcie_portdrv_dmi_table[] __initconst = { /* * Boxes that should not use MSI for PCIe PME signaling. */ { .callback = dmi_pcie_pme_disable_msi, .ident = "MSI Wind U-100", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"), DMI_MATCH(DMI_PRODUCT_NAME, "U-100"), }, }, {} }; static int __init pcie_portdrv_init(void) { int retval; if (pcie_ports_disabled) return pci_register_driver(&pcie_portdriver); dmi_check_system(pcie_portdrv_dmi_table); retval = pcie_port_bus_register(); if (retval) { printk(KERN_WARNING "PCIE: bus_register error: %d\n", retval); goto out; } retval = pci_register_driver(&pcie_portdriver); if (retval) pcie_port_bus_unregister(); out: return retval; } device_initcall(pcie_portdrv_init);
{ "pile_set_name": "Github" }
/** * Copyright 2020 The Pennsylvania State University * @license Apache-2.0, see License.md for full text. */ import{LitElement as t,html as e,css as i}from"../../../lit-element/lit-element.js";import"../../../@polymer/iron-icon/iron-icon.js";import"../../../@polymer/iron-icons/iron-icons.js";import"../../lrndesign-avatar/lrndesign-avatar.js";class NavCardItem extends t{static get tag(){return"nav-card-item"}static get properties(){return{accentColor:{type:String,attribute:"accent-color"},allowGrey:{type:Boolean,attribute:"allow-grey"},avatar:{type:String,attribute:"avatar"},dark:{type:Boolean,attribute:"dark"},icon:{type:String,attribute:"icon"},initials:{type:String,attribute:"initials"},invert:{type:Boolean,attribute:"invert"}}}static get haxProperties(){return{canScale:!0,canPosition:!0,canEditSource:!1,gizmo:{title:"Nav card",description:"an accent card of link lists",icon:"av:playlist-play",color:"pink",groups:["Card","Nav","List"],handles:[{type:"todo:read-the-docs-for-usage"}],meta:{author:"nikkimk",owner:"The Pennsylvania State University"}},settings:{quick:[],configure:[{property:"accentColor",title:"Accent Color",description:"Select an accent color.",inputMethod:"colorpicker",required:!1},{property:"dark",title:"Dark",description:"Display the card as dark theme?",inputMethod:"boolean",required:!1},{property:"icon",title:"Icon",description:"Select an icon.",inputMethod:"iconpicker",required:!1},{property:"initials",title:"Initials",description:"Initials to display if there is no icon.",inputMethod:"textfield",required:!1},{property:"avatar",title:"Avatar Image",description:"Select an image",inputMethod:"haxupload",required:!1},{slot:"label",title:"Button or Link",inputMethod:"code-editor",required:!1},{slot:"description",title:"Additional description",inputMethod:"code-editor",required:!1}],advanced:[{property:"allowGrey",title:"Allow Grey",description:"Allows grey if set. Otherwise a color will be assigned.",inputMethod:"boolean"},{property:"avatar",title:"Avatar Icon",description:"Select an icon.",inputMethod:"iconpicker",required:!1},{property:"invert",title:"Invert",description:"Inverts icon coloring.",inputMethod:"boolean"}]}}}static get styles(){return[i` :host { position: relative; display: flex; align-items: center; justify-content: space-between; text-decoration: none; padding: 5px 0; margin-bottom: 1px; color: var(--nav-card-item-color, unset); background-color: var(--nav-card-item-background-color, unset); border-bottom: var( --nav-card-linklist-border-bottom, 1px solid var(--simple-colors-default-theme-grey-4, #666) ); } :host(:last-of-type) { border-bottom: none; } :host([hidden]) { display: none; } :host div { flex: 1 1 auto; } ::slotted([slot="label"]:hover), ::slotted([slot="label"]:focus), :host(:hover) ::slotted([slot="label"]), :host(:focus-within) ::slotted([slot="label"]) { text-decoration: underline; } ::slotted(*) { display: block; } ::slotted([slot="label"]), ::slotted([slot="description"]) { color: inherit; font-family: inherit; } ::slotted([slot="label"]) { text-decoration: inherit; outline: none; border: none; padding: 0; text-align: left; color: var(--nav-card-item-color, unset); background-color: var(--nav-card-item-background-color, unset); font-size: var(--nav-card-item-label-font-size, inherit); font-weight: var(--nav-card-item-label-font-weight, bold); } ::slotted([slot="description"]) { font-size: var(--nav-card-item-label-font-size, 11px); font-weight: var(--nav-card-item-label-font-weight, normal); } ::slotted([slot="label"]):after { content: ""; position: absolute; left: 0; top: 0; right: 0; bottom: 0; } ::slotted([slot="label"]:focus):after { outline: 1px solid blue; } lrndesign-avatar { margin-right: 10px; width: var( --nav-card-item-avatar-width, var(--nav-card-item-avatar-size, 36px) ); height: var( --nav-card-item-avatar-height, var(--nav-card-item-avatar-size, 36px) ); --lrndesign-avatar-width: var( --nav-card-item-avatar-width, var(--nav-card-item-avatar-size, 36px) ); --lrndesign-avatar-height: var( --nav-card-item-avatar-height, var(--nav-card-item-avatar-size, 36px) ); --lrndesign-avatar-border-radius: var( --nav-card-item-avatar-border-radius, 50% ); } iron-icon { margin-left: 10px; width: var( --nav-card-item-icon-width, var(--nav-card-item-icon-size, 24px) ); height: var( --nav-card-item-icon-height, var(--nav-card-item-icon-size, 24px) ); --lrndesign-icon-width: var( --nav-card-item-icon-width, var(--nav-card-item-icon-size, 24px) ); --lrndesign-icon-height: var( --nav-card-item-icon-height, var(--nav-card-item-icon-size 24px) ); } `]}render(){return e` ${this.avatar||this.initials?e` <lrndesign-avatar .accentColor="${this.accentColor||""}" ?allow-grey="${this.allowGrey}" ?dark="${this.dark}" .icon="${this.ico}" ?invert="${this.invert}" .src="${this.src}" .label="${this.label}" ?two-chars="${this.twoChars}" > </lrndesign-avatar> `:""} <div> <slot name="label"></slot> <slot name="description"></slot> </div> ${this.icon?e` <iron-icon icon="${this.icon}"></iron-icon> `:""} `}constructor(){super(),this.tag=NavCardItem.tag,this.accentColor="grey",this.allowGrey=!1,this.dark=!1,this.invert=!1}get twoChars(){return this.label&&this.label.split(/\s*/).length>1}get label(){let t=this.initials&&this.initials.split(" ");return t&&t[0]?`${t[0][0]} ${t[1]?t[1][0]:t[0][1]||""}}`:this.initials}get ico(){return this.avatar&&!this._validURL(this.avatar)?this.avatar:""}get src(){return this.avatar&&this._validURL(this.avatar)?this.avatar:""}_validURL(t){return console.log(),!!new RegExp("^((https?:)?\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(data:image)?(\\#[-a-z\\d_]*)?$","i").test(t)}}customElements.define("nav-card-item",NavCardItem);export{NavCardItem};
{ "pile_set_name": "Github" }
const _ = require('lodash'); const hasOwnProperty = Object.prototype.hasOwnProperty; /** * Check if a given member object is of kind `event`. * @param {Object} member - The member to check. * @returns {boolean} `true` if it is of kind `event`, otherwise false. */ const isEvent = member => member.kind === 'event'; /** * We need to have members of all valid JSDoc scopes. * @private */ const getMembers = () => ({ global: Object.create(null), inner: Object.create(null), instance: Object.create(null), events: Object.create(null), static: Object.create(null) }); /** * Pick only relevant properties from a comment to store them in * an inheritance chain * @param comment a parsed comment * @returns reduced comment * @private */ function pick(comment) { if (typeof comment.name !== 'string') { return undefined; } const item = { name: comment.name, kind: comment.kind }; if (comment.scope) { item.scope = comment.scope; } return item; } /** * @param {Array<Object>} comments an array of parsed comments * @returns {Array<Object>} nested comments, with only root comments * at the top level. */ module.exports = function (comments) { let id = 0; const root = { members: getMembers() }; const namesToUnroot = []; comments.forEach(comment => { let path = comment.path; if (!path) { path = []; if (comment.memberof) { // TODO: full namepath parsing path = comment.memberof .split('.') .map(segment => ({ scope: 'static', name: segment })); } if (!comment.name) { comment.errors.push({ message: 'could not determine @name for hierarchy' }); } path.push({ scope: comment.scope || 'static', name: comment.name || 'unknown_' + id++ }); } let node = root; while (path.length) { const segment = path.shift(); const scope = segment.scope; const name = segment.name; if (!hasOwnProperty.call(node.members[scope], name)) { // If segment.toc is true, everything up to this point in the path // represents how the documentation should be nested, but not how the // actual code is nested. To ensure that child members end up in the // right places in the tree, we temporarily push the same node a second // time to the root of the tree, and unroot it after all the comments // have found their homes. if ( segment.toc && node !== root && hasOwnProperty.call(root.members[scope], name) ) { node.members[scope][name] = root.members[scope][name]; namesToUnroot.push(name); } else { const newNode = (node.members[scope][name] = { comments: [], members: getMembers() }); if (segment.toc && node !== root) { root.members[scope][name] = newNode; namesToUnroot.push(name); } } } node = node.members[scope][name]; } node.comments.push(comment); }); namesToUnroot.forEach(function (name) { delete root.members.static[name]; }); /* * Massage the hierarchy into a format more suitable for downstream consumers: * * * Individual top-level scopes are collapsed to a single array * * Members at intermediate nodes are copied over to the corresponding comments, * with multisignature comments allowed. * * Intermediate nodes without corresponding comments indicate an undefined * @memberof reference. Emit an error, and reparent the offending comment to * the root. * * Add paths to each comment, making it possible to generate permalinks * that differentiate between instance functions with the same name but * different `@memberof` values. * * Person#say // the instance method named "say." * Person.say // the static method named "say." * Person~say // the inner method named "say." */ function toComments(nodes, root, hasUndefinedParent, path) { const result = []; let scope; path = path || []; for (const name in nodes) { const node = nodes[name]; for (scope in node.members) { node.members[scope] = toComments( node.members[scope], root || result, !node.comments.length, node.comments.length && node.comments[0].kind !== 'note' ? path.concat(node.comments[0]) : [] ); } for (let i = 0; i < node.comments.length; i++) { const comment = node.comments[i]; comment.members = {}; for (scope in node.members) { comment.members[scope] = node.members[scope]; } let events = comment.members.events; let groups = []; if (comment.members.instance.length) { groups = _.groupBy(comment.members.instance, isEvent); events = events.concat(groups[true] || []); comment.members.instance = groups[false] || []; } if (comment.members.static.length) { groups = _.groupBy(comment.members.static, isEvent); events = events.concat(groups[true] || []); comment.members.static = groups[false] || []; } if (comment.members.inner.length) { groups = _.groupBy(comment.members.inner, isEvent); events = events.concat(groups[true] || []); comment.members.inner = groups[false] || []; } if (comment.members.global.length) { groups = _.groupBy(comment.members.global, isEvent); events = events.concat(groups[true] || []); comment.members.global = groups[false] || []; } comment.members.events = events; comment.path = path.map(pick).concat(pick(comment)).filter(Boolean); const scopeChars = { instance: '#', static: '.', inner: '~', global: '' }; comment.namespace = comment.path.reduce((memo, part) => { if (part.kind === 'event') { return memo + '.event:' + part.name; } let scopeChar = ''; if (part.scope) { scopeChar = scopeChars[part.scope]; } return memo + scopeChar + part.name; }, ''); if (hasUndefinedParent) { const memberOfTag = comment.tags.filter( tag => tag.title === 'memberof' )[0]; const memberOfTagLineNumber = (memberOfTag && memberOfTag.lineNumber) || 0; comment.errors.push({ message: `@memberof reference to ${comment.memberof} not found`, commentLineNumber: memberOfTagLineNumber }); root.push(comment); } else { result.push(comment); } } } return result; } return toComments(root.members.static); };
{ "pile_set_name": "Github" }
export * from './entry'; import './database-extras';
{ "pile_set_name": "Github" }
<?xml version='1.0' encoding='utf-8'?> <SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"> <Profiles> <Profile Name="(Default)" /> </Profiles> <Settings /> </SettingsFile>
{ "pile_set_name": "Github" }
rule m2377_61b16a88d8bb0912 { meta: copyright="Copyright (c) 2014-2018 Support Intelligence Inc, All Rights Reserved." engine="saphire/1.3.1 divinorum/0.998 icewater/0.4" viz_url="http://icewater.io/en/cluster/query?h64=m2377.61b16a88d8bb0912" cluster="m2377.61b16a88d8bb0912" cluster_size="10" filetype = "HTML document" tlp = "amber" version = "icewater snowflake" author = "Rick Wesson (@wessorh) [email protected]" date = "20171120" license = "RIL-1.0 [Rick's Internet License] " family="ramnit html script" md5_hashes="['1611289d9bc19d74697cf23cf228463a','24bc39db9cbcbf47d38cedf506bec444','e4ce035b01a25ca437d7877b2ef2089a']" strings: $hex_string = { 696e672e46696c6553797374656d4f626a65637422290d0a44726f7050617468203d2046534f2e4765745370656369616c466f6c646572283229202620225c22 } condition: filesize > 65536 and filesize < 262144 and $hex_string }
{ "pile_set_name": "Github" }
#include <stdio.h> #include <stdlib.h> #include <limits.h> #include "map.h" #define QSIZE 100 int **init_flow(int nodesize){ int **flow=malloc(sizeof(int *)*nodesize); int i,j; for(i=0;i<nodesize;i++){ flow[i]=malloc(sizeof(int)*nodesize); for(j=0;j<nodesize;j++) flow[i][j]=0; } return flow; } int **create_complegraph(int **capacity,int nodesize,int **flow){ int **complegraph=malloc(sizeof(int *)*nodesize); int i,j; for(i=0;i<nodesize;i++) complegraph[i]=malloc(sizeof(int)*nodesize); for(i=0;i<nodesize;i++){ for(j=0;j<nodesize;j++){ if(capacity[i][j]-flow[i][j]>0) complegraph[i][j]=capacity[i][j]-flow[i][j]; else complegraph[i][j]=0; } } return complegraph; } void destory_matrix(int **matrix,int size){ int i; for(i=0;i<size;i++) free(matrix[i]); free(matrix); } int head,rear; int queue[QSIZE]; int empty(void){ return head==rear; } void enqueue(int new){ queue[rear]=new; rear=(rear+1)%QSIZE; } int dequeue(void){ int retval=queue[head]; head=(head+1)%QSIZE; return retval; } #define START 0 #define END 5 int find_path(int **complegraph,int nodesize,int **flow){ int prev[nodesize]; int visited[nodesize]; int i; for(i=0;i<nodesize;i++) visited[i]=0,prev[i]=-1; enqueue(START); int cur; while(!empty()){ cur=dequeue(); if(cur==END) break; if(!visited[cur]){ visited[cur]=1; for(i=0;i<nodesize;i++) if(complegraph[cur][i] && !visited[i]){ prev[i]=cur; enqueue(i); } } } if(cur==END){ int parent; int minflow=INT_MAX; while((parent=prev[cur])!=-1){ if(complegraph[parent][cur]<minflow) minflow=complegraph[parent][cur]; cur=parent; } cur=END; while((parent=prev[cur])!=-1){ printf("%d->%d\n",parent,cur); flow[parent][cur]+=minflow; flow[cur][parent]-=minflow; cur=parent; } return 1; }else{ return 0; } } int main(int argc, char const *argv[]){ if(argc<2) return 1; int nodesize; int **capacity=read_map(argv[1],&nodesize); int **flow=init_flow(nodesize); display_debug(capacity,nodesize); int status=0; int **complegraph; do{ complegraph=create_complegraph(capacity,nodesize,flow); status=find_path(complegraph,nodesize,flow); destory_matrix(complegraph,nodesize); }while(status); printf("maximum flow:\n"); display_debug(flow,nodesize); return 0; }
{ "pile_set_name": "Github" }
package com.tencent.mm.plugin.sns.e; import android.database.Cursor; import com.tencent.mm.plugin.sns.i.k; import com.tencent.mm.plugin.sns.i.l; import com.tencent.mm.sdk.h.d; import com.tencent.mm.sdk.platformtools.v; final class ar$2 implements Runnable { ar$2(ar paramar) {} public final void run() { Object localObject1 = null; if (ad.aBr()) { v.e("MicroMsg.UploadManager", "is invalid to getSnsInfoStorage"); return; } ar.b(gYa); if (ad.aBr()) { v.e("MicroMsg.UploadManager", "is invalid after checkTLE"); return; } Object localObject2 = ad.aBI(); k localk = new k(); String str = "select *,rowid from SnsInfo where " + l.hhP + " order by SnsInfo.rowid" + " asc "; localObject2 = bkP.rawQuery(str, null); v.d("MicroMsg.SnsInfoStorage", "getLastUpload " + str); if (((Cursor)localObject2).getCount() == 0) { ((Cursor)localObject2).close(); } while (localObject1 == null) { v.d("MicroMsg.UploadManager", "All has post"); return; ((Cursor)localObject2).moveToFirst(); localk.b((Cursor)localObject2); ((Cursor)localObject2).close(); localObject1 = localk; } if (ad.aBH().mC(hhu)) { v.d("MicroMsg.UploadManager", "checking isPosting " + hhu); return; } v.d("MicroMsg.UploadManager", "checking startPost " + ((k)localObject1).aCX()); ar.a(gYa, (k)localObject1); } } /* Location: * Qualified Name: com.tencent.mm.plugin.sns.e.ar.2 * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */
{ "pile_set_name": "Github" }
/* * Copyright (C) 1999-2019 John Källén. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "stdafx.h" #include "reko.h" #include "ComBase.h" #include "Arm64Rewriter.h" #include "Arm64Disassembler.h" #include "Arm64Architecture.h" #include "functions.h" Arm64Architecture::Arm64Architecture() { AddRef(); } STDMETHODIMP Arm64Architecture::QueryInterface(REFIID riid, void ** ppvObject) { if (riid == IID_INativeArchitecture || riid == IID_IAgileObject || riid == IID_IUnknown) { AddRef(); *ppvObject = static_cast<INativeArchitecture *>(this); return S_OK; } *ppvObject = nullptr; return E_NOINTERFACE; } STDMETHODIMP Arm64Architecture::GetAllRegisters(int regKind, int * pcRegs, void ** ppRegs) { *pcRegs = ARM64_REG_ENDING; *ppRegs = const_cast<NativeRegister*>(&aRegs[0]); return S_OK; } INativeDisassembler * STDMETHODCALLTYPE Arm64Architecture::CreateDisassembler( void * bytes, int length, int offset, uint64_t uAddr) { auto dasm = new Arm64Disassembler(reinterpret_cast<uint8_t*>(bytes) + offset, length - offset, offset, uAddr); dasm->AddRef(); return dasm; } INativeRewriter * STDAPICALLTYPE Arm64Architecture::CreateRewriter( void * rawBytes, int32_t length, int32_t offset, uint64_t address, INativeRtlEmitter * m, INativeTypeFactory * typeFactory, INativeRewriterHost * host) { return new Arm64Rewriter(reinterpret_cast<uint8_t*>(rawBytes) + offset, length - offset, address, m, typeFactory, host); } const NativeRegister Arm64Architecture::aRegs[] = { { nullptr, ARM64_REG_INVALID, 0, }, { "x29", ARM64_REG_X29, ARM64_REG_X29, 64 }, { "x30", ARM64_REG_X30, ARM64_REG_X30, 64 }, { "NZCV", ARM64_REG_NZCV, ARM64_REG_NZCV, 8 }, { "sp", ARM64_REG_SP, ARM64_REG_SP, 64 }, { "wsp", ARM64_REG_WSP, ARM64_REG_SP, 32 }, { "wzr", ARM64_REG_WZR, ARM64_REG_XZR, 64}, { "xzr", ARM64_REG_XZR, ARM64_REG_XZR, 32 }, { "b0", ARM64_REG_B0, ARM64_REG_Q0, 8, 0 }, { "b1", ARM64_REG_B1, ARM64_REG_Q1, 8, 0 }, { "b2", ARM64_REG_B2, ARM64_REG_Q2, 8, 0 }, { "b3", ARM64_REG_B3, ARM64_REG_Q3, 8, 0 }, { "b4", ARM64_REG_B4, ARM64_REG_Q4, 8, 0 }, { "b5", ARM64_REG_B5, ARM64_REG_Q5, 8, 0 }, { "b6", ARM64_REG_B6, ARM64_REG_Q6, 8, 0 }, { "b7", ARM64_REG_B7, ARM64_REG_Q7, 8, 0 }, { "b8", ARM64_REG_B8, ARM64_REG_Q8, 8, 0 }, { "b9", ARM64_REG_B9, ARM64_REG_Q9, 8, 0 }, { "b10", ARM64_REG_B10, ARM64_REG_Q10, 8, 0 }, { "b11", ARM64_REG_B11, ARM64_REG_Q11, 8, 0 }, { "b12", ARM64_REG_B12, ARM64_REG_Q12, 8, 0 }, { "b13", ARM64_REG_B13, ARM64_REG_Q13, 8, 0 }, { "b14", ARM64_REG_B14, ARM64_REG_Q14, 8, 0 }, { "b15", ARM64_REG_B15, ARM64_REG_Q15, 8, 0 }, { "b16", ARM64_REG_B16, ARM64_REG_Q16, 8, 0 }, { "b17", ARM64_REG_B17, ARM64_REG_Q17, 8, 0 }, { "b18", ARM64_REG_B18, ARM64_REG_Q18, 8, 0 }, { "b19", ARM64_REG_B19, ARM64_REG_Q19, 8, 0 }, { "b20", ARM64_REG_B20, ARM64_REG_Q20, 8, 0 }, { "b21", ARM64_REG_B21, ARM64_REG_Q21, 8, 0 }, { "b22", ARM64_REG_B22, ARM64_REG_Q22, 8, 0 }, { "b23", ARM64_REG_B23, ARM64_REG_Q23, 8, 0 }, { "b24", ARM64_REG_B24, ARM64_REG_Q24, 8, 0 }, { "b25", ARM64_REG_B25, ARM64_REG_Q25, 8, 0 }, { "b26", ARM64_REG_B26, ARM64_REG_Q26, 8, 0 }, { "b27", ARM64_REG_B27, ARM64_REG_Q27, 8, 0 }, { "b28", ARM64_REG_B28, ARM64_REG_Q28, 8, 0 }, { "b29", ARM64_REG_B29, ARM64_REG_Q29, 8, 0 }, { "b30", ARM64_REG_B30, ARM64_REG_Q30, 8, 0 }, { "b31", ARM64_REG_B31, ARM64_REG_Q31, 8, 0 }, { "d0", ARM64_REG_D0, ARM64_REG_Q0, 64, 0 }, { "d1", ARM64_REG_D1, ARM64_REG_Q1, 64, 0 }, { "d2", ARM64_REG_D2, ARM64_REG_Q2, 64, 0 }, { "d3", ARM64_REG_D3, ARM64_REG_Q3, 64, 0 }, { "d4", ARM64_REG_D4, ARM64_REG_Q4, 64, 0 }, { "d5", ARM64_REG_D5, ARM64_REG_Q5, 64, 0 }, { "d6", ARM64_REG_D6, ARM64_REG_Q6, 64, 0 }, { "d7", ARM64_REG_D7, ARM64_REG_Q7, 64, 0 }, { "d8", ARM64_REG_D8, ARM64_REG_Q8, 64, 0 }, { "d9", ARM64_REG_D9, ARM64_REG_Q9, 64, 0 }, { "d10", ARM64_REG_D10, ARM64_REG_Q10, 64, 0 }, { "d11", ARM64_REG_D11, ARM64_REG_Q11, 64, 0 }, { "d12", ARM64_REG_D12, ARM64_REG_Q12, 64, 0 }, { "d13", ARM64_REG_D13, ARM64_REG_Q13, 64, 0 }, { "d14", ARM64_REG_D14, ARM64_REG_Q14, 64, 0 }, { "d15", ARM64_REG_D15, ARM64_REG_Q15, 64, 0 }, { "d16", ARM64_REG_D16, ARM64_REG_Q16, 64, 0 }, { "d17", ARM64_REG_D17, ARM64_REG_Q17, 64, 0 }, { "d18", ARM64_REG_D18, ARM64_REG_Q18, 64, 0 }, { "d19", ARM64_REG_D19, ARM64_REG_Q19, 64, 0 }, { "d20", ARM64_REG_D20, ARM64_REG_Q20, 64, 0 }, { "d21", ARM64_REG_D21, ARM64_REG_Q21, 64, 0 }, { "d22", ARM64_REG_D22, ARM64_REG_Q22, 64, 0 }, { "d23", ARM64_REG_D23, ARM64_REG_Q23, 64, 0 }, { "d24", ARM64_REG_D24, ARM64_REG_Q24, 64, 0 }, { "d25", ARM64_REG_D25, ARM64_REG_Q25, 64, 0 }, { "d26", ARM64_REG_D26, ARM64_REG_Q26, 64, 0 }, { "d27", ARM64_REG_D27, ARM64_REG_Q27, 64, 0 }, { "d28", ARM64_REG_D28, ARM64_REG_Q28, 64, 0 }, { "d29", ARM64_REG_D29, ARM64_REG_Q29, 64, 0 }, { "d30", ARM64_REG_D30, ARM64_REG_Q30, 64, 0 }, { "d31", ARM64_REG_D31, ARM64_REG_Q31, 64, 0 }, { "h0", ARM64_REG_H0, ARM64_REG_Q0, 16, 0 }, { "h1", ARM64_REG_H1, ARM64_REG_Q1, 16, 0 }, { "h2", ARM64_REG_H2, ARM64_REG_Q2, 16, 0 }, { "h3", ARM64_REG_H3, ARM64_REG_Q3, 16, 0 }, { "h4", ARM64_REG_H4, ARM64_REG_Q4, 16, 0 }, { "h5", ARM64_REG_H5, ARM64_REG_Q5, 16, 0 }, { "h6", ARM64_REG_H6, ARM64_REG_Q6, 16, 0 }, { "h7", ARM64_REG_H7, ARM64_REG_Q7, 16, 0 }, { "h8", ARM64_REG_H8, ARM64_REG_Q8, 16, 0 }, { "h9", ARM64_REG_H9, ARM64_REG_Q9, 16, 0 }, { "h10", ARM64_REG_H10, ARM64_REG_Q10, 16, 0 }, { "h11", ARM64_REG_H11, ARM64_REG_Q11, 16, 0 }, { "h12", ARM64_REG_H12, ARM64_REG_Q12, 16, 0 }, { "h13", ARM64_REG_H13, ARM64_REG_Q13, 16, 0 }, { "h14", ARM64_REG_H14, ARM64_REG_Q14, 16, 0 }, { "h15", ARM64_REG_H15, ARM64_REG_Q15, 16, 0 }, { "h16", ARM64_REG_H16, ARM64_REG_Q16, 16, 0 }, { "h17", ARM64_REG_H17, ARM64_REG_Q17, 16, 0 }, { "h18", ARM64_REG_H18, ARM64_REG_Q18, 16, 0 }, { "h19", ARM64_REG_H19, ARM64_REG_Q19, 16, 0 }, { "h20", ARM64_REG_H20, ARM64_REG_Q20, 16, 0 }, { "h21", ARM64_REG_H21, ARM64_REG_Q21, 16, 0 }, { "h22", ARM64_REG_H22, ARM64_REG_Q22, 16, 0 }, { "h23", ARM64_REG_H23, ARM64_REG_Q23, 16, 0 }, { "h24", ARM64_REG_H24, ARM64_REG_Q24, 16, 0 }, { "h25", ARM64_REG_H25, ARM64_REG_Q25, 16, 0 }, { "h26", ARM64_REG_H26, ARM64_REG_Q26, 16, 0 }, { "h27", ARM64_REG_H27, ARM64_REG_Q27, 16, 0 }, { "h28", ARM64_REG_H28, ARM64_REG_Q28, 16, 0 }, { "h29", ARM64_REG_H29, ARM64_REG_Q29, 16, 0 }, { "h30", ARM64_REG_H30, ARM64_REG_Q30, 16, 0 }, { "h31", ARM64_REG_H31, ARM64_REG_Q31, 16, 0 }, { "q0", ARM64_REG_Q0, ARM64_REG_Q0, 128, 0 }, { "q1", ARM64_REG_Q1, ARM64_REG_Q1, 128, 0 }, { "q2", ARM64_REG_Q2, ARM64_REG_Q2, 128, 0 }, { "q3", ARM64_REG_Q3, ARM64_REG_Q3, 128, 0 }, { "q4", ARM64_REG_Q4, ARM64_REG_Q4, 128, 0 }, { "q5", ARM64_REG_Q5, ARM64_REG_Q5, 128, 0 }, { "q6", ARM64_REG_Q6, ARM64_REG_Q6, 128, 0 }, { "q7", ARM64_REG_Q7, ARM64_REG_Q7, 128, 0 }, { "q8", ARM64_REG_Q8, ARM64_REG_Q8, 128, 0 }, { "q9", ARM64_REG_Q9, ARM64_REG_Q9, 128, 0 }, { "q10", ARM64_REG_Q10, ARM64_REG_Q10, 128, 0 }, { "q11", ARM64_REG_Q11, ARM64_REG_Q11, 128, 0 }, { "q12", ARM64_REG_Q12, ARM64_REG_Q12, 128, 0 }, { "q13", ARM64_REG_Q13, ARM64_REG_Q13, 128, 0 }, { "q14", ARM64_REG_Q14, ARM64_REG_Q14, 128, 0 }, { "q15", ARM64_REG_Q15, ARM64_REG_Q15, 128, 0 }, { "q16", ARM64_REG_Q16, ARM64_REG_Q16, 128, 0 }, { "q17", ARM64_REG_Q17, ARM64_REG_Q17, 128, 0 }, { "q18", ARM64_REG_Q18, ARM64_REG_Q18, 128, 0 }, { "q19", ARM64_REG_Q19, ARM64_REG_Q19, 128, 0 }, { "q20", ARM64_REG_Q20, ARM64_REG_Q20, 128, 0 }, { "q21", ARM64_REG_Q21, ARM64_REG_Q21, 128, 0 }, { "q22", ARM64_REG_Q22, ARM64_REG_Q22, 128, 0 }, { "q23", ARM64_REG_Q23, ARM64_REG_Q23, 128, 0 }, { "q24", ARM64_REG_Q24, ARM64_REG_Q24, 128, 0 }, { "q25", ARM64_REG_Q25, ARM64_REG_Q25, 128, 0 }, { "q26", ARM64_REG_Q26, ARM64_REG_Q26, 128, 0 }, { "q27", ARM64_REG_Q27, ARM64_REG_Q27, 128, 0 }, { "q28", ARM64_REG_Q28, ARM64_REG_Q28, 128, 0 }, { "q29", ARM64_REG_Q29, ARM64_REG_Q29, 128, 0 }, { "q30", ARM64_REG_Q30, ARM64_REG_Q30, 128, 0 }, { "q31", ARM64_REG_Q31, ARM64_REG_Q31, 128, 0 }, { "s0", ARM64_REG_S0, ARM64_REG_Q0, 32, 0 }, { "s1", ARM64_REG_S1, ARM64_REG_Q1, 32, 0 }, { "s2", ARM64_REG_S2, ARM64_REG_Q2, 32, 0 }, { "s3", ARM64_REG_S3, ARM64_REG_Q3, 32, 0 }, { "s4", ARM64_REG_S4, ARM64_REG_Q4, 32, 0 }, { "s5", ARM64_REG_S5, ARM64_REG_Q5, 32, 0 }, { "s6", ARM64_REG_S6, ARM64_REG_Q6, 32, 0 }, { "s7", ARM64_REG_S7, ARM64_REG_Q7, 32, 0 }, { "s8", ARM64_REG_S8, ARM64_REG_Q8, 32, 0 }, { "s9", ARM64_REG_S9, ARM64_REG_Q9, 32, 0 }, { "s10", ARM64_REG_S10, ARM64_REG_Q10, 32, 0 }, { "s11", ARM64_REG_S11, ARM64_REG_Q11, 32, 0 }, { "s12", ARM64_REG_S12, ARM64_REG_Q12, 32, 0 }, { "s13", ARM64_REG_S13, ARM64_REG_Q13, 32, 0 }, { "s14", ARM64_REG_S14, ARM64_REG_Q14, 32, 0 }, { "s15", ARM64_REG_S15, ARM64_REG_Q15, 32, 0 }, { "s16", ARM64_REG_S16, ARM64_REG_Q16, 32, 0 }, { "s17", ARM64_REG_S17, ARM64_REG_Q17, 32, 0 }, { "s18", ARM64_REG_S18, ARM64_REG_Q18, 32, 0 }, { "s19", ARM64_REG_S19, ARM64_REG_Q19, 32, 0 }, { "s20", ARM64_REG_S20, ARM64_REG_Q20, 32, 0 }, { "s21", ARM64_REG_S21, ARM64_REG_Q21, 32, 0 }, { "s22", ARM64_REG_S22, ARM64_REG_Q22, 32, 0 }, { "s23", ARM64_REG_S23, ARM64_REG_Q23, 32, 0 }, { "s24", ARM64_REG_S24, ARM64_REG_Q24, 32, 0 }, { "s25", ARM64_REG_S25, ARM64_REG_Q25, 32, 0 }, { "s26", ARM64_REG_S26, ARM64_REG_Q26, 32, 0 }, { "s27", ARM64_REG_S27, ARM64_REG_Q27, 32, 0 }, { "s28", ARM64_REG_S28, ARM64_REG_Q28, 32, 0 }, { "s29", ARM64_REG_S29, ARM64_REG_Q29, 32, 0 }, { "s30", ARM64_REG_S30, ARM64_REG_Q30, 32, 0 }, { "s31", ARM64_REG_S31, ARM64_REG_Q31, 32, 0 }, { "w0", ARM64_REG_W0, ARM64_REG_X0, 32 }, { "w1", ARM64_REG_W1, ARM64_REG_X1, 32 }, { "w2", ARM64_REG_W2, ARM64_REG_X2, 32 }, { "w3", ARM64_REG_W3, ARM64_REG_X3, 32 }, { "w4", ARM64_REG_W4, ARM64_REG_X4, 32 }, { "w5", ARM64_REG_W5, ARM64_REG_X5, 32 }, { "w6", ARM64_REG_W6, ARM64_REG_X6, 32 }, { "w7", ARM64_REG_W7, ARM64_REG_X7, 32 }, { "w8", ARM64_REG_W8, ARM64_REG_X8, 32 }, { "w9", ARM64_REG_W9, ARM64_REG_X9, 32 }, { "w10", ARM64_REG_W10, ARM64_REG_X10, 32 }, { "w11", ARM64_REG_W11, ARM64_REG_X11, 32 }, { "w12", ARM64_REG_W12, ARM64_REG_X12, 32 }, { "w13", ARM64_REG_W13, ARM64_REG_X13, 32 }, { "w14", ARM64_REG_W14, ARM64_REG_X14, 32 }, { "w15", ARM64_REG_W15, ARM64_REG_X15, 32 }, { "w16", ARM64_REG_W16, ARM64_REG_X16, 32 }, { "w17", ARM64_REG_W17, ARM64_REG_X17, 32 }, { "w18", ARM64_REG_W18, ARM64_REG_X18, 32 }, { "w19", ARM64_REG_W19, ARM64_REG_X19, 32 }, { "w20", ARM64_REG_W20, ARM64_REG_X20, 32 }, { "w21", ARM64_REG_W21, ARM64_REG_X21, 32 }, { "w22", ARM64_REG_W22, ARM64_REG_X22, 32 }, { "w23", ARM64_REG_W23, ARM64_REG_X23, 32 }, { "w24", ARM64_REG_W24, ARM64_REG_X24, 32 }, { "w25", ARM64_REG_W25, ARM64_REG_X25, 32 }, { "w26", ARM64_REG_W26, ARM64_REG_X26, 32 }, { "w27", ARM64_REG_W27, ARM64_REG_X27, 32 }, { "w28", ARM64_REG_W28, ARM64_REG_X28, 32 }, { "w29", ARM64_REG_W29, ARM64_REG_X29, 32 }, { "w30", ARM64_REG_W30, ARM64_REG_X30, 32 }, { "x0", ARM64_REG_X0, ARM64_REG_X0, 64 }, { "x1", ARM64_REG_X1, ARM64_REG_X1, 64 }, { "x2", ARM64_REG_X2, ARM64_REG_X2, 64 }, { "x3", ARM64_REG_X3, ARM64_REG_X3, 64 }, { "x4", ARM64_REG_X4, ARM64_REG_X4, 64 }, { "x5", ARM64_REG_X5, ARM64_REG_X5, 64 }, { "x6", ARM64_REG_X6, ARM64_REG_X6, 64 }, { "x7", ARM64_REG_X7, ARM64_REG_X7, 64 }, { "x8", ARM64_REG_X8, ARM64_REG_X8, 64 }, { "x9", ARM64_REG_X9, ARM64_REG_X9, 64 }, { "x10", ARM64_REG_X10, ARM64_REG_X10, 64 }, { "x11", ARM64_REG_X11, ARM64_REG_X11, 64 }, { "x12", ARM64_REG_X12, ARM64_REG_X12, 64 }, { "x13", ARM64_REG_X13, ARM64_REG_X13, 64 }, { "x14", ARM64_REG_X14, ARM64_REG_X14, 64 }, { "x15", ARM64_REG_X15, ARM64_REG_X15, 64 }, { "x16", ARM64_REG_X16, ARM64_REG_X16, 64 }, { "x17", ARM64_REG_X17, ARM64_REG_X17, 64 }, { "x18", ARM64_REG_X18, ARM64_REG_X18, 64 }, { "x19", ARM64_REG_X19, ARM64_REG_X19, 64 }, { "x20", ARM64_REG_X20, ARM64_REG_X20, 64 }, { "x21", ARM64_REG_X21, ARM64_REG_X21, 64 }, { "x22", ARM64_REG_X22, ARM64_REG_X22, 64 }, { "x23", ARM64_REG_X23, ARM64_REG_X23, 64 }, { "x24", ARM64_REG_X24, ARM64_REG_X24, 64 }, { "x25", ARM64_REG_X25, ARM64_REG_X25, 64 }, { "x26", ARM64_REG_X26, ARM64_REG_X26, 64 }, { "x27", ARM64_REG_X27, ARM64_REG_X27, 64 }, { "x28", ARM64_REG_X28, ARM64_REG_X28, 64 }, { "v0", ARM64_REG_V0, ARM64_REG_Q0, 128 }, { "v1", ARM64_REG_V1, ARM64_REG_Q1, 128 }, { "v2", ARM64_REG_V2, ARM64_REG_Q2, 128 }, { "v3", ARM64_REG_V3, ARM64_REG_Q3, 128 }, { "v4", ARM64_REG_V4, ARM64_REG_Q4, 128 }, { "v5", ARM64_REG_V5, ARM64_REG_Q5, 128 }, { "v6", ARM64_REG_V6, ARM64_REG_Q6, 128 }, { "v7", ARM64_REG_V7, ARM64_REG_Q7, 128 }, { "v8", ARM64_REG_V8, ARM64_REG_Q8, 128 }, { "v9", ARM64_REG_V9, ARM64_REG_Q9, 128 }, { "v10", ARM64_REG_V10, ARM64_REG_Q10, 128 }, { "v11", ARM64_REG_V11, ARM64_REG_Q11, 128 }, { "v12", ARM64_REG_V12, ARM64_REG_Q12, 128 }, { "v13", ARM64_REG_V13, ARM64_REG_Q13, 128 }, { "v14", ARM64_REG_V14, ARM64_REG_Q14, 128 }, { "v15", ARM64_REG_V15, ARM64_REG_Q15, 128 }, { "v16", ARM64_REG_V16, ARM64_REG_Q16, 128 }, { "v17", ARM64_REG_V17, ARM64_REG_Q17, 128 }, { "v18", ARM64_REG_V18, ARM64_REG_Q18, 128 }, { "v19", ARM64_REG_V19, ARM64_REG_Q19, 128 }, { "v20", ARM64_REG_V20, ARM64_REG_Q20, 128 }, { "v21", ARM64_REG_V21, ARM64_REG_Q21, 128 }, { "v22", ARM64_REG_V22, ARM64_REG_Q22, 128 }, { "v23", ARM64_REG_V23, ARM64_REG_Q23, 128 }, { "v24", ARM64_REG_V24, ARM64_REG_Q24, 128 }, { "v25", ARM64_REG_V25, ARM64_REG_Q25, 128 }, { "v26", ARM64_REG_V26, ARM64_REG_Q26, 128 }, { "v27", ARM64_REG_V27, ARM64_REG_Q27, 128 }, { "v28", ARM64_REG_V28, ARM64_REG_Q28, 128 }, { "v29", ARM64_REG_V29, ARM64_REG_Q29, 128 }, { "v30", ARM64_REG_V30, ARM64_REG_Q30, 128 }, { "v31", ARM64_REG_V31, ARM64_REG_Q31, 128 }, //> alias registers // ARM64_REG_IP1 = ARM64_REG_X16, // ARM64_REG_IP0 = ARM64_REG_X17, // ARM64_REG_FP = ARM64_REG_X29, // ARM64_REG_LR = ARM64_REG_X30, };
{ "pile_set_name": "Github" }
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # NOTE: This file is auto generated by the elixir code generator program. # Do not edit this file manually. defmodule GoogleApi.CloudIdentity.V1.Model.GoogleAppsCloudidentityDevicesV1BlockDeviceUserRequest do @moduledoc """ Request message for blocking account on device. ## Attributes * `customer` (*type:* `String.t`, *default:* `nil`) - Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the customer. If you're using this API for your own organization, use `customers/my_customer` If you're using this API to manage another organization, use `customers/{customer_id}`, where customer_id is the customer to whom the device belongs. """ use GoogleApi.Gax.ModelBase @type t :: %__MODULE__{ :customer => String.t() } field(:customer) end defimpl Poison.Decoder, for: GoogleApi.CloudIdentity.V1.Model.GoogleAppsCloudidentityDevicesV1BlockDeviceUserRequest do def decode(value, options) do GoogleApi.CloudIdentity.V1.Model.GoogleAppsCloudidentityDevicesV1BlockDeviceUserRequest.decode( value, options ) end end defimpl Poison.Encoder, for: GoogleApi.CloudIdentity.V1.Model.GoogleAppsCloudidentityDevicesV1BlockDeviceUserRequest do def encode(value, options) do GoogleApi.Gax.ModelBase.encode(value, options) end end
{ "pile_set_name": "Github" }