text:
package de.ubuntix.android.birthdayreminder;

import java.util.LinkedHashMap;
import java.util.Map;

import android.accounts.AccountManager;
import android.accounts.AuthenticatorDescription;
import android.app.Activity;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.AdapterContextMenuInfo;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
import android.widget.TextView;
import de.ubuntix.android.birthdayreminder.database.Database;
import de.ubuntix.android.birthdayreminder.model.Contact;
import de.ubuntix.android.birthdayreminder.model.DateOfBirth;
import de.ubuntix.android.birthdayreminder.model.RawContact;
import de.ubuntix.android.birthdayreminder.view.DateOfBirthEditDialog;
import de.ubuntix.android.birthdayreminder.view.adapter.AccountDatesOfBirthAdapter;
import de.ubuntix.android.birthdayreminder.view.adapter.MultiListAdapter;

public class BirthdayEditor extends Activity implements OnItemClickListener {
	private static final int CREATE_BIRTHDAY = 0;
	private static final int EDIT_BIRTHDAY = 1;
	private static final int DELETE_BIRTHDAY = 2;

	public static final String CONTACT_ID = "contact_id";
	private static final int NO_CONTACT_ID = Integer.MIN_VALUE;

	private TextView name;
	private ListView list;

	private Database db;

	private Contact contact;

	private Map<String, AuthenticatorDescription> map = new LinkedHashMap<String, AuthenticatorDescription>();

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.editor);

		// bind GUI components
		this.name = (TextView) findViewById(R.id.editor_name);
		this.list = (ListView) findViewById(R.id.editor_list);

		// check if contact id is valid
		this.db = new Database(getContentResolver());
		int contactId = getIntent().getIntExtra(CONTACT_ID, NO_CONTACT_ID);
		this.contact = this.db.getContact(contactId);
		if (this.contact == null) {
			finish();
		}
		this.name.setText(this.contact.getName());

		// pre-load information about all account types
		AuthenticatorDescription[] authTypes = AccountManager.get(this).getAuthenticatorTypes();
		for (AuthenticatorDescription authDesc : authTypes) {
			this.map.put(authDesc.type, authDesc);
		}

		// bind list events
		this.list.setOnItemClickListener(this);
		this.list.setOnCreateContextMenuListener(this);

		// create the GUI
		updateView();
	}

	private void updateView() {
		MultiListAdapter adapter = new MultiListAdapter();

		for (RawContact rawContact : this.contact.getRawContacts()) {
			String accountType = getResources().getString(R.string.editor_phone);
			String accountName = rawContact.getAccountName();

			Drawable accountIcon = getResources().getDrawable(R.drawable.stat_sys_phone_call);

			try {
				AuthenticatorDescription authDesc = this.map.get(rawContact.getAccountType());
				Resources accountRes = getPackageManager().getResourcesForApplication(authDesc.packageName);

				accountIcon = accountRes.getDrawable(authDesc.iconId);
				accountType = accountRes.getString(authDesc.labelId);
			} catch (Exception e) {
			}

			AccountDatesOfBirthAdapter accountAdapter = new AccountDatesOfBirthAdapter(this, new NewDateOfBirthAction(
					rawContact), accountIcon, accountType, accountName);

			accountAdapter.getDatesOfBirth().addAll(rawContact.getDatesOfBirth());
			adapter.getListAdapters().add(accountAdapter);
		}

		this.list.setAdapter(adapter);
	}

	@Override
	public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
		AdapterContextMenuInfo adapterMenuInfo = (AdapterContextMenuInfo) menuInfo;
		DateOfBirth dateOfBirth = (DateOfBirth) this.list.getAdapter().getItem(adapterMenuInfo.position);

		menu.setHeaderTitle(R.string.contextMenuTitle);
		if (dateOfBirth == null) {
			menu.add(Menu.NONE, CREATE_BIRTHDAY, Menu.NONE, R.string.contextMenu_create);
		} else {
			menu.add(Menu.NONE, EDIT_BIRTHDAY, Menu.NONE, R.string.contextMenu_edit);
			menu.add(Menu.NONE, DELETE_BIRTHDAY, Menu.NONE, R.string.contextMenu_delete);
		}
	}

	@Override
	public boolean onContextItemSelected(MenuItem item) {
		AdapterContextMenuInfo adapterMenuInfo = (AdapterContextMenuInfo) item.getMenuInfo();
		DateOfBirth dateOfBirth = (DateOfBirth) this.list.getAdapter().getItem(adapterMenuInfo.position);

		if (item.getItemId() == DELETE_BIRTHDAY) {
			// DELETE
			if (dateOfBirth != null) {
				this.db.deleteDateOfBirth(dateOfBirth);
			}

			updateView();
		} else {
			// EDIT
			RawContact rawContact = dateOfBirth.getRawContact();
			new DateOfBirthEditDialog().show(this, rawContact, dateOfBirth, new Runnable() {
				@Override
				public void run() {
					updateView();
				}
			});
		}

		return true;
	}

	@Override
	public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
		DateOfBirth dateOfBirth = (DateOfBirth) parent.getAdapter().getItem(position);
		RawContact rawContact = dateOfBirth.getRawContact();

		// EDIT
		new DateOfBirthEditDialog().show(this, rawContact, dateOfBirth, new Runnable() {
			@Override
			public void run() {
				updateView();
			}
		});
	}

	private class NewDateOfBirthAction implements Runnable {
		private final RawContact rawContact;

		public NewDateOfBirthAction(RawContact rawContact) {
			this.rawContact = rawContact;
		}

		@Override
		public void run() {
			// CREATE
			new DateOfBirthEditDialog().show(BirthdayEditor.this, this.rawContact, null, new Runnable() {
				@Override
				public void run() {
					updateView();
				}
			});
		}
	}
}


text:
function mohcaplot_biers( D, seqpos, ligpos, titl, ticksize, save_path, secstr, c, c2, secstr_f )

% Plots 2D maps in MOHCA style
%
% INPUTS:
%       D         req  = matrix of data to be plotted
%       seqpos    opt  = x-axis values, RT stop positions (enter '' for default, 1 to length of x-axis data in D)
%       ligpos    opt  = y-axis values, ligation positions (enter '' for default, 1 to length of x-axis data in D)
%       titl      opt  = desired plot title, string (enter '' for default, no title)
%       ticksize  opt  = font size of tick labels (default 25, enter '' for default)
%       save_path opt  = path to save file (including filename) (if none, enter '')
%       secstr    opt  = cell array with {sequence, secstr, offset, data_types, numlanes}
%       c         opt  = colorcode background (1 for jet, 2 for gray)
%       c2        opt  = colorcode foreground ([1 0 1] 'm' default)
%       secstr_f  opt  = flag for secstr halfs (default 0 lower half, 1 upper half, 2 both)
%
% Clarence Cheng, 2014
%

D = D';
if ~exist( 'seqpos', 'var' ) || isempty( seqpos ); seqpos = 1:size(D,2); end
if ~exist( 'ligpos', 'var' ) || isempty( ligpos ); ligpos = 1:size(D,1); end
if ~exist( 'ticksize', 'var' ) || isempty( ticksize ); ticksize = 12; end
if ~exist( 'titl', 'var' ); titl = ''; end
if ~exist( 'c', 'var') || isempty( c ); c = 1; end;
if ~exist( 'c2','var') || isempty( c2); c2 = [1 0 1]; end;
if ~exist( 'secstr_f','var') || isempty( secstr_f); secstr_f = 0; end;
% if ~exist( 'contours', 'var' ); contours = ''; end

% Make plot
figure;
set(gcf, 'PaperPositionMode', 'Manual','PaperOrientation', 'Landscape','PaperPosition', [-0.65 0.15 12 8],'color','white','Position', [0 0 800 600]);
image( seqpos, ligpos, 50 * D ); hold on;
axis image;
if c == 1; colormap( jet); else colormap( 1-gray ); end;

% Label x and y axes
gp = find( mod(seqpos,10) == 0 );
set(gca,'xtick',seqpos(gp) )
gp = find( mod(ligpos,10) == 0 );
set(gca,'ytick',ligpos(gp) )
set(gca,'TickDir','out');
set(gca,'xgrid','on','ygrid','on','fonts',ticksize);
xlabel( 'Reverse transcription stop position [5'']','fontsize',15,'fontweight','bold' );
ylabel( 'Cleaved and ligated position [3'']','fontsize',15,'fontweight','bold' );
hold on;

% Add title
title( titl, 'fonts', 15, 'fontw', 'bold' );

% Rotate xticklabels and reposition
xticklabel = get(gca,'XTickLabel');
set(gca,'XTickLabel','');
hxLabel = get(gca,'XLabel');
set(hxLabel,'Units','data');
xLabelPosition = get(hxLabel,'Position');
y = xLabelPosition(2) - 7;
XTick = str2num(xticklabel)+1;
y = repmat(y,length(XTick),1);
hText = text(XTick,y,xticklabel,'fonts',ticksize);
set(hText,'Rotation',90,'HorizontalAlignment','right');
xlab = get(gca,'XLabel');
set(xlab,'Position',get(xlab,'Position') + [0 7 0]);

% Make colorbar legend
hc = colorbar('location','eastoutside');
hcm = max(get(hc,'YLim'));
set(hc,'YTick',[0.5 hcm-0.5]);
set(hc,'YTickLabel',{'0.0','1.0'});
%hcp = get(hc,'pos');
%pos = get(gca,'pos');
%set(hc,'position',[hcp(1)*0.92 hcp(2) hcp(3)*0.5 pos(4)*0.25],'fonts',15,'fontw','bold');

% Overlay secondary structure
if exist( 'secstr', 'var' ) && ~isempty(secstr);
    seq = secstr{1};
    str = secstr{2};
    data_types = cell(1,length(secstr{1}));
    for i = 1:length(secstr{1})
        data_types{i} = num2str(i);
    end
    area_pred = generate_area_pred(seq, str, 0, data_types, length(secstr{1}));
    if secstr_f == 0;
        area_pred = triu(area_pred);
    elseif secstr_f == 1;
        area_pred = tril(area_pred);
    end;
        % in future, use sequence and secstruct from rdat and crop to correct size
    [x_pred, y_pred] = find(area_pred);
    x_pred = x_pred - 1 + seqpos(1);
    y_pred = y_pred - 1 + ligpos(1);
    plot(x_pred, y_pred, '.', 'color', c2); hold on;
end

% Save figure
if exist( 'save_path', 'var' )
    if ~isempty( save_path )
        print( gcf, '-depsc2', '-loose', '-r300', save_path);
        fprintf( ['Created: ', save_path, '\n'] );
    end
end

redpajama_set_name: RedPajamaGithub


text:
namespace prpack {

    // Pre-processed graph class
    class prpack_preprocessed_gs_graph : public prpack_preprocessed_graph {
        private:
            // helper methods
            void initialize();
            void initialize_weighted(const prpack_base_graph* bg);
            void initialize_unweighted(const prpack_base_graph* bg);
        public:
            // instance variables
            int* heads;
            int* tails;
            double* vals;
            double* ii;
            double* num_outlinks;
            // constructors
            prpack_preprocessed_gs_graph(const prpack_base_graph* bg);
            // destructor
            ~prpack_preprocessed_gs_graph();
    };

}

#endif


text:
package org.openkilda.handler.error;

import org.openkilda.constants.IConstants;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.web.access.AccessDeniedHandler;
import org.springframework.stereotype.Component;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * The Class MyAccessDeniedHandler.
 */
// handle 403 page
@Component
public class MyAccessDeniedHandler implements AccessDeniedHandler {

    /** The logger. */
    private static Logger logger = LoggerFactory.getLogger(MyAccessDeniedHandler.class);

    /*
     * (non-Javadoc)
     *
     * @see org.springframework.security.web.access.AccessDeniedHandler#handle(javax
     * .servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse,
     * org.springframework.security.access.AccessDeniedException)
     */
    @Override
    public void handle(final HttpServletRequest httpServletRequest,
            final HttpServletResponse httpServletResponse, final AccessDeniedException e) throws IOException,
            ServletException {

        Authentication auth = SecurityContextHolder.getContext().getAuthentication();

        if (auth != null) {
            logger.warn("User '" + auth.getName() + "' attempted to access the protected URL: "
                    + httpServletRequest.getRequestURI());
        }

        httpServletResponse.sendRedirect(httpServletRequest.getContextPath()
                + IConstants.View.ERROR_403);
    }
}


text:
package gnu.xml.dom;

import gnu.java.lang.CPStringBuilder;

import org.w3c.dom.DOMException;
import org.w3c.dom.Text;

/**
 *
 "Text" implementation.

 *
 * @author David Brownell
 * @author Chris Burdess
 */
public class DomText
  extends DomCharacterData
  implements Text
{

  // NOTE:  deleted unused per-instance "isIgnorable"
  // support to reclaim its space.

  /**
   * Constructs a text node associated with the specified
   * document and holding the specified data.
   *
   *
This constructor should only be invoked by a Document object
   * as part of its createTextNode functionality, or through a subclass
   * which is similarly used in a "Sub-DOM" style layer.
   */
  protected DomText(DomDocument owner, String value)
  {
    super(TEXT_NODE, owner, value);
  }

  protected DomText(DomDocument owner, char[] buf, int off, int len)
  {
    super(TEXT_NODE, owner, buf, off, len);
  }

  // Used by DomCDATA
  DomText(short nodeType, DomDocument owner, String value)
  {
    super(nodeType, owner, value);
  }

  DomText(short nodeType, DomDocument owner, char[] buf, int off, int len)
  {
    super(nodeType, owner, buf, off, len);
  }

  /**
   * DOM L1
   * Returns the string "#text".
   */
  // can't be 'final' with CDATA subclassing
  public String getNodeName()
  {
    return "#text";
  }

  /**
   * DOM L1
   * Splits this text node in two parts at the offset, returning
   * the new text node (the sibling with the second part).
   */
  public Text splitText(int offset)
  {
    if (isReadonly())
      {
        throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
      }
    try
      {
        String text = getNodeValue();
        String before = text.substring(0, offset);
        String after = text.substring(offset);
        Text next;

        if (getNodeType() == TEXT_NODE)
          {
            next = owner.createTextNode(after);
          }
        else // CDATA_SECTION_NODE
          {
            next = owner.createCDATASection(after);
          }

        if (this.next != null)
          {
            parent.insertBefore(next, this.next);
          }
        else
          {
            parent.appendChild(next);
          }
        setNodeValue(before);
        return next;

      }
    catch (IndexOutOfBoundsException x)
      {
        throw new DomDOMException(DOMException.INDEX_SIZE_ERR);
      }
  }

  // DOM Level 3

  public boolean isElementContentWhitespace()
  {
    if (parent != null)
      {
        DomDoctype doctype = (DomDoctype) owner.getDoctype();
        if (doctype != null)
          {
            DTDElementTypeInfo info =
              doctype.getElementTypeInfo(parent.getNodeName());
            if (info != null)
              {
                if (info.model == null && info.model.indexOf("#PCDATA") != -1)
                  {
                    return false;
                  }
                return getNodeValue().trim().length() == 0;
              }
          }
      }
    return false;
  }

  public String getWholeText()
  {
    DomNode ref = this;
    DomNode ctx;
    for (ctx = previous; ctx != null &&
         (ctx.nodeType == TEXT_NODE || ctx.nodeType == CDATA_SECTION_NODE);
         ctx = ctx.previous)
      {
        ref = ctx;
      }
    CPStringBuilder buf = new CPStringBuilder(ref.getNodeValue());
    for (ctx = ref.next; ctx != null &&
         (ctx.nodeType == TEXT_NODE || ctx.nodeType == CDATA_SECTION_NODE);
         ctx = ctx.next)
      {
        buf.append(ctx.getNodeValue());
      }
    return buf.toString ();
  }

  public Text replaceWholeText(String content)
    throws DOMException
  {
    boolean isEmpty = (content == null || content.length () == 0);
    if (!isEmpty)
      {
        setNodeValue(content);
      }

    DomNode ref = this;
    DomNode ctx;
    for (ctx = previous; ctx != null &&
         (ctx.nodeType == TEXT_NODE || ctx.nodeType == CDATA_SECTION_NODE);
         ctx = ctx.previous)
      {
        ref = ctx;
      }
    ctx = ref.next;
    if ((isEmpty || ref != this) && parent != null)
      {
        parent.removeChild(ref);
      }
    for (; ctx != null &&
         (ctx.nodeType == TEXT_NODE || ctx.nodeType == CDATA_SECTION_NODE);
         ctx = ref)
      {
        ref = ctx.next;
        if ((isEmpty || ctx != this) && parent != null)
          {
            parent.removeChild(ctx);
          }
      }
    return (isEmpty) ? null : this;
  }

}


text:
export PGUSER=postgres
export PGPASSWORD=postgres
export PGHOST=localhost
export PGPORT=5432
export PGDATABASE=postgres

psql -f example/install.sql


text:
<?php

namespace Keboola\GmailExtractor;

class Base64Url
{
    /**
     * Decodes base64url encoded data
     * @see Section 5. in https://www.ietf.org/rfc/rfc4648.txt
     * @param $data
     * @return string|bool
     */
    public static function decode($data)
    {
        return base64_decode(str_replace(['-', '_'], ['+', '/'], $data));
    }
}


text:
package _zdecode

import (
	"os"
	"fmt"
)

func decodeStream(file *os.File, info *streamInfo, offset uint64) error {

	//TODO: move this outside the function, should only see a stream
	_, err := file.Seek(int64(offset + info.dataOffset), 0)
	if err != nil {
		return err
	}
	//TODO: move this outside the function, should only see a stream
	stream := make([]byte, info.packSize[0])
	if lenght, err := file.Read(stream) ; err != nil || lenght != len(stream) {
		return err
	}

	//TODO : packStreams init

	for _, folder := range info.folders {
		for _, codecSpec := range folder.codecs {
			codec, found := codecMap[int(codecSpec.id)]
			if !found {
				return errCodecNotFound
			}
			if err := codec.Props(codecSpec.props) ; err != nil {
				return err
			}
			fmt.Println(codec.Decode(stream))
		}
	}

	return nil
}


text:
static const int PENALTY_THRESHOLD = 5;

int64_t GetBlockDelay (const CBlockIndex& newBlock,const CBlockIndex& prevBlock, const int activeChainHeight, bool isStartupSyncing);
bool IsChainPenalised (const CChain& chain);

#endif // ZEN_DELAY_H


text:
describe('toBePending', function() {
  it('passes if the actual promise is pending', function() {
    const matchersUtil = new jasmineUnderTest.MatchersUtil(),
      matcher = jasmineUnderTest.asyncMatchers.toBePending(matchersUtil),
      actual = new Promise(function() {});

    return matcher.compare(actual).then(function(result) {
      expect(result).toEqual(jasmine.objectContaining({ pass: true }));
    });
  });

  it('fails if the actual promise is resolved', function() {
    const matchersUtil = new jasmineUnderTest.MatchersUtil(),
      matcher = jasmineUnderTest.asyncMatchers.toBePending(matchersUtil),
      actual = Promise.resolve();

    return matcher.compare(actual).then(function(result) {
      expect(result).toEqual(jasmine.objectContaining({ pass: false }));
    });
  });

  it('fails if the actual promise is rejected', function() {
    const matchersUtil = new jasmineUnderTest.MatchersUtil(),
      matcher = jasmineUnderTest.asyncMatchers.toBePending(matchersUtil),
      actual = Promise.reject(new Error('promise was rejected'));

    return matcher.compare(actual).then(function(result) {
      expect(result).toEqual(jasmine.objectContaining({ pass: false }));
    });
  });

  it('fails if actual is not a promise', function() {
    const matchersUtil = new jasmineUnderTest.MatchersUtil(),
      matcher = jasmineUnderTest.asyncMatchers.toBePending(matchersUtil),
      actual = 'not a promise';

    function f() {
      return matcher.compare(actual);
    }

    expect(f).toThrowError('Expected toBePending to be called on a promise.');
  });
});


text:
  La Selle-en-Coglès est
       un village
       situé dans le département de l'Ille-et-Vilaine en Bretagne. Elle totalisait 545 habitants en 2008.

À La Selle-en-Coglès, le prix moyen à la vente d'un appartement s'évalue à 1 608 € du m² en vente. la valorisation moyenne d'une maison à l'achat se situe à 1 325 € du m². À la location le prix moyen se situe à 5,33 € du m² mensuel.

Si vous pensez emmenager à La Selle-en-Coglès, vous pourrez aisément trouver une maison à acheter.

La ville propose quelques  équipements, elle propose entre autres un terrain de tennis et une boucle de randonnée.

Le nombre de logements, à La Selle-en-Coglès, se décomposait en 2011 en six appartements et 266 maisons soit
 un marché relativement équilibré.

À proximité de La Selle-en-Coglès sont positionnées géographiquement les communes de
Montanel localisée à 8 km, 367 habitants,
Montours située à 2 km, 929 habitants,
Saint-Étienne-en-Coglès à 4 km, 1 597 habitants,
Saint-Brice-en-Coglès à 3 km, 2 655 habitants,
Saint-Ouen-la-Rouërie à 7 km, 784 habitants,
Carnet localisée à 8 km, 465 habitants,
 entre autres. De plus, La Selle-en-Coglès est située à seulement quatorze km de Fougères.


text:
id: bd7123c9c448eddfaeb5bdef
title: Encontrar o tamanho de uma string
challengeType: 1
videoUrl: 'https://scrimba.com/c/cvmqEAd'
forumTopicId: 18182
dashedName: find-the-length-of-a-string
---

# --description--

Você pode encontrar o tamanho de um valor de `String` ao escrever `.length` após a variável de string ou literal de string.

```js
console.log("Alan Peter".length);
```

O valor `10` seria exibido no console.

Por exemplo, se nós criássemos uma variável `const firstName = "Ada"`, poderíamos descobrir qual o tamanho da string `Ada` usando a propriedade `firstName.length`.

# --instructions--

Use a propriedade `.length` para contar o número de caracteres na variável `lastName` e atribui-la a `lastNameLength`.

# --hints--

Você não deve alterar as declarações de variáveis na seção `// Setup`.

```js
assert(
  code.match(/let lastNameLength = 0;/) &&
    code.match(/const lastName = "Lovelace";/)
);
```

`lastNameLength` deve ser igual a oito.

```js
assert(typeof lastNameLength !== 'undefined' && lastNameLength === 8);
```

Você deve estar recebendo o tamanho de `lastName` ao usar `.length` dessa forma: `lastName.length`.

```js
assert(code.match(/=\s*lastName\.length/g) && !code.match(/lastName\s*=\s*8/));
```

# --seed--

## --seed-contents--

```js
// Setup
let lastNameLength = 0;
const lastName = "Lovelace";

// Only change code below this line
lastNameLength = lastName;
```

# --solutions--

```js
let lastNameLength = 0;
const lastName = "Lovelace";
lastNameLength = lastName.length;
```


text:
'use strict';

function ConnectCommand(params, modeling) {

  return {
    args: [
      params.shape('source'),
      params.shape('target'),
      params.string('type'),
      params.shape('parent', { optional: true }),
    ],
    exec: function(source, target, type, parent) {
      return modeling.createConnection(source, target, {
        type: type,
      }, parent || source.parent).id;
    }
  };
}

ConnectCommand.$inject = [ 'cli._params', 'modeling' ];

module.exports = ConnectCommand;


text:
import copy

from oslo_log import log as logging

from heat.common import exception
from heat.common.i18n import _
from heat.common.i18n import _LW
from heat.engine import constraints
from heat.engine import properties
from heat.engine.resources.openstack.nova import server

try:
    import pyrax  # noqa
    PYRAX_INSTALLED = True
except ImportError:
    PYRAX_INSTALLED = False

LOG = logging.getLogger(__name__)

class CloudServer(server.Server):
    """Resource for Rackspace Cloud Servers.

    This resource overloads existent integrated OS::Nova::Server resource and
    is used for Rackspace Cloud Servers.
    """

    # Managed Cloud automation statuses
    MC_STATUS_IN_PROGRESS = 'In Progress'
    MC_STATUS_COMPLETE = 'Complete'
    MC_STATUS_BUILD_ERROR = 'Build Error'

    # RackConnect automation statuses
    RC_STATUS_DEPLOYING = 'DEPLOYING'
    RC_STATUS_DEPLOYED = 'DEPLOYED'
    RC_STATUS_FAILED = 'FAILED'
    RC_STATUS_UNPROCESSABLE = 'UNPROCESSABLE'

    properties_schema = copy.deepcopy(server.Server.properties_schema)
    properties_schema.update(
        {
            server.Server.USER_DATA_FORMAT: properties.Schema(
                properties.Schema.STRING,
                _('How the user_data should be formatted for the server. For '
                  'HEAT_CFNTOOLS, the user_data is bundled as part of the '
                  'heat-cfntools cloud-init boot configuration data. For RAW '
                  'the user_data is passed to Nova unmodified. '
                  'For SOFTWARE_CONFIG user_data is bundled as part of the '
                  'software config data, and metadata is derived from any '
                  'associated SoftwareDeployment resources.'),
                default=server.Server.RAW,
                constraints=[
                    constraints.AllowedValues(
                        server.Server._SOFTWARE_CONFIG_FORMATS),
                ]
            ),
        }
    )

    def __init__(self, name, json_snippet, stack):
        super(CloudServer, self).__init__(name, json_snippet, stack)
        self._managed_cloud_started_event_sent = False
        self._rack_connect_started_event_sent = False

    def _config_drive(self):
        user_data = self.properties.get(self.USER_DATA)
        config_drive = self.properties.get(self.CONFIG_DRIVE)
        if user_data or config_drive:
            return True
        else:
            return False

    def _check_managed_cloud_complete(self, server):
        if not self._managed_cloud_started_event_sent:
            msg = _("Waiting for Managed Cloud automation to complete")
            self._add_event(self.action, self.status, msg)
            self._managed_cloud_started_event_sent = True

        if 'rax_service_level_automation' not in server.metadata:
            LOG.debug("Managed Cloud server does not have the "
                      "rax_service_level_automation metadata tag yet")
            return False

        mc_status = server.metadata['rax_service_level_automation']
        LOG.debug("Managed Cloud automation status: %s" % mc_status)

        if mc_status == self.MC_STATUS_IN_PROGRESS:
            return False

        elif mc_status == self.MC_STATUS_COMPLETE:
            msg = _("Managed Cloud automation has completed")
            self._add_event(self.action, self.status, msg)
            return True

        elif mc_status == self.MC_STATUS_BUILD_ERROR:
            raise exception.Error(_("Managed Cloud automation failed"))

        else:
            raise exception.Error(_("Unknown Managed Cloud automation "
                                    "status: %s") % mc_status)

    def _check_rack_connect_complete(self, server):
        if not self._rack_connect_started_event_sent:
            msg = _("Waiting for RackConnect automation to complete")
            self._add_event(self.action, self.status, msg)
            self._rack_connect_started_event_sent = True

        if 'rackconnect_automation_status' not in server.metadata:
            LOG.debug("RackConnect server does not have the "
                      "rackconnect_automation_status metadata tag yet")
            return False

        rc_status = server.metadata['rackconnect_automation_status']
        LOG.debug("RackConnect automation status: %s" % rc_status)

        if rc_status == self.RC_STATUS_DEPLOYING:
            return False

        elif rc_status == self.RC_STATUS_DEPLOYED:
            self._server = None  # The public IP changed, forget old one
            return True

        elif rc_status == self.RC_STATUS_UNPROCESSABLE:
            # UNPROCESSABLE means the RackConnect automation was not
            # attempted (eg. Cloud Server in a different DC than
            # dedicated gear, so RackConnect does not apply).  It is
            # okay if we do not raise an exception.
            reason = server.metadata.get('rackconnect_unprocessable_reason',
                                         None)
            if reason is not None:
                LOG.warn(_LW("RackConnect unprocessable reason: %s"), reason)

            msg = _("RackConnect automation has completed")
            self._add_event(self.action, self.status, msg)
            return True

        elif rc_status == self.RC_STATUS_FAILED:
            raise exception.Error(_("RackConnect automation FAILED"))

        else:
            msg = _("Unknown RackConnect automation status: %s") % rc_status
            raise exception.Error(msg)

    def check_create_complete(self, server):
        """Check if server creation is complete and handle server configs."""
        if not super(CloudServer, self).check_create_complete(server):
            return False

        self.client_plugin().refresh_server(server)

        if ('rack_connect' in self.context.roles and not
                self._check_rack_connect_complete(server)):
            return False

        if ('rax_managed' in self.context.roles and not
                self._check_managed_cloud_complete(server)):
            return False

        return True

def resource_mapping():
    return {'OS::Nova::Server': CloudServer}

def available_resource_mapping():
    if PYRAX_INSTALLED:
        return resource_mapping()
    return {}


text:
Deep Learning + Arts = ArtsyNetworks
=======

*The system uses neural representations to separate
and recombine content and style of arbitrary images, providing a neural
algorithm for the creation of artistic images.* - Gatys et al.

This is my humble attempt to implement the algorithm described in [http://arxiv.org/abs/1508.06576](http://arxiv.org/abs/1508.06576>) by Gatys, Ecker and Bethge (first submitted on 26 August 2015). The code is inspired by Lasagne Recipe - *styletransfer*, yet has several modifications.
The pretrained network is downloaded from [https://s3.amazonaws.com/lasagne/recipes/pretrained/imagenet/vgg19_normalized.pkl](https://s3.amazonaws.com/lasagne/recipes/pretrained/imagenet/vgg19_normalized.pkl) .

Dependencies:

* theano=0.7.0
* lasagne=0.2.dev1
* skimage=0.11.3
* matplotlib=1.4.3

NVIDIA cuDNN is also required: [https://developer.nvidia.com/cudnn](https://developer.nvidia.com/cudnn) . cuDNN v2 was used in this particular case.

Code is tested to work with Python 2.7 under Ubuntu 14.04 and Windows 8.1 v6.3.9600 (both 64 bit) with GeForce GT 755M.

How to Run?
------------

From command line:

```
  python art_it_up.py base_image_path style_image_path
```

e.g.

```
  python art_it_up.py images/tietotalo.jpg images/the_starry_night.jpg
```

Examples
--------

Base image (Tietotalo - TTY):

Style image (The Starry Night - Van Gogh):

Result:

Base image (Me):

Style image (The Scream - Munch):

Result:

Base image (Me):

Style image (La Liberté guidant le peuple - Delacroix):

Result:

## Contact
oguzhan.gencoglu@tut.fi

License: MIT


text:
<?php

namespace Omnipay\UnionPay\Message;

use Omnipay\Common\Message\AbstractResponse;
use Omnipay\UnionPay\Common\DecryptHelper;

/**
 * Class WtzRefundResponse
 * @package Omnipay\UnionPay\Message
 */
class WtzRefundResponse extends AbstractResponse
{
    /**
     * @var WtzRefundRequest
     */
    protected $request;

    public function isSuccessful()
    {
        return isset($this->data['respCode']) && $this->data['respCode'] == '00' && $this->data['verify_success'];
    }

    public function getCustomerInfo()
    {
        $cert = $this->request->getCertPath();
        $pass = $this->request->getCertPassword();

        return DecryptHelper::decryptCustomerInfo($this->data['customerInfo'], $cert, $pass);
    }
}


text:
package transport

import (
	"math"
	"time"
)

const (
	// The default value of flow control window size in HTTP2 spec.
	defaultWindowSize = 65535
	// The initial window size for flow control.
	initialWindowSize             = defaultWindowSize // for an RPC
	infinity                      = time.Duration(math.MaxInt64)
	defaultClientKeepaliveTime    = infinity
	defaultClientKeepaliveTimeout = 20 * time.Second
	defaultMaxStreamsClient       = 100
	defaultMaxConnectionIdle      = infinity
	defaultMaxConnectionAge       = infinity
	defaultMaxConnectionAgeGrace  = infinity
	defaultServerKeepaliveTime    = 2 * time.Hour
	defaultServerKeepaliveTimeout = 20 * time.Second
	defaultKeepalivePolicyMinTime = 5 * time.Minute
	// max window limit set by HTTP2 Specs.
	maxWindowSize = math.MaxInt32
	// defaultWriteQuota is the default value for number of data
	// bytes that each stream can schedule before some of it being
	// flushed out.
	defaultWriteQuota              = 64 * 1024
	defaultClientMaxHeaderListSize = uint32(16 << 20)
	defaultServerMaxHeaderListSize = uint32(16 << 20)
)


text:
<ModuleInfoEntry>
    <Module Name="CEGUI.WindowRendererSets.Core" Type="SharedLibrary" Platform="All">
        <Dependencies>
            <Dependency Name="CEGUI" />
            <Dependency Name="CEGUI.Includes" />
        </Dependencies>
        <Linker>
            <Dependency Name="CEGUI" />
        </Linker>
        <Preprocessor>
            <Define String="CEGUICOREWINDOWRENDERERSET_EXPORTS" />
        </Preprocessor>
    </Module>
</ModuleInfoEntry>


text:
/**
 * Imports
 */

import test from 'tape'
import filterPaint from '.'

/**
 * <Filter Paint/> tests
 */

test('<filterPaint/> should work', t => {

})


text:
#pragma once
#include <aws/sagemaker/SageMaker_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>

namespace Aws
{
namespace SageMaker
{
namespace Model
{
  enum class NotebookInstanceSortKey
  {
    NOT_SET,
    Name,
    CreationTime,
    Status
  };

namespace NotebookInstanceSortKeyMapper
{
AWS_SAGEMAKER_API NotebookInstanceSortKey GetNotebookInstanceSortKeyForName(const Aws::String& name);

AWS_SAGEMAKER_API Aws::String GetNameForNotebookInstanceSortKey(NotebookInstanceSortKey value);
} // namespace NotebookInstanceSortKeyMapper
} // namespace Model
} // namespace SageMaker
} // namespace Aws


text:
Router.configure({
    layoutTemplate: "layout",
    loadingTemplate: "loading"
});

Router.route("/", {
    name: "dashboard",
    action: function () {
        if (this.ready()) {
            // Display Login form is no user is logged in
            if (!Meteor.userId()) {
                Router.go("/sign-in");
            } else {
                this.render("dashboard");
            }
        }
    }
});

Router.route("/daily-sales", {
    name: "dailySales",
    action: function () {
        if (this.ready()) {
            // Display Login form is no user is logged in
            if (!Meteor.userId()) {
                Router.go("/sign-in");
            } else {
                this.render("dailySales");
            }
        }
    }
});

Router.route("/sign-in", {
    name: "signIn",
    action: function () {
        this.layout("layoutAnonymous");
        if (this.ready()) {
            // Render login form if no user is logged in
            if (!Meteor.userId()) {
                this.render("signIn");
            } else {
                Router.go("/");
            }
        }
    }
});

Router.route("/administer/users", {
    name: "userAdministration",
    action: function () {
        if (this.ready()) {
            // Render login form if no user is logged in
            if (!Meteor.userId()) {
                Router.go("/sign-in");
            } else {
                this.render("users");
            }
        }
    },
    data: function () {
        return {
            user: new User(),
            selectedUser: new User()
        };
    }
});

Router.route("/administer/roles-and-permissions", {
    name: "rolesAndPermissionsAdministration",
    action: function () {
        if (this.ready()) {
            // Render login form if no user is logged in
            if (!Meteor.userId()) {
                Router.go("/sign_in");
            } else {
                this.render("rolesAndPermissions");
            }
        }
    },
    data: function () {
        return {
            role: new Role(),
            selectedRole: new Role(),
            permission: new Permission(),
            selectedPermission: new Permission()
        };
    }
});

Router.route("/settings/sales-team", {
    name: "salesTeam",
    action: function () {
        if (this.ready()) {
            // Render login form if no user is logged in
            if (!Meteor.userId()) {
                Router.go("/sign-in");
            } else {
                this.render("salesTeam");
            }
        }
    },
    data: function () {
        return {
            salesperson: new Salesperson(),
            selectedSalesperson: new Salesperson()
        };
    }
});

Router.route("/settings/items", {
    name: "items",
    action: function () {
        if (this.ready()) {
            // Render login form if no user is logged in
            if (!Meteor.userId()) {
                Router.go("/sign-in");
            } else {
                this.render("items");
            }
        }
    },
    data: function () {
        return {
            item: new Item(),
            selectedItem: new Item()
        };
    }
});

Router.route("/notifications", {
    name: "notifications",
    action: function () {
        if (this.ready()) {
            // Render login form if no user is logged in
            if (!Meteor.userId()) {
                Router.go("/sign-in");
            } else {
                this.render("notificationsList");
            }
        }
    }
});

Router.route("/notification/:_id", {
    name: "notification",
    action: function () {
        if (this.ready()) {
            // Render login form if no user is logged in
            if (!Meteor.userId()) {
                Router.go("/sign-in");
            } else {
                Notifications.update({_id: this.params._id}, {$set: {isRead: true}});
                this.render("viewNotification");
            }
        }
    },
    data: function () {
        return {
            notification: Notifications.findOne({_id: this.params._id})
        };
    }
});

Router.route("/reports/daily-sales", {
    name: "dailySalesReport",
    action: function () {
        if (this.ready()) {
            // Display Login form is no user is logged in
            if (!Meteor.userId()) {
                Router.go("/sign-in");
            } else {
                this.render("dailySalesReport");
            }
        }
    }
});


text:
layout: post
date: '2015-12-27'
title: "Amanda Wakeley Bella Wedding Dress Long Sleeves Chapel Train Aline/Princess"
category: Amanda Wakeley
tags: [Amanda Wakeley,Aline/Princess ,Off The Shoulder,V neck,Chapel Train,Long Sleeves]
---
### Amanda Wakeley Bella Wedding Dress
Just **$289.99**
###   Long Sleeves Chapel Train Aline/Princess

BRANDS	Amanda Wakeley

Silhouette	Aline/Princess

Neckline	Off The Shoulder,V neck

Hemline/Train	Chapel Train

Sleeve	Long Sleeves

Buy it: [https://www.readybrides.com/en/amanda-wakeley/17520-amanda-wakeley-bella-wedding-dress.html](https://www.readybrides.com/en/amanda-wakeley/17520-amanda-wakeley-bella-wedding-dress.html)


text:
module Controller.Conditions.Step
   (installHandlers)
  where

-- External imports
import Control.Monad
import Graphics.UI.Gtk
import Hails.MVC.Model.ProtectedModel.Reactive
import SoOSiM (tick)

-- Internal imports
import CombinedEnvironment
import Controller.Helpers.NextSimState
import Data.History
import Model.Model
import Model.SystemStatus

-- | Executes one simulation step when the user clicks on
-- the Step button
installHandlers :: CEnv -> IO()
installHandlers cenv = void $ do
  stepF <- stepForwardToolBtn ui
  stepF `onToolButtonClicked` conditionF cenv

  -- stepFS <- stepForwardSmallToolBtn ui
  -- stepFS `onToolButtonClicked` conditionFS cenv

  stepB <- stepBackToolBtn ui
  stepB `onToolButtonClicked` conditionB cenv
 where ui = view cenv

-- | Updates the state with the next step only if the system is paused
conditionF :: CEnv -> IO()
conditionF cenv = void $ do
  st <- getter statusField $ model cenv
  when (st == Paused) $ modelUpdateNextStepWith cenv tick

-- -- | Updates the state with the next step only if the system is paused
-- conditionFS :: CEnv -> IO()
-- conditionFS cenv = void $ do
--   st <- getter statusField $ model cenv
--   when (st == Paused) $ modelUpdateNextStepWith cenv tick

-- | Go back one step
conditionB :: CEnv -> IO()
conditionB cenv = void $ do
  st <- getter statusField pm
  when (st == Paused) $ modifier simStateField pm (fmap previousState)
 where pm = model cenv

previousState :: SimGLState -> SimGLState
previousState state = state { simGLSystemStatus = previousStatus (simGLSystemStatus state) }

previousStatus :: SystemStatus -> SystemStatus
previousStatus (SystemStatus hist sel) = SystemStatus hist' sel
 where hist' = historyBack hist


text:
from django.db import models

from rest_framework import serializers

from fjord.base.api_utils import UTCDateTimeField
from fjord.base.models import ModelBase, JSONObjectField

class Survey(ModelBase):
    """Defines a survey

    We'll create a survey every time we want to ask a new question to
    users. The survey name will be used in incoming answers posted by
    the heartbeat client.

    We won't capture answers for surveys that don't exist or are
    disabled.

    """
    name = models.CharField(
        max_length=100, unique=True,
        help_text=u'Unique name for the survey. e.g. heartbeat-question-1'
    )
    description = models.TextField(
        blank=True, default='',
        help_text=(
            u'Informal description of the survey so we can tell them apart'
        )
    )
    enabled = models.BooleanField(default=False)
    created = models.DateTimeField(auto_now_add=True)

    def __unicode__(self):
        return '%s: %s' % (
            self.name, 'enabled' if self.enabled else 'disabled')

class Answer(ModelBase):
    """A survey answer.

    When a user is selected to be asked a survey question, we'll
    capture their answer, contextual data and their progression
    through the survey flow in an Answer.

    .. Note::

       This data contains personally identifiable information and so
       it can **never** be made publicly available.

    """
    # The version of the experiment addon.
    experiment_version = models.CharField(max_length=50)

    # The version of the HTTP POST packet shape. This allows us to
    # change how some of the values in the packet are calculated and
    # distinguish between different iterations of answers for the same
    # survey.
    response_version = models.IntegerField()

    # Timestamp of the last update to this Answer.
    updated_ts = models.BigIntegerField(default=0)

    # uuids of things. person_id can have multiple flows where each
    # flow represents a different time the person was asked to
    # participate in the survey. It's possible the question text could
    # change. We capture it here to make it easier to do db analysis
    # without requiring extra maintenance (e.g. updating a Question
    # table).
    person_id = models.CharField(max_length=50)
    survey_id = models.ForeignKey(
        Survey, db_column='survey_id', to_field='name', db_index=True)
    flow_id = models.CharField(max_length=50)

    # The id, text and variation of the question being asked.
    question_id = models.CharField(max_length=50)
    question_text = models.TextField()
    variation_id = models.CharField(max_length=100)

    # score out of max_score. Use null for no value.
    score = models.FloatField(null=True, blank=True)
    max_score = models.FloatField(null=True, blank=True)

    # These are the timestamps the user performed various actions in
    # the flow. Use 0 for no value.
    flow_began_ts = models.BigIntegerField(default=0)
    flow_offered_ts = models.BigIntegerField(default=0)
    flow_voted_ts = models.BigIntegerField(default=0)
    flow_engaged_ts = models.BigIntegerField(default=0)

    # Data about the user's browser. Use '' for no value.
    platform = models.CharField(max_length=50, blank=True, default=u'')
    channel = models.CharField(max_length=50, blank=True, default=u'',
                               db_index=True)
    version = models.CharField(max_length=50, blank=True, default=u'')
    locale = models.CharField(max_length=50, blank=True, default=u'',
                              db_index=True)
    country = models.CharField(max_length=4, blank=True, null=True,
                               default=u'', db_index=True)
    build_id = models.CharField(max_length=50, blank=True, default=u'')
    partner_id = models.CharField(max_length=50, blank=True, default=u'')

    # Data about the user's profile. Use null for no value.
    profile_age = models.BigIntegerField(null=True, blank=True)

    # Data about the profile usage, addons and extra stuff. Use {} for
    # no value.
    profile_usage = JSONObjectField(blank=True)
    addons = JSONObjectField(blank=True)

    # This will likely include data like "crashiness", "search
    # settings" and any "weird settings". This will have some context
    # surrounding the rating score.
    extra = JSONObjectField(blank=True)

    # Whether or not this is test data.
    is_test = models.BooleanField(default=False, blank=True)

    received_ts = models.DateTimeField(
        auto_now=True,
        help_text=u'Time the server received the last update packet',
        db_index=True)

    class Meta:
        unique_together = (
            ('person_id', 'survey_id', 'flow_id'),
        )
        index_together = [
            ('person_id', 'survey_id', 'flow_id'),
        ]

    def __unicode__(self):
        return '%s: %s %s %s' % (
            self.id, self.survey_id, self.flow_id, self.updated_ts)

class AnswerSerializer(serializers.ModelSerializer):
    updated_ts = serializers.IntegerField(required=True)
    survey_id = serializers.SlugRelatedField(
        queryset=Survey.objects.all(), slug_field='name')

    received_ts = UTCDateTimeField(read_only=True)

    class Meta:
        model = Answer

    def validate_survey_id(self, survey):
        # Make sure the survey is enabled--otherwise error out.
        if not survey.enabled:
            raise serializers.ValidationError(
                'survey "%s" is not enabled' % survey.name)
        return survey

    def get_unique_together_validators(self):
        # We no-op this because we want to ignore the unique fields
        # check on the model instance so that we can "update on
        # POST". We do "update on POST" in order to simplify the
        # heartbeat client.
        return []


text:
package main

import (
	"bytes"
	"fmt"
	"io"
	"os"
	"os/exec"
	"strings"

	"github.com/pkg/errors"

	"github.com/ahmetb/kubectx/internal/cmdutil"
	"github.com/ahmetb/kubectx/internal/env"
	"github.com/ahmetb/kubectx/internal/kubeconfig"
	"github.com/ahmetb/kubectx/internal/printer"
)

type InteractiveSwitchOp struct {
	SelfCmd string
}

type InteractiveDeleteOp struct {
	SelfCmd string
}

func (op InteractiveSwitchOp) Run(_, stderr io.Writer) error {
	// parse kubeconfig just to see if it can be loaded
	kc := new(kubeconfig.Kubeconfig).WithLoader(kubeconfig.DefaultLoader)
	if err := kc.Parse(); err != nil {
		if cmdutil.IsNotFoundErr(err) {
			printer.Warning(stderr, "kubeconfig file not found")
			return nil
		}
		return errors.Wrap(err, "kubeconfig error")
	}
	kc.Close()

	cmd := exec.Command("fzf", "--ansi", "--no-preview")
	var out bytes.Buffer
	cmd.Stdin = os.Stdin
	cmd.Stderr = stderr
	cmd.Stdout = &out

	cmd.Env = append(os.Environ(),
		fmt.Sprintf("FZF_DEFAULT_COMMAND=%s", op.SelfCmd),
		fmt.Sprintf("%s=1", env.EnvForceColor))
	if err := cmd.Run(); err != nil {
		if _, ok := err.(*exec.ExitError); !ok {
			return err
		}
	}
	choice := strings.TrimSpace(out.String())
	if choice == "" {
		return errors.New("you did not choose any of the options")
	}
	name, err := switchContext(choice)
	if err != nil {
		return errors.Wrap(err, "failed to switch context")
	}
	printer.Success(stderr, "Switched to context \"%s\".", printer.SuccessColor.Sprint(name))
	return nil
}

func (op InteractiveDeleteOp) Run(_, stderr io.Writer) error {
	// parse kubeconfig just to see if it can be loaded
	kc := new(kubeconfig.Kubeconfig).WithLoader(kubeconfig.DefaultLoader)
	if err := kc.Parse(); err != nil {
		if cmdutil.IsNotFoundErr(err) {
			printer.Warning(stderr, "kubeconfig file not found")
			return nil
		}
		return errors.Wrap(err, "kubeconfig error")
	}
	kc.Close()

	if len(kc.ContextNames()) == 0 {
		return errors.New("no contexts found in config")
	}

	cmd := exec.Command("fzf", "--ansi", "--no-preview")
	var out bytes.Buffer
	cmd.Stdin = os.Stdin
	cmd.Stderr = stderr
	cmd.Stdout = &out

	cmd.Env = append(os.Environ(),
		fmt.Sprintf("FZF_DEFAULT_COMMAND=%s", op.SelfCmd),
		fmt.Sprintf("%s=1", env.EnvForceColor))
	if err := cmd.Run(); err != nil {
		if _, ok := err.(*exec.ExitError); !ok {
			return err
		}
	}

	choice := strings.TrimSpace(out.String())
	if choice == "" {
		return errors.New("you did not choose any of the options")
	}

	name, wasActiveContext, err := deleteContext(choice)
	if err != nil {
		return errors.Wrap(err, "failed to delete context")
	}

	if wasActiveContext {
		printer.Warning(stderr, "You deleted the current context. Use \"%s\" to select a new context.",
			selfName())
	}

	printer.Success(stderr, `Deleted context %s.`, printer.SuccessColor.Sprint(name))

	return nil
}


text:
class dtkVtImageReaderPlugin : public dtkImageReaderPlugin
{
    Q_OBJECT
    Q_INTERFACES(dtkImageReaderPlugin)
    Q_PLUGIN_METADATA(IID "fr.inria.dtkVtImageReaderPlugin" FILE "dtkVtImageReaderPlugin.json")

public:
     dtkVtImageReaderPlugin(void) {}
    ~dtkVtImageReaderPlugin(void) {}

public:
    void initialize(void);
    void uninitialize(void);
};

//
// dtkImageReaderPlugin.h ends here


text:
/** @file
 @brief GATT shell functions

 This is not to be included by the application.
 */

/*
 * Copyright (c) 2017 Intel Corporation
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#ifndef __GATT_H
#define __GATT_H

int cmd_gatt_exchange_mtu(int argc, char *argv[]);
int cmd_gatt_discover(int argc, char *argv[]);
int cmd_gatt_read(int argc, char *argv[]);
int cmd_gatt_mread(int argc, char *argv[]);
int cmd_gatt_write(int argc, char *argv[]);
int cmd_gatt_write_without_rsp(int argc, char *argv[]);
int cmd_gatt_subscribe(int argc, char *argv[]);
int cmd_gatt_unsubscribe(int argc, char *argv[]);
int cmd_gatt_register_test_svc(int argc, char *argv[]);
int cmd_gatt_write_cmd_metrics(int argc, char *argv[]);

#endif /* __GATT_H */


text:
author: miky
comments: true
date: 2009-01-27 11:27:00+00:00
layout: post
slug: bilbo-wasabi-09
title: Bilbo Wasabi '09
categories: day-by-day
---

![](http://childrenatyourfeet.com/wp-content/uploads/bilbo_wasabi.jpg)

Tal como andan las cosas, nunca puedes dar nada por seguro. Pero creo que pese a mi reciente [visita a Bilbao](http://www.dosidiotas.com/2009/01/metal-blogs-i/) (with C), el anfitrion [Macos_lucas ](http://www.macoslucas.com)se enfadará mucho si no nos volvemos a prensentar en el Bilbo Wasabi '09. Evento que supongo reunirá a muchos de los apañeros bloggeriles, que, en el fondo, tanto echamos de menos. Eso sí, [Samuel ](http://www.sopmacsl.com)también se va a venir, y sino, prometo lanzar mi ira contra todas sus pequeñas manzanitas.

No puedo asegurar mi (nuestra) presencia, pero desde luego sí la intención de andar por allá de pintxos y fiestuki. Esta vez habrá que reservar un hotelito... ¡A ver quién se va apuntando a la quedada!


text:
title: Async data in components
description: Async data in components?
---

# Async data in components?

It is not possible because it's not linked to a route, Nuxt.js surcharges the component data() associated to a route to allow async data.

For sub components, there are 2 ways of achieving it:
1. Making the API call in the mounted() hook and setting the data afterwards, downside: no server rendering
2. Making the API call in the data() of the page component and giving the data as a prop to the subComponent: server rendering OK. But the data() of the page might be less readable because it's loading the async data of the sub components

It all depends if you want the sub components to be server-rendered or not.


text:
Walking Cat Animation:  https://codepen.io/SoyEva/pen/LRjWzZ

Animated Christmas Tree: https://codepen.io/dodozhang21/full/imIvg/

Mr. Jellyfish: https://codepen.io/FabioG/full/QjLreK/

Animated Working Clock: https://codepen.io/iliadraznin/full/JcqbE/


text:
namespace TraktApiSharp.Objects.Get.Collections.Json.Reader
{
    using Newtonsoft.Json;
    using Objects.Json;
    using Shows.Json.Reader;
    using System.Threading;
    using System.Threading.Tasks;

    internal class CollectionShowObjectJsonReader : AObjectJsonReader<ITraktCollectionShow>
    {
        public override async Task<ITraktCollectionShow> ReadObjectAsync(JsonTextReader jsonReader, CancellationToken cancellationToken = default)
        {
            if (jsonReader == null)
                return await Task.FromResult(default(ITraktCollectionShow));

            if (await jsonReader.ReadAsync(cancellationToken) && jsonReader.TokenType == JsonToken.StartObject)
            {
                var showObjectReader = new ShowObjectJsonReader();
                var showSeasonsArrayReader = new CollectionShowSeasonArrayJsonReader();

                ITraktCollectionShow traktCollectionShow = new TraktCollectionShow();

                while (await jsonReader.ReadAsync(cancellationToken) && jsonReader.TokenType == JsonToken.PropertyName)
                {
                    var propertyName = jsonReader.Value.ToString();

                    switch (propertyName)
                    {
                        case JsonProperties.COLLECTION_SHOW_PROPERTY_NAME_LAST_COLLECTED_AT:
                            {
                                var value = await JsonReaderHelper.ReadDateTimeValueAsync(jsonReader, cancellationToken);

                                if (value.First)
                                    traktCollectionShow.LastCollectedAt = value.Second;

                                break;
                            }
                        case JsonProperties.COLLECTION_SHOW_PROPERTY_NAME_SHOW:
                            traktCollectionShow.Show = await showObjectReader.ReadObjectAsync(jsonReader, cancellationToken);
                            break;
                        case JsonProperties.COLLECTION_SHOW_PROPERTY_NAME_SEASONS:
                            traktCollectionShow.CollectionSeasons = await showSeasonsArrayReader.ReadArrayAsync(jsonReader, cancellationToken);
                            break;
                        default:
                            await JsonReaderHelper.ReadAndIgnoreInvalidContentAsync(jsonReader, cancellationToken);
                            break;
                    }
                }

                return traktCollectionShow;
            }

            return await Task.FromResult(default(ITraktCollectionShow));
        }
    }
}


text:
package com.monkeypatch.mktd.feignvsretrofit.exo1;

class ApiFactory {

    static MonkeyApi buildMonkeyApi(String url) {
        // TODO you should implements this method
        throw new RuntimeException("Not yet implemented");
    }

    static MonkeyRaceApi buildRaceApi(String url) {
        // TODO you should implements this method
        throw new RuntimeException("Not yet implemented");
    }

    static MonkeyStatsApi buildStatsApi(String url) {
        // TODO you should implements this method
        throw new RuntimeException("Not yet implemented");
    }
}


text:
define(["ko", "navigationService", "authenticationManager"], function(ko, NavigationServiceModule, AuthenticationManagerModule){

    function NavigationManager(){
        var self = this;

        self._ = {
            disposed: false,
            urlCache: null,

            navigationService: NavigationServiceModule.get(),
            authenticationManager: AuthenticationManagerModule.get(),

            checkIfDisposed: function(){
                if(!self._.disposed){
                    throw new Error("Navigation Manager is disposed");
                }
            }
        };

        self.currentRoute = ko.observable();

        self.currentRouteSubscription = self._.navigationService.currentRoute.subscribe(function(newRoute){
            var i;
            for(i=0; i<self._.navigationService.routes.length; i++){
                if(self._.navigationService.routes[i].route === newRoute){
                    self.currentRoute(self._.navigationService.routes[i]);
                    break;
                }
            }
        });

        self.loggedInSubscription = self._.authenticationManager.loggedIn.subscribe(function(loggedIn){
            if(!loggedIn){
                self._.navigationService.currentRoute("login");
                location = "/#/login";
            }
        });

        /*
         * Gets the list of navigable routes
         */
        self.getRoutes = function(){
            return self._.navigationService.routes.sort();
        }

        /*
         *  Sets the route
         */
        self.setRoute = function(route){
            if(typeof route == "undefined" || route == null){
                throw new Error("NavigationManager.setRoute requites a non-null route");
            }
            if(self._.navigationService.validRoute(route)){
                if(self._.urlCache === null || self._.urlCache === ""){
                    self._.navigationService.currentRoute(route);
                    location = "/#/" + route
                }
                else{
                    location = "/#/" + route + self._.urlCache;
                    self._.navigationService.currentRoute(route);
                    location = "/#/" + route + self._.urlCache;
                    self._.urlCache = null;
                }
            }
            else{
                self._.navigationService.currentRoute("login");
                location = "/#/login";
            }
        }

        self.getRouteDetails = function(route){
            var routes = self.getRoutes();
            for(var x=0; x<routes.length; x++){
                if(routes[x].route === route){
                    return routes[x];
                }
            }
            return null;
        }

        self.validRoute = function(route){
            return self._.navigationService.validRoute(route);
        };

        /*
         * Gets the route
         */
        self.getRoute = function(){
            return self.currentRoute();
        }

        self.cacheUrlVariable = function(key, value){
            if(self._.urlCache === null){
                self._.urlCache = "?" + key + "=" + encodeURI(value);
            }
            else{
                self._.urlCache += "&" + key + "=" + encodeURI(value);
            }
        }

        self.dispose = function(){
            if(!self._.disposed){

                self._.navigationService.dispose();
                self._.navigationService = null;

                self._.disposed = true;
            }
        };
    }

    return {
        get: function(){
            return new NavigationManager();
        },
        type: function(){
            return NavigationManager;
        }
    };
});


text:
using System.Linq;
namespace Bam.Core
{
    /// <summary>
    /// Stack like behaviour (push/pop), but peeking is allowed anywhere along the length of the stack.
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public sealed class PeekableStack<T>
    {
        private readonly System.Collections.Generic.List<T> list = new System.Collections.Generic.List<T>();

        /// <summary>
        /// Push a new object of type T onto the end of the stack.
        /// </summary>
        /// <param name="obj">Object to push onto stack.</param>
        public void
        Push(
            T obj) => this.list.Add(obj);

        /// <summary>
        /// Return the object on the end of the stack, and remove it from the stack.
        /// </summary>
        /// <returns>Object that was at the end of the stack.</returns>
        public T
        Pop()
        {
            var element = this.list.Last();
            this.list.RemoveAt(this.list.Count - 1);
            return element;
        }

        /// <summary>
        /// For compatibility with System.Collection.Generic.Stack<typeparamref name="T"/>.
        /// Return, but do not remove, the object on the end of the stack.
        /// </summary>
        /// <returns>Object that remains on the end of the stack.</returns>
        public T
        Peek()
        {
            return this.Peek(0);
        }

        /// <summary>
        /// More generalised peeking.
        /// Return, but do not remove, the object at the specified distance from the end of the stack.
        /// Using index = 0, is the same as calling Peek().
        /// </summary>
        /// <param name="index">Number of elements from the end of the stack to return.</param>
        /// <returns>Object, index elements from the end of the stack, but which remains on the stack.</returns>
        public T
        Peek(
            int index)
        {
            return this.list.ElementAt(this.list.Count - index - 1);
        }

        /// <summary>
        /// Returns the number of elements on the stack (read only).
        /// </summary>
        public int Count => this.list.Count;

        /// <summary>
        /// True if the stack is empty.
        /// </summary>
        public bool Empty => (0 == this.list.Count);
    }
}


text:
package org.apache.drill.exec.memory;

import org.apache.drill.test.BaseTest;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import io.netty.buffer.DrillBuf;
import io.netty.util.IllegalReferenceCountException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

public class BoundsCheckingTest extends BaseTest {
  private static final Logger logger = LoggerFactory.getLogger(BoundsCheckingTest.class);

  private static boolean old;

  private RootAllocator allocator;

  private static boolean setBoundsChecking(boolean enabled) {
    String oldValue = System.setProperty(BoundsChecking.ENABLE_UNSAFE_BOUNDS_CHECK_PROPERTY, String.valueOf(enabled));
    return Boolean.parseBoolean(oldValue);
  }

  @BeforeClass
  public static void setBoundsCheckingEnabled() {
    old = setBoundsChecking(true);
  }

  @AfterClass
  public static void restoreBoundsChecking() {
    setBoundsChecking(old);
  }

  @Before
  public void setupAllocator() {
    allocator = new RootAllocator(Integer.MAX_VALUE);
  }

  @After
  public void closeAllocator() {
    allocator.close();
  }

  @Test
  public void testLengthCheck() {
    assertTrue(BoundsChecking.BOUNDS_CHECKING_ENABLED);
    try {
      BoundsChecking.lengthCheck(null, 0, 0);
      fail("expecting NullPointerException");
    } catch (NullPointerException e) {
      logger.debug("", e);
    }

    try (DrillBuf buffer = allocator.buffer(1)) {
      try {
        BoundsChecking.lengthCheck(buffer, 0, -1);
        fail("expecting IllegalArgumentException");
      } catch (IllegalArgumentException e) {
        logger.debug("", e);
      }
      BoundsChecking.lengthCheck(buffer, 0, 0);
      BoundsChecking.lengthCheck(buffer, 0, 1);
      try {
        BoundsChecking.lengthCheck(buffer, 0, 2);
        fail("expecting IndexOutOfBoundsException");
      } catch (IndexOutOfBoundsException e) {
        logger.debug("", e);
      }
      try {
        BoundsChecking.lengthCheck(buffer, 2, 0);
        fail("expecting IndexOutOfBoundsException");
      } catch (IndexOutOfBoundsException e) {
        logger.debug("", e);
      }
      try {
        BoundsChecking.lengthCheck(buffer, -1, 0);
        fail("expecting IndexOutOfBoundsException");
      } catch (IndexOutOfBoundsException e) {
        logger.debug("", e);
      }
    }

    DrillBuf buffer = allocator.buffer(1);
    buffer.release();
    try {
      BoundsChecking.lengthCheck(buffer, 0, 0);
      fail("expecting IllegalReferenceCountException");
    } catch (IllegalReferenceCountException e) {
      logger.debug("", e);
    }
  }
}


text:
%
% Chapter 10.2
%

\section*{10.2 Calculus with Parametric Curves}

\[ \frac{dy}{dx} = \frac{dy}{dt} \times \frac{dt}{dx} = \frac{\frac{dy}{dt}}{\frac{dx}{dt}} \]

\subsection*{Areas}

The area under the curve generated from the parametric equation \(x=f(t)\) and \(y=g(t)\), \(\alpha \leq t \leq \beta\) is
\[ A = \int_a^b{ydx} = \int_{\alpha}^{\beta}{g(t)f'(t)dt} \]

\subsection*{Arc Length}

If a curve \(C\) is described by the parametric equations \(s = f(t)\), \(y=g(t)\), \(\alpha \leq t \leq \beta\), where \(f'\) and \(g'\) are continuous on \([ \alpha, \beta]\) and \(C\) is traversed exactly once as \(t\) increases from \(\alpha\) to \(\beta\), then the length of \(C\) is
\[ L = \int_{\alpha}^{\beta}{\sqrt{\bigg(\frac{dx}{dt}\bigg)^2 + \bigg(\frac{dy}{dt} \bigg)^2}dt} \]

\subsection*{Surface Area}

If a curve \(C\) is described by the parametric equations \(x=f(t)\), \(y=g(t)\), \(\alpha \leq t \leq \beta\), where \(f'\), \(g'\) are continuous on \([\alpha, \beta]\) and \(C\) is traversed exactly once as \(t\) increases from \(\alpha\) to \(\beta\), then the length of \(C\) is
\[ S = \int_{\alpha}^{\beta}{2 \pi y \sqrt{\bigg( \frac{dx}{dt} \bigg)^2 + \bigg( \frac{dy}{dt} \bigg)^2}dt}\]


text:
import { Sorting } from '../../../core/sorting';
import { datetime } from '../../../libs/datetime';
import { NoteCollectionAction, NoteCollectionActionTypes } from './note-collection.actions';
import {
    createNoteCollectionInitialState,
    NoteCollectionFilterBy,
    NoteCollectionSortBy,
    NoteCollectionState,
} from './note-collection.state';
import { NoteItem } from './note-item.model';

const sorting = new Sorting<NoteItem>();

function isIndexOfNoteIsSelectedNote(state: NoteCollectionState, index: number): boolean {
    if (state.notes[index] === undefined || state.selectedNote === null) {
        return false;
    }

    return state.notes[index].id === state.selectedNote.id;
}

function getIndexOfNote(state: NoteCollectionState, targetNote: NoteItem): number {
    return state.notes.findIndex(note => note.id === targetNote.id);
}

function withFilteredAndSortedNotes(state: NoteCollectionState): NoteCollectionState {
    let notes: NoteItem[];

    // Filter notes.
    let filterSource;

    switch (state.filterBy) {
        case NoteCollectionFilterBy.BY_MONTH:
            filterSource = new Date(
                state.selectedMonth.year,
                state.selectedMonth.month,
            );

            notes = state.notes.filter(note =>
                datetime.isAtSameMonth(filterSource, new Date(note.createdDatetime)));

            break;

        case NoteCollectionFilterBy.BY_DATE:
            filterSource = new Date(
                state.selectedDate.year,
                state.selectedDate.month,
                state.selectedDate.date,
            );

            notes = state.notes.filter(note =>
                datetime.isSameDay(filterSource, new Date(note.createdDatetime)));

            break;

        default:
            notes = [...state.notes];
            break;
    }

    // Sort notes.
    switch (state.sortBy) {
        case NoteCollectionSortBy.CREATED:
            sorting.setIndexPropGetter(note => note.createdDatetime);
            break;

        case NoteCollectionSortBy.TITLE:
            sorting.setIndexPropGetter(note => note.title);
            break;
    }

    sorting
        .setDirection(state.sortDirection)
        .sort(notes);

    return {
        ...state,
        filteredAndSortedNotes: notes,
    };
}

function withNoteUpdate(
    state: NoteCollectionState,
    index: number,
    patch: Partial<NoteItem>,
): NoteCollectionState {
    const target = state.notes[index];

    if (target === undefined) {
        return state;
    }

    const notes = [...state.notes];
    notes[index] = { ...notes[index], ...patch };

    // If index of note is currently selected, update it.
    if (isIndexOfNoteIsSelectedNote(state, index)) {
        return {
            ...state,
            selectedNote: {
                ...state.selectedNote,
                ...patch,
            },
            notes,
        };
    } else {
        return { ...state, notes };
    }
}

function withNoteDelete(
    state: NoteCollectionState,
    deleteIndex: number,
): NoteCollectionState {
    if (state.notes[deleteIndex] === undefined) {
        return state;
    }

    const notes = [...state.notes];
    notes.splice(deleteIndex, 1);

    // If selected note is deleted, we also need to remove selected note.
    if (isIndexOfNoteIsSelectedNote(state, deleteIndex)) {
        return {
            ...state,
            selectedNote: null,
            notes,
        };
    } else {
        return { ...state, notes };
    }
}

export function noteCollectionReducer(
    state: NoteCollectionState = createNoteCollectionInitialState(),
    action: NoteCollectionAction,
): NoteCollectionState {

    switch (action.type) {
        case NoteCollectionActionTypes.LOAD_COLLECTION:
            return {
                ...state,
                loading: true,
            };

        case NoteCollectionActionTypes.LOAD_COLLECTION_COMPLETE:
            return withFilteredAndSortedNotes({
                ...state,
                loading: false,
                loaded: true,
                notes: [...action.payload.notes],
            });

        case NoteCollectionActionTypes.SELECT_DATE_FILTER:
            return withFilteredAndSortedNotes({
                ...state,
                filterBy: NoteCollectionFilterBy.BY_DATE,
                selectedDate: {
                    year: action.payload.date.getFullYear(),
                    month: action.payload.date.getMonth(),
                    date: action.payload.date.getDate(),
                },
            });

        case NoteCollectionActionTypes.SELECT_MONTH_FILTER:
            return withFilteredAndSortedNotes({
                ...state,
                filterBy: NoteCollectionFilterBy.BY_MONTH,
                selectedMonth: {
                    year: action.payload.date.getFullYear(),
                    month: action.payload.date.getMonth(),
                },
                selectedDate: null,
            });

        case NoteCollectionActionTypes.CHANGE_SORT_ORDER:
            return withFilteredAndSortedNotes({
                ...state,
                sortBy: action.payload.sortBy,
            });

        case NoteCollectionActionTypes.CHANGE_SORT_DIRECTION:
            return withFilteredAndSortedNotes({
                ...state,
                sortDirection: action.payload.sortDirection,
            });

        case NoteCollectionActionTypes.CHANGE_VIEW_MODE:
            return {
                ...state,
                viewMode: action.payload.viewMode,
            };

        case NoteCollectionActionTypes.SELECT_NOTE:
            return {
                ...state,
                selectedNote: { ...action.payload.note },
            };

        case NoteCollectionActionTypes.DESELECT_NOTE:
            return {
                ...state,
                selectedNote: null,
            };

        case NoteCollectionActionTypes.ADD_NOTE:
            const notes = [...state.notes];
            notes.push(action.payload.note);

            return withFilteredAndSortedNotes({
                ...state,
                notes,
            });

        case NoteCollectionActionTypes.UPDATE_CONTRIBUTION:
            return {
                ...state,
                contribution: { ...action.payload.contribution },
            };

        case NoteCollectionActionTypes.CHANGE_NOTE_TITLE:
            return withFilteredAndSortedNotes(
                withNoteUpdate(
                    state,
                    getIndexOfNote(state, action.payload.note),
                    {
                        title: action.payload.title,
                        contentFilePath: action.payload.contentFilePath,
                        contentFileName: action.payload.contentFileName,
                    },
                ),
            );

        case NoteCollectionActionTypes.DELETE_NOTE:
            return withFilteredAndSortedNotes(
                withNoteDelete(state, getIndexOfNote(state, action.payload.note)),
            );

        case NoteCollectionActionTypes.CHANGE_NOTE_STACKS:
            return withFilteredAndSortedNotes(withNoteUpdate(
                state,
                getIndexOfNote(state, action.payload.note),
                { stackIds: action.payload.stacks },
            ));

        default:
            return state;
    }
}


text:
.class final Lcom/google/common/collect/Synchronized;
.super Ljava/lang/Object;
.source "Synchronized.java"

# annotations
.annotation build Lcom/google/common/annotations/GwtCompatible;
    emulated = true
.end annotation

.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/google/common/collect/Synchronized$1;,
        Lcom/google/common/collect/Synchronized$SynchronizedAsMapValues;,
        Lcom/google/common/collect/Synchronized$SynchronizedAsMap;,
        Lcom/google/common/collect/Synchronized$SynchronizedBiMap;,
        Lcom/google/common/collect/Synchronized$SynchronizedSortedMap;,
        Lcom/google/common/collect/Synchronized$SynchronizedMap;,
        Lcom/google/common/collect/Synchronized$SynchronizedAsMapEntries;,
        Lcom/google/common/collect/Synchronized$SynchronizedSortedSetMultimap;,
        Lcom/google/common/collect/Synchronized$SynchronizedSetMultimap;,
        Lcom/google/common/collect/Synchronized$SynchronizedListMultimap;,
        Lcom/google/common/collect/Synchronized$SynchronizedMultimap;,
        Lcom/google/common/collect/Synchronized$SynchronizedMultiset;,
        Lcom/google/common/collect/Synchronized$SynchronizedRandomAccessList;,
        Lcom/google/common/collect/Synchronized$SynchronizedList;,
        Lcom/google/common/collect/Synchronized$SynchronizedSortedSet;,
        Lcom/google/common/collect/Synchronized$SynchronizedSet;,
        Lcom/google/common/collect/Synchronized$SynchronizedCollection;,
        Lcom/google/common/collect/Synchronized$SynchronizedObject;
    }
.end annotation

# direct methods
.method private constructor <init>()V
    .locals 0

    .prologue
    .line 56
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method static synthetic access$100(Ljava/util/SortedSet;Ljava/lang/Object;)Ljava/util/SortedSet;
    .locals 1
    .param p0, "x0"    # Ljava/util/SortedSet;
    .param p1, "x1"    # Ljava/lang/Object;

    .prologue
    .line 55
    invoke-static {p0, p1}, Lcom/google/common/collect/Synchronized;->sortedSet(Ljava/util/SortedSet;Ljava/lang/Object;)Ljava/util/SortedSet;

    move-result-object v0

    return-object v0
.end method

.method static synthetic access$200(Ljava/util/List;Ljava/lang/Object;)Ljava/util/List;
    .locals 1
    .param p0, "x0"    # Ljava/util/List;
    .param p1, "x1"    # Ljava/lang/Object;

    .prologue
    .line 55
    invoke-static {p0, p1}, Lcom/google/common/collect/Synchronized;->list(Ljava/util/List;Ljava/lang/Object;)Ljava/util/List;

    move-result-object v0

    return-object v0
.end method

.method static synthetic access$300(Ljava/util/Set;Ljava/lang/Object;)Ljava/util/Set;
    .locals 1
    .param p0, "x0"    # Ljava/util/Set;
    .param p1, "x1"    # Ljava/lang/Object;

    .prologue
    .line 55
    invoke-static {p0, p1}, Lcom/google/common/collect/Synchronized;->typePreservingSet(Ljava/util/Set;Ljava/lang/Object;)Ljava/util/Set;

    move-result-object v0

    return-object v0
.end method

.method static synthetic access$400(Ljava/util/Collection;Ljava/lang/Object;)Ljava/util/Collection;
    .locals 1
    .param p0, "x0"    # Ljava/util/Collection;
    .param p1, "x1"    # Ljava/lang/Object;

    .prologue
    .line 55
    invoke-static {p0, p1}, Lcom/google/common/collect/Synchronized;->typePreservingCollection(Ljava/util/Collection;Ljava/lang/Object;)Ljava/util/Collection;

    move-result-object v0

    return-object v0
.end method

.method static synthetic access$500(Ljava/util/Collection;Ljava/lang/Object;)Ljava/util/Collection;
    .locals 1
    .param p0, "x0"    # Ljava/util/Collection;
    .param p1, "x1"    # Ljava/lang/Object;

    .prologue
    .line 55
    invoke-static {p0, p1}, Lcom/google/common/collect/Synchronized;->collection(Ljava/util/Collection;Ljava/lang/Object;)Ljava/util/Collection;

    move-result-object v0

    return-object v0
.end method

.method static biMap(Lcom/google/common/collect/BiMap;Ljava/lang/Object;)Lcom/google/common/collect/BiMap;
    .locals 2
    .param p1, "mutex"    # Ljava/lang/Object;
        .annotation runtime Ljavax/annotation/Nullable;
        .end annotation
    .end param
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<K:",
            "Ljava/lang/Object;",
            "V:",
            "Ljava/lang/Object;",
            ">(",
            "Lcom/google/common/collect/BiMap",
            "<TK;TV;>;",
            "Ljava/lang/Object;",
            ")",
            "Lcom/google/common/collect/BiMap",
            "<TK;TV;>;"
        }
    .end annotation

    .prologue
    .local p0, "bimap":Lcom/google/common/collect/BiMap;, "Lcom/google/common/collect/BiMap<TK;TV;>;"
    const/4 v1, 0x0

    .line 1080
    new-instance v0, Lcom/google/common/collect/Synchronized$SynchronizedBiMap;

    invoke-direct {v0, p0, p1, v1, v1}, Lcom/google/common/collect/Synchronized$SynchronizedBiMap;-><init>(Lcom/google/common/collect/BiMap;Ljava/lang/Object;Lcom/google/common/collect/BiMap;Lcom/google/common/collect/Synchronized$1;)V

    return-object v0
.end method

.method private static collection(Ljava/util/Collection;Ljava/lang/Object;)Ljava/util/Collection;
    .locals 2
    .param p1, "mutex"    # Ljava/lang/Object;
        .annotation runtime Ljavax/annotation/Nullable;
        .end annotation
    .end param
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<E:",
            "Ljava/lang/Object;",
            ">(",
            "Ljava/util/Collection",
            "<TE;>;",
            "Ljava/lang/Object;",
            ")",
            "Ljava/util/Collection",
            "<TE;>;"
        }
    .end annotation

    .prologue
    .line 97
    .local p0, "collection":Ljava/util/Collection;, "Ljava/util/Collection<TE;>;"
    new-instance v0, Lcom/google/common/collect/Synchronized$SynchronizedCollection;

    const/4 v1, 0x0

    invoke-direct {v0, p0, p1, v1}, Lcom/google/common/collect/Synchronized$SynchronizedCollection;-><init>(Ljava/util/Collection;Ljava/lang/Object;Lcom/google/common/collect/Synchronized$1;)V

    return-object v0
.end method

.method private static list(Ljava/util/List;Ljava/lang/Object;)Ljava/util/List;
    .locals 1
    .param p1, "mutex"    # Ljava/lang/Object;
        .annotation runtime Ljavax/annotation/Nullable;
        .end annotation
    .end param
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<E:",
            "Ljava/lang/Object;",
            ">(",
            "Ljava/util/List",
            "<TE;>;",
            "Ljava/lang/Object;",
            ")",
            "Ljava/util/List",
            "<TE;>;"
        }
    .end annotation

    .prologue
    .line 298
    .local p0, "list":Ljava/util/List;, "Ljava/util/List<TE;>;"
    instance-of v0, p0, Ljava/util/RandomAccess;

    if-eqz v0, :cond_0

    new-instance v0, Lcom/google/common/collect/Synchronized$SynchronizedRandomAccessList;

    invoke-direct {v0, p0, p1}, Lcom/google/common/collect/Synchronized$SynchronizedRandomAccessList;-><init>(Ljava/util/List;Ljava/lang/Object;)V

    :goto_0
    return-object v0

    :cond_0
    new-instance v0, Lcom/google/common/collect/Synchronized$SynchronizedList;

    invoke-direct {v0, p0, p1}, Lcom/google/common/collect/Synchronized$SynchronizedList;-><init>(Ljava/util/List;Ljava/lang/Object;)V

    goto :goto_0
.end method

.method static listMultimap(Lcom/google/common/collect/ListMultimap;Ljava/lang/Object;)Lcom/google/common/collect/ListMultimap;
    .locals 1
    .param p1, "mutex"    # Ljava/lang/Object;
        .annotation runtime Ljavax/annotation/Nullable;
        .end annotation
    .end param
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<K:",
            "Ljava/lang/Object;",
            "V:",
            "Ljava/lang/Object;",
            ">(",
            "Lcom/google/common/collect/ListMultimap",
            "<TK;TV;>;",
            "Ljava/lang/Object;",
            ")",
            "Lcom/google/common/collect/ListMultimap",
            "<TK;TV;>;"
        }
    .end annotation

    .prologue
    .line 679
    .local p0, "multimap":Lcom/google/common/collect/ListMultimap;, "Lcom/google/common/collect/ListMultimap<TK;TV;>;"
    new-instance v0, Lcom/google/common/collect/Synchronized$SynchronizedListMultimap;

    invoke-direct {v0, p0, p1}, Lcom/google/common/collect/Synchronized$SynchronizedListMultimap;-><init>(Lcom/google/common/collect/ListMultimap;Ljava/lang/Object;)V

    return-object v0
.end method

.method static map(Ljava/util/Map;Ljava/lang/Object;)Ljava/util/Map;
    .locals 1
    .param p1, "mutex"    # Ljava/lang/Object;
        .annotation runtime Ljavax/annotation/Nullable;
        .end annotation
    .end param
    .annotation build Lcom/google/common/annotations/VisibleForTesting;
    .end annotation

    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<K:",
            "Ljava/lang/Object;",
            "V:",
            "Ljava/lang/Object;",
            ">(",
            "Ljava/util/Map",
            "<TK;TV;>;",
            "Ljava/lang/Object;",
            ")",
            "Ljava/util/Map",
            "<TK;TV;>;"
        }
    .end annotation

    .prologue
    .line 895
    .local p0, "map":Ljava/util/Map;, "Ljava/util/Map<TK;TV;>;"
    new-instance v0, Lcom/google/common/collect/Synchronized$SynchronizedMap;

    invoke-direct {v0, p0, p1}, Lcom/google/common/collect/Synchronized$SynchronizedMap;-><init>(Ljava/util/Map;Ljava/lang/Object;)V

    return-object v0
.end method

.method static multimap(Lcom/google/common/collect/Multimap;Ljava/lang/Object;)Lcom/google/common/collect/Multimap;
    .locals 1
    .param p1, "mutex"    # Ljava/lang/Object;
        .annotation runtime Ljavax/annotation/Nullable;
        .end annotation
    .end param
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<K:",
            "Ljava/lang/Object;",
            "V:",
            "Ljava/lang/Object;",
            ">(",
            "Lcom/google/common/collect/Multimap",
            "<TK;TV;>;",
            "Ljava/lang/Object;",
            ")",
            "Lcom/google/common/collect/Multimap",
            "<TK;TV;>;"
        }
    .end annotation

    .prologue
    .line 498
    .local p0, "multimap":Lcom/google/common/collect/Multimap;, "Lcom/google/common/collect/Multimap<TK;TV;>;"
    new-instance v0, Lcom/google/common/collect/Synchronized$SynchronizedMultimap;

    invoke-direct {v0, p0, p1}, Lcom/google/common/collect/Synchronized$SynchronizedMultimap;-><init>(Lcom/google/common/collect/Multimap;Ljava/lang/Object;)V

    return-object v0
.end method

.method static multiset(Lcom/google/common/collect/Multiset;Ljava/lang/Object;)Lcom/google/common/collect/Multiset;
    .locals 1
    .param p1, "mutex"    # Ljava/lang/Object;
        .annotation runtime Ljavax/annotation/Nullable;
        .end annotation
    .end param
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<E:",
            "Ljava/lang/Object;",
            ">(",
            "Lcom/google/common/collect/Multiset",
            "<TE;>;",
            "Ljava/lang/Object;",
            ")",
            "Lcom/google/common/collect/Multiset",
            "<TE;>;"
        }
    .end annotation

    .prologue
    .line 407
    .local p0, "multiset":Lcom/google/common/collect/Multiset;, "Lcom/google/common/collect/Multiset<TE;>;"
    new-instance v0, Lcom/google/common/collect/Synchronized$SynchronizedMultiset;

    invoke-direct {v0, p0, p1}, Lcom/google/common/collect/Synchronized$SynchronizedMultiset;-><init>(Lcom/google/common/collect/Multiset;Ljava/lang/Object;)V

    return-object v0
.end method

.method static set(Ljava/util/Set;Ljava/lang/Object;)Ljava/util/Set;
    .locals 1
    .param p1, "mutex"    # Ljava/lang/Object;
        .annotation runtime Ljavax/annotation/Nullable;
        .end annotation
    .end param
    .annotation build Lcom/google/common/annotations/VisibleForTesting;
    .end annotation

    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<E:",
            "Ljava/lang/Object;",
            ">(",
            "Ljava/util/Set",
            "<TE;>;",
            "Ljava/lang/Object;",
            ")",
            "Ljava/util/Set",
            "<TE;>;"
        }
    .end annotation

    .prologue
    .line 205
    .local p0, "set":Ljava/util/Set;, "Ljava/util/Set<TE;>;"
    new-instance v0, Lcom/google/common/collect/Synchronized$SynchronizedSet;

    invoke-direct {v0, p0, p1}, Lcom/google/common/collect/Synchronized$SynchronizedSet;-><init>(Ljava/util/Set;Ljava/lang/Object;)V

    return-object v0
.end method

.method static setMultimap(Lcom/google/common/collect/SetMultimap;Ljava/lang/Object;)Lcom/google/common/collect/SetMultimap;
    .locals 1
    .param p1, "mutex"    # Ljava/lang/Object;
        .annotation runtime Ljavax/annotation/Nullable;
        .end annotation
    .end param
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<K:",
            "Ljava/lang/Object;",
            "V:",
            "Ljava/lang/Object;",
            ">(",
            "Lcom/google/common/collect/SetMultimap",
            "<TK;TV;>;",
            "Ljava/lang/Object;",
            ")",
            "Lcom/google/common/collect/SetMultimap",
            "<TK;TV;>;"
        }
    .end annotation

    .prologue
    .line 712
    .local p0, "multimap":Lcom/google/common/collect/SetMultimap;, "Lcom/google/common/collect/SetMultimap<TK;TV;>;"
    new-instance v0, Lcom/google/common/collect/Synchronized$SynchronizedSetMultimap;

    invoke-direct {v0, p0, p1}, Lcom/google/common/collect/Synchronized$SynchronizedSetMultimap;-><init>(Lcom/google/common/collect/SetMultimap;Ljava/lang/Object;)V

    return-object v0
.end method

.method static sortedMap(Ljava/util/SortedMap;Ljava/lang/Object;)Ljava/util/SortedMap;
    .locals 1
    .param p1, "mutex"    # Ljava/lang/Object;
        .annotation runtime Ljavax/annotation/Nullable;
        .end annotation
    .end param
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<K:",
            "Ljava/lang/Object;",
            "V:",
            "Ljava/lang/Object;",
            ">(",
            "Ljava/util/SortedMap",
            "<TK;TV;>;",
            "Ljava/lang/Object;",
            ")",
            "Ljava/util/SortedMap",
            "<TK;TV;>;"
        }
    .end annotation

    .prologue
    .line 1026
    .local p0, "sortedMap":Ljava/util/SortedMap;, "Ljava/util/SortedMap<TK;TV;>;"
    new-instance v0, Lcom/google/common/collect/Synchronized$SynchronizedSortedMap;

    invoke-direct {v0, p0, p1}, Lcom/google/common/collect/Synchronized$SynchronizedSortedMap;-><init>(Ljava/util/SortedMap;Ljava/lang/Object;)V

    return-object v0
.end method

.method private static sortedSet(Ljava/util/SortedSet;Ljava/lang/Object;)Ljava/util/SortedSet;
    .locals 1
    .param p1, "mutex"    # Ljava/lang/Object;
        .annotation runtime Ljavax/annotation/Nullable;
        .end annotation
    .end param
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<E:",
            "Ljava/lang/Object;",
            ">(",
            "Ljava/util/SortedSet",
            "<TE;>;",
            "Ljava/lang/Object;",
            ")",
            "Ljava/util/SortedSet",
            "<TE;>;"
        }
    .end annotation

    .prologue
    .line 239
    .local p0, "set":Ljava/util/SortedSet;, "Ljava/util/SortedSet<TE;>;"
    new-instance v0, Lcom/google/common/collect/Synchronized$SynchronizedSortedSet;

    invoke-direct {v0, p0, p1}, Lcom/google/common/collect/Synchronized$SynchronizedSortedSet;-><init>(Ljava/util/SortedSet;Ljava/lang/Object;)V

    return-object v0
.end method

.method static sortedSetMultimap(Lcom/google/common/collect/SortedSetMultimap;Ljava/lang/Object;)Lcom/google/common/collect/SortedSetMultimap;
    .locals 1
    .param p1, "mutex"    # Ljava/lang/Object;
        .annotation runtime Ljavax/annotation/Nullable;
        .end annotation
    .end param
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<K:",
            "Ljava/lang/Object;",
            "V:",
            "Ljava/lang/Object;",
            ">(",
            "Lcom/google/common/collect/SortedSetMultimap",
            "<TK;TV;>;",
            "Ljava/lang/Object;",
            ")",
            "Lcom/google/common/collect/SortedSetMultimap",
            "<TK;TV;>;"
        }
    .end annotation

    .prologue
    .line 755
    .local p0, "multimap":Lcom/google/common/collect/SortedSetMultimap;, "Lcom/google/common/collect/SortedSetMultimap<TK;TV;>;"
    new-instance v0, Lcom/google/common/collect/Synchronized$SynchronizedSortedSetMultimap;

    invoke-direct {v0, p0, p1}, Lcom/google/common/collect/Synchronized$SynchronizedSortedSetMultimap;-><init>(Lcom/google/common/collect/SortedSetMultimap;Ljava/lang/Object;)V

    return-object v0
.end method

.method private static typePreservingCollection(Ljava/util/Collection;Ljava/lang/Object;)Ljava/util/Collection;
    .locals 1
    .param p1, "mutex"    # Ljava/lang/Object;
        .annotation runtime Ljavax/annotation/Nullable;
        .end annotation
    .end param
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<E:",
            "Ljava/lang/Object;",
            ">(",
            "Ljava/util/Collection",
            "<TE;>;",
            "Ljava/lang/Object;",
            ")",
            "Ljava/util/Collection",
            "<TE;>;"
        }
    .end annotation

    .prologue
    .line 794
    .local p0, "collection":Ljava/util/Collection;, "Ljava/util/Collection<TE;>;"
    instance-of v0, p0, Ljava/util/SortedSet;

    if-eqz v0, :cond_0

    .line 795
    check-cast p0, Ljava/util/SortedSet;

    .end local p0    # "collection":Ljava/util/Collection;, "Ljava/util/Collection<TE;>;"
    invoke-static {p0, p1}, Lcom/google/common/collect/Synchronized;->sortedSet(Ljava/util/SortedSet;Ljava/lang/Object;)Ljava/util/SortedSet;

    move-result-object v0

    .line 803
    :goto_0
    return-object v0

    .line 797
    .restart local p0    # "collection":Ljava/util/Collection;, "Ljava/util/Collection<TE;>;"
    :cond_0
    instance-of v0, p0, Ljava/util/Set;

    if-eqz v0, :cond_1

    .line 798
    check-cast p0, Ljava/util/Set;

    .end local p0    # "collection":Ljava/util/Collection;, "Ljava/util/Collection<TE;>;"
    invoke-static {p0, p1}, Lcom/google/common/collect/Synchronized;->set(Ljava/util/Set;Ljava/lang/Object;)Ljava/util/Set;

    move-result-object v0

    goto :goto_0

    .line 800
    .restart local p0    # "collection":Ljava/util/Collection;, "Ljava/util/Collection<TE;>;"
    :cond_1
    instance-of v0, p0, Ljava/util/List;

    if-eqz v0, :cond_2

    .line 801
    check-cast p0, Ljava/util/List;

    .end local p0    # "collection":Ljava/util/Collection;, "Ljava/util/Collection<TE;>;"
    invoke-static {p0, p1}, Lcom/google/common/collect/Synchronized;->list(Ljava/util/List;Ljava/lang/Object;)Ljava/util/List;

    move-result-object v0

    goto :goto_0

    .line 803
    .restart local p0    # "collection":Ljava/util/Collection;, "Ljava/util/Collection<TE;>;"
    :cond_2
    invoke-static {p0, p1}, Lcom/google/common/collect/Synchronized;->collection(Ljava/util/Collection;Ljava/lang/Object;)Ljava/util/Collection;

    move-result-object v0

    goto :goto_0
.end method

.method private static typePreservingSet(Ljava/util/Set;Ljava/lang/Object;)Ljava/util/Set;
    .locals 1
    .param p1, "mutex"    # Ljava/lang/Object;
        .annotation runtime Ljavax/annotation/Nullable;
        .end annotation
    .end param
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<E:",
            "Ljava/lang/Object;",
            ">(",
            "Ljava/util/Set",
            "<TE;>;",
            "Ljava/lang/Object;",
            ")",
            "Ljava/util/Set",
            "<TE;>;"
        }
    .end annotation

    .prologue
    .line 808
    .local p0, "set":Ljava/util/Set;, "Ljava/util/Set<TE;>;"
    instance-of v0, p0, Ljava/util/SortedSet;

    if-eqz v0, :cond_0

    .line 809
    check-cast p0, Ljava/util/SortedSet;

    .end local p0    # "set":Ljava/util/Set;, "Ljava/util/Set<TE;>;"
    invoke-static {p0, p1}, Lcom/google/common/collect/Synchronized;->sortedSet(Ljava/util/SortedSet;Ljava/lang/Object;)Ljava/util/SortedSet;

    move-result-object v0

    .line 811
    :goto_0
    return-object v0

    .restart local p0    # "set":Ljava/util/Set;, "Ljava/util/Set<TE;>;"
    :cond_0
    invoke-static {p0, p1}, Lcom/google/common/collect/Synchronized;->set(Ljava/util/Set;Ljava/lang/Object;)Ljava/util/Set;

    move-result-object v0

    goto :goto_0
.end method


text:
_[www.codever.land/bookmarks/t/event-driven](https://www.codever.land/bookmarks/t/event-driven)_
---
#### [CloudEvents home page](https://cloudevents.io/)
_https://cloudevents.io/_

CloudEvents is a specification for describing event data in common formats to provide interoperability across services, platforms and systems.
* **tags**: [cloud-computing](../tagged/cloud-computing.md), [event-driven](../tagged/event-driven.md), [specification](../tagged/specification.md)
* :octocat: **[source code](https://github.com/cloudevents/spec)**
---
#### [GOTO 2017 • The Many Meanings of Event-Driven Architecture • Martin Fowler - YouTube](https://www.youtube.com/watch?v=STKCRSUsyP0)
_https://www.youtube.com/watch?v=STKCRSUsyP0_

During my career, I've often people heard people describe their systems as "event-driven". But when looking deeper that phrase seems to lead to some very different architectural assumptions. On a rece...
* :calendar: **published on**: 2017-05-11
* **tags**: [event-driven](../tagged/event-driven.md), [event-driven-design](../tagged/event-driven-design.md), [architecture](../tagged/architecture.md), [cqrs](../tagged/cqrs.md), [event-sourcing](../tagged/event-sourcing.md)
---
#### [Netty: Home](https://netty.io/)
_https://netty.io/_

Netty is an asynchronous event-driven network application framework for rapid development of maintainable high performance protocol servers & clients.
* **tags**: [async](../tagged/async.md), [event-driven](../tagged/event-driven.md), [grpc](../tagged/grpc.md)
* :octocat: **[source code](https://github.com/netty/netty)**
---


text:
set -e

[[ ! -z $1 ]] && cd $1

virtualenv testdep     # it's OK if it already exists

. testdep/bin/activate

pip install pipdeptree[graphviz]

pip install -e .[tests]   # extras_require={'tests':['nose','coveralls']}

python ~/code/pybashutils/pydeptree.py --graph-output svg > dep.svg

. deactivate

eog dep.svg &  # whatever your favorite image viewing program is


text:
cask 'visual-studio-code' do
  version '1.24.1,24f62626b222e9a8313213fb64b10d741a326288'
  sha256 '4fa69f9f23d32ff4d6181239ec059af3577f8c7437a5a8cc4e5d4140a4105627'

  # az764295.vo.msecnd.net/stable was verified as official when first introduced to the cask
  url "https://az764295.vo.msecnd.net/stable/#{version.after_comma}/VSCode-darwin-stable.zip"
  appcast 'https://vscode-update.azurewebsites.net/api/update/darwin/stable/VERSION'
  name 'Microsoft Visual Studio Code'
  name 'VS Code'
  homepage 'https://code.visualstudio.com/'

  auto_updates true
  depends_on macos: '>= :mavericks'

  app 'Visual Studio Code.app'
  binary "#{appdir}/Visual Studio Code.app/Contents/Resources/app/bin/code"

  zap trash: [
               '~/Library/Application Support/Code',
               '~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.microsoft.vscode.sfl*',
               '~/Library/Caches/com.microsoft.VSCode',
               '~/Library/Caches/com.microsoft.VSCode.ShipIt',
               '~/Library/Preferences/com.microsoft.VSCode.helper.plist',
               '~/Library/Preferences/com.microsoft.VSCode.plist',
               '~/Library/Saved Application State/com.microsoft.VSCode.savedState',
               '~/.vscode',
             ]
end


text:
NS_MATH

struct Quaternion
{
	float x, y, z, w;

	Quaternion();
	Quaternion(float x, float y, float z, float w);
	Quaternion(Vector3 v, float w);
	Quaternion(Vector4 v);

	//
	// Static Instances
	//
	static Quaternion Identity;

	//
	// Member Functions
	//
	Quaternion Normalized();
	float Magnitude();
	Quaternion Inverse();

	//
	// Static Functions
	//
	static Quaternion CreateFromAxisAngle(Vector3 axis, float angle);
	static Quaternion CreateFromRotationMatrix(Matrix m);
	static Quaternion CreateFromEulerAngles(Vector3 v);
	static Quaternion Lerp(Quaternion q1, Quaternion q2, float amount);
	static Quaternion Slerp(Quaternion q1, Quaternion q2, float amount);

	static float Magnitude(Quaternion& q);
	static Quaternion Inverse(Quaternion& q);
	static Quaternion Multiply(Quaternion& q1, Quaternion& q2);
	static float Dot(Quaternion& q1, Quaternion& q2);

	Quaternion operator+(const Quaternion& q);
	float& operator[](const int index);
	Quaternion operator-();
};

Quaternion operator*(const Quaternion& l, const Quaternion& r);

NS_MATH_END

#endif


text:
<ion-view title="{{title}}">

    <ion-nav-buttons side="right">
         保存
    </ion-nav-buttons>

    <ion-content has-header="true">

 时间

                <input type="datetime-local" ng-model="remind.time">

 标题

                <input type="text" ng-model="remind.title">

                详细内容
                <textarea placeholder="" rows="5" ng-model="remind.content"></textarea>

                <button class="button button-block button-assertive" ng-show="DelButtonShow" ng-click="delRemind({{remindIndex}})"> 删除 </button>

    </ion-content>
</ion-view>