text:
'use strict';

var async = require('async');
var meta = require('../meta');
var plugins = require('../plugins');
var db = require('../database');

module.exports = function (User) {
	User.search = function (data, callback) {
		var query = data.query || '';
		var searchBy = data.searchBy || 'username';
		var page = data.page || 1;
		var uid = data.uid || 0;
		var paginate = data.hasOwnProperty('paginate') ? data.paginate : true;

		if (searchBy === 'ip') {
			return searchByIP(query, uid, callback);
		}

		var startTime = process.hrtime();

		var searchResult = {};
		async.waterfall([
			function (next) {
				var searchMethod = data.findUids || findUids;
				searchMethod(query, searchBy, data.hardCap, next);
			},
			function (uids, next) {
				filterAndSortUids(uids, data, next);
			},
			function (uids, next) {
				plugins.fireHook('filter:users.search', { uids: uids, uid: uid }, next);
			},
			function (data, next) {
				var uids = data.uids;
				searchResult.matchCount = uids.length;

				if (paginate) {
					var resultsPerPage = parseInt(meta.config.userSearchResultsPerPage, 10) || 20;
					var start = Math.max(0, page - 1) * resultsPerPage;
					var stop = start + resultsPerPage;
					searchResult.pageCount = Math.ceil(uids.length / resultsPerPage);
					uids = uids.slice(start, stop);
				}

				User.getUsers(uids, uid, next);
			},
			function (userData, next) {
				searchResult.timing = (process.elapsedTimeSince(startTime) / 1000).toFixed(2);
				searchResult.users = userData;
				next(null, searchResult);
			},
		], callback);
	};

	function findUids(query, searchBy, hardCap, callback) {
		if (!query) {
			return callback(null, []);
		}
		query = query.toLowerCase();
		var min = query;
		var max = query.substr(0, query.length - 1) + String.fromCharCode(query.charCodeAt(query.length - 1) + 1);

		var resultsPerPage = parseInt(meta.config.userSearchResultsPerPage, 10) || 20;
		hardCap = hardCap || resultsPerPage * 10;

		async.waterfall([
			function (next) {
				db.getSortedSetRangeByLex(searchBy + ':sorted', min, max, 0, hardCap, next);
			},
			function (data, next) {
				var uids = data.map(function (data) {
					return data.split(':')[1];
				});
				next(null, uids);
			},
		], callback);
	}

	function filterAndSortUids(uids, data, callback) {
		var fields = [];

		if (data.sortBy) {
			fields.push(data.sortBy);
		}
		if (data.onlineOnly) {
			fields = fields.concat(['status', 'lastonline']);
		}
		if (data.bannedOnly) {
			fields.push('banned');
		}
		if (data.flaggedOnly) {
			fields.push('flags');
		}

		if (!fields.length) {
			return callback(null, uids);
		}

		fields = ['uid'].concat(fields);

		async.waterfall([
			function (next) {
				User.getUsersFields(uids, fields, next);
			},
			function (userData, next) {
				if (data.onlineOnly) {
					userData = userData.filter(function (user) {
						return user && user.status !== 'offline' && (Date.now() - parseInt(user.lastonline, 10) < 300000);
					});
				}

				if (data.bannedOnly) {
					userData = userData.filter(function (user) {
						return user && parseInt(user.banned, 10) === 1;
					});
				}

				if (data.flaggedOnly) {
					userData = userData.filter(function (user) {
						return user && parseInt(user.flags, 10) > 0;
					});
				}

				if (data.sortBy) {
					sortUsers(userData, data.sortBy);
				}

				uids = userData.map(function (user) {
					return user && user.uid;
				});

				next(null, uids);
			},
		], callback);
	}

	function sortUsers(userData, sortBy) {
		if (sortBy === 'joindate' || sortBy === 'postcount' || sortBy === 'reputation') {
			userData.sort(function (u1, u2) {
				return u2[sortBy] - u1[sortBy];
			});
		} else {
			userData.sort(function (u1, u2) {
				if (u1[sortBy] < u2[sortBy]) {
					return -1;
				} else if (u1[sortBy] > u2[sortBy]) {
					return 1;
				}
				return 0;
			});
		}
	}

	function searchByIP(ip, uid, callback) {
		var start = process.hrtime();
		async.waterfall([
			function (next) {
				db.getSortedSetRevRange('ip:' + ip + ':uid', 0, -1, next);
			},
			function (uids, next) {
				User.getUsers(uids, uid, next);
			},
			function (users, next) {
				var diff = process.hrtime(start);
				var timing = ((diff[0] * 1e3) + (diff[1] / 1e6)).toFixed(1);
				next(null, { timing: timing, users: users });
			},
		], callback);
	}
};


text:
package exec

import (
	"fmt"
	"reflect"
	"testing"

	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/apimachinery/pkg/util/sets"
	clientauthenticationv1 "k8s.io/client-go/pkg/apis/clientauthentication/v1"
	clientauthenticationv1beta1 "k8s.io/client-go/pkg/apis/clientauthentication/v1beta1"
	clientcmdv1 "k8s.io/client-go/tools/clientcmd/api/v1"
)

func TestClientAuthenticationClusterTypesAreSynced(t *testing.T) {
	t.Parallel()

	for _, cluster := range []interface{}{
		clientauthenticationv1beta1.Cluster{},
		clientauthenticationv1.Cluster{},
	} {
		t.Run(fmt.Sprintf("%T", cluster), func(t *testing.T) {
			t.Parallel()
			testClientAuthenticationClusterTypesAreSynced(t, cluster)
		})
	}
}

// testClusterTypesAreSynced ensures that the provided cluster type stays in sync
// with clientcmdv1.Cluster.
//
// We want clientauthentication*.Cluster types to offer the same knobs as clientcmdv1.Cluster to
// allow someone to connect to the kubernetes API. This test should fail if a new field is added to
// one of the structs without updating the other.
func testClientAuthenticationClusterTypesAreSynced(t *testing.T, cluster interface{}) {
	execType := reflect.TypeOf(cluster)
	clientcmdType := reflect.TypeOf(clientcmdv1.Cluster{})

	t.Run("exec cluster fields match clientcmd cluster fields", func(t *testing.T) {
		t.Parallel()

		// These are fields that are specific to Cluster and shouldn't be in clientcmdv1.Cluster.
		execSkippedFieldNames := sets.NewString(
			// Cluster uses Config to provide its cluster-specific configuration object.
			"Config",
		)

		for i := 0; i < execType.NumField(); i++ {
			execField := execType.Field(i)
			if execSkippedFieldNames.Has(execField.Name) {
				continue
			}

			t.Run(execField.Name, func(t *testing.T) {
				t.Parallel()
				clientcmdField, ok := clientcmdType.FieldByName(execField.Name)
				if !ok {
					t.Errorf("unknown field (please add field to clientcmdv1.Cluster): '%s'", execField.Name)
				} else if execField.Type != clientcmdField.Type {
					t.Errorf(
						"type mismatch (please update Cluster.%s field type to match clientcmdv1.Cluster.%s field type): %q != %q",
						execField.Name,
						clientcmdField.Name,
						execField.Type,
						clientcmdField.Type,
					)
				} else if execField.Tag != clientcmdField.Tag {
					t.Errorf(
						"tag mismatch (please update Cluster.%s tag to match clientcmdv1.Cluster.%s tag): %q != %q",
						execField.Name,
						clientcmdField.Name,
						execField.Tag,
						clientcmdField.Tag,
					)
				}
			})
		}
	})

	t.Run("clientcmd cluster fields match exec cluster fields", func(t *testing.T) {
		t.Parallel()

		// These are the fields that we don't want to shadow from clientcmdv1.Cluster.
		clientcmdSkippedFieldNames := sets.NewString(
			// CA data will be passed via CertificateAuthorityData, so we don't need this field.
			"CertificateAuthority",
			// Cluster uses Config to provide its cluster-specific configuration object.
			"Extensions",
		)

		for i := 0; i < clientcmdType.NumField(); i++ {
			clientcmdField := clientcmdType.Field(i)
			if clientcmdSkippedFieldNames.Has(clientcmdField.Name) {
				continue
			}

			t.Run(clientcmdField.Name, func(t *testing.T) {
				t.Parallel()
				execField, ok := execType.FieldByName(clientcmdField.Name)
				if !ok {
					t.Errorf("unknown field (please add field to Cluster): '%s'", clientcmdField.Name)
				} else if clientcmdField.Type != execField.Type {
					t.Errorf(
						"type mismatch (please update clientcmdv1.Cluster.%s field type to match Cluster.%s field type): %q != %q",
						clientcmdField.Name,
						execField.Name,
						clientcmdField.Type,
						execField.Type,
					)
				} else if clientcmdField.Tag != execField.Tag {
					t.Errorf(
						"tag mismatch (please update clientcmdv1.Cluster.%s tag to match Cluster.%s tag): %q != %q",
						clientcmdField.Name,
						execField.Name,
						clientcmdField.Tag,
						execField.Tag,
					)
				}
			})
		}
	})
}

// TestAllClusterTypesAreSynced is a TODO so that we remember to write a test similar to
// TestClientAuthenticationClusterTypesAreSynced for any future ExecCredential version. It should start failing
// when someone adds support for any other ExecCredential type to this package.
func TestAllClusterTypesAreSynced(t *testing.T) {
	versionsThatDontNeedTests := sets.NewString(
		// The internal Cluster type should only be used...internally...and therefore doesn't
		// necessarily need to be synced with clientcmdv1.
		runtime.APIVersionInternal,
		// We have a test for v1beta1 above.
		clientauthenticationv1beta1.SchemeGroupVersion.Version,
		// We have a test for v1 above.
		clientauthenticationv1.SchemeGroupVersion.Version,
	)
	for gvk := range scheme.AllKnownTypes() {
		if gvk.Group == clientauthenticationv1beta1.SchemeGroupVersion.Group &&
			gvk.Kind == "ExecCredential" {
			if !versionsThatDontNeedTests.Has(gvk.Version) {
				t.Errorf(
					"TODO: add test similar to TestV1beta1ClusterTypesAreSynced for client.authentication.k8s.io/%s",
					gvk.Version,
				)
			}
		}
	}
}

redpajama_set_name: RedPajamaGithub


text: Sandwich Van Spam  {{model.lastTweet}}  @ {{model.lastTweetTime}}


text:
This extension measures page load time and displays it in the toolbar.
Web Timing API is used for precise measurement.

Icons are from Human-O2 iconset
http://schollidesign.deviantart.com/art/Human-O2-Iconset-105344123

# Install

To install the plugin, simply clone this repository and [follow the instructions here](https://developer.chrome.com/extensions/getstarted#unpacked).

*Tip: Reload the webpage a multiple times to see a history of previous load timings and average load time!*

# Approach

The purpose of this forked project is to build upon the great work done by [Alexander Vykhodtsev](https://github.com/alex-vv)
on [chrome-load-timer](https://github.com/alex-vv/chrome-load-timer).

In this project I have focused on imrovements & additions to these areas:

1. Improve the UI to allow the context of the timing data to be more easily digested
2. Add further data: Previous load timing totals & an average timing total
3. Refactor the code to achieve the following:
 	1. Separate styling from content, refactor styling using a BEM style approach
 	2. Implement a prototypal pattern with useful methods, allowing for easier future development
 	3. Implement a DOM manipulation pattern, generating content on page load

# Considerations

The DOM manipulation pattern has reduced a lot of static markup in `info.html` whilst at the same time introduced a
DOM manipulation dependency and additionally has resulted in the creation of a great deal of boilerplate code to create
the required markup.

I have considered various approaches to the DOM manipulation problem during this project, here is a summary of my thoughts on each:

1. **Static markup**: Terse and simple, however somewhat limiting if the content needs to be updated on user interaction
2. **DOM manipulation (jQuery style)**: Dynamic with a small dependency, however the code base has become littered with
boilerplate code that generates the markup, tightly coupling the timing logic with content generation.
3. **Client side templating**: Decoupled approach with cleaner code, however at the cost of using a larger dependency
I originally discounted this approach. On reflection, it would probably be the best approach for separation of concerns
between the timing logic and content generation, in addition future maintainability of the code should be easier.
4. **Framework (Backbone/Angular/React)**: Dynamic and powerful, however it this approach would be far too heavyweight
for a simple plugin popup.

# Todo
1. Refactor DOM manipulation pattern in favour of a Client side templating implementation
2. Add (% faster/slower) to main total
3. Provide functionality to review timings table from click any previous totals, plus a way to revert to current timings

# License

This project is licensed under the terms of the MIT license.


text:
PANEL = 'database_configurations'
# The slug of the dashboard the PANEL associated with. Required.
PANEL_DASHBOARD = 'project'
# The slug of the panel group the PANEL is associated with.
PANEL_GROUP = 'tesora_database'

# Python panel class of the PANEL to be added.
ADD_PANEL = ('tesora_horizon.openstack_dashboard.'
             'dashboards.project.'
             'database_configurations.panel.Configurations')


text:
package com.emistoolbox.client.ui.pdf;

import com.emistoolbox.client.admin.ui.ListBoxWithUserObjects;
import com.emistoolbox.client.util.ui.UIUtils;
import com.emistoolbox.common.model.meta.EmisMeta;
import com.emistoolbox.common.model.meta.EmisMetaEntity;
import com.emistoolbox.common.model.meta.EmisMetaHierarchy;
import com.emistoolbox.common.renderer.pdfreport.EmisPdfReportConfig;
import com.emistoolbox.common.renderer.pdfreport.EmisPdfReportConfig.PageOrientation;
import com.emistoolbox.common.renderer.pdfreport.EmisPdfReportConfig.PageSize;
import com.google.gwt.user.client.ui.ListBox;
import com.google.gwt.user.client.ui.TextBox;

public class LayoutReportConfigProperties extends LayoutProperties<EmisPdfReportConfig>
{
	private EmisPdfReportConfig config = null;

	private ListBox uiPageSize = new ListBox();
	private ListBox uiPageOrientation = new ListBox();
    private ListBoxWithUserObjects<EmisMetaEntity> uiEntity = new ListBoxWithUserObjects<EmisMetaEntity>();
	private TextBox uiName = new TextBox();

    private EmisMeta meta;

//	private Map<String, TextSetEntryUi> uiTexts;

	public LayoutReportConfigProperties(EmisMeta emis)
	{
		super(null);

		this.meta = emis;

		uiPageSize.addChangeHandler(getChangeHandler());
		UIUtils.listBoxInit(uiPageSize, PageSize.values());

		uiPageOrientation.addChangeHandler(getChangeHandler());
		UIUtils.listBoxInit(uiPageOrientation, PageOrientation.values());

		int row = getRowCount();

		setText(row, 0, "Report");
		setWidget(row++, 1, uiName);

		setText(row, 0, "Page Size");
		setWidget(row++, 1, uiPageSize);

		setText(row, 0, "Page Orientation");
		setWidget(row++, 1, uiPageOrientation);

		setText(row, 0, "Location");
		setWidget(row++, 1, uiEntity);
        for (EmisMetaEntity entity : emis.getEntities())
            this.uiEntity.addItem(entity.getName(), entity);

		uiPageSize.addChangeHandler(getChangeHandler());
		uiPageOrientation.addChangeHandler(getChangeHandler());

//		uiTexts = initTexts(LayoutPageConfig.TEXT_KEYS, new String[] { "Default Title", "Default Subtitle", "Default Footer"});
		set(null);
	}

	@Override
	public void commit()
	{
		if (config == null)
			return;

//		updateTextSet(uiTexts, config);
		config.setPage(PageSize.valueOf(UIUtils.getListBoxValue(uiPageSize)), PageOrientation.valueOf(UIUtils.getListBoxValue(uiPageOrientation)));
		config.setEntityType(uiEntity.getUserObject());
		config.setName(uiName.getText());
	}

	@Override
	public EmisPdfReportConfig get()
	{
		commit();
		return config;
	}

	@Override
	public void set(EmisPdfReportConfig config)
	{
		this.config = config;
		if (config == null)
			setVisible(false);
		else
		{
			setVisible(true);

			uiName.setText(config.getName());
			UIUtils.setListBoxValue(uiPageSize, config.getPageSize().toString());
			UIUtils.setListBoxValue(uiPageOrientation, config.getOrientation().toString());

	        EmisMetaEntity reportEntity = config.getJuniorEntity();
	        EmisMetaHierarchy hierarchy = config.getHierarchy();

	        // Update report location level UI.
	        uiEntity.clear();
	        for (EmisMetaEntity entity : this.meta.getEntities())
	            if ((reportEntity == null) || (hierarchy == null) || (!reportEntity.isChildOf(entity, hierarchy)))
	                this.uiEntity.addItem(entity.getName(), entity);

	        this.uiEntity.setValue(config.getEntityType());
		}
	}
}


text:
/* -*- c++ -*- */
/*
 * Copyright 2013 Jiří Pinkava <j-pi@seznam.cz>.
 *
 * This is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3, or (at your option)
 * any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#ifndef INCLUDED_RSTT_ERROR_CORRECTION_IMPL_H
#define INCLUDED_RSTT_ERROR_CORRECTION_IMPL_H

#include <rstt/error_correction.h>
#include "error_correction_guess.h"

namespace gr {
  namespace rstt {

    class error_correction_impl : public error_correction
    {
     private:
      typedef unsigned short in_t;
      typedef unsigned short out_t;

      /** Reed-Solomon codec private data. */
      void *rs;

      bool drop_invalid;
      int guess_level;

      struct pred_byte_err;
      struct pred_recv_err;

      error_correction_guess guess_correction;

      /** Try serveral correction algorithms. */
      bool do_corrections(const in_t *in, out_t *out) const;

      /** Try process correction for specified value algorithm. */
      template <class GetValue>
      bool do_correction(const in_t *in, out_t *out, GetValue get_value) const;

      /** Evaluate Reed-Solomon correction code. */
      template <class GetValue>
      int do_rs_correction(const in_t *in, unsigned char *rs_data,
              GetValue get_value) const;

      /** copy back corrected data and (correct) header */
      void copy_corrected(unsigned char *rs_data, out_t *out) const;

      static bool chech_crc(const in_t *in, int len);

     public:
      error_correction_impl(bool drop_invalid, int guess_level);
      ~error_correction_impl();

      /**
        Check subframes CRC.
        Returns positive number if all subframes are valid,
        negative number if some subframes are invalid, or zero
        if no valid subframe is found.
      **/
      static int is_frame_valid(const in_t *in);

      int work(int noutput_items,
	       gr_vector_const_void_star &input_items,
	       gr_vector_void_star &output_items);
    };

  } // namespace rstt
} // namespace gr

#endif /* INCLUDED_RSTT_ERROR_CORRECTION_IMPL_H */


text:
package org.pushbutton.aws.gui.components;

import java.awt.Color;
import java.awt.Component;
import java.awt.Insets;

import javax.swing.border.LineBorder;

public class CustomLineBorder extends LineBorder {

	private static final long serialVersionUID = 586098798049894312L;
	private int insets = 0;

	public CustomLineBorder(int insets, Color color) {
		super(color);
		this.insets = insets;
	}

	public CustomLineBorder(int insets, Color color, int thickness) {
		super(color, thickness);
		this.insets = insets;
	}

	public CustomLineBorder(int insets, Color color, int thickness,
			boolean rounded) {
		super(color, thickness, rounded);
		this.insets = insets;
	}

	@Override
	public Insets getBorderInsets(Component c, Insets insets) {
		return new Insets(this.insets, this.insets, this.insets, this.insets);
	}
}


text:
void URITests::uriTests()
{
    SendCoinsRecipient rv;
    QUrl uri;
    uri.setUrl(QString("motocoin:MoTbHg6mUKZPnjhfAPYk7W5F847X91FPoJ6?req-dontexist="));
    QVERIFY(!GUIUtil::parseBitcoinURI(uri, &rv));

    uri.setUrl(QString("motocoin:MoTbHg6mUKZPnjhfAPYk7W5F847X91FPoJ6?dontexist="));
    QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv));
    QVERIFY(rv.address == QString("MoTbHg6mUKZPnjhfAPYk7W5F847X91FPoJ6"));
    QVERIFY(rv.label == QString());
    QVERIFY(rv.amount == 0);

    uri.setUrl(QString("motocoin:MoTbHg6mUKZPnjhfAPYk7W5F847X91FPoJ6?label=Wikipedia Example Address"));
    QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv));
    QVERIFY(rv.address == QString("MoTbHg6mUKZPnjhfAPYk7W5F847X91FPoJ6"));
    QVERIFY(rv.label == QString("Wikipedia Example Address"));
    QVERIFY(rv.amount == 0);

    uri.setUrl(QString("motocoin:MoTbHg6mUKZPnjhfAPYk7W5F847X91FPoJ6?amount=0.001"));
    QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv));
    QVERIFY(rv.address == QString("MoTbHg6mUKZPnjhfAPYk7W5F847X91FPoJ6"));
    QVERIFY(rv.label == QString());
    QVERIFY(rv.amount == 100000);

    uri.setUrl(QString("motocoin:MoTbHg6mUKZPnjhfAPYk7W5F847X91FPoJ6?amount=1.001"));
    QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv));
    QVERIFY(rv.address == QString("MoTbHg6mUKZPnjhfAPYk7W5F847X91FPoJ6"));
    QVERIFY(rv.label == QString());
    QVERIFY(rv.amount == 100100000);

    uri.setUrl(QString("motocoin:MoTbHg6mUKZPnjhfAPYk7W5F847X91FPoJ6?amount=100&label=Wikipedia Example"));
    QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv));
    QVERIFY(rv.address == QString("MoTbHg6mUKZPnjhfAPYk7W5F847X91FPoJ6"));
    QVERIFY(rv.amount == 10000000000LL);
    QVERIFY(rv.label == QString("Wikipedia Example"));

    uri.setUrl(QString("motocoin:MoTbHg6mUKZPnjhfAPYk7W5F847X91FPoJ6?message=Wikipedia Example Address"));
    QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv));
    QVERIFY(rv.address == QString("MoTbHg6mUKZPnjhfAPYk7W5F847X91FPoJ6"));
    QVERIFY(rv.label == QString());

    QVERIFY(GUIUtil::parseBitcoinURI("motocoin://MoTbHg6mUKZPnjhfAPYk7W5F847X91FPoJ6?message=Wikipedia Example Address", &rv));
    QVERIFY(rv.address == QString("MoTbHg6mUKZPnjhfAPYk7W5F847X91FPoJ6"));
    QVERIFY(rv.label == QString());

    // We currently don't implement the message parameter (ok, yea, we break spec...)
    uri.setUrl(QString("motocoin:MoTbHg6mUKZPnjhfAPYk7W5F847X91FPoJ6?req-message=Wikipedia Example Address"));
    QVERIFY(!GUIUtil::parseBitcoinURI(uri, &rv));

    uri.setUrl(QString("motocoin:MoTbHg6mUKZPnjhfAPYk7W5F847X91FPoJ6?amount=1,000&label=Wikipedia Example"));
    QVERIFY(!GUIUtil::parseBitcoinURI(uri, &rv));

    uri.setUrl(QString("motocoin:MoTbHg6mUKZPnjhfAPYk7W5F847X91FPoJ6?amount=1,000.0&label=Wikipedia Example"));
    QVERIFY(!GUIUtil::parseBitcoinURI(uri, &rv));
}


text:
package com.bourke.glimmr.appwidget;

import android.appwidget.AppWidgetManager;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;
import com.bourke.glimmr.R;
import com.bourke.glimmr.activities.BaseActivity;
import com.bourke.glimmr.common.Constants;
import com.bourke.glimmr.common.OAuthUtils;

public class StackViewWidgetConfigure extends BaseActivity {

    private static final String TAG = "Glimmr/StackViewWidgetConfigure";

    private int mAppWidgetId = AppWidgetManager.INVALID_APPWIDGET_ID;

    private static final String KEY_WIDGET_TYPE =
        "com.bourke.glimmr.appwidget.StackViewWidgetConfigure.KEY_WIDGET_TYPE";

    public static final int WIDGET_TYPE_EXPORE = 0;
    public static final int WIDGET_TYPE_FAVORITES = 1;
    public static final int WIDGET_TYPE_PHOTOS= 2;
    public static final int WIDGET_TYPE_CONTACTS = 3;
    private static final int[] LOGIN_REQUIRED = { WIDGET_TYPE_FAVORITES,
        WIDGET_TYPE_PHOTOS, WIDGET_TYPE_CONTACTS };

    @Override
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);

        /* Set the result to CANCELED.  This will cause the widget host to
         * cancel out of the widget placement if they press the back button. */
        setResult(RESULT_CANCELED);

        setContentView(R.layout.stackview_widget_configure);

        /* Find the widget id from the intent. */
        Intent intent = getIntent();
        Bundle extras = intent.getExtras();
        if (extras != null) {
            mAppWidgetId = extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID,
                    AppWidgetManager.INVALID_APPWIDGET_ID);
        }

        /* If they gave us an intent without the widget id, just bail. */
        if (mAppWidgetId == AppWidgetManager.INVALID_APPWIDGET_ID) {
            finish();
        }

        /* NOTE: Remember to update the constants at the top if modifying
         * these */
        String[] widgetTypes = new String[] { getString(R.string.explore),
            getString(R.string.favorites), getString(R.string.photos),
            getString(R.string.contacts) };

        ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
                android.R.layout.simple_list_item_1, android.R.id.text1,
                widgetTypes);
        ListView list = (ListView) findViewById(R.id.list);
        list.setAdapter(adapter);

        list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view,
                    int position, long id) {
                final Context context = StackViewWidgetConfigure.this;

                /* check if widget type requires login */
                for (int widgetType : LOGIN_REQUIRED) {
                    if (widgetType == position) {
                        if (!OAuthUtils.isLoggedIn(context)) {
                            Toast.makeText(context,
                                getString(R.string.login_required),
                                Toast.LENGTH_SHORT).show();
                            return;
                        }
                    }
                }

                saveWidgetType(position);

                /* Make sure we pass back the original appWidgetId */
                Intent resultValue = new Intent();
                resultValue.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID,
                    mAppWidgetId);
                setResult(RESULT_OK, resultValue);
                finish();
            }
        });
    }

    private void saveWidgetType(int type) {
        SharedPreferences prefs = getSharedPreferences(
                Constants.PREFS_NAME, Context.MODE_PRIVATE);
        SharedPreferences.Editor editor = prefs.edit();
        editor.putInt(KEY_WIDGET_TYPE, type);
        editor.commit();
    }

    public static int loadWidgetType(Context context) {
        SharedPreferences prefs = context.getSharedPreferences(
                Constants.PREFS_NAME, Context.MODE_PRIVATE);
        int widgetType = prefs.getInt(KEY_WIDGET_TYPE, -1);
        if (widgetType == -1) {
            Log.e(TAG, "No widgetType found in SharedPreferences (-1)");
            widgetType = WIDGET_TYPE_EXPORE;
        }
        return widgetType;
    }

    /* Disable menu for this activity */
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        return true;
    }

}


text:
title: "Mint Mobile: Is Wireless Plan for $15/month worth it? Let's review it"
description: "A full first-hand product review on Mint Mobile about a wireless plan for only $15/month, who is this product fits for."
last_modified_at: 2019-12-10T16:20:02-05:00
categories:
  - Reviews
tags:
  - Mint Mobile
  - Cellphone Review
  - Electronic Review
toc: true
toc_icon: "money"
---
> Do you want to pay only $15 as person for your wireless bill each month? If "Yes", please keep reading.

[Mint Mobile](https://www.mintmobile.com/) initially starts on August 1, 2016. It started gaining massive attraction during the Super Bowl commercial in 2018 with a "green fox" talking about saving money on phone plan with only $20 a month.

## Initial Thoughts
At the time of writing this article, assume you only want to pay for a single line, you'd see the following price from major carriers. You can get even lower price if you are in a family plan with multiple people, so it is something we need to take into consideration compared with Mint Mobile. Note: the price below gives you unlimited talk, text & data.

|  AT&T  | Verizon | T-Mobile | Sprint |
|:--------|:-------:|--------:|--------:|
| $65/mo  | $70/mo   | $60/mo   | $60/mo  |

At first glance, Mint Mobile's plans are very competitive on the price. Although users have to plan on how much data they would need beforehand (Mint Mobile is not unlimited on 4G), it's still sounds like a good deal from the money perspective.

Secondly, users pay their contract fee upfront with Mint Mobile, it feels like prepaid monthly plan. There are 9 options available now: 3, 6 and 12 months, each month you can choose 3G, 8G and 12G as 4G data plan, both talks and text are unlimited, the longer period you have the less monthly cost you pay.

With a winter (Black Friday) deal, you could get your first 3 months with 12G data as low as $15/month. After 3 month "welcome" contract period, you can choose to close the account, change plan or continue with the current plan. Despite the plan you choose, at the beginning of each plan cycle, you pay for the entire contract instead of a monthly installment. For example, if you choose a 12 month plan, you'd need to pay for the entire year, which could be a burden compared to other wireless carriers.

Thirdly, as a wireless provider, signal is one of the biggest factors need to take careful consideration. Mint Mobile is powered by T-Mobile's 4G LTE network, how good is that? It depends where you go but overall I am happy with my experience.

At last, Mint Mobile doesn't sell your phone with their plan, it is called **Bring Your Own Device (BYOD)**, which means you'd need to bring an unlocked phone yourself. If you are not sure if your phone is unlocked, please check your current wireless provider before making the purchase.

Since I need to purchase a cheap phone plan for less than 6 months, I am curious, I'd give Mint Mobile a try, below is my review within 7 days experience.

## Ordering & Unboxing Process
I had a very good experience with their website and order process is straightforward, they also take the shipping cost away due to the deal which is very nice. I paid chose the $15/month for first 3 months with 12G plan as the "welcome" offer, Mint Mobile used Fedex and shipped from CA to NJ within 2 days.

The package includes two green envelopes, one has a single SIM card with the plan you purchased, the other one has two SIM cards that you can send as a gift to your friends. I'm not sure if Mint Mobile always send out the "gift" SIM cards, but it is nice gift for sharing (Only if the SIM works, more detail in [Onboarding Process & Get a New Number](#onboarding-process--get-a-new-number)).

|:---:|:---:|
|![image-center]({{ site.url }}{{ site.baseurl }}/assets/images/mintmobile/envelopes.JPG) | ![image-center]({{ site.url }}{{ site.baseurl }}/assets/images/mintmobile/opened-envelopes.JPG) |

## Activation Process
Mint Mobile has an easy way to activate the SIM card [online](https://my.mintmobile.com/activation), you just need to provie the ACT Code on the back of the card, then follow the instructions online. Since I only need a new number, all I need is to choose a zip code and they generate a phone number for you. _Note: if you live in city like New York and keep the number for limit time, you might want to choose an area that's less crowded, my one bad experience is spam call starts on day 1!_

![image-center]({{ site.url }}{{ site.baseurl }}/assets/images/mintmobile/chose_number.png){: .align-center}

One small issue I had was the SIM card carried my 12G plan was a bad SIM one, which I tried on different 3 phones, all phones said "No SIM Card Found". I called Mint Mobile, the representative kept saying my phone was locked. Then I switched to the "gift" SIM card which showed "No signal", I called Mint Mobile again and told them more detail, they swapped the SIM card associated with my plan, problem solved!

Another issue I encountered was I initially don't have 4G data available. After resetting network on my iPhone 6, everything seems to be working smoothly. I am in Mint network!

## Mint Mobile UI
You can interact with Mint Mobile by web, app and text message. I am impressed by its UI. It is clean and clear, it has all the information I need as a wireless plan, renew the plan is very simple, add more data is just a few buttons click, it even provides a useful button to check my remaining 4G data of a month.

|:---:|:---:|
| ![image-center]({{ site.url }}{{ site.baseurl }}/assets/images/mintmobile/ui_summary.png) | ![image-center]({{ site.url }}{{ site.baseurl }}/assets/images/mintmobile/ui_menu.png) |

## Signal Test
I'd say signal is acceptable in my test, I have my AT&T at home with 2 out of 4 signal bars and Mint Mobile has 1-2 out of 4 signal bar. I went to Whole Food market in NJ during last weekend, both carriers had a hard time to get any signal, Mint Mobile is not impressive at this point.

## Summary
In summary, I think Mint Mobile is very smart in the wireless market. It focuses on a very different segments than its competitors.

I think it is a great product for the following needs:
- For travellers only need to be in the US for a limited time without worrying about signing a wireless contract.
- Users use less data than unlimited or have access to WIFI most of time.
- Users bring their own phone and want to cut their monthly phone plan cost.


text:
package com.siyeh.ig.naming;

import com.intellij.psi.PsiIdentifier;
import com.intellij.psi.PsiTypeParameter;
import com.siyeh.InspectionGadgetsBundle;
import com.siyeh.ig.BaseInspectionVisitor;
import org.jetbrains.annotations.NotNull;

public class TypeParameterNamingConventionInspectionBase extends ConventionInspection {
  private static final int DEFAULT_MIN_LENGTH = 1;
  private static final int DEFAULT_MAX_LENGTH = 1;

  @Override
  @NotNull
  public String getDisplayName() {
    return InspectionGadgetsBundle.message(
      "type.parameter.naming.convention.display.name");
  }

  @Override
  protected boolean buildQuickFixesOnlyForOnTheFlyErrors() {
    return true;
  }

  @Override
  protected String getElementDescription() {
    return InspectionGadgetsBundle.message("type.parameter.naming.convention.element.description");
  }

  @Override
  protected String getDefaultRegex() {
    return "[A-Z][A-Za-z\\d]*";
  }

  @Override
  protected int getDefaultMinLength() {
    return DEFAULT_MIN_LENGTH;
  }

  @Override
  protected int getDefaultMaxLength() {
    return DEFAULT_MAX_LENGTH;
  }

  @Override
  public BaseInspectionVisitor buildVisitor() {
    return new NamingConventionsVisitor();
  }

  private class NamingConventionsVisitor extends BaseInspectionVisitor {

    @Override
    public void visitTypeParameter(PsiTypeParameter parameter) {
      super.visitTypeParameter(parameter);
      final String name = parameter.getName();
      if (name == null) {
        return;
      }
      if (isValid(name)) {
        return;
      }
      final PsiIdentifier nameIdentifier = parameter.getNameIdentifier();
      if (nameIdentifier == null) {
        return;
      }
      registerError(nameIdentifier, name);
    }
  }
}


text:
const debug = require('debug')('app:main');
const config = require('./config/env');
const appSetup = require('./config/app-init-setup');

const app = appSetup.init();

app.use('/api', require('./session-api'));
app.use('/api', require('./server-api'));
app.use('/', require('./flux/server.jsx'));

appSetup.connectToDatabase(config.get('mongo.url'));
appSetup.handleErrors(app);
appSetup.startServer(app, config.get('port'));


text:
package com.binarymystery.pista.ais;

import android.content.Context;
import android.os.AsyncTask;
import android.os.PowerManager;
import android.widget.Toast;

import com.binarymystery.pista.ModulManager;
import com.binarymystery.pista.R;
import com.binarymystery.pista.dialog.NetworkDialogManager;
import com.binarymystery.pista.email.EmailClient;
import com.binarymystery.pista.networking.NetworkConstants;
import com.binarymystery.pista.storage.database.Email;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Vedľajšie vlákno pre získanie dát z Akademického informačného systému.
 */
public class AISSynchronizationTask extends AsyncTask<String, String, Integer> {

    private ModulManager modulManager;
    private AISOperations aisOp;
    private NetworkDialogManager.LoadingDialog loading;
    private PowerManager.WakeLock wakeLock;

    private EmailClient emailClient;
    private Email email;

    public AISSynchronizationTask(ModulManager mManager) {
        this.modulManager = mManager;
        aisOp = new AISOperations(modulManager);
        NetworkDialogManager dialogManager = new NetworkDialogManager();
        loading = dialogManager.getLoadingDialog();
    }

    public AISSynchronizationTask(ModulManager mManager, EmailClient emailClient, Email email) {
        this.modulManager = mManager;
        this.emailClient = emailClient;
        this.email = email;
        aisOp = new AISOperations(modulManager);
        NetworkDialogManager dialogManager = new NetworkDialogManager();
        loading = dialogManager.getLoadingDialog();
    }

    @Override
    protected void onPreExecute() {
        super.onPreExecute();
        loading.show(modulManager.getMainActivity().getFragmentManager(), "AIS_LOADING");
        PowerManager powerManager = (PowerManager)modulManager.getMainActivity().getSystemService(Context.POWER_SERVICE);
        wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,"AISSyncWakelock");
        wakeLock.acquire();
    }

    @Override
    protected Integer doInBackground(String... params) {

        publishProgress("Zisťujem dostupnosť internetu");
        if (!modulManager.getNetworkManager().isInternetConnected()) return 0;

        publishProgress("Prihlasujem ťa");
        String page = modulManager.getNetworkManager().login(params[0], params[1]);
        if (page == null) return 0;
        if (page.contentEquals(NetworkConstants.ERROR_LOGIN)) {
            publishProgress("41");
            return 2;
        }

        publishProgress("Sťahujem obsah");
        if (params.length >= 3) {
            /**
             * Rýchly update
             */
            if (params[2].equalsIgnoreCase("1")) {
                publishProgress("Zisťujem tvoje osobné informácie");
                aisOp.fetchUserData(page, modulManager.getStorage().getUserData());
                publishProgress("Aktualizujem tvoje známky");
                aisOp.fetchCurrentEindex(page, modulManager.getStorage().getUserData());
                publishProgress("Aktualizujem informacie o osobách");
                aisOp.updatePersons();
                publishProgress("Sťahujem tvoje body");
                aisOp.fetchLectureSheets();
                publishProgress("Čítam tvoje emaily");
                aisOp.fetchEmails();
                publishProgress("Šťahujem nové aktuality z fakulty");
                modulManager.getInfoService().updateOnlyEvents(modulManager.getMainActivity());
                modulManager.getStorage().getSettingsData().setStringData(modulManager.getMainActivity().getString(R.string.settings_lastsync), getTime());
            } else if (params[2].equalsIgnoreCase("2") && emailClient != null && email != null) {
                publishProgress("Sťahujem ti požadovaný email");
                aisOp.fetchEmailDetail(emailClient.getEmails(), email);

                publishProgress("Email stiahnutý");
                publishProgress("Hotovo a odhlasujem ťa");
                modulManager.getNetworkManager().logout();
                return 3;
            }
        }
        /**
         * Úplný update
         */
        else {
            publishProgress("Zisťujem tvoje osobné informácie");
            aisOp.fetchUserData(page, modulManager.getStorage().getUserData());
            publishProgress("Rozpoznávam tvoj rozvrh");
            aisOp.fetchTimetableData(page, modulManager.getStorage().getUserData());
            publishProgress("Sťahujem všetky tvoje známky");
            aisOp.fetchEindex(page, modulManager.getStorage().getUserData());
            publishProgress("Aktualizujem informacie o osobách");
            aisOp.updatePersons();
            publishProgress("Parsujem dokumentový strom");
            aisOp.fetchDocumentTree();
            publishProgress("Zisťujem čo máš ešte odovzdať");
            aisOp.fetchCourseworkSubmissions();
            publishProgress("Sťahujem tvoje body");
            aisOp.fetchLectureSheets();
            publishProgress("Čítam tvoje emaily");
            aisOp.fetchEmails();
            publishProgress("Aktualizujem informácie o fakulte");
            modulManager.getInfoService().updateAllInfo(modulManager.getMainActivity());
            modulManager.getStorage().getSettingsData().setStringData(modulManager.getMainActivity().getString(R.string.settings_lastfullsync), getTime());
        }

        publishProgress("Hotovo a odhlasujem ťa");
        modulManager.getNetworkManager().logout();
        return 1;
    }

    @Override
    protected void onProgressUpdate(String... progress) {
        if(loading.isAdded()){
            loading.setMessage(progress[0]);
        }
    }

    @Override
    protected void onPostExecute(Integer result) {
        wakeLock.release();
        loading.dismiss();
        if (result == 0) {
            Toast.makeText(modulManager.getMainActivity(), "Zariadenie nie je pripojený k internetu!", Toast.LENGTH_LONG).show();
        } else if (result == 1) {
            modulManager.refreshDrawer();
            Toast.makeText(modulManager.getMainActivity(), "Synchronizácia s AIS prebehla úspešne", Toast.LENGTH_LONG).show();
        } else if (result == 2) {
            Toast.makeText(modulManager.getMainActivity(), "Prihlasovacie údaje sú chybné", Toast.LENGTH_LONG).show();
            modulManager.getStorage().getUserData().setLogin(" ");
            modulManager.getStorage().getUserData().setPassword(" ");
        } else if (result == 3) {
            emailClient.getEmails().set(email.getListIndex(), email);
            emailClient.showEmailDetails(email);
        }
    }

    public String getTime() {
        Date date = new Date();
        SimpleDateFormat format = new SimpleDateFormat("HH:mm dd.MM.yy");
        return format.format(date);
    }

}


text:
// Type definitions for three.js (VRControls.js)
// Project: https://github.com/mrdoob/three.js/blob/master/examples/js/controls/VRControls.js
// Definitions by: Toshiya Nakakura <https://github.com/nakakura>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

/// <reference path="./three.d.ts" />
/// <reference path="../webvr-api/webvr-api.d.ts" />

declare namespace THREE {
    export class VRControls {
        constructor(camera: Camera, callback?: (param: string)=>void);

        /**
         * Update VR Instance Tracking
         */
        update(): void;
        zeroSensor(): void;

        scale: number;

        setVRDisplay(display: VRDisplay): void;
    }
}


text:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated Sep 3, 2008 1:58:22 PM by Hibernate Tools 3.2.1.GA -->
<hibernate-mapping>
    <class name="org.gmod.gbol.simpleObject.generated.AbstractPublicationAuthor" table="pubauthor">
        <meta attribute="chadoModule" inherit="false">publication</meta>

        <meta attribute="scope-class" inherit="false">public abstract</meta>

        <comment>An author for a publication. Note the denormalisation (hence lack of _ in table name) - this is deliberate as it is in general too hard to assign IDs to
        authors.</comment>

        <id name="publicationAuthorId" type="java.lang.Integer">
            <column name="pubauthor_id" />

            <generator class="sequence">
                <param name="sequence">pubauthor_pubauthor_id_seq</param>
            </generator>
        </id>

        <discriminator column="pubauthor_id" insert="false" />

        <many-to-one name="publication" class="org.gmod.gbol.simpleObject.Publication" fetch="select">
            <meta attribute="use-in-equals" inherit="false">true</meta>

            <column name="pub_id" not-null="true" />
        </many-to-one>

        <property name="rank" type="int">
            <meta attribute="use-in-equals" inherit="false">true</meta>

            <column name="rank" not-null="true">
                <comment>Order of author in author list for this pub - order is important.</comment>
            </column>
        </property>

        <property name="editor" type="java.lang.Boolean">
            <column name="editor">
                <comment>Indicates whether the author is an editor for linked publication. Note: this is a boolean field but does not follow the normal chado convention for naming
                booleans.</comment>
            </column>
        </property>

        <property name="surname" type="string">
            <column name="surname" length="100" not-null="true" />
        </property>

        <property name="givenNames" type="string">
            <column name="givennames" length="100">
                <comment>First name, initials</comment>
            </column>
        </property>

        <property name="suffix" type="string">
            <column name="suffix" length="100">
                <comment>Jr., Sr., etc</comment>
            </column>
        </property>
    </class>
</hibernate-mapping>


text:
require "active_support/core_ext/object/to_param"

module ActionCable
  module Channel
    module Broadcasting
      extend ActiveSupport::Concern

      delegate :broadcasting_for, to: :class

      module ClassMethods
        # Broadcast a hash to a unique broadcasting for this <tt>model</tt> in this channel.
        def broadcast_to(model, message)
          ActionCable.server.broadcast(broadcasting_for([ channel_name, model ]), message)
        end

        def broadcasting_for(model) #:nodoc:
          case
          when model.is_a?(Array)
            model.map { |m| broadcasting_for(m) }.join(":")
          when model.respond_to?(:to_gid_param)
            model.to_gid_param
          else
            model.to_param
          end
        end
      end
    end
  end
end


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <title>Title</title>

Wave.io Tests

Press F12 and Enjoy :)

<button onclick="postest()">Post Test!</button>


text:
<!DOCTYPE html>

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>Calendario MiHuerta</title>

    <link href="../vendors/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">

    <link href="../vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">

    <link href="../vendors/nprogress/nprogress.css" rel="stylesheet">

    <link href="../vendors/fullcalendar/dist/fullcalendar.min.css" rel="stylesheet">
    <link href="../vendors/fullcalendar/dist/fullcalendar.print.css" rel="stylesheet" media="print">

    <link href="../build/css/custom.min.css" rel="stylesheet">

               Calendario

                Bienvenido

Jesús Miguel

General

 Home

 Calendario

 Clima

 Estadística

                    John Doe

 Profile

                        50%
                        Settings

Help

 Log Out

                    6

                          John Smith
                          3 mins ago

                          Film festivals used to be do-or-die moments for movie makers. They were where...

                          John Smith
                          3 mins ago

                          Film festivals used to be do-or-die moments for movie makers. They were where...

                          John Smith
                          3 mins ago

                          Film festivals used to be do-or-die moments for movie makers. They were where...

                          John Smith
                          3 mins ago

                          Film festivals used to be do-or-die moments for movie makers. They were where...

                          See All Alerts

Calendar Click to add/edit events

                    <input type="text" class="form-control" placeholder="Search for...">

                      <button class="btn btn-default" type="button">Go!</button>

Calendar Events Sessions

Settings 1

Settings 2

            Gentelella - Bootstrap Admin Template by Colorlib

            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>

New Calendar Entry

              <form id="antoform" class="form-horizontal calender" role="form">

                  Title

                    <input type="text" class="form-control" id="title" name="title">

                  Description

                    <textarea class="form-control" style="height:55px;" id="descr" name="descr"></textarea>

              </form>

            <button type="button" class="btn btn-default antoclose" data-dismiss="modal">Close</button>
            <button type="button" class="btn btn-primary antosubmit">Save changes</button>

            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>

Edit Calendar Entry

              <form id="antoform2" class="form-horizontal calender" role="form">

                  Title

                    <input type="text" class="form-control" id="title2" name="title2">

                  Description

                    <textarea class="form-control" style="height:55px;" id="descr2" name="descr"></textarea>

              </form>

            <button type="button" class="btn btn-default antoclose2" data-dismiss="modal">Close</button>
            <button type="button" class="btn btn-primary antosubmit2">Save changes</button>


text:
/*
 * $Id: XSModelGroup.hpp 527149 2007-04-10 14:56:39Z amassari $
 */

#if !defined(XERCESC_INCLUDE_GUARD_XSMODELGROUP_HPP)
#define XERCESC_INCLUDE_GUARD_XSMODELGROUP_HPP

#include <xercesc/framework/psvi/XSObject.hpp>

XERCES_CPP_NAMESPACE_BEGIN

/**
 * This class describes all properties of a Schema Model Group
 * component.
 * This is *always* owned by the validator /parser object from which
 * it is obtained.
 */

// forward declarations
class XSAnnotation;
class XSParticle;

class XMLPARSER_EXPORT XSModelGroup : public XSObject
{
public:

    // Content model compositors
    enum COMPOSITOR_TYPE {
	    /**
	     * This constant value signifies a sequence operator.
	     */
	    COMPOSITOR_SEQUENCE       = 1,
	    /**
	     * This constant value signifies a choice operator.
	     */
	    COMPOSITOR_CHOICE         = 2,
	    /**
	     * This content model represents a simplified version of the SGML
	     * &-Connector and is limited to the top-level of any content model.
	     * No element in the all content model may appear more than once.
	     */
	    COMPOSITOR_ALL            = 3
    };

    //  Constructors and Destructor
    // -----------------------------------------------------------------------
    /** @name Constructors */
    //@{

    /**
      * The default constructor
      *
      * @param  compositorType
      * @param  particleList
      * @param  annot
      * @param  xsModel
      * @param  manager     The configurable memory manager
      */
    XSModelGroup
    (
        COMPOSITOR_TYPE compositorType
        , XSParticleList* const particleList
        , XSAnnotation* const annot
        , XSModel* const xsModel
        , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
    );

    //@};

    /** @name Destructor */
    //@{
    ~XSModelGroup();
    //@}

    //---------------------
    /** @name XSModelGroup methods */
    //@{

    /**
     * [compositor]: one of all, choice or sequence. The valid constants
     * values are:
     * COMPOSITOR_SEQUENCE, COMPOSITOR_CHOICE, COMPOSITOR_ALL.
     */
    COMPOSITOR_TYPE getCompositor() const;

    /**
     *  A list of [particles].
     */
    XSParticleList *getParticles() const;

    /**
     * Optional. An [annotation].
     */
    XSAnnotation *getAnnotation() const;

    //@}

    //----------------------------------
    /** methods needed by implementation */

    //@{

    //@}
private:

    // -----------------------------------------------------------------------
    //  Unimplemented constructors and operators
    // -----------------------------------------------------------------------
    XSModelGroup(const XSModelGroup&);
    XSModelGroup & operator=(const XSModelGroup &);

protected:

    // -----------------------------------------------------------------------
    //  data members
    // -----------------------------------------------------------------------
    COMPOSITOR_TYPE fCompositorType;
    XSParticleList* fParticleList;
    XSAnnotation*   fAnnotation;
};

inline XSModelGroup::COMPOSITOR_TYPE XSModelGroup::getCompositor() const
{
    return fCompositorType;
}

inline XSParticleList* XSModelGroup::getParticles() const
{
    return fParticleList;
}

inline XSAnnotation* XSModelGroup::getAnnotation() const
{
    return fAnnotation;
}

XERCES_CPP_NAMESPACE_END

#endif


text:
#ifndef ACCOUNT_H
#define ACCOUNT_H
#include <QDate>
#include <QString>
//start
class Account {
public:
    Account(unsigned acctno, double bal, QString owner);
    virtual ~Account() { }
    virtual void deposit(double amt);
    virtual QString toString() const;
    virtual QString toString(char delimiter);   /* Overloaded
       function. */
protected:
    unsigned  m_AcctNo;
    double    m_Balance;
    QString   m_Owner;
};

class InsecureAccount: public Account {
public:
    InsecureAccount(unsigned acctno, double bal, QString owner);
    QString toString() const;                   /* Overrides base method
       and hides toString(char). */
    void deposit(double amt, QDate postDate);   /* Does not
       override any method, but hides all Account::deposit()
       methods. */
};
//end
#endif        //  #ifndef ACCOUNT_H


text:
instanceof shouldn't call __autoload
--FILE--
<?php
function __autoload($name) {
	echo("AUTOLOAD '$name'\n");
	eval("class $name {}");
}

class A {
}
$a = new A;
var_dump($a instanceof B);
var_dump($a instanceof A);
?>
--EXPECT--
bool(false)
bool(true)


text:
package com.vmware.vim25;

/**
@author Steve Jin (sjin@vmware.com)
*/

public class HostInDomain extends HostConfigFault
{
}


text:
@protocol WCPayCreditPayCreateWeixinCreditViewControllerDelegate <NSObject>
- (void)WCPayCreditPayCreateWeixinCreditViewControllerRemove;
- (void)WCPayCreditPayCreateWeixinCreditViewControllerNext;
- (void)WCPayCreditPayCreateWeixinCreditViewControllerCancel;
@end


text:
<?php

use yii\helpers\Html;
use yii\widgets\DetailView;

use app\models\general\GeneralLabel;
use app\models\general\GeneralMessage;
use common\models\general\GeneralFunction;

/* @var $this yii\web\View */
/* @var $model app\models\PenilaianPestasi */

//$this->title = $model->penilaian_pestasi_id;
$this->title = GeneralLabel::viewTitle . ' ' . GeneralLabel::penilaian_pestasi;
$this->params['breadcrumbs'][] = ['label' => GeneralLabel::penilaian_pestasi, 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>

<?= Html::encode($this->title) ?>

        <?php if(isset(Yii::$app->user->identity->peranan_akses['MSN']['penilaian-pestasi']['update']) && ($model->tarikh_nilai_tamat >  GeneralFunction::getCurrentDate())): ?>
            <?= Html::a(GeneralLabel::update, ['update', 'id' => $model->penilaian_pestasi_id], ['class' => 'btn btn-primary']) ?>
        <?php endif; ?>
        <?php if(isset(Yii::$app->user->identity->peranan_akses['MSN']['penilaian-pestasi']['delete']) && ($model->tarikh_nilai_tamat >  GeneralFunction::getCurrentDate())): ?>
            <?= Html::a(GeneralLabel::delete, ['delete', 'id' => $model->penilaian_pestasi_id], [
                'class' => 'btn btn-danger',
                'data' => [
                    'confirm' => GeneralMessage::confirmDelete,
                    'method' => 'post',
                ],
            ]) ?>
        <?php endif; ?>
		<?php if(isset(Yii::$app->user->identity->peranan_akses['MSN']['penilaian-pestasi']['update'])): ?>
			<?= Html::a(GeneralLabel::cetak_pencapaian_atlet, ['print', 'id' => $model->penilaian_pestasi_id], ['class' => 'btn btn-default', 'target' => '_blank']) ?>
		<?php endif; ?>

    <?= $this->render('_form', [
        'model' => $model,
        'searchModelPenilaianPrestasiAtletSasaran' => $searchModelPenilaianPrestasiAtletSasaran,
        'dataProviderPenilaianPrestasiAtletSasaran' => $dataProviderPenilaianPrestasiAtletSasaran,
        'readonly' => $readonly,
    ]) ?>

    <?php /*echo DetailView::widget([
        'model' => $model,
        'attributes' => [
            'penilaian_pestasi_id',
            'atlet_id',
            'tahap_sihat',
            'pencapaian_sukan_dalam_tahun_yang_dinilai',
            'kecederaan_jika_ada',
            'laporan_kesihatan',
            'elaun_yang_diterima',
            'skim_hadiah_kemenangan_sukan',
        ],
    ])*/ ?>


text:
"use strict";

const {strict: assert} = require("assert");

const {set_global, zrequire} = require("../zjsunit/namespace");
const {run_test} = require("../zjsunit/test");

set_global("page_params", {
    is_spectator: false,
});

const params = {
    alert_words: ["alertone", "alerttwo", "alertthree", "al*rt.*s", ".+", "emoji"],
};

const people = zrequire("people");
const alert_words = zrequire("alert_words");

alert_words.initialize(params);

people.add_active_user({
    email: "tester@zulip.com",
    full_name: "Tester von Tester",
    user_id: 42,
});

people.initialize_current_user(42);

const regular_message = {
    sender_email: "another@zulip.com",
    content: "
a message
",
};
const own_message = {
    sender_email: "tester@zulip.com",
    content: "
hey this message alertone
",
    alerted: true,
};
const other_message = {
    sender_email: "another@zulip.com",
    content: "
another alertone message
",
    alerted: true,
};
const caps_message = {
    sender_email: "another@zulip.com",
    content: "
another ALERTtwo message
",
    alerted: true,
};
const alertwordboundary_message = {
    sender_email: "another@zulip.com",
    content: "
another alertthreemessage
",
    alerted: false,
};
const multialert_message = {
    sender_email: "another@zulip.com",
    content: "
another emoji alertone and then alerttwo
",
    alerted: true,
};
const unsafe_word_message = {
    sender_email: "another@zulip.com",
    content: "
gotta al*rt.*s all
",
    alerted: true,
};
const alert_in_url_message = {
    sender_email: "another@zulip.com",
    content: "
http://www.google.com/alertone/me
",
    alerted: true,
};
const question_word_message = {
    sender_email: "another@zulip.com",
    content: "
still alertone? me
",
    alerted: true,
};

const typo_word_message = {
    sender_email: "another@zulip.com",
    content: "
alertones alerttwo alerttwo alertthreez
",
    alerted: true,
};

const alert_domain_message = {
    sender_email: "another@zulip.com",
    content:
        '
now with link www.alerttwo.us/foo/bar
',
    alerted: true,
};
// This test ensure we are not mucking up rendered HTML content.
const message_with_emoji = {
    sender_email: "another@zulip.com",
    content:
        '
I  emoji!
',
    alerted: true,
};

run_test("notifications", () => {
    assert.ok(!alert_words.notifies(regular_message));
    assert.ok(!alert_words.notifies(own_message));
    assert.ok(alert_words.notifies(other_message));
    assert.ok(alert_words.notifies(caps_message));
    assert.ok(!alert_words.notifies(alertwordboundary_message));
    assert.ok(alert_words.notifies(multialert_message));
    assert.ok(alert_words.notifies(unsafe_word_message));
    assert.ok(alert_words.notifies(alert_domain_message));
    assert.ok(alert_words.notifies(message_with_emoji));
});

run_test("munging", () => {
    alert_words.initialize(params);

    let saved_content = regular_message.content;
    alert_words.process_message(regular_message);
    assert.equal(saved_content, regular_message.content);

    saved_content = alertwordboundary_message.content;
    alert_words.process_message(alertwordboundary_message);
    assert.equal(alertwordboundary_message.content, saved_content);

    function assert_transform(message, expected_new_content) {
        const msg = {...message};
        alert_words.process_message(msg);
        assert.equal(msg.content, expected_new_content);
    }

    assert_transform(
        other_message,
        "
another alertone message
",
    );

    assert_transform(
        caps_message,
        "
another ALERTtwo message
",
    );

    assert_transform(
        multialert_message,
        "
another emoji alertone and then alerttwo
",
    );

    assert_transform(
        unsafe_word_message,
        "
gotta al*rt.*s all
",
    );

    assert_transform(alert_in_url_message, "
http://www.google.com/alertone/me
");

    assert_transform(
        question_word_message,
        "
still alertone? me
",
    );

    assert_transform(
        typo_word_message,
        "
alertones alerttwo alerttwo alertthreez
",
    );

    assert_transform(
        alert_domain_message,
        '
now with link www.alerttwo.us/foo/bar
',
    );

    assert_transform(
        message_with_emoji,
        '
I  emoji!
',
    );
});

run_test("basic get/set operations", () => {
    alert_words.initialize({alert_words: []});
    assert.ok(!alert_words.has_alert_word("breakfast"));
    assert.ok(!alert_words.has_alert_word("lunch"));
    alert_words.set_words(["breakfast", "lunch"]);
    assert.ok(alert_words.has_alert_word("breakfast"));
    assert.ok(alert_words.has_alert_word("lunch"));
    assert.ok(!alert_words.has_alert_word("dinner"));
});


text:
layout: post
title:  "kwgia zcotdgygn nbtvuqpj voqqdksbse ixojpogmhm"
date:   2016-12-04 15:39:40
description:  "A sample description describing this bland and lifeless randomly generated post"
img:
  wide: /images/wide.png
  square: /images/square.png
tags:
---
Bavaria ipsum dolor sit amet g'hupft wia gsprunga wolln dringma aweng oba Biazelt hogg di hera helfgod. Sog i hawadere midananda nomoi a bissal wos gehd ollaweil gor kumm geh naa jo leck mi, Xaver: Weiznglasl i hob di liab des muas ma hoid kenna.


text:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="format-detection" content="telephone=no, email=no" />
<meta name="x5-orientation" content="portrait" />
<meta name="x5-fullscreen" content="true" />
<meta name="x5-page-mode" content="app" />
<title>陈旭华</title>
<link rel="apple-touch-icon-precomposed" href="img/apple-touch-icon-57x57.png" />
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="img/apple-touch-icon-114x114.png" />
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="img/apple-touch-icon-114x114.png" />
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="img/apple-touch-icon-144x144.png" />
<link rel="apple-touch-startup-image" href="img/apple-touch-startup-image-320x460.png">
<link rel="apple-touch-startup-image" href="img/apple-touch-startup-image-640x920.png" media="(-webkit-min-device-pixel-ratio: 2)">
<link rel="apple-touch-startup-image" href="img/apple-touch-startup-image-640x1096.png" media="(device-height: 568px)">
<link rel="stylesheet" href="dist/main.min.css" />
<script src="dist/main.min.js"></script>
<script>
$.extend(spring.config, {
  // my blog title
  title: '陈旭华',
  // my blog description
  desc: "博客引擎通过GitHub Issues  \n[Fork me on GitHub](https://github.com/chenxuhua/chenxuhua.github.io)",
  // my github username
  owner: 'chenxuhua',
  // creator's username
  creator: 'chenxuhua',
  // the repository name on github for writting issues
  repo: 'chenxuhua.github.io',
  // custom page
  pages: [
    {name: 'About Spring', number: 1},
    {name: 'Quick Start', number: 2}
  ]
})
</script>
</head>
<body>
<!--[if lt IE 9]>
<script>
location.href = 'https://gitcdn.b0.upaiyun.com/' + spring.config.owner + '/' + spring.config.repo + '/issues?page=1&state=open'
</script>
<![endif]-->
</body>
</html>


text:
package com.xinyu.mwp.adapter;

import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.Drawable;

import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.xinyu.mwp.R;
import com.xinyu.mwp.adapter.base.BaseListViewAdapter;
import com.xinyu.mwp.adapter.viewholder.BaseViewHolder;
import com.xinyu.mwp.entity.BankCardEntity;
import com.xinyu.mwp.listener.OnAPIListener;
import com.xinyu.mwp.networkapi.NetworkAPIFactoryImpl;
import com.xinyu.mwp.util.BankInfoUtil;
import com.xinyu.mwp.util.DisplayUtil;
import com.xinyu.mwp.util.ErrorCodeUtil;
import com.xinyu.mwp.util.GradientDrawableUtil;
import com.xinyu.mwp.util.LogUtil;
import com.xinyu.mwp.util.NumberUtils;
import com.xinyu.mwp.util.ToastUtils;
import com.xinyu.mwp.view.SwipeListLayout;

import org.xutils.view.annotation.Event;
import org.xutils.view.annotation.ViewInject;

import java.util.ArrayList;
import java.util.List;

import in.srain.cube.views.ptr.PtrFrameLayout;

/**
 * @author : Created by xiepeng
 * @email : xiepeng2015929@gmail.com
 * @created time : 2017/1/16 0016
 * @describe : com.xinyu.mwp.adapter
 */
public class BindBankCardAdapter extends BaseListViewAdapter<BankCardEntity> {

    private PtrFrameLayout ptrFrameLayout;

    public BindBankCardAdapter(Context context) {
        super(context);
    }

    public void setPtrFrameLayout(PtrFrameLayout ptrFrameLayout) {
        this.ptrFrameLayout = ptrFrameLayout;
    }

    @Override
    protected BaseViewHolder<BankCardEntity> getViewHolder(int position) {
        return new BindBankCardViewHolder(context);
    }

    class BindBankCardViewHolder extends BaseViewHolder<BankCardEntity> {

        @ViewInject(R.id.swipeLayout)
        private SwipeListLayout swipeLayout;
        @ViewInject(R.id.itemLayout)
        private LinearLayout itemLayout;
        @ViewInject(R.id.iconView)
        private ImageView iconView;
        @ViewInject(R.id.titleView)
        private TextView titleView;
        @ViewInject(R.id.typeView)
        private TextView typeView;
        @ViewInject(R.id.numberView)
        private TextView numberView;
        @ViewInject(R.id.deleteView)
        private TextView deleteView;
        private BankCardEntity bankCardEntity;

        public BindBankCardViewHolder(Context context) {
            super(context);
        }

        @Override
        protected int layoutId() {
            return R.layout.item_bind_bank_card2;
        }

//        @Override
//        protected void initView() {
//            super.initView();
//            if (ptrFrameLayout != null) {
//                swipeLayout.setPtrFrameLayout(ptrFrameLayout);
//            }
//        }

        //存放所有已经打开的菜单
        private List<SwipeListLayout> openList = new ArrayList<SwipeListLayout>();

        @Override
        protected void initListener() {
            super.initListener();
            deleteView.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    unBindcard(); //解除绑定的银行卡
                }
            });
            swipeLayout.setSwipeChangeListener(new SwipeListLayout.OnSwipeChangeListener() {
                @Override
                public void onStartOpen(SwipeListLayout mSwipeLayout) {
                    for (SwipeListLayout layout : openList) {
                        layout.close();
                    }
                    openList.clear();
                }

                @Override
                public void onStartClose(SwipeListLayout mSwipeLayout) {
                }

                @Override
                public void onOpen(SwipeListLayout mSwipeLayout) {
                    openList.add(mSwipeLayout);
                }

                @Override
                public void onDraging(SwipeListLayout mSwipeLayout) {
                }

                @Override
                public void onClose(SwipeListLayout mSwipeLayout) {
                    openList.remove(mSwipeLayout);
                }
            });
        }

        /**
         * 解除绑定银行卡
         */
        private void unBindcard() {
            NetworkAPIFactoryImpl.getDealAPI().unBindCard(bankCardEntity.getBid(), "", new OnAPIListener<Object>() {
                @Override
                public void onError(Throwable ex) {
                    ex.printStackTrace();
                    ErrorCodeUtil.showEeorMsg(context, ex);
                }

                @Override
                public void onSuccess(Object o) {
                    remove(position);
                    notifyDataSetChanged();
                    swipeLayout.close();
                }
            });
        }

        @Event(value = R.id.rl_bank)
        private void click(View v) {
            onItemChildViewClick(v, 99);
        }

        @Override
        protected void update(BankCardEntity data) {
            if (data != null) {
                bankCardEntity = data;
//                ImageLoader.getInstance().displayImage(data.getIcon(), iconView);
                iconView.setImageResource(BankInfoUtil.getIcon(data.getBank()));
                titleView.setText(data.getBank());
                typeView.setText("储蓄卡");
                String cardEnd4 = NumberUtils.formatCard(data.getCardNo());
                numberView.setText(cardEnd4);
                Drawable drawable = GradientDrawableUtil.getGradientDrawable(Color.parseColor(data.getBackGround()), DisplayUtil.dip2px(5, context));
                itemLayout.setBackgroundDrawable(drawable);
                String menuBg = "#";
                if (data.getBackGround().contains("#")) {
                    menuBg = data.getBackGround().substring(1);
                    menuBg = "#87" + menuBg;
                }
                Drawable menuDrawable = GradientDrawableUtil.getGradientDrawable(Color.parseColor(menuBg), DisplayUtil.dip2px(5, context));
                deleteView.setBackgroundDrawable(menuDrawable);
            }
        }
    }
}


text:
const ExplicitContext = require('../src/explicit-context.js');

describe('ExplicitContext', () => {
  it('should start with context null', () => {
    const ctx = new ExplicitContext();
    expect(ctx.getContext()).to.equal(null);
  });

  it('should set an inner context', () => {
    const ctx = new ExplicitContext();
    ctx.letContext('foo', () => {
      expect(ctx.getContext()).to.equal('foo');
    });
  });

  it('should return the inner value', () => {
    const ctx = new ExplicitContext();
    const returnValue = ctx.letContext('foo', () => 123);
    expect(returnValue).to.equal(123);
  });

  it('should be reset after the callback', () => {
    const ctx = new ExplicitContext();
    ctx.letContext('foo', () => {
      // do nothing
    });
    expect(ctx.getContext()).to.equal(null);
  });

  it('support nested contexts', () => {
    const ctx = new ExplicitContext();
    const finalReturnValue = ctx.letContext('foo', () => {
      expect(ctx.getContext()).to.equal('foo');
      const innerReturnValue = ctx.letContext('bar', () => {
        expect(ctx.getContext()).to.equal('bar');
        return 1;
      });
      expect(ctx.getContext()).to.equal('foo');
      return innerReturnValue + 2;
    });
    expect(ctx.getContext()).to.equal(null);
    expect(finalReturnValue).to.equal(3);
  });

  it('does not support async context', done => {
    const ctx = new ExplicitContext();
    function callback() {
      expect(ctx.getContext()).to.equal(null);
      done();
    }
    ctx.letContext('foo', () => {
      setTimeout(callback, 10);
    });
  });
});


text:
<?xml version="1.0"?>

<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
<document>

    <title>Batik contributors</title>

      This page contains information about the current Batik developers and
      the features they are working on at the moment.

      <title>Committers</title>

        This section lists all developers with commit access to the Batik
        subversion repository.

        The following people are active Batik developers:

Thomas DeWeese (TD)

Thomas.DeWeese@Kodak.com

            Thomas DeWeese is a Senior Software Engineer at Eastman Kodak Company,
            in Rochester New York where he has worked for the Image Science
            Division's image application development group since 1994.  Thomas
            has made contributions to the imaging portions of the Java2D API,
            and was a major contributor to the Java Advanced Image API (version
            1.0).  Since then he has participated in the Jini Printing Working
            group and has recently become a member of Kodak's SVG Working Group
            team.

Cameron McCormack (CM)

cam@mcc.id.au

            Cameron McCormack is a postgraduate student at Monash University in
            Melbourne, Australia, where he is undertaking his PhD.  His thesis
            relates to adaptive layout of diagrams, and he has worked on an
            extension to SVG to allow expressions as attribute values.  He also
            is an invited expert on the SVG Working Group.  Cameron
            has been a committer since 2004, and has contributed code mostly
            related to SMIL animation and upcoming SVG 1.2 support.

Dieter von Holten (DH)

            Dieter is a freelance programmer living in Hamburg, Germany. He
            spends his time on projects in refineries and tankfarms, chasing
            bits from ERP to PLC and back. Although not specifically an expert
            with graphics, he tries to help out "maintaining and enhancing this
            interesting, non-trivial piece of code".

        The following people are some of the Batik project founders and
        helped define and implement the initial Batik architecture:

Bill Haneman

bill.haneman@ireland.sun.com

            Bill Haneman works for Sun Microsystems' Desktop Enabling Middleware
            group in Dublin, Ireland, and implemented much of the Batik's text
            support (though not SVG Fonts, thanks Bella, Dean, and David!).  He is
            also technical lead for the
            GNOME
              Accessibility Project, an open project to provide an
            accessibility framework for Linux and Solaris(TM) desktops.  A
            twenty-year veteran of scientific programming and application
            development, he is a US expatriate who plays traditional Irish music
            on the uilleann pipes.

Vincent Hardy

vincent.hardy@eng.sun.com

            Vincent is one of the founders of the SVG Batik project at Apache.
            He is a Senior Staff Engineer at Sun Microsystems Inc., where he is
            part of the XML technology center.  Vincent represented Sun in the
            W3C's SVG Working Group and is currently a W3C fellow in the W3C
            office in Sophia Antipolis, France.  Vincent is the author of papers
            and a book on the Java 2D API.

Stephane Hillion

shillion@ilog.fr

            Stephane is a software engineer at the Koala project, part of
            ILOG's visualization R&D team, located in Sophia-Antipolis,
            France. His main interests are in programming languages and web
            standards. He wrote the Apache Batik's DOM, CSS and Swing modules.

Dean Jackson

dean.jackson@cmis.csiro.au

            Dean is employed by CSIRO Australia and is currently working at
            the World Wide Web Consortium (W3C) full time on SVG. He is a member
            of the W3C's SVG working group, and was a developer
            of the CSIRO SVG Toolkit, one of the first and most complete open source
            SVG libraries.

Christophe Jolif

cjolif@ilog.fr

            Christophe Jolif is a Software Architect mainly working on the ILOG
            JViews Component Suite, the ILOG Java visualization framework. He has
            been working for ILOG since 1997, and is representing the company in the
            Scalable Vector Graphics (SVG) W3C Working Group since 1999. He has
            implemented SVG import and export features in ILOG JViews and is now
            also working on the SVG Batik project at Apache.

Thierry Kormann

tkormann@ilog.fr

            Thierry is a software engineer, at the Koala project of ILOG located at
            Sophia-Antipolis, France and a member of the SVG working group. Thierry has
            contributed to most of Koala's projects involving Java and XML. Since
            then, he co-founded the Apache Batik project. His daytime job is focused on
            Graphics and XML related technologies. Prior to joining ILOG, Thierry worked
            as a software engineer for Bull.

Nicolas Socheleau

nicolas.socheleau@bitflash.com

            Nicolas Socheleau is a software engineer at BitFlash Inc, Ottawa, Canada
            where he worked on different SVG related projects. He joined the Batik
            team in June 2002. His interests include XML technologies and Graphics. He
            contributed some text functionality and SVG DOM interface implementations.

Emmanuel Tissandier

tissandi@ilog.fr

            Emmanuel Tissandier has been working for 10 years as a software engineer
            in object oriented environments. He started with the development of CASE
            tools at Rank Xerox and joined the visualization R&D team of ILOG in
            1995. Since 1997, he has been the R&D Project Manager for the ILOG
            JViews Component Suite, a product for delivering two-dimensional
            structured graphics, cartography, diagrams, and Gantt charts in Java.

        Bella Robinson implemented the SVG font support in Batik:

Bella Robinson

bella.robinson@cmis.csiro.au

            Bella is a Software Engineer working for CSIRO Australia. She was one
            of the main developers of the CSIRO SVG Toolkit and has also been working
            on a Pocket SVG Viewer for handheld devices. Her interests include
            graphics and XML programming.

        In addition, James
          Davidson and Stefano
          Mazzochi, two Apache veterans who helped the Batik team start the
        project at Apache, also have commit access to the Subversion repository.

      <title>Batik contributors</title>

        The following people have contributed to Batik:

          Ivan
            Andjelkovic—Google Summer of Code student who worked
          on enhancements to the DOM Viewer window.

          Curt
            Arnold—Contributed many bug reports and fixes.

          Robert A.
            DiBlasi—Contributed a lot of feedback on the Batik
          documentation and suggestions on how to improve it.

          Archie
            Cobbs—Contributed a thread deadlocking fix.

          Paul
            Evenblij—Contributed an improvement to the way images are
          handled by the SVGGraphics2D component. Also contributed bug fixes on
          the SVGGraphics2D component.

          Pier
            Fumagalli—Helped with the Batik web site and mailing
          lists.

          Hervé
            Girod—Contributed many improvements to the WMF
          transcoder.

          Christophe
            Held—Contributed a math formula in SVG generated from
          MathML.

          Tonny Kohar—Contributed
          a syntax highlight XML editor component for use in Squiggle.

          Clay Leeds—Helped
          getting Batik's new site set up.

          Keiron Liddle—A
          FOP member who worked
          on an SVG to PDF transcoder that is a part of FOP but works in the
          Batik infrastructure.

          Jeremias
            Märki—Another FOP member who contributed code to improve
          compatibility with GNU Classpath.

          John
            Morrison—Contributed a set of XSL stylesheets to generate
          SVG charts, such as line graphs, bar charts or pie charts.

          Andreas
            Neumann—Contributed two SVG maps which
          Bert Bos has internationalized
          (adding an English version to the original German text).

          Luan O'Carroll—Contributed
          the original WMF transcoder.

          Sheng Pei—Contributed
          to filter support and the regard tool.

          Neeme
            Praks—Contributed patches, feedback and scripts for
          building charts from John Morrisson's XSL stylesheets.

          Henri Ruini—Contributed to
          a rewrite of the rasterizer application.

          David
            Schweinsberg—Contributed the True Type Font to SVG Font
          converter.

          Eric Suen—Tracked
          down some memory leaks.

          Nicholas
            Talian—Contributed on gradients.

          Andres
            Toussaint—Contributed SVGAnimatedPathData functionality.

      <title>Areas of expertise</title>

        The following table summarizes the areas of expertise of each active
        committer. It allows better coordination of both internal and
        external development efforts.

            TD	CM	DH

            Team Contact
            X

            Bridge
            X

            Browser
            X

            CSS
            X	X

            Documentation
            X	X

            SVG DOM
            X

            GVT Core
            X

            GVT Filters
            X

            GVT Renderer
            X

            GVT Text
            X

            SVGGraphics2D
            X

            SMIL Animation
            X

            Micro Parsers
            X

            Rasterizer
            X

            Scripting
            X

            Swing Components
            X

            Test
            X	X

</document>


text:
package virtualmachine

import (
	"encoding/xml"
	"github.com/megamsys/opennebula-go/api"
	"strconv"
	"strings"
)

const (
	//VmState starts at 0
	INIT VmState = iota
	PENDING
	HOLD
	ACTIVE
	STOPPED
	SUSPENDED
	DONE
	UNKNOWNSTATE
	POWEROFF
	UNDEPLOYED
)

type Query struct {
	VMName string
	VMId   int
	T      *api.Rpc
}

type UserVMs struct {
	UserVM []*UserVM `xml:"VM"`
}

type UserVM struct {
	Id   int    `xml:"ID"`
	Uid  int    `xml:"UID"`
	Name string `xml:"NAME"`
}

type Vnc struct {
	VmId string
	T    *api.Rpc
	VM   *VM `xml:"VM"`
}

type VM struct {
	Id             string          `xml:"ID"`
	Name           string          `xml:"NAME"`
	State          int             `xml:"STATE"`
	LcmState       int             `xml:"LCM_STATE"`
	VmTemplate     *VmTemplate     `xml:"TEMPLATE"`
	UserTemplate   UserTemplate    `xml:"USER_TEMPLATE"`
	HistoryRecords *HistoryRecords `xml:"HISTORY_RECORDS"`
	Snapshots      *Snapshots      `xml:"SNAPSHOTS"`
}

type VmTemplate struct {
	Graphics *Graphics `xml:"GRAPHICS"`
	Context  *Context  `xml:"CONTEXT"`
	Nics     []Nic     `xml:"NIC"`
}

type Nic struct {
	Network   string `xml:"NETWORK"`
	Id        string `xml:"NIC_ID"`
	IPaddress string `xml:"IP"`
	Mac       string `xml:"MAC"`
}

type Context struct {
	VMIP string `xml:"ETH0_IP"`
}

type HistoryRecords struct {
	History *History `xml:"HISTORY"`
}
type History struct {
	HostName string `xml:"HOSTNAME"`
}

type Graphics struct {
	Port string `xml:"PORT"`
}

type UserTemplate struct {
	Description        string `xml:"DESCRIPTION"`
	Error              string `xml:"ERROR"`
	Sched_Requirements string `xml:"SCHED_REQUIREMENTS"`
}

type Snapshots struct {
	DiskId   int        `xml:"DISK_ID"`
	Snapshot []Snapshot `xml:"SNAPSHOT"`
}

type Snapshot struct {
	Name string `xml:"NAME"`
	Id   int    `xml:"ID"`
	Size string `xml:"SIZE"`
}

func (v *Vnc) GetVm() (*VM, error) {
	intstr, _ := strconv.Atoi(v.VmId)
	args := []interface{}{v.T.Key, intstr}
	onevm, err := v.T.Call(api.VM_INFO, args)
	if err != nil {
		return nil, err
	}

	xmlVM := &VM{}
	if err = xml.Unmarshal([]byte(onevm), xmlVM); err != nil {
		return nil, err
	}
	return xmlVM, err
}

//have to release hold ips
func (v *Vnc) AttachNic(network, ip string) error {
	var forceIp string
	id, _ := strconv.Atoi(v.VmId)
	if len(ip) > 0 {
		forceIp = ", IP=\"" + ip + "\""
	}
	nic := "NIC = [ NETWORK=\"" + network + "\", NETWORK_UNAME=\"oneadmin\"" + forceIp + "]"
	args := []interface{}{v.T.Key, id, nic}
	_, err := v.T.Call(api.ONE_VM_ATTACHNIC, args)
	return err
}

func (v *Vnc) DetachNic(nic int) error {
	id, _ := strconv.Atoi(v.VmId)
	args := []interface{}{v.T.Key, id, nic}
	_, err := v.T.Call(api.ONE_VM_DETACHNIC, args)
	return err
}

func (u *VM) GetPort() string {
	return u.VmTemplate.Graphics.Port
}

func (u *VM) GetState() int {
	return u.State
}

func (u *VM) GetLcmState() int {
	return u.LcmState
}

func (u *VM) GetHostIp() string {
	return u.HistoryRecords.History.HostName
}

func (u *VM) GetVMIP() string {
	return u.VmTemplate.Context.VMIP
}

func (v *VM) StateString() string {
	return VmStateString[VmState(v.State)]
}

func (v *VM) Nics() []Nic {
	return v.VmTemplate.Nics
}

func (v *VM) LenSnapshots() int {
	if v.Snapshots != nil {
		return len(v.Snapshots.Snapshot)
	}
	return 0
}

func (v *VM) NetworkIdByIP(ip string) string {
	for _, n := range v.VmTemplate.Nics {
		if ip == n.IPaddress {
			return n.Id
		}
	}
	return ""
}

func (v *VM) LcmStateString() string {
	return LcmStateString[LcmState(v.LcmState)]
}

func (v *VM) IsFailure() bool {
	return strings.Contains(v.LcmStateString(), "failure")
}

func (v *VM) IsSnapshotReady() bool {
	return (v.State == int(ACTIVE) && v.LcmState == int(RUNNING)) || (v.State == int(POWEROFF) && v.LcmState == int(LCM_INIT))
}

// Given a name, this function will return the VM
func (v *Query) GetByName() ([]*UserVM, error) {
	args := []interface{}{v.T.Key, -2, -1, -1, -1}
	VMPool, err := v.T.Call(api.VMPOOL_INFO, args)
	if err != nil {
		return nil, err
	}

	xmlVM := UserVMs{}
	if err = xml.Unmarshal([]byte(VMPool), &xmlVM); err != nil {
		return nil, err
	}
	var matchedVM = make([]*UserVM, len(xmlVM.UserVM))

	for _, u := range xmlVM.UserVM {
		if u.Name == v.VMName {
			matchedVM[0] = u
		}
	}

	return matchedVM, nil

}


text:
import React from 'react';
import axios from 'axios';
import QuakeMap from './QuakeMap'

const init_lng = 174.885971;
const init_lat = -40.900557;

export default class QuakeDetail extends React.Component {
    constructor(props) {
        super(props);

        this.state = {
            post: [],
            loading: true,
            error: null
        };
    }

    componentDidMount() {

        axios.get('https://api.geonet.org.nz/quake/' + this.props.publicID)
            .then(res => {
                const filterData = [];

                var posts = res.data.features.reduce((array, value) => {

                    let time = value.properties.time;

                    time = new Date(time);
                    time = time.toString().split('GMT')[0];
                    value.properties.time = time;
                    value.properties.magnitude = value.properties.magnitude.toFixed(1);
                    value.properties.depth = value.properties.depth.toFixed(1) + ' km';
                    array.push(value);

                    return array.slice(0, 10);
                }, filterData)

                this.setState({
                    posts,
                    loading: false,
                    error: null
                });
            })

            .catch(err => {
                this.setState({
                    loading: false,
                    error: err
                });
            });
    }

    renderLoading() {
        return
Loading...
;
    }

    renderError() {
        return (

                Uh oh: {this.state.error.message}

        );
    }

    renderPosts() {
        if (this.state.error) {
            return this.renderError();
        }

        return (

                    <QuakeMap type="DetailMap" mapInfo={this.state.posts} init_lat={init_lat} init_lng={init_lng}/>

                    {this.state.posts.map((post, index) =>

Quake-{this.props.publicID}

NZST

{post.properties.time}

Magnitude

 {post.properties.magnitude}

Depth

 {post.properties.depth}

Locality

 {post.properties.locality}

Latitude

 {parseFloat(post.geometry.coordinates[1]).toFixed(2)}

Longtitude

 {parseFloat(post.geometry.coordinates[0]).toFixed(2)}

                    )}

        );
    }

    render() {
        return (

{`${this.props.type}`}

                {this.state.loading ?
                    this.renderLoading()
                    : this.renderPosts()}

        );
    }
}


text:
from __future__ import unicode_literals

from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('profiles', '0009_remove_profile_location'),
    ]

    operations = [
        migrations.AddField(
            model_name='profile',
            name='location',
            field=models.CharField(blank=True, max_length=50, null=True),
        ),
    ]


text:
String.prototype.startsWith = function(text) {
  return this.substr(0, text.length) == text;
}

function parseURL(url) {
	var ret = {
		protocol: null,
		username: null,
		password: null,
		hostname: null,
		path: null,
		query: null,
		hash: null,
		toString: function() {
			return this.protocol + "://" +
				(this.username ? this.username +
				(this.password ? ":" + this.password : "") + "@" : "") +
				this.hostname +
				this.path +
				(this.query ? "?" + this.query : "") +
				(this.hash ? "#" + this.hash : "");
		}
	};

	var endOfProtocol = url.indexOf(":");
	if (endOfProtocol > -1) {
		ret.protocol = url.substr(0, endOfProtocol);
		url = url.substr(endOfProtocol + 1);
	}

	if (url.substr(0, 2) == "//") {
		url = url.substr(2);
	} else if (url.substr(0, 1) == "/") {
		url = url.substr(1);
	}

	var afterHostname = url.indexOf("/");
	if (afterHostname == -1) {
		afterHostname = url.length;
	}
	var hostname = url.substr(0, afterHostname == -1 ? url.length : afterHostname);
	url = url.substr(afterHostname);

	var beforeHostname = hostname.lastIndexOf("@");
	ret.hostname = hostname.substr(beforeHostname + 1);
	if (beforeHostname > -1) {
		hostname = hostname.substr(0, beforeHostname);
		var beforePassword = hostname.indexOf(":");
		if (beforePassword > -1) {
			ret.username = hostname.substr(0, beforePassword);
			ret.password = hostname.substr(beforePassword + 1);
		} else {
			ret.username = hostname;
		}
	}

	var beforeQuery = url.indexOf("?");
	if (beforeQuery > -1) {
		ret.path = url.substr(0, beforeQuery);
		url = url.substr(beforeQuery + 1);

		var beforeHash = url.indexOf("#");
		if (beforeHash > -1) {
			ret.query = url.substr(0, beforeHash);
			ret.hash = url.substr(beforeHash + 1);
		} else {
			ret.query = url;
		}
	} else {
		var beforeHash = url.indexOf("#");
		if (beforeHash > -1) {
			ret.path = url.substr(0, beforeHash);
			ret.hash = url.substr(beforeHash + 1);
		} else {
			ret.path = url;
		}
	}

	return ret;
}

function transformLinks(e) {
	removeListeners();

	var element = e.target;
	if (element.nodeName.toLowerCase() == "a") {
		checkLink(element);
	}
	if (element.getElementsByTagName) {
		var a = element.getElementsByTagName("a");
		for (var i = a.length; i--; ) {
			checkLink(a[i]);
		}
	}

	addListeners();
}

function checkLink(link) {
	var text = link.textContent.toLowerCase().replace(" ", "");
	var href = link.href.toLowerCase().replace(" ", "");

	if (text === href) {
		return;
	}

	if (text.indexOf("://") == -1 || href.indexOf("://") == -1) {
		return;
	}

	text = parseURL(text);
	href = parseURL(href);

	if ((text.protocol != "http" && text.protocol != "https") || !text.hostname) {
		return;
	}
	if ((href.protocol != "http" && href.protocol != "https") || !href.hostname) {
		return;
	}

	if (text.hostname == href.hostname && text.username == href.username &&
		text.password == href.password) {

		return;
	}

	// Temp whitelist
	if (href.hostname == "i.imgur.com") {
		return;
	}

	link.href = chrome.extension.getURL("/warning.html#text=" +
		encodeURIComponent(link.textContent) + "&href=" + encodeURIComponent(link.href));
}

function addListeners() {
	// These two don't seem to work
	//document.addEventListener("DOMAttrModified", transformLinks, false);
	//document.addEventListener("DOMNodeInsertedIntoDocument", transformLinks, false);
	document.addEventListener("DOMSubtreeModified", transformLinks, false);
}

function removeListeners() {
	document.removeEventListener("DOMSubtreeModified", transformLinks, false);
}

document.addEventListener("load", transformLinks, false);
addListeners();
transformLinks({target: document});


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>Source code</title>
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

001
002
007
008package org.jsimpledb.core;
009
010import java.util.NavigableSet;
011
012/**
013 * Listener interface for notifications of a change in value of a {@link MapField}.
014 *
015 * @see Transaction#addMapFieldChangeListener Transaction.addMapFieldChangeListener()
016 */
017public interface MapFieldChangeListener {
018
019    /**
020     * Receive notification of the addition of a new key/value pair into a {@link MapField}.
021     *
022     * <p>
023     * Notifications are only delivered when the set of referring objects is non-empty.
024     * </p>
025     *
026     * <p>
027     * Notifications are delivered in the same thread that made the change, before the outermost mutation operation returns.
028     * </p>
029     *
030     * @param tx associated transaction
031     * @param id the ID of the affected object (i.e., the object containing the field that changed)
032     * @param field the field that changed
033     * @param path path of reference fields (represented by storage IDs) that lead to {@code id}
034     * @param referrers all objects that (indirectly) refer to the affected object via {@code path}
035     * @param key the new map entry's key
036     * @param value the new map entry's value
037     * @param <K> Java type for {@code field}'s keys
038     * @param <V> Java type for {@code field}'s values
039     */
040    <K, V> void onMapFieldAdd(Transaction tx, ObjId id, MapField<K, V> field,
041      int[] path, NavigableSet<ObjId> referrers, K key, V value);
042
043    /**
044     * Receive notification of the removal of an entry from a {@link MapField}.
045     *
046     * <p>
047     * Notifications are only delivered when the set of referring objects is non-empty.
048     * </p>
049     *
050     * <p>
051     * Notifications are delivered in the same thread that made the change, before the outermost mutation operation returns.
052     * </p>
053     *
054     * @param tx associated transaction
055     * @param id the ID of the affected object (i.e., the object containing the field that changed)
056     * @param field the field that changed
057     * @param path path of reference fields (represented by storage IDs) that lead to {@code id}
058     * @param referrers all objects that (indirectly) refer to the affected object via {@code path}
059     * @param key the removed map entry's key
060     * @param value the removed map entry's value
061     * @param <K> Java type for {@code field}'s keys
062     * @param <V> Java type for {@code field}'s values
063     */
064    <K, V> void onMapFieldRemove(Transaction tx, ObjId id, MapField<K, V> field,
065      int[] path, NavigableSet<ObjId> referrers, K key, V value);
066
067    /**
068     * Receive notification of the change in value of an existing entry in a {@link MapField}.
069     *
070     * <p>
071     * Notifications are only delivered when the set of referring objects is non-empty.
072     * </p>
073     *
074     * <p>
075     * Notifications are delivered in the same thread that made the change, before the outermost mutation operation returns.
076     * </p>
077     *
078     * @param tx associated transaction
079     * @param id the ID of the affected object (i.e., the object containing the field that changed)
080     * @param field the field that changed
081     * @param path path of reference fields (represented by storage IDs) that lead to {@code id}
082     * @param referrers all objects that (indirectly) refer to the affected object via {@code path}
083     * @param key the map entry key
084     * @param oldValue the previous value associated with {@code key}
085     * @param newValue the new value associated with {@code key}
086     * @param <K> Java type for {@code field}'s keys
087     * @param <V> Java type for {@code field}'s values
088     */
089    <K, V> void onMapFieldReplace(Transaction tx, ObjId id, MapField<K, V> field,
090      int[] path, NavigableSet<ObjId> referrers, K key, V oldValue, V newValue);
091
092    /**
093     * Receive notification of the clearing of a {@link MapField}.
094     *
095     * <p>
096     * This method is only used when the whole map is cleared; when a range restricted submap is cleared, individual
097     * {@linkplain #onMapFieldRemove onMapFieldRemove()} invocations for each removed entry are made instead.
098     * </p>
099     *
100     * <p>
101     * Notifications are only delivered when the set of referring objects is non-empty.
102     * </p>
103     *
104     * <p>
105     * Notifications are delivered in the same thread that made the change, before the outermost mutation operation returns.
106     * </p>
107     *
108     * @param tx associated transaction
109     * @param id the ID of the affected object (i.e., the object containing the field that was cleared)
110     * @param field the field that changed
111     * @param path path of reference fields (represented by storage IDs) that lead to {@code id}
112     * @param referrers all objects that (indirectly) refer to the affected object via {@code path}
113     */
114    void onMapFieldClear(Transaction tx, ObjId id, MapField<?, ?> field, int[] path, NavigableSet<ObjId> referrers);
115}
116


text:
/**
 * @author Alexander Ivanov
 * @version 1.0
 * @since 25.12.2017
 */
package ru.job4j.repository.factoryrepo;