code
stringlengths 3
1.05M
| repo_name
stringlengths 4
116
| path
stringlengths 3
942
| language
stringclasses 30
values | license
stringclasses 15
values | size
int32 3
1.05M
|
---|---|---|---|---|---|
package com.fantasy.lulutong.activity.me;
import android.os.Bundle;
import android.view.View;
import android.widget.RelativeLayout;
import com.fantasy.lulutong.R;
import com.fantasy.lulutong.activity.BaseActivity;
/**
* “注册”的页面
* @author Fantasy
* @version 1.0, 2017-02-
*/
public class RegisterActivity extends BaseActivity {
private RelativeLayout relativeBack;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layout_register);
relativeBack = (RelativeLayout) findViewById(R.id.relative_register_back);
relativeBack.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
}
}
| FantasyLWX/LuLuTong | app/src/main/java/com/fantasy/lulutong/activity/me/RegisterActivity.java | Java | apache-2.0 | 863 |
package com.blackducksoftware.integration.hub.detect.tool.bazel;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.ArrayList;
import java.util.List;
import org.junit.jupiter.api.Test;
public class BazelVariableSubstitutorTest {
@Test
public void testTargetOnly() {
BazelVariableSubstitutor substitutor = new BazelVariableSubstitutor("//foo:foolib");
final List<String> origArgs = new ArrayList<>();
origArgs.add("query");
origArgs.add("filter(\"@.*:jar\", deps(${detect.bazel.target}))");
final List<String> adjustedArgs = substitutor.substitute(origArgs);
assertEquals(2, adjustedArgs.size());
assertEquals("query", adjustedArgs.get(0));
assertEquals("filter(\"@.*:jar\", deps(//foo:foolib))", adjustedArgs.get(1));
}
@Test
public void testBoth() {
BazelVariableSubstitutor substitutor = new BazelVariableSubstitutor("//foo:foolib", "//external:org_apache_commons_commons_io");
final List<String> origArgs = new ArrayList<>();
origArgs.add("query");
origArgs.add("filter(\"@.*:jar\", deps(${detect.bazel.target}))");
origArgs.add("kind(maven_jar, ${detect.bazel.target.dependency})");
final List<String> adjustedArgs = substitutor.substitute(origArgs);
assertEquals(3, adjustedArgs.size());
assertEquals("query", adjustedArgs.get(0));
assertEquals("filter(\"@.*:jar\", deps(//foo:foolib))", adjustedArgs.get(1));
assertEquals("kind(maven_jar, //external:org_apache_commons_commons_io)", adjustedArgs.get(2));
}
}
| blackducksoftware/hub-detect | hub-detect/src/test/groovy/com/blackducksoftware/integration/hub/detect/tool/bazel/BazelVariableSubstitutorTest.java | Java | apache-2.0 | 1,618 |
package com.dyhpoon.fodex.navigationDrawer;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import com.dyhpoon.fodex.R;
/**
* Created by darrenpoon on 3/2/15.
*/
public class NavigationDrawerAdapter extends SectionAdapter {
private Context mContext;
public class ViewType {
public static final int PROFILE = 0;
public static final int WHITESPACE = 1;
public static final int PAGE = 2;
public static final int DIVIDER = 3;
public static final int UTILITY = 4;
}
public NavigationDrawerAdapter(Context context) {
mContext = context;
}
@Override
public int getSectionCount() {
return 5; // all view types
}
@Override
public Boolean isSectionEnabled(int section) {
switch (section) {
case ViewType.PROFILE:
return false;
case ViewType.WHITESPACE:
return false;
case ViewType.PAGE:
return true;
case ViewType.DIVIDER:
return false;
case ViewType.UTILITY:
return true;
default:
throw new IllegalArgumentException(
"Unhandled section number in navigation drawer adapter, found: " + section);
}
}
@Override
public int getViewCountAtSection(int section) {
switch (section) {
case ViewType.PROFILE:
return 1;
case ViewType.WHITESPACE:
return 1;
case ViewType.PAGE:
return NavigationDrawerData.getPageItems(mContext).size();
case ViewType.DIVIDER:
return 1;
case ViewType.UTILITY:
return NavigationDrawerData.getUtilityItems(mContext).size();
default:
throw new IllegalArgumentException(
"Unhandled section number in navigation drawer adapter, found: " + section);
}
}
@Override
public View getView(int section, int position, View convertView, ViewGroup parent) {
switch (section) {
case 0:
convertView = inflateProfile(convertView);
break;
case 1:
convertView = inflateWhiteSpace(convertView);
break;
case 2:
convertView = inflatePageItem(convertView, position);
break;
case 3:
convertView = inflateListDivider(convertView);
break;
case 4:
convertView = inflateUtilityItem(convertView, position);
break;
default:
throw new IllegalArgumentException(
"Unhandled section/position number in navigation drawer adapter, " +
"found section: " + section + " position: " + position);
}
return convertView;
}
private View inflateProfile(View convertView) {
if (convertView == null) {
convertView = View.inflate(mContext, R.layout.list_item_profile, null);
}
return convertView;
}
private View inflateWhiteSpace(View convertView) {
if (convertView == null) {
convertView = View.inflate(mContext, R.layout.list_item_whitespace, null);
}
return convertView;
}
private View inflatePageItem(View convertView, int position) {
if (convertView == null) {
convertView = new NavigationDrawerItem(mContext);
}
NavigationDrawerInfo info = NavigationDrawerData.getPageItem(mContext, position);
((NavigationDrawerItem)convertView).iconImageView.setImageDrawable(info.drawable);
((NavigationDrawerItem)convertView).titleTextView.setText(info.title);
return convertView;
}
private View inflateUtilityItem(View convertView, int position) {
if (convertView == null) {
convertView = new NavigationDrawerItem(mContext);
}
NavigationDrawerInfo info = NavigationDrawerData.getUtilityItem(mContext, position);
((NavigationDrawerItem)convertView).iconImageView.setImageDrawable(info.drawable);
((NavigationDrawerItem)convertView).titleTextView.setText(info.title);
return convertView;
}
private View inflateListDivider(View convertView) {
if (convertView == null) {
convertView = View.inflate(mContext, R.layout.list_item_divider, null);
}
return convertView;
}
}
| dyhpoon/Fo.dex | app/src/main/java/com/dyhpoon/fodex/navigationDrawer/NavigationDrawerAdapter.java | Java | apache-2.0 | 4,636 |
// Copyright (c) 2021 Tigera, Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package cachingmap
import (
"fmt"
"testing"
. "github.com/onsi/gomega"
"github.com/sirupsen/logrus"
"github.com/projectcalico/felix/bpf"
"github.com/projectcalico/felix/bpf/mock"
"github.com/projectcalico/felix/logutils"
)
func init() {
logutils.ConfigureEarlyLogging()
logrus.SetLevel(logrus.DebugLevel)
}
var cachingMapParams = bpf.MapParameters{
Name: "mock-map",
KeySize: 2,
ValueSize: 4,
}
// TestCachingMap_Empty verifies loading of an empty map with no changes queued.
func TestCachingMap_Empty(t *testing.T) {
mockMap, cm := setupCachingMapTest(t)
err := cm.ApplyAllChanges()
Expect(err).NotTo(HaveOccurred())
Expect(mockMap.Contents).To(BeEmpty())
}
var ErrFail = fmt.Errorf("fail")
// TestCachingMap_Errors tests returning of errors from the underlying map.
func TestCachingMap_Errors(t *testing.T) {
mockMap, cm := setupCachingMapTest(t)
mockMap.IterErr = ErrFail
err := cm.ApplyAllChanges()
Expect(err).To(HaveOccurred())
// Failure should have cleared the cache again so next Apply should see this new entry.
mockMap.Contents = map[string]string{
string([]byte{1, 1}): string([]byte{1, 2, 4, 3}),
}
mockMap.IterErr = nil
err = cm.ApplyAllChanges()
Expect(err).NotTo(HaveOccurred())
Expect(mockMap.Contents).To(BeEmpty())
// Now check errors on update
cm.SetDesired([]byte{1, 1}, []byte{1, 2, 4, 4})
mockMap.UpdateErr = ErrFail
err = cm.ApplyAllChanges()
Expect(err).To(HaveOccurred())
// And then success
mockMap.UpdateErr = nil
err = cm.ApplyAllChanges()
Expect(err).NotTo(HaveOccurred())
Expect(mockMap.Contents).To(Equal(map[string]string{
string([]byte{1, 1}): string([]byte{1, 2, 4, 4}),
}))
// And delete.
mockMap.DeleteErr = ErrFail
cm.DeleteAllDesired()
err = cm.ApplyAllChanges()
Expect(err).To(HaveOccurred())
mockMap.DeleteErr = nil
err = cm.ApplyAllChanges()
Expect(err).NotTo(HaveOccurred())
Expect(mockMap.Contents).To(BeEmpty())
}
// TestCachingMap_CleanUp verifies cleaning up of a whole map.
func TestCachingMap_CleanUp(t *testing.T) {
mockMap, cm := setupCachingMapTest(t)
_ = mockMap.Update([]byte{1, 2}, []byte{1, 2, 3, 4})
_ = mockMap.Update([]byte{1, 3}, []byte{1, 2, 4, 4})
err := cm.ApplyAllChanges()
Expect(err).NotTo(HaveOccurred())
Expect(mockMap.Contents).To(BeEmpty())
}
// TestCachingMap_ApplyAll mainline test using separate Apply calls for adds and deletes.
func TestCachingMap_SplitUpdateAndDelete(t *testing.T) {
mockMap, cm := setupCachingMapTest(t)
mockMap.Contents = map[string]string{
string([]byte{1, 1}): string([]byte{1, 2, 4, 3}),
string([]byte{1, 2}): string([]byte{1, 2, 3, 4}),
string([]byte{1, 3}): string([]byte{1, 2, 4, 4}),
}
cm.SetDesired([]byte{1, 1}, []byte{1, 2, 4, 3}) // Same value for existing key.
cm.SetDesired([]byte{1, 2}, []byte{1, 2, 3, 6}) // New value for existing key.
cm.SetDesired([]byte{1, 4}, []byte{1, 2, 3, 5}) // New K/V
// Shouldn't do anything until we hit apply.
Expect(mockMap.OpCount()).To(Equal(0))
err := cm.ApplyUpdatesOnly()
Expect(err).NotTo(HaveOccurred())
Expect(mockMap.Contents).To(Equal(map[string]string{
string([]byte{1, 1}): string([]byte{1, 2, 4, 3}), // No change
string([]byte{1, 2}): string([]byte{1, 2, 3, 6}), // Updated
string([]byte{1, 3}): string([]byte{1, 2, 4, 4}), // Not desired but should be left alone
string([]byte{1, 4}): string([]byte{1, 2, 3, 5}), // Added
}))
// Two updates and an iteration to load the map initially.
Expect(mockMap.UpdateCount).To(Equal(2))
Expect(mockMap.DeleteCount).To(Equal(0))
Expect(mockMap.GetCount).To(Equal(0))
Expect(mockMap.IterCount).To(Equal(1))
err = cm.ApplyDeletionsOnly()
Expect(err).NotTo(HaveOccurred())
Expect(mockMap.Contents).To(Equal(map[string]string{
string([]byte{1, 1}): string([]byte{1, 2, 4, 3}),
string([]byte{1, 2}): string([]byte{1, 2, 3, 6}),
string([]byte{1, 4}): string([]byte{1, 2, 3, 5}),
}))
// No new updates or iterations but should get one extra deletion.
Expect(mockMap.UpdateCount).To(Equal(2))
Expect(mockMap.GetCount).To(Equal(0))
Expect(mockMap.DeleteCount).To(Equal(1))
Expect(mockMap.IterCount).To(Equal(1))
// Doing an extra apply should make no changes.
preApplyOpCount := mockMap.OpCount()
err = cm.ApplyAllChanges()
Expect(err).NotTo(HaveOccurred())
Expect(mockMap.OpCount()).To(Equal(preApplyOpCount))
}
// TestCachingMap_ApplyAll mainline test using ApplyAll() to update the dataplane.
func TestCachingMap_ApplyAll(t *testing.T) {
mockMap, cm := setupCachingMapTest(t)
mockMap.Contents = map[string]string{
string([]byte{1, 1}): string([]byte{1, 2, 4, 3}),
string([]byte{1, 2}): string([]byte{1, 2, 3, 4}),
string([]byte{1, 3}): string([]byte{1, 2, 4, 4}),
}
cm.SetDesired([]byte{1, 1}, []byte{1, 2, 4, 3}) // Same value for existing key.
cm.SetDesired([]byte{1, 2}, []byte{1, 2, 3, 6}) // New value for existing key.
cm.SetDesired([]byte{1, 4}, []byte{1, 2, 3, 5}) // New K/V
// Shouldn't do anything until we hit apply.
Expect(mockMap.OpCount()).To(Equal(0))
err := cm.ApplyAllChanges()
Expect(err).NotTo(HaveOccurred())
Expect(mockMap.Contents).To(Equal(map[string]string{
string([]byte{1, 1}): string([]byte{1, 2, 4, 3}),
string([]byte{1, 2}): string([]byte{1, 2, 3, 6}),
string([]byte{1, 4}): string([]byte{1, 2, 3, 5}),
}))
// Two updates and an iteration to load the map initially.
Expect(mockMap.UpdateCount).To(Equal(2))
Expect(mockMap.DeleteCount).To(Equal(1))
Expect(mockMap.GetCount).To(Equal(0))
Expect(mockMap.IterCount).To(Equal(1))
// Doing an extra apply should make no changes.
preApplyOpCount := mockMap.OpCount()
err = cm.ApplyAllChanges()
Expect(err).NotTo(HaveOccurred())
Expect(mockMap.OpCount()).To(Equal(preApplyOpCount))
// Finish with a DeleteAll()
cm.DeleteAllDesired()
Expect(mockMap.OpCount()).To(Equal(preApplyOpCount)) // No immediate change
err = cm.ApplyAllChanges()
Expect(err).NotTo(HaveOccurred())
Expect(mockMap.Contents).To(BeEmpty())
Expect(mockMap.DeleteCount).To(Equal(4))
err = cm.ApplyAllChanges()
Expect(err).NotTo(HaveOccurred())
Expect(mockMap.Contents).To(BeEmpty())
Expect(mockMap.DeleteCount).To(Equal(4))
}
// TestCachingMap_DeleteBeforeLoad does some set and delete calls before loading from
// the dataplane.
func TestCachingMap_DeleteBeforeLoad(t *testing.T) {
mockMap, cm := setupCachingMapTest(t)
mockMap.Contents = map[string]string{
string([]byte{1, 1}): string([]byte{1, 2, 4, 3}),
string([]byte{1, 2}): string([]byte{1, 2, 3, 4}),
string([]byte{1, 3}): string([]byte{1, 2, 4, 4}),
}
cm.SetDesired([]byte{1, 1}, []byte{1, 2, 4, 3}) // Same value for existing key.
cm.SetDesired([]byte{1, 2}, []byte{1, 2, 3, 6}) // New value for existing key.
cm.SetDesired([]byte{1, 4}, []byte{1, 2, 3, 5}) // New K/V
cm.DeleteDesired([]byte{1, 2}) // Changed my mind.
cm.DeleteDesired([]byte{1, 4}) // Changed my mind.
cm.DeleteDesired([]byte{1, 8}) // Delete of non-existent key is a no-op.
// Shouldn't do anything until we hit apply.
Expect(mockMap.OpCount()).To(Equal(0))
err := cm.ApplyAllChanges()
Expect(err).NotTo(HaveOccurred())
Expect(mockMap.Contents).To(Equal(map[string]string{
string([]byte{1, 1}): string([]byte{1, 2, 4, 3}),
}))
// Just the two deletes.
Expect(mockMap.UpdateCount).To(Equal(0))
Expect(mockMap.DeleteCount).To(Equal(2))
Expect(mockMap.GetCount).To(Equal(0))
Expect(mockMap.IterCount).To(Equal(1))
// Doing an extra apply should make no changes.
preApplyOpCount := mockMap.OpCount()
err = cm.ApplyAllChanges()
Expect(err).NotTo(HaveOccurred())
Expect(mockMap.OpCount()).To(Equal(preApplyOpCount))
}
// TestCachingMap_PreLoad verifies calling LoadCacheFromDataplane before setting values.
func TestCachingMap_PreLoad(t *testing.T) {
mockMap, cm := setupCachingMapTest(t)
mockMap.Contents = map[string]string{
string([]byte{1, 1}): string([]byte{1, 2, 4, 3}),
string([]byte{1, 2}): string([]byte{1, 2, 3, 4}),
string([]byte{1, 3}): string([]byte{1, 2, 4, 4}),
}
err := cm.LoadCacheFromDataplane()
Expect(err).NotTo(HaveOccurred())
Expect(mockMap.IterCount).To(Equal(1))
Expect(mockMap.OpCount()).To(Equal(1))
// Check we can query the cache.
Expect(cm.GetDataplaneCache([]byte{1, 1})).To(Equal([]byte{1, 2, 4, 3}))
seenValues := make(map[string]string)
cm.IterDataplaneCache(func(k, v []byte) {
seenValues[string(k)] = string(v)
})
Expect(seenValues).To(Equal(mockMap.Contents))
cm.SetDesired([]byte{1, 1}, []byte{1, 2, 4, 3}) // Same value for existing key.
cm.SetDesired([]byte{1, 2}, []byte{1, 2, 3, 6}) // New value for existing key.
cm.SetDesired([]byte{1, 4}, []byte{1, 2, 3, 5}) // New K/V
cm.DeleteDesired([]byte{1, 8}) // Delete of non-existent key is a no-op.
err = cm.ApplyAllChanges()
Expect(err).NotTo(HaveOccurred())
Expect(mockMap.Contents).To(Equal(map[string]string{
string([]byte{1, 1}): string([]byte{1, 2, 4, 3}),
string([]byte{1, 2}): string([]byte{1, 2, 3, 6}),
string([]byte{1, 4}): string([]byte{1, 2, 3, 5}),
}))
// Two updates and an iteration to load the map initially.
Expect(mockMap.UpdateCount).To(Equal(2))
Expect(mockMap.DeleteCount).To(Equal(1))
Expect(mockMap.GetCount).To(Equal(0))
Expect(mockMap.IterCount).To(Equal(1))
// Doing an extra apply should make no changes.
preApplyOpCount := mockMap.OpCount()
err = cm.ApplyAllChanges()
Expect(err).NotTo(HaveOccurred())
Expect(mockMap.OpCount()).To(Equal(preApplyOpCount))
}
// TestCachingMap_Resync verifies handling of a dataplane reload while there are pending
// changes. Pending changes should be dropped if the reload finds that they've already
// been made.
func TestCachingMap_Resync(t *testing.T) {
mockMap, cm := setupCachingMapTest(t)
mockMap.Contents = map[string]string{
string([]byte{1, 1}): string([]byte{1, 2, 4, 3}),
string([]byte{1, 2}): string([]byte{1, 2, 3, 4}),
string([]byte{1, 3}): string([]byte{1, 2, 4, 4}),
}
err := cm.LoadCacheFromDataplane()
Expect(err).NotTo(HaveOccurred())
Expect(mockMap.IterCount).To(Equal(1))
Expect(mockMap.OpCount()).To(Equal(1))
cm.SetDesired([]byte{1, 1}, []byte{1, 2, 4, 3}) // Same value for existing key.
cm.SetDesired([]byte{1, 2}, []byte{1, 2, 3, 6}) // New value for existing key.
cm.SetDesired([]byte{1, 4}, []byte{1, 2, 3, 5}) // New K/V
// At this point we've got some updates and a deletion queued up. Change the contents
// of the map:
// - Remove the key that was already correct.
// - Remove the key that we were about to delete.
// - Correct the value of the other key.
mockMap.Contents = map[string]string{
string([]byte{1, 2}): string([]byte{1, 2, 3, 6}),
}
err = cm.LoadCacheFromDataplane()
Expect(err).NotTo(HaveOccurred())
err = cm.ApplyAllChanges()
Expect(err).NotTo(HaveOccurred())
Expect(mockMap.Contents).To(Equal(map[string]string{
string([]byte{1, 1}): string([]byte{1, 2, 4, 3}),
string([]byte{1, 2}): string([]byte{1, 2, 3, 6}),
string([]byte{1, 4}): string([]byte{1, 2, 3, 5}),
}))
// Two updates and an iteration to load the map initially.
Expect(mockMap.UpdateCount).To(Equal(2))
Expect(mockMap.DeleteCount).To(Equal(0))
Expect(mockMap.GetCount).To(Equal(0))
Expect(mockMap.IterCount).To(Equal(2))
// Doing an extra apply should make no changes.
preApplyOpCount := mockMap.OpCount()
err = cm.ApplyAllChanges()
Expect(err).NotTo(HaveOccurred())
Expect(mockMap.OpCount()).To(Equal(preApplyOpCount))
}
func setupCachingMapTest(t *testing.T) (*mock.Map, *CachingMap) {
RegisterTestingT(t)
mockMap := mock.NewMockMap(cachingMapParams)
cm := New(cachingMapParams, mockMap)
return mockMap, cm
}
func TestByteArrayToByteArrayMap(t *testing.T) {
RegisterTestingT(t)
m := NewByteArrayToByteArrayMap(2, 4)
Expect(m.Get([]byte{1, 2})).To(BeNil(), "New map should not contain a value")
m.Set([]byte{1, 2}, []byte{1, 2, 3, 4})
Expect(m.Get([]byte{1, 2})).To(Equal([]byte{1, 2, 3, 4}), "Map should contain set value")
m.Set([]byte{1, 2}, []byte{1, 2, 3, 5})
Expect(m.Get([]byte{1, 2})).To(Equal([]byte{1, 2, 3, 5}), "Map should record updates")
m.Set([]byte{3, 4}, []byte{1, 2, 3, 6})
Expect(m.Get([]byte{3, 4})).To(Equal([]byte{1, 2, 3, 6}), "Map should record updates")
seenValues := map[string][]byte{}
m.Iter(func(k, v []byte) {
Expect(k).To(HaveLen(2))
Expect(v).To(HaveLen(4))
vCopy := make([]byte, len(v))
copy(vCopy, v)
seenValues[string(k)] = vCopy
})
Expect(seenValues).To(Equal(map[string][]byte{
string([]byte{1, 2}): {1, 2, 3, 5},
string([]byte{3, 4}): {1, 2, 3, 6},
}))
m.Delete([]byte{1, 2})
Expect(m.Get([]byte{1, 2})).To(BeNil(), "Deletion should remove the value")
}
| neiljerram/felix | bpf/cachingmap/caching_map_test.go | GO | apache-2.0 | 13,257 |
# frozen_string_literal: true
# Copyright 2015 Australian National Botanic Gardens
#
# This file is part of the NSL Editor.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
require "test_helper"
# Single controller test.
class ReferencesesUpdateIsoPartialDayOnlyTest < ActionController::TestCase
tests ReferencesController
test "update reference iso partial day only test" do
@request.headers["Accept"] = "application/javascript"
patch(:update,
{ id: references(:simple).id,
reference: { "ref_type_id" => ref_types(:book),
"title" => "Some book",
"author_id" => authors(:dash),
"author_typeahead" => "-",
"published" => true,
"ref_author_role_id" => ref_author_roles(:author),
"day" => '2' } },
username: "fred",
user_full_name: "Fred Jones",
groups: ["edit"])
assert_response :unprocessable_entity
assert_match(/Day entered but no month/,
response.body.to_s,
"Missing or incorrect error message")
end
end
| bio-org-au/nsl-editor | test/controllers/references/edit/iso_publication_date/partial_date/day_only_test.rb | Ruby | apache-2.0 | 1,697 |
/**
* This class hierarchy was generated from the Yang module hcta-epc
* by the <a target="_top" href="https://github.com/tail-f-systems/JNC">JNC</a> plugin of <a target="_top" href="http://code.google.com/p/pyang/">pyang</a>.
* The generated classes may be used to manipulate pieces of configuration data
* with NETCONF operations such as edit-config, delete-config and lock. These
* operations are typically accessed through the JNC Java library by
* instantiating Device objects and setting up NETCONF sessions with real
* devices using a compatible YANG model.
* <p>
* @see <a target="_top" href="https://github.com/tail-f-systems/JNC">JNC project page</a>
* @see <a target="_top" href="ftp://ftp.rfc-editor.org/in-notes/rfc6020.txt">RFC 6020: YANG - A Data Modeling Language for the Network Configuration Protocol (NETCONF)</a>
* @see <a target="_top" href="ftp://ftp.rfc-editor.org/in-notes/rfc6241.txt">RFC 6241: Network Configuration Protocol (NETCONF)</a>
* @see <a target="_top" href="ftp://ftp.rfc-editor.org/in-notes/rfc6242.txt">RFC 6242: Using the NETCONF Protocol over Secure Shell (SSH)</a>
* @see <a target="_top" href="http://www.tail-f.com">Tail-f Systems</a>
*/
package hctaEpc.mmeSgsn.interface_.ge; | jnpr-shinma/yangfile | hitel/src/hctaEpc/mmeSgsn/interface_/ge/package-info.java | Java | apache-2.0 | 1,235 |
# Copyright 2014 Rackspace Hosting
# Copyright 2014 Hewlett-Packard Development Company, L.P.
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import uuid
from mock import Mock, patch
from trove.backup import models as backup_models
from trove.common import cfg
from trove.common import exception
from trove.common.instance import ServiceStatuses
from trove.datastore import models as datastore_models
from trove.instance import models
from trove.instance.models import DBInstance
from trove.instance.models import filter_ips
from trove.instance.models import Instance
from trove.instance.models import InstanceServiceStatus
from trove.instance.models import SimpleInstance
from trove.instance.tasks import InstanceTasks
from trove.taskmanager import api as task_api
from trove.tests.fakes import nova
from trove.tests.unittests import trove_testtools
from trove.tests.unittests.util import util
CONF = cfg.CONF
class SimpleInstanceTest(trove_testtools.TestCase):
def setUp(self):
super(SimpleInstanceTest, self).setUp()
db_info = DBInstance(
InstanceTasks.BUILDING, name="TestInstance")
self.instance = SimpleInstance(
None, db_info, InstanceServiceStatus(
ServiceStatuses.BUILDING), ds_version=Mock(), ds=Mock())
db_info.addresses = {"private": [{"addr": "123.123.123.123"}],
"internal": [{"addr": "10.123.123.123"}],
"public": [{"addr": "15.123.123.123"}]}
self.orig_conf = CONF.network_label_regex
self.orig_ip_regex = CONF.ip_regex
self.orig_black_list_regex = CONF.black_list_regex
def tearDown(self):
super(SimpleInstanceTest, self).tearDown()
CONF.network_label_regex = self.orig_conf
CONF.ip_start = None
def test_get_root_on_create(self):
root_on_create_val = Instance.get_root_on_create(
'redis')
self.assertFalse(root_on_create_val)
def test_filter_ips_white_list(self):
CONF.network_label_regex = '.*'
CONF.ip_regex = '^(15.|123.)'
CONF.black_list_regex = '^10.123.123.*'
ip = self.instance.get_visible_ip_addresses()
ip = filter_ips(
ip, CONF.ip_regex, CONF.black_list_regex)
self.assertEqual(2, len(ip))
self.assertTrue('123.123.123.123' in ip)
self.assertTrue('15.123.123.123' in ip)
def test_filter_ips_black_list(self):
CONF.network_label_regex = '.*'
CONF.ip_regex = '.*'
CONF.black_list_regex = '^10.123.123.*'
ip = self.instance.get_visible_ip_addresses()
ip = filter_ips(
ip, CONF.ip_regex, CONF.black_list_regex)
self.assertEqual(2, len(ip))
self.assertTrue('10.123.123.123' not in ip)
def test_one_network_label(self):
CONF.network_label_regex = 'public'
ip = self.instance.get_visible_ip_addresses()
self.assertEqual(['15.123.123.123'], ip)
def test_two_network_labels(self):
CONF.network_label_regex = '^(private|public)$'
ip = self.instance.get_visible_ip_addresses()
self.assertEqual(2, len(ip))
self.assertTrue('123.123.123.123' in ip)
self.assertTrue('15.123.123.123' in ip)
def test_all_network_labels(self):
CONF.network_label_regex = '.*'
ip = self.instance.get_visible_ip_addresses()
self.assertEqual(3, len(ip))
self.assertTrue('10.123.123.123' in ip)
self.assertTrue('123.123.123.123' in ip)
self.assertTrue('15.123.123.123' in ip)
class CreateInstanceTest(trove_testtools.TestCase):
@patch.object(task_api.API, 'get_client', Mock(return_value=Mock()))
def setUp(self):
util.init_db()
self.context = trove_testtools.TroveTestContext(self, is_admin=True)
self.name = "name"
self.flavor_id = 5
self.image_id = "UUID"
self.databases = []
self.users = []
self.datastore = datastore_models.DBDatastore.create(
id=str(uuid.uuid4()),
name='mysql' + str(uuid.uuid4()),
)
self.datastore_version = (
datastore_models.DBDatastoreVersion.create(
id=str(uuid.uuid4()),
datastore_id=self.datastore.id,
name="5.5" + str(uuid.uuid4()),
manager="mysql",
image_id="image_id",
packages="",
active=True))
self.volume_size = 1
self.az = "az"
self.nics = None
self.configuration = None
self.tenant_id = "UUID"
self.datastore_version_id = str(uuid.uuid4())
self.db_info = DBInstance.create(
name=self.name, flavor_id=self.flavor_id,
tenant_id=self.tenant_id,
volume_size=self.volume_size,
datastore_version_id=self.datastore_version.id,
task_status=InstanceTasks.BUILDING,
configuration_id=self.configuration
)
self.backup_name = "name"
self.descr = None
self.backup_state = backup_models.BackupState.COMPLETED
self.instance_id = self.db_info.id
self.parent_id = None
self.deleted = False
self.backup = backup_models.DBBackup.create(
name=self.backup_name,
description=self.descr,
tenant_id=self.tenant_id,
state=self.backup_state,
instance_id=self.instance_id,
parent_id=self.parent_id,
datastore_version_id=self.datastore_version.id,
deleted=False
)
self.backup.size = 1.1
self.backup.save()
self.backup_id = self.backup.id
self.orig_client = models.create_nova_client
models.create_nova_client = nova.fake_create_nova_client
self.orig_api = task_api.API(self.context).create_instance
task_api.API(self.context).create_instance = Mock()
self.run_with_quotas = models.run_with_quotas
models.run_with_quotas = Mock()
self.check = backup_models.DBBackup.check_swift_object_exist
backup_models.DBBackup.check_swift_object_exist = Mock(
return_value=True)
super(CreateInstanceTest, self).setUp()
@patch.object(task_api.API, 'get_client', Mock(return_value=Mock()))
def tearDown(self):
self.db_info.delete()
self.backup.delete()
self.datastore.delete()
self.datastore_version.delete()
models.create_nova_client = self.orig_client
task_api.API(self.context).create_instance = self.orig_api
models.run_with_quotas = self.run_with_quotas
backup_models.DBBackup.check_swift_object_exist = self.check
self.backup.delete()
self.db_info.delete()
super(CreateInstanceTest, self).tearDown()
def test_exception_on_invalid_backup_size(self):
self.assertEqual(self.backup.id, self.backup_id)
exc = self.assertRaises(
exception.BackupTooLarge, models.Instance.create,
self.context, self.name, self.flavor_id,
self.image_id, self.databases, self.users,
self.datastore, self.datastore_version,
self.volume_size, self.backup_id,
self.az, self.nics, self.configuration
)
self.assertIn("Backup is too large for "
"given flavor or volume.", str(exc))
def test_can_restore_from_backup_with_almost_equal_size(self):
# target size equals to "1Gb"
self.backup.size = 0.99
self.backup.save()
instance = models.Instance.create(
self.context, self.name, self.flavor_id,
self.image_id, self.databases, self.users,
self.datastore, self.datastore_version,
self.volume_size, self.backup_id,
self.az, self.nics, self.configuration)
self.assertIsNotNone(instance)
class TestReplication(trove_testtools.TestCase):
def setUp(self):
util.init_db()
self.datastore = datastore_models.DBDatastore.create(
id=str(uuid.uuid4()),
name='name' + str(uuid.uuid4()),
default_version_id=str(uuid.uuid4()))
self.datastore_version = datastore_models.DBDatastoreVersion.create(
id=self.datastore.default_version_id,
name='name' + str(uuid.uuid4()),
image_id=str(uuid.uuid4()),
packages=str(uuid.uuid4()),
datastore_id=self.datastore.id,
manager='mysql',
active=1)
self.master = DBInstance(
InstanceTasks.NONE,
id=str(uuid.uuid4()),
name="TestMasterInstance",
datastore_version_id=self.datastore_version.id)
self.master.set_task_status(InstanceTasks.NONE)
self.master.save()
self.master_status = InstanceServiceStatus(
ServiceStatuses.RUNNING,
id=str(uuid.uuid4()),
instance_id=self.master.id)
self.master_status.save()
self.safe_nova_client = models.create_nova_client
models.create_nova_client = nova.fake_create_nova_client
super(TestReplication, self).setUp()
def tearDown(self):
self.master.delete()
self.master_status.delete()
self.datastore.delete()
self.datastore_version.delete()
models.create_nova_client = self.safe_nova_client
super(TestReplication, self).tearDown()
@patch('trove.instance.models.LOG')
def test_replica_of_not_active_master(self, mock_logging):
self.master.set_task_status(InstanceTasks.BUILDING)
self.master.save()
self.master_status.set_status(ServiceStatuses.BUILDING)
self.master_status.save()
self.assertRaises(exception.UnprocessableEntity,
Instance.create,
None, 'name', 1, "UUID", [], [], None,
self.datastore_version, 1,
None, slave_of_id=self.master.id)
@patch('trove.instance.models.LOG')
def test_replica_with_invalid_slave_of_id(self, mock_logging):
self.assertRaises(exception.NotFound,
Instance.create,
None, 'name', 1, "UUID", [], [], None,
self.datastore_version, 1,
None, slave_of_id=str(uuid.uuid4()))
def test_create_replica_from_replica(self):
self.replica_datastore_version = Mock(
spec=datastore_models.DBDatastoreVersion)
self.replica_datastore_version.id = "UUID"
self.replica_datastore_version.manager = 'mysql'
self.replica_info = DBInstance(
InstanceTasks.NONE,
id="UUID",
name="TestInstance",
datastore_version_id=self.replica_datastore_version.id,
slave_of_id=self.master.id)
self.replica_info.save()
self.assertRaises(exception.Forbidden, Instance.create,
None, 'name', 2, "UUID", [], [], None,
self.datastore_version, 1,
None, slave_of_id=self.replica_info.id)
| redhat-openstack/trove | trove/tests/unittests/instance/test_instance_models.py | Python | apache-2.0 | 11,729 |
# tldbinit
tldbinit initialize PostgrSQL database environment droping, creating tables:
* symbols
* quotes
# Environment
* Operating System: openSUSE 13.1
* Development tool: KDevelop 4.5.2 for KDE 4.11.5
* Languaje: C++
* Program directory; HOME/TradingLab/tldbinit
* PostgreSQL lib: libpqxx
| TradingLab/tldbinit | README.md | Markdown | apache-2.0 | 296 |
<!DOCTYPE html>
<html lang="zh-cn" class="js csstransforms3d">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="Hugo 0.56.0" />
<meta name="description" content="Documentation for Selenium">
<link rel="icon" href="https://seleniumhq.github.io/docs/site/zh-cn/images/favicon.png" type="image/png">
<title>驱动特性 :: Selenium 文档</title>
<link href="https://seleniumhq.github.io/docs/site/zh-cn/css/nucleus.css?1571349423" rel="stylesheet">
<link href="https://seleniumhq.github.io/docs/site/zh-cn/css/fontawesome-all.min.css?1571349423" rel="stylesheet">
<link href="https://seleniumhq.github.io/docs/site/zh-cn/css/hybrid.css?1571349423" rel="stylesheet">
<link href="https://seleniumhq.github.io/docs/site/zh-cn/css/featherlight.min.css?1571349423" rel="stylesheet">
<link href="https://seleniumhq.github.io/docs/site/zh-cn/css/perfect-scrollbar.min.css?1571349423" rel="stylesheet">
<link href="https://seleniumhq.github.io/docs/site/zh-cn/css/auto-complete.css?1571349423" rel="stylesheet">
<link href="https://seleniumhq.github.io/docs/site/zh-cn/css/atom-one-dark-reasonable.css?1571349423" rel="stylesheet">
<link href="https://seleniumhq.github.io/docs/site/zh-cn/css/theme.css?1571349423" rel="stylesheet">
<link href="https://seleniumhq.github.io/docs/site/zh-cn/css/hugo-theme.css?1571349423" rel="stylesheet">
<link href="https://seleniumhq.github.io/docs/site/zh-cn/css/theme-selenium.css?1571349423" rel="stylesheet">
<script src="https://seleniumhq.github.io/docs/site/zh-cn/js/jquery-3.3.1.min.js?1571349423"></script>
<style>
:root #header + #content > #left > #rlblock_left{
display:none !important;
}
</style>
</head>
<body class="" data-url="/driver_idiosyncrasies/">
<nav id="sidebar" class="showVisitedLinks">
<div id="header-wrapper">
<div id="header">
<a id="logo" href="https://seleniumhq.github.io/docs/site/zh-cn">
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 139.38 34"
width="100%" height="100%" xml:space="preserve">
<defs>
<style>.cls-1{fill:#fff;}</style>
</defs>
<title>Selenium</title>
<path class="cls-1" d="M46.2,26.37a18.85,18.85,0,0,1-2.57-.2,25,25,0,0,1-2.74-.53l0-1.39a25.31,25.31,0,0,0,2.71.53,18,18,0,0,0,2.5.2,5.51,5.51,0,0,0,3.29-.84,2.79,2.79,0,0,0,1.14-2.39,2.85,2.85,0,0,0-1.24-2.49A6,6,0,0,0,48,18.55q-.78-.29-1.67-.55A15.93,15.93,0,0,1,44,17.13a5.92,5.92,0,0,1-1.58-1.05,3.6,3.6,0,0,1-.9-1.34A5,5,0,0,1,41.23,13a4.46,4.46,0,0,1,.41-1.93,4.31,4.31,0,0,1,1.17-1.5,5.26,5.26,0,0,1,1.82-1A8,8,0,0,1,47,8.28a20.51,20.51,0,0,1,4.41.57l0,1.42a20,20,0,0,0-2.23-.44,15.2,15.2,0,0,0-2-.15,4.86,4.86,0,0,0-3.08.9A2.9,2.9,0,0,0,42.88,13a3.25,3.25,0,0,0,.21,1.21,2.61,2.61,0,0,0,.7,1,4.83,4.83,0,0,0,1.27.79,14.31,14.31,0,0,0,2,.68q1.11.33,2.06.71a6.21,6.21,0,0,1,1.65.94,4.09,4.09,0,0,1,1.1,1.38,4.54,4.54,0,0,1,.4,2,4.15,4.15,0,0,1-1.56,3.48A7.16,7.16,0,0,1,46.2,26.37Z"/>
<path class="cls-1" d="M60.62,26.32a5.46,5.46,0,0,1-4.28-1.62A6.9,6.9,0,0,1,54.88,20a7.8,7.8,0,0,1,1.43-5,5,5,0,0,1,4.14-1.75,4.24,4.24,0,0,1,3.47,1.43A6.48,6.48,0,0,1,65.1,18.8q0,.54,0,.92a3.22,3.22,0,0,1-.09.64H56.44a5.39,5.39,0,0,0,1.17,3.5A4.18,4.18,0,0,0,60.8,25a10.52,10.52,0,0,0,1.82-.17,11.77,11.77,0,0,0,1.93-.52l.12,1.27a10.68,10.68,0,0,1-2,.55A11.47,11.47,0,0,1,60.62,26.32ZM60.4,14.43q-3.68,0-3.94,4.74h7.15a6.49,6.49,0,0,0-.78-3.63A2.76,2.76,0,0,0,60.4,14.43Z"/>
<path class="cls-1" d="M68.64,7h1.58V26.11H68.64Z"/>
<path class="cls-1" d="M79.56,26.32a5.46,5.46,0,0,1-4.28-1.62A6.9,6.9,0,0,1,73.83,20a7.8,7.8,0,0,1,1.43-5,5,5,0,0,1,4.14-1.75,4.24,4.24,0,0,1,3.47,1.43A6.48,6.48,0,0,1,84,18.8q0,.54,0,.92a3.22,3.22,0,0,1-.09.64H75.38a5.4,5.4,0,0,0,1.17,3.5A4.18,4.18,0,0,0,79.75,25a10.52,10.52,0,0,0,1.82-.17,11.8,11.8,0,0,0,1.93-.52l.12,1.27a10.68,10.68,0,0,1-2,.55A11.47,11.47,0,0,1,79.56,26.32Zm-.21-11.89q-3.68,0-3.94,4.74h7.15a6.49,6.49,0,0,0-.78-3.63A2.76,2.76,0,0,0,79.35,14.43Z"/>
<path class="cls-1" d="M87.51,13.37h1.32l.12,1.49h.12q.94-.45,1.72-.78t1.43-.54a8.42,8.42,0,0,1,1.2-.31,6.54,6.54,0,0,1,1.1-.09A3.3,3.3,0,0,1,97,14a3.63,3.63,0,0,1,.83,2.63v9.51H96.24v-9a3,3,0,0,0-.55-2,2.18,2.18,0,0,0-1.69-.6,7.25,7.25,0,0,0-2.24.41,20.1,20.1,0,0,0-2.67,1.12v10H87.51Z"/>
<path class="cls-1" d="M102.75,10.52a.93.93,0,0,1-1.06-1,1.06,1.06,0,0,1,2.12,0A.93.93,0,0,1,102.75,10.52Zm-.8,2.85h1.58V26.11h-1.58Z"/>
<path class="cls-1" d="M110.81,26.34q-3.14,0-3.14-3.47V13.37h1.58v9a3.16,3.16,0,0,0,.48,2,1.92,1.92,0,0,0,1.59.6,6.83,6.83,0,0,0,2.48-.48q1.25-.48,2.59-1.14V13.37H118V26.11h-1.32l-.12-1.58h-.09l-1.73.81q-.74.34-1.38.57a7.9,7.9,0,0,1-1.23.33A7.34,7.34,0,0,1,110.81,26.34Z"/>
<path class="cls-1" d="M122.18,13.37h1.3l.14,1.49h.09a19.53,19.53,0,0,1,2.58-1.31,5.51,5.51,0,0,1,2-.41,2.83,2.83,0,0,1,3,1.77h.12q.8-.5,1.45-.83a12.61,12.61,0,0,1,1.2-.54,6.17,6.17,0,0,1,1-.31,5.18,5.18,0,0,1,1-.09,3.3,3.3,0,0,1,2.45.84,3.63,3.63,0,0,1,.83,2.63v9.51h-1.56v-9a2.9,2.9,0,0,0-.55-2,2.21,2.21,0,0,0-1.69-.59,5.14,5.14,0,0,0-1.78.38A14.45,14.45,0,0,0,131.6,16v10.1H130v-9a2.9,2.9,0,0,0-.55-2,2.21,2.21,0,0,0-1.69-.59,5.24,5.24,0,0,0-1.86.4A14,14,0,0,0,123.76,16V26.11h-1.58Z"/>
<path class="cls-1" d="M21.45,21.51a2.49,2.49,0,0,0-2.55,2.21.08.08,0,0,0,.08.1h4.95a.08.08,0,0,0,.08-.09A2.41,2.41,0,0,0,21.45,21.51Z"/>
<path class="cls-1" d="M32.06,4.91,21.56,16.7a.32.32,0,0,1-.47,0l-5.36-5.53a.32.32,0,0,1,0-.4l1.77-2.27a.32.32,0,0,1,.52,0l3,3.32a.32.32,0,0,0,.49,0L29.87.36A.23.23,0,0,0,29.69,0H.25A.25.25,0,0,0,0,.25v33.5A.25.25,0,0,0,.25,34h32a.25.25,0,0,0,.25-.25V5.06A.23.23,0,0,0,32.06,4.91Zm-23,25.36a8.08,8.08,0,0,1-5.74-2,.31.31,0,0,1,0-.41l1.25-1.75A.31.31,0,0,1,5,26a6.15,6.15,0,0,0,4.2,1.64c1.64,0,2.44-.76,2.44-1.56,0-2.48-8.08-.78-8.08-6.06,0-2.33,2-4.27,5.32-4.27a7.88,7.88,0,0,1,5.25,1.76.31.31,0,0,1,0,.43L12.9,19.65a.31.31,0,0,1-.45.05,6.08,6.08,0,0,0-3.84-1.32c-1.28,0-2,.57-2,1.41,0,2.23,8.06.74,8.06,6C14.67,28.33,12.84,30.27,9.05,30.27ZM26.68,25.4a.27.27,0,0,1-.28.28H19a.09.09,0,0,0-.08.1,2.81,2.81,0,0,0,3,2.32,4.62,4.62,0,0,0,2.56-.84.27.27,0,0,1,.4.06l.9,1.31a.28.28,0,0,1-.06.37,6.67,6.67,0,0,1-4.1,1.28,5.28,5.28,0,0,1-5.57-5.48,5.31,5.31,0,0,1,5.4-5.46c3.11,0,5.22,2.33,5.22,5.74Z"/>
</svg>
</a>
</div>
<div class="searchbox">
<label for="search-by"><i class="fas fa-search"></i></label>
<input data-search-input id="search-by" type="search" placeholder="搜索...">
<span data-search-clear=""><i class="fas fa-times"></i></span>
</div>
<script type="text/javascript" src="https://seleniumhq.github.io/docs/site/zh-cn/js/lunr.min.js?1571349423"></script>
<script type="text/javascript" src="https://seleniumhq.github.io/docs/site/zh-cn/js/auto-complete.js?1571349423"></script>
<script type="text/javascript">
var baseurl = "https:\/\/seleniumhq.github.io\/docs\/site\/zh-cn\/zh-cn";
</script>
<script type="text/javascript" src="https://seleniumhq.github.io/docs/site/zh-cn/js/search.js?1571349423"></script>
</div>
<div class="highlightable">
<ul class="topics">
<li data-nav-id="/getting_started/" title="入门指南" class="dd-item
">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/getting_started/">
入门指南
<i class="fas fa-check read-icon"></i>
</a>
<ul>
<li data-nav-id="/getting_started/quick/" title="快速浏览" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/getting_started/quick/">
快速浏览
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/getting_started/html-runner/" title="HTML runner" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/getting_started/html-runner/">
HTML runner
<i class="fas fa-check read-icon"></i>
</a>
</li>
</ul>
</li>
<li data-nav-id="/introduction/" title="介绍" class="dd-item
">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/introduction/">
介绍
<i class="fas fa-check read-icon"></i>
</a>
<ul>
<li data-nav-id="/introduction/the_selenium_project_and_tools/" title="Selenium 项目和工具" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/introduction/the_selenium_project_and_tools/">
Selenium 项目和工具
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/introduction/on_test_automation/" title="关于测试自动化" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/introduction/on_test_automation/">
关于测试自动化
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/introduction/types_of_testing/" title="Types of testing" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/introduction/types_of_testing/">
Types of testing
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/introduction/about_this_documentation/" title="关于这个文档" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/introduction/about_this_documentation/">
关于这个文档
<i class="fas fa-check read-icon"></i>
</a>
</li>
</ul>
</li>
<li data-nav-id="/selenium_installation/" title="Selenium 安装" class="dd-item
">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/selenium_installation/">
Selenium 安装
<i class="fas fa-check read-icon"></i>
</a>
<ul>
<li data-nav-id="/selenium_installation/installing_selenium_libraries/" title="安装 Selenium 库" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/selenium_installation/installing_selenium_libraries/">
安装 Selenium 库
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/selenium_installation/installing_webdriver_binaries/" title="安装 WebDriver 二进制文件" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/selenium_installation/installing_webdriver_binaries/">
安装 WebDriver 二进制文件
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/selenium_installation/installing_standalone_server/" title="安装独立服务器" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/selenium_installation/installing_standalone_server/">
安装独立服务器
<i class="fas fa-check read-icon"></i>
</a>
</li>
</ul>
</li>
<li data-nav-id="/getting_started_with_webdriver/" title="WebDriver 入门" class="dd-item
">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/getting_started_with_webdriver/">
WebDriver 入门
<i class="fas fa-check read-icon"></i>
</a>
<ul>
<li data-nav-id="/getting_started_with_webdriver/browsers/" title="浏览器" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/getting_started_with_webdriver/browsers/">
浏览器
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/getting_started_with_webdriver/third_party_drivers_and_plugins/" title="Third party drivers and plugins" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/getting_started_with_webdriver/third_party_drivers_and_plugins/">
Third party drivers and plugins
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/getting_started_with_webdriver/locating_elements/" title="Locating elements" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/getting_started_with_webdriver/locating_elements/">
Locating elements
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/getting_started_with_webdriver/performing_actions_on_the_aut/" title="Performing actions on the AUT*" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/getting_started_with_webdriver/performing_actions_on_the_aut/">
Performing actions on the AUT*
<i class="fas fa-check read-icon"></i>
</a>
</li>
</ul>
</li>
<li data-nav-id="/webdriver/" title="WebDriver" class="dd-item
">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/webdriver/">
WebDriver
<i class="fas fa-check read-icon"></i>
</a>
<ul>
<li data-nav-id="/webdriver/understanding_the_components/" title="Understanding the components" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/webdriver/understanding_the_components/">
Understanding the components
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/webdriver/driver_requirements/" title="Driver requirements" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/webdriver/driver_requirements/">
Driver requirements
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/webdriver/browser_manipulation/" title="Browser manipulation" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/webdriver/browser_manipulation/">
Browser manipulation
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/webdriver/waits/" title="Waits" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/webdriver/waits/">
Waits
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/webdriver/support_classes/" title="Support classes" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/webdriver/support_classes/">
Support classes
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/webdriver/js_alerts_prompts_and_confirmations/" title="JavaScript alerts, prompts and confirmations" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/webdriver/js_alerts_prompts_and_confirmations/">
JavaScript alerts, prompts and confirmations
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/webdriver/http_proxies/" title="Http proxies" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/webdriver/http_proxies/">
Http proxies
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/webdriver/page_loading_strategy/" title="Page loading strategy" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/webdriver/page_loading_strategy/">
Page loading strategy
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/webdriver/web_element/" title="Web element" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/webdriver/web_element/">
Web element
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/webdriver/keyboard/" title="Keyboard" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/webdriver/keyboard/">
Keyboard
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/webdriver/mouse/" title="Mouse" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/webdriver/mouse/">
Mouse
<i class="fas fa-check read-icon"></i>
</a>
</li>
</ul>
</li>
<li data-nav-id="/remote_webdriver/" title="Remote WebDriver" class="dd-item
">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/remote_webdriver/">
Remote WebDriver
<i class="fas fa-check read-icon"></i>
</a>
<ul>
<li data-nav-id="/remote_webdriver/remote_webdriver_server/" title="Remote WebDriver server" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/remote_webdriver/remote_webdriver_server/">
Remote WebDriver server
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/remote_webdriver/remote_webdriver_client/" title="Remote WebDriver client" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/remote_webdriver/remote_webdriver_client/">
Remote WebDriver client
<i class="fas fa-check read-icon"></i>
</a>
</li>
</ul>
</li>
<li data-nav-id="/guidelines_and_recommendations/" title="Guidelines and recommendations" class="dd-item
">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/guidelines_and_recommendations/">
Guidelines
<i class="fas fa-check read-icon"></i>
</a>
<ul>
<li data-nav-id="/guidelines_and_recommendations/page_object_models/" title="Page object models" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/guidelines_and_recommendations/page_object_models/">
Page object models
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/guidelines_and_recommendations/domain_specific_language/" title="Domain specific language" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/guidelines_and_recommendations/domain_specific_language/">
Domain specific language
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/guidelines_and_recommendations/generating_application_state/" title="Generating application state" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/guidelines_and_recommendations/generating_application_state/">
Generating application state
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/guidelines_and_recommendations/mock_external_services/" title="Mock external services" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/guidelines_and_recommendations/mock_external_services/">
Mock external services
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/guidelines_and_recommendations/improved_reporting/" title="Improved reporting" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/guidelines_and_recommendations/improved_reporting/">
Improved reporting
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/guidelines_and_recommendations/avoid_sharing_state/" title="Avoid sharing state" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/guidelines_and_recommendations/avoid_sharing_state/">
Avoid sharing state
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/guidelines_and_recommendations/test_independency/" title="Test independency" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/guidelines_and_recommendations/test_independency/">
Test independency
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/guidelines_and_recommendations/consider_using_a_fluent_api/" title="Consider using a fluent API" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/guidelines_and_recommendations/consider_using_a_fluent_api/">
Consider using a fluent API
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/guidelines_and_recommendations/fresh_browser_per_test/" title="Fresh browser per test" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/guidelines_and_recommendations/fresh_browser_per_test/">
Fresh browser per test
<i class="fas fa-check read-icon"></i>
</a>
</li>
</ul>
</li>
<li data-nav-id="/worst_practices/" title="Worst practices" class="dd-item
">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/worst_practices/">
Worst practices
<i class="fas fa-check read-icon"></i>
</a>
<ul>
<li data-nav-id="/worst_practices/captchas/" title="Captchas" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/worst_practices/captchas/">
Captchas
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/worst_practices/file_downloads/" title="File downloads" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/worst_practices/file_downloads/">
File downloads
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/worst_practices/http_response_codes/" title="HTTP response codes" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/worst_practices/http_response_codes/">
HTTP response codes
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/worst_practices/gmail_email_and_facebook_logins/" title="Gmail, email and Facebook logins" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/worst_practices/gmail_email_and_facebook_logins/">
Gmail, email and Facebook
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/worst_practices/test_dependency/" title="Test dependency" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/worst_practices/test_dependency/">
Test dependency
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/worst_practices/performance_testing/" title="Performance testing" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/worst_practices/performance_testing/">
Performance testing
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/worst_practices/link_spidering/" title="Link spidering" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/worst_practices/link_spidering/">
Link spidering
<i class="fas fa-check read-icon"></i>
</a>
</li>
</ul>
</li>
<li data-nav-id="/grid/" title="Grid" class="dd-item
">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/grid/">
Grid
<i class="fas fa-check read-icon"></i>
</a>
<ul>
<li data-nav-id="/grid/purposes_and_main_functionalities/" title="Purposes and main functionalities" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/grid/purposes_and_main_functionalities/">
Purposes and functionalities
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/grid/components_of_a_grid/" title="Components of a Grid" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/grid/components_of_a_grid/">
Components of a Grid
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/grid/setting_up_your_own_grid/" title="Setting up your own Grid" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/grid/setting_up_your_own_grid/">
Setting up your own Grid
<i class="fas fa-check read-icon"></i>
</a>
</li>
</ul>
</li>
<li data-nav-id="/driver_idiosyncrasies/" title="驱动特性" class="dd-item
parent
active
">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/driver_idiosyncrasies/">
驱动特性
<i class="fas fa-check read-icon"></i>
</a>
<ul>
<li data-nav-id="/driver_idiosyncrasies/shared_capabilities/" title="Shared capabilities" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/driver_idiosyncrasies/shared_capabilities/">
Shared capabilities
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/driver_idiosyncrasies/driver_specific_capabilities/" title="Driver specific capabilities" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/driver_idiosyncrasies/driver_specific_capabilities/">
Driver specific capabilities
<i class="fas fa-check read-icon"></i>
</a>
</li>
</ul>
</li>
<li data-nav-id="/support_packages/" title="Support packages" class="dd-item
">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/support_packages/">
Support packages
<i class="fas fa-check read-icon"></i>
</a>
<ul>
<li data-nav-id="/support_packages/browser_navigation/" title="Browser navigation" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/support_packages/browser_navigation/">
Browser navigation
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/support_packages/working_with_colours/" title="Working with colours" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/support_packages/working_with_colours/">
Working with colours
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/support_packages/working_with_select_elements/" title="Working with select elements" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/support_packages/working_with_select_elements/">
Working with select elements
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/support_packages/mouse_and_keyboard_actions_in_detail/" title="Mouse and keyboard actions in detail" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/support_packages/mouse_and_keyboard_actions_in_detail/">
Mouse and keyboard actions in detail
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/support_packages/working_with_web_elements/" title="Working with web elements" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/support_packages/working_with_web_elements/">
Working with web elements
<i class="fas fa-check read-icon"></i>
</a>
</li>
</ul>
</li>
<li data-nav-id="/front_matter/" title="版权页" class="dd-item
">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/front_matter/">
版权页
<i class="fas fa-check read-icon"></i>
</a>
<ul>
<li data-nav-id="/front_matter/copyright_and_attributions/" title="Copyright and attributions" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/front_matter/copyright_and_attributions/">
Copyright and attributions
<i class="fas fa-check read-icon"></i>
</a>
</li>
<li data-nav-id="/front_matter/typographical_conventions/" title="Typographical conventions" class="dd-item ">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/front_matter/typographical_conventions/">
Typographical conventions
<i class="fas fa-check read-icon"></i>
</a>
</li>
</ul>
</li>
</ul>
<section id="shortcuts">
<h3>更多</h3>
<ul>
<li>
<a class="padding" href="https://github.com/SeleniumHQ/docs"><i class='fab fa-fw fa-github'></i> GitHub repo</a>
</li>
<li>
<a class="padding" href="https://github.com/seleniumhq/docs/issues"><i class='fas fa-fw fa-exclamation-triangle'></i> Report a bug</a>
</li>
<li>
<a class="padding" href="https://seleniumhq.github.io/docs/site/zh-cn/front_matter/copyright_and_attributions"><i class='fas fa-fw fa-bullhorn'></i> Credits</a>
</li>
<li>
<a class="padding" href="https://seleniumhq.github.io/docs/site/zh-cn/contributing"><i class='fas fa-fw fa-bullhorn'></i> How to contribute</a>
</li>
</ul>
</section>
<section id="prefooter">
<hr/>
<ul>
<li>
<a class="padding">
<i class="fas fa-language fa-fw"></i>
<div class="select-style">
<select id="select-language" onchange="location = this.value;">
<option id="en" value="https://seleniumhq.github.io/docs/site/en/driver_idiosyncrasies/">English</option>
<option id="es" value="https://seleniumhq.github.io/docs/site/es/driver_idiosyncrasies/">Español</option>
<option id="nl" value="https://seleniumhq.github.io/docs/site/nl/driver_idiosyncrasies/">Nederlands</option>
<option id="zh-cn" value="https://seleniumhq.github.io/docs/site/zh-cn/driver_idiosyncrasies/" selected>中文简体</option>
<option id="fr" value="https://seleniumhq.github.io/docs/site/fr/driver_idiosyncrasies/">Français</option>
<option id="ja" value="https://seleniumhq.github.io/docs/site/ja/driver_idiosyncrasies/">日本語</option>
</select>
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="255px" height="255px" viewBox="0 0 255 255" style="enable-background:new 0 0 255 255;" xml:space="preserve">
<g>
<g id="arrow-drop-down">
<polygon points="0,63.75 127.5,191.25 255,63.75 " />
</g>
</g>
</svg>
</div>
</a>
</li>
<li><a class="padding" href="#" data-clear-history-toggle=""><i class="fas fa-history fa-fw"></i> 清理历史记录</a></li>
</ul>
</section>
<section id="footer">
<p>
© 2013-2019
</p>
<p>
Software Freedom Conservancy (SFC)
</p>
</section>
</div>
</nav>
<section id="body">
<div id="overlay"></div>
<div class="padding highlightable">
<div>
<div id="top-bar">
<div id="top-github-link">
<a class="github-link" title='Edit this page' href="https://github.com/SeleniumHQ/docs/edit/gh-pages/docs_source_files/content/driver_idiosyncrasies/_index.zh-cn.md" target="blank">
<i class="fas fa-code-branch"></i>
<span id="top-github-link-text">Edit this page</span>
</a>
</div>
<div id="breadcrumbs" itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb">
<span id="sidebar-toggle-span">
<a href="#" id="sidebar-toggle" data-sidebar-toggle="">
<i class="fas fa-bars"></i>
</a>
</span>
<span class="links">
<a href='https://seleniumhq.github.io/docs/site/zh-cn/'>Selenium 浏览器自动化项目</a> > 驱动特性
</span>
</div>
</div>
</div>
<div id="head-tags">
</div>
<div id="chapter">
<div id="body-inner">
<h1 id="驱动特性">驱动特性</h1>
<footer class=" footline" >
</footer>
<h5 class="meta-data">
<a href="https://seleniumhq.github.io/docs/site/zh-cn/driver_idiosyncrasies/">
“驱动特性”
</a> was last updated on: 25 Aug 2019 18:58:49 +0000: <a href="https://github.com/SeleniumHQ/docs/commit/0796e9a2e9ff438d6431521ef7d11bab85df016d">Publishing site on Sun Aug 25 18:58:49 UTC 2019, commit 95da9c5fb67f3ee0d8643391d33c432194496c59 and job 795.1, [skip ci] (0796e9a2)</a>
</h5>
</div>
</div>
</div>
<div id="navigation">
<a class="nav nav-prev" href="https://seleniumhq.github.io/docs/site/zh-cn/grid/setting_up_your_own_grid/" title="Setting up your own Grid"> <i class="fa fa-chevron-left"></i></a>
<a class="nav nav-next" href="https://seleniumhq.github.io/docs/site/zh-cn/driver_idiosyncrasies/shared_capabilities/" title="Shared capabilities" style="margin-right: 0px;"><i class="fa fa-chevron-right"></i></a>
</div>
</section>
<div style="left: -1000px; overflow: scroll; position: absolute; top: -1000px; border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;">
<div style="border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;"></div>
</div>
<script src="https://seleniumhq.github.io/docs/site/zh-cn/js/clipboard.min.js?1571349423"></script>
<script src="https://seleniumhq.github.io/docs/site/zh-cn/js/perfect-scrollbar.min.js?1571349423"></script>
<script src="https://seleniumhq.github.io/docs/site/zh-cn/js/perfect-scrollbar.jquery.min.js?1571349423"></script>
<script src="https://seleniumhq.github.io/docs/site/zh-cn/js/jquery.sticky.js?1571349423"></script>
<script src="https://seleniumhq.github.io/docs/site/zh-cn/js/featherlight.min.js?1571349423"></script>
<script src="https://seleniumhq.github.io/docs/site/zh-cn/js/highlight.pack.js?1571349423"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script src="https://seleniumhq.github.io/docs/site/zh-cn/js/modernizr.custom-3.6.0.js?1571349423"></script>
<script src="https://seleniumhq.github.io/docs/site/zh-cn/js/learn.js?1571349423"></script>
<script src="https://seleniumhq.github.io/docs/site/zh-cn/js/hugo-learn.js?1571349423"></script>
<link href="https://seleniumhq.github.io/docs/site/zh-cn/mermaid/mermaid.css?1571349423" rel="stylesheet" />
<script src="https://seleniumhq.github.io/docs/site/zh-cn/mermaid/mermaid.js?1571349423"></script>
<script>
mermaid.initialize({ startOnLoad: true });
</script>
</body>
</html>
| SeleniumHQ/docs | site/zh-cn/driver_idiosyncrasies/index.html | HTML | apache-2.0 | 60,660 |
package ibmmq
/*
Copyright (c) IBM Corporation 2018
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Contributors:
Mark Taylor - Initial Contribution
*/
/*
#include <stdlib.h>
#include <string.h>
#include <cmqc.h>
*/
import "C"
/*
MQCBD is a structure containing the MQ Callback Descriptor
*/
type MQCBD struct {
CallbackType int32
Options int32
CallbackArea interface{}
CallbackFunction MQCB_FUNCTION
CallbackName string
MaxMsgLength int32
}
/*
NewMQCBD fills in default values for the MQCBD structure
*/
func NewMQCBD() *MQCBD {
cbd := new(MQCBD)
cbd.CallbackType = C.MQCBT_MESSAGE_CONSUMER
cbd.Options = C.MQCBDO_NONE
cbd.CallbackArea = nil
cbd.CallbackFunction = nil
cbd.CallbackName = ""
cbd.MaxMsgLength = C.MQCBD_FULL_MSG_LENGTH
return cbd
}
func copyCBDtoC(mqcbd *C.MQCBD, gocbd *MQCBD) {
setMQIString((*C.char)(&mqcbd.StrucId[0]), "CBD ", 4)
mqcbd.Version = C.MQCBD_VERSION_1
mqcbd.CallbackType = C.MQLONG(gocbd.CallbackType)
mqcbd.Options = C.MQLONG(gocbd.Options) | C.MQCBDO_FAIL_IF_QUIESCING
// CallbackArea is always set to NULL here. The user's values are saved/restored elsewhere
mqcbd.CallbackArea = (C.MQPTR)(C.NULL)
setMQIString((*C.char)(&mqcbd.CallbackName[0]), gocbd.CallbackName, 128) // There's no MQI constant for the length
mqcbd.MaxMsgLength = C.MQLONG(gocbd.MaxMsgLength)
return
}
func copyCBDfromC(mqcbd *C.MQCBD, gocbd *MQCBD) {
// There are no modified output parameters
return
}
| ibm-messaging/mq-golang | ibmmq/mqiCBD.go | GO | apache-2.0 | 1,975 |
#ifndef LMS7002M_COMMANDS_H
#define LMS7002M_COMMANDS_H
const int LMS_RST_PULSE = 2;
enum eCMD_LMS
{
CMD_GET_INFO = 0x00,
///Writes data to SI5356 synthesizer via I2C
CMD_SI5356_WR = 0x11,
///Reads data from SI5356 synthesizer via I2C
CMD_SI5356_RD = 0x12,
///Writes data to SI5351 synthesizer via I2C
CMD_SI5351_WR = 0x13,
///Reads data from SI5351 synthesizer via I2C
CMD_SI5351_RD = 0x14,
///Sets new LMS7002M chips RESET pin level (0, 1, pulse)
CMD_LMS7002_RST = 0x20,
///Writes data to LMS7002M chip via SPI
CMD_LMS7002_WR = 0x21,
///Reads data from LMS7002M chip via SPI
CMD_LMS7002_RD = 0x22,
///
CMD_PROG_MCU = 0x2A,
///Writes data to ADF4002 chip via SPI
CMD_ADF4002_WR = 0x31,
CMD_LMS6002_WR = 0x23,
CMD_LMS6002_RD = 0x24,
CMD_PE636040_WR = 0x41,
CMD_PE636040_RD = 0x42,
CMD_MYRIAD_GPIO_WR = 0x51,
CMD_MYRIAD_GPIO_RD = 0x52
};
enum eCMD_STATUS
{
STATUS_UNDEFINED,
STATUS_COMPLETED_CMD,
STATUS_UNKNOWN_CMD,
STATUS_BUSY_CMD,
STATUS_MANY_BLOCKS_CMD,
STATUS_ERROR_CMD
};
#endif // LMS7002M_COMMANDS_H
| myriadrf/lms-suite | LMS6002D/legacy/control_LMS6002/src/Logic/include/LMS_Commands.h | C | apache-2.0 | 1,170 |
/*
* Copyright 2011-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package com.amazonaws.client.builder;
import com.amazonaws.AmazonWebServiceClient;
import com.amazonaws.ClientConfiguration;
import com.amazonaws.ClientConfigurationFactory;
import com.amazonaws.PredefinedClientConfigurations;
import com.amazonaws.SdkClientException;
import com.amazonaws.annotation.NotThreadSafe;
import com.amazonaws.annotation.SdkInternalApi;
import com.amazonaws.annotation.SdkProtectedApi;
import com.amazonaws.annotation.SdkTestInternalApi;
import com.amazonaws.auth.AWSCredentialsProvider;
import com.amazonaws.auth.DefaultAWSCredentialsProviderChain;
import com.amazonaws.client.AwsAsyncClientParams;
import com.amazonaws.client.AwsSyncClientParams;
import com.amazonaws.monitoring.MonitoringListener;
import com.amazonaws.handlers.RequestHandler2;
import com.amazonaws.metrics.RequestMetricCollector;
import com.amazonaws.monitoring.CsmConfigurationProvider;
import com.amazonaws.monitoring.DefaultCsmConfigurationProviderChain;
import com.amazonaws.regions.AwsRegionProvider;
import com.amazonaws.regions.DefaultAwsRegionProviderChain;
import com.amazonaws.regions.Region;
import com.amazonaws.regions.RegionUtils;
import com.amazonaws.regions.Regions;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.ExecutorService;
/**
* Base class for all service specific client builders.
*
* @param <Subclass> Concrete builder type, used for better fluent methods.
* @param <TypeToBuild> Type that this builder builds.
*/
@NotThreadSafe
@SdkProtectedApi
public abstract class AwsClientBuilder<Subclass extends AwsClientBuilder, TypeToBuild> {
/**
* Default Region Provider chain. Used only when the builder is not explicitly configured with a
* region.
*/
private static final AwsRegionProvider DEFAULT_REGION_PROVIDER = new DefaultAwsRegionProviderChain();
/**
* Different services may have custom client configuration factories to vend defaults tailored
* for that service. If no explicit client configuration is provided to the builder the default
* factory for the service is used.
*/
private final ClientConfigurationFactory clientConfigFactory;
/**
* {@link AwsRegionProvider} to use when no explicit region or endpointConfiguration is configured.
* This is currently not exposed for customization by customers.
*/
private final AwsRegionProvider regionProvider;
private final AdvancedConfig.Builder advancedConfig = AdvancedConfig.builder();
private AWSCredentialsProvider credentials;
private ClientConfiguration clientConfig;
private RequestMetricCollector metricsCollector;
private Region region;
private List<RequestHandler2> requestHandlers;
private EndpointConfiguration endpointConfiguration;
private CsmConfigurationProvider csmConfig;
private MonitoringListener monitoringListener;
protected AwsClientBuilder(ClientConfigurationFactory clientConfigFactory) {
this(clientConfigFactory, DEFAULT_REGION_PROVIDER);
}
@SdkTestInternalApi
protected AwsClientBuilder(ClientConfigurationFactory clientConfigFactory,
AwsRegionProvider regionProvider) {
this.clientConfigFactory = clientConfigFactory;
this.regionProvider = regionProvider;
}
/**
* Gets the AWSCredentialsProvider currently configured in the builder.
*/
public final AWSCredentialsProvider getCredentials() {
return this.credentials;
}
/**
* Sets the AWSCredentialsProvider used by the client. If not specified the default is {@link
* DefaultAWSCredentialsProviderChain}.
*
* @param credentialsProvider New AWSCredentialsProvider to use.
*/
public final void setCredentials(AWSCredentialsProvider credentialsProvider) {
this.credentials = credentialsProvider;
}
/**
* Sets the AWSCredentialsProvider used by the client. If not specified the default is {@link
* DefaultAWSCredentialsProviderChain}.
*
* @param credentialsProvider New AWSCredentialsProvider to use.
* @return This object for method chaining.
*/
public final Subclass withCredentials(AWSCredentialsProvider credentialsProvider) {
setCredentials(credentialsProvider);
return getSubclass();
}
/**
* If the builder isn't explicitly configured with credentials we use the {@link
* DefaultAWSCredentialsProviderChain}.
*/
private AWSCredentialsProvider resolveCredentials() {
return (credentials == null) ? DefaultAWSCredentialsProviderChain.getInstance() : credentials;
}
/**
* Gets the ClientConfiguration currently configured in the builder
*/
public final ClientConfiguration getClientConfiguration() {
return this.clientConfig;
}
/**
* Sets the ClientConfiguration to be used by the client. If not specified the default is
* typically {@link PredefinedClientConfigurations#defaultConfig} but may differ per service.
*
* @param config Custom configuration to use
*/
public final void setClientConfiguration(ClientConfiguration config) {
this.clientConfig = config;
}
/**
* Sets the ClientConfiguration to be used by the client. If not specified the default is
* typically {@link PredefinedClientConfigurations#defaultConfig} but may differ per service.
*
* @param config Custom configuration to use
* @return This object for method chaining.
*/
public final Subclass withClientConfiguration(ClientConfiguration config) {
setClientConfiguration(config);
return getSubclass();
}
/**
* If not explicit client configuration is provided we consult the {@link
* ClientConfigurationFactory} of the service. If an explicit configuration is provided we use
* ClientConfiguration's copy constructor to avoid mutation.
*/
private ClientConfiguration resolveClientConfiguration() {
return (clientConfig == null) ? clientConfigFactory.getConfig() :
new ClientConfiguration(clientConfig);
}
/**
* Gets the {@link RequestMetricCollector} in use by the builder.
*/
public final RequestMetricCollector getMetricsCollector() {
return this.metricsCollector;
}
/**
* Sets a custom RequestMetricCollector to use for the client.
*
* @param metrics Custom RequestMetricCollector to use.
*/
public final void setMetricsCollector(RequestMetricCollector metrics) {
this.metricsCollector = metrics;
}
/**
* Sets a custom RequestMetricCollector to use for the client.
*
* @param metrics Custom RequestMetricCollector to use.
* @return This object for method chaining.
*/
public final Subclass withMetricsCollector(RequestMetricCollector metrics) {
setMetricsCollector(metrics);
return getSubclass();
}
/**
* Gets the region in use by the builder.
*/
public final String getRegion() {
return region == null ? null : region.getName();
}
/**
* Sets the region to be used by the client. This will be used to determine both the
* service endpoint (eg: https://sns.us-west-1.amazonaws.com) and signing region (eg: us-west-1)
* for requests. If neither region or endpoint configuration {@link #setEndpointConfiguration(EndpointConfiguration)}
* are explicitly provided in the builder the {@link #DEFAULT_REGION_PROVIDER} is consulted.
*
* @param region Region to use
*/
public final void setRegion(String region) {
withRegion(region);
}
/**
* Sets the region to be used by the client. This will be used to determine both the
* service endpoint (eg: https://sns.us-west-1.amazonaws.com) and signing region (eg: us-west-1)
* for requests. If neither region or endpoint configuration {@link #setEndpointConfiguration(EndpointConfiguration)}
* are explicitly provided in the builder the {@link #DEFAULT_REGION_PROVIDER} is consulted.
*
* <p> For regions not explicitly in the {@link Regions} enum use the {@link
* #withRegion(String)} overload.</p>
*
* @param region Region to use
* @return This object for method chaining.
*/
public final Subclass withRegion(Regions region) {
return withRegion(region.getName());
}
/**
* Sets the region to be used by the client. This will be used to determine both the
* service endpoint (eg: https://sns.us-west-1.amazonaws.com) and signing region (eg: us-west-1)
* for requests. If neither region or endpoint configuration {@link #setEndpointConfiguration(EndpointConfiguration)}
* are explicitly provided in the builder the {@link #DEFAULT_REGION_PROVIDER} is consulted.
*
* @param region Region to use
* @return This object for method chaining.
*/
public final Subclass withRegion(String region) {
return withRegion(getRegionObject(region));
}
/**
* Lookups the {@link Region} object for the given string region name.
*
* @param regionStr Region name.
* @return Region object.
* @throws SdkClientException If region cannot be found in the metadata.
*/
private Region getRegionObject(String regionStr) {
Region regionObj = RegionUtils.getRegion(regionStr);
if (regionObj == null) {
throw new SdkClientException(String.format("Could not find region information for '%s' in SDK metadata.",
regionStr));
}
return regionObj;
}
/**
* Sets the region to be used by the client. This will be used to determine both the
* service endpoint (eg: https://sns.us-west-1.amazonaws.com) and signing region (eg: us-west-1)
* for requests. If neither region or endpoint configuration {@link #setEndpointConfiguration(EndpointConfiguration)}
* are explicitly provided in the builder the {@link #DEFAULT_REGION_PROVIDER} is consulted.
*
* @param region Region to use, this will be used to determine both service endpoint
* and the signing region
* @return This object for method chaining.
*/
private Subclass withRegion(Region region) {
this.region = region;
return getSubclass();
}
/**
* Gets the service endpointConfiguration in use by the builder
*/
public final EndpointConfiguration getEndpoint() {
return endpointConfiguration;
}
/**
* Sets the endpoint configuration (service endpoint & signing region) to be used for requests. If neither region {@link #setRegion(String)}
* or endpoint configuration are explicitly provided in the builder the {@link #DEFAULT_REGION_PROVIDER} is consulted.
*
* <p><b>Only use this if using a non-standard service endpoint - the recommended approach for configuring a client is to use {@link #setRegion(String)}</b>
*
* @param endpointConfiguration The endpointConfiguration to use
*/
public final void setEndpointConfiguration(EndpointConfiguration endpointConfiguration) {
withEndpointConfiguration(endpointConfiguration);
}
/**
* Sets the endpoint configuration (service endpoint & signing region) to be used for requests. If neither region {@link #withRegion(String)}
* or endpoint configuration are explicitly provided in the builder the {@link #DEFAULT_REGION_PROVIDER} is consulted.
*
* <p><b>Only use this if using a non-standard service endpoint - the recommended approach for configuring a client is to use {@link #withRegion(String)}</b>
*
* @param endpointConfiguration The endpointConfiguration to use
* @return This object for method chaining.
*/
public final Subclass withEndpointConfiguration(EndpointConfiguration endpointConfiguration) {
this.endpointConfiguration = endpointConfiguration;
return getSubclass();
}
/**
* Gets the list of request handlers in use by the builder.
*/
public final List<RequestHandler2> getRequestHandlers() {
return this.requestHandlers == null ? null :
Collections.unmodifiableList(this.requestHandlers);
}
/**
* Sets the request handlers to use in the client.
*
* @param handlers Request handlers to use for client.
*/
public final void setRequestHandlers(RequestHandler2... handlers) {
this.requestHandlers = Arrays.asList(handlers);
}
/**
* Sets the request handlers to use in the client.
*
* @param handlers Request handlers to use for client.
* @return This object for method chaining.
*/
public final Subclass withRequestHandlers(RequestHandler2... handlers) {
setRequestHandlers(handlers);
return getSubclass();
}
/**
* Gets the {@link MonitoringListener} in use by the builder.
*/
public final MonitoringListener getMonitoringListener() {
return this.monitoringListener;
}
/**
* Sets a custom MonitoringListener to use for the client.
*
* @param monitoringListener Custom Monitoring Listener to use.
*/
public final void setMonitoringListener(MonitoringListener monitoringListener) {
this.monitoringListener = monitoringListener;
}
/**
* Sets a custom MonitoringListener to use for the client.
*
* @param monitoringListener Custom MonitoringListener to use.
* @return This object for method chaining.
*/
public final Subclass withMonitoringListener(MonitoringListener monitoringListener) {
setMonitoringListener(monitoringListener);
return getSubclass();
}
/**
* Request handlers are copied to a new list to avoid mutation, if no request handlers are
* provided to the builder we supply an empty list.
*/
private List<RequestHandler2> resolveRequestHandlers() {
return (requestHandlers == null) ? new ArrayList<RequestHandler2>() :
new ArrayList<RequestHandler2>(requestHandlers);
}
public CsmConfigurationProvider getClientSideMonitoringConfigurationProvider() {
return csmConfig;
}
public void setClientSideMonitoringConfigurationProvider(CsmConfigurationProvider csmConfig) {
this.csmConfig = csmConfig;
}
public Subclass withClientSideMonitoringConfigurationProvider(
CsmConfigurationProvider csmConfig) {
setClientSideMonitoringConfigurationProvider(csmConfig);
return getSubclass();
}
private CsmConfigurationProvider resolveClientSideMonitoringConfig() {
return csmConfig == null ? DefaultCsmConfigurationProviderChain.getInstance() : csmConfig;
}
/**
* Get the current value of an advanced config option.
* @param key Key of value to get.
* @param <T> Type of value to get.
* @return Value if set, otherwise null.
*/
protected final <T> T getAdvancedConfig(AdvancedConfig.Key<T> key) {
return advancedConfig.get(key);
}
/**
* Sets the value of an advanced config option.
* @param key Key of value to set.
* @param value The new value.
* @param <T> Type of value.
*/
protected final <T> void putAdvancedConfig(AdvancedConfig.Key<T> key, T value) {
advancedConfig.put(key, value);
}
/**
* Region and endpoint logic is tightly coupled to the client class right now so it's easier to
* set them after client creation and let the normal logic kick in. Ideally this should resolve
* the endpoint and signer information here and just pass that information as is to the client.
*
* @param clientInterface Client to configure
*/
@SdkInternalApi
final TypeToBuild configureMutableProperties(TypeToBuild clientInterface) {
AmazonWebServiceClient client = (AmazonWebServiceClient) clientInterface;
setRegion(client);
client.makeImmutable();
return clientInterface;
}
/**
* Builds a client with the configure properties.
*
* @return Client instance to make API calls with.
*/
public abstract TypeToBuild build();
/**
* @return An instance of AwsSyncClientParams that has all params to be used in the sync client
* constructor.
*/
protected final AwsSyncClientParams getSyncClientParams() {
return new SyncBuilderParams();
}
protected final AdvancedConfig getAdvancedConfig() {
return advancedConfig.build();
}
private void setRegion(AmazonWebServiceClient client) {
if (region != null && endpointConfiguration != null) {
throw new IllegalStateException("Only one of Region or EndpointConfiguration may be set.");
}
if (endpointConfiguration != null) {
client.setEndpoint(endpointConfiguration.getServiceEndpoint());
client.setSignerRegionOverride(endpointConfiguration.getSigningRegion());
} else if (region != null) {
client.setRegion(region);
} else {
final String region = determineRegionFromRegionProvider();
if (region != null) {
client.setRegion(getRegionObject(region));
} else {
throw new SdkClientException(
"Unable to find a region via the region provider chain. " +
"Must provide an explicit region in the builder or setup environment to supply a region.");
}
}
}
/**
* Attempt to determine the region from the configured region provider. This will return null in the event that the
* region provider could not determine the region automatically.
*/
private String determineRegionFromRegionProvider() {
try {
return regionProvider.getRegion();
}
catch (SdkClientException e) {
// The AwsRegionProviderChain that is used by default throws an exception instead of returning null when
// the region is not defined. For that reason, we have to support both throwing an exception and returning
// null as the region not being defined.
return null;
}
}
@SuppressWarnings("unchecked")
protected final Subclass getSubclass() {
return (Subclass) this;
}
/**
* Presents a view of the builder to be used in a client constructor.
*/
protected class SyncBuilderParams extends AwsAsyncClientParams {
private final ClientConfiguration _clientConfig;
private final AWSCredentialsProvider _credentials;
private final RequestMetricCollector _metricsCollector;
private final List<RequestHandler2> _requestHandlers;
private final CsmConfigurationProvider _csmConfig;
private final MonitoringListener _monitoringListener;
private final AdvancedConfig _advancedConfig;
protected SyncBuilderParams() {
this._clientConfig = resolveClientConfiguration();
this._credentials = resolveCredentials();
this._metricsCollector = metricsCollector;
this._requestHandlers = resolveRequestHandlers();
this._csmConfig = resolveClientSideMonitoringConfig();
this._monitoringListener = monitoringListener;
this._advancedConfig = advancedConfig.build();
}
@Override
public AWSCredentialsProvider getCredentialsProvider() {
return this._credentials;
}
@Override
public ClientConfiguration getClientConfiguration() {
return this._clientConfig;
}
@Override
public RequestMetricCollector getRequestMetricCollector() {
return this._metricsCollector;
}
@Override
public List<RequestHandler2> getRequestHandlers() {
return this._requestHandlers;
}
@Override
public CsmConfigurationProvider getClientSideMonitoringConfigurationProvider() {
return this._csmConfig;
}
@Override
public MonitoringListener getMonitoringListener() {
return this._monitoringListener;
}
@Override
public AdvancedConfig getAdvancedConfig() {
return _advancedConfig;
}
@Override
public ExecutorService getExecutor() {
throw new UnsupportedOperationException("ExecutorService is not used for sync client.");
}
}
/**
* A container for configuration required to submit requests to a service (service endpoint and signing region)
*/
public static final class EndpointConfiguration {
private final String serviceEndpoint;
private final String signingRegion;
/**
* @param serviceEndpoint the service endpoint either with or without the protocol (e.g. https://sns.us-west-1.amazonaws.com or sns.us-west-1.amazonaws.com)
* @param signingRegion the region to use for SigV4 signing of requests (e.g. us-west-1)
*/
public EndpointConfiguration(String serviceEndpoint, String signingRegion) {
this.serviceEndpoint = serviceEndpoint;
this.signingRegion = signingRegion;
}
public String getServiceEndpoint() {
return serviceEndpoint;
}
public String getSigningRegion() {
return signingRegion;
}
}
}
| jentfoo/aws-sdk-java | aws-java-sdk-core/src/main/java/com/amazonaws/client/builder/AwsClientBuilder.java | Java | apache-2.0 | 22,211 |
package com.jukusoft.libgdx.rpg.engine.story.impl;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.jukusoft.libgdx.rpg.engine.story.StoryPart;
import com.jukusoft.libgdx.rpg.engine.story.StoryTeller;
import com.jukusoft.libgdx.rpg.engine.time.GameTime;
import com.jukusoft.libgdx.rpg.engine.utils.ArrayUtils;
import com.jukusoft.libgdx.rpg.engine.utils.FileUtils;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Justin on 07.02.2017.
*/
public class DefaultStoryTeller implements StoryTeller {
/**
* all story parts
*/
List<StoryPart> storyParts = new ArrayList<>();
protected volatile StoryPart currentPart = null;
protected int currentPartIndex = 0;
protected BitmapFont font = null;
public DefaultStoryTeller (BitmapFont font) {
this.font = font;
}
@Override public void load(String storyFile) throws IOException {
String[] lines = ArrayUtils.convertStringListToArray(FileUtils.readLines(storyFile, StandardCharsets.UTF_8));
StoryPart part = new StoryPart();
this.currentPart = part;
//parse lines
for (String line : lines) {
if (line.startsWith("#")) {
//next part
storyParts.add(part);
part = new StoryPart();
continue;
}
part.addLine(line);
}
storyParts.add(part);
}
@Override public void start() {
this.currentPart.start();
}
@Override public int countParts() {
return this.storyParts.size();
}
@Override public StoryPart getCurrentPart() {
return this.currentPart;
}
@Override public float getPartProgress(long now) {
if (currentPart == null) {
return 1f;
} else {
return currentPart.getPartProgress(now);
}
}
@Override public void update(GameTime time) {
if (currentPart.hasFinished(time.getTime())) {
//switch to next part
this.currentPartIndex++;
if (this.currentPartIndex < this.storyParts.size()) {
this.currentPart = this.storyParts.get(this.currentPartIndex);
this.currentPart.start();
System.out.println("next story part: " + this.currentPartIndex);
} else {
System.out.println("story finished!");
}
}
}
@Override public void draw(GameTime time, SpriteBatch batch, float x, float y, float spacePerLine) {
if (currentPart == null) {
return;
}
String[] lines = this.currentPart.getLineArray();
for (int i = 0; i < lines.length; i++) {
this.font.draw(batch, lines[i], /*(game.getViewportWidth() - 80) / 2*/x, y - (i * spacePerLine));
}
}
@Override public boolean hasFinished() {
return this.currentPartIndex > this.storyParts.size();
}
}
| JuKu/libgdx-test-rpg | engine/src/main/java/com/jukusoft/libgdx/rpg/engine/story/impl/DefaultStoryTeller.java | Java | apache-2.0 | 3,080 |
/*
* Copyright to the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.rioproject.test.log;
import org.junit.runner.RunWith;
import org.rioproject.test.RioTestRunner;
/**
* Tests ServiceEventLog notifications using logback
*
* @author Dennis Reedy
*/
@RunWith(RioTestRunner.class)
public class LogbackServiceLogEventAppenderTest extends BaseServiceEventLogTest {
}
| khartig/assimilator | rio-test/src/test/java/org/rioproject/test/log/LogbackServiceLogEventAppenderTest.java | Java | apache-2.0 | 926 |
/*
* Copyright 2014 NAVER Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.navercorp.pinpoint.web.controller;
import com.navercorp.pinpoint.web.service.oncecloud.ItemService;
import com.navercorp.pinpoint.web.vo.oncecloud.Item;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
/**
* @author wziyong
*/
@Controller
@RequestMapping("/Item")
public class ItemController {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
private ItemService itemService;
/*@RequestMapping(value = "/add", method = RequestMethod.POST)
@ResponseBody
public MyResult add(@RequestParam(value = "name", required = true) String name, @RequestParam(value = "cluster_id", required = true) String cluster_id, @RequestParam(value = "interface", required = true) String interface_addr, @RequestParam(value = "status", required = true) String status, @RequestParam(value = "description", required = false) String desc) {
Host host = new Host();
host.setName(name);
host.setClusterId(Integer.parseInt(cluster_id));
host.setInterfaceAddr(interface_addr);
host.setStatus(Integer.parseInt(status));
host.setDescription(desc);
this.hostService.add(host);
return new MyResult(true, 0, null);
}*/
@RequestMapping(value = "/getList", method = RequestMethod.POST)
@ResponseBody
public List<Item> getItemList(@RequestParam(value = "host_id", required = true) String host_id, @RequestParam(value = "offset", required = false) String offset) {
if (offset != null && offset != "") {
return this.itemService.getList(Integer.parseInt(host_id), Integer.parseInt(offset));
}
else{
return this.itemService.getList(Integer.parseInt(host_id), 0);
}
}
} | wziyong/pinpoint | web/src/main/java/com/navercorp/pinpoint/web/controller/ItemController.java | Java | apache-2.0 | 2,732 |
extern crate ai_behavior;
extern crate find_folder;
extern crate gfx_device_gl;
extern crate graphics;
extern crate nalgebra;
extern crate ncollide;
extern crate piston_window;
extern crate rand;
extern crate sprite;
extern crate uuid;
mod mobs;
use gfx_device_gl::Resources;
use graphics::Image;
use graphics::rectangle::square;
use piston_window::*;
use mobs::{Hero, Star};
use sprite::*;
pub struct Game {
scene: Scene<Texture<Resources>>,
player: Hero,
stars: Vec<Star>,
diag: bool,
pause: bool,
victory: bool,
loss: bool,
}
const TILE_SIZE: u32 = 64;
impl Game {
pub fn new(w: &mut PistonWindow) -> Game {
let mut scene = Scene::new();
let mut stars: Vec<Star> = vec![];
for number in 1..7 {
let color = match number % 4 {
1 => "yellow",
2 => "green",
3 => "blue",
_ => "pink",
};
stars.push(Star::new(color, w, &mut scene));
}
let player = Hero::new(w, &mut scene);
Game {
scene: scene,
player: player,
stars: stars,
diag: false,
pause: false,
victory: false,
loss: false,
}
}
pub fn on_update(&mut self, e: &Input, upd: UpdateArgs, w: &PistonWindow) {
if self.pause || self.victory || self.loss {
return;
}
self.scene.event(e);
let mut grew = false;
for mut star in &mut self.stars {
if !star.destroyed && self.player.collides(&star) {
star.destroy(&mut self.scene, upd.dt);
self.player.grow(&mut self.scene, upd.dt);
grew = true;
} else {
star.mov(w, &mut self.scene, upd.dt);
}
}
if self.stars.iter().all(|star| star.destroyed) {
self.victory = true;
self.loss = false;
return;
}
if !grew {
self.player.shrink(&mut self.scene, upd.dt);
}
if self.player.size > 0.0 {
self.player.mov(w, &mut self.scene, upd.dt);
} else {
self.loss = true;
self.victory = false;
}
}
pub fn on_draw(&mut self, e: &Input, _: RenderArgs, w: &mut PistonWindow) {
let assets = find_folder::Search::ParentsThenKids(3, 3)
.for_folder("assets")
.unwrap();
let ref font = assets.join("Fresca-Regular.ttf");
let factory = w.factory.clone();
let mut glyphs = Glyphs::new(font, factory).unwrap();
let Size { height, width } = w.size();
let image = Image::new().rect(square(0.0, 0.0, width as f64));
let bg = Texture::from_path(&mut w.factory,
assets.join("bg.png"),
Flip::None,
&TextureSettings::new()).unwrap();
w.draw_2d(e, |c, g| {
clear([1.0, 1.0, 1.0, 1.0], g);
let cols = width / TILE_SIZE;
// 4:3 means rows will be fractional so add one to cover completely
let tile_count = cols * (height / TILE_SIZE + 1);
for number in 0..tile_count {
let x: f64 = (number % cols * TILE_SIZE).into();
let y: f64 = (number / cols * TILE_SIZE).into();
image.draw(&bg, &Default::default(), c.transform.trans(x, y).zoom(1.0 / cols as f64), g);
}
if self.victory {
text::Text::new_color([0.0, 1.0, 0.0, 1.0], height / 10).draw(
"Hurray! You win!",
&mut glyphs,
&c.draw_state,
c.transform.trans(width as f64 / 2.0 - width as f64 / 4.5, height as f64 / 2.0), g
);
return;
} else if self.loss {
text::Text::new_color([0.0, 1.0, 0.0, 1.0], height / 10).draw(
"Aw! You lose!",
&mut glyphs,
&c.draw_state,
c.transform.trans(width as f64 / 2.0 - width as f64 / 4.5, height as f64 / 2.0), g
);
return;
}
if self.diag {
text::Text::new_color([0.0, 1.0, 0.0, 1.0], 10).draw(
&format!("{}", self.player.diag()),
&mut glyphs,
&c.draw_state,
c.transform.trans(10.0, 10.0), g
);
}
self.scene.draw(c.transform, g);
});
}
// TODO use an enum to track requested movement direction
pub fn on_input(&mut self, inp: Input) {
match inp {
Input::Press(but) => {
match but {
Button::Keyboard(Key::Up) => {
self.player.dir = (self.player.dir.0, -1.0);
}
Button::Keyboard(Key::Down) => {
self.player.dir = (self.player.dir.0, 1.0);
}
Button::Keyboard(Key::Left) => {
self.player.dir = (-1.0, self.player.dir.1);
}
Button::Keyboard(Key::Right) => {
self.player.dir = (1.0, self.player.dir.1);
}
_ => {}
}
}
Input::Release(but) => {
match but {
Button::Keyboard(Key::Up) => {
self.player.dir = (self.player.dir.0, 0.0);
}
Button::Keyboard(Key::Down) => {
self.player.dir = (self.player.dir.0, 0.0);
}
Button::Keyboard(Key::Left) => {
self.player.dir = (0.0, self.player.dir.1);
}
Button::Keyboard(Key::Right) => {
self.player.dir = (0.0, self.player.dir.1);
}
Button::Keyboard(Key::H) => {
self.diag = !self.diag;
}
Button::Keyboard(Key::P) => {
self.pause = !self.pause;
}
_ => {}
}
}
_ => {}
}
}
}
| commandline/susuwatari-game | src/lib.rs | Rust | apache-2.0 | 6,452 |
var editMode = portal.request.mode == 'edit';
var content = portal.content;
var component = portal.component;
var layoutRegions = portal.layoutRegions;
var body = system.thymeleaf.render('view/layout-70-30.html', {
title: content.displayName,
path: content.path,
name: content.name,
editable: editMode,
resourcesPath: portal.url.createResourceUrl(''),
component: component,
leftRegion: layoutRegions.getRegion("left"),
rightRegion: layoutRegions.getRegion("right")
});
portal.response.body = body;
portal.response.contentType = 'text/html';
portal.response.status = 200;
| RF0/wem-sample-package | modules/xeon-1.0.0/component/layout-70-30/get.js | JavaScript | apache-2.0 | 607 |
# jsp-aufgabe04ab_api
jsp-aufgabe04ab_api
| hemmerling/jsp-aufgabe04ab_api | README.md | Markdown | apache-2.0 | 42 |
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ASC.Data.Backup.Console")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Ascensio System SIA")]
[assembly: AssemblyProduct("ASC.Data.Backup.Console")]
[assembly: AssemblyCopyright("(c) Ascensio System SIA. All rights reserved")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("5b6a14ab-a2a0-427c-bdb0-9a0b682e2771")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| ONLYOFFICE/CommunityServer | common/ASC.Data.Backup.Console/Properties/AssemblyInfo.cs | C# | apache-2.0 | 1,460 |
/*
* Copyright 2009-2021 The VOTCA Development Team (http://www.votca.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#define BOOST_TEST_MAIN
#define BOOST_TEST_MODULE beadstructure_test
// Standard includes
#include <stdexcept>
// Third party includes
#include <boost/test/unit_test.hpp>
// VOTCA includes
#include <votca/tools/types.h>
// Local VOTCA includes
#include "votca/csg/basebead.h"
#include "votca/csg/beadstructure.h" // IWYU pragma: keep
using namespace std;
using namespace votca::csg;
using namespace votca::tools;
class TestBead : public BaseBead {
public:
TestBead() : BaseBead(){};
};
BOOST_AUTO_TEST_SUITE(beadstructure_test)
BOOST_AUTO_TEST_CASE(test_beadstructure_constructor) {
BeadStructure beadstructure;
}
BOOST_AUTO_TEST_CASE(test_beadstructure_beadcount) {
BeadStructure beadstructure;
BOOST_CHECK_EQUAL(beadstructure.BeadCount(), 0);
}
BOOST_AUTO_TEST_CASE(test_beadstructure_add_and_getbead) {
BeadStructure beadstructure;
TestBead testbead;
testbead.setId(2);
testbead.setName("Carbon");
beadstructure.AddBead(testbead);
BOOST_CHECK_EQUAL(beadstructure.BeadCount(), 1);
BOOST_CHECK(beadstructure.BeadExist(2));
}
BOOST_AUTO_TEST_CASE(test_beadstructure_ConnectBeads) {
BeadStructure beadstructure;
TestBead testbead1;
testbead1.setId(1);
testbead1.setName("Carbon");
TestBead testbead2;
testbead2.setId(2);
testbead2.setName("Carbon");
beadstructure.AddBead(testbead1);
beadstructure.AddBead(testbead2);
beadstructure.ConnectBeads(1, 2);
}
BOOST_AUTO_TEST_CASE(test_beadstructure_getBeadIds) {
BeadStructure beadstructure;
TestBead testbead1;
testbead1.setId(1);
testbead1.setName("Carbon");
TestBead testbead2;
testbead2.setId(2);
testbead2.setName("Carbon");
beadstructure.AddBead(testbead1);
beadstructure.AddBead(testbead2);
vector<votca::Index> bead_ids = beadstructure.getBeadIds();
BOOST_CHECK_EQUAL(bead_ids.size(), 2);
sort(bead_ids.begin(), bead_ids.end());
BOOST_CHECK_EQUAL(bead_ids.at(0), 1);
BOOST_CHECK_EQUAL(bead_ids.at(1), 2);
}
BOOST_AUTO_TEST_CASE(test_beadstructure_getSubStructure) {
BeadStructure beadstructure;
TestBead testbead1;
testbead1.setId(1);
testbead1.setName("Carbon");
TestBead testbead2;
testbead2.setId(2);
testbead2.setName("Carbon");
TestBead testbead3;
testbead3.setId(3);
testbead3.setName("Hydrogen");
beadstructure.AddBead(testbead1);
beadstructure.AddBead(testbead2);
beadstructure.AddBead(testbead3);
beadstructure.ConnectBeads(1, 2);
beadstructure.ConnectBeads(2, 3);
vector<votca::Index> CH = {2, 3};
vector<Edge> CH_bond = {Edge(2, 3)};
BeadStructure CHstructure = beadstructure.getSubStructure(CH, CH_bond);
BOOST_CHECK(CHstructure.BeadExist(2));
BOOST_CHECK(CHstructure.BeadExist(3));
/// Should Throw bond connecting bead 1 and 3 is not in beadstructure
vector<Edge> CH_bond_false = {Edge(1, 3)};
BOOST_CHECK_THROW(beadstructure.getSubStructure(CH, CH_bond_false),
std::runtime_error);
/// Should Throw bead with id 4 is not in beadstructure
vector<votca::Index> CHH_false = {2, 3, 4};
BOOST_CHECK_THROW(beadstructure.getSubStructure(CHH_false, CH_bond),
std::runtime_error);
}
BOOST_AUTO_TEST_CASE(test_beadstructure_isSingleStructure) {
BeadStructure beadstructure;
TestBead testbead1;
testbead1.setName("Carbon");
testbead1.setId(1);
TestBead testbead2;
testbead2.setName("Carbon");
testbead2.setId(2);
TestBead testbead3;
testbead3.setName("Oxygen");
testbead3.setId(3);
TestBead testbead4;
testbead4.setName("Hydrogen");
testbead4.setId(4);
TestBead testbead5;
testbead5.setName("Hydrogen");
testbead5.setId(5);
beadstructure.AddBead(testbead1);
beadstructure.AddBead(testbead2);
BOOST_CHECK(!beadstructure.isSingleStructure());
// C - C
beadstructure.ConnectBeads(1, 2);
BOOST_CHECK(beadstructure.isSingleStructure());
// C - C O
beadstructure.AddBead(testbead3);
BOOST_CHECK(!beadstructure.isSingleStructure());
// C - C - O
beadstructure.ConnectBeads(2, 3);
BOOST_CHECK(beadstructure.isSingleStructure());
// C - C - O H - H
beadstructure.AddBead(testbead4);
beadstructure.AddBead(testbead5);
beadstructure.ConnectBeads(4, 5);
BOOST_CHECK(!beadstructure.isSingleStructure());
}
BOOST_AUTO_TEST_CASE(test_beadstructure_isStructureEquivalent) {
BeadStructure beadstructure1;
BeadStructure beadstructure2;
// Beads for bead structure 1
TestBead testbead1;
testbead1.setName("Carbon");
testbead1.setId(1);
TestBead testbead2;
testbead2.setName("Carbon");
testbead2.setId(2);
TestBead testbead3;
testbead3.setName("Oxygen");
testbead3.setId(3);
TestBead testbead4;
testbead4.setName("Hydrogen");
testbead4.setId(4);
TestBead testbead5;
testbead5.setName("Hydrogen");
testbead5.setId(5);
// Beads for bead structure 2
TestBead testbead6;
testbead6.setName("Carbon");
testbead6.setId(6);
TestBead testbead7;
testbead7.setName("Carbon");
testbead7.setId(7);
TestBead testbead8;
testbead8.setName("Oxygen");
testbead8.setId(8);
TestBead testbead9;
testbead9.setName("Hydrogen");
testbead9.setId(9);
TestBead testbead10;
testbead10.setName("Hydrogen");
testbead10.setId(10);
BOOST_CHECK(beadstructure1.isStructureEquivalent(beadstructure2));
beadstructure1.AddBead(testbead1);
BOOST_CHECK(!beadstructure1.isStructureEquivalent(beadstructure2));
beadstructure2.AddBead(testbead6);
BOOST_CHECK(beadstructure1.isStructureEquivalent(beadstructure2));
beadstructure1.AddBead(testbead2);
beadstructure2.AddBead(testbead7);
beadstructure1.ConnectBeads(1, 2);
BOOST_CHECK(!beadstructure1.isStructureEquivalent(beadstructure2));
beadstructure2.ConnectBeads(6, 7);
BOOST_CHECK(beadstructure1.isStructureEquivalent(beadstructure2));
beadstructure1.AddBead(testbead3);
beadstructure1.AddBead(testbead4);
beadstructure1.AddBead(testbead5);
beadstructure1.ConnectBeads(2, 3);
beadstructure1.ConnectBeads(4, 5);
beadstructure2.AddBead(testbead10);
beadstructure2.AddBead(testbead8);
beadstructure2.AddBead(testbead9);
beadstructure2.ConnectBeads(7, 8);
beadstructure2.ConnectBeads(9, 10);
BOOST_CHECK(beadstructure1.isStructureEquivalent(beadstructure2));
}
BOOST_AUTO_TEST_CASE(test_beadstructure_getNeighBeadIds) {
BeadStructure beadstructure1;
// Beads for bead structure 1
// Make a methane molecule
//
// H
// |
// H - C - H
// |
// H
//
TestBead testbead1;
testbead1.setName("Hydrogen");
testbead1.setId(1);
TestBead testbead2;
testbead2.setName("Carbon");
testbead2.setId(2);
TestBead testbead3;
testbead3.setName("Hydrogen");
testbead3.setId(3);
TestBead testbead4;
testbead4.setName("Hydrogen");
testbead4.setId(4);
TestBead testbead5;
testbead5.setName("Hydrogen");
testbead5.setId(5);
// Make a Water molecule
//
// H - O - H
//
TestBead testbead6;
testbead6.setName("Hydrogen");
testbead6.setId(6);
TestBead testbead7;
testbead7.setName("Oxygen");
testbead7.setId(7);
TestBead testbead8;
testbead8.setName("Hydrogen");
testbead8.setId(8);
beadstructure1.AddBead(testbead1);
beadstructure1.AddBead(testbead2);
beadstructure1.AddBead(testbead3);
beadstructure1.AddBead(testbead4);
beadstructure1.AddBead(testbead5);
beadstructure1.AddBead(testbead6);
beadstructure1.AddBead(testbead7);
beadstructure1.AddBead(testbead8);
// At this point non of the beads are connected so should return a vector of
// size 0
auto v1 = beadstructure1.getNeighBeadIds(1);
BOOST_CHECK_EQUAL(v1.size(), 0);
auto v2 = beadstructure1.getNeighBeadIds(2);
BOOST_CHECK_EQUAL(v2.size(), 0);
auto v3 = beadstructure1.getNeighBeadIds(3);
BOOST_CHECK_EQUAL(v3.size(), 0);
auto v4 = beadstructure1.getNeighBeadIds(4);
BOOST_CHECK_EQUAL(v4.size(), 0);
auto v5 = beadstructure1.getNeighBeadIds(5);
BOOST_CHECK_EQUAL(v5.size(), 0);
auto v6 = beadstructure1.getNeighBeadIds(1);
BOOST_CHECK_EQUAL(v6.size(), 0);
auto v7 = beadstructure1.getNeighBeadIds(7);
BOOST_CHECK_EQUAL(v7.size(), 0);
auto v8 = beadstructure1.getNeighBeadIds(8);
BOOST_CHECK_EQUAL(v8.size(), 0);
// Connect beads
beadstructure1.ConnectBeads(1, 2);
beadstructure1.ConnectBeads(3, 2);
beadstructure1.ConnectBeads(4, 2);
beadstructure1.ConnectBeads(5, 2);
beadstructure1.ConnectBeads(6, 7);
beadstructure1.ConnectBeads(7, 8);
v1 = beadstructure1.getNeighBeadIds(1);
BOOST_CHECK_EQUAL(v1.size(), 1);
v2 = beadstructure1.getNeighBeadIds(2);
BOOST_CHECK_EQUAL(v2.size(), 4);
v3 = beadstructure1.getNeighBeadIds(3);
BOOST_CHECK_EQUAL(v3.size(), 1);
v4 = beadstructure1.getNeighBeadIds(4);
BOOST_CHECK_EQUAL(v4.size(), 1);
v5 = beadstructure1.getNeighBeadIds(5);
BOOST_CHECK_EQUAL(v5.size(), 1);
v6 = beadstructure1.getNeighBeadIds(1);
BOOST_CHECK_EQUAL(v6.size(), 1);
v7 = beadstructure1.getNeighBeadIds(7);
BOOST_CHECK_EQUAL(v7.size(), 2);
v8 = beadstructure1.getNeighBeadIds(8);
BOOST_CHECK_EQUAL(v8.size(), 1);
}
BOOST_AUTO_TEST_CASE(test_beadstructure_catchError) {
{
TestBead testbead1;
testbead1.setName("Hydrogen");
testbead1.setId(1);
TestBead testbead2;
testbead2.setName("Carbon");
testbead2.setId(2);
TestBead testbead3;
testbead3.setName("Hydrogen");
testbead3.setId(3);
TestBead testbead4;
testbead4.setName("Hydrogen");
testbead4.setId(4);
TestBead testbead5;
testbead5.setName("Hydrogen");
testbead5.setId(5);
TestBead testbead6;
testbead6.setName("Hydrogen");
testbead6.setId(5);
BeadStructure beadstructure;
beadstructure.AddBead(testbead1);
beadstructure.AddBead(testbead2);
beadstructure.AddBead(testbead3);
beadstructure.AddBead(testbead4);
beadstructure.AddBead(testbead5);
BOOST_CHECK_THROW(beadstructure.AddBead(testbead6), invalid_argument);
BOOST_CHECK_THROW(beadstructure.ConnectBeads(0, 1), invalid_argument);
BOOST_CHECK_THROW(beadstructure.ConnectBeads(5, 6), invalid_argument);
BOOST_CHECK_THROW(beadstructure.ConnectBeads(1, 1), invalid_argument);
}
}
BOOST_AUTO_TEST_SUITE_END()
| votca/csg | src/tests/test_beadstructure_base.cc | C++ | apache-2.0 | 10,755 |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Arch.CMessaging.Client.Impl.Consumer
{
public interface IDisposed
{
bool IsDispose { get; }
}
}
| zesus19/hermes.net | Arch.CMessaging.Client/CMessagingV1/Impl/Consumer/IDisposed.cs | C# | apache-2.0 | 216 |
SqlDataModel
============
A small example of implementing a SQL CRUD in Qt that can be used in a DataModel (already integrated and functional in a DataModel).
| danielsanfr/sqldatamodel | README.md | Markdown | apache-2.0 | 160 |
/**
* Solutii Ecommerce, Automatizare, Validare si Analiza | Seava.ro
* Copyright: 2013 Nan21 Electronics SRL. All rights reserved.
* Use is subject to license terms.
*/
Ext.define("seava.ad.ui.extjs.frame.DateFormatMask_Ui", {
extend: "e4e.ui.AbstractUi",
alias: "widget.DateFormatMask_Ui",
/**
* Data-controls definition
*/
_defineDcs_: function() {
this._getBuilder_().addDc("mask", Ext.create(seava.ad.ui.extjs.dc.DateFormatMask_Dc,{multiEdit: true}))
;
},
/**
* Components definition
*/
_defineElements_: function() {
this._getBuilder_()
.addDcFilterFormView("mask", {name:"maskFilter", xtype:"ad_DateFormatMask_Dc$Filter"})
.addDcEditGridView("mask", {name:"maskEditList", xtype:"ad_DateFormatMask_Dc$EditList", frame:true})
.addPanel({name:"main", layout:"border", defaults:{split:true}});
},
/**
* Combine the components
*/
_linkElements_: function() {
this._getBuilder_()
.addChildrenTo("main", ["maskFilter", "maskEditList"], ["north", "center"])
.addToolbarTo("main", "tlbMaskList");
},
/**
* Create toolbars
*/
_defineToolbars_: function() {
this._getBuilder_()
.beginToolbar("tlbMaskList", {dc: "mask"})
.addTitle().addSeparator().addSeparator()
.addQuery().addSave().addCancel()
.addReports()
.end();
}
});
| seava/seava.mod.ad | seava.mod.ad.ui.extjs/src/main/resources/webapp/seava/ad/ui/extjs/frame/DateFormatMask_Ui.js | JavaScript | apache-2.0 | 1,296 |
// modules are defined as an array
// [ module function, map of requireuires ]
//
// map of requireuires is short require name -> numeric require
//
// anything defined in a previous bundle is accessed via the
// orig method which is the requireuire for previous bundles
(function outer (modules, cache, entry) {
// Save the require from previous bundle to this closure if any
var previousRequire = typeof require == "function" && require;
function findProxyquireifyName() {
var deps = Object.keys(modules)
.map(function (k) { return modules[k][1]; });
for (var i = 0; i < deps.length; i++) {
var pq = deps[i]['proxyquireify'];
if (pq) return pq;
}
}
var proxyquireifyName = findProxyquireifyName();
function newRequire(name, jumped){
// Find the proxyquireify module, if present
var pqify = (proxyquireifyName != null) && cache[proxyquireifyName];
// Proxyquireify provides a separate cache that is used when inside
// a proxyquire call, and is set to null outside a proxyquire call.
// This allows the regular caching semantics to work correctly both
// inside and outside proxyquire calls while keeping the cached
// modules isolated.
// When switching from one proxyquire call to another, it clears
// the cache to prevent contamination between different sets
// of stubs.
var currentCache = (pqify && pqify.exports._cache) || cache;
if(!currentCache[name]) {
if(!modules[name]) {
// if we cannot find the the module within our internal map or
// cache jump to the current global require ie. the last bundle
// that was added to the page.
var currentRequire = typeof require == "function" && require;
if (!jumped && currentRequire) return currentRequire(name, true);
// If there are other bundles on this page the require from the
// previous one is saved to 'previousRequire'. Repeat this as
// many times as there are bundles until the module is found or
// we exhaust the require chain.
if (previousRequire) return previousRequire(name, true);
var err = new Error('Cannot find module \'' + name + '\'');
err.code = 'MODULE_NOT_FOUND';
throw err;
}
var m = currentCache[name] = {exports:{}};
// The normal browserify require function
var req = function(x){
var id = modules[name][1][x];
return newRequire(id ? id : x);
};
// The require function substituted for proxyquireify
var moduleRequire = function(x){
var pqify = (proxyquireifyName != null) && cache[proxyquireifyName];
// Only try to use the proxyquireify version if it has been `require`d
if (pqify && pqify.exports._proxy) {
return pqify.exports._proxy(req, x);
} else {
return req(x);
}
};
modules[name][0].call(m.exports,moduleRequire,m,m.exports,outer,modules,currentCache,entry);
}
return currentCache[name].exports;
}
for(var i=0;i<entry.length;i++) newRequire(entry[i]);
// Override the current require with this new one
return newRequire;
})
({1:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var ctor = ( typeof Float32Array === 'function' ) ? Float32Array : void 0; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = ctor;
},{}],2:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Typed array constructor which returns a typed array representing an array of single-precision floating-point numbers in the platform byte order.
*
* @module @stdlib/array/float32
*
* @example
* var ctor = require( '@stdlib/array/float32' );
*
* var arr = new ctor( 10 );
* // returns <Float32Array>
*/
// MODULES //
var hasFloat32ArraySupport = require( '@stdlib/assert/has-float32array-support' );
var builtin = require( './float32array.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var ctor;
if ( hasFloat32ArraySupport() ) {
ctor = builtin;
} else {
ctor = polyfill;
}
// EXPORTS //
module.exports = ctor;
},{"./float32array.js":1,"./polyfill.js":3,"@stdlib/assert/has-float32array-support":29}],3:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// TODO: write polyfill
// MAIN //
/**
* Typed array which represents an array of single-precision floating-point numbers in the platform byte order.
*
* @throws {Error} not implemented
*/
function polyfill() {
throw new Error( 'not implemented' );
}
// EXPORTS //
module.exports = polyfill;
},{}],4:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var ctor = ( typeof Float64Array === 'function' ) ? Float64Array : void 0; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = ctor;
},{}],5:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in the platform byte order.
*
* @module @stdlib/array/float64
*
* @example
* var ctor = require( '@stdlib/array/float64' );
*
* var arr = new ctor( 10 );
* // returns <Float64Array>
*/
// MODULES //
var hasFloat64ArraySupport = require( '@stdlib/assert/has-float64array-support' );
var builtin = require( './float64array.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var ctor;
if ( hasFloat64ArraySupport() ) {
ctor = builtin;
} else {
ctor = polyfill;
}
// EXPORTS //
module.exports = ctor;
},{"./float64array.js":4,"./polyfill.js":6,"@stdlib/assert/has-float64array-support":32}],6:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// TODO: write polyfill
// MAIN //
/**
* Typed array which represents an array of double-precision floating-point numbers in the platform byte order.
*
* @throws {Error} not implemented
*/
function polyfill() {
throw new Error( 'not implemented' );
}
// EXPORTS //
module.exports = polyfill;
},{}],7:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Typed array constructor which returns a typed array representing an array of twos-complement 16-bit signed integers in the platform byte order.
*
* @module @stdlib/array/int16
*
* @example
* var ctor = require( '@stdlib/array/int16' );
*
* var arr = new ctor( 10 );
* // returns <Int16Array>
*/
// MODULES //
var hasInt16ArraySupport = require( '@stdlib/assert/has-int16array-support' );
var builtin = require( './int16array.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var ctor;
if ( hasInt16ArraySupport() ) {
ctor = builtin;
} else {
ctor = polyfill;
}
// EXPORTS //
module.exports = ctor;
},{"./int16array.js":8,"./polyfill.js":9,"@stdlib/assert/has-int16array-support":34}],8:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var ctor = ( typeof Int16Array === 'function' ) ? Int16Array : void 0; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = ctor;
},{}],9:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// TODO: write polyfill
// MAIN //
/**
* Typed array which represents an array of twos-complement 16-bit signed integers in the platform byte order.
*
* @throws {Error} not implemented
*/
function polyfill() {
throw new Error( 'not implemented' );
}
// EXPORTS //
module.exports = polyfill;
},{}],10:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Typed array constructor which returns a typed array representing an array of twos-complement 32-bit signed integers in the platform byte order.
*
* @module @stdlib/array/int32
*
* @example
* var ctor = require( '@stdlib/array/int32' );
*
* var arr = new ctor( 10 );
* // returns <Int32Array>
*/
// MODULES //
var hasInt32ArraySupport = require( '@stdlib/assert/has-int32array-support' );
var builtin = require( './int32array.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var ctor;
if ( hasInt32ArraySupport() ) {
ctor = builtin;
} else {
ctor = polyfill;
}
// EXPORTS //
module.exports = ctor;
},{"./int32array.js":11,"./polyfill.js":12,"@stdlib/assert/has-int32array-support":37}],11:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var ctor = ( typeof Int32Array === 'function' ) ? Int32Array : void 0; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = ctor;
},{}],12:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// TODO: write polyfill
// MAIN //
/**
* Typed array which represents an array of twos-complement 32-bit signed integers in the platform byte order.
*
* @throws {Error} not implemented
*/
function polyfill() {
throw new Error( 'not implemented' );
}
// EXPORTS //
module.exports = polyfill;
},{}],13:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Typed array constructor which returns a typed array representing an array of twos-complement 8-bit signed integers in the platform byte order.
*
* @module @stdlib/array/int8
*
* @example
* var ctor = require( '@stdlib/array/int8' );
*
* var arr = new ctor( 10 );
* // returns <Int8Array>
*/
// MODULES //
var hasInt8ArraySupport = require( '@stdlib/assert/has-int8array-support' );
var builtin = require( './int8array.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var ctor;
if ( hasInt8ArraySupport() ) {
ctor = builtin;
} else {
ctor = polyfill;
}
// EXPORTS //
module.exports = ctor;
},{"./int8array.js":14,"./polyfill.js":15,"@stdlib/assert/has-int8array-support":40}],14:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var ctor = ( typeof Int8Array === 'function' ) ? Int8Array : void 0; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = ctor;
},{}],15:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// TODO: write polyfill
// MAIN //
/**
* Typed array which represents an array of twos-complement 8-bit signed integers in the platform byte order.
*
* @throws {Error} not implemented
*/
function polyfill() {
throw new Error( 'not implemented' );
}
// EXPORTS //
module.exports = polyfill;
},{}],16:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Typed array constructor which returns a typed array representing an array of 16-bit unsigned integers in the platform byte order.
*
* @module @stdlib/array/uint16
*
* @example
* var ctor = require( '@stdlib/array/uint16' );
*
* var arr = new ctor( 10 );
* // returns <Uint16Array>
*/
// MODULES //
var hasUint16ArraySupport = require( '@stdlib/assert/has-uint16array-support' );
var builtin = require( './uint16array.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var ctor;
if ( hasUint16ArraySupport() ) {
ctor = builtin;
} else {
ctor = polyfill;
}
// EXPORTS //
module.exports = ctor;
},{"./polyfill.js":17,"./uint16array.js":18,"@stdlib/assert/has-uint16array-support":52}],17:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// TODO: write polyfill
// MAIN //
/**
* Typed array which represents an array of 16-bit unsigned integers in the platform byte order.
*
* @throws {Error} not implemented
*/
function polyfill() {
throw new Error( 'not implemented' );
}
// EXPORTS //
module.exports = polyfill;
},{}],18:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var ctor = ( typeof Uint16Array === 'function' ) ? Uint16Array : void 0; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = ctor;
},{}],19:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Typed array constructor which returns a typed array representing an array of 32-bit unsigned integers in the platform byte order.
*
* @module @stdlib/array/uint32
*
* @example
* var ctor = require( '@stdlib/array/uint32' );
*
* var arr = new ctor( 10 );
* // returns <Uint32Array>
*/
// MODULES //
var hasUint32ArraySupport = require( '@stdlib/assert/has-uint32array-support' );
var builtin = require( './uint32array.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var ctor;
if ( hasUint32ArraySupport() ) {
ctor = builtin;
} else {
ctor = polyfill;
}
// EXPORTS //
module.exports = ctor;
},{"./polyfill.js":20,"./uint32array.js":21,"@stdlib/assert/has-uint32array-support":55}],20:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// TODO: write polyfill
// MAIN //
/**
* Typed array which represents an array of 32-bit unsigned integers in the platform byte order.
*
* @throws {Error} not implemented
*/
function polyfill() {
throw new Error( 'not implemented' );
}
// EXPORTS //
module.exports = polyfill;
},{}],21:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var ctor = ( typeof Uint32Array === 'function' ) ? Uint32Array : void 0; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = ctor;
},{}],22:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Typed array constructor which returns a typed array representing an array of 8-bit unsigned integers in the platform byte order.
*
* @module @stdlib/array/uint8
*
* @example
* var ctor = require( '@stdlib/array/uint8' );
*
* var arr = new ctor( 10 );
* // returns <Uint8Array>
*/
// MODULES //
var hasUint8ArraySupport = require( '@stdlib/assert/has-uint8array-support' );
var builtin = require( './uint8array.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var ctor;
if ( hasUint8ArraySupport() ) {
ctor = builtin;
} else {
ctor = polyfill;
}
// EXPORTS //
module.exports = ctor;
},{"./polyfill.js":23,"./uint8array.js":24,"@stdlib/assert/has-uint8array-support":58}],23:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// TODO: write polyfill
// MAIN //
/**
* Typed array which represents an array of 8-bit unsigned integers in the platform byte order.
*
* @throws {Error} not implemented
*/
function polyfill() {
throw new Error( 'not implemented' );
}
// EXPORTS //
module.exports = polyfill;
},{}],24:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var ctor = ( typeof Uint8Array === 'function' ) ? Uint8Array : void 0; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = ctor;
},{}],25:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Typed array constructor which returns a typed array representing an array of 8-bit unsigned integers in the platform byte order clamped to 0-255.
*
* @module @stdlib/array/uint8c
*
* @example
* var ctor = require( '@stdlib/array/uint8c' );
*
* var arr = new ctor( 10 );
* // returns <Uint8ClampedArray>
*/
// MODULES //
var hasUint8ClampedArraySupport = require( '@stdlib/assert/has-uint8clampedarray-support' ); // eslint-disable-line id-length
var builtin = require( './uint8clampedarray.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var ctor;
if ( hasUint8ClampedArraySupport() ) {
ctor = builtin;
} else {
ctor = polyfill;
}
// EXPORTS //
module.exports = ctor;
},{"./polyfill.js":26,"./uint8clampedarray.js":27,"@stdlib/assert/has-uint8clampedarray-support":61}],26:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// TODO: write polyfill
// MAIN //
/**
* Typed array which represents an array of 8-bit unsigned integers in the platform byte order clamped to 0-255.
*
* @throws {Error} not implemented
*/
function polyfill() {
throw new Error( 'not implemented' );
}
// EXPORTS //
module.exports = polyfill;
},{}],27:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var ctor = ( typeof Uint8ClampedArray === 'function' ) ? Uint8ClampedArray : void 0; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = ctor;
},{}],28:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var main = ( typeof Float32Array === 'function' ) ? Float32Array : null; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = main;
},{}],29:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test for native `Float32Array` support.
*
* @module @stdlib/assert/has-float32array-support
*
* @example
* var hasFloat32ArraySupport = require( '@stdlib/assert/has-float32array-support' );
*
* var bool = hasFloat32ArraySupport();
* // returns <boolean>
*/
// MODULES //
var hasFloat32ArraySupport = require( './main.js' );
// EXPORTS //
module.exports = hasFloat32ArraySupport;
},{"./main.js":30}],30:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isFloat32Array = require( '@stdlib/assert/is-float32array' );
var PINF = require( '@stdlib/constants/float64/pinf' );
var GlobalFloat32Array = require( './float32array.js' );
// MAIN //
/**
* Tests for native `Float32Array` support.
*
* @returns {boolean} boolean indicating if an environment has `Float32Array` support
*
* @example
* var bool = hasFloat32ArraySupport();
* // returns <boolean>
*/
function hasFloat32ArraySupport() {
var bool;
var arr;
if ( typeof GlobalFloat32Array !== 'function' ) {
return false;
}
// Test basic support...
try {
arr = new GlobalFloat32Array( [ 1.0, 3.14, -3.14, 5.0e40 ] );
bool = (
isFloat32Array( arr ) &&
arr[ 0 ] === 1.0 &&
arr[ 1 ] === 3.140000104904175 &&
arr[ 2 ] === -3.140000104904175 &&
arr[ 3 ] === PINF
);
} catch ( err ) { // eslint-disable-line no-unused-vars
bool = false;
}
return bool;
}
// EXPORTS //
module.exports = hasFloat32ArraySupport;
},{"./float32array.js":28,"@stdlib/assert/is-float32array":89,"@stdlib/constants/float64/pinf":225}],31:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var main = ( typeof Float64Array === 'function' ) ? Float64Array : null; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = main;
},{}],32:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test for native `Float64Array` support.
*
* @module @stdlib/assert/has-float64array-support
*
* @example
* var hasFloat64ArraySupport = require( '@stdlib/assert/has-float64array-support' );
*
* var bool = hasFloat64ArraySupport();
* // returns <boolean>
*/
// MODULES //
var hasFloat64ArraySupport = require( './main.js' );
// EXPORTS //
module.exports = hasFloat64ArraySupport;
},{"./main.js":33}],33:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isFloat64Array = require( '@stdlib/assert/is-float64array' );
var GlobalFloat64Array = require( './float64array.js' );
// MAIN //
/**
* Tests for native `Float64Array` support.
*
* @returns {boolean} boolean indicating if an environment has `Float64Array` support
*
* @example
* var bool = hasFloat64ArraySupport();
* // returns <boolean>
*/
function hasFloat64ArraySupport() {
var bool;
var arr;
if ( typeof GlobalFloat64Array !== 'function' ) {
return false;
}
// Test basic support...
try {
arr = new GlobalFloat64Array( [ 1.0, 3.14, -3.14, NaN ] );
bool = (
isFloat64Array( arr ) &&
arr[ 0 ] === 1.0 &&
arr[ 1 ] === 3.14 &&
arr[ 2 ] === -3.14 &&
arr[ 3 ] !== arr[ 3 ]
);
} catch ( err ) { // eslint-disable-line no-unused-vars
bool = false;
}
return bool;
}
// EXPORTS //
module.exports = hasFloat64ArraySupport;
},{"./float64array.js":31,"@stdlib/assert/is-float64array":91}],34:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test for native `Int16Array` support.
*
* @module @stdlib/assert/has-int16array-support
*
* @example
* var hasInt16ArraySupport = require( '@stdlib/assert/has-int16array-support' );
*
* var bool = hasInt16ArraySupport();
* // returns <boolean>
*/
// MODULES //
var hasInt16ArraySupport = require( './main.js' );
// EXPORTS //
module.exports = hasInt16ArraySupport;
},{"./main.js":36}],35:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var main = ( typeof Int16Array === 'function' ) ? Int16Array : null; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = main;
},{}],36:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isInt16Array = require( '@stdlib/assert/is-int16array' );
var INT16_MAX = require( '@stdlib/constants/int16/max' );
var INT16_MIN = require( '@stdlib/constants/int16/min' );
var GlobalInt16Array = require( './int16array.js' );
// MAIN //
/**
* Tests for native `Int16Array` support.
*
* @returns {boolean} boolean indicating if an environment has `Int16Array` support
*
* @example
* var bool = hasInt16ArraySupport();
* // returns <boolean>
*/
function hasInt16ArraySupport() {
var bool;
var arr;
if ( typeof GlobalInt16Array !== 'function' ) {
return false;
}
// Test basic support...
try {
arr = new GlobalInt16Array( [ 1, 3.14, -3.14, INT16_MAX+1 ] );
bool = (
isInt16Array( arr ) &&
arr[ 0 ] === 1 &&
arr[ 1 ] === 3 && // truncation
arr[ 2 ] === -3 && // truncation
arr[ 3 ] === INT16_MIN // wrap around
);
} catch ( err ) { // eslint-disable-line no-unused-vars
bool = false;
}
return bool;
}
// EXPORTS //
module.exports = hasInt16ArraySupport;
},{"./int16array.js":35,"@stdlib/assert/is-int16array":95,"@stdlib/constants/int16/max":226,"@stdlib/constants/int16/min":227}],37:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test for native `Int32Array` support.
*
* @module @stdlib/assert/has-int32array-support
*
* @example
* var hasInt32ArraySupport = require( '@stdlib/assert/has-int32array-support' );
*
* var bool = hasInt32ArraySupport();
* // returns <boolean>
*/
// MODULES //
var hasInt32ArraySupport = require( './main.js' );
// EXPORTS //
module.exports = hasInt32ArraySupport;
},{"./main.js":39}],38:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var main = ( typeof Int32Array === 'function' ) ? Int32Array : null; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = main;
},{}],39:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isInt32Array = require( '@stdlib/assert/is-int32array' );
var INT32_MAX = require( '@stdlib/constants/int32/max' );
var INT32_MIN = require( '@stdlib/constants/int32/min' );
var GlobalInt32Array = require( './int32array.js' );
// MAIN //
/**
* Tests for native `Int32Array` support.
*
* @returns {boolean} boolean indicating if an environment has `Int32Array` support
*
* @example
* var bool = hasInt32ArraySupport();
* // returns <boolean>
*/
function hasInt32ArraySupport() {
var bool;
var arr;
if ( typeof GlobalInt32Array !== 'function' ) {
return false;
}
// Test basic support...
try {
arr = new GlobalInt32Array( [ 1, 3.14, -3.14, INT32_MAX+1 ] );
bool = (
isInt32Array( arr ) &&
arr[ 0 ] === 1 &&
arr[ 1 ] === 3 && // truncation
arr[ 2 ] === -3 && // truncation
arr[ 3 ] === INT32_MIN // wrap around
);
} catch ( err ) { // eslint-disable-line no-unused-vars
bool = false;
}
return bool;
}
// EXPORTS //
module.exports = hasInt32ArraySupport;
},{"./int32array.js":38,"@stdlib/assert/is-int32array":97,"@stdlib/constants/int32/max":228,"@stdlib/constants/int32/min":229}],40:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test for native `Int8Array` support.
*
* @module @stdlib/assert/has-int8array-support
*
* @example
* var hasInt8ArraySupport = require( '@stdlib/assert/has-int8array-support' );
*
* var bool = hasInt8ArraySupport();
* // returns <boolean>
*/
// MODULES //
var hasInt8ArraySupport = require( './main.js' );
// EXPORTS //
module.exports = hasInt8ArraySupport;
},{"./main.js":42}],41:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var main = ( typeof Int8Array === 'function' ) ? Int8Array : null; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = main;
},{}],42:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isInt8Array = require( '@stdlib/assert/is-int8array' );
var INT8_MAX = require( '@stdlib/constants/int8/max' );
var INT8_MIN = require( '@stdlib/constants/int8/min' );
var GlobalInt8Array = require( './int8array.js' );
// MAIN //
/**
* Tests for native `Int8Array` support.
*
* @returns {boolean} boolean indicating if an environment has `Int8Array` support
*
* @example
* var bool = hasInt8ArraySupport();
* // returns <boolean>
*/
function hasInt8ArraySupport() {
var bool;
var arr;
if ( typeof GlobalInt8Array !== 'function' ) {
return false;
}
// Test basic support...
try {
arr = new GlobalInt8Array( [ 1, 3.14, -3.14, INT8_MAX+1 ] );
bool = (
isInt8Array( arr ) &&
arr[ 0 ] === 1 &&
arr[ 1 ] === 3 && // truncation
arr[ 2 ] === -3 && // truncation
arr[ 3 ] === INT8_MIN // wrap around
);
} catch ( err ) { // eslint-disable-line no-unused-vars
bool = false;
}
return bool;
}
// EXPORTS //
module.exports = hasInt8ArraySupport;
},{"./int8array.js":41,"@stdlib/assert/is-int8array":99,"@stdlib/constants/int8/max":230,"@stdlib/constants/int8/min":231}],43:[function(require,module,exports){
(function (Buffer){(function (){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var main = ( typeof Buffer === 'function' ) ? Buffer : null; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = main;
}).call(this)}).call(this,require("buffer").Buffer)
},{"buffer":379}],44:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test for native `Buffer` support.
*
* @module @stdlib/assert/has-node-buffer-support
*
* @example
* var hasNodeBufferSupport = require( '@stdlib/assert/has-node-buffer-support' );
*
* var bool = hasNodeBufferSupport();
* // returns <boolean>
*/
// MODULES //
var hasNodeBufferSupport = require( './main.js' );
// EXPORTS //
module.exports = hasNodeBufferSupport;
},{"./main.js":45}],45:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isBuffer = require( '@stdlib/assert/is-buffer' );
var GlobalBuffer = require( './buffer.js' );
// MAIN //
/**
* Tests for native `Buffer` support.
*
* @returns {boolean} boolean indicating if an environment has `Buffer` support
*
* @example
* var bool = hasNodeBufferSupport();
* // returns <boolean>
*/
function hasNodeBufferSupport() {
var bool;
var b;
if ( typeof GlobalBuffer !== 'function' ) {
return false;
}
// Test basic support...
try {
if ( typeof GlobalBuffer.from === 'function' ) {
b = GlobalBuffer.from( [ 1, 2, 3, 4 ] );
} else {
b = new GlobalBuffer( [ 1, 2, 3, 4 ] ); // Note: this is deprecated behavior starting in Node v6 (see https://nodejs.org/api/buffer.html#buffer_new_buffer_array)
}
bool = (
isBuffer( b ) &&
b[ 0 ] === 1 &&
b[ 1 ] === 2 &&
b[ 2 ] === 3 &&
b[ 3 ] === 4
);
} catch ( err ) { // eslint-disable-line no-unused-vars
bool = false;
}
return bool;
}
// EXPORTS //
module.exports = hasNodeBufferSupport;
},{"./buffer.js":43,"@stdlib/assert/is-buffer":79}],46:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test whether an object has a specified property.
*
* @module @stdlib/assert/has-own-property
*
* @example
* var hasOwnProp = require( '@stdlib/assert/has-own-property' );
*
* var beep = {
* 'boop': true
* };
*
* var bool = hasOwnProp( beep, 'boop' );
* // returns true
*
* bool = hasOwnProp( beep, 'bop' );
* // returns false
*/
// MODULES //
var hasOwnProp = require( './main.js' );
// EXPORTS //
module.exports = hasOwnProp;
},{"./main.js":47}],47:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// FUNCTIONS //
var has = Object.prototype.hasOwnProperty;
// MAIN //
/**
* Tests if an object has a specified property.
*
* @param {*} value - value to test
* @param {*} property - property to test
* @returns {boolean} boolean indicating if an object has a specified property
*
* @example
* var beep = {
* 'boop': true
* };
*
* var bool = hasOwnProp( beep, 'boop' );
* // returns true
*
* @example
* var beep = {
* 'boop': true
* };
*
* var bool = hasOwnProp( beep, 'bap' );
* // returns false
*/
function hasOwnProp( value, property ) {
if (
value === void 0 ||
value === null
) {
return false;
}
return has.call( value, property );
}
// EXPORTS //
module.exports = hasOwnProp;
},{}],48:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test for native `Symbol` support.
*
* @module @stdlib/assert/has-symbol-support
*
* @example
* var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' );
*
* var bool = hasSymbolSupport();
* // returns <boolean>
*/
// MODULES //
var hasSymbolSupport = require( './main.js' );
// EXPORTS //
module.exports = hasSymbolSupport;
},{"./main.js":49}],49:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Tests for native `Symbol` support.
*
* @returns {boolean} boolean indicating if an environment has `Symbol` support
*
* @example
* var bool = hasSymbolSupport();
* // returns <boolean>
*/
function hasSymbolSupport() {
return (
typeof Symbol === 'function' &&
typeof Symbol( 'foo' ) === 'symbol'
);
}
// EXPORTS //
module.exports = hasSymbolSupport;
},{}],50:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test for native `toStringTag` support.
*
* @module @stdlib/assert/has-tostringtag-support
*
* @example
* var hasToStringTagSupport = require( '@stdlib/assert/has-tostringtag-support' );
*
* var bool = hasToStringTagSupport();
* // returns <boolean>
*/
// MODULES //
var hasToStringTagSupport = require( './main.js' );
// EXPORTS //
module.exports = hasToStringTagSupport;
},{"./main.js":51}],51:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var hasSymbols = require( '@stdlib/assert/has-symbol-support' );
// VARIABLES //
var FLG = hasSymbols();
// MAIN //
/**
* Tests for native `toStringTag` support.
*
* @returns {boolean} boolean indicating if an environment has `toStringTag` support
*
* @example
* var bool = hasToStringTagSupport();
* // returns <boolean>
*/
function hasToStringTagSupport() {
return ( FLG && typeof Symbol.toStringTag === 'symbol' );
}
// EXPORTS //
module.exports = hasToStringTagSupport;
},{"@stdlib/assert/has-symbol-support":48}],52:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test for native `Uint16Array` support.
*
* @module @stdlib/assert/has-uint16array-support
*
* @example
* var hasUint16ArraySupport = require( '@stdlib/assert/has-uint16array-support' );
*
* var bool = hasUint16ArraySupport();
* // returns <boolean>
*/
// MODULES //
var hasUint16ArraySupport = require( './main.js' );
// EXPORTS //
module.exports = hasUint16ArraySupport;
},{"./main.js":53}],53:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isUint16Array = require( '@stdlib/assert/is-uint16array' );
var UINT16_MAX = require( '@stdlib/constants/uint16/max' );
var GlobalUint16Array = require( './uint16array.js' );
// MAIN //
/**
* Tests for native `Uint16Array` support.
*
* @returns {boolean} boolean indicating if an environment has `Uint16Array` support
*
* @example
* var bool = hasUint16ArraySupport();
* // returns <boolean>
*/
function hasUint16ArraySupport() {
var bool;
var arr;
if ( typeof GlobalUint16Array !== 'function' ) {
return false;
}
// Test basic support...
try {
arr = [ 1, 3.14, -3.14, UINT16_MAX+1, UINT16_MAX+2 ];
arr = new GlobalUint16Array( arr );
bool = (
isUint16Array( arr ) &&
arr[ 0 ] === 1 &&
arr[ 1 ] === 3 && // truncation
arr[ 2 ] === UINT16_MAX-2 && // truncation and wrap around
arr[ 3 ] === 0 && // wrap around
arr[ 4 ] === 1 // wrap around
);
} catch ( err ) { // eslint-disable-line no-unused-vars
bool = false;
}
return bool;
}
// EXPORTS //
module.exports = hasUint16ArraySupport;
},{"./uint16array.js":54,"@stdlib/assert/is-uint16array":155,"@stdlib/constants/uint16/max":232}],54:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var main = ( typeof Uint16Array === 'function' ) ? Uint16Array : null; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = main;
},{}],55:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test for native `Uint32Array` support.
*
* @module @stdlib/assert/has-uint32array-support
*
* @example
* var hasUint32ArraySupport = require( '@stdlib/assert/has-uint32array-support' );
*
* var bool = hasUint32ArraySupport();
* // returns <boolean>
*/
// MODULES //
var hasUint32ArraySupport = require( './main.js' );
// EXPORTS //
module.exports = hasUint32ArraySupport;
},{"./main.js":56}],56:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isUint32Array = require( '@stdlib/assert/is-uint32array' );
var UINT32_MAX = require( '@stdlib/constants/uint32/max' );
var GlobalUint32Array = require( './uint32array.js' );
// MAIN //
/**
* Tests for native `Uint32Array` support.
*
* @returns {boolean} boolean indicating if an environment has `Uint32Array` support
*
* @example
* var bool = hasUint32ArraySupport();
* // returns <boolean>
*/
function hasUint32ArraySupport() {
var bool;
var arr;
if ( typeof GlobalUint32Array !== 'function' ) {
return false;
}
// Test basic support...
try {
arr = [ 1, 3.14, -3.14, UINT32_MAX+1, UINT32_MAX+2 ];
arr = new GlobalUint32Array( arr );
bool = (
isUint32Array( arr ) &&
arr[ 0 ] === 1 &&
arr[ 1 ] === 3 && // truncation
arr[ 2 ] === UINT32_MAX-2 && // truncation and wrap around
arr[ 3 ] === 0 && // wrap around
arr[ 4 ] === 1 // wrap around
);
} catch ( err ) { // eslint-disable-line no-unused-vars
bool = false;
}
return bool;
}
// EXPORTS //
module.exports = hasUint32ArraySupport;
},{"./uint32array.js":57,"@stdlib/assert/is-uint32array":157,"@stdlib/constants/uint32/max":233}],57:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var main = ( typeof Uint32Array === 'function' ) ? Uint32Array : null; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = main;
},{}],58:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test for native `Uint8Array` support.
*
* @module @stdlib/assert/has-uint8array-support
*
* @example
* var hasUint8ArraySupport = require( '@stdlib/assert/has-uint8array-support' );
*
* var bool = hasUint8ArraySupport();
* // returns <boolean>
*/
// MODULES //
var hasUint8ArraySupport = require( './main.js' );
// EXPORTS //
module.exports = hasUint8ArraySupport;
},{"./main.js":59}],59:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isUint8Array = require( '@stdlib/assert/is-uint8array' );
var UINT8_MAX = require( '@stdlib/constants/uint8/max' );
var GlobalUint8Array = require( './uint8array.js' );
// MAIN //
/**
* Tests for native `Uint8Array` support.
*
* @returns {boolean} boolean indicating if an environment has `Uint8Array` support
*
* @example
* var bool = hasUint8ArraySupport();
* // returns <boolean>
*/
function hasUint8ArraySupport() {
var bool;
var arr;
if ( typeof GlobalUint8Array !== 'function' ) {
return false;
}
// Test basic support...
try {
arr = [ 1, 3.14, -3.14, UINT8_MAX+1, UINT8_MAX+2 ];
arr = new GlobalUint8Array( arr );
bool = (
isUint8Array( arr ) &&
arr[ 0 ] === 1 &&
arr[ 1 ] === 3 && // truncation
arr[ 2 ] === UINT8_MAX-2 && // truncation and wrap around
arr[ 3 ] === 0 && // wrap around
arr[ 4 ] === 1 // wrap around
);
} catch ( err ) { // eslint-disable-line no-unused-vars
bool = false;
}
return bool;
}
// EXPORTS //
module.exports = hasUint8ArraySupport;
},{"./uint8array.js":60,"@stdlib/assert/is-uint8array":159,"@stdlib/constants/uint8/max":234}],60:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var main = ( typeof Uint8Array === 'function' ) ? Uint8Array : null; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = main;
},{}],61:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test for native `Uint8ClampedArray` support.
*
* @module @stdlib/assert/has-uint8clampedarray-support
*
* @example
* var hasUint8ClampedArraySupport = require( '@stdlib/assert/has-uint8clampedarray-support' );
*
* var bool = hasUint8ClampedArraySupport();
* // returns <boolean>
*/
// MODULES //
var hasUint8ClampedArraySupport = require( './main.js' );
// EXPORTS //
module.exports = hasUint8ClampedArraySupport;
},{"./main.js":62}],62:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isUint8ClampedArray = require( '@stdlib/assert/is-uint8clampedarray' );
var GlobalUint8ClampedArray = require( './uint8clampedarray.js' );
// MAIN //
/**
* Tests for native `Uint8ClampedArray` support.
*
* @returns {boolean} boolean indicating if an environment has `Uint8ClampedArray` support
*
* @example
* var bool = hasUint8ClampedArraySupport();
* // returns <boolean>
*/
function hasUint8ClampedArraySupport() { // eslint-disable-line id-length
var bool;
var arr;
if ( typeof GlobalUint8ClampedArray !== 'function' ) {
return false;
}
// Test basic support...
try {
arr = new GlobalUint8ClampedArray( [ -1, 0, 1, 3.14, 4.99, 255, 256 ] );
bool = (
isUint8ClampedArray( arr ) &&
arr[ 0 ] === 0 && // clamped
arr[ 1 ] === 0 &&
arr[ 2 ] === 1 &&
arr[ 3 ] === 3 && // round to nearest
arr[ 4 ] === 5 && // round to nearest
arr[ 5 ] === 255 &&
arr[ 6 ] === 255 // clamped
);
} catch ( err ) { // eslint-disable-line no-unused-vars
bool = false;
}
return bool;
}
// EXPORTS //
module.exports = hasUint8ClampedArraySupport;
},{"./uint8clampedarray.js":63,"@stdlib/assert/is-uint8clampedarray":161}],63:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var main = ( typeof Uint8ClampedArray === 'function' ) ? Uint8ClampedArray : null; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = main;
},{}],64:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isArguments = require( './main.js' );
// VARIABLES //
var bool;
// FUNCTIONS //
/**
* Detects whether an environment returns the expected internal class of the `arguments` object.
*
* @private
* @returns {boolean} boolean indicating whether an environment behaves as expected
*
* @example
* var bool = detect();
* // returns <boolean>
*/
function detect() {
return isArguments( arguments );
}
// MAIN //
bool = detect();
// EXPORTS //
module.exports = bool;
},{"./main.js":66}],65:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is an `arguments` object.
*
* @module @stdlib/assert/is-arguments
*
* @example
* var isArguments = require( '@stdlib/assert/is-arguments' );
*
* function foo() {
* return arguments;
* }
*
* var bool = isArguments( foo() );
* // returns true
*
* bool = isArguments( [] );
* // returns false
*/
// MODULES //
var hasArgumentsClass = require( './detect.js' );
var main = require( './main.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var isArguments;
if ( hasArgumentsClass ) {
isArguments = main;
} else {
isArguments = polyfill;
}
// EXPORTS //
module.exports = isArguments;
},{"./detect.js":64,"./main.js":66,"./polyfill.js":67}],66:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var nativeClass = require( '@stdlib/utils/native-class' );
// MAIN //
/**
* Tests whether a value is an `arguments` object.
*
* @private
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether a value is an `arguments` object
*
* @example
* function foo() {
* return arguments;
* }
*
* var bool = isArguments( foo() );
* // returns true
*
* @example
* var bool = isArguments( [] );
* // returns false
*/
function isArguments( value ) {
return ( nativeClass( value ) === '[object Arguments]' );
}
// EXPORTS //
module.exports = isArguments;
},{"@stdlib/utils/native-class":346}],67:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var isEnumerableProperty = require( '@stdlib/assert/is-enumerable-property' );
var isArray = require( '@stdlib/assert/is-array' );
var isInteger = require( '@stdlib/math/base/assert/is-integer' );
var MAX_LENGTH = require( '@stdlib/constants/uint32/max' );
// MAIN //
/**
* Tests whether a value is an `arguments` object.
*
* @private
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether a value is an `arguments` object
*
* @example
* function foo() {
* return arguments;
* }
*
* var bool = isArguments( foo() );
* // returns true
*
* @example
* var bool = isArguments( [] );
* // returns false
*/
function isArguments( value ) {
return (
value !== null &&
typeof value === 'object' &&
!isArray( value ) &&
typeof value.length === 'number' &&
isInteger( value.length ) &&
value.length >= 0 &&
value.length <= MAX_LENGTH &&
hasOwnProp( value, 'callee' ) &&
!isEnumerableProperty( value, 'callee' )
);
}
// EXPORTS //
module.exports = isArguments;
},{"@stdlib/assert/has-own-property":46,"@stdlib/assert/is-array":70,"@stdlib/assert/is-enumerable-property":84,"@stdlib/constants/uint32/max":233,"@stdlib/math/base/assert/is-integer":237}],68:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is array-like.
*
* @module @stdlib/assert/is-array-like
*
* @example
* var isArrayLike = require( '@stdlib/assert/is-array-like' );
*
* var bool = isArrayLike( [] );
* // returns true
*
* bool = isArrayLike( { 'length': 10 } );
* // returns true
*
* bool = isArrayLike( 'beep' );
* // returns true
*/
// MODULES //
var isArrayLike = require( './main.js' );
// EXPORTS //
module.exports = isArrayLike;
},{"./main.js":69}],69:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isInteger = require( '@stdlib/math/base/assert/is-integer' );
var MAX_LENGTH = require( '@stdlib/constants/array/max-array-length' );
// MAIN //
/**
* Tests if a value is array-like.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is array-like
*
* @example
* var bool = isArrayLike( [] );
* // returns true
*
* @example
* var bool = isArrayLike( {'length':10} );
* // returns true
*/
function isArrayLike( value ) {
return (
value !== void 0 &&
value !== null &&
typeof value !== 'function' &&
typeof value.length === 'number' &&
isInteger( value.length ) &&
value.length >= 0 &&
value.length <= MAX_LENGTH
);
}
// EXPORTS //
module.exports = isArrayLike;
},{"@stdlib/constants/array/max-array-length":219,"@stdlib/math/base/assert/is-integer":237}],70:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is an array.
*
* @module @stdlib/assert/is-array
*
* @example
* var isArray = require( '@stdlib/assert/is-array' );
*
* var bool = isArray( [] );
* // returns true
*
* bool = isArray( {} );
* // returns false
*/
// MODULES //
var isArray = require( './main.js' );
// EXPORTS //
module.exports = isArray;
},{"./main.js":71}],71:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var nativeClass = require( '@stdlib/utils/native-class' );
// VARIABLES //
var f;
// FUNCTIONS //
/**
* Tests if a value is an array.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is an array
*
* @example
* var bool = isArray( [] );
* // returns true
*
* @example
* var bool = isArray( {} );
* // returns false
*/
function isArray( value ) {
return ( nativeClass( value ) === '[object Array]' );
}
// MAIN //
if ( Array.isArray ) {
f = Array.isArray;
} else {
f = isArray;
}
// EXPORTS //
module.exports = f;
},{"@stdlib/utils/native-class":346}],72:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is a boolean.
*
* @module @stdlib/assert/is-boolean
*
* @example
* var isBoolean = require( '@stdlib/assert/is-boolean' );
*
* var bool = isBoolean( false );
* // returns true
*
* bool = isBoolean( new Boolean( false ) );
* // returns true
*
* @example
* // Use interface to check for boolean primitives...
* var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
*
* var bool = isBoolean( false );
* // returns true
*
* bool = isBoolean( new Boolean( true ) );
* // returns false
*
* @example
* // Use interface to check for boolean objects...
* var isBoolean = require( '@stdlib/assert/is-boolean' ).isObject;
*
* var bool = isBoolean( true );
* // returns false
*
* bool = isBoolean( new Boolean( false ) );
* // returns true
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var isBoolean = require( './main.js' );
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
setReadOnly( isBoolean, 'isPrimitive', isPrimitive );
setReadOnly( isBoolean, 'isObject', isObject );
// EXPORTS //
module.exports = isBoolean;
},{"./main.js":73,"./object.js":74,"./primitive.js":75,"@stdlib/utils/define-nonenumerable-read-only-property":297}],73:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
/**
* Tests if a value is a boolean.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a boolean
*
* @example
* var bool = isBoolean( false );
* // returns true
*
* @example
* var bool = isBoolean( true );
* // returns true
*
* @example
* var bool = isBoolean( new Boolean( false ) );
* // returns true
*
* @example
* var bool = isBoolean( new Boolean( true ) );
* // returns true
*/
function isBoolean( value ) {
return ( isPrimitive( value ) || isObject( value ) );
}
// EXPORTS //
module.exports = isBoolean;
},{"./object.js":74,"./primitive.js":75}],74:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var hasToStringTag = require( '@stdlib/assert/has-tostringtag-support' );
var nativeClass = require( '@stdlib/utils/native-class' );
var test = require( './try2serialize.js' );
// VARIABLES //
var FLG = hasToStringTag();
// MAIN //
/**
* Tests if a value is a boolean object.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a boolean object
*
* @example
* var bool = isBoolean( true );
* // returns false
*
* @example
* var bool = isBoolean( new Boolean( false ) );
* // returns true
*/
function isBoolean( value ) {
if ( typeof value === 'object' ) {
if ( value instanceof Boolean ) {
return true;
}
if ( FLG ) {
return test( value );
}
return ( nativeClass( value ) === '[object Boolean]' );
}
return false;
}
// EXPORTS //
module.exports = isBoolean;
},{"./try2serialize.js":77,"@stdlib/assert/has-tostringtag-support":50,"@stdlib/utils/native-class":346}],75:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Tests if a value is a boolean primitive.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a boolean primitive
*
* @example
* var bool = isBoolean( true );
* // returns true
*
* @example
* var bool = isBoolean( false );
* // returns true
*
* @example
* var bool = isBoolean( new Boolean( true ) );
* // returns false
*/
function isBoolean( value ) {
return ( typeof value === 'boolean' );
}
// EXPORTS //
module.exports = isBoolean;
},{}],76:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// eslint-disable-next-line stdlib/no-redeclare
var toString = Boolean.prototype.toString; // non-generic
// EXPORTS //
module.exports = toString;
},{}],77:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var toString = require( './tostring.js' ); // eslint-disable-line stdlib/no-redeclare
// MAIN //
/**
* Attempts to serialize a value to a string.
*
* @private
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value can be serialized
*/
function test( value ) {
try {
toString.call( value );
return true;
} catch ( err ) { // eslint-disable-line no-unused-vars
return false;
}
}
// EXPORTS //
module.exports = test;
},{"./tostring.js":76}],78:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// EXPORTS //
module.exports = true;
},{}],79:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is a Buffer instance.
*
* @module @stdlib/assert/is-buffer
*
* @example
* var isBuffer = require( '@stdlib/assert/is-buffer' );
*
* var v = isBuffer( new Buffer( 'beep' ) );
* // returns true
*
* v = isBuffer( {} );
* // returns false
*/
// MODULES //
var isBuffer = require( './main.js' );
// EXPORTS //
module.exports = isBuffer;
},{"./main.js":80}],80:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isObjectLike = require( '@stdlib/assert/is-object-like' );
// MAIN //
/**
* Tests if a value is a Buffer instance.
*
* @param {*} value - value to validate
* @returns {boolean} boolean indicating if a value is a Buffer instance
*
* @example
* var v = isBuffer( new Buffer( 'beep' ) );
* // returns true
*
* @example
* var v = isBuffer( new Buffer( [1,2,3,4] ) );
* // returns true
*
* @example
* var v = isBuffer( {} );
* // returns false
*
* @example
* var v = isBuffer( [] );
* // returns false
*/
function isBuffer( value ) {
return (
isObjectLike( value ) &&
(
// eslint-disable-next-line no-underscore-dangle
value._isBuffer || // for envs missing Object.prototype.constructor (e.g., Safari 5-7)
(
value.constructor &&
// WARNING: `typeof` is not a foolproof check, as certain envs consider RegExp and NodeList instances to be functions
typeof value.constructor.isBuffer === 'function' &&
value.constructor.isBuffer( value )
)
)
);
}
// EXPORTS //
module.exports = isBuffer;
},{"@stdlib/assert/is-object-like":134}],81:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is a collection.
*
* @module @stdlib/assert/is-collection
*
* @example
* var isCollection = require( '@stdlib/assert/is-collection' );
*
* var bool = isCollection( [] );
* // returns true
*
* bool = isCollection( {} );
* // returns false
*/
// MODULES //
var isCollection = require( './main.js' );
// EXPORTS //
module.exports = isCollection;
},{"./main.js":82}],82:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isInteger = require( '@stdlib/math/base/assert/is-integer' );
var MAX_LENGTH = require( '@stdlib/constants/array/max-typed-array-length' );
// MAIN //
/**
* Tests if a value is a collection.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether a value is a collection
*
* @example
* var bool = isCollection( [] );
* // returns true
*
* @example
* var bool = isCollection( {} );
* // returns false
*/
function isCollection( value ) {
return (
typeof value === 'object' &&
value !== null &&
typeof value.length === 'number' &&
isInteger( value.length ) &&
value.length >= 0 &&
value.length <= MAX_LENGTH
);
}
// EXPORTS //
module.exports = isCollection;
},{"@stdlib/constants/array/max-typed-array-length":220,"@stdlib/math/base/assert/is-integer":237}],83:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isEnum = require( './native.js' );
// VARIABLES //
var bool;
// FUNCTIONS //
/**
* Detects whether an environment has a bug where String indices are not detected as "enumerable" properties. Observed in Node v0.10.
*
* @private
* @returns {boolean} boolean indicating whether an environment has the bug
*/
function detect() {
return !isEnum.call( 'beep', '0' );
}
// MAIN //
bool = detect();
// EXPORTS //
module.exports = bool;
},{"./native.js":86}],84:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test whether an object's own property is enumerable.
*
* @module @stdlib/assert/is-enumerable-property
*
* @example
* var isEnumerableProperty = require( '@stdlib/assert/is-enumerable-property' );
*
* var beep = {
* 'boop': true
* };
*
* var bool = isEnumerableProperty( beep, 'boop' );
* // returns true
*
* bool = isEnumerableProperty( beep, 'hasOwnProperty' );
* // returns false
*/
// MODULES //
var isEnumerableProperty = require( './main.js' );
// EXPORTS //
module.exports = isEnumerableProperty;
},{"./main.js":85}],85:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isString = require( '@stdlib/assert/is-string' );
var isnan = require( '@stdlib/assert/is-nan' ).isPrimitive;
var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive;
var isEnum = require( './native.js' );
var hasStringEnumBug = require( './has_string_enumerability_bug.js' );
// MAIN //
/**
* Tests if an object's own property is enumerable.
*
* @param {*} value - value to test
* @param {*} property - property to test
* @returns {boolean} boolean indicating if an object property is enumerable
*
* @example
* var beep = {
* 'boop': true
* };
*
* var bool = isEnumerableProperty( beep, 'boop' );
* // returns true
*
* @example
* var beep = {
* 'boop': true
* };
*
* var bool = isEnumerableProperty( beep, 'hasOwnProperty' );
* // returns false
*/
function isEnumerableProperty( value, property ) {
var bool;
if (
value === void 0 ||
value === null
) {
return false;
}
bool = isEnum.call( value, property );
if ( !bool && hasStringEnumBug && isString( value ) ) {
// Note: we only check for indices, as properties attached to a `String` object are properly detected as enumerable above.
property = +property;
return (
!isnan( property ) &&
isInteger( property ) &&
property >= 0 &&
property < value.length
);
}
return bool;
}
// EXPORTS //
module.exports = isEnumerableProperty;
},{"./has_string_enumerability_bug.js":83,"./native.js":86,"@stdlib/assert/is-integer":101,"@stdlib/assert/is-nan":109,"@stdlib/assert/is-string":149}],86:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Tests if an object's own property is enumerable.
*
* @private
* @name isEnumerableProperty
* @type {Function}
* @param {*} value - value to test
* @param {*} property - property to test
* @returns {boolean} boolean indicating if an object property is enumerable
*
* @example
* var beep = {
* 'boop': true
* };
*
* var bool = isEnumerableProperty( beep, 'boop' );
* // returns true
*
* @example
* var beep = {
* 'boop': true
* };
*
* var bool = isEnumerableProperty( beep, 'hasOwnProperty' );
* // returns false
*/
var isEnumerableProperty = Object.prototype.propertyIsEnumerable;
// EXPORTS //
module.exports = isEnumerableProperty;
},{}],87:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is an `Error` object.
*
* @module @stdlib/assert/is-error
*
* @example
* var isError = require( '@stdlib/assert/is-error' );
*
* var bool = isError( new Error( 'beep' ) );
* // returns true
*
* bool = isError( {} );
* // returns false
*/
// MODULES //
var isError = require( './main.js' );
// EXPORTS //
module.exports = isError;
},{"./main.js":88}],88:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var getPrototypeOf = require( '@stdlib/utils/get-prototype-of' );
var nativeClass = require( '@stdlib/utils/native-class' );
// MAIN //
/**
* Tests if a value is an `Error` object.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether a value is an `Error` object
*
* @example
* var bool = isError( new Error( 'beep' ) );
* // returns true
*
* @example
* var bool = isError( {} );
* // returns false
*/
function isError( value ) {
if ( typeof value !== 'object' || value === null ) {
return false;
}
// Check for `Error` objects from the same realm (same Node.js `vm` or same `Window` object)...
if ( value instanceof Error ) {
return true;
}
// Walk the prototype tree until we find an object having the desired native class...
while ( value ) {
if ( nativeClass( value ) === '[object Error]' ) {
return true;
}
value = getPrototypeOf( value );
}
return false;
}
// EXPORTS //
module.exports = isError;
},{"@stdlib/utils/get-prototype-of":312,"@stdlib/utils/native-class":346}],89:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is a Float32Array.
*
* @module @stdlib/assert/is-float32array
*
* @example
* var isFloat32Array = require( '@stdlib/assert/is-float32array' );
*
* var bool = isFloat32Array( new Float32Array( 10 ) );
* // returns true
*
* bool = isFloat32Array( [] );
* // returns false
*/
// MODULES //
var isFloat32Array = require( './main.js' );
// EXPORTS //
module.exports = isFloat32Array;
},{"./main.js":90}],90:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var nativeClass = require( '@stdlib/utils/native-class' );
// VARIABLES //
var hasFloat32Array = ( typeof Float32Array === 'function' );// eslint-disable-line stdlib/require-globals
// MAIN //
/**
* Tests if a value is a Float32Array.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a Float32Array
*
* @example
* var bool = isFloat32Array( new Float32Array( 10 ) );
* // returns true
*
* @example
* var bool = isFloat32Array( [] );
* // returns false
*/
function isFloat32Array( value ) {
return (
( hasFloat32Array && value instanceof Float32Array ) || // eslint-disable-line stdlib/require-globals
nativeClass( value ) === '[object Float32Array]'
);
}
// EXPORTS //
module.exports = isFloat32Array;
},{"@stdlib/utils/native-class":346}],91:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is a Float64Array.
*
* @module @stdlib/assert/is-float64array
*
* @example
* var isFloat64Array = require( '@stdlib/assert/is-float64array' );
*
* var bool = isFloat64Array( new Float64Array( 10 ) );
* // returns true
*
* bool = isFloat64Array( [] );
* // returns false
*/
// MODULES //
var isFloat64Array = require( './main.js' );
// EXPORTS //
module.exports = isFloat64Array;
},{"./main.js":92}],92:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var nativeClass = require( '@stdlib/utils/native-class' );
// VARIABLES //
var hasFloat64Array = ( typeof Float64Array === 'function' ); // eslint-disable-line stdlib/require-globals
// MAIN //
/**
* Tests if a value is a Float64Array.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a Float64Array
*
* @example
* var bool = isFloat64Array( new Float64Array( 10 ) );
* // returns true
*
* @example
* var bool = isFloat64Array( [] );
* // returns false
*/
function isFloat64Array( value ) {
return (
( hasFloat64Array && value instanceof Float64Array ) || // eslint-disable-line stdlib/require-globals
nativeClass( value ) === '[object Float64Array]'
);
}
// EXPORTS //
module.exports = isFloat64Array;
},{"@stdlib/utils/native-class":346}],93:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is a function.
*
* @module @stdlib/assert/is-function
*
* @example
* var isFunction = require( '@stdlib/assert/is-function' );
*
* function beep() {
* return 'beep';
* }
*
* var bool = isFunction( beep );
* // returns true
*/
// MODULES //
var isFunction = require( './main.js' );
// EXPORTS //
module.exports = isFunction;
},{"./main.js":94}],94:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var typeOf = require( '@stdlib/utils/type-of' );
// MAIN //
/**
* Tests if a value is a function.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a function
*
* @example
* function beep() {
* return 'beep';
* }
*
* var bool = isFunction( beep );
* // returns true
*/
function isFunction( value ) {
// Note: cannot use `typeof` directly, as various browser engines incorrectly return `'function'` when operating on non-function objects, such as regular expressions and NodeLists.
return ( typeOf( value ) === 'function' );
}
// EXPORTS //
module.exports = isFunction;
},{"@stdlib/utils/type-of":373}],95:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is an Int16Array.
*
* @module @stdlib/assert/is-int16array
*
* @example
* var isInt16Array = require( '@stdlib/assert/is-int16array' );
*
* var bool = isInt16Array( new Int16Array( 10 ) );
* // returns true
*
* bool = isInt16Array( [] );
* // returns false
*/
// MODULES //
var isInt16Array = require( './main.js' );
// EXPORTS //
module.exports = isInt16Array;
},{"./main.js":96}],96:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var nativeClass = require( '@stdlib/utils/native-class' );
// VARIABLES //
var hasInt16Array = ( typeof Int16Array === 'function' ); // eslint-disable-line stdlib/require-globals
// MAIN //
/**
* Tests if a value is an Int16Array.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is an Int16Array
*
* @example
* var bool = isInt16Array( new Int16Array( 10 ) );
* // returns true
*
* @example
* var bool = isInt16Array( [] );
* // returns false
*/
function isInt16Array( value ) {
return (
( hasInt16Array && value instanceof Int16Array ) || // eslint-disable-line stdlib/require-globals
nativeClass( value ) === '[object Int16Array]'
);
}
// EXPORTS //
module.exports = isInt16Array;
},{"@stdlib/utils/native-class":346}],97:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is an Int32Array.
*
* @module @stdlib/assert/is-int32array
*
* @example
* var isInt32Array = require( '@stdlib/assert/is-int32array' );
*
* var bool = isInt32Array( new Int32Array( 10 ) );
* // returns true
*
* bool = isInt32Array( [] );
* // returns false
*/
// MODULES //
var isInt32Array = require( './main.js' );
// EXPORTS //
module.exports = isInt32Array;
},{"./main.js":98}],98:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var nativeClass = require( '@stdlib/utils/native-class' );
// VARIABLES //
var hasInt32Array = ( typeof Int32Array === 'function' ); // eslint-disable-line stdlib/require-globals
// MAIN //
/**
* Tests if a value is an Int32Array.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is an Int32Array
*
* @example
* var bool = isInt32Array( new Int32Array( 10 ) );
* // returns true
*
* @example
* var bool = isInt32Array( [] );
* // returns false
*/
function isInt32Array( value ) {
return (
( hasInt32Array && value instanceof Int32Array ) || // eslint-disable-line stdlib/require-globals
nativeClass( value ) === '[object Int32Array]'
);
}
// EXPORTS //
module.exports = isInt32Array;
},{"@stdlib/utils/native-class":346}],99:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is an Int8Array.
*
* @module @stdlib/assert/is-int8array
*
* @example
* var isInt8Array = require( '@stdlib/assert/is-int8array' );
*
* var bool = isInt8Array( new Int8Array( 10 ) );
* // returns true
*
* bool = isInt8Array( [] );
* // returns false
*/
// MODULES //
var isInt8Array = require( './main.js' );
// EXPORTS //
module.exports = isInt8Array;
},{"./main.js":100}],100:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var nativeClass = require( '@stdlib/utils/native-class' );
// VARIABLES //
var hasInt8Array = ( typeof Int8Array === 'function' ); // eslint-disable-line stdlib/require-globals
// MAIN //
/**
* Tests if a value is an Int8Array.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is an Int8Array
*
* @example
* var bool = isInt8Array( new Int8Array( 10 ) );
* // returns true
*
* @example
* var bool = isInt8Array( [] );
* // returns false
*/
function isInt8Array( value ) {
return (
( hasInt8Array && value instanceof Int8Array ) || // eslint-disable-line stdlib/require-globals
nativeClass( value ) === '[object Int8Array]'
);
}
// EXPORTS //
module.exports = isInt8Array;
},{"@stdlib/utils/native-class":346}],101:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is an integer.
*
* @module @stdlib/assert/is-integer
*
* @example
* var isInteger = require( '@stdlib/assert/is-integer' );
*
* var bool = isInteger( 5.0 );
* // returns true
*
* bool = isInteger( new Number( 5.0 ) );
* // returns true
*
* bool = isInteger( -3.14 );
* // returns false
*
* bool = isInteger( null );
* // returns false
*
* @example
* // Use interface to check for integer primitives...
* var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive;
*
* var bool = isInteger( -3.0 );
* // returns true
*
* bool = isInteger( new Number( -3.0 ) );
* // returns false
*
* @example
* // Use interface to check for integer objects...
* var isInteger = require( '@stdlib/assert/is-integer' ).isObject;
*
* var bool = isInteger( 3.0 );
* // returns false
*
* bool = isInteger( new Number( 3.0 ) );
* // returns true
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var isInteger = require( './main.js' );
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
setReadOnly( isInteger, 'isPrimitive', isPrimitive );
setReadOnly( isInteger, 'isObject', isObject );
// EXPORTS //
module.exports = isInteger;
},{"./main.js":103,"./object.js":104,"./primitive.js":105,"@stdlib/utils/define-nonenumerable-read-only-property":297}],102:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var PINF = require( '@stdlib/constants/float64/pinf' );
var NINF = require( '@stdlib/constants/float64/ninf' );
var isInt = require( '@stdlib/math/base/assert/is-integer' );
// MAIN //
/**
* Tests if a number primitive is an integer value.
*
* @private
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a number primitive is an integer value
*/
function isInteger( value ) {
return (
value < PINF &&
value > NINF &&
isInt( value )
);
}
// EXPORTS //
module.exports = isInteger;
},{"@stdlib/constants/float64/ninf":224,"@stdlib/constants/float64/pinf":225,"@stdlib/math/base/assert/is-integer":237}],103:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
/**
* Tests if a value is an integer.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is an integer
*
* @example
* var bool = isInteger( 5.0 );
* // returns true
*
* @example
* var bool = isInteger( new Number( 5.0 ) );
* // returns true
*
* @example
* var bool = isInteger( -3.14 );
* // returns false
*
* @example
* var bool = isInteger( null );
* // returns false
*/
function isInteger( value ) {
return ( isPrimitive( value ) || isObject( value ) );
}
// EXPORTS //
module.exports = isInteger;
},{"./object.js":104,"./primitive.js":105}],104:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isNumber = require( '@stdlib/assert/is-number' ).isObject;
var isInt = require( './integer.js' );
// MAIN //
/**
* Tests if a value is a number object having an integer value.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a number object having an integer value
*
* @example
* var bool = isInteger( 3.0 );
* // returns false
*
* @example
* var bool = isInteger( new Number( 3.0 ) );
* // returns true
*/
function isInteger( value ) {
return (
isNumber( value ) &&
isInt( value.valueOf() )
);
}
// EXPORTS //
module.exports = isInteger;
},{"./integer.js":102,"@stdlib/assert/is-number":128}],105:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;
var isInt = require( './integer.js' );
// MAIN //
/**
* Tests if a value is a number primitive having an integer value.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a number primitive having an integer value
*
* @example
* var bool = isInteger( -3.0 );
* // returns true
*
* @example
* var bool = isInteger( new Number( -3.0 ) );
* // returns false
*/
function isInteger( value ) {
return (
isNumber( value ) &&
isInt( value )
);
}
// EXPORTS //
module.exports = isInteger;
},{"./integer.js":102,"@stdlib/assert/is-number":128}],106:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var Uint8Array = require( '@stdlib/array/uint8' );
var Uint16Array = require( '@stdlib/array/uint16' );
// MAIN //
var ctors = {
'uint16': Uint16Array,
'uint8': Uint8Array
};
// EXPORTS //
module.exports = ctors;
},{"@stdlib/array/uint16":16,"@stdlib/array/uint8":22}],107:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Return a boolean indicating if an environment is little endian.
*
* @module @stdlib/assert/is-little-endian
*
* @example
* var IS_LITTLE_ENDIAN = require( '@stdlib/assert/is-little-endian' );
*
* var bool = IS_LITTLE_ENDIAN;
* // returns <boolean>
*/
// MODULES //
var IS_LITTLE_ENDIAN = require( './main.js' );
// EXPORTS //
module.exports = IS_LITTLE_ENDIAN;
},{"./main.js":108}],108:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var ctors = require( './ctors.js' );
// VARIABLES //
var bool;
// FUNCTIONS //
/**
* Returns a boolean indicating if an environment is little endian.
*
* @private
* @returns {boolean} boolean indicating if an environment is little endian
*
* @example
* var bool = isLittleEndian();
* // returns <boolean>
*/
function isLittleEndian() {
var uint16view;
var uint8view;
uint16view = new ctors[ 'uint16' ]( 1 );
/*
* Set the uint16 view to a value having distinguishable lower and higher order words.
*
* 4660 => 0x1234 => 0x12 0x34 => '00010010 00110100' => (0x12,0x34) == (18,52)
*/
uint16view[ 0 ] = 0x1234;
// Create a uint8 view on top of the uint16 buffer:
uint8view = new ctors[ 'uint8' ]( uint16view.buffer );
// If little endian, the least significant byte will be first...
return ( uint8view[ 0 ] === 0x34 );
}
// MAIN //
bool = isLittleEndian();
// EXPORTS //
module.exports = bool;
},{"./ctors.js":106}],109:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is `NaN`.
*
* @module @stdlib/assert/is-nan
*
* @example
* var isnan = require( '@stdlib/assert/is-nan' );
*
* var bool = isnan( NaN );
* // returns true
*
* bool = isnan( new Number( NaN ) );
* // returns true
*
* bool = isnan( 3.14 );
* // returns false
*
* bool = isnan( null );
* // returns false
*
* @example
* var isnan = require( '@stdlib/assert/is-nan' ).isPrimitive;
*
* var bool = isnan( NaN );
* // returns true
*
* bool = isnan( 3.14 );
* // returns false
*
* bool = isnan( new Number( NaN ) );
* // returns false
*
* @example
* var isnan = require( '@stdlib/assert/is-nan' ).isObject;
*
* var bool = isnan( NaN );
* // returns false
*
* bool = isnan( new Number( NaN ) );
* // returns true
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var isnan = require( './main.js' );
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
setReadOnly( isnan, 'isPrimitive', isPrimitive );
setReadOnly( isnan, 'isObject', isObject );
// EXPORTS //
module.exports = isnan;
},{"./main.js":110,"./object.js":111,"./primitive.js":112,"@stdlib/utils/define-nonenumerable-read-only-property":297}],110:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
/**
* Tests if a value is `NaN`.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is `NaN`
*
* @example
* var bool = isnan( NaN );
* // returns true
*
* @example
* var bool = isnan( new Number( NaN ) );
* // returns true
*
* @example
* var bool = isnan( 3.14 );
* // returns false
*
* @example
* var bool = isnan( null );
* // returns false
*/
function isnan( value ) {
return ( isPrimitive( value ) || isObject( value ) );
}
// EXPORTS //
module.exports = isnan;
},{"./object.js":111,"./primitive.js":112}],111:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isNumber = require( '@stdlib/assert/is-number' ).isObject;
var isNan = require( '@stdlib/math/base/assert/is-nan' );
// MAIN //
/**
* Tests if a value is a number object having a value of `NaN`.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a number object having a value of `NaN`
*
* @example
* var bool = isnan( NaN );
* // returns false
*
* @example
* var bool = isnan( new Number( NaN ) );
* // returns true
*/
function isnan( value ) {
return (
isNumber( value ) &&
isNan( value.valueOf() )
);
}
// EXPORTS //
module.exports = isnan;
},{"@stdlib/assert/is-number":128,"@stdlib/math/base/assert/is-nan":239}],112:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;
var isNan = require( '@stdlib/math/base/assert/is-nan' );
// MAIN //
/**
* Tests if a value is a `NaN` number primitive.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a `NaN` number primitive
*
* @example
* var bool = isnan( NaN );
* // returns true
*
* @example
* var bool = isnan( 3.14 );
* // returns false
*
* @example
* var bool = isnan( new Number( NaN ) );
* // returns false
*/
function isnan( value ) {
return (
isNumber( value ) &&
isNan( value )
);
}
// EXPORTS //
module.exports = isnan;
},{"@stdlib/assert/is-number":128,"@stdlib/math/base/assert/is-nan":239}],113:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is Node stream-like.
*
* @module @stdlib/assert/is-node-stream-like
*
* @example
* var transformStream = require( '@stdlib/streams/node/transform' );
* var isNodeStreamLike = require( '@stdlib/assert/is-node-stream-like' );
*
* var stream = transformStream();
*
* var bool = isNodeStreamLike( stream );
* // returns true
*
* bool = isNodeStreamLike( {} );
* // returns false
*/
// MODULES //
var isNodeStreamLike = require( './main.js' );
// EXPORTS //
module.exports = isNodeStreamLike;
},{"./main.js":114}],114:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Tests if a value is Node stream-like.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is Node stream-like
*
* @example
* var transformStream = require( '@stdlib/streams/node/transform' );
*
* var stream = transformStream();
*
* var bool = isNodeStreamLike( stream );
* // returns true
*
* bool = isNodeStreamLike( {} );
* // returns false
*/
function isNodeStreamLike( value ) {
return (
// Must be an object:
value !== null &&
typeof value === 'object' &&
// Should be an event emitter:
typeof value.on === 'function' &&
typeof value.once === 'function' &&
typeof value.emit === 'function' &&
typeof value.addListener === 'function' &&
typeof value.removeListener === 'function' &&
typeof value.removeAllListeners === 'function' &&
// Should have a `pipe` method (Node streams inherit from `Stream`, including writable streams):
typeof value.pipe === 'function'
);
}
// EXPORTS //
module.exports = isNodeStreamLike;
},{}],115:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is Node writable stream-like.
*
* @module @stdlib/assert/is-node-writable-stream-like
*
* @example
* var transformStream = require( '@stdlib/streams/node/transform' );
* var isNodeWritableStreamLike = require( '@stdlib/assert/is-node-writable-stream-like' );
*
* var stream = transformStream();
*
* var bool = isNodeWritableStreamLike( stream );
* // returns true
*
* bool = isNodeWritableStreamLike( {} );
* // returns false
*/
// MODULES //
var isNodeWritableStreamLike = require( './main.js' );
// EXPORTS //
module.exports = isNodeWritableStreamLike;
},{"./main.js":116}],116:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable no-underscore-dangle */
'use strict';
// MODULES //
var isNodeStreamLike = require( '@stdlib/assert/is-node-stream-like' );
// MAIN //
/**
* Tests if a value is Node writable stream-like.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is Node writable stream-like
*
* @example
* var transformStream = require( '@stdlib/streams/node/transform' );
*
* var stream = transformStream();
*
* var bool = isNodeWritableStreamLike( stream );
* // returns true
*
* bool = isNodeWritableStreamLike( {} );
* // returns false
*/
function isNodeWritableStreamLike( value ) {
return (
// Must be stream-like:
isNodeStreamLike( value ) &&
// Should have writable stream methods:
typeof value._write === 'function' &&
// Should have writable stream state:
typeof value._writableState === 'object'
);
}
// EXPORTS //
module.exports = isNodeWritableStreamLike;
},{"@stdlib/assert/is-node-stream-like":113}],117:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is an array-like object containing only nonnegative integers.
*
* @module @stdlib/assert/is-nonnegative-integer-array
*
* @example
* var isNonNegativeIntegerArray = require( '@stdlib/assert/is-nonnegative-integer-array' );
*
* var bool = isNonNegativeIntegerArray( [ 3.0, new Number(3.0) ] );
* // returns true
*
* bool = isNonNegativeIntegerArray( [ 3.0, '3.0' ] );
* // returns false
*
* @example
* var isNonNegativeIntegerArray = require( '@stdlib/assert/is-nonnegative-integer-array' ).primitives;
*
* var bool = isNonNegativeIntegerArray( [ 1.0, 0.0, 10.0 ] );
* // returns true
*
* bool = isNonNegativeIntegerArray( [ 3.0, new Number(1.0) ] );
* // returns false
*
* @example
* var isNonNegativeIntegerArray = require( '@stdlib/assert/is-nonnegative-integer-array' ).objects;
*
* var bool = isNonNegativeIntegerArray( [ new Number(3.0), new Number(1.0) ] );
* // returns true
*
* bool = isNonNegativeIntegerArray( [ 1.0, 0.0, 10.0 ] );
* // returns false
*/
// MODULES //
var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' );
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var arrayfun = require( '@stdlib/assert/tools/array-like-function' );
// MAIN //
var isNonNegativeIntegerArray = arrayfun( isNonNegativeInteger );
setReadOnly( isNonNegativeIntegerArray, 'primitives', arrayfun( isNonNegativeInteger.isPrimitive ) );
setReadOnly( isNonNegativeIntegerArray, 'objects', arrayfun( isNonNegativeInteger.isObject ) );
// EXPORTS //
module.exports = isNonNegativeIntegerArray;
},{"@stdlib/assert/is-nonnegative-integer":118,"@stdlib/assert/tools/array-like-function":166,"@stdlib/utils/define-nonenumerable-read-only-property":297}],118:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is a nonnegative integer.
*
* @module @stdlib/assert/is-nonnegative-integer
*
* @example
* var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' );
*
* var bool = isNonNegativeInteger( 5.0 );
* // returns true
*
* bool = isNonNegativeInteger( new Number( 5.0 ) );
* // returns true
*
* bool = isNonNegativeInteger( -5.0 );
* // returns false
*
* bool = isNonNegativeInteger( 3.14 );
* // returns false
*
* bool = isNonNegativeInteger( null );
* // returns false
*
* @example
* var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;
*
* var bool = isNonNegativeInteger( 3.0 );
* // returns true
*
* bool = isNonNegativeInteger( new Number( 3.0 ) );
* // returns false
*
* @example
* var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isObject;
*
* var bool = isNonNegativeInteger( 3.0 );
* // returns false
*
* bool = isNonNegativeInteger( new Number( 3.0 ) );
* // returns true
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var isNonNegativeInteger = require( './main.js' );
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
setReadOnly( isNonNegativeInteger, 'isPrimitive', isPrimitive );
setReadOnly( isNonNegativeInteger, 'isObject', isObject );
// EXPORTS //
module.exports = isNonNegativeInteger;
},{"./main.js":119,"./object.js":120,"./primitive.js":121,"@stdlib/utils/define-nonenumerable-read-only-property":297}],119:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
/**
* Tests if a value is a nonnegative integer.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a nonnegative integer
*
* @example
* var bool = isNonNegativeInteger( 5.0 );
* // returns true
*
* @example
* var bool = isNonNegativeInteger( new Number( 5.0 ) );
* // returns true
*
* @example
* var bool = isNonNegativeInteger( -5.0 );
* // returns false
*
* @example
* var bool = isNonNegativeInteger( 3.14 );
* // returns false
*
* @example
* var bool = isNonNegativeInteger( null );
* // returns false
*/
function isNonNegativeInteger( value ) {
return ( isPrimitive( value ) || isObject( value ) );
}
// EXPORTS //
module.exports = isNonNegativeInteger;
},{"./object.js":120,"./primitive.js":121}],120:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isInteger = require( '@stdlib/assert/is-integer' ).isObject;
// MAIN //
/**
* Tests if a value is a number object having a nonnegative integer value.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a number object having a nonnegative integer value
*
* @example
* var bool = isNonNegativeInteger( 3.0 );
* // returns false
*
* @example
* var bool = isNonNegativeInteger( new Number( 3.0 ) );
* // returns true
*/
function isNonNegativeInteger( value ) {
return (
isInteger( value ) &&
value.valueOf() >= 0
);
}
// EXPORTS //
module.exports = isNonNegativeInteger;
},{"@stdlib/assert/is-integer":101}],121:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive;
// MAIN //
/**
* Tests if a value is a number primitive having a nonnegative integer value.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a number primitive having a nonnegative integer value
*
* @example
* var bool = isNonNegativeInteger( 3.0 );
* // returns true
*
* @example
* var bool = isNonNegativeInteger( new Number( 3.0 ) );
* // returns false
*/
function isNonNegativeInteger( value ) {
return (
isInteger( value ) &&
value >= 0
);
}
// EXPORTS //
module.exports = isNonNegativeInteger;
},{"@stdlib/assert/is-integer":101}],122:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is a nonnegative number.
*
* @module @stdlib/assert/is-nonnegative-number
*
* @example
* var isNonNegativeNumber = require( '@stdlib/assert/is-nonnegative-number' );
*
* var bool = isNonNegativeNumber( 5.0 );
* // returns true
*
* bool = isNonNegativeNumber( new Number( 5.0 ) );
* // returns true
*
* bool = isNonNegativeNumber( 3.14 );
* // returns true
*
* bool = isNonNegativeNumber( -5.0 );
* // returns false
*
* bool = isNonNegativeNumber( null );
* // returns false
*
* @example
* var isNonNegativeNumber = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;
*
* var bool = isNonNegativeNumber( 3.0 );
* // returns true
*
* bool = isNonNegativeNumber( new Number( 3.0 ) );
* // returns false
*
* @example
* var isNonNegativeNumber = require( '@stdlib/assert/is-nonnegative-number' ).isObject;
*
* var bool = isNonNegativeNumber( 3.0 );
* // returns false
*
* bool = isNonNegativeNumber( new Number( 3.0 ) );
* // returns true
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var isNonNegativeNumber = require( './main.js' );
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
setReadOnly( isNonNegativeNumber, 'isPrimitive', isPrimitive );
setReadOnly( isNonNegativeNumber, 'isObject', isObject );
// EXPORTS //
module.exports = isNonNegativeNumber;
},{"./main.js":123,"./object.js":124,"./primitive.js":125,"@stdlib/utils/define-nonenumerable-read-only-property":297}],123:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
/**
* Tests if a value is a nonnegative number.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a nonnegative number
*
* @example
* var bool = isNonNegativeNumber( 5.0 );
* // returns true
*
* @example
* var bool = isNonNegativeNumber( new Number( 5.0 ) );
* // returns true
*
* @example
* var bool = isNonNegativeNumber( 3.14 );
* // returns true
*
* @example
* var bool = isNonNegativeNumber( -5.0 );
* // returns false
*
* @example
* var bool = isNonNegativeNumber( null );
* // returns false
*/
function isNonNegativeNumber( value ) {
return ( isPrimitive( value ) || isObject( value ) );
}
// EXPORTS //
module.exports = isNonNegativeNumber;
},{"./object.js":124,"./primitive.js":125}],124:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isNumber = require( '@stdlib/assert/is-number' ).isObject;
// MAIN //
/**
* Tests if a value is a number object having a nonnegative value.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a number object having a nonnegative number value
*
* @example
* var bool = isNonNegativeNumber( 3.0 );
* // returns false
*
* @example
* var bool = isNonNegativeNumber( new Number( 3.0 ) );
* // returns true
*/
function isNonNegativeNumber( value ) {
return (
isNumber( value ) &&
value.valueOf() >= 0.0
);
}
// EXPORTS //
module.exports = isNonNegativeNumber;
},{"@stdlib/assert/is-number":128}],125:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;
// MAIN //
/**
* Tests if a value is a number primitive having a nonnegative value.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a number primitive having a nonnegative number value
*
* @example
* var bool = isNonNegativeNumber( 3.0 );
* // returns true
*
* @example
* var bool = isNonNegativeNumber( new Number( 3.0 ) );
* // returns false
*/
function isNonNegativeNumber( value ) {
return (
isNumber( value ) &&
value >= 0.0
);
}
// EXPORTS //
module.exports = isNonNegativeNumber;
},{"@stdlib/assert/is-number":128}],126:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is `null`.
*
* @module @stdlib/assert/is-null
*
* @example
* var isNull = require( '@stdlib/assert/is-null' );
*
* var value = null;
*
* var bool = isNull( value );
* // returns true
*/
// MODULES //
var isNull = require( './main.js' );
// EXPORTS //
module.exports = isNull;
},{"./main.js":127}],127:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Tests if a value is `null`.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is null
*
* @example
* var bool = isNull( null );
* // returns true
*
* bool = isNull( true );
* // returns false
*/
function isNull( value ) {
return value === null;
}
// EXPORTS //
module.exports = isNull;
},{}],128:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is a number.
*
* @module @stdlib/assert/is-number
*
* @example
* var isNumber = require( '@stdlib/assert/is-number' );
*
* var bool = isNumber( 3.14 );
* // returns true
*
* bool = isNumber( new Number( 3.14 ) );
* // returns true
*
* bool = isNumber( NaN );
* // returns true
*
* bool = isNumber( null );
* // returns false
*
* @example
* var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;
*
* var bool = isNumber( 3.14 );
* // returns true
*
* bool = isNumber( NaN );
* // returns true
*
* bool = isNumber( new Number( 3.14 ) );
* // returns false
*
* @example
* var isNumber = require( '@stdlib/assert/is-number' ).isObject;
*
* var bool = isNumber( 3.14 );
* // returns false
*
* bool = isNumber( new Number( 3.14 ) );
* // returns true
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var isNumber = require( './main.js' );
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
setReadOnly( isNumber, 'isPrimitive', isPrimitive );
setReadOnly( isNumber, 'isObject', isObject );
// EXPORTS //
module.exports = isNumber;
},{"./main.js":129,"./object.js":130,"./primitive.js":131,"@stdlib/utils/define-nonenumerable-read-only-property":297}],129:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
/**
* Tests if a value is a number.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a number
*
* @example
* var bool = isNumber( 3.14 );
* // returns true
*
* @example
* var bool = isNumber( new Number( 3.14 ) );
* // returns true
*
* @example
* var bool = isNumber( NaN );
* // returns true
*
* @example
* var bool = isNumber( null );
* // returns false
*/
function isNumber( value ) {
return ( isPrimitive( value ) || isObject( value ) );
}
// EXPORTS //
module.exports = isNumber;
},{"./object.js":130,"./primitive.js":131}],130:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var hasToStringTag = require( '@stdlib/assert/has-tostringtag-support' );
var nativeClass = require( '@stdlib/utils/native-class' );
var Number = require( '@stdlib/number/ctor' );
var test = require( './try2serialize.js' );
// VARIABLES //
var FLG = hasToStringTag();
// MAIN //
/**
* Tests if a value is a number object.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a number object
*
* @example
* var bool = isNumber( 3.14 );
* // returns false
*
* @example
* var bool = isNumber( new Number( 3.14 ) );
* // returns true
*/
function isNumber( value ) {
if ( typeof value === 'object' ) {
if ( value instanceof Number ) {
return true;
}
if ( FLG ) {
return test( value );
}
return ( nativeClass( value ) === '[object Number]' );
}
return false;
}
// EXPORTS //
module.exports = isNumber;
},{"./try2serialize.js":133,"@stdlib/assert/has-tostringtag-support":50,"@stdlib/number/ctor":248,"@stdlib/utils/native-class":346}],131:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Tests if a value is a number primitive.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a number primitive
*
* @example
* var bool = isNumber( 3.14 );
* // returns true
*
* @example
* var bool = isNumber( NaN );
* // returns true
*
* @example
* var bool = isNumber( new Number( 3.14 ) );
* // returns false
*/
function isNumber( value ) {
return ( typeof value === 'number' );
}
// EXPORTS //
module.exports = isNumber;
},{}],132:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var Number = require( '@stdlib/number/ctor' );
// MAIN //
// eslint-disable-next-line stdlib/no-redeclare
var toString = Number.prototype.toString; // non-generic
// EXPORTS //
module.exports = toString;
},{"@stdlib/number/ctor":248}],133:[function(require,module,exports){
arguments[4][77][0].apply(exports,arguments)
},{"./tostring.js":132,"dup":77}],134:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is object-like.
*
* @module @stdlib/assert/is-object-like
*
* @example
* var isObjectLike = require( '@stdlib/assert/is-object-like' );
*
* var bool = isObjectLike( {} );
* // returns true
*
* bool = isObjectLike( [] );
* // returns true
*
* bool = isObjectLike( null );
* // returns false
*
* @example
* var isObjectLike = require( '@stdlib/assert/is-object-like' ).isObjectLikeArray;
*
* var bool = isObjectLike( [ {}, [] ] );
* // returns true
*
* bool = isObjectLike( [ {}, '3.0' ] );
* // returns false
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var arrayfun = require( '@stdlib/assert/tools/array-function' );
var isObjectLike = require( './main.js' );
// MAIN //
setReadOnly( isObjectLike, 'isObjectLikeArray', arrayfun( isObjectLike ) );
// EXPORTS //
module.exports = isObjectLike;
},{"./main.js":135,"@stdlib/assert/tools/array-function":164,"@stdlib/utils/define-nonenumerable-read-only-property":297}],135:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Tests if a value is object-like.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether a value is object-like
*
* @example
* var bool = isObjectLike( {} );
* // returns true
*
* @example
* var bool = isObjectLike( [] );
* // returns true
*
* @example
* var bool = isObjectLike( null );
* // returns false
*/
function isObjectLike( value ) {
return (
value !== null &&
typeof value === 'object'
);
}
// EXPORTS //
module.exports = isObjectLike;
},{}],136:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is an object.
*
* @module @stdlib/assert/is-object
*
* @example
* var isObject = require( '@stdlib/assert/is-object' );
*
* var bool = isObject( {} );
* // returns true
*
* bool = isObject( true );
* // returns false
*/
// MODULES //
var isObject = require( './main.js' );
// EXPORTS //
module.exports = isObject;
},{"./main.js":137}],137:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isArray = require( '@stdlib/assert/is-array' );
// MAIN //
/**
* Tests if a value is an object; e.g., `{}`.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is an object
*
* @example
* var bool = isObject( {} );
* // returns true
*
* @example
* var bool = isObject( null );
* // returns false
*/
function isObject( value ) {
return (
typeof value === 'object' &&
value !== null &&
!isArray( value )
);
}
// EXPORTS //
module.exports = isObject;
},{"@stdlib/assert/is-array":70}],138:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is a plain object.
*
* @module @stdlib/assert/is-plain-object
*
* @example
* var isPlainObject = require( '@stdlib/assert/is-plain-object' );
*
* var bool = isPlainObject( {} );
* // returns true
*
* bool = isPlainObject( null );
* // returns false
*/
// MODULES //
var isPlainObject = require( './main.js' );
// EXPORTS //
module.exports = isPlainObject;
},{"./main.js":139}],139:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isObject = require( '@stdlib/assert/is-object' );
var isFunction = require( '@stdlib/assert/is-function' );
var getPrototypeOf = require( '@stdlib/utils/get-prototype-of' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var nativeClass = require( '@stdlib/utils/native-class' );
// VARIABLES //
var objectPrototype = Object.prototype;
// FUNCTIONS //
/**
* Tests that an object only has own properties.
*
* @private
* @param {Object} obj - value to test
* @returns {boolean} boolean indicating if an object only has own properties
*/
function ownProps( obj ) {
var key;
// NOTE: possibility of perf boost if key enumeration order is known (see http://stackoverflow.com/questions/18531624/isplainobject-thing).
for ( key in obj ) {
if ( !hasOwnProp( obj, key ) ) {
return false;
}
}
return true;
}
// MAIN //
/**
* Tests if a value is a plain object.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a plain object
*
* @example
* var bool = isPlainObject( {} );
* // returns true
*
* @example
* var bool = isPlainObject( null );
* // returns false
*/
function isPlainObject( value ) {
var proto;
// Screen for obvious non-objects...
if ( !isObject( value ) ) {
return false;
}
// Objects with no prototype (e.g., `Object.create( null )`) are plain...
proto = getPrototypeOf( value );
if ( !proto ) {
return true;
}
// Objects having a prototype are plain if and only if they are constructed with a global `Object` function and the prototype points to the prototype of a plain object...
return (
// Cannot have own `constructor` property:
!hasOwnProp( value, 'constructor' ) &&
// Prototype `constructor` property must be a function (see also https://bugs.jquery.com/ticket/9897 and http://stackoverflow.com/questions/18531624/isplainobject-thing):
hasOwnProp( proto, 'constructor' ) &&
isFunction( proto.constructor ) &&
nativeClass( proto.constructor ) === '[object Function]' &&
// Test for object-specific method:
hasOwnProp( proto, 'isPrototypeOf' ) &&
isFunction( proto.isPrototypeOf ) &&
(
// Test if the prototype matches the global `Object` prototype (same realm):
proto === objectPrototype ||
// Test that all properties are own properties (cross-realm; *most* likely a plain object):
ownProps( value )
)
);
}
// EXPORTS //
module.exports = isPlainObject;
},{"@stdlib/assert/has-own-property":46,"@stdlib/assert/is-function":93,"@stdlib/assert/is-object":136,"@stdlib/utils/get-prototype-of":312,"@stdlib/utils/native-class":346}],140:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is a positive integer.
*
* @module @stdlib/assert/is-positive-integer
*
* @example
* var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' );
*
* var bool = isPositiveInteger( 5.0 );
* // returns true
*
* bool = isPositiveInteger( new Number( 5.0 ) );
* // returns true
*
* bool = isPositiveInteger( -5.0 );
* // returns false
*
* bool = isPositiveInteger( 3.14 );
* // returns false
*
* bool = isPositiveInteger( null );
* // returns false
*
* @example
* var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;
*
* var bool = isPositiveInteger( 3.0 );
* // returns true
*
* bool = isPositiveInteger( new Number( 3.0 ) );
* // returns false
*
* @example
* var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isObject;
*
* var bool = isPositiveInteger( 3.0 );
* // returns false
*
* bool = isPositiveInteger( new Number( 3.0 ) );
* // returns true
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var isPositiveInteger = require( './main.js' );
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
setReadOnly( isPositiveInteger, 'isPrimitive', isPrimitive );
setReadOnly( isPositiveInteger, 'isObject', isObject );
// EXPORTS //
module.exports = isPositiveInteger;
},{"./main.js":141,"./object.js":142,"./primitive.js":143,"@stdlib/utils/define-nonenumerable-read-only-property":297}],141:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
/**
* Tests if a value is a positive integer.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a positive integer
*
* @example
* var bool = isPositiveInteger( 5.0 );
* // returns true
*
* @example
* var bool = isPositiveInteger( new Number( 5.0 ) );
* // returns true
*
* @example
* var bool = isPositiveInteger( 0.0 );
* // returns false
*
* @example
* var bool = isPositiveInteger( -5.0 );
* // returns false
*
* @example
* var bool = isPositiveInteger( 3.14 );
* // returns false
*
* @example
* var bool = isPositiveInteger( null );
* // returns false
*/
function isPositiveInteger( value ) {
return ( isPrimitive( value ) || isObject( value ) );
}
// EXPORTS //
module.exports = isPositiveInteger;
},{"./object.js":142,"./primitive.js":143}],142:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isInteger = require( '@stdlib/assert/is-integer' ).isObject;
// MAIN //
/**
* Tests if a value is a number object having a positive integer value.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a number object having a positive integer value
*
* @example
* var bool = isPositiveInteger( 3.0 );
* // returns false
*
* @example
* var bool = isPositiveInteger( new Number( 3.0 ) );
* // returns true
*/
function isPositiveInteger( value ) {
return (
isInteger( value ) &&
value.valueOf() > 0.0
);
}
// EXPORTS //
module.exports = isPositiveInteger;
},{"@stdlib/assert/is-integer":101}],143:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive;
// MAIN //
/**
* Tests if a value is a number primitive having a positive integer value.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a number primitive having a positive integer value
*
* @example
* var bool = isPositiveInteger( 3.0 );
* // returns true
*
* @example
* var bool = isPositiveInteger( new Number( 3.0 ) );
* // returns false
*/
function isPositiveInteger( value ) {
return (
isInteger( value ) &&
value > 0.0
);
}
// EXPORTS //
module.exports = isPositiveInteger;
},{"@stdlib/assert/is-integer":101}],144:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
var exec = RegExp.prototype.exec; // non-generic
// EXPORTS //
module.exports = exec;
},{}],145:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is a regular expression.
*
* @module @stdlib/assert/is-regexp
*
* @example
* var isRegExp = require( '@stdlib/assert/is-regexp' );
*
* var bool = isRegExp( /\.+/ );
* // returns true
*
* bool = isRegExp( {} );
* // returns false
*/
// MODULES //
var isRegExp = require( './main.js' );
// EXPORTS //
module.exports = isRegExp;
},{"./main.js":146}],146:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var hasToStringTag = require( '@stdlib/assert/has-tostringtag-support' );
var nativeClass = require( '@stdlib/utils/native-class' );
var test = require( './try2exec.js' );
// VARIABLES //
var FLG = hasToStringTag();
// MAIN //
/**
* Tests if a value is a regular expression.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a regular expression
*
* @example
* var bool = isRegExp( /\.+/ );
* // returns true
*
* @example
* var bool = isRegExp( {} );
* // returns false
*/
function isRegExp( value ) {
if ( typeof value === 'object' ) {
if ( value instanceof RegExp ) {
return true;
}
if ( FLG ) {
return test( value );
}
return ( nativeClass( value ) === '[object RegExp]' );
}
return false;
}
// EXPORTS //
module.exports = isRegExp;
},{"./try2exec.js":147,"@stdlib/assert/has-tostringtag-support":50,"@stdlib/utils/native-class":346}],147:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var exec = require( './exec.js' );
// MAIN //
/**
* Attempts to call a `RegExp` method.
*
* @private
* @param {*} value - value to test
* @returns {boolean} boolean indicating if able to call a `RegExp` method
*/
function test( value ) {
try {
exec.call( value );
return true;
} catch ( err ) { // eslint-disable-line no-unused-vars
return false;
}
}
// EXPORTS //
module.exports = test;
},{"./exec.js":144}],148:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is an array of strings.
*
* @module @stdlib/assert/is-string-array
*
* @example
* var isStringArray = require( '@stdlib/assert/is-string-array' );
*
* var bool = isStringArray( [ 'abc', 'def' ] );
* // returns true
*
* bool = isStringArray( [ 'abc', 123 ] );
* // returns false
*
* @example
* var isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;
*
* var bool = isStringArray( [ 'abc', 'def' ] );
* // returns true
*
* bool = isStringArray( [ 'abc', new String( 'def' ) ] );
* // returns false
*
* @example
* var isStringArray = require( '@stdlib/assert/is-string-array' ).objects;
*
* var bool = isStringArray( [ new String( 'abc' ), new String( 'def' ) ] );
* // returns true
*
* bool = isStringArray( [ new String( 'abc' ), 'def' ] );
* // returns false
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var arrayfun = require( '@stdlib/assert/tools/array-function' );
var isString = require( '@stdlib/assert/is-string' );
// MAIN //
var isStringArray = arrayfun( isString );
setReadOnly( isStringArray, 'primitives', arrayfun( isString.isPrimitive ) );
setReadOnly( isStringArray, 'objects', arrayfun( isString.isObject ) );
// EXPORTS //
module.exports = isStringArray;
},{"@stdlib/assert/is-string":149,"@stdlib/assert/tools/array-function":164,"@stdlib/utils/define-nonenumerable-read-only-property":297}],149:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is a string.
*
* @module @stdlib/assert/is-string
*
* @example
* var isString = require( '@stdlib/assert/is-string' );
*
* var bool = isString( 'beep' );
* // returns true
*
* bool = isString( new String( 'beep' ) );
* // returns true
*
* bool = isString( 5 );
* // returns false
*
* @example
* var isString = require( '@stdlib/assert/is-string' ).isObject;
*
* var bool = isString( new String( 'beep' ) );
* // returns true
*
* bool = isString( 'beep' );
* // returns false
*
* @example
* var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
*
* var bool = isString( 'beep' );
* // returns true
*
* bool = isString( new String( 'beep' ) );
* // returns false
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var isString = require( './main.js' );
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
setReadOnly( isString, 'isPrimitive', isPrimitive );
setReadOnly( isString, 'isObject', isObject );
// EXPORTS //
module.exports = isString;
},{"./main.js":150,"./object.js":151,"./primitive.js":152,"@stdlib/utils/define-nonenumerable-read-only-property":297}],150:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
/**
* Tests if a value is a string.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a string
*
* @example
* var bool = isString( new String( 'beep' ) );
* // returns true
*
* @example
* var bool = isString( 'beep' );
* // returns true
*/
function isString( value ) {
return ( isPrimitive( value ) || isObject( value ) );
}
// EXPORTS //
module.exports = isString;
},{"./object.js":151,"./primitive.js":152}],151:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var hasToStringTag = require( '@stdlib/assert/has-tostringtag-support' );
var nativeClass = require( '@stdlib/utils/native-class' );
var test = require( './try2valueof.js' );
// VARIABLES //
var FLG = hasToStringTag();
// MAIN //
/**
* Tests if a value is a string object.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a string object
*
* @example
* var bool = isString( new String( 'beep' ) );
* // returns true
*
* @example
* var bool = isString( 'beep' );
* // returns false
*/
function isString( value ) {
if ( typeof value === 'object' ) {
if ( value instanceof String ) {
return true;
}
if ( FLG ) {
return test( value );
}
return ( nativeClass( value ) === '[object String]' );
}
return false;
}
// EXPORTS //
module.exports = isString;
},{"./try2valueof.js":153,"@stdlib/assert/has-tostringtag-support":50,"@stdlib/utils/native-class":346}],152:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Tests if a value is a string primitive.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a string primitive
*
* @example
* var bool = isString( 'beep' );
* // returns true
*
* @example
* var bool = isString( new String( 'beep' ) );
* // returns false
*/
function isString( value ) {
return ( typeof value === 'string' );
}
// EXPORTS //
module.exports = isString;
},{}],153:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var valueOf = require( './valueof.js' ); // eslint-disable-line stdlib/no-redeclare
// MAIN //
/**
* Attempts to extract a string value.
*
* @private
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a string can be extracted
*/
function test( value ) {
try {
valueOf.call( value );
return true;
} catch ( err ) { // eslint-disable-line no-unused-vars
return false;
}
}
// EXPORTS //
module.exports = test;
},{"./valueof.js":154}],154:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// eslint-disable-next-line stdlib/no-redeclare
var valueOf = String.prototype.valueOf; // non-generic
// EXPORTS //
module.exports = valueOf;
},{}],155:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is a Uint16Array.
*
* @module @stdlib/assert/is-uint16array
*
* @example
* var isUint16Array = require( '@stdlib/assert/is-uint16array' );
*
* var bool = isUint16Array( new Uint16Array( 10 ) );
* // returns true
*
* bool = isUint16Array( [] );
* // returns false
*/
// MODULES //
var isUint16Array = require( './main.js' );
// EXPORTS //
module.exports = isUint16Array;
},{"./main.js":156}],156:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var nativeClass = require( '@stdlib/utils/native-class' );
// VARIABLES //
var hasUint16Array = ( typeof Uint16Array === 'function' ); // eslint-disable-line stdlib/require-globals
// MAIN //
/**
* Tests if a value is a Uint16Array.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a Uint16Array
*
* @example
* var bool = isUint16Array( new Uint16Array( 10 ) );
* // returns true
*
* @example
* var bool = isUint16Array( [] );
* // returns false
*/
function isUint16Array( value ) {
return (
( hasUint16Array && value instanceof Uint16Array ) || // eslint-disable-line stdlib/require-globals
nativeClass( value ) === '[object Uint16Array]'
);
}
// EXPORTS //
module.exports = isUint16Array;
},{"@stdlib/utils/native-class":346}],157:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is a Uint32Array.
*
* @module @stdlib/assert/is-uint32array
*
* @example
* var isUint32Array = require( '@stdlib/assert/is-uint32array' );
*
* var bool = isUint32Array( new Uint32Array( 10 ) );
* // returns true
*
* bool = isUint32Array( [] );
* // returns false
*/
// MODULES //
var isUint32Array = require( './main.js' );
// EXPORTS //
module.exports = isUint32Array;
},{"./main.js":158}],158:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var nativeClass = require( '@stdlib/utils/native-class' );
// VARIABLES //
var hasUint32Array = ( typeof Uint32Array === 'function' ); // eslint-disable-line stdlib/require-globals
// MAIN //
/**
* Tests if a value is a Uint32Array.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a Uint32Array
*
* @example
* var bool = isUint32Array( new Uint32Array( 10 ) );
* // returns true
*
* @example
* var bool = isUint32Array( [] );
* // returns false
*/
function isUint32Array( value ) {
return (
( hasUint32Array && value instanceof Uint32Array ) || // eslint-disable-line stdlib/require-globals
nativeClass( value ) === '[object Uint32Array]'
);
}
// EXPORTS //
module.exports = isUint32Array;
},{"@stdlib/utils/native-class":346}],159:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is a Uint8Array.
*
* @module @stdlib/assert/is-uint8array
*
* @example
* var isUint8Array = require( '@stdlib/assert/is-uint8array' );
*
* var bool = isUint8Array( new Uint8Array( 10 ) );
* // returns true
*
* bool = isUint8Array( [] );
* // returns false
*/
// MODULES //
var isUint8Array = require( './main.js' );
// EXPORTS //
module.exports = isUint8Array;
},{"./main.js":160}],160:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var nativeClass = require( '@stdlib/utils/native-class' );
// VARIABLES //
var hasUint8Array = ( typeof Uint8Array === 'function' ); // eslint-disable-line stdlib/require-globals
// MAIN //
/**
* Tests if a value is a Uint8Array.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a Uint8Array
*
* @example
* var bool = isUint8Array( new Uint8Array( 10 ) );
* // returns true
*
* @example
* var bool = isUint8Array( [] );
* // returns false
*/
function isUint8Array( value ) {
return (
( hasUint8Array && value instanceof Uint8Array ) || // eslint-disable-line stdlib/require-globals
nativeClass( value ) === '[object Uint8Array]'
);
}
// EXPORTS //
module.exports = isUint8Array;
},{"@stdlib/utils/native-class":346}],161:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is a Uint8ClampedArray.
*
* @module @stdlib/assert/is-uint8clampedarray
*
* @example
* var isUint8ClampedArray = require( '@stdlib/assert/is-uint8clampedarray' );
*
* var bool = isUint8ClampedArray( new Uint8ClampedArray( 10 ) );
* // returns true
*
* bool = isUint8ClampedArray( [] );
* // returns false
*/
// MODULES //
var isUint8ClampedArray = require( './main.js' );
// EXPORTS //
module.exports = isUint8ClampedArray;
},{"./main.js":162}],162:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var nativeClass = require( '@stdlib/utils/native-class' );
// VARIABLES //
var hasUint8ClampedArray = ( typeof Uint8ClampedArray === 'function' ); // eslint-disable-line stdlib/require-globals
// MAIN //
/**
* Tests if a value is a Uint8ClampedArray.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a Uint8ClampedArray
*
* @example
* var bool = isUint8ClampedArray( new Uint8ClampedArray( 10 ) );
* // returns true
*
* @example
* var bool = isUint8ClampedArray( [] );
* // returns false
*/
function isUint8ClampedArray( value ) {
return (
( hasUint8ClampedArray && value instanceof Uint8ClampedArray ) || // eslint-disable-line stdlib/require-globals
nativeClass( value ) === '[object Uint8ClampedArray]'
);
}
// EXPORTS //
module.exports = isUint8ClampedArray;
},{"@stdlib/utils/native-class":346}],163:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isArray = require( '@stdlib/assert/is-array' );
// MAIN //
/**
* Returns a function which tests if every element in an array passes a test condition.
*
* @param {Function} predicate - function to apply
* @throws {TypeError} must provide a function
* @returns {Function} an array function
*
* @example
* var isOdd = require( '@stdlib/assert/is-odd' );
*
* var arr1 = [ 1, 3, 5, 7 ];
* var arr2 = [ 3, 5, 8 ];
*
* var validate = arrayfcn( isOdd );
*
* var bool = validate( arr1 );
* // returns true
*
* bool = validate( arr2 );
* // returns false
*/
function arrayfcn( predicate ) {
if ( typeof predicate !== 'function' ) {
throw new TypeError( 'invalid argument. Must provide a function. Value: `' + predicate + '`.' );
}
return every;
/**
* Tests if every element in an array passes a test condition.
*
* @private
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether a value is an array for which all elements pass a test condition
*/
function every( value ) {
var len;
var i;
if ( !isArray( value ) ) {
return false;
}
len = value.length;
if ( len === 0 ) {
return false;
}
for ( i = 0; i < len; i++ ) {
if ( predicate( value[ i ] ) === false ) {
return false;
}
}
return true;
}
}
// EXPORTS //
module.exports = arrayfcn;
},{"@stdlib/assert/is-array":70}],164:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Return a function which tests if every element in an array passes a test condition.
*
* @module @stdlib/assert/tools/array-function
*
* @example
* var isOdd = require( '@stdlib/assert/is-odd' );
* var arrayfcn = require( '@stdlib/assert/tools/array-function' );
*
* var arr1 = [ 1, 3, 5, 7 ];
* var arr2 = [ 3, 5, 8 ];
*
* var validate = arrayfcn( isOdd );
*
* var bool = validate( arr1 );
* // returns true
*
* bool = validate( arr2 );
* // returns false
*/
// MODULES //
var arrayfcn = require( './arrayfcn.js' );
// EXPORTS //
module.exports = arrayfcn;
},{"./arrayfcn.js":163}],165:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isArrayLike = require( '@stdlib/assert/is-array-like' );
// MAIN //
/**
* Returns a function which tests if every element in an array-like object passes a test condition.
*
* @param {Function} predicate - function to apply
* @throws {TypeError} must provide a function
* @returns {Function} an array-like object function
*
* @example
* var isOdd = require( '@stdlib/assert/is-odd' );
*
* var arr1 = [ 1, 3, 5, 7 ];
* var arr2 = [ 3, 5, 8 ];
*
* var validate = arraylikefcn( isOdd );
*
* var bool = validate( arr1 );
* // returns true
*
* bool = validate( arr2 );
* // returns false
*/
function arraylikefcn( predicate ) {
if ( typeof predicate !== 'function' ) {
throw new TypeError( 'invalid argument. Must provide a function. Value: `' + predicate + '`.' );
}
return every;
/**
* Tests if every element in an array-like object passes a test condition.
*
* @private
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether a value is an array-like object for which all elements pass a test condition
*/
function every( value ) {
var len;
var i;
if ( !isArrayLike( value ) ) {
return false;
}
len = value.length;
if ( len === 0 ) {
return false;
}
for ( i = 0; i < len; i++ ) {
if ( predicate( value[ i ] ) === false ) {
return false;
}
}
return true;
}
}
// EXPORTS //
module.exports = arraylikefcn;
},{"@stdlib/assert/is-array-like":68}],166:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Return a function which tests if every element in an array-like object passes a test condition.
*
* @module @stdlib/assert/tools/array-like-function
*
* @example
* var isOdd = require( '@stdlib/assert/is-odd' );
* var arraylikefcn = require( '@stdlib/assert/tools/array-like-function' );
*
* var arr1 = [ 1, 3, 5, 7 ];
* var arr2 = [ 3, 5, 8 ];
*
* var validate = arraylikefcn( isOdd );
*
* var bool = validate( arr1 );
* // returns true
*
* bool = validate( arr2 );
* // returns false
*/
// MODULES //
var arraylikefcn = require( './arraylikefcn.js' );
// EXPORTS //
module.exports = arraylikefcn;
},{"./arraylikefcn.js":165}],167:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var TransformStream = require( '@stdlib/streams/node/transform' );
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var isFunction = require( '@stdlib/assert/is-function' );
var createHarness = require( './harness' );
var harness = require( './get_harness.js' );
// VARIABLES //
var listeners = [];
// FUNCTIONS //
/**
* Callback invoked when a harness finishes running all benchmarks.
*
* @private
*/
function done() {
var len;
var f;
var i;
len = listeners.length;
// Inform all the listeners that the harness has finished...
for ( i = 0; i < len; i++ ) {
f = listeners.shift();
f();
}
}
/**
* Creates a results stream.
*
* @private
* @param {Options} [options] - stream options
* @throws {Error} must provide valid stream options
* @returns {TransformStream} results stream
*/
function createStream( options ) {
var stream;
var bench;
var opts;
if ( arguments.length ) {
opts = options;
} else {
opts = {};
}
// If we have already created a harness, calling this function simply creates another results stream...
if ( harness.cached ) {
bench = harness();
return bench.createStream( opts );
}
stream = new TransformStream( opts );
opts.stream = stream;
// Create a harness which uses the created output stream:
harness( opts, done );
return stream;
}
/**
* Adds a listener for when a harness finishes running all benchmarks.
*
* @private
* @param {Callback} clbk - listener
* @throws {TypeError} must provide a function
* @throws {Error} must provide a listener only once
* @returns {void}
*/
function onFinish( clbk ) {
var i;
if ( !isFunction( clbk ) ) {
throw new TypeError( 'invalid argument. Must provide a function. Value: `'+clbk+'`.' );
}
// Allow adding a listener only once...
for ( i = 0; i < listeners.length; i++ ) {
if ( clbk === listeners[ i ] ) {
throw new Error( 'invalid argument. Attempted to add duplicate listener.' );
}
}
listeners.push( clbk );
}
// MAIN //
/**
* Runs a benchmark.
*
* @param {string} name - benchmark name
* @param {Options} [options] - benchmark options
* @param {boolean} [options.skip=false] - boolean indicating whether to skip a benchmark
* @param {(PositiveInteger|null)} [options.iterations=null] - number of iterations
* @param {PositiveInteger} [options.repeats=3] - number of repeats
* @param {PositiveInteger} [options.timeout=300000] - number of milliseconds before a benchmark automatically fails
* @param {Function} [benchmark] - function containing benchmark code
* @throws {TypeError} first argument must be a string
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @throws {TypeError} benchmark argument must a function
* @returns {Benchmark} benchmark harness
*
* @example
* bench( 'beep', function benchmark( b ) {
* var x;
* var i;
* b.tic();
* for ( i = 0; i < b.iterations; i++ ) {
* x = Math.sin( Math.random() );
* if ( x !== x ) {
* b.ok( false, 'should not return NaN' );
* }
* }
* b.toc();
* if ( x !== x ) {
* b.ok( false, 'should not return NaN' );
* }
* b.end();
* });
*/
function bench( name, options, benchmark ) {
var h = harness( done );
if ( arguments.length < 2 ) {
h( name );
} else if ( arguments.length === 2 ) {
h( name, options );
} else {
h( name, options, benchmark );
}
return bench;
}
/**
* Creates a benchmark harness.
*
* @name createHarness
* @memberof bench
* @type {Function}
* @param {Options} [options] - harness options
* @param {Callback} [clbk] - callback to invoke when a harness finishes running all benchmarks
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @throws {TypeError} callback argument must be a function
* @returns {Function} benchmark harness
*/
setReadOnly( bench, 'createHarness', createHarness );
/**
* Creates a results stream.
*
* @name createStream
* @memberof bench
* @type {Function}
* @param {Options} [options] - stream options
* @throws {Error} must provide valid stream options
* @returns {TransformStream} results stream
*/
setReadOnly( bench, 'createStream', createStream );
/**
* Adds a listener for when a harness finishes running all benchmarks.
*
* @name onFinish
* @memberof bench
* @type {Function}
* @param {Callback} clbk - listener
* @throws {TypeError} must provide a function
* @throws {Error} must provide a listener only once
* @returns {void}
*/
setReadOnly( bench, 'onFinish', onFinish );
// EXPORTS //
module.exports = bench;
},{"./get_harness.js":189,"./harness":190,"@stdlib/assert/is-function":93,"@stdlib/streams/node/transform":273,"@stdlib/utils/define-nonenumerable-read-only-property":297}],168:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
// MAIN //
/**
* Generates an assertion.
*
* @private
* @param {boolean} ok - assertion outcome
* @param {Options} opts - options
*/
function assert( ok, opts ) {
/* eslint-disable no-invalid-this, no-unused-vars */ // TODO: remove no-unused-vars once `err` is used
var result;
var err;
result = {
'id': this._count,
'ok': ok,
'skip': opts.skip,
'todo': opts.todo,
'name': opts.message || '(unnamed assert)',
'operator': opts.operator
};
if ( hasOwnProp( opts, 'actual' ) ) {
result.actual = opts.actual;
}
if ( hasOwnProp( opts, 'expected' ) ) {
result.expected = opts.expected;
}
if ( !ok ) {
result.error = opts.error || new Error( this.name );
err = new Error( 'exception' );
// TODO: generate an exception in order to locate the calling function (https://github.com/substack/tape/blob/master/lib/test.js#L215)
}
this._count += 1;
this.emit( 'result', result );
}
// EXPORTS //
module.exports = assert;
},{"@stdlib/assert/has-own-property":46}],169:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// EXPORTS //
module.exports = clearTimeout;
},{}],170:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var trim = require( '@stdlib/string/trim' );
var replace = require( '@stdlib/string/replace' );
var EOL = require( '@stdlib/regexp/eol' ).REGEXP;
// VARIABLES //
var RE_COMMENT = /^#\s*/;
// MAIN //
/**
* Writes a comment.
*
* @private
* @param {string} msg - comment message
*/
function comment( msg ) {
/* eslint-disable no-invalid-this */
var lines;
var i;
msg = trim( msg );
lines = msg.split( EOL );
for ( i = 0; i < lines.length; i++ ) {
msg = trim( lines[ i ] );
msg = replace( msg, RE_COMMENT, '' );
this.emit( 'result', msg );
}
}
// EXPORTS //
module.exports = comment;
},{"@stdlib/regexp/eol":257,"@stdlib/string/replace":279,"@stdlib/string/trim":281}],171:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Asserts that `actual` is deeply equal to `expected`.
*
* @private
* @param {*} actual - actual value
* @param {*} expected - expected value
* @param {string} [msg] message
*/
function deepEqual( actual, expected, msg ) {
/* eslint-disable no-invalid-this */
this.comment( 'actual: '+actual+'. expected: '+expected+'. msg: '+msg+'.' );
// TODO: implement
}
// EXPORTS //
module.exports = deepEqual;
},{}],172:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var nextTick = require( './../utils/next_tick.js' );
// MAIN //
/**
* Ends a benchmark.
*
* @private
*/
function end() {
/* eslint-disable no-invalid-this */
var self = this;
if ( this._ended ) {
this.fail( '.end() called more than once' );
} else {
// Prevents releasing the zalgo when running synchronous benchmarks.
nextTick( onTick );
}
this._ended = true;
this._running = false;
/**
* Callback invoked upon a subsequent tick of the event loop.
*
* @private
*/
function onTick() {
self.emit( 'end' );
}
}
// EXPORTS //
module.exports = end;
},{"./../utils/next_tick.js":209}],173:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Returns a `boolean` indicating if a benchmark has ended.
*
* @private
* @returns {boolean} boolean indicating if a benchmark has ended
*/
function ended() {
/* eslint-disable no-invalid-this */
return this._ended;
}
// EXPORTS //
module.exports = ended;
},{}],174:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Asserts that `actual` is strictly equal to `expected`.
*
* @private
* @param {*} actual - actual value
* @param {*} expected - expected value
* @param {string} [msg] - message
*/
function equal( actual, expected, msg ) {
/* eslint-disable no-invalid-this */
this._assert( actual === expected, {
'message': msg || 'should be equal',
'operator': 'equal',
'expected': expected,
'actual': actual
});
}
// EXPORTS //
module.exports = equal;
},{}],175:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Forcefully ends a benchmark.
*
* @private
* @returns {void}
*/
function exit() {
/* eslint-disable no-invalid-this */
if ( this._exited ) {
// If we have already "exited", do not create more failing assertions when one should suffice...
return;
}
// Only "exit" when a benchmark has either not yet been run or is currently running. If a benchmark has already ended, no need to generate a failing assertion.
if ( !this._ended ) {
this._exited = true;
this.fail( 'benchmark exited without ending' );
// Allow running benchmarks to call `end` on their own...
if ( !this._running ) {
this.end();
}
}
}
// EXPORTS //
module.exports = exit;
},{}],176:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Generates a failing assertion.
*
* @private
* @param {string} msg - message
*/
function fail( msg ) {
/* eslint-disable no-invalid-this */
this._assert( false, {
'message': msg,
'operator': 'fail'
});
}
// EXPORTS //
module.exports = fail;
},{}],177:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var EventEmitter = require( 'events' ).EventEmitter;
var inherit = require( '@stdlib/utils/inherit' );
var defineProperty = require( '@stdlib/utils/define-property' );
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var tic = require( '@stdlib/time/tic' );
var toc = require( '@stdlib/time/toc' );
var run = require( './run.js' );
var exit = require( './exit.js' );
var ended = require( './ended.js' );
var assert = require( './assert.js' );
var comment = require( './comment.js' );
var skip = require( './skip.js' );
var todo = require( './todo.js' );
var fail = require( './fail.js' );
var pass = require( './pass.js' );
var ok = require( './ok.js' );
var notOk = require( './not_ok.js' );
var equal = require( './equal.js' );
var notEqual = require( './not_equal.js' );
var deepEqual = require( './deep_equal.js' );
var notDeepEqual = require( './not_deep_equal.js' );
var end = require( './end.js' );
// MAIN //
/**
* Benchmark constructor.
*
* @constructor
* @param {string} name - benchmark name
* @param {Options} opts - benchmark options
* @param {boolean} opts.skip - boolean indicating whether to skip a benchmark
* @param {PositiveInteger} opts.iterations - number of iterations
* @param {PositiveInteger} opts.timeout - number of milliseconds before a benchmark automatically fails
* @param {Function} [benchmark] - function containing benchmark code
* @returns {Benchmark} Benchmark instance
*
* @example
* var bench = new Benchmark( 'beep', function benchmark( b ) {
* var x;
* var i;
* b.comment( 'Running benchmarks...' );
* b.tic();
* for ( i = 0; i < b.iterations; i++ ) {
* x = Math.sin( Math.random() );
* if ( x !== x ) {
* b.ok( false, 'should not return NaN' );
* }
* }
* b.toc();
* if ( x !== x ) {
* b.ok( false, 'should not return NaN' );
* }
* b.comment( 'Finished running benchmarks.' );
* b.end();
* });
*/
function Benchmark( name, opts, benchmark ) {
var hasTicked;
var hasTocked;
var self;
var time;
if ( !( this instanceof Benchmark ) ) {
return new Benchmark( name, opts, benchmark );
}
self = this;
hasTicked = false;
hasTocked = false;
EventEmitter.call( this );
// Private properties:
setReadOnly( this, '_benchmark', benchmark );
setReadOnly( this, '_skip', opts.skip );
defineProperty( this, '_ended', {
'configurable': false,
'enumerable': false,
'writable': true,
'value': false
});
defineProperty( this, '_running', {
'configurable': false,
'enumerable': false,
'writable': true,
'value': false
});
defineProperty( this, '_exited', {
'configurable': false,
'enumerable': false,
'writable': true,
'value': false
});
defineProperty( this, '_count', {
'configurable': false,
'enumerable': false,
'writable': true,
'value': 0
});
// Read-only:
setReadOnly( this, 'name', name );
setReadOnly( this, 'tic', start );
setReadOnly( this, 'toc', stop );
setReadOnly( this, 'iterations', opts.iterations );
setReadOnly( this, 'timeout', opts.timeout );
return this;
/**
* Starts a benchmark timer.
*
* ## Notes
*
* - Using a scoped variable prevents nefarious mutation by bad actors hoping to manipulate benchmark results.
* - The one attack vector which remains is manipulation of the `require` cache for `tic` and `toc`.
* - One way to combat cache manipulation is by comparing the checksum of `Function#toString()` against known values.
*
* @private
*/
function start() {
if ( hasTicked ) {
self.fail( '.tic() called more than once' );
} else {
self.emit( 'tic' );
hasTicked = true;
time = tic();
}
}
/**
* Stops a benchmark timer.
*
* @private
* @returns {void}
*/
function stop() {
var elapsed;
var secs;
var rate;
var out;
if ( hasTicked === false ) {
return self.fail( '.toc() called before .tic()' );
}
elapsed = toc( time );
if ( hasTocked ) {
return self.fail( '.toc() called more than once' );
}
hasTocked = true;
self.emit( 'toc' );
secs = elapsed[ 0 ] + ( elapsed[ 1 ]/1e9 );
rate = self.iterations / secs;
out = {
'ok': true,
'operator': 'result',
'iterations': self.iterations,
'elapsed': secs,
'rate': rate
};
self.emit( 'result', out );
}
}
/*
* Inherit from the `EventEmitter` prototype.
*/
inherit( Benchmark, EventEmitter );
/**
* Runs a benchmark.
*
* @private
* @name run
* @memberof Benchmark.prototype
* @type {Function}
*/
setReadOnly( Benchmark.prototype, 'run', run );
/**
* Forcefully ends a benchmark.
*
* @private
* @name exit
* @memberof Benchmark.prototype
* @type {Function}
*/
setReadOnly( Benchmark.prototype, 'exit', exit );
/**
* Returns a `boolean` indicating if a benchmark has ended.
*
* @private
* @name ended
* @memberof Benchmark.prototype
* @type {Function}
* @returns {boolean} boolean indicating if a benchmark has ended
*/
setReadOnly( Benchmark.prototype, 'ended', ended );
/**
* Generates an assertion.
*
* @private
* @name _assert
* @memberof Benchmark.prototype
* @type {Function}
* @param {boolean} ok - assertion outcome
* @param {Options} opts - options
*/
setReadOnly( Benchmark.prototype, '_assert', assert );
/**
* Writes a comment.
*
* @name comment
* @memberof Benchmark.prototype
* @type {Function}
* @param {string} msg - comment message
*/
setReadOnly( Benchmark.prototype, 'comment', comment );
/**
* Generates an assertion which will be skipped.
*
* @name skip
* @memberof Benchmark.prototype
* @type {Function}
* @param {*} value - value
* @param {string} msg - message
*/
setReadOnly( Benchmark.prototype, 'skip', skip );
/**
* Generates an assertion which should be implemented.
*
* @name todo
* @memberof Benchmark.prototype
* @type {Function}
* @param {*} value - value
* @param {string} msg - message
*/
setReadOnly( Benchmark.prototype, 'todo', todo );
/**
* Generates a failing assertion.
*
* @name fail
* @memberof Benchmark.prototype
* @type {Function}
* @param {string} msg - message
*/
setReadOnly( Benchmark.prototype, 'fail', fail );
/**
* Generates a passing assertion.
*
* @name pass
* @memberof Benchmark.prototype
* @type {Function}
* @param {string} msg - message
*/
setReadOnly( Benchmark.prototype, 'pass', pass );
/**
* Asserts that a `value` is truthy.
*
* @name ok
* @memberof Benchmark.prototype
* @type {Function}
* @param {*} value - value
* @param {string} [msg] - message
*/
setReadOnly( Benchmark.prototype, 'ok', ok );
/**
* Asserts that a `value` is falsy.
*
* @name notOk
* @memberof Benchmark.prototype
* @type {Function}
* @param {*} value - value
* @param {string} [msg] - message
*/
setReadOnly( Benchmark.prototype, 'notOk', notOk );
/**
* Asserts that `actual` is strictly equal to `expected`.
*
* @name equal
* @memberof Benchmark.prototype
* @type {Function}
* @param {*} actual - actual value
* @param {*} expected - expected value
* @param {string} [msg] - message
*/
setReadOnly( Benchmark.prototype, 'equal', equal );
/**
* Asserts that `actual` is not strictly equal to `expected`.
*
* @name notEqual
* @memberof Benchmark.prototype
* @type {Function}
* @param {*} actual - actual value
* @param {*} expected - expected value
* @param {string} [msg] - message
*/
setReadOnly( Benchmark.prototype, 'notEqual', notEqual );
/**
* Asserts that `actual` is deeply equal to `expected`.
*
* @name deepEqual
* @memberof Benchmark.prototype
* @type {Function}
* @param {*} actual - actual value
* @param {*} expected - expected value
* @param {string} [msg] message
*/
setReadOnly( Benchmark.prototype, 'deepEqual', deepEqual );
/**
* Asserts that `actual` is not deeply equal to `expected`.
*
* @name notDeepEqual
* @memberof Benchmark.prototype
* @type {Function}
* @param {*} actual - actual value
* @param {*} expected - expected value
* @param {string} [msg] message
*/
setReadOnly( Benchmark.prototype, 'notDeepEqual', notDeepEqual );
/**
* Ends a benchmark.
*
* @name end
* @memberof Benchmark.prototype
* @type {Function}
*/
setReadOnly( Benchmark.prototype, 'end', end );
// EXPORTS //
module.exports = Benchmark;
},{"./assert.js":168,"./comment.js":170,"./deep_equal.js":171,"./end.js":172,"./ended.js":173,"./equal.js":174,"./exit.js":175,"./fail.js":176,"./not_deep_equal.js":178,"./not_equal.js":179,"./not_ok.js":180,"./ok.js":181,"./pass.js":182,"./run.js":183,"./skip.js":185,"./todo.js":186,"@stdlib/time/tic":283,"@stdlib/time/toc":287,"@stdlib/utils/define-nonenumerable-read-only-property":297,"@stdlib/utils/define-property":302,"@stdlib/utils/inherit":325,"events":378}],178:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Asserts that `actual` is not deeply equal to `expected`.
*
* @private
* @param {*} actual - actual value
* @param {*} expected - expected value
* @param {string} [msg] message
*/
function notDeepEqual( actual, expected, msg ) {
/* eslint-disable no-invalid-this */
this.comment( 'actual: '+actual+'. expected: '+expected+'. msg: '+msg+'.' );
// TODO: implement
}
// EXPORTS //
module.exports = notDeepEqual;
},{}],179:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Asserts that `actual` is not strictly equal to `expected`.
*
* @private
* @param {*} actual - actual value
* @param {*} expected - expected value
* @param {string} [msg] - message
*/
function notEqual( actual, expected, msg ) {
/* eslint-disable no-invalid-this */
this._assert( actual !== expected, {
'message': msg || 'should not be equal',
'operator': 'notEqual',
'expected': expected,
'actual': actual
});
}
// EXPORTS //
module.exports = notEqual;
},{}],180:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Asserts that a `value` is falsy.
*
* @private
* @param {*} value - value
* @param {string} [msg] - message
*/
function notOk( value, msg ) {
/* eslint-disable no-invalid-this */
this._assert( !value, {
'message': msg || 'should be falsy',
'operator': 'notOk',
'expected': false,
'actual': value
});
}
// EXPORTS //
module.exports = notOk;
},{}],181:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Asserts that a `value` is truthy.
*
* @private
* @param {*} value - value
* @param {string} [msg] - message
*/
function ok( value, msg ) {
/* eslint-disable no-invalid-this */
this._assert( !!value, {
'message': msg || 'should be truthy',
'operator': 'ok',
'expected': true,
'actual': value
});
}
// EXPORTS //
module.exports = ok;
},{}],182:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Generates a passing assertion.
*
* @private
* @param {string} msg - message
*/
function pass( msg ) {
/* eslint-disable no-invalid-this */
this._assert( true, {
'message': msg,
'operator': 'pass'
});
}
// EXPORTS //
module.exports = pass;
},{}],183:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var timeout = require( './set_timeout.js' );
var clear = require( './clear_timeout.js' );
// MAIN //
/**
* Runs a benchmark.
*
* @private
* @returns {void}
*/
function run() {
/* eslint-disable no-invalid-this */
var self;
var id;
if ( this._skip ) {
this.comment( 'SKIP '+this.name );
return this.end();
}
if ( !this._benchmark ) {
this.comment( 'TODO '+this.name );
return this.end();
}
self = this;
this._running = true;
id = timeout( onTimeout, this.timeout );
this.once( 'end', endTimeout );
this.emit( 'prerun' );
this._benchmark( this );
this.emit( 'run' );
/**
* Callback invoked once a timeout ends.
*
* @private
*/
function onTimeout() {
self.fail( 'benchmark timed out after '+self.timeout+'ms' );
}
/**
* Clears a timeout.
*
* @private
*/
function endTimeout() {
clear( id );
}
}
// EXPORTS //
module.exports = run;
},{"./clear_timeout.js":169,"./set_timeout.js":184}],184:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// EXPORTS //
module.exports = setTimeout;
},{}],185:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Generates an assertion which will be skipped.
*
* @private
* @param {*} value - value
* @param {string} msg - message
*/
function skip( value, msg ) {
/* eslint-disable no-invalid-this */
this._assert( true, {
'message': msg,
'operator': 'skip',
'skip': true
});
}
// EXPORTS //
module.exports = skip;
},{}],186:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Generates an assertion which should be implemented.
*
* @private
* @param {*} value - value
* @param {string} msg - message
*/
function todo( value, msg ) {
/* eslint-disable no-invalid-this */
this._assert( !!value, {
'message': msg,
'operator': 'todo',
'todo': true
});
}
// EXPORTS //
module.exports = todo;
},{}],187:[function(require,module,exports){
module.exports={
"skip": false,
"iterations": null,
"repeats": 3,
"timeout": 300000
}
},{}],188:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isFunction = require( '@stdlib/assert/is-function' );
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var isObject = require( '@stdlib/assert/is-plain-object' );
var isNodeWritableStreamLike = require( '@stdlib/assert/is-node-writable-stream-like' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var pick = require( '@stdlib/utils/pick' );
var omit = require( '@stdlib/utils/omit' );
var noop = require( '@stdlib/utils/noop' );
var createHarness = require( './harness' );
var logStream = require( './log' );
var canEmitExit = require( './utils/can_emit_exit.js' );
var proc = require( './utils/process.js' );
// MAIN //
/**
* Creates a benchmark harness which supports closing when a process exits.
*
* @private
* @param {Options} [options] - function options
* @param {boolean} [options.autoclose] - boolean indicating whether to automatically close a harness after a harness finishes running all benchmarks
* @param {Stream} [options.stream] - output writable stream
* @param {Callback} [clbk] - callback to invoke when a harness finishes running all benchmarks
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @throws {TypeError} callback argument must be a function
* @returns {Function} benchmark harness
*
* @example
* var proc = require( 'process' );
* var bench = createExitHarness( onFinish );
*
* function onFinish() {
* bench.close();
* }
*
* bench( 'beep', function benchmark( b ) {
* var x;
* var i;
* b.tic();
* for ( i = 0; i < b.iterations; i++ ) {
* x = Math.sin( Math.random() );
* if ( x !== x ) {
* b.ok( false, 'should not return NaN' );
* }
* }
* b.toc();
* if ( x !== x ) {
* b.ok( false, 'should not return NaN' );
* }
* b.end();
* });
*
* @example
* var stdout = require( '@stdlib/streams/node/stdout' );
*
* var stream = createExitHarness().createStream();
* stream.pipe( stdout );
*/
function createExitHarness() {
var exitCode;
var pipeline;
var harness;
var options;
var stream;
var topts;
var opts;
var clbk;
if ( arguments.length === 0 ) {
options = {};
clbk = noop;
} else if ( arguments.length === 1 ) {
if ( isFunction( arguments[ 0 ] ) ) {
options = {};
clbk = arguments[ 0 ];
} else if ( isObject( arguments[ 0 ] ) ) {
options = arguments[ 0 ];
clbk = noop;
} else {
throw new TypeError( 'invalid argument. Must provide either an options object or a callback function. Value: `'+arguments[ 0 ]+'`.' );
}
} else {
options = arguments[ 0 ];
if ( !isObject( options ) ) {
throw new TypeError( 'invalid argument. First argument must be an object. Value: `'+options+'`.' );
}
clbk = arguments[ 1 ];
if ( !isFunction( clbk ) ) {
throw new TypeError( 'invalid argument. Second argument must be a function. Value: `'+clbk+'`.' );
}
}
opts = {};
if ( hasOwnProp( options, 'autoclose' ) ) {
opts.autoclose = options.autoclose;
if ( !isBoolean( opts.autoclose ) ) {
throw new TypeError( 'invalid option. `autoclose` option must be a boolean primitive. Option: `'+opts.autoclose+'`.' );
}
}
if ( hasOwnProp( options, 'stream' ) ) {
opts.stream = options.stream;
if ( !isNodeWritableStreamLike( opts.stream ) ) {
throw new TypeError( 'invalid option. `stream` option must be a writable stream. Option: `'+opts.stream+'`.' );
}
}
exitCode = 0;
// Create a new harness:
topts = pick( opts, [ 'autoclose' ] );
harness = createHarness( topts, done );
// Create a results stream:
topts = omit( options, [ 'autoclose', 'stream' ] );
stream = harness.createStream( topts );
// Pipe results to an output stream:
pipeline = stream.pipe( opts.stream || logStream() );
// If a process can emit an 'exit' event, capture errors in order to set the exit code...
if ( canEmitExit ) {
pipeline.on( 'error', onError );
proc.on( 'exit', onExit );
}
return harness;
/**
* Callback invoked when a harness finishes.
*
* @private
* @returns {void}
*/
function done() {
return clbk();
}
/**
* Callback invoked upon a stream `error` event.
*
* @private
* @param {Error} error - error object
*/
function onError() {
exitCode = 1;
}
/**
* Callback invoked upon an `exit` event.
*
* @private
* @param {integer} code - exit code
*/
function onExit( code ) {
if ( code !== 0 ) {
// Allow the process to exit...
return;
}
harness.close();
proc.exit( exitCode || harness.exitCode );
}
}
// EXPORTS //
module.exports = createExitHarness;
},{"./harness":190,"./log":196,"./utils/can_emit_exit.js":207,"./utils/process.js":210,"@stdlib/assert/has-own-property":46,"@stdlib/assert/is-boolean":72,"@stdlib/assert/is-function":93,"@stdlib/assert/is-node-writable-stream-like":115,"@stdlib/assert/is-plain-object":138,"@stdlib/utils/noop":353,"@stdlib/utils/omit":355,"@stdlib/utils/pick":357}],189:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var canEmitExit = require( './utils/can_emit_exit.js' );
var createExitHarness = require( './exit_harness.js' );
// VARIABLES //
var harness;
// MAIN //
/**
* Returns a benchmark harness. If a harness has already been created, returns the cached harness.
*
* @private
* @param {Options} [options] - harness options
* @param {Callback} [clbk] - callback to invoke when a harness finishes running all benchmarks
* @returns {Function} benchmark harness
*/
function getHarness( options, clbk ) {
var opts;
var cb;
if ( harness ) {
return harness;
}
if ( arguments.length > 1 ) {
opts = options;
cb = clbk;
} else {
opts = {};
cb = options;
}
opts.autoclose = !canEmitExit;
harness = createExitHarness( opts, cb );
// Update state:
getHarness.cached = true;
return harness;
}
// EXPORTS //
module.exports = getHarness;
},{"./exit_harness.js":188,"./utils/can_emit_exit.js":207}],190:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
var isFunction = require( '@stdlib/assert/is-function' );
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var isObject = require( '@stdlib/assert/is-plain-object' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var copy = require( '@stdlib/utils/copy' );
var Benchmark = require( './../benchmark-class' );
var Runner = require( './../runner' );
var nextTick = require( './../utils/next_tick.js' );
var DEFAULTS = require( './../defaults.json' );
var validate = require( './validate.js' );
var init = require( './init.js' );
// MAIN //
/**
* Creates a benchmark harness.
*
* @param {Options} [options] - function options
* @param {boolean} [options.autoclose] - boolean indicating whether to automatically close a harness after a harness finishes running all benchmarks
* @param {Callback} [clbk] - callback to invoke when a harness finishes running all benchmarks
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @throws {TypeError} callback argument must be a function
* @returns {Function} benchmark harness
*
* @example
* var bench = createHarness( onFinish );
*
* function onFinish() {
* bench.close();
* console.log( 'Exit code: %d', bench.exitCode );
* }
*
* bench( 'beep', function benchmark( b ) {
* var x;
* var i;
* b.tic();
* for ( i = 0; i < b.iterations; i++ ) {
* x = Math.sin( Math.random() );
* if ( x !== x ) {
* b.ok( false, 'should not return NaN' );
* }
* }
* b.toc();
* if ( x !== x ) {
* b.ok( false, 'should not return NaN' );
* }
* b.end();
* });
*
* @example
* var stdout = require( '@stdlib/streams/node/stdout' );
*
* var stream = createHarness().createStream();
* stream.pipe( stdout );
*/
function createHarness( options, clbk ) {
var exitCode;
var runner;
var queue;
var opts;
var cb;
opts = {};
if ( arguments.length === 1 ) {
if ( isFunction( options ) ) {
cb = options;
} else if ( isObject( options ) ) {
opts = options;
} else {
throw new TypeError( 'invalid argument. Must provide either an options object or a callback function. Value: `'+options+'`.' );
}
} else if ( arguments.length > 1 ) {
if ( !isObject( options ) ) {
throw new TypeError( 'invalid argument. First argument must be an object. Value: `'+options+'`.' );
}
if ( hasOwnProp( options, 'autoclose' ) ) {
opts.autoclose = options.autoclose;
if ( !isBoolean( opts.autoclose ) ) {
throw new TypeError( 'invalid option. `autoclose` option must be a boolean primitive. Option: `'+opts.autoclose+'`.' );
}
}
cb = clbk;
if ( !isFunction( cb ) ) {
throw new TypeError( 'invalid argument. Second argument must be a function. Value: `'+cb+'`.' );
}
}
runner = new Runner();
if ( opts.autoclose ) {
runner.once( 'done', close );
}
if ( cb ) {
runner.once( 'done', cb );
}
exitCode = 0;
queue = [];
/**
* Benchmark harness.
*
* @private
* @param {string} name - benchmark name
* @param {Options} [options] - benchmark options
* @param {boolean} [options.skip=false] - boolean indicating whether to skip a benchmark
* @param {(PositiveInteger|null)} [options.iterations=null] - number of iterations
* @param {PositiveInteger} [options.repeats=3] - number of repeats
* @param {PositiveInteger} [options.timeout=300000] - number of milliseconds before a benchmark automatically fails
* @param {Function} [benchmark] - function containing benchmark code
* @throws {TypeError} first argument must be a string
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @throws {TypeError} benchmark argument must a function
* @throws {Error} benchmark error
* @returns {Function} benchmark harness
*/
function harness( name, options, benchmark ) {
var opts;
var err;
var b;
if ( !isString( name ) ) {
throw new TypeError( 'invalid argument. First argument must be a string. Value: `'+name+'`.' );
}
opts = copy( DEFAULTS );
if ( arguments.length === 2 ) {
if ( isFunction( options ) ) {
b = options;
} else {
err = validate( opts, options );
if ( err ) {
throw err;
}
}
} else if ( arguments.length > 2 ) {
err = validate( opts, options );
if ( err ) {
throw err;
}
b = benchmark;
if ( !isFunction( b ) ) {
throw new TypeError( 'invalid argument. Third argument must be a function. Value: `'+b+'`.' );
}
}
// Add the benchmark to the initialization queue:
queue.push( [ name, opts, b ] );
// Perform initialization on the next turn of the event loop (note: this allows all benchmarks to be "registered" within the same turn of the loop; otherwise, we run the risk of registration-execution race conditions (i.e., a benchmark registers and executes before other benchmarks can register, depleting the benchmark queue and leading the harness to close)):
if ( queue.length === 1 ) {
nextTick( initialize );
}
return harness;
}
/**
* Initializes each benchmark.
*
* @private
* @returns {void}
*/
function initialize() {
var idx = -1;
return next();
/**
* Initialize the next benchmark.
*
* @private
* @returns {void}
*/
function next() {
var args;
idx += 1;
// If all benchmarks have been initialized, begin running the benchmarks:
if ( idx === queue.length ) {
queue.length = 0;
return runner.run();
}
// Initialize the next benchmark:
args = queue[ idx ];
init( args[ 0 ], args[ 1 ], args[ 2 ], onInit );
}
/**
* Callback invoked after performing initialization tasks.
*
* @private
* @param {string} name - benchmark name
* @param {Options} opts - benchmark options
* @param {(Function|undefined)} benchmark - function containing benchmark code
* @returns {void}
*/
function onInit( name, opts, benchmark ) {
var b;
var i;
// Create a `Benchmark` instance for each repeat to ensure each benchmark has its own state...
for ( i = 0; i < opts.repeats; i++ ) {
b = new Benchmark( name, opts, benchmark );
b.on( 'result', onResult );
runner.push( b );
}
return next();
}
}
/**
* Callback invoked upon a `result` event.
*
* @private
* @param {(string|Object)} result - result
*/
function onResult( result ) {
if (
!isString( result ) &&
!result.ok &&
!result.todo
) {
exitCode = 1;
}
}
/**
* Returns a results stream.
*
* @private
* @param {Object} [options] - options
* @returns {TransformStream} transform stream
*/
function createStream( options ) {
if ( arguments.length ) {
return runner.createStream( options );
}
return runner.createStream();
}
/**
* Closes a benchmark harness.
*
* @private
*/
function close() {
runner.close();
}
/**
* Forcefully exits a benchmark harness.
*
* @private
*/
function exit() {
runner.exit();
}
/**
* Returns the harness exit code.
*
* @private
* @returns {NonNegativeInteger} exit code
*/
function getExitCode() {
return exitCode;
}
setReadOnly( harness, 'createStream', createStream );
setReadOnly( harness, 'close', close );
setReadOnly( harness, 'exit', exit );
setReadOnlyAccessor( harness, 'exitCode', getExitCode );
return harness;
}
// EXPORTS //
module.exports = createHarness;
},{"./../benchmark-class":177,"./../defaults.json":187,"./../runner":204,"./../utils/next_tick.js":209,"./init.js":191,"./validate.js":194,"@stdlib/assert/has-own-property":46,"@stdlib/assert/is-boolean":72,"@stdlib/assert/is-function":93,"@stdlib/assert/is-plain-object":138,"@stdlib/assert/is-string":149,"@stdlib/utils/copy":293,"@stdlib/utils/define-nonenumerable-read-only-accessor":295,"@stdlib/utils/define-nonenumerable-read-only-property":297}],191:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var pretest = require( './pretest.js' );
var iterations = require( './iterations.js' );
// MAIN //
/**
* Performs benchmark initialization tasks.
*
* @private
* @param {string} name - benchmark name
* @param {Options} opts - benchmark options
* @param {(Function|undefined)} benchmark - function containing benchmark code
* @param {Callback} clbk - callback to invoke after completing initialization tasks
* @returns {void}
*/
function init( name, opts, benchmark, clbk ) {
// If no benchmark function, then the benchmark is considered a "todo", so no need to repeat multiple times...
if ( !benchmark ) {
opts.repeats = 1;
return clbk( name, opts, benchmark );
}
// If the `skip` option to `true`, no need to initialize or repeat multiple times as will not be running the benchmark:
if ( opts.skip ) {
opts.repeats = 1;
return clbk( name, opts, benchmark );
}
// Perform pretests:
pretest( name, opts, benchmark, onPreTest );
/**
* Callback invoked upon completing pretests.
*
* @private
* @param {Error} [error] - error object
* @returns {void}
*/
function onPreTest( error ) {
// If the pretests failed, don't run the benchmark multiple times...
if ( error ) {
opts.repeats = 1;
opts.iterations = 1;
return clbk( name, opts, benchmark );
}
// If a user specified an iteration number, we can begin running benchmarks...
if ( opts.iterations ) {
return clbk( name, opts, benchmark );
}
// Determine iteration number:
iterations( name, opts, benchmark, onIterations );
}
/**
* Callback invoked upon determining an iteration number.
*
* @private
* @param {(Error|null)} error - error object
* @param {PositiveInteger} iter - number of iterations
* @returns {void}
*/
function onIterations( error, iter ) {
// If provided an error, then a benchmark failed, and, similar to pretests, don't run the benchmark multiple times...
if ( error ) {
opts.repeats = 1;
opts.iterations = 1;
return clbk( name, opts, benchmark );
}
opts.iterations = iter;
return clbk( name, opts, benchmark );
}
}
// EXPORTS //
module.exports = init;
},{"./iterations.js":192,"./pretest.js":193}],192:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
var copy = require( '@stdlib/utils/copy' );
var Benchmark = require( './../benchmark-class' );
// VARIABLES //
var MIN_TIME = 0.1; // seconds
var ITERATIONS = 10; // 10^1
var MAX_ITERATIONS = 10000000000; // 10^10
// MAIN //
/**
* Determines the number of iterations.
*
* @private
* @param {string} name - benchmark name
* @param {Options} options - benchmark options
* @param {(Function|undefined)} benchmark - function containing benchmark code
* @param {Callback} clbk - callback to invoke after determining number of iterations
* @returns {void}
*/
function iterations( name, options, benchmark, clbk ) {
var opts;
var time;
// Elapsed time (in seconds):
time = 0;
// Create a local copy:
opts = copy( options );
opts.iterations = ITERATIONS;
// Begin running benchmarks:
return next();
/**
* Run a new benchmark.
*
* @private
*/
function next() {
var b = new Benchmark( name, opts, benchmark );
b.on( 'result', onResult );
b.once( 'end', onEnd );
b.run();
}
/**
* Callback invoked upon a `result` event.
*
* @private
* @param {(string|Object)} result - result
*/
function onResult( result ) {
if ( !isString( result ) && result.operator === 'result' ) {
time = result.elapsed;
}
}
/**
* Callback invoked upon an `end` event.
*
* @private
* @returns {void}
*/
function onEnd() {
if (
time < MIN_TIME &&
opts.iterations < MAX_ITERATIONS
) {
opts.iterations *= 10;
return next();
}
clbk( null, opts.iterations );
}
}
// EXPORTS //
module.exports = iterations;
},{"./../benchmark-class":177,"@stdlib/assert/is-string":149,"@stdlib/utils/copy":293}],193:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
var copy = require( '@stdlib/utils/copy' );
var Benchmark = require( './../benchmark-class' );
// MAIN //
/**
* Runs pretests to sanity check and/or catch failures.
*
* @private
* @param {string} name - benchmark name
* @param {Options} options - benchmark options
* @param {(Function|undefined)} benchmark - function containing benchmark code
* @param {Callback} clbk - callback to invoke after completing pretests
*/
function pretest( name, options, benchmark, clbk ) {
var fail;
var opts;
var tic;
var toc;
var b;
// Counters to determine the number of `tic` and `toc` events:
tic = 0;
toc = 0;
// Local copy:
opts = copy( options );
opts.iterations = 1;
// Pretest to check for minimum requirements and/or errors...
b = new Benchmark( name, opts, benchmark );
b.on( 'result', onResult );
b.on( 'tic', onTic );
b.on( 'toc', onToc );
b.once( 'end', onEnd );
b.run();
/**
* Callback invoked upon a `result` event.
*
* @private
* @param {(string|Object)} result - result
*/
function onResult( result ) {
if (
!isString( result ) &&
!result.ok &&
!result.todo
) {
fail = true;
}
}
/**
* Callback invoked upon a `tic` event.
*
* @private
*/
function onTic() {
tic += 1;
}
/**
* Callback invoked upon a `toc` event.
*
* @private
*/
function onToc() {
toc += 1;
}
/**
* Callback invoked upon an `end` event.
*
* @private
* @returns {void}
*/
function onEnd() {
var err;
if ( fail ) {
// Possibility that failure is intermittent, but we will assume that the usual case is that the failure would persist across all repeats and no sense failing multiple times when once suffices.
err = new Error( 'benchmark failed' );
} else if ( tic !== 1 || toc !== 1 ) {
// Unable to do anything definitive with timing information (e.g., a tic with no toc or vice versa, or benchmark function calls neither tic nor toc).
err = new Error( 'invalid benchmark' );
}
if ( err ) {
return clbk( err );
}
return clbk();
}
}
// EXPORTS //
module.exports = pretest;
},{"./../benchmark-class":177,"@stdlib/assert/is-string":149,"@stdlib/utils/copy":293}],194:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isObject = require( '@stdlib/assert/is-plain-object' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var isNull = require( '@stdlib/assert/is-null' );
var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;
// MAIN //
/**
* Validates function options.
*
* @private
* @param {Object} opts - destination object
* @param {Options} options - function options
* @param {boolean} [options.skip] - boolean indicating whether to skip a benchmark
* @param {(PositiveInteger|null)} [options.iterations] - number of iterations
* @param {PositiveInteger} [options.repeats] - number of repeats
* @param {PositiveInteger} [options.timeout] - number of milliseconds before a benchmark automatically fails
* @returns {(Error|null)} error object or null
*
* @example
* var opts = {};
* var options = {
* 'skip': false,
* 'iterations': 1e6,
* 'repeats': 3,
* 'timeout': 10000
* };
*
* var err = validate( opts, options );
* if ( err ) {
* throw err;
* }
*/
function validate( opts, options ) {
if ( !isObject( options ) ) {
return new TypeError( 'invalid argument. Options argument must be an object. Value: `' + options + '`.' );
}
if ( hasOwnProp( options, 'skip' ) ) {
opts.skip = options.skip;
if ( !isBoolean( opts.skip ) ) {
return new TypeError( 'invalid option. `skip` option must be a boolean primitive. Option: `' + opts.skip + '`.' );
}
}
if ( hasOwnProp( options, 'iterations' ) ) {
opts.iterations = options.iterations;
if (
!isPositiveInteger( opts.iterations ) &&
!isNull( opts.iterations )
) {
return new TypeError( 'invalid option. `iterations` option must be either a positive integer or `null`. Option: `' + opts.iterations + '`.' );
}
}
if ( hasOwnProp( options, 'repeats' ) ) {
opts.repeats = options.repeats;
if ( !isPositiveInteger( opts.repeats ) ) {
return new TypeError( 'invalid option. `repeats` option must be a positive integer. Option: `' + opts.repeats + '`.' );
}
}
if ( hasOwnProp( options, 'timeout' ) ) {
opts.timeout = options.timeout;
if ( !isPositiveInteger( opts.timeout ) ) {
return new TypeError( 'invalid option. `timeout` option must be a positive integer. Option: `' + opts.timeout + '`.' );
}
}
return null;
}
// EXPORTS //
module.exports = validate;
},{"@stdlib/assert/has-own-property":46,"@stdlib/assert/is-boolean":72,"@stdlib/assert/is-null":126,"@stdlib/assert/is-plain-object":138,"@stdlib/assert/is-positive-integer":140}],195:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Benchmark harness.
*
* @module @stdlib/bench/harness
*
* @example
* var bench = require( '@stdlib/bench/harness' );
*
* bench( 'beep', function benchmark( b ) {
* var x;
* var i;
* b.tic();
* for ( i = 0; i < b.iterations; i++ ) {
* x = Math.sin( Math.random() );
* if ( x !== x ) {
* b.ok( false, 'should not return NaN' );
* }
* }
* b.toc();
* if ( x !== x ) {
* b.ok( false, 'should not return NaN' );
* }
* b.end();
* });
*/
// MODULES //
var bench = require( './bench.js' );
// EXPORTS //
module.exports = bench;
},{"./bench.js":167}],196:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var TransformStream = require( '@stdlib/streams/node/transform' );
var fromCodePoint = require( '@stdlib/string/from-code-point' );
var log = require( './log.js' );
// MAIN //
/**
* Returns a Transform stream for logging to the console.
*
* @private
* @returns {TransformStream} transform stream
*/
function createStream() {
var stream;
var line;
stream = new TransformStream({
'transform': transform,
'flush': flush
});
line = '';
return stream;
/**
* Callback invoked upon receiving a new chunk.
*
* @private
* @param {(Buffer|string)} chunk - chunk
* @param {string} enc - Buffer encoding
* @param {Callback} clbk - callback to invoke after transforming the streamed chunk
*/
function transform( chunk, enc, clbk ) {
var c;
var i;
for ( i = 0; i < chunk.length; i++ ) {
c = fromCodePoint( chunk[ i ] );
if ( c === '\n' ) {
flush();
} else {
line += c;
}
}
clbk();
}
/**
* Callback to flush data to `stdout`.
*
* @private
* @param {Callback} [clbk] - callback to invoke after processing data
* @returns {void}
*/
function flush( clbk ) {
try {
log( line );
} catch ( err ) {
stream.emit( 'error', err );
}
line = '';
if ( clbk ) {
return clbk();
}
}
}
// EXPORTS //
module.exports = createStream;
},{"./log.js":197,"@stdlib/streams/node/transform":273,"@stdlib/string/from-code-point":277}],197:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Writes a string to the console.
*
* @private
* @param {string} str - string to write
*/
function log( str ) {
console.log( str ); // eslint-disable-line no-console
}
// EXPORTS //
module.exports = log;
},{}],198:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Removes any pending benchmarks.
*
* @private
*/
function clear() {
/* eslint-disable no-invalid-this */
this._benchmarks.length = 0;
}
// EXPORTS //
module.exports = clear;
},{}],199:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Closes a benchmark runner.
*
* @private
* @returns {void}
*/
function closeRunner() {
/* eslint-disable no-invalid-this */
var self = this;
if ( this._closed ) {
return;
}
this._closed = true;
if ( this._benchmarks.length ) {
this.clear();
this._stream.write( '# WARNING: harness closed before completion.\n' );
} else {
this._stream.write( '#\n' );
this._stream.write( '1..'+this.total+'\n' );
this._stream.write( '# total '+this.total+'\n' );
this._stream.write( '# pass '+this.pass+'\n' );
if ( this.fail ) {
this._stream.write( '# fail '+this.fail+'\n' );
}
if ( this.skip ) {
this._stream.write( '# skip '+this.skip+'\n' );
}
if ( this.todo ) {
this._stream.write( '# todo '+this.todo+'\n' );
}
if ( !this.fail ) {
this._stream.write( '#\n# ok\n' );
}
}
this._stream.once( 'close', onClose );
this._stream.destroy();
/**
* Callback invoked upon a `close` event.
*
* @private
*/
function onClose() {
self.emit( 'close' );
}
}
// EXPORTS //
module.exports = closeRunner;
},{}],200:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable no-underscore-dangle */
'use strict';
// MODULES //
var TransformStream = require( '@stdlib/streams/node/transform' );
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
var nextTick = require( './../utils/next_tick.js' );
// VARIABLES //
var TAP_HEADER = 'TAP version 13';
// MAIN //
/**
* Creates a results stream.
*
* @private
* @param {Options} [options] - stream options
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @returns {TransformStream} transform stream
*/
function createStream( options ) {
/* eslint-disable no-invalid-this */
var stream;
var opts;
var self;
var id;
self = this;
if ( arguments.length ) {
opts = options;
} else {
opts = {};
}
stream = new TransformStream( opts );
if ( opts.objectMode ) {
id = 0;
this.on( '_push', onPush );
this.on( 'done', onDone );
} else {
stream.write( TAP_HEADER+'\n' );
this._stream.pipe( stream );
}
this.on( '_run', onRun );
return stream;
/**
* Runs the next benchmark.
*
* @private
*/
function next() {
nextTick( onTick );
}
/**
* Callback invoked upon the next tick.
*
* @private
* @returns {void}
*/
function onTick() {
var b = self._benchmarks.shift();
if ( b ) {
b.run();
if ( !b.ended() ) {
return b.once( 'end', next );
}
return next();
}
self._running = false;
self.emit( 'done' );
}
/**
* Callback invoked upon a run event.
*
* @private
* @returns {void}
*/
function onRun() {
if ( !self._running ) {
self._running = true;
return next();
}
}
/**
* Callback invoked upon a push event.
*
* @private
* @param {Benchmark} b - benchmark
*/
function onPush( b ) {
var bid = id;
id += 1;
b.once( 'prerun', onPreRun );
b.on( 'result', onResult );
b.on( 'end', onEnd );
/**
* Callback invoked upon a `prerun` event.
*
* @private
*/
function onPreRun() {
var row = {
'type': 'benchmark',
'name': b.name,
'id': bid
};
stream.write( row );
}
/**
* Callback invoked upon a `result` event.
*
* @private
* @param {(Object|string)} res - result
*/
function onResult( res ) {
if ( isString( res ) ) {
res = {
'benchmark': bid,
'type': 'comment',
'name': res
};
} else if ( res.operator === 'result' ) {
res.benchmark = bid;
res.type = 'result';
} else {
res.benchmark = bid;
res.type = 'assert';
}
stream.write( res );
}
/**
* Callback invoked upon an `end` event.
*
* @private
*/
function onEnd() {
stream.write({
'benchmark': bid,
'type': 'end'
});
}
}
/**
* Callback invoked upon a `done` event.
*
* @private
*/
function onDone() {
stream.destroy();
}
}
// EXPORTS //
module.exports = createStream;
},{"./../utils/next_tick.js":209,"@stdlib/assert/is-string":149,"@stdlib/streams/node/transform":273}],201:[function(require,module,exports){
/* eslint-disable stdlib/jsdoc-require-throws-tags */
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var replace = require( '@stdlib/string/replace' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var reEOL = require( '@stdlib/regexp/eol' );
// VARIABLES //
var RE_WHITESPACE = /\s+/g;
// MAIN //
/**
* Encodes an assertion.
*
* @private
* @param {Object} result - result
* @param {PositiveInteger} count - result count
* @returns {string} encoded assertion
*/
function encodeAssertion( result, count ) {
var actualStack;
var errorStack;
var expected;
var actual;
var indent;
var stack;
var lines;
var out;
var i;
out = '';
if ( !result.ok ) {
out += 'not ';
}
// Add result count:
out += 'ok ' + count;
// Add description:
if ( result.name ) {
out += ' ' + replace( result.name.toString(), RE_WHITESPACE, ' ' );
}
// Append directives:
if ( result.skip ) {
out += ' # SKIP';
} else if ( result.todo ) {
out += ' # TODO';
}
out += '\n';
if ( result.ok ) {
return out;
}
// Format diagnostics as YAML...
indent = ' ';
out += indent + '---\n';
out += indent + 'operator: ' + result.operator + '\n';
if (
hasOwnProp( result, 'actual' ) ||
hasOwnProp( result, 'expected' )
) {
// TODO: inspect object logic (https://github.com/substack/tape/blob/master/lib/results.js#L145)
expected = result.expected;
actual = result.actual;
if ( actual !== actual && expected !== expected ) {
throw new Error( 'TODO: remove me' );
}
}
if ( result.at ) {
out += indent + 'at: ' + result.at + '\n';
}
if ( result.actual ) {
actualStack = result.actual.stack;
}
if ( result.error ) {
errorStack = result.error.stack;
}
if ( actualStack ) {
stack = actualStack;
} else {
stack = errorStack;
}
if ( stack ) {
lines = stack.toString().split( reEOL.REGEXP );
out += indent + 'stack: |-\n';
for ( i = 0; i < lines.length; i++ ) {
out += indent + ' ' + lines[ i ] + '\n';
}
}
out += indent + '...\n';
return out;
}
// EXPORTS //
module.exports = encodeAssertion;
},{"@stdlib/assert/has-own-property":46,"@stdlib/regexp/eol":257,"@stdlib/string/replace":279}],202:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// VARIABLES //
var YAML_INDENT = ' ';
var YAML_BEGIN = YAML_INDENT + '---\n';
var YAML_END = YAML_INDENT + '...\n';
// MAIN //
/**
* Encodes a result as a YAML block.
*
* @private
* @param {Object} result - result
* @returns {string} encoded result
*/
function encodeResult( result ) {
var out = YAML_BEGIN;
out += YAML_INDENT + 'iterations: '+result.iterations+'\n';
out += YAML_INDENT + 'elapsed: '+result.elapsed+'\n';
out += YAML_INDENT + 'rate: '+result.rate+'\n';
out += YAML_END;
return out;
}
// EXPORTS //
module.exports = encodeResult;
},{}],203:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Forcefully exits a benchmark runner.
*
* @private
*/
function exit() {
/* eslint-disable no-invalid-this */
var self;
var i;
for ( i = 0; i < this._benchmarks.length; i++ ) {
this._benchmarks[ i ].exit();
}
self = this;
this.clear();
this._stream.once( 'close', onClose );
this._stream.destroy();
/**
* Callback invoked upon a `close` event.
*
* @private
*/
function onClose() {
self.emit( 'close' );
}
}
// EXPORTS //
module.exports = exit;
},{}],204:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var EventEmitter = require( 'events' ).EventEmitter;
var inherit = require( '@stdlib/utils/inherit' );
var defineProperty = require( '@stdlib/utils/define-property' );
var TransformStream = require( '@stdlib/streams/node/transform' );
var push = require( './push.js' );
var createStream = require( './create_stream.js' );
var run = require( './run.js' );
var clear = require( './clear.js' );
var close = require( './close.js' ); // eslint-disable-line stdlib/no-redeclare
var exit = require( './exit.js' );
// MAIN //
/**
* Benchmark runner.
*
* @private
* @constructor
* @returns {Runner} Runner instance
*
* @example
* var runner = new Runner();
*/
function Runner() {
if ( !( this instanceof Runner ) ) {
return new Runner();
}
EventEmitter.call( this );
// Private properties:
defineProperty( this, '_benchmarks', {
'value': [],
'configurable': false,
'writable': false,
'enumerable': false
});
defineProperty( this, '_stream', {
'value': new TransformStream(),
'configurable': false,
'writable': false,
'enumerable': false
});
defineProperty( this, '_closed', {
'value': false,
'configurable': false,
'writable': true,
'enumerable': false
});
defineProperty( this, '_running', {
'value': false,
'configurable': false,
'writable': true,
'enumerable': false
});
// Public properties:
defineProperty( this, 'total', {
'value': 0,
'configurable': false,
'writable': true,
'enumerable': true
});
defineProperty( this, 'fail', {
'value': 0,
'configurable': false,
'writable': true,
'enumerable': true
});
defineProperty( this, 'pass', {
'value': 0,
'configurable': false,
'writable': true,
'enumerable': true
});
defineProperty( this, 'skip', {
'value': 0,
'configurable': false,
'writable': true,
'enumerable': true
});
defineProperty( this, 'todo', {
'value': 0,
'configurable': false,
'writable': true,
'enumerable': true
});
return this;
}
/*
* Inherit from the `EventEmitter` prototype.
*/
inherit( Runner, EventEmitter );
/**
* Adds a new benchmark.
*
* @private
* @memberof Runner.prototype
* @function push
* @param {Benchmark} b - benchmark
*/
defineProperty( Runner.prototype, 'push', {
'value': push,
'configurable': false,
'writable': false,
'enumerable': false
});
/**
* Creates a results stream.
*
* @private
* @memberof Runner.prototype
* @function createStream
* @param {Options} [options] - stream options
* @returns {TransformStream} transform stream
*/
defineProperty( Runner.prototype, 'createStream', {
'value': createStream,
'configurable': false,
'writable': false,
'enumerable': false
});
/**
* Runs pending benchmarks.
*
* @private
* @memberof Runner.prototype
* @function run
*/
defineProperty( Runner.prototype, 'run', {
'value': run,
'configurable': false,
'writable': false,
'enumerable': false
});
/**
* Removes any pending benchmarks.
*
* @private
* @memberof Runner.prototype
* @function clear
*/
defineProperty( Runner.prototype, 'clear', {
'value': clear,
'configurable': false,
'writable': false,
'enumerable': false
});
/**
* Closes a benchmark runner.
*
* @private
* @memberof Runner.prototype
* @function close
*/
defineProperty( Runner.prototype, 'close', {
'value': close,
'configurable': false,
'writable': false,
'enumerable': false
});
/**
* Forcefully exits a benchmark runner.
*
* @private
* @memberof Runner.prototype
* @function exit
*/
defineProperty( Runner.prototype, 'exit', {
'value': exit,
'configurable': false,
'writable': false,
'enumerable': false
});
// EXPORTS //
module.exports = Runner;
},{"./clear.js":198,"./close.js":199,"./create_stream.js":200,"./exit.js":203,"./push.js":205,"./run.js":206,"@stdlib/streams/node/transform":273,"@stdlib/utils/define-property":302,"@stdlib/utils/inherit":325,"events":378}],205:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable no-underscore-dangle */
'use strict';
// MODULES //
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
var encodeAssertion = require( './encode_assertion.js' );
var encodeResult = require( './encode_result.js' );
// MAIN //
/**
* Adds a new benchmark.
*
* @private
* @param {Benchmark} b - benchmark
*/
function push( b ) {
/* eslint-disable no-invalid-this */
var self = this;
this._benchmarks.push( b );
b.once( 'prerun', onPreRun );
b.on( 'result', onResult );
this.emit( '_push', b );
/**
* Callback invoked upon a `prerun` event.
*
* @private
*/
function onPreRun() {
self._stream.write( '# '+b.name+'\n' );
}
/**
* Callback invoked upon a `result` event.
*
* @private
* @param {(Object|string)} res - result
* @returns {void}
*/
function onResult( res ) {
// Check for a comment...
if ( isString( res ) ) {
return self._stream.write( '# '+res+'\n' );
}
if ( res.operator === 'result' ) {
res = encodeResult( res );
return self._stream.write( res );
}
self.total += 1;
if ( res.ok ) {
if ( res.skip ) {
self.skip += 1;
} else if ( res.todo ) {
self.todo += 1;
}
self.pass += 1;
}
// According to the TAP spec, todos pass even if not "ok"...
else if ( res.todo ) {
self.pass += 1;
self.todo += 1;
}
// Everything else is a failure...
else {
self.fail += 1;
}
res = encodeAssertion( res, self.total );
self._stream.write( res );
}
}
// EXPORTS //
module.exports = push;
},{"./encode_assertion.js":201,"./encode_result.js":202,"@stdlib/assert/is-string":149}],206:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Runs pending benchmarks.
*
* @private
*/
function run() {
/* eslint-disable no-invalid-this */
this.emit( '_run' );
}
// EXPORTS //
module.exports = run;
},{}],207:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var IS_BROWSER = require( '@stdlib/assert/is-browser' );
var canExit = require( './can_exit.js' );
// MAIN //
var bool = ( !IS_BROWSER && canExit );
// EXPORTS //
module.exports = bool;
},{"./can_exit.js":208,"@stdlib/assert/is-browser":78}],208:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var proc = require( './process.js' );
// MAIN //
var bool = ( proc && typeof proc.exit === 'function' );
// EXPORTS //
module.exports = bool;
},{"./process.js":210}],209:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Runs a function on a subsequent turn of the event loop.
*
* ## Notes
*
* - `process.nextTick` is only Node.js.
* - `setImmediate` is non-standard.
* - Everything else is browser based (e.g., mutation observer, requestAnimationFrame, etc).
* - Only API which is universal is `setTimeout`.
* - Note that `0` is not actually `0ms`. Browser environments commonly have a minimum delay of `4ms`. This is acceptable. Here, the main intent of this function is to give the runtime a chance to run garbage collection, clear state, and tend to any other pending tasks before returning control to benchmark tasks. The larger aim (attainable or not) is to provide each benchmark run with as much of a fresh state as possible.
*
*
* @private
* @param {Function} fcn - function to run upon a subsequent turn of the event loop
*/
function nextTick( fcn ) {
setTimeout( fcn, 0 );
}
// EXPORTS //
module.exports = nextTick;
},{}],210:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var proc = require( 'process' );
// EXPORTS //
module.exports = proc;
},{"process":389}],211:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Benchmark harness.
*
* @module @stdlib/bench
*
* @example
* var bench = require( '@stdlib/bench' );
*
* bench( 'beep', function benchmark( b ) {
* var x;
* var i;
* b.tic();
* for ( i = 0; i < b.iterations; i++ ) {
* x = Math.sin( Math.random() );
* if ( x !== x ) {
* b.ok( false, 'should not return NaN' );
* }
* }
* b.toc();
* if ( x !== x ) {
* b.ok( false, 'should not return NaN' );
* }
* b.end();
* });
*/
// MODULES //
var bench = require( '@stdlib/bench/harness' );
// EXPORTS //
module.exports = bench;
},{"@stdlib/bench/harness":195}],212:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var ctor = require( 'buffer' ).Buffer; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = ctor;
},{"buffer":379}],213:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Buffer constructor.
*
* @module @stdlib/buffer/ctor
*
* @example
* var ctor = require( '@stdlib/buffer/ctor' );
*
* var b = new ctor( [ 1, 2, 3, 4 ] );
* // returns <Buffer>
*/
// MODULES //
var hasNodeBufferSupport = require( '@stdlib/assert/has-node-buffer-support' );
var main = require( './buffer.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var ctor;
if ( hasNodeBufferSupport() ) {
ctor = main;
} else {
ctor = polyfill;
}
// EXPORTS //
module.exports = ctor;
},{"./buffer.js":212,"./polyfill.js":214,"@stdlib/assert/has-node-buffer-support":44}],214:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// TODO: write (browser) polyfill
// MAIN //
/**
* Buffer constructor.
*
* @throws {Error} not implemented
*/
function polyfill() {
throw new Error( 'not implemented' );
}
// EXPORTS //
module.exports = polyfill;
},{}],215:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isFunction = require( '@stdlib/assert/is-function' );
var Buffer = require( '@stdlib/buffer/ctor' );
// MAIN //
var bool = isFunction( Buffer.from );
// EXPORTS //
module.exports = bool;
},{"@stdlib/assert/is-function":93,"@stdlib/buffer/ctor":213}],216:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Copy buffer data to a new `Buffer` instance.
*
* @module @stdlib/buffer/from-buffer
*
* @example
* var fromArray = require( '@stdlib/buffer/from-array' );
* var copyBuffer = require( '@stdlib/buffer/from-buffer' );
*
* var b1 = fromArray( [ 1, 2, 3, 4 ] );
* // returns <Buffer>
*
* var b2 = copyBuffer( b1 );
* // returns <Buffer>
*/
// MODULES //
var hasFrom = require( './has_from.js' );
var main = require( './main.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var copyBuffer;
if ( hasFrom ) {
copyBuffer = main;
} else {
copyBuffer = polyfill;
}
// EXPORTS //
module.exports = copyBuffer;
},{"./has_from.js":215,"./main.js":217,"./polyfill.js":218}],217:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isBuffer = require( '@stdlib/assert/is-buffer' );
var Buffer = require( '@stdlib/buffer/ctor' );
// MAIN //
/**
* Copies buffer data to a new `Buffer` instance.
*
* @param {Buffer} buffer - buffer from which to copy
* @throws {TypeError} must provide a `Buffer` instance
* @returns {Buffer} new `Buffer` instance
*
* @example
* var fromArray = require( '@stdlib/buffer/from-array' );
*
* var b1 = fromArray( [ 1, 2, 3, 4 ] );
* // returns <Buffer>
*
* var b2 = fromBuffer( b1 );
* // returns <Buffer>
*/
function fromBuffer( buffer ) {
if ( !isBuffer( buffer ) ) {
throw new TypeError( 'invalid argument. Must provide a Buffer. Value: `' + buffer + '`' );
}
return Buffer.from( buffer );
}
// EXPORTS //
module.exports = fromBuffer;
},{"@stdlib/assert/is-buffer":79,"@stdlib/buffer/ctor":213}],218:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isBuffer = require( '@stdlib/assert/is-buffer' );
var Buffer = require( '@stdlib/buffer/ctor' );
// MAIN //
/**
* Copies buffer data to a new `Buffer` instance.
*
* @param {Buffer} buffer - buffer from which to copy
* @throws {TypeError} must provide a `Buffer` instance
* @returns {Buffer} new `Buffer` instance
*
* @example
* var fromArray = require( '@stdlib/buffer/from-array' );
*
* var b1 = fromArray( [ 1, 2, 3, 4 ] );
* // returns <Buffer>
*
* var b2 = fromBuffer( b1 );
* // returns <Buffer>
*/
function fromBuffer( buffer ) {
if ( !isBuffer( buffer ) ) {
throw new TypeError( 'invalid argument. Must provide a Buffer. Value: `' + buffer + '`' );
}
return new Buffer( buffer ); // eslint-disable-line no-buffer-constructor
}
// EXPORTS //
module.exports = fromBuffer;
},{"@stdlib/assert/is-buffer":79,"@stdlib/buffer/ctor":213}],219:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Maximum length of a generic array.
*
* @module @stdlib/constants/array/max-array-length
*
* @example
* var MAX_ARRAY_LENGTH = require( '@stdlib/constants/array/max-array-length' );
* // returns 4294967295
*/
// MAIN //
/**
* Maximum length of a generic array.
*
* ```tex
* 2^{32} - 1
* ```
*
* @constant
* @type {uinteger32}
* @default 4294967295
*/
var MAX_ARRAY_LENGTH = 4294967295>>>0; // asm type annotation
// EXPORTS //
module.exports = MAX_ARRAY_LENGTH;
},{}],220:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Maximum length of a typed array.
*
* @module @stdlib/constants/array/max-typed-array-length
*
* @example
* var MAX_TYPED_ARRAY_LENGTH = require( '@stdlib/constants/array/max-typed-array-length' );
* // returns 9007199254740991
*/
// MAIN //
/**
* Maximum length of a typed array.
*
* ```tex
* 2^{53} - 1
* ```
*
* @constant
* @type {number}
* @default 9007199254740991
*/
var MAX_TYPED_ARRAY_LENGTH = 9007199254740991;
// EXPORTS //
module.exports = MAX_TYPED_ARRAY_LENGTH;
},{}],221:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* The bias of a double-precision floating-point number's exponent.
*
* @module @stdlib/constants/float64/exponent-bias
* @type {integer32}
*
* @example
* var FLOAT64_EXPONENT_BIAS = require( '@stdlib/constants/float64/exponent-bias' );
* // returns 1023
*/
// MAIN //
/**
* Bias of a double-precision floating-point number's exponent.
*
* ## Notes
*
* The bias can be computed via
*
* ```tex
* \mathrm{bias} = 2^{k-1} - 1
* ```
*
* where \\(k\\) is the number of bits in the exponent; here, \\(k = 11\\).
*
* @constant
* @type {integer32}
* @default 1023
* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}
*/
var FLOAT64_EXPONENT_BIAS = 1023|0; // asm type annotation
// EXPORTS //
module.exports = FLOAT64_EXPONENT_BIAS;
},{}],222:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* High word mask for the exponent of a double-precision floating-point number.
*
* @module @stdlib/constants/float64/high-word-exponent-mask
* @type {uinteger32}
*
* @example
* var FLOAT64_HIGH_WORD_EXPONENT_MASK = require( '@stdlib/constants/float64/high-word-exponent-mask' );
* // returns 2146435072
*/
// MAIN //
/**
* High word mask for the exponent of a double-precision floating-point number.
*
* ## Notes
*
* The high word mask for the exponent of a double-precision floating-point number is an unsigned 32-bit integer with the value \\( 2146435072 \\), which corresponds to the bit sequence
*
* ```binarystring
* 0 11111111111 00000000000000000000
* ```
*
* @constant
* @type {uinteger32}
* @default 0x7ff00000
* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}
*/
var FLOAT64_HIGH_WORD_EXPONENT_MASK = 0x7ff00000;
// EXPORTS //
module.exports = FLOAT64_HIGH_WORD_EXPONENT_MASK;
},{}],223:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* High word mask for the significand of a double-precision floating-point number.
*
* @module @stdlib/constants/float64/high-word-significand-mask
* @type {uinteger32}
*
* @example
* var FLOAT64_HIGH_WORD_SIGNIFICAND_MASK = require( '@stdlib/constants/float64/high-word-significand-mask' );
* // returns 1048575
*/
// MAIN //
/**
* High word mask for the significand of a double-precision floating-point number.
*
* ## Notes
*
* The high word mask for the significand of a double-precision floating-point number is an unsigned 32-bit integer with the value \\( 1048575 \\), which corresponds to the bit sequence
*
* ```binarystring
* 0 00000000000 11111111111111111111
* ```
*
* @constant
* @type {uinteger32}
* @default 0x000fffff
* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}
*/
var FLOAT64_HIGH_WORD_SIGNIFICAND_MASK = 0x000fffff;
// EXPORTS //
module.exports = FLOAT64_HIGH_WORD_SIGNIFICAND_MASK;
},{}],224:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Double-precision floating-point negative infinity.
*
* @module @stdlib/constants/float64/ninf
* @type {number}
*
* @example
* var FLOAT64_NINF = require( '@stdlib/constants/float64/ninf' );
* // returns -Infinity
*/
// MODULES //
var Number = require( '@stdlib/number/ctor' );
// MAIN //
/**
* Double-precision floating-point negative infinity.
*
* ## Notes
*
* Double-precision floating-point negative infinity has the bit sequence
*
* ```binarystring
* 1 11111111111 00000000000000000000 00000000000000000000000000000000
* ```
*
* @constant
* @type {number}
* @default Number.NEGATIVE_INFINITY
* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}
*/
var FLOAT64_NINF = Number.NEGATIVE_INFINITY;
// EXPORTS //
module.exports = FLOAT64_NINF;
},{"@stdlib/number/ctor":248}],225:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Double-precision floating-point positive infinity.
*
* @module @stdlib/constants/float64/pinf
* @type {number}
*
* @example
* var FLOAT64_PINF = require( '@stdlib/constants/float64/pinf' );
* // returns Infinity
*/
// MAIN //
/**
* Double-precision floating-point positive infinity.
*
* ## Notes
*
* Double-precision floating-point positive infinity has the bit sequence
*
* ```binarystring
* 0 11111111111 00000000000000000000 00000000000000000000000000000000
* ```
*
* @constant
* @type {number}
* @default Number.POSITIVE_INFINITY
* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}
*/
var FLOAT64_PINF = Number.POSITIVE_INFINITY; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = FLOAT64_PINF;
},{}],226:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Maximum signed 16-bit integer.
*
* @module @stdlib/constants/int16/max
* @type {integer32}
*
* @example
* var INT16_MAX = require( '@stdlib/constants/int16/max' );
* // returns 32767
*/
// MAIN //
/**
* Maximum signed 16-bit integer.
*
* ## Notes
*
* The number has the value
*
* ```tex
* 2^{15} - 1
* ```
*
* which corresponds to the bit sequence
*
* ```binarystring
* 0111111111111111
* ```
*
* @constant
* @type {integer32}
* @default 32767
*/
var INT16_MAX = 32767|0; // asm type annotation
// EXPORTS //
module.exports = INT16_MAX;
},{}],227:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Minimum signed 16-bit integer.
*
* @module @stdlib/constants/int16/min
* @type {integer32}
*
* @example
* var INT16_MIN = require( '@stdlib/constants/int16/min' );
* // returns -32768
*/
// MAIN //
/**
* Minimum signed 16-bit integer.
*
* ## Notes
*
* The number has the value
*
* ```tex
* -(2^{15})
* ```
*
* which corresponds to the two's complement bit sequence
*
* ```binarystring
* 1000000000000000
* ```
*
* @constant
* @type {integer32}
* @default -32768
*/
var INT16_MIN = -32768|0; // asm type annotation
// EXPORTS //
module.exports = INT16_MIN;
},{}],228:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Maximum signed 32-bit integer.
*
* @module @stdlib/constants/int32/max
* @type {integer32}
*
* @example
* var INT32_MAX = require( '@stdlib/constants/int32/max' );
* // returns 2147483647
*/
// MAIN //
/**
* Maximum signed 32-bit integer.
*
* ## Notes
*
* The number has the value
*
* ```tex
* 2^{31} - 1
* ```
*
* which corresponds to the bit sequence
*
* ```binarystring
* 01111111111111111111111111111111
* ```
*
* @constant
* @type {integer32}
* @default 2147483647
*/
var INT32_MAX = 2147483647|0; // asm type annotation
// EXPORTS //
module.exports = INT32_MAX;
},{}],229:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Minimum signed 32-bit integer.
*
* @module @stdlib/constants/int32/min
* @type {integer32}
*
* @example
* var INT32_MIN = require( '@stdlib/constants/int32/min' );
* // returns -2147483648
*/
// MAIN //
/**
* Minimum signed 32-bit integer.
*
* ## Notes
*
* The number has the value
*
* ```tex
* -(2^{31})
* ```
*
* which corresponds to the two's complement bit sequence
*
* ```binarystring
* 10000000000000000000000000000000
* ```
*
* @constant
* @type {integer32}
* @default -2147483648
*/
var INT32_MIN = -2147483648|0; // asm type annotation
// EXPORTS //
module.exports = INT32_MIN;
},{}],230:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Maximum signed 8-bit integer.
*
* @module @stdlib/constants/int8/max
* @type {integer32}
*
* @example
* var INT8_MAX = require( '@stdlib/constants/int8/max' );
* // returns 127
*/
// MAIN //
/**
* Maximum signed 8-bit integer.
*
* ## Notes
*
* The number is given by
*
* ```tex
* 2^{7} - 1
* ```
*
* which corresponds to the bit sequence
*
* ```binarystring
* 01111111
* ```
*
* @constant
* @type {integer32}
* @default 127
*/
var INT8_MAX = 127|0; // asm type annotation
// EXPORTS //
module.exports = INT8_MAX;
},{}],231:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Minimum signed 8-bit integer.
*
* @module @stdlib/constants/int8/min
* @type {integer32}
*
* @example
* var INT8_MIN = require( '@stdlib/constants/int8/min' );
* // returns -128
*/
// MAIN //
/**
* Minimum signed 8-bit integer.
*
* ## Notes
*
* The number is given by
*
* ```tex
* -(2^{7})
* ```
*
* which corresponds to the two's complement bit sequence
*
* ```binarystring
* 10000000
* ```
*
* @constant
* @type {integer32}
* @default -128
*/
var INT8_MIN = -128|0; // asm type annotation
// EXPORTS //
module.exports = INT8_MIN;
},{}],232:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Maximum unsigned 16-bit integer.
*
* @module @stdlib/constants/uint16/max
* @type {integer32}
*
* @example
* var UINT16_MAX = require( '@stdlib/constants/uint16/max' );
* // returns 65535
*/
// MAIN //
/**
* Maximum unsigned 16-bit integer.
*
* ## Notes
*
* The number has the value
*
* ```tex
* 2^{16} - 1
* ```
*
* which corresponds to the bit sequence
*
* ```binarystring
* 1111111111111111
* ```
*
* @constant
* @type {integer32}
* @default 65535
*/
var UINT16_MAX = 65535|0; // asm type annotation
// EXPORTS //
module.exports = UINT16_MAX;
},{}],233:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Maximum unsigned 32-bit integer.
*
* @module @stdlib/constants/uint32/max
* @type {uinteger32}
*
* @example
* var UINT32_MAX = require( '@stdlib/constants/uint32/max' );
* // returns 4294967295
*/
// MAIN //
/**
* Maximum unsigned 32-bit integer.
*
* ## Notes
*
* The number has the value
*
* ```tex
* 2^{32} - 1
* ```
*
* which corresponds to the bit sequence
*
* ```binarystring
* 11111111111111111111111111111111
* ```
*
* @constant
* @type {uinteger32}
* @default 4294967295
*/
var UINT32_MAX = 4294967295;
// EXPORTS //
module.exports = UINT32_MAX;
},{}],234:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Maximum unsigned 8-bit integer.
*
* @module @stdlib/constants/uint8/max
* @type {integer32}
*
* @example
* var UINT8_MAX = require( '@stdlib/constants/uint8/max' );
* // returns 255
*/
// MAIN //
/**
* Maximum unsigned 8-bit integer.
*
* ## Notes
*
* The number has the value
*
* ```tex
* 2^{8} - 1
* ```
*
* which corresponds to the bit sequence
*
* ```binarystring
* 11111111
* ```
*
* @constant
* @type {integer32}
* @default 255
*/
var UINT8_MAX = 255|0; // asm type annotation
// EXPORTS //
module.exports = UINT8_MAX;
},{}],235:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Maximum Unicode code point in the Basic Multilingual Plane (BMP).
*
* @module @stdlib/constants/unicode/max-bmp
* @type {integer32}
*
* @example
* var UNICODE_MAX_BMP = require( '@stdlib/constants/unicode/max-bmp' );
* // returns 65535
*/
// MAIN //
/**
* Maximum Unicode code point in the Basic Multilingual Plane (BMP).
*
* @constant
* @type {integer32}
* @default 65535
* @see [Unicode]{@link https://en.wikipedia.org/wiki/Unicode}
*/
var UNICODE_MAX_BMP = 0xFFFF|0; // asm type annotation
// EXPORTS //
module.exports = UNICODE_MAX_BMP;
},{}],236:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Maximum Unicode code point.
*
* @module @stdlib/constants/unicode/max
* @type {integer32}
*
* @example
* var UNICODE_MAX = require( '@stdlib/constants/unicode/max' );
* // returns 1114111
*/
// MAIN //
/**
* Maximum Unicode code point.
*
* @constant
* @type {integer32}
* @default 1114111
* @see [Unicode]{@link https://en.wikipedia.org/wiki/Unicode}
*/
var UNICODE_MAX = 0x10FFFF|0; // asm type annotation
// EXPORTS //
module.exports = UNICODE_MAX;
},{}],237:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a finite double-precision floating-point number is an integer.
*
* @module @stdlib/math/base/assert/is-integer
*
* @example
* var isInteger = require( '@stdlib/math/base/assert/is-integer' );
*
* var bool = isInteger( 1.0 );
* // returns true
*
* bool = isInteger( 3.14 );
* // returns false
*/
// MODULES //
var isInteger = require( './is_integer.js' );
// EXPORTS //
module.exports = isInteger;
},{"./is_integer.js":238}],238:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var floor = require( '@stdlib/math/base/special/floor' );
// MAIN //
/**
* Tests if a finite double-precision floating-point number is an integer.
*
* @param {number} x - value to test
* @returns {boolean} boolean indicating whether the value is an integer
*
* @example
* var bool = isInteger( 1.0 );
* // returns true
*
* @example
* var bool = isInteger( 3.14 );
* // returns false
*/
function isInteger( x ) {
return (floor(x) === x);
}
// EXPORTS //
module.exports = isInteger;
},{"@stdlib/math/base/special/floor":241}],239:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a double-precision floating-point numeric value is `NaN`.
*
* @module @stdlib/math/base/assert/is-nan
*
* @example
* var isnan = require( '@stdlib/math/base/assert/is-nan' );
*
* var bool = isnan( NaN );
* // returns true
*
* bool = isnan( 7.0 );
* // returns false
*/
// MODULES //
var isnan = require( './main.js' );
// EXPORTS //
module.exports = isnan;
},{"./main.js":240}],240:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Tests if a double-precision floating-point numeric value is `NaN`.
*
* @param {number} x - value to test
* @returns {boolean} boolean indicating whether the value is `NaN`
*
* @example
* var bool = isnan( NaN );
* // returns true
*
* @example
* var bool = isnan( 7.0 );
* // returns false
*/
function isnan( x ) {
return ( x !== x );
}
// EXPORTS //
module.exports = isnan;
},{}],241:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Round a double-precision floating-point number toward negative infinity.
*
* @module @stdlib/math/base/special/floor
*
* @example
* var floor = require( '@stdlib/math/base/special/floor' );
*
* var v = floor( -4.2 );
* // returns -5.0
*
* v = floor( 9.99999 );
* // returns 9.0
*
* v = floor( 0.0 );
* // returns 0.0
*
* v = floor( NaN );
* // returns NaN
*/
// MODULES //
var floor = require( './main.js' );
// EXPORTS //
module.exports = floor;
},{"./main.js":242}],242:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// TODO: implementation (?)
/**
* Rounds a double-precision floating-point number toward negative infinity.
*
* @param {number} x - input value
* @returns {number} rounded value
*
* @example
* var v = floor( -4.2 );
* // returns -5.0
*
* @example
* var v = floor( 9.99999 );
* // returns 9.0
*
* @example
* var v = floor( 0.0 );
* // returns 0.0
*
* @example
* var v = floor( NaN );
* // returns NaN
*/
var floor = Math.floor; // eslint-disable-line stdlib/no-builtin-math
// EXPORTS //
module.exports = floor;
},{}],243:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Decompose a double-precision floating-point number into integral and fractional parts.
*
* @module @stdlib/math/base/special/modf
*
* @example
* var modf = require( '@stdlib/math/base/special/modf' );
*
* var parts = modf( 3.14 );
* // returns [ 3.0, 0.14000000000000012 ]
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
* var modf = require( '@stdlib/math/base/special/modf' );
*
* var out = new Float64Array( 2 );
*
* var parts = modf( out, 3.14 );
* // returns [ 3.0, 0.14000000000000012 ]
*
* var bool = ( parts === out );
* // returns true
*/
// MODULES //
var modf = require( './main.js' );
// EXPORTS //
module.exports = modf;
},{"./main.js":244}],244:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var fcn = require( './modf.js' );
// MAIN //
/**
* Decomposes a double-precision floating-point number into integral and fractional parts, each having the same type and sign as the input value.
*
* @param {(Array|TypedArray|Object)} [out] - output array
* @param {number} x - input value
* @returns {(Array|TypedArray|Object)} output array
*
* @example
* var parts = modf( 3.14 );
* // returns [ 3.0, 0.14000000000000012 ]
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
*
* var out = new Float64Array( 2 );
*
* var parts = modf( out, 3.14 );
* // returns <Float64Array>[ 3.0, 0.14000000000000012 ]
*
* var bool = ( parts === out );
* // returns true
*/
function modf( out, x ) {
if ( arguments.length === 1 ) {
return fcn( [ 0.0, 0.0 ], out );
}
return fcn( out, x );
}
// EXPORTS //
module.exports = modf;
},{"./modf.js":245}],245:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var toWords = require( '@stdlib/number/float64/base/to-words' );
var fromWords = require( '@stdlib/number/float64/base/from-words' );
var PINF = require( '@stdlib/constants/float64/pinf' );
var FLOAT64_EXPONENT_BIAS = require( '@stdlib/constants/float64/exponent-bias' );
var FLOAT64_HIGH_WORD_EXPONENT_MASK = require( '@stdlib/constants/float64/high-word-exponent-mask' ); // eslint-disable-line id-length
var FLOAT64_HIGH_WORD_SIGNIFICAND_MASK = require( '@stdlib/constants/float64/high-word-significand-mask' ); // eslint-disable-line id-length
// VARIABLES //
// 4294967295 => 0xffffffff => 11111111111111111111111111111111
var ALL_ONES = 4294967295>>>0; // asm type annotation
// High/low words workspace:
var WORDS = [ 0|0, 0|0 ]; // WARNING: not thread safe
// MAIN //
/**
* Decomposes a double-precision floating-point number into integral and fractional parts, each having the same type and sign as the input value.
*
* @private
* @param {(Array|TypedArray|Object)} out - output array
* @param {number} x - input value
* @returns {(Array|TypedArray|Object)} output array
*
* @example
* var parts = modf( [ 0.0, 0.0 ], 3.14 );
* // returns [ 3.0, 0.14000000000000012 ]
*/
function modf( out, x ) {
var high;
var low;
var exp;
var i;
// Special cases...
if ( x < 1.0 ) {
if ( x < 0.0 ) {
modf( out, -x );
out[ 0 ] *= -1.0;
out[ 1 ] *= -1.0;
return out;
}
if ( x === 0.0 ) { // [ +-0, +-0 ]
out[ 0 ] = x;
out[ 1 ] = x;
return out;
}
out[ 0 ] = 0.0;
out[ 1 ] = x;
return out;
}
if ( isnan( x ) ) {
out[ 0 ] = NaN;
out[ 1 ] = NaN;
return out;
}
if ( x === PINF ) {
out[ 0 ] = PINF;
out[ 1 ] = 0.0;
return out;
}
// Decompose |x|...
// Extract the high and low words:
toWords( WORDS, x );
high = WORDS[ 0 ];
low = WORDS[ 1 ];
// Extract the unbiased exponent from the high word:
exp = ((high & FLOAT64_HIGH_WORD_EXPONENT_MASK) >> 20)|0; // asm type annotation
exp -= FLOAT64_EXPONENT_BIAS|0; // asm type annotation
// Handle smaller values (x < 2**20 = 1048576)...
if ( exp < 20 ) {
i = (FLOAT64_HIGH_WORD_SIGNIFICAND_MASK >> exp)|0; // asm type annotation
// Determine if `x` is integral by checking for significand bits which cannot be exponentiated away...
if ( ((high&i)|low) === 0 ) {
out[ 0 ] = x;
out[ 1 ] = 0.0;
return out;
}
// Turn off all the bits which cannot be exponentiated away:
high &= (~i);
// Generate the integral part:
i = fromWords( high, 0 );
// The fractional part is whatever is leftover:
out[ 0 ] = i;
out[ 1 ] = x - i;
return out;
}
// Check if `x` can even have a fractional part...
if ( exp > 51 ) {
// `x` is integral:
out[ 0 ] = x;
out[ 1 ] = 0.0;
return out;
}
i = ALL_ONES >>> (exp-20);
// Determine if `x` is integral by checking for less significant significand bits which cannot be exponentiated away...
if ( (low&i) === 0 ) {
out[ 0 ] = x;
out[ 1 ] = 0.0;
return out;
}
// Turn off all the bits which cannot be exponentiated away:
low &= (~i);
// Generate the integral part:
i = fromWords( high, low );
// The fractional part is whatever is leftover:
out[ 0 ] = i;
out[ 1 ] = x - i;
return out;
}
// EXPORTS //
module.exports = modf;
},{"@stdlib/constants/float64/exponent-bias":221,"@stdlib/constants/float64/high-word-exponent-mask":222,"@stdlib/constants/float64/high-word-significand-mask":223,"@stdlib/constants/float64/pinf":225,"@stdlib/math/base/assert/is-nan":239,"@stdlib/number/float64/base/from-words":250,"@stdlib/number/float64/base/to-words":253}],246:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// TODO: implementation
/**
* Round a numeric value to the nearest integer.
*
* @module @stdlib/math/base/special/round
*
* @example
* var round = require( '@stdlib/math/base/special/round' );
*
* var v = round( -4.2 );
* // returns -4.0
*
* v = round( -4.5 );
* // returns -4.0
*
* v = round( -4.6 );
* // returns -5.0
*
* v = round( 9.99999 );
* // returns 10.0
*
* v = round( 9.5 );
* // returns 10.0
*
* v = round( 9.2 );
* // returns 9.0
*
* v = round( 0.0 );
* // returns 0.0
*
* v = round( -0.0 );
* // returns -0.0
*
* v = round( Infinity );
* // returns Infinity
*
* v = round( -Infinity );
* // returns -Infinity
*
* v = round( NaN );
* // returns NaN
*/
// MODULES //
var round = require( './round.js' );
// EXPORTS //
module.exports = round;
},{"./round.js":247}],247:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// TODO: implementation
/**
* Rounds a numeric value to the nearest integer.
*
* @param {number} x - input value
* @returns {number} function value
*
* @example
* var v = round( -4.2 );
* // returns -4.0
*
* @example
* var v = round( -4.5 );
* // returns -4.0
*
* @example
* var v = round( -4.6 );
* // returns -5.0
*
* @example
* var v = round( 9.99999 );
* // returns 10.0
*
* @example
* var v = round( 9.5 );
* // returns 10.0
*
* @example
* var v = round( 9.2 );
* // returns 9.0
*
* @example
* var v = round( 0.0 );
* // returns 0.0
*
* @example
* var v = round( -0.0 );
* // returns -0.0
*
* @example
* var v = round( Infinity );
* // returns Infinity
*
* @example
* var v = round( -Infinity );
* // returns -Infinity
*
* @example
* var v = round( NaN );
* // returns NaN
*/
var round = Math.round; // eslint-disable-line stdlib/no-builtin-math
// EXPORTS //
module.exports = round;
},{}],248:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Constructor which returns a `Number` object.
*
* @module @stdlib/number/ctor
*
* @example
* var Number = require( '@stdlib/number/ctor' );
*
* var v = new Number( 10.0 );
* // returns <Number>
*/
// MODULES //
var Number = require( './number.js' );
// EXPORTS //
module.exports = Number;
},{"./number.js":249}],249:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// EXPORTS //
module.exports = Number; // eslint-disable-line stdlib/require-globals
},{}],250:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Create a double-precision floating-point number from a higher order word (unsigned 32-bit integer) and a lower order word (unsigned 32-bit integer).
*
* @module @stdlib/number/float64/base/from-words
*
* @example
* var fromWords = require( '@stdlib/number/float64/base/from-words' );
*
* var v = fromWords( 1774486211, 2479577218 );
* // returns 3.14e201
*
* v = fromWords( 3221823995, 1413754136 );
* // returns -3.141592653589793
*
* v = fromWords( 0, 0 );
* // returns 0.0
*
* v = fromWords( 2147483648, 0 );
* // returns -0.0
*
* v = fromWords( 2146959360, 0 );
* // returns NaN
*
* v = fromWords( 2146435072, 0 );
* // returns Infinity
*
* v = fromWords( 4293918720, 0 );
* // returns -Infinity
*/
// MODULES //
var fromWords = require( './main.js' );
// EXPORTS //
module.exports = fromWords;
},{"./main.js":252}],251:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isLittleEndian = require( '@stdlib/assert/is-little-endian' );
// MAIN //
var indices;
var HIGH;
var LOW;
if ( isLittleEndian === true ) {
HIGH = 1; // second index
LOW = 0; // first index
} else {
HIGH = 0; // first index
LOW = 1; // second index
}
indices = {
'HIGH': HIGH,
'LOW': LOW
};
// EXPORTS //
module.exports = indices;
},{"@stdlib/assert/is-little-endian":107}],252:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var Uint32Array = require( '@stdlib/array/uint32' );
var Float64Array = require( '@stdlib/array/float64' );
var indices = require( './indices.js' );
// VARIABLES //
var FLOAT64_VIEW = new Float64Array( 1 );
var UINT32_VIEW = new Uint32Array( FLOAT64_VIEW.buffer );
var HIGH = indices.HIGH;
var LOW = indices.LOW;
// MAIN //
/**
* Creates a double-precision floating-point number from a higher order word (unsigned 32-bit integer) and a lower order word (unsigned 32-bit integer).
*
* ## Notes
*
* ```text
* float64 (64 bits)
* f := fraction (significand/mantissa) (52 bits)
* e := exponent (11 bits)
* s := sign bit (1 bit)
*
* |-------- -------- -------- -------- -------- -------- -------- --------|
* | Float64 |
* |-------- -------- -------- -------- -------- -------- -------- --------|
* | Uint32 | Uint32 |
* |-------- -------- -------- -------- -------- -------- -------- --------|
* ```
*
* If little endian (more significant bits last):
*
* ```text
* <-- lower higher -->
* | f7 f6 f5 f4 f3 f2 e2 | f1 |s| e1 |
* ```
*
* If big endian (more significant bits first):
*
* ```text
* <-- higher lower -->
* |s| e1 e2 | f1 f2 f3 f4 f5 f6 f7 |
* ```
*
*
* In which Uint32 should we place the higher order bits? If little endian, the second; if big endian, the first.
*
*
* ## References
*
* - [Open Group][1]
*
* [1]: http://pubs.opengroup.org/onlinepubs/9629399/chap14.htm
*
* @param {uinteger32} high - higher order word (unsigned 32-bit integer)
* @param {uinteger32} low - lower order word (unsigned 32-bit integer)
* @returns {number} floating-point number
*
* @example
* var v = fromWords( 1774486211, 2479577218 );
* // returns 3.14e201
*
* @example
* var v = fromWords( 3221823995, 1413754136 );
* // returns -3.141592653589793
*
* @example
* var v = fromWords( 0, 0 );
* // returns 0.0
*
* @example
* var v = fromWords( 2147483648, 0 );
* // returns -0.0
*
* @example
* var v = fromWords( 2146959360, 0 );
* // returns NaN
*
* @example
* var v = fromWords( 2146435072, 0 );
* // returns Infinity
*
* @example
* var v = fromWords( 4293918720, 0 );
* // returns -Infinity
*/
function fromWords( high, low ) {
UINT32_VIEW[ HIGH ] = high;
UINT32_VIEW[ LOW ] = low;
return FLOAT64_VIEW[ 0 ];
}
// EXPORTS //
module.exports = fromWords;
},{"./indices.js":251,"@stdlib/array/float64":5,"@stdlib/array/uint32":19}],253:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Split a double-precision floating-point number into a higher order word (unsigned 32-bit integer) and a lower order word (unsigned 32-bit integer).
*
* @module @stdlib/number/float64/base/to-words
*
* @example
* var toWords = require( '@stdlib/number/float64/base/to-words' );
*
* var w = toWords( 3.14e201 );
* // returns [ 1774486211, 2479577218 ]
*
* @example
* var Uint32Array = require( '@stdlib/array/uint32' );
* var toWords = require( '@stdlib/number/float64/base/to-words' );
*
* var out = new Uint32Array( 2 );
*
* var w = toWords( out, 3.14e201 );
* // returns <Uint32Array>[ 1774486211, 2479577218 ]
*
* var bool = ( w === out );
* // returns true
*/
// MODULES //
var toWords = require( './main.js' );
// EXPORTS //
module.exports = toWords;
},{"./main.js":255}],254:[function(require,module,exports){
arguments[4][251][0].apply(exports,arguments)
},{"@stdlib/assert/is-little-endian":107,"dup":251}],255:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var fcn = require( './to_words.js' );
// MAIN //
/**
* Splits a double-precision floating-point number into a higher order word (unsigned 32-bit integer) and a lower order word (unsigned 32-bit integer).
*
* @param {(Array|TypedArray|Object)} [out] - output array
* @param {number} x - input value
* @returns {(Array|TypedArray|Object)} output array
*
* @example
* var w = toWords( 3.14e201 );
* // returns [ 1774486211, 2479577218 ]
*
* @example
* var Uint32Array = require( '@stdlib/array/uint32' );
*
* var out = new Uint32Array( 2 );
*
* var w = toWords( out, 3.14e201 );
* // returns <Uint32Array>[ 1774486211, 2479577218 ]
*
* var bool = ( w === out );
* // returns true
*/
function toWords( out, x ) {
if ( arguments.length === 1 ) {
return fcn( [ 0, 0 ], out );
}
return fcn( out, x );
}
// EXPORTS //
module.exports = toWords;
},{"./to_words.js":256}],256:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var Uint32Array = require( '@stdlib/array/uint32' );
var Float64Array = require( '@stdlib/array/float64' );
var indices = require( './indices.js' );
// VARIABLES //
var FLOAT64_VIEW = new Float64Array( 1 );
var UINT32_VIEW = new Uint32Array( FLOAT64_VIEW.buffer );
var HIGH = indices.HIGH;
var LOW = indices.LOW;
// MAIN //
/**
* Splits a double-precision floating-point number into a higher order word (unsigned 32-bit integer) and a lower order word (unsigned 32-bit integer).
*
* ## Notes
*
* ```text
* float64 (64 bits)
* f := fraction (significand/mantissa) (52 bits)
* e := exponent (11 bits)
* s := sign bit (1 bit)
*
* |-------- -------- -------- -------- -------- -------- -------- --------|
* | Float64 |
* |-------- -------- -------- -------- -------- -------- -------- --------|
* | Uint32 | Uint32 |
* |-------- -------- -------- -------- -------- -------- -------- --------|
* ```
*
* If little endian (more significant bits last):
*
* ```text
* <-- lower higher -->
* | f7 f6 f5 f4 f3 f2 e2 | f1 |s| e1 |
* ```
*
* If big endian (more significant bits first):
*
* ```text
* <-- higher lower -->
* |s| e1 e2 | f1 f2 f3 f4 f5 f6 f7 |
* ```
*
* In which Uint32 can we find the higher order bits? If little endian, the second; if big endian, the first.
*
*
* ## References
*
* - [Open Group][1]
*
* [1]: http://pubs.opengroup.org/onlinepubs/9629399/chap14.htm
*
*
* @private
* @param {(Array|TypedArray|Object)} out - output array
* @param {number} x - input value
* @returns {(Array|TypedArray|Object)} output array
*
* @example
* var Uint32Array = require( '@stdlib/array/uint32' );
*
* var out = new Uint32Array( 2 );
*
* var w = toWords( out, 3.14e201 );
* // returns <Uint32Array>[ 1774486211, 2479577218 ]
*
* var bool = ( w === out );
* // returns true
*/
function toWords( out, x ) {
FLOAT64_VIEW[ 0 ] = x;
out[ 0 ] = UINT32_VIEW[ HIGH ];
out[ 1 ] = UINT32_VIEW[ LOW ];
return out;
}
// EXPORTS //
module.exports = toWords;
},{"./indices.js":254,"@stdlib/array/float64":5,"@stdlib/array/uint32":19}],257:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Regular expression to match a newline character sequence.
*
* @module @stdlib/regexp/eol
*
* @example
* var reEOL = require( '@stdlib/regexp/eol' );
* var RE_EOL = reEOL();
*
* var bool = RE_EOL.test( '\n' );
* // returns true
*
* bool = RE_EOL.test( '\\r\\n' );
* // returns false
*
* @example
* var reEOL = require( '@stdlib/regexp/eol' );
* var replace = require( '@stdlib/string/replace' );
*
* var RE_EOL = reEOL({
* 'flags': 'g'
* });
* var str = '1\n2\n3';
* var out = replace( str, RE_EOL, '' );
*
* @example
* var reEOL = require( '@stdlib/regexp/eol' );
* var bool = reEOL.REGEXP.test( '\r\n' );
* // returns true
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var reEOL = require( './main.js' );
var REGEXP_CAPTURE = require( './regexp_capture.js' );
var REGEXP = require( './regexp.js' );
// MAIN //
setReadOnly( reEOL, 'REGEXP', REGEXP );
setReadOnly( reEOL, 'REGEXP_CAPTURE', REGEXP_CAPTURE );
// EXPORTS //
module.exports = reEOL;
},{"./main.js":258,"./regexp.js":259,"./regexp_capture.js":260,"@stdlib/utils/define-nonenumerable-read-only-property":297}],258:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2021 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var validate = require( './validate.js' );
// VARIABLES //
var REGEXP_STRING = '\\r?\\n';
// MAIN //
/**
* Returns a regular expression to match a newline character sequence.
*
* @param {Options} [options] - function options
* @param {string} [options.flags=''] - regular expression flags
* @param {boolean} [options.capture=false] - boolean indicating whether to create a capture group for the match
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @returns {RegExp} regular expression
*
* @example
* var RE_EOL = reEOL();
* var bool = RE_EOL.test( '\r\n' );
* // returns true
*
* @example
* var replace = require( '@stdlib/string/replace' );
*
* var RE_EOL = reEOL({
* 'flags': 'g'
* });
* var str = '1\n2\n3';
* var out = replace( str, RE_EOL, '' );
*/
function reEOL( options ) {
var opts;
var err;
if ( arguments.length > 0 ) {
opts = {};
err = validate( opts, options );
if ( err ) {
throw err;
}
if ( opts.capture ) {
return new RegExp( '('+REGEXP_STRING+')', opts.flags );
}
return new RegExp( REGEXP_STRING, opts.flags );
}
return /\r?\n/;
}
// EXPORTS //
module.exports = reEOL;
},{"./validate.js":261}],259:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2021 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var reEOL = require( './main.js' );
// MAIN //
/**
* Matches a newline character sequence.
*
* Regular expression: `/\r?\n/`
*
* - `\r?`
* - match a carriage return character (optional)
*
* - `\n`
* - match a line feed character
*
* @constant
* @type {RegExp}
* @default /\r?\n/
*/
var REGEXP = reEOL();
// EXPORTS //
module.exports = REGEXP;
},{"./main.js":258}],260:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2021 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var reEOL = require( './main.js' );
// MAIN //
/**
* Captures a newline character sequence.
*
* Regular expression: `/\r?\n/`
*
* - `()`
* - capture
*
* - `\r?`
* - match a carriage return character (optional)
*
* - `\n`
* - match a line feed character
*
* @constant
* @type {RegExp}
* @default /(\r?\n)/
*/
var REGEXP_CAPTURE = reEOL({
'capture': true
});
// EXPORTS //
module.exports = REGEXP_CAPTURE;
},{"./main.js":258}],261:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2021 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isObject = require( '@stdlib/assert/is-plain-object' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
// MAIN //
/**
* Validates function options.
*
* @private
* @param {Object} opts - destination object
* @param {Options} options - function options
* @param {string} [options.flags] - regular expression flags
* @param {boolean} [options.capture] - boolean indicating whether to wrap a regular expression matching a decimal number with a capture group
* @returns {(Error|null)} null or an error object
*
* @example
* var opts = {};
* var options = {
* 'flags': 'gm'
* };
* var err = validate( opts, options );
* if ( err ) {
* throw err;
* }
*/
function validate( opts, options ) {
if ( !isObject( options ) ) {
return new TypeError( 'invalid argument. Options must be an object. Value: `' + options + '`.' );
}
if ( hasOwnProp( options, 'flags' ) ) {
opts.flags = options.flags;
if ( !isString( opts.flags ) ) {
return new TypeError( 'invalid option. `flags` option must be a string primitive. Option: `' + opts.flags + '`.' );
}
}
if ( hasOwnProp( options, 'capture' ) ) {
opts.capture = options.capture;
if ( !isBoolean( opts.capture ) ) {
return new TypeError( 'invalid option. `capture` option must be a boolean primitive. Option: `' + opts.capture + '`.' );
}
}
return null;
}
// EXPORTS //
module.exports = validate;
},{"@stdlib/assert/has-own-property":46,"@stdlib/assert/is-boolean":72,"@stdlib/assert/is-plain-object":138,"@stdlib/assert/is-string":149}],262:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2021 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Regular expression to capture everything that is not a space immediately after the `function` keyword and before the first left parenthesis.
*
* @module @stdlib/regexp/function-name
*
* @example
* var reFunctionName = require( '@stdlib/regexp/function-name' );
* var RE_FUNCTION_NAME = reFunctionName();
*
* function fname( fcn ) {
* return RE_FUNCTION_NAME.exec( fcn.toString() )[ 1 ];
* }
*
* var fn = fname( Math.sqrt );
* // returns 'sqrt'
*
* fn = fname( Int8Array );
* // returns 'Int8Array'
*
* fn = fname( Object.prototype.toString );
* // returns 'toString'
*
* fn = fname( function(){} );
* // returns ''
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var reFunctionName = require( './main.js' );
var REGEXP = require( './regexp.js' );
// MAIN //
setReadOnly( reFunctionName, 'REGEXP', REGEXP );
// EXPORTS //
module.exports = reFunctionName;
},{"./main.js":263,"./regexp.js":264,"@stdlib/utils/define-nonenumerable-read-only-property":297}],263:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2021 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Returns a regular expression to capture everything that is not a space immediately after the `function` keyword and before the first left parenthesis.
*
* @returns {RegExp} regular expression
*
* @example
* var RE_FUNCTION_NAME = reFunctionName();
*
* function fname( fcn ) {
* return RE_FUNCTION_NAME.exec( fcn.toString() )[ 1 ];
* }
*
* var fn = fname( Math.sqrt );
* // returns 'sqrt'
*
* fn = fname( Int8Array );
* // returns 'Int8Array'
*
* fn = fname( Object.prototype.toString );
* // returns 'toString'
*
* fn = fname( function(){} );
* // returns ''
*/
function reFunctionName() {
return /^\s*function\s*([^(]*)/i;
}
// EXPORTS //
module.exports = reFunctionName;
},{}],264:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var reFunctionName = require( './main.js' );
// MAIN //
/**
* Captures everything that is not a space immediately after the `function` keyword and before the first left parenthesis.
*
* Regular expression: `/^\s*function\s*([^(]*)/i`
*
* - `/^\s*`
* - Match zero or more spaces at beginning
*
* - `function`
* - Match the word `function`
*
* - `\s*`
* - Match zero or more spaces after the word `function`
*
* - `()`
* - Capture
*
* - `[^(]*`
* - Match anything except a left parenthesis `(` zero or more times
*
* - `/i`
* - ignore case
*
* @constant
* @type {RegExp}
* @default /^\s*function\s*([^(]*)/i
*/
var RE_FUNCTION_NAME = reFunctionName();
// EXPORTS //
module.exports = RE_FUNCTION_NAME;
},{"./main.js":263}],265:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Return a regular expression to parse a regular expression string.
*
* @module @stdlib/regexp/regexp
*
* @example
* var reRegExp = require( '@stdlib/regexp/regexp' );
*
* var RE_REGEXP = reRegExp();
*
* var bool = RE_REGEXP.test( '/^beep$/' );
* // returns true
*
* bool = RE_REGEXP.test( '' );
* // returns false
*
* @example
* var reRegExp = require( '@stdlib/regexp/regexp' );
*
* var RE_REGEXP = reRegExp();
*
* var parts = RE_REGEXP.exec( '/^.*$/ig' );
* // returns [ '/^.*$/ig', '^.*$', 'ig', 'index': 0, 'input': '/^.*$/ig' ]
*/
// MAIN //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var reRegExp = require( './main.js' );
var REGEXP = require( './regexp.js' );
// MAIN //
setReadOnly( reRegExp, 'REGEXP', REGEXP );
// EXPORTS //
module.exports = reRegExp;
// EXPORTS //
module.exports = reRegExp;
},{"./main.js":266,"./regexp.js":267,"@stdlib/utils/define-nonenumerable-read-only-property":297}],266:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2021 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Returns a regular expression to parse a regular expression string.
*
* @returns {RegExp} regular expression
*
* @example
* var RE_REGEXP = reRegExp();
*
* var bool = RE_REGEXP.test( '/^beep$/' );
* // returns true
*
* bool = RE_REGEXP.test( '' );
* // returns false
*/
function reRegExp() {
return /^\/((?:\\\/|[^\/])+)\/([imgy]*)$/; // eslint-disable-line no-useless-escape
}
// EXPORTS //
module.exports = reRegExp;
},{}],267:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var reRegExp = require( './main.js' );
// MAIN //
/**
* Matches parts of a regular expression string.
*
* Regular expression: `/^\/((?:\\\/|[^\/])+)\/([imgy]*)$/`
*
* - `/^\/`
* - match a string that begins with a `/`
*
* - `()`
* - capture
*
* - `(?:)+`
* - capture, but do not remember, a group of characters which occur one or more times
*
* - `\\\/`
* - match the literal `\/`
*
* - `|`
* - OR
*
* - `[^\/]`
* - anything which is not the literal `\/`
*
* - `\/`
* - match the literal `/`
*
* - `([imgy]*)`
* - capture any characters matching `imgy` occurring zero or more times
*
* - `$/`
* - string end
*
*
* @constant
* @type {RegExp}
* @default /^\/((?:\\\/|[^\/])+)\/([imgy]*)$/
*/
var RE_REGEXP = reRegExp();
// EXPORTS //
module.exports = RE_REGEXP;
},{"./main.js":266}],268:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var logger = require( 'debug' );
// VARIABLES //
var debug = logger( 'transform-stream:transform' );
// MAIN //
/**
* Implements the `_transform` method as a pass through.
*
* @private
* @param {(Uint8Array|Buffer|string)} chunk - streamed chunk
* @param {string} encoding - Buffer encoding
* @param {Callback} clbk - callback to invoke after transforming the streamed chunk
*/
function transform( chunk, encoding, clbk ) {
debug( 'Received a new chunk. Chunk: %s. Encoding: %s.', chunk.toString(), encoding );
clbk( null, chunk );
}
// EXPORTS //
module.exports = transform;
},{"debug":381}],269:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var logger = require( 'debug' );
var Transform = require( 'readable-stream' ).Transform;
var inherit = require( '@stdlib/utils/inherit' );
var copy = require( '@stdlib/utils/copy' );
var DEFAULTS = require( './defaults.json' );
var validate = require( './validate.js' );
var destroy = require( './destroy.js' );
var _transform = require( './_transform.js' ); // eslint-disable-line no-underscore-dangle
// VARIABLES //
var debug = logger( 'transform-stream:ctor' );
// MAIN //
/**
* Transform stream constructor factory.
*
* @param {Options} [options] - stream options
* @param {Function} [options.transform] - callback to invoke upon receiving a new chunk
* @param {Function} [options.flush] - callback to invoke after receiving all chunks and prior to the stream closing
* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode
* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`
* @param {NonNegativeNumber} [options.highWaterMark] - specifies the `Buffer` level for when `write()` starts returning `false`
* @param {boolean} [options.allowHalfOpen=false] - specifies whether the stream should remain open even if one side ends
* @param {boolean} [options.decodeStrings=true] - specifies whether to decode `strings` into `Buffer` objects when writing
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @returns {Function} Transform stream constructor
*
* @example
* var stdout = require( '@stdlib/streams/node/stdout' );
*
* function transform( chunk, enc, clbk ) {
* clbk( null, chunk.toString()+'\n' );
* }
*
* var opts = {
* 'transform': transform
* };
*
* var TransformStream = ctor( opts );
*
* var stream = new TransformStream();
*
* stream.pipe( stdout );
*
* stream.write( '1' );
* stream.write( '2' );
* stream.write( '3' );
*
* stream.end();
*
* // prints: '1\n2\n3\n'
*/
function ctor( options ) {
var transform;
var copts;
var err;
copts = copy( DEFAULTS );
if ( arguments.length ) {
err = validate( copts, options );
if ( err ) {
throw err;
}
}
if ( copts.transform ) {
transform = copts.transform;
} else {
transform = _transform;
}
/**
* Transform stream constructor.
*
* @private
* @constructor
* @param {Options} [options] - stream options
* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode
* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`
* @param {NonNegativeNumber} [options.highWaterMark] - specifies the `Buffer` level for when `write()` starts returning `false`
* @param {boolean} [options.allowHalfOpen=false] - specifies whether the stream should remain open even if one side ends
* @param {boolean} [options.decodeStrings=true] - specifies whether to decode `strings` into `Buffer` objects when writing
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @returns {TransformStream} transform stream
*
* @example
* var stdout = require( '@stdlib/streams/node/stdout' );
*
* var stream = new TransformStream();
*
* stream.pipe( stdout );
*
* stream.write( '1' );
* stream.write( '2' );
* stream.write( '3' );
*
* stream.end();
*
* // prints: '1\n2\n3\n'
*/
function TransformStream( options ) {
var opts;
var err;
if ( !( this instanceof TransformStream ) ) {
if ( arguments.length ) {
return new TransformStream( options );
}
return new TransformStream();
}
opts = copy( copts );
if ( arguments.length ) {
err = validate( opts, options );
if ( err ) {
throw err;
}
}
debug( 'Creating a transform stream configured with the following options: %s.', JSON.stringify( opts ) );
Transform.call( this, opts );
this._destroyed = false;
return this;
}
/**
* Inherit from the `Transform` prototype.
*/
inherit( TransformStream, Transform );
/**
* Implements the `_transform` method.
*
* @private
* @name _transform
* @memberof TransformStream.prototype
* @type {Function}
* @param {(Buffer|string)} chunk - streamed chunk
* @param {string} encoding - Buffer encoding
* @param {Callback} clbk - callback to invoke after transforming the streamed chunk
*/
TransformStream.prototype._transform = transform; // eslint-disable-line no-underscore-dangle
if ( copts.flush ) {
/**
* Implements the `_flush` method.
*
* @private
* @name _flush
* @memberof TransformStream.prototype
* @type {Function}
* @param {Callback} callback to invoke after performing flush tasks
*/
TransformStream.prototype._flush = copts.flush; // eslint-disable-line no-underscore-dangle
}
/**
* Gracefully destroys a stream, providing backward compatibility.
*
* @private
* @name destroy
* @memberof TransformStream.prototype
* @type {Function}
* @param {Object} [error] - optional error message
* @returns {TransformStream} stream instance
*/
TransformStream.prototype.destroy = destroy;
return TransformStream;
}
// EXPORTS //
module.exports = ctor;
},{"./_transform.js":268,"./defaults.json":270,"./destroy.js":271,"./validate.js":276,"@stdlib/utils/copy":293,"@stdlib/utils/inherit":325,"debug":381,"readable-stream":398}],270:[function(require,module,exports){
module.exports={
"objectMode": false,
"encoding": null,
"allowHalfOpen": false,
"decodeStrings": true
}
},{}],271:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var logger = require( 'debug' );
var nextTick = require( '@stdlib/utils/next-tick' );
// VARIABLES //
var debug = logger( 'transform-stream:destroy' );
// MAIN //
/**
* Gracefully destroys a stream, providing backward compatibility.
*
* @private
* @param {Object} [error] - optional error message
* @returns {Stream} stream instance
*/
function destroy( error ) {
/* eslint-disable no-invalid-this */
var self;
if ( this._destroyed ) {
debug( 'Attempted to destroy an already destroyed stream.' );
return this;
}
self = this;
this._destroyed = true;
nextTick( close );
return this;
/**
* Closes a stream.
*
* @private
*/
function close() {
if ( error ) {
debug( 'Stream was destroyed due to an error. Error: %s.', JSON.stringify( error ) );
self.emit( 'error', error );
}
debug( 'Closing the stream...' );
self.emit( 'close' );
}
}
// EXPORTS //
module.exports = destroy;
},{"@stdlib/utils/next-tick":351,"debug":381}],272:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isObject = require( '@stdlib/assert/is-plain-object' );
var copy = require( '@stdlib/utils/copy' );
var Stream = require( './main.js' );
// MAIN //
/**
* Creates a reusable transform stream factory.
*
* @param {Options} [options] - stream options
* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode
* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`
* @param {NonNegativeNumber} [options.highWaterMark] - specifies the `Buffer` level for when `write()` starts returning `false`
* @param {boolean} [options.allowHalfOpen=false] - specifies whether the stream should remain open even if one side ends
* @param {boolean} [options.decodeStrings=true] - specifies whether to decode `strings` into `Buffer` objects when writing
* @throws {TypeError} options argument must be an object
* @returns {Function} transform stream factory
*
* @example
* function transform( chunk, enc, clbk ) {
* clbk( null, chunk.toString()+'\n' );
* }
*
* var opts = {
* 'objectMode': true,
* 'encoding': 'utf8',
* 'highWaterMark': 64,
* 'decodeStrings': false
* };
*
* var factory = streamFactory( opts );
*
* // Create 10 identically configured streams...
* var streams = [];
* var i;
* for ( i = 0; i < 10; i++ ) {
* streams.push( factory( transform ) );
* }
*/
function streamFactory( options ) {
var opts;
if ( arguments.length ) {
if ( !isObject( options ) ) {
throw new TypeError( 'invalid argument. Options argument must be an object. Value: `' + options + '`.' );
}
opts = copy( options );
} else {
opts = {};
}
return createStream;
/**
* Creates a transform stream.
*
* @private
* @param {Function} transform - callback to invoke upon receiving a new chunk
* @param {Function} [flush] - callback to invoke after receiving all chunks and prior to the stream closing
* @throws {TypeError} must provide valid options
* @throws {TypeError} transform callback must be a function
* @throws {TypeError} flush callback must be a function
* @returns {TransformStream} transform stream
*/
function createStream( transform, flush ) {
opts.transform = transform;
if ( arguments.length > 1 ) {
opts.flush = flush;
} else {
delete opts.flush; // clear any previous `flush`
}
return new Stream( opts );
}
}
// EXPORTS //
module.exports = streamFactory;
},{"./main.js":274,"@stdlib/assert/is-plain-object":138,"@stdlib/utils/copy":293}],273:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Transform stream.
*
* @module @stdlib/streams/node/transform
*
* @example
* var stdout = require( '@stdlib/streams/node/stdout' );
* var transformStream = require( '@stdlib/streams/node/transform' );
*
* function transform( chunk, enc, clbk ) {
* clbk( null, chunk.toString()+'\n' );
* }
*
* var opts = {
* 'transform': transform
* };
* var stream = transformStream( opts );
*
* stream.pipe( stdout );
*
* stream.write( '1' );
* stream.write( '2' );
* stream.write( '3' );
*
* stream.end();
* // => '1\n2\n3\n'
*
*
* @example
* var transformStream = require( '@stdlib/streams/node/transform' );
*
* function transform( chunk, enc, clbk ) {
* clbk( null, chunk.toString()+'\n' );
* }
*
* var opts = {
* 'objectMode': true,
* 'encoding': 'utf8',
* 'highWaterMark': 64,
* 'decodeStrings': false
* };
*
* var factory = transformStream.factory( opts );
*
* // Create 10 identically configured streams...
* var streams = [];
* var i;
* for ( i = 0; i < 10; i++ ) {
* streams.push( factory( transform ) );
* }
*
*
* @example
* var stdout = require( '@stdlib/streams/node/stdout' );
* var transformStream = require( '@stdlib/streams/node/transform' );
*
* function stringify( chunk, enc, clbk ) {
* clbk( null, JSON.stringify( chunk ) );
* }
*
* function newline( chunk, enc, clbk ) {
* clbk( null, chunk+'\n' );
* }
*
* var s1 = transformStream.objectMode({
* 'transform': stringify
* });
*
* var s2 = transformStream.objectMode({
* 'transform': newline
* });
*
* s1.pipe( s2 ).pipe( stdout );
*
* s1.write( {'value': 'a'} );
* s1.write( {'value': 'b'} );
* s1.write( {'value': 'c'} );
*
* s1.end();
* // => '{"value":"a"}\n{"value":"b"}\n{"value":"c"}\n'
*
*
* @example
* var stdout = require( '@stdlib/streams/node/stdout' );
* var transformStream = require( '@stdlib/streams/node/transform' );
*
* function transform( chunk, enc, clbk ) {
* clbk( null, chunk.toString()+'\n' );
* }
*
* var opts = {
* 'transform': transform
* };
*
* var Stream = transformStream.ctor( opts );
*
* var stream = new Stream();
*
* stream.pipe( stdout );
*
* stream.write( '1' );
* stream.write( '2' );
* stream.write( '3' );
*
* stream.end();
* // => '1\n2\n3\n'
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var transform = require( './main.js' );
var objectMode = require( './object_mode.js' );
var factory = require( './factory.js' );
var ctor = require( './ctor.js' );
// MAIN //
setReadOnly( transform, 'objectMode', objectMode );
setReadOnly( transform, 'factory', factory );
setReadOnly( transform, 'ctor', ctor );
// EXPORTS //
module.exports = transform;
},{"./ctor.js":269,"./factory.js":272,"./main.js":274,"./object_mode.js":275,"@stdlib/utils/define-nonenumerable-read-only-property":297}],274:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var logger = require( 'debug' );
var Transform = require( 'readable-stream' ).Transform;
var inherit = require( '@stdlib/utils/inherit' );
var copy = require( '@stdlib/utils/copy' );
var DEFAULTS = require( './defaults.json' );
var validate = require( './validate.js' );
var destroy = require( './destroy.js' );
var _transform = require( './_transform.js' ); // eslint-disable-line no-underscore-dangle
// VARIABLES //
var debug = logger( 'transform-stream:main' );
// MAIN //
/**
* Transform stream constructor.
*
* @constructor
* @param {Options} [options] - stream options
* @param {Function} [options.transform] - callback to invoke upon receiving a new chunk
* @param {Function} [options.flush] - callback to invoke after receiving all chunks and prior to the stream closing
* @param {boolean} [options.objectMode=false] - specifies whether stream should operate in object mode
* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`
* @param {NonNegativeNumber} [options.highWaterMark] - specifies the `Buffer` level for when `write()` starts returning `false`
* @param {boolean} [options.allowHalfOpen=false] - specifies whether the stream should remain open even if one side ends
* @param {boolean} [options.decodeStrings=true] - specifies whether to decode `strings` into `Buffer` objects when writing
* @throws {TypeError} must provide valid options
* @returns {TransformStream} transform stream
*
* @example
* var stdout = require( '@stdlib/streams/node/stdout' );
*
* function transform( chunk, enc, clbk ) {
* clbk( null, chunk.toString()+'\n' );
* }
*
* var opts = {
* 'transform': transform
* };
* var stream = new TransformStream( opts );
*
* stream.pipe( stdout );
*
* stream.write( '1' );
* stream.write( '2' );
* stream.write( '3' );
*
* stream.end();
*
* // prints: '1\n2\n3\n'
*/
function TransformStream( options ) {
var opts;
var err;
if ( !( this instanceof TransformStream ) ) {
if ( arguments.length ) {
return new TransformStream( options );
}
return new TransformStream();
}
opts = copy( DEFAULTS );
if ( arguments.length ) {
err = validate( opts, options );
if ( err ) {
throw err;
}
}
debug( 'Creating a transform stream configured with the following options: %s.', JSON.stringify( opts ) );
Transform.call( this, opts );
this._destroyed = false;
if ( opts.transform ) {
this._transform = opts.transform;
} else {
this._transform = _transform;
}
if ( opts.flush ) {
this._flush = opts.flush;
}
return this;
}
/*
* Inherit from the `Transform` prototype.
*/
inherit( TransformStream, Transform );
/**
* Gracefully destroys a stream, providing backward compatibility.
*
* @name destroy
* @memberof TransformStream.prototype
* @type {Function}
* @param {Object} [error] - optional error message
* @returns {TransformStream} stream instance
*/
TransformStream.prototype.destroy = destroy;
// EXPORTS //
module.exports = TransformStream;
},{"./_transform.js":268,"./defaults.json":270,"./destroy.js":271,"./validate.js":276,"@stdlib/utils/copy":293,"@stdlib/utils/inherit":325,"debug":381,"readable-stream":398}],275:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isObject = require( '@stdlib/assert/is-plain-object' );
var copy = require( '@stdlib/utils/copy' );
var Stream = require( './main.js' );
// MAIN //
/**
* Returns a transform stream with `objectMode` set to `true`.
*
* @param {Options} [options] - stream options
* @param {Function} [options.transform] - callback to invoke upon receiving a new chunk
* @param {Function} [options.flush] - callback to invoke after receiving all chunks and prior to the stream closing
* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`
* @param {NonNegativeNumber} [options.highWaterMark] - specifies the `Buffer` level for when `write()` starts returning `false`
* @param {boolean} [options.allowHalfOpen=false] - specifies whether the stream should remain open even if one side ends
* @param {boolean} [options.decodeStrings=true] - specifies whether to decode `strings` into `Buffer` objects when writing
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @returns {TransformStream} transform stream
*
* @example
* var stdout = require( '@stdlib/streams/node/stdout' );
*
* function stringify( chunk, enc, clbk ) {
* clbk( null, JSON.stringify( chunk ) );
* }
*
* function newline( chunk, enc, clbk ) {
* clbk( null, chunk+'\n' );
* }
*
* var s1 = objectMode({
* 'transform': stringify
* });
*
* var s2 = objectMode({
* 'transform': newline
* });
*
* s1.pipe( s2 ).pipe( stdout );
*
* s1.write( {'value': 'a'} );
* s1.write( {'value': 'b'} );
* s1.write( {'value': 'c'} );
*
* s1.end();
*
* // prints: '{"value":"a"}\n{"value":"b"}\n{"value":"c"}\n'
*/
function objectMode( options ) {
var opts;
if ( arguments.length ) {
if ( !isObject( options ) ) {
throw new TypeError( 'invalid argument. Options argument must be an object. Value: `' + options + '`.' );
}
opts = copy( options );
} else {
opts = {};
}
opts.objectMode = true;
return new Stream( opts );
}
// EXPORTS //
module.exports = objectMode;
},{"./main.js":274,"@stdlib/assert/is-plain-object":138,"@stdlib/utils/copy":293}],276:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isObject = require( '@stdlib/assert/is-plain-object' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var isFunction = require( '@stdlib/assert/is-function' );
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
// MAIN //
/**
* Validates function options.
*
* @private
* @param {Object} opts - destination object
* @param {Options} options - function options
* @param {Function} [options.transform] - callback to invoke upon receiving a new chunk
* @param {Function} [options.flush] - callback to invoke after receiving all chunks and prior to the stream closing
* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode
* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`
* @param {NonNegativeNumber} [options.highWaterMark] - specifies the `Buffer` level for when `write()` starts returning `false`
* @param {boolean} [options.allowHalfOpen] - specifies whether the stream should remain open even if one side ends
* @param {boolean} [options.decodeStrings] - specifies whether to decode `strings` into `Buffer` objects when writing
* @returns {(Error|null)} null or an error object
*/
function validate( opts, options ) {
if ( !isObject( options ) ) {
return new TypeError( 'invalid argument. Options must be an object. Value: `' + options + '`.' );
}
if ( hasOwnProp( options, 'transform' ) ) {
opts.transform = options.transform;
if ( !isFunction( opts.transform ) ) {
return new TypeError( 'invalid option. `transform` option must be a function. Option: `' + opts.transform + '`.' );
}
}
if ( hasOwnProp( options, 'flush' ) ) {
opts.flush = options.flush;
if ( !isFunction( opts.flush ) ) {
return new TypeError( 'invalid option. `flush` option must be a function. Option: `' + opts.flush + '`.' );
}
}
if ( hasOwnProp( options, 'objectMode' ) ) {
opts.objectMode = options.objectMode;
if ( !isBoolean( opts.objectMode ) ) {
return new TypeError( 'invalid option. `objectMode` option must be a primitive boolean. Option: `' + opts.objectMode + '`.' );
}
}
if ( hasOwnProp( options, 'encoding' ) ) {
opts.encoding = options.encoding;
if ( !isString( opts.encoding ) ) {
return new TypeError( 'invalid option. `encoding` option must be a primitive string. Option: `' + opts.encoding + '`.' );
}
}
if ( hasOwnProp( options, 'allowHalfOpen' ) ) {
opts.allowHalfOpen = options.allowHalfOpen;
if ( !isBoolean( opts.allowHalfOpen ) ) {
return new TypeError( 'invalid option. `allowHalfOpen` option must be a primitive boolean. Option: `' + opts.allowHalfOpen + '`.' );
}
}
if ( hasOwnProp( options, 'highWaterMark' ) ) {
opts.highWaterMark = options.highWaterMark;
if ( !isNonNegative( opts.highWaterMark ) ) {
return new TypeError( 'invalid option. `highWaterMark` option must be a nonnegative number. Option: `' + opts.highWaterMark + '`.' );
}
}
if ( hasOwnProp( options, 'decodeStrings' ) ) {
opts.decodeStrings = options.decodeStrings;
if ( !isBoolean( opts.decodeStrings ) ) {
return new TypeError( 'invalid option. `decodeStrings` option must be a primitive boolean. Option: `' + opts.decodeStrings + '`.' );
}
}
return null;
}
// EXPORTS //
module.exports = validate;
},{"@stdlib/assert/has-own-property":46,"@stdlib/assert/is-boolean":72,"@stdlib/assert/is-function":93,"@stdlib/assert/is-nonnegative-number":122,"@stdlib/assert/is-plain-object":138,"@stdlib/assert/is-string":149}],277:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Create a string from a sequence of Unicode code points.
*
* @module @stdlib/string/from-code-point
*
* @example
* var fromCodePoint = require( '@stdlib/string/from-code-point' );
*
* var str = fromCodePoint( 9731 );
* // returns '☃'
*/
// MODULES //
var fromCodePoint = require( './main.js' );
// EXPORTS //
module.exports = fromCodePoint;
},{"./main.js":278}],278:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;
var isCollection = require( '@stdlib/assert/is-collection' );
var UNICODE_MAX = require( '@stdlib/constants/unicode/max' );
var UNICODE_MAX_BMP = require( '@stdlib/constants/unicode/max-bmp' );
// VARIABLES //
var fromCharCode = String.fromCharCode;
// Factor to rescale a code point from a supplementary plane:
var Ox10000 = 0x10000|0; // 65536
// Factor added to obtain a high surrogate:
var OxD800 = 0xD800|0; // 55296
// Factor added to obtain a low surrogate:
var OxDC00 = 0xDC00|0; // 56320
// 10-bit mask: 2^10-1 = 1023 => 0x3ff => 00000000 00000000 00000011 11111111
var Ox3FF = 1023|0;
// MAIN //
/**
* Creates a string from a sequence of Unicode code points.
*
* ## Notes
*
* - UTF-16 encoding uses one 16-bit unit for non-surrogates (U+0000 to U+D7FF and U+E000 to U+FFFF).
* - UTF-16 encoding uses two 16-bit units (surrogate pairs) for U+10000 to U+10FFFF and encodes U+10000-U+10FFFF by subtracting 0x10000 from the code point, expressing the result as a 20-bit binary, and splitting the 20 bits of 0x0-0xFFFFF as upper and lower 10-bits. The respective 10-bits are stored in two 16-bit words: a high and a low surrogate.
*
*
* @param {...NonNegativeInteger} args - sequence of code points
* @throws {Error} must provide either an array-like object of code points or one or more code points as separate arguments
* @throws {TypeError} a code point must be a nonnegative integer
* @throws {RangeError} must provide a valid Unicode code point
* @returns {string} created string
*
* @example
* var str = fromCodePoint( 9731 );
* // returns '☃'
*/
function fromCodePoint( args ) {
var len;
var str;
var arr;
var low;
var hi;
var pt;
var i;
len = arguments.length;
if ( len === 1 && isCollection( args ) ) {
arr = arguments[ 0 ];
len = arr.length;
} else {
arr = [];
for ( i = 0; i < len; i++ ) {
arr.push( arguments[ i ] );
}
}
if ( len === 0 ) {
throw new Error( 'insufficient input arguments. Must provide either an array of code points or one or more code points as separate arguments.' );
}
str = '';
for ( i = 0; i < len; i++ ) {
pt = arr[ i ];
if ( !isNonNegativeInteger( pt ) ) {
throw new TypeError( 'invalid argument. Must provide valid code points (nonnegative integers). Value: `'+pt+'`.' );
}
if ( pt > UNICODE_MAX ) {
throw new RangeError( 'invalid argument. Must provide a valid code point (cannot exceed max). Value: `'+pt+'`.' );
}
if ( pt <= UNICODE_MAX_BMP ) {
str += fromCharCode( pt );
} else {
// Code point from a supplementary plane. Split into two 16-bit code units (surrogate pair).
pt -= Ox10000;
hi = (pt >> 10) + OxD800;
low = (pt & Ox3FF) + OxDC00;
str += fromCharCode( hi, low );
}
}
return str;
}
// EXPORTS //
module.exports = fromCodePoint;
},{"@stdlib/assert/is-collection":81,"@stdlib/assert/is-nonnegative-integer":118,"@stdlib/constants/unicode/max":236,"@stdlib/constants/unicode/max-bmp":235}],279:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Replace search occurrences with a replacement string.
*
* @module @stdlib/string/replace
*
* @example
* var replace = require( '@stdlib/string/replace' );
*
* var str = 'beep';
* var out = replace( str, 'e', 'o' );
* // returns 'boop'
*
* str = 'Hello World';
* out = replace( str, /world/i, 'Mr. President' );
* // returns 'Hello Mr. President'
*/
// MODULES //
var replace = require( './replace.js' );
// EXPORTS //
module.exports = replace;
},{"./replace.js":280}],280:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var rescape = require( '@stdlib/utils/escape-regexp-string' );
var isFunction = require( '@stdlib/assert/is-function' );
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
var isRegExp = require( '@stdlib/assert/is-regexp' );
// MAIN //
/**
* Replace search occurrences with a replacement string.
*
* @param {string} str - input string
* @param {(string|RegExp)} search - search expression
* @param {(string|Function)} newval - replacement value or function
* @throws {TypeError} first argument must be a string primitive
* @throws {TypeError} second argument argument must be a string primitive or regular expression
* @throws {TypeError} third argument must be a string primitive or function
* @returns {string} new string containing replacement(s)
*
* @example
* var str = 'beep';
* var out = replace( str, 'e', 'o' );
* // returns 'boop'
*
* @example
* var str = 'Hello World';
* var out = replace( str, /world/i, 'Mr. President' );
* // returns 'Hello Mr. President'
*
* @example
* var capitalize = require( '@stdlib/string/capitalize' );
*
* var str = 'Oranges and lemons say the bells of St. Clement\'s';
*
* function replacer( match, p1 ) {
* return capitalize( p1 );
* }
*
* var out = replace( str, /([^\s]*)/gi, replacer);
* // returns 'Oranges And Lemons Say The Bells Of St. Clement\'s'
*/
function replace( str, search, newval ) {
if ( !isString( str ) ) {
throw new TypeError( 'invalid argument. First argument must be a string primitive. Value: `' + str + '`.' );
}
if ( isString( search ) ) {
search = rescape( search );
search = new RegExp( search, 'g' );
}
else if ( !isRegExp( search ) ) {
throw new TypeError( 'invalid argument. Second argument must be a string primitive or regular expression. Value: `' + search + '`.' );
}
if ( !isString( newval ) && !isFunction( newval ) ) {
throw new TypeError( 'invalid argument. Third argument must be a string primitive or replacement function. Value: `' + newval + '`.' );
}
return str.replace( search, newval );
}
// EXPORTS //
module.exports = replace;
},{"@stdlib/assert/is-function":93,"@stdlib/assert/is-regexp":145,"@stdlib/assert/is-string":149,"@stdlib/utils/escape-regexp-string":304}],281:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Trim whitespace characters from the beginning and end of a string.
*
* @module @stdlib/string/trim
*
* @example
* var trim = require( '@stdlib/string/trim' );
*
* var out = trim( ' Whitespace ' );
* // returns 'Whitespace'
*
* out = trim( '\t\t\tTabs\t\t\t' );
* // returns 'Tabs'
*
* out = trim( '\n\n\nNew Lines\n\n\n' );
* // returns 'New Lines'
*/
// MODULES //
var trim = require( './trim.js' );
// EXPORTS //
module.exports = trim;
},{"./trim.js":282}],282:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
var replace = require( '@stdlib/string/replace' );
// VARIABLES //
// The following regular expression should suffice to polyfill (most?) all environments.
var RE = /^[\u0020\f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]*([\S\s]*?)[\u0020\f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]*$/;
// MAIN //
/**
* Trim whitespace characters from beginning and end of a string.
*
* @param {string} str - input string
* @throws {TypeError} must provide a string primitive
* @returns {string} trimmed string
*
* @example
* var out = trim( ' Whitespace ' );
* // returns 'Whitespace'
*
* @example
* var out = trim( '\t\t\tTabs\t\t\t' );
* // returns 'Tabs'
*
* @example
* var out = trim( '\n\n\nNew Lines\n\n\n' );
* // returns 'New Lines'
*/
function trim( str ) {
if ( !isString( str ) ) {
throw new TypeError( 'invalid argument. Must provide a string primitive. Value: `' + str + '`.' );
}
return replace( str, RE, '$1' );
}
// EXPORTS //
module.exports = trim;
},{"@stdlib/assert/is-string":149,"@stdlib/string/replace":279}],283:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var getGlobal = require( '@stdlib/utils/global' );
var isObject = require( '@stdlib/assert/is-object' );
var modf = require( '@stdlib/math/base/special/modf' );
var round = require( '@stdlib/math/base/special/round' );
var now = require( './now.js' );
// VARIABLES //
var Global = getGlobal();
var ts;
var ns;
if ( isObject( Global.performance ) ) {
ns = Global.performance;
} else {
ns = {};
}
if ( ns.now ) {
ts = ns.now.bind( ns );
} else if ( ns.mozNow ) {
ts = ns.mozNow.bind( ns );
} else if ( ns.msNow ) {
ts = ns.msNow.bind( ns );
} else if ( ns.oNow ) {
ts = ns.oNow.bind( ns );
} else if ( ns.webkitNow ) {
ts = ns.webkitNow.bind( ns );
} else {
ts = now;
}
// MAIN //
/**
* Returns a high-resolution time.
*
* ## Notes
*
* - Output format: `[seconds, nanoseconds]`.
*
*
* @private
* @returns {NumberArray} high-resolution time
*
* @example
* var t = tic();
* // returns [<number>,<number>]
*/
function tic() {
var parts;
var t;
// Get a millisecond timestamp and convert to seconds:
t = ts() / 1000;
// Decompose the timestamp into integer (seconds) and fractional parts:
parts = modf( t );
// Convert the fractional part to nanoseconds:
parts[ 1 ] = round( parts[1] * 1.0e9 );
// Return the high-resolution time:
return parts;
}
// EXPORTS //
module.exports = tic;
},{"./now.js":285,"@stdlib/assert/is-object":136,"@stdlib/math/base/special/modf":243,"@stdlib/math/base/special/round":246,"@stdlib/utils/global":318}],284:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isFunction = require( '@stdlib/assert/is-function' );
// MAIN //
var bool = isFunction( Date.now );
// EXPORTS //
module.exports = bool;
},{"@stdlib/assert/is-function":93}],285:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var bool = require( './detect.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var now;
if ( bool ) {
now = Date.now;
} else {
now = polyfill;
}
// EXPORTS //
module.exports = now;
},{"./detect.js":284,"./polyfill.js":286}],286:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Returns the time in milliseconds since the epoch.
*
* @private
* @returns {number} time
*
* @example
* var ts = now();
* // returns <number>
*/
function now() {
var d = new Date();
return d.getTime();
}
// EXPORTS //
module.exports = now;
},{}],287:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Return a high-resolution time difference.
*
* @module @stdlib/time/toc
*
* @example
* var tic = require( '@stdlib/time/tic' );
* var toc = require( '@stdlib/time/toc' );
*
* var start = tic();
* var delta = toc( start );
* // returns [<number>,<number>]
*/
// MODULES //
var toc = require( './toc.js' );
// EXPORTS //
module.exports = toc;
},{"./toc.js":288}],288:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isNonNegativeIntegerArray = require( '@stdlib/assert/is-nonnegative-integer-array' ).primitives;
var tic = require( '@stdlib/time/tic' );
// MAIN //
/**
* Returns a high-resolution time difference.
*
* ## Notes
*
* - Output format: `[seconds, nanoseconds]`.
*
*
* @param {NonNegativeIntegerArray} time - high-resolution time
* @throws {TypeError} must provide a nonnegative integer array
* @throws {RangeError} input array must have length `2`
* @returns {NumberArray} high resolution time difference
*
* @example
* var tic = require( '@stdlib/time/tic' );
*
* var start = tic();
* var delta = toc( start );
* // returns [<number>,<number>]
*/
function toc( time ) {
var now = tic();
var sec;
var ns;
if ( !isNonNegativeIntegerArray( time ) ) {
throw new TypeError( 'invalid argument. Must provide an array of nonnegative integers. Value: `' + time + '`.' );
}
if ( time.length !== 2 ) {
throw new RangeError( 'invalid argument. Input array must have length `2`.' );
}
sec = now[ 0 ] - time[ 0 ];
ns = now[ 1 ] - time[ 1 ];
if ( sec > 0 && ns < 0 ) {
sec -= 1;
ns += 1e9;
}
else if ( sec < 0 && ns > 0 ) {
sec += 1;
ns -= 1e9;
}
return [ sec, ns ];
}
// EXPORTS //
module.exports = toc;
},{"@stdlib/assert/is-nonnegative-integer-array":117,"@stdlib/time/tic":283}],289:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Determine the name of a value's constructor.
*
* @module @stdlib/utils/constructor-name
*
* @example
* var constructorName = require( '@stdlib/utils/constructor-name' );
*
* var v = constructorName( 'a' );
* // returns 'String'
*
* v = constructorName( {} );
* // returns 'Object'
*
* v = constructorName( true );
* // returns 'Boolean'
*/
// MODULES //
var constructorName = require( './main.js' );
// EXPORTS //
module.exports = constructorName;
},{"./main.js":290}],290:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var nativeClass = require( '@stdlib/utils/native-class' );
var RE = require( '@stdlib/regexp/function-name' ).REGEXP;
var isBuffer = require( '@stdlib/assert/is-buffer' );
// MAIN //
/**
* Determines the name of a value's constructor.
*
* @param {*} v - input value
* @returns {string} name of a value's constructor
*
* @example
* var v = constructorName( 'a' );
* // returns 'String'
*
* @example
* var v = constructorName( 5 );
* // returns 'Number'
*
* @example
* var v = constructorName( null );
* // returns 'Null'
*
* @example
* var v = constructorName( undefined );
* // returns 'Undefined'
*
* @example
* var v = constructorName( function noop() {} );
* // returns 'Function'
*/
function constructorName( v ) {
var match;
var name;
var ctor;
name = nativeClass( v ).slice( 8, -1 );
if ( (name === 'Object' || name === 'Error') && v.constructor ) {
ctor = v.constructor;
if ( typeof ctor.name === 'string' ) {
return ctor.name;
}
match = RE.exec( ctor.toString() );
if ( match ) {
return match[ 1 ];
}
}
if ( isBuffer( v ) ) {
return 'Buffer';
}
return name;
}
// EXPORTS //
module.exports = constructorName;
},{"@stdlib/assert/is-buffer":79,"@stdlib/regexp/function-name":262,"@stdlib/utils/native-class":346}],291:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isArray = require( '@stdlib/assert/is-array' );
var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;
var PINF = require( '@stdlib/constants/float64/pinf' );
var deepCopy = require( './deep_copy.js' );
// MAIN //
/**
* Copies or deep clones a value to an arbitrary depth.
*
* @param {*} value - value to copy
* @param {NonNegativeInteger} [level=+infinity] - copy depth
* @throws {TypeError} `level` must be a nonnegative integer
* @returns {*} value copy
*
* @example
* var out = copy( 'beep' );
* // returns 'beep'
*
* @example
* var value = [
* {
* 'a': 1,
* 'b': true,
* 'c': [ 1, 2, 3 ]
* }
* ];
* var out = copy( value );
* // returns [ { 'a': 1, 'b': true, 'c': [ 1, 2, 3 ] } ]
*
* var bool = ( value[0].c === out[0].c );
* // returns false
*/
function copy( value, level ) {
var out;
if ( arguments.length > 1 ) {
if ( !isNonNegativeInteger( level ) ) {
throw new TypeError( 'invalid argument. `level` must be a nonnegative integer. Value: `' + level + '`.' );
}
if ( level === 0 ) {
return value;
}
} else {
level = PINF;
}
out = ( isArray( value ) ) ? new Array( value.length ) : {};
return deepCopy( value, out, [value], [out], level );
}
// EXPORTS //
module.exports = copy;
},{"./deep_copy.js":292,"@stdlib/assert/is-array":70,"@stdlib/assert/is-nonnegative-integer":118,"@stdlib/constants/float64/pinf":225}],292:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var isArray = require( '@stdlib/assert/is-array' );
var isBuffer = require( '@stdlib/assert/is-buffer' );
var isError = require( '@stdlib/assert/is-error' );
var typeOf = require( '@stdlib/utils/type-of' );
var regexp = require( '@stdlib/utils/regexp-from-string' );
var indexOf = require( '@stdlib/utils/index-of' );
var objectKeys = require( '@stdlib/utils/keys' );
var propertyNames = require( '@stdlib/utils/property-names' );
var propertyDescriptor = require( '@stdlib/utils/property-descriptor' );
var getPrototypeOf = require( '@stdlib/utils/get-prototype-of' );
var defineProperty = require( '@stdlib/utils/define-property' );
var copyBuffer = require( '@stdlib/buffer/from-buffer' );
var typedArrays = require( './typed_arrays.js' );
// FUNCTIONS //
/**
* Clones a class instance.
*
* ## Notes
*
* - This should **only** be used for simple cases. Any instances with privileged access to variables (e.g., within closures) cannot be cloned. This approach should be considered **fragile**.
* - The function is greedy, disregarding the notion of a `level`. Instead, the function deep copies all properties, as we assume the concept of `level` applies only to the class instance reference but not to its internal state. This prevents, in theory, two instances from sharing state.
*
*
* @private
* @param {Object} val - class instance
* @returns {Object} new instance
*/
function cloneInstance( val ) {
var cache;
var names;
var name;
var refs;
var desc;
var tmp;
var ref;
var i;
cache = [];
refs = [];
ref = Object.create( getPrototypeOf( val ) );
cache.push( val );
refs.push( ref );
names = propertyNames( val );
for ( i = 0; i < names.length; i++ ) {
name = names[ i ];
desc = propertyDescriptor( val, name );
if ( hasOwnProp( desc, 'value' ) ) {
tmp = ( isArray( val[name] ) ) ? [] : {};
desc.value = deepCopy( val[name], tmp, cache, refs, -1 );
}
defineProperty( ref, name, desc );
}
if ( !Object.isExtensible( val ) ) {
Object.preventExtensions( ref );
}
if ( Object.isSealed( val ) ) {
Object.seal( ref );
}
if ( Object.isFrozen( val ) ) {
Object.freeze( ref );
}
return ref;
}
/**
* Copies an error object.
*
* @private
* @param {(Error|TypeError|SyntaxError|URIError|ReferenceError|RangeError|EvalError)} error - error to copy
* @returns {(Error|TypeError|SyntaxError|URIError|ReferenceError|RangeError|EvalError)} error copy
*
* @example
* var err1 = new TypeError( 'beep' );
*
* var err2 = copyError( err1 );
* // returns <TypeError>
*/
function copyError( error ) {
var cache = [];
var refs = [];
var keys;
var desc;
var tmp;
var key;
var err;
var i;
// Create a new error...
err = new error.constructor( error.message );
cache.push( error );
refs.push( err );
// If a `stack` property is present, copy it over...
if ( error.stack ) {
err.stack = error.stack;
}
// Node.js specific (system errors)...
if ( error.code ) {
err.code = error.code;
}
if ( error.errno ) {
err.errno = error.errno;
}
if ( error.syscall ) {
err.syscall = error.syscall;
}
// Any enumerable properties...
keys = objectKeys( error );
for ( i = 0; i < keys.length; i++ ) {
key = keys[ i ];
desc = propertyDescriptor( error, key );
if ( hasOwnProp( desc, 'value' ) ) {
tmp = ( isArray( error[ key ] ) ) ? [] : {};
desc.value = deepCopy( error[ key ], tmp, cache, refs, -1 );
}
defineProperty( err, key, desc );
}
return err;
}
// MAIN //
/**
* Recursively performs a deep copy of an input object.
*
* @private
* @param {*} val - value to copy
* @param {(Array|Object)} copy - copy
* @param {Array} cache - an array of visited objects
* @param {Array} refs - an array of object references
* @param {NonNegativeInteger} level - copy depth
* @returns {*} deep copy
*/
function deepCopy( val, copy, cache, refs, level ) {
var parent;
var keys;
var name;
var desc;
var ctor;
var key;
var ref;
var x;
var i;
var j;
level -= 1;
// Primitives and functions...
if (
typeof val !== 'object' ||
val === null
) {
return val;
}
if ( isBuffer( val ) ) {
return copyBuffer( val );
}
if ( isError( val ) ) {
return copyError( val );
}
// Objects...
name = typeOf( val );
if ( name === 'date' ) {
return new Date( +val );
}
if ( name === 'regexp' ) {
return regexp( val.toString() );
}
if ( name === 'set' ) {
return new Set( val );
}
if ( name === 'map' ) {
return new Map( val );
}
if (
name === 'string' ||
name === 'boolean' ||
name === 'number'
) {
// If provided an `Object`, return an equivalent primitive!
return val.valueOf();
}
ctor = typedArrays[ name ];
if ( ctor ) {
return ctor( val );
}
// Class instances...
if (
name !== 'array' &&
name !== 'object'
) {
// Cloning requires ES5 or higher...
if ( typeof Object.freeze === 'function' ) {
return cloneInstance( val );
}
return {};
}
// Arrays and plain objects...
keys = objectKeys( val );
if ( level > 0 ) {
parent = name;
for ( j = 0; j < keys.length; j++ ) {
key = keys[ j ];
x = val[ key ];
// Primitive, Buffer, special class instance...
name = typeOf( x );
if (
typeof x !== 'object' ||
x === null ||
(
name !== 'array' &&
name !== 'object'
) ||
isBuffer( x )
) {
if ( parent === 'object' ) {
desc = propertyDescriptor( val, key );
if ( hasOwnProp( desc, 'value' ) ) {
desc.value = deepCopy( x );
}
defineProperty( copy, key, desc );
} else {
copy[ key ] = deepCopy( x );
}
continue;
}
// Circular reference...
i = indexOf( cache, x );
if ( i !== -1 ) {
copy[ key ] = refs[ i ];
continue;
}
// Plain array or object...
ref = ( isArray( x ) ) ? new Array( x.length ) : {};
cache.push( x );
refs.push( ref );
if ( parent === 'array' ) {
copy[ key ] = deepCopy( x, ref, cache, refs, level );
} else {
desc = propertyDescriptor( val, key );
if ( hasOwnProp( desc, 'value' ) ) {
desc.value = deepCopy( x, ref, cache, refs, level );
}
defineProperty( copy, key, desc );
}
}
} else if ( name === 'array' ) {
for ( j = 0; j < keys.length; j++ ) {
key = keys[ j ];
copy[ key ] = val[ key ];
}
} else {
for ( j = 0; j < keys.length; j++ ) {
key = keys[ j ];
desc = propertyDescriptor( val, key );
defineProperty( copy, key, desc );
}
}
if ( !Object.isExtensible( val ) ) {
Object.preventExtensions( copy );
}
if ( Object.isSealed( val ) ) {
Object.seal( copy );
}
if ( Object.isFrozen( val ) ) {
Object.freeze( copy );
}
return copy;
}
// EXPORTS //
module.exports = deepCopy;
},{"./typed_arrays.js":294,"@stdlib/assert/has-own-property":46,"@stdlib/assert/is-array":70,"@stdlib/assert/is-buffer":79,"@stdlib/assert/is-error":87,"@stdlib/buffer/from-buffer":216,"@stdlib/utils/define-property":302,"@stdlib/utils/get-prototype-of":312,"@stdlib/utils/index-of":322,"@stdlib/utils/keys":339,"@stdlib/utils/property-descriptor":361,"@stdlib/utils/property-names":365,"@stdlib/utils/regexp-from-string":368,"@stdlib/utils/type-of":373}],293:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Copy or deep clone a value to an arbitrary depth.
*
* @module @stdlib/utils/copy
*
* @example
* var copy = require( '@stdlib/utils/copy' );
*
* var out = copy( 'beep' );
* // returns 'beep'
*
* @example
* var copy = require( '@stdlib/utils/copy' );
*
* var value = [
* {
* 'a': 1,
* 'b': true,
* 'c': [ 1, 2, 3 ]
* }
* ];
* var out = copy( value );
* // returns [ {'a': 1, 'b': true, 'c': [ 1, 2, 3 ] } ]
*
* var bool = ( value[0].c === out[0].c );
* // returns false
*/
// MODULES //
var copy = require( './copy.js' );
// EXPORTS //
module.exports = copy;
},{"./copy.js":291}],294:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var Int8Array = require( '@stdlib/array/int8' );
var Uint8Array = require( '@stdlib/array/uint8' );
var Uint8ClampedArray = require( '@stdlib/array/uint8c' );
var Int16Array = require( '@stdlib/array/int16' );
var Uint16Array = require( '@stdlib/array/uint16' );
var Int32Array = require( '@stdlib/array/int32' );
var Uint32Array = require( '@stdlib/array/uint32' );
var Float32Array = require( '@stdlib/array/float32' );
var Float64Array = require( '@stdlib/array/float64' );
// VARIABLES //
var hash;
// FUNCTIONS //
/**
* Copies an `Int8Array`.
*
* @private
* @param {Int8Array} arr - array to copy
* @returns {Int8Array} new array
*/
function int8array( arr ) {
return new Int8Array( arr );
}
/**
* Copies a `Uint8Array`.
*
* @private
* @param {Uint8Array} arr - array to copy
* @returns {Uint8Array} new array
*/
function uint8array( arr ) {
return new Uint8Array( arr );
}
/**
* Copies a `Uint8ClampedArray`.
*
* @private
* @param {Uint8ClampedArray} arr - array to copy
* @returns {Uint8ClampedArray} new array
*/
function uint8clampedarray( arr ) {
return new Uint8ClampedArray( arr );
}
/**
* Copies an `Int16Array`.
*
* @private
* @param {Int16Array} arr - array to copy
* @returns {Int16Array} new array
*/
function int16array( arr ) {
return new Int16Array( arr );
}
/**
* Copies a `Uint16Array`.
*
* @private
* @param {Uint16Array} arr - array to copy
* @returns {Uint16Array} new array
*/
function uint16array( arr ) {
return new Uint16Array( arr );
}
/**
* Copies an `Int32Array`.
*
* @private
* @param {Int32Array} arr - array to copy
* @returns {Int32Array} new array
*/
function int32array( arr ) {
return new Int32Array( arr );
}
/**
* Copies a `Uint32Array`.
*
* @private
* @param {Uint32Array} arr - array to copy
* @returns {Uint32Array} new array
*/
function uint32array( arr ) {
return new Uint32Array( arr );
}
/**
* Copies a `Float32Array`.
*
* @private
* @param {Float32Array} arr - array to copy
* @returns {Float32Array} new array
*/
function float32array( arr ) {
return new Float32Array( arr );
}
/**
* Copies a `Float64Array`.
*
* @private
* @param {Float64Array} arr - array to copy
* @returns {Float64Array} new array
*/
function float64array( arr ) {
return new Float64Array( arr );
}
/**
* Returns a hash of functions for copying typed arrays.
*
* @private
* @returns {Object} function hash
*/
function typedarrays() {
var out = {
'int8array': int8array,
'uint8array': uint8array,
'uint8clampedarray': uint8clampedarray,
'int16array': int16array,
'uint16array': uint16array,
'int32array': int32array,
'uint32array': uint32array,
'float32array': float32array,
'float64array': float64array
};
return out;
}
// MAIN //
hash = typedarrays();
// EXPORTS //
module.exports = hash;
},{"@stdlib/array/float32":2,"@stdlib/array/float64":5,"@stdlib/array/int16":7,"@stdlib/array/int32":10,"@stdlib/array/int8":13,"@stdlib/array/uint16":16,"@stdlib/array/uint32":19,"@stdlib/array/uint8":22,"@stdlib/array/uint8c":25}],295:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Define a non-enumerable read-only accessor.
*
* @module @stdlib/utils/define-nonenumerable-read-only-accessor
*
* @example
* var setNonEnumerableReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );
*
* function getter() {
* return 'bar';
* }
*
* var obj = {};
*
* setNonEnumerableReadOnlyAccessor( obj, 'foo', getter );
*
* try {
* obj.foo = 'boop';
* } catch ( err ) {
* console.error( err.message );
* }
*/
// MODULES //
var setNonEnumerableReadOnlyAccessor = require( './main.js' ); // eslint-disable-line id-length
// EXPORTS //
module.exports = setNonEnumerableReadOnlyAccessor;
},{"./main.js":296}],296:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var defineProperty = require( '@stdlib/utils/define-property' );
// MAIN //
/**
* Defines a non-enumerable read-only accessor.
*
* @param {Object} obj - object on which to define the property
* @param {(string|symbol)} prop - property name
* @param {Function} getter - accessor
*
* @example
* function getter() {
* return 'bar';
* }
*
* var obj = {};
*
* setNonEnumerableReadOnlyAccessor( obj, 'foo', getter );
*
* try {
* obj.foo = 'boop';
* } catch ( err ) {
* console.error( err.message );
* }
*/
function setNonEnumerableReadOnlyAccessor( obj, prop, getter ) { // eslint-disable-line id-length
defineProperty( obj, prop, {
'configurable': false,
'enumerable': false,
'get': getter
});
}
// EXPORTS //
module.exports = setNonEnumerableReadOnlyAccessor;
},{"@stdlib/utils/define-property":302}],297:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Define a non-enumerable read-only property.
*
* @module @stdlib/utils/define-nonenumerable-read-only-property
*
* @example
* var setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
*
* var obj = {};
*
* setNonEnumerableReadOnly( obj, 'foo', 'bar' );
*
* try {
* obj.foo = 'boop';
* } catch ( err ) {
* console.error( err.message );
* }
*/
// MODULES //
var setNonEnumerableReadOnly = require( './main.js' );
// EXPORTS //
module.exports = setNonEnumerableReadOnly;
},{"./main.js":298}],298:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var defineProperty = require( '@stdlib/utils/define-property' );
// MAIN //
/**
* Defines a non-enumerable read-only property.
*
* @param {Object} obj - object on which to define the property
* @param {(string|symbol)} prop - property name
* @param {*} value - value to set
*
* @example
* var obj = {};
*
* setNonEnumerableReadOnly( obj, 'foo', 'bar' );
*
* try {
* obj.foo = 'boop';
* } catch ( err ) {
* console.error( err.message );
* }
*/
function setNonEnumerableReadOnly( obj, prop, value ) {
defineProperty( obj, prop, {
'configurable': false,
'enumerable': false,
'writable': false,
'value': value
});
}
// EXPORTS //
module.exports = setNonEnumerableReadOnly;
},{"@stdlib/utils/define-property":302}],299:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Defines (or modifies) an object property.
*
* ## Notes
*
* - Property descriptors come in two flavors: **data descriptors** and **accessor descriptors**. A data descriptor is a property that has a value, which may or may not be writable. An accessor descriptor is a property described by a getter-setter function pair. A descriptor must be one of these two flavors and cannot be both.
*
* @name defineProperty
* @type {Function}
* @param {Object} obj - object on which to define the property
* @param {(string|symbol)} prop - property name
* @param {Object} descriptor - property descriptor
* @param {boolean} [descriptor.configurable=false] - boolean indicating if property descriptor can be changed and if the property can be deleted from the provided object
* @param {boolean} [descriptor.enumerable=false] - boolean indicating if the property shows up when enumerating object properties
* @param {boolean} [descriptor.writable=false] - boolean indicating if the value associated with the property can be changed with an assignment operator
* @param {*} [descriptor.value] - property value
* @param {(Function|void)} [descriptor.get=undefined] - function which serves as a getter for the property, or, if no getter, undefined. When the property is accessed, a getter function is called without arguments and with the `this` context set to the object through which the property is accessed (which may not be the object on which the property is defined due to inheritance). The return value will be used as the property value.
* @param {(Function|void)} [descriptor.set=undefined] - function which serves as a setter for the property, or, if no setter, undefined. When assigning a property value, a setter function is called with one argument (the value being assigned to the property) and with the `this` context set to the object through which the property is assigned.
* @throws {TypeError} first argument must be an object
* @throws {TypeError} third argument must be an object
* @throws {Error} property descriptor cannot have both a value and a setter and/or getter
* @returns {Object} object with added property
*
* @example
* var obj = {};
*
* defineProperty( obj, 'foo', {
* 'value': 'bar'
* });
*
* var str = obj.foo;
* // returns 'bar'
*/
var defineProperty = Object.defineProperty;
// EXPORTS //
module.exports = defineProperty;
},{}],300:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2021 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var main = ( typeof Object.defineProperty === 'function' ) ? Object.defineProperty : null;
// EXPORTS //
module.exports = main;
},{}],301:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2021 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var defineProperty = require( './define_property.js' );
// MAIN //
/**
* Tests for `Object.defineProperty` support.
*
* @private
* @returns {boolean} boolean indicating if an environment has `Object.defineProperty` support
*
* @example
* var bool = hasDefinePropertySupport();
* // returns <boolean>
*/
function hasDefinePropertySupport() {
// Test basic support...
try {
defineProperty( {}, 'x', {} );
return true;
} catch ( err ) { // eslint-disable-line no-unused-vars
return false;
}
}
// EXPORTS //
module.exports = hasDefinePropertySupport;
},{"./define_property.js":300}],302:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Define (or modify) an object property.
*
* @module @stdlib/utils/define-property
*
* @example
* var defineProperty = require( '@stdlib/utils/define-property' );
*
* var obj = {};
* defineProperty( obj, 'foo', {
* 'value': 'bar',
* 'writable': false,
* 'configurable': false,
* 'enumerable': false
* });
* obj.foo = 'boop'; // => throws
*/
// MODULES //
var hasDefinePropertySupport = require( './has_define_property_support.js' );
var builtin = require( './builtin.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var defineProperty;
if ( hasDefinePropertySupport() ) {
defineProperty = builtin;
} else {
defineProperty = polyfill;
}
// EXPORTS //
module.exports = defineProperty;
},{"./builtin.js":299,"./has_define_property_support.js":301,"./polyfill.js":303}],303:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable no-underscore-dangle, no-proto */
'use strict';
// VARIABLES //
var objectProtoype = Object.prototype;
var toStr = objectProtoype.toString;
var defineGetter = objectProtoype.__defineGetter__;
var defineSetter = objectProtoype.__defineSetter__;
var lookupGetter = objectProtoype.__lookupGetter__;
var lookupSetter = objectProtoype.__lookupSetter__;
// MAIN //
/**
* Defines (or modifies) an object property.
*
* ## Notes
*
* - Property descriptors come in two flavors: **data descriptors** and **accessor descriptors**. A data descriptor is a property that has a value, which may or may not be writable. An accessor descriptor is a property described by a getter-setter function pair. A descriptor must be one of these two flavors and cannot be both.
*
* @param {Object} obj - object on which to define the property
* @param {string} prop - property name
* @param {Object} descriptor - property descriptor
* @param {boolean} [descriptor.configurable=false] - boolean indicating if property descriptor can be changed and if the property can be deleted from the provided object
* @param {boolean} [descriptor.enumerable=false] - boolean indicating if the property shows up when enumerating object properties
* @param {boolean} [descriptor.writable=false] - boolean indicating if the value associated with the property can be changed with an assignment operator
* @param {*} [descriptor.value] - property value
* @param {(Function|void)} [descriptor.get=undefined] - function which serves as a getter for the property, or, if no getter, undefined. When the property is accessed, a getter function is called without arguments and with the `this` context set to the object through which the property is accessed (which may not be the object on which the property is defined due to inheritance). The return value will be used as the property value.
* @param {(Function|void)} [descriptor.set=undefined] - function which serves as a setter for the property, or, if no setter, undefined. When assigning a property value, a setter function is called with one argument (the value being assigned to the property) and with the `this` context set to the object through which the property is assigned.
* @throws {TypeError} first argument must be an object
* @throws {TypeError} third argument must be an object
* @throws {Error} property descriptor cannot have both a value and a setter and/or getter
* @returns {Object} object with added property
*
* @example
* var obj = {};
*
* defineProperty( obj, 'foo', {
* 'value': 'bar'
* });
*
* var str = obj.foo;
* // returns 'bar'
*/
function defineProperty( obj, prop, descriptor ) {
var prototype;
var hasValue;
var hasGet;
var hasSet;
if ( typeof obj !== 'object' || obj === null || toStr.call( obj ) === '[object Array]' ) {
throw new TypeError( 'invalid argument. First argument must be an object. Value: `' + obj + '`.' );
}
if ( typeof descriptor !== 'object' || descriptor === null || toStr.call( descriptor ) === '[object Array]' ) {
throw new TypeError( 'invalid argument. Property descriptor must be an object. Value: `' + descriptor + '`.' );
}
hasValue = ( 'value' in descriptor );
if ( hasValue ) {
if (
lookupGetter.call( obj, prop ) ||
lookupSetter.call( obj, prop )
) {
// Override `__proto__` to avoid touching inherited accessors:
prototype = obj.__proto__;
obj.__proto__ = objectProtoype;
// Delete property as existing getters/setters prevent assigning value to specified property:
delete obj[ prop ];
obj[ prop ] = descriptor.value;
// Restore original prototype:
obj.__proto__ = prototype;
} else {
obj[ prop ] = descriptor.value;
}
}
hasGet = ( 'get' in descriptor );
hasSet = ( 'set' in descriptor );
if ( hasValue && ( hasGet || hasSet ) ) {
throw new Error( 'invalid argument. Cannot specify one or more accessors and a value or writable attribute in the property descriptor.' );
}
if ( hasGet && defineGetter ) {
defineGetter.call( obj, prop, descriptor.get );
}
if ( hasSet && defineSetter ) {
defineSetter.call( obj, prop, descriptor.set );
}
return obj;
}
// EXPORTS //
module.exports = defineProperty;
},{}],304:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Escape a regular expression string or pattern.
*
* @module @stdlib/utils/escape-regexp-string
*
* @example
* var rescape = require( '@stdlib/utils/escape-regexp-string' );
*
* var str = rescape( '[A-Z]*' );
* // returns '\\[A\\-Z\\]\\*'
*/
// MODULES //
var rescape = require( './main.js' );
// EXPORTS //
module.exports = rescape;
},{"./main.js":305}],305:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
// VARIABLES //
var RE_CHARS = /[-\/\\^$*+?.()|[\]{}]/g; // eslint-disable-line no-useless-escape
// MAIN //
/**
* Escapes a regular expression string.
*
* @param {string} str - regular expression string
* @throws {TypeError} first argument must be a string primitive
* @returns {string} escaped string
*
* @example
* var str = rescape( '[A-Z]*' );
* // returns '\\[A\\-Z\\]\\*'
*/
function rescape( str ) {
var len;
var s;
var i;
if ( !isString( str ) ) {
throw new TypeError( 'invalid argument. Must provide a regular expression string. Value: `' + str + '`.' );
}
// Check if the string starts with a forward slash...
if ( str[ 0 ] === '/' ) {
// Find the last forward slash...
len = str.length;
for ( i = len-1; i >= 0; i-- ) {
if ( str[ i ] === '/' ) {
break;
}
}
}
// If we searched the string to no avail or if the first letter is not `/`, assume that the string is not of the form `/[...]/[guimy]`:
if ( i === void 0 || i <= 0 ) {
return str.replace( RE_CHARS, '\\$&' );
}
// We need to de-construct the string...
s = str.substring( 1, i );
// Only escape the characters between the `/`:
s = s.replace( RE_CHARS, '\\$&' );
// Reassemble:
str = str[ 0 ] + s + str.substring( i );
return str;
}
// EXPORTS //
module.exports = rescape;
},{"@stdlib/assert/is-string":149}],306:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var bench = require( '@stdlib/bench' );
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var pkg = require( './../package.json' ).name;
var everyBy = require( './../lib' );
// MAIN //
bench( pkg, function benchmark( b ) {
var bool;
var arr;
var i;
function predicate( v ) {
return !isnan( v );
}
b.tic();
for ( i = 0; i < b.iterations; i++ ) {
arr = [ i, i+1, i+2, i+3, i+4 ];
bool = everyBy( arr, predicate );
if ( !isBoolean( bool ) ) {
b.fail( 'should return a boolean' );
}
}
b.toc();
if ( !isBoolean( bool ) ) {
b.fail( 'should return a boolean' );
}
b.pass( 'benchmark finished' );
b.end();
});
bench( pkg+'::built-in', function benchmark( b ) {
var bool;
var arr;
var i;
function predicate( v ) {
return !isnan( v );
}
b.tic();
for ( i = 0; i < b.iterations; i++ ) {
arr = [ i, i+1, i+2, i+3, i+4 ];
bool = arr.every( predicate );
if ( !isBoolean( bool ) ) {
b.fail( 'should return a boolean' );
}
}
b.toc();
if ( !isBoolean( bool ) ) {
b.fail( 'should return a boolean' );
}
b.pass( 'benchmark finished' );
b.end();
});
bench( pkg+'::loop', function benchmark( b ) {
var bool;
var arr;
var i;
var j;
b.tic();
for ( i = 0; i < b.iterations; i++ ) {
arr = [ i, i+1, i+2, i+3, i+4 ];
bool = true;
for ( j = 0; j < arr.length; j++ ) {
if ( isnan( arr[ j ] ) ) {
bool = false;
break;
}
}
if ( !isBoolean( bool ) ) {
b.fail( 'should be a boolean' );
}
}
b.toc();
if ( !isBoolean( bool ) ) {
b.fail( 'should be a boolean' );
}
b.pass( 'benchmark finished' );
b.end();
});
},{"./../lib":308,"./../package.json":309,"@stdlib/assert/is-boolean":72,"@stdlib/bench":211,"@stdlib/math/base/assert/is-nan":239}],307:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isCollection = require( '@stdlib/assert/is-collection' );
var isFunction = require( '@stdlib/assert/is-function' );
// MAIN //
/**
* Tests whether all elements in a collection pass a test implemented by a predicate function.
*
* @param {Collection} collection - input collection
* @param {Function} predicate - test function
* @param {*} [thisArg] - execution context
* @throws {TypeError} first argument must be a collection
* @throws {TypeError} second argument must be a function
* @returns {boolean} boolean indicating whether all elements pass a test
*
* @example
* function isPositive( v ) {
* return ( v > 0 );
* }
*
* var arr = [ 1, 2, 3, 4 ];
*
* var bool = everyBy( arr, isPositive );
* // returns true
*/
function everyBy( collection, predicate, thisArg ) {
var out;
var len;
var i;
if ( !isCollection( collection ) ) {
throw new TypeError( 'invalid argument. First argument must be a collection. Value: `'+collection+'`.' );
}
if ( !isFunction( predicate ) ) {
throw new TypeError( 'invalid argument. Second argument must be a function. Value: `'+predicate+'`.' );
}
len = collection.length;
for ( i = 0; i < len; i++ ) {
out = predicate.call( thisArg, collection[ i ], i, collection );
if ( !out ) {
return false;
}
// Account for dynamically resizing a collection:
len = collection.length;
}
return true;
}
// EXPORTS //
module.exports = everyBy;
},{"@stdlib/assert/is-collection":81,"@stdlib/assert/is-function":93}],308:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test whether all elements in a collection pass a test implemented by a predicate function.
*
* @module @stdlib/utils/every-by
*
* @example
* var every = require( '@stdlib/utils/every-by' );
*
* function isPositive( v ) {
* return ( v > 0 );
* }
*
* var arr = [ 1, 2, 3, 4 ];
*
* var bool = everyBy( arr, isPositive );
* // returns true
*/
// MODULES //
var everyBy = require( './every_by.js' );
// EXPORTS //
module.exports = everyBy;
},{"./every_by.js":307}],309:[function(require,module,exports){
module.exports={
"name": "@stdlib/utils/every-by",
"version": "0.0.0",
"description": "Test whether all elements in a collection pass a test implemented by a predicate function.",
"license": "Apache-2.0",
"author": {
"name": "The Stdlib Authors",
"url": "https://github.com/stdlib-js/stdlib/graphs/contributors"
},
"contributors": [
{
"name": "The Stdlib Authors",
"url": "https://github.com/stdlib-js/stdlib/graphs/contributors"
}
],
"main": "./lib",
"directories": {
"benchmark": "./benchmark",
"doc": "./docs",
"example": "./examples",
"lib": "./lib",
"test": "./test"
},
"types": "./docs/types",
"scripts": {},
"homepage": "https://github.com/stdlib-js/stdlib",
"repository": {
"type": "git",
"url": "git://github.com/stdlib-js/stdlib.git"
},
"bugs": {
"url": "https://github.com/stdlib-js/stdlib/issues"
},
"dependencies": {},
"devDependencies": {},
"engines": {
"node": ">=0.10.0",
"npm": ">2.7.0"
},
"os": [
"aix",
"darwin",
"freebsd",
"linux",
"macos",
"openbsd",
"sunos",
"win32",
"windows"
],
"keywords": [
"stdlib",
"stdutils",
"stdutil",
"utilities",
"utility",
"utils",
"util",
"test",
"predicate",
"every",
"all",
"array.every",
"iterate",
"collection",
"array-like",
"validate"
]
}
},{}],310:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isFunction = require( '@stdlib/assert/is-function' );
var builtin = require( './native.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var getProto;
if ( isFunction( Object.getPrototypeOf ) ) {
getProto = builtin;
} else {
getProto = polyfill;
}
// EXPORTS //
module.exports = getProto;
},{"./native.js":313,"./polyfill.js":314,"@stdlib/assert/is-function":93}],311:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var getProto = require( './detect.js' );
// MAIN //
/**
* Returns the prototype of a provided object.
*
* @param {*} value - input value
* @returns {(Object|null)} prototype
*
* @example
* var proto = getPrototypeOf( {} );
* // returns {}
*/
function getPrototypeOf( value ) {
if (
value === null ||
value === void 0
) {
return null;
}
// In order to ensure consistent ES5/ES6 behavior, cast input value to an object (strings, numbers, booleans); ES5 `Object.getPrototypeOf` throws when provided primitives and ES6 `Object.getPrototypeOf` casts:
value = Object( value );
return getProto( value );
}
// EXPORTS //
module.exports = getPrototypeOf;
},{"./detect.js":310}],312:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Return the prototype of a provided object.
*
* @module @stdlib/utils/get-prototype-of
*
* @example
* var getPrototype = require( '@stdlib/utils/get-prototype-of' );
*
* var proto = getPrototype( {} );
* // returns {}
*/
// MODULES //
var getPrototype = require( './get_prototype_of.js' );
// EXPORTS //
module.exports = getPrototype;
},{"./get_prototype_of.js":311}],313:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var getProto = Object.getPrototypeOf;
// EXPORTS //
module.exports = getProto;
},{}],314:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var nativeClass = require( '@stdlib/utils/native-class' );
var getProto = require( './proto.js' );
// MAIN //
/**
* Returns the prototype of a provided object.
*
* @private
* @param {Object} obj - input object
* @returns {(Object|null)} prototype
*/
function getPrototypeOf( obj ) {
var proto = getProto( obj );
if ( proto || proto === null ) {
return proto;
}
if ( nativeClass( obj.constructor ) === '[object Function]' ) {
// May break if the constructor has been tampered with...
return obj.constructor.prototype;
}
if ( obj instanceof Object ) {
return Object.prototype;
}
// Return `null` for objects created via `Object.create( null )`. Also return `null` for cross-realm objects on browsers that lack `__proto__` support, such as IE < 11.
return null;
}
// EXPORTS //
module.exports = getPrototypeOf;
},{"./proto.js":315,"@stdlib/utils/native-class":346}],315:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Returns the value of the `__proto__` property.
*
* @private
* @param {Object} obj - input object
* @returns {*} value of `__proto__` property
*/
function getProto( obj ) {
// eslint-disable-next-line no-proto
return obj.__proto__;
}
// EXPORTS //
module.exports = getProto;
},{}],316:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Returns the global object using code generation.
*
* @private
* @returns {Object} global object
*/
function getGlobal() {
return new Function( 'return this;' )(); // eslint-disable-line no-new-func
}
// EXPORTS //
module.exports = getGlobal;
},{}],317:[function(require,module,exports){
(function (global){(function (){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var obj = ( typeof global === 'object' ) ? global : null;
// EXPORTS //
module.exports = obj;
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}],318:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Return the global object.
*
* @module @stdlib/utils/global
*
* @example
* var getGlobal = require( '@stdlib/utils/global' );
*
* var g = getGlobal();
* // returns {...}
*/
// MODULES //
var getGlobal = require( './main.js' );
// EXPORTS //
module.exports = getGlobal;
},{"./main.js":319}],319:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var getThis = require( './codegen.js' );
var Self = require( './self.js' );
var Win = require( './window.js' );
var Global = require( './global.js' );
// MAIN //
/**
* Returns the global object.
*
* ## Notes
*
* - Using code generation is the **most** reliable way to resolve the global object; however, doing so is likely to violate content security policies (CSPs) in, e.g., Chrome Apps and elsewhere.
*
* @param {boolean} [codegen=false] - boolean indicating whether to use code generation to resolve the global object
* @throws {TypeError} must provide a boolean
* @throws {Error} unable to resolve global object
* @returns {Object} global object
*
* @example
* var g = getGlobal();
* // returns {...}
*/
function getGlobal( codegen ) {
if ( arguments.length ) {
if ( !isBoolean( codegen ) ) {
throw new TypeError( 'invalid argument. Must provide a boolean primitive. Value: `'+codegen+'`.' );
}
if ( codegen ) {
return getThis();
}
// Fall through...
}
// Case: browsers and web workers
if ( Self ) {
return Self;
}
// Case: browsers
if ( Win ) {
return Win;
}
// Case: Node.js
if ( Global ) {
return Global;
}
// Case: unknown
throw new Error( 'unexpected error. Unable to resolve global object.' );
}
// EXPORTS //
module.exports = getGlobal;
},{"./codegen.js":316,"./global.js":317,"./self.js":320,"./window.js":321,"@stdlib/assert/is-boolean":72}],320:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var obj = ( typeof self === 'object' ) ? self : null;
// EXPORTS //
module.exports = obj;
},{}],321:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var obj = ( typeof window === 'object' ) ? window : null;
// EXPORTS //
module.exports = obj;
},{}],322:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Return the first index at which a given element can be found.
*
* @module @stdlib/utils/index-of
*
* @example
* var indexOf = require( '@stdlib/utils/index-of' );
*
* var arr = [ 4, 3, 2, 1 ];
* var idx = indexOf( arr, 3 );
* // returns 1
*
* arr = [ 4, 3, 2, 1 ];
* idx = indexOf( arr, 5 );
* // returns -1
*
* // Using a `fromIndex`:
* arr = [ 1, 2, 3, 4, 5, 2, 6 ];
* idx = indexOf( arr, 2, 3 );
* // returns 5
*
* // `fromIndex` which exceeds `array` length:
* arr = [ 1, 2, 3, 4, 2, 5 ];
* idx = indexOf( arr, 2, 10 );
* // returns -1
*
* // Negative `fromIndex`:
* arr = [ 1, 2, 3, 4, 5, 2, 6, 2 ];
* idx = indexOf( arr, 2, -4 );
* // returns 5
*
* idx = indexOf( arr, 2, -1 );
* // returns 7
*
* // Negative `fromIndex` exceeding input `array` length:
* arr = [ 1, 2, 3, 4, 5, 2, 6 ];
* idx = indexOf( arr, 2, -10 );
* // returns 1
*
* // Array-like objects:
* var str = 'bebop';
* idx = indexOf( str, 'o' );
* // returns 3
*/
// MODULES //
var indexOf = require( './index_of.js' );
// EXPORTS //
module.exports = indexOf;
},{"./index_of.js":323}],323:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isnan = require( '@stdlib/assert/is-nan' );
var isCollection = require( '@stdlib/assert/is-collection' );
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive;
// MAIN //
/**
* Returns the first index at which a given element can be found.
*
* @param {ArrayLike} arr - array-like object
* @param {*} searchElement - element to find
* @param {integer} [fromIndex] - starting index (if negative, the start index is determined relative to last element)
* @throws {TypeError} must provide an array-like object
* @throws {TypeError} `fromIndex` must be an integer
* @returns {integer} index or -1
*
* @example
* var arr = [ 4, 3, 2, 1 ];
* var idx = indexOf( arr, 3 );
* // returns 1
*
* @example
* var arr = [ 4, 3, 2, 1 ];
* var idx = indexOf( arr, 5 );
* // returns -1
*
* @example
* // Using a `fromIndex`:
* var arr = [ 1, 2, 3, 4, 5, 2, 6 ];
* var idx = indexOf( arr, 2, 3 );
* // returns 5
*
* @example
* // `fromIndex` which exceeds `array` length:
* var arr = [ 1, 2, 3, 4, 2, 5 ];
* var idx = indexOf( arr, 2, 10 );
* // returns -1
*
* @example
* // Negative `fromIndex`:
* var arr = [ 1, 2, 3, 4, 5, 2, 6, 2 ];
* var idx = indexOf( arr, 2, -4 );
* // returns 5
*
* idx = indexOf( arr, 2, -1 );
* // returns 7
*
* @example
* // Negative `fromIndex` exceeding input `array` length:
* var arr = [ 1, 2, 3, 4, 5, 2, 6 ];
* var idx = indexOf( arr, 2, -10 );
* // returns 1
*
* @example
* // Array-like objects:
* var str = 'bebop';
* var idx = indexOf( str, 'o' );
* // returns 3
*/
function indexOf( arr, searchElement, fromIndex ) {
var len;
var i;
if ( !isCollection( arr ) && !isString( arr ) ) {
throw new TypeError( 'invalid argument. First argument must be an array-like object. Value: `' + arr + '`.' );
}
len = arr.length;
if ( len === 0 ) {
return -1;
}
if ( arguments.length === 3 ) {
if ( !isInteger( fromIndex ) ) {
throw new TypeError( 'invalid argument. `fromIndex` must be an integer. Value: `' + fromIndex + '`.' );
}
if ( fromIndex >= 0 ) {
if ( fromIndex >= len ) {
return -1;
}
i = fromIndex;
} else {
i = len + fromIndex;
if ( i < 0 ) {
i = 0;
}
}
} else {
i = 0;
}
// Check for `NaN`...
if ( isnan( searchElement ) ) {
for ( ; i < len; i++ ) {
if ( isnan( arr[i] ) ) {
return i;
}
}
} else {
for ( ; i < len; i++ ) {
if ( arr[ i ] === searchElement ) {
return i;
}
}
}
return -1;
}
// EXPORTS //
module.exports = indexOf;
},{"@stdlib/assert/is-collection":81,"@stdlib/assert/is-integer":101,"@stdlib/assert/is-nan":109,"@stdlib/assert/is-string":149}],324:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var builtin = require( './native.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var createObject;
if ( typeof builtin === 'function' ) {
createObject = builtin;
} else {
createObject = polyfill;
}
// EXPORTS //
module.exports = createObject;
},{"./native.js":327,"./polyfill.js":328}],325:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Implement prototypical inheritance by replacing the prototype of one constructor with the prototype of another constructor.
*
* @module @stdlib/utils/inherit
*
* @example
* var inherit = require( '@stdlib/utils/inherit' );
*
* function Foo() {
* return this;
* }
* Foo.prototype.beep = function beep() {
* return 'boop';
* };
*
* function Bar() {
* Foo.call( this );
* return this;
* }
* inherit( Bar, Foo );
*
* var bar = new Bar();
* var v = bar.beep();
* // returns 'boop'
*/
// MODULES //
var inherit = require( './inherit.js' );
// EXPORTS //
module.exports = inherit;
},{"./inherit.js":326}],326:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var defineProperty = require( '@stdlib/utils/define-property' );
var validate = require( './validate.js' );
var createObject = require( './detect.js' );
// MAIN //
/**
* Implements prototypical inheritance by replacing the prototype of one constructor with the prototype of another constructor.
*
* ## Notes
*
* - This implementation is not designed to work with ES2015/ES6 classes. For ES2015/ES6 classes, use `class` with `extends`.
* - For reference, see [node#3455](https://github.com/nodejs/node/pull/3455), [node#4179](https://github.com/nodejs/node/issues/4179), [node#3452](https://github.com/nodejs/node/issues/3452), and [node commit](https://github.com/nodejs/node/commit/29da8cf8d7ab8f66b9091ab22664067d4468461e#diff-3deb3f32958bb937ae05c6f3e4abbdf5).
*
*
* @param {(Object|Function)} ctor - constructor which will inherit
* @param {(Object|Function)} superCtor - super (parent) constructor
* @throws {TypeError} first argument must be either an object or a function which can inherit
* @throws {TypeError} second argument must be either an object or a function from which a constructor can inherit
* @throws {TypeError} second argument must have an inheritable prototype
* @returns {(Object|Function)} child constructor
*
* @example
* function Foo() {
* return this;
* }
* Foo.prototype.beep = function beep() {
* return 'boop';
* };
*
* function Bar() {
* Foo.call( this );
* return this;
* }
* inherit( Bar, Foo );
*
* var bar = new Bar();
* var v = bar.beep();
* // returns 'boop'
*/
function inherit( ctor, superCtor ) {
var err = validate( ctor );
if ( err ) {
throw err;
}
err = validate( superCtor );
if ( err ) {
throw err;
}
if ( typeof superCtor.prototype === 'undefined' ) {
throw new TypeError( 'invalid argument. Second argument must have a prototype from which another object can inherit. Value: `'+superCtor.prototype+'`.' );
}
// Create a prototype which inherits from the parent prototype:
ctor.prototype = createObject( superCtor.prototype );
// Set the constructor to refer to the child constructor:
defineProperty( ctor.prototype, 'constructor', {
'configurable': true,
'enumerable': false,
'writable': true,
'value': ctor
});
return ctor;
}
// EXPORTS //
module.exports = inherit;
},{"./detect.js":324,"./validate.js":329,"@stdlib/utils/define-property":302}],327:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// EXPORTS //
module.exports = Object.create;
},{}],328:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// FUNCTIONS //
/**
* Dummy constructor.
*
* @private
*/
function Ctor() {
// Empty...
}
// MAIN //
/**
* An `Object.create` shim for older JavaScript engines.
*
* @private
* @param {Object} proto - prototype
* @returns {Object} created object
*
* @example
* var obj = createObject( Object.prototype );
* // returns {}
*/
function createObject( proto ) {
Ctor.prototype = proto;
return new Ctor();
}
// EXPORTS //
module.exports = createObject;
},{}],329:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Tests that a value is a valid constructor.
*
* @private
* @param {*} value - value to test
* @returns {(Error|null)} error object or null
*
* @example
* var ctor = function ctor() {};
*
* var err = validate( ctor );
* // returns null
*
* err = validate( null );
* // returns <TypeError>
*/
function validate( value ) {
var type = typeof value;
if (
value === null ||
(type !== 'object' && type !== 'function')
) {
return new TypeError( 'invalid argument. A provided constructor must be either an object (except null) or a function. Value: `'+value+'`.' );
}
return null;
}
// EXPORTS //
module.exports = validate;
},{}],330:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Returns an array of an object's own enumerable property names.
*
* ## Notes
*
* - In contrast to the built-in `Object.keys()`, this function returns an empty array if provided `undefined` or `null`, rather than throwing an error.
*
* @private
* @param {*} value - input object
* @returns {Array} a list of own enumerable property names
*
* @example
* var obj = {
* 'beep': 'boop',
* 'foo': 3.14
* };
*
* var k = keys( obj );
* // e.g., returns [ 'beep', 'foo' ]
*/
function keys( value ) {
return Object.keys( Object( value ) );
}
// EXPORTS //
module.exports = keys;
},{}],331:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isArguments = require( '@stdlib/assert/is-arguments' );
var builtin = require( './builtin.js' );
// VARIABLES //
var slice = Array.prototype.slice;
// MAIN //
/**
* Returns an array of an object's own enumerable property names.
*
* @private
* @param {*} value - input object
* @returns {Array} a list of own enumerable property names
*
* @example
* var obj = {
* 'beep': 'boop',
* 'foo': 3.14
* };
*
* var k = keys( obj );
* // e.g., returns [ 'beep', 'foo' ]
*/
function keys( value ) {
if ( isArguments( value ) ) {
return builtin( slice.call( value ) );
}
return builtin( value );
}
// EXPORTS //
module.exports = keys;
},{"./builtin.js":330,"@stdlib/assert/is-arguments":65}],332:[function(require,module,exports){
module.exports=[
"console",
"external",
"frame",
"frameElement",
"frames",
"innerHeight",
"innerWidth",
"outerHeight",
"outerWidth",
"pageXOffset",
"pageYOffset",
"parent",
"scrollLeft",
"scrollTop",
"scrollX",
"scrollY",
"self",
"webkitIndexedDB",
"webkitStorageInfo",
"window"
]
},{}],333:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var keys = require( './builtin.js' );
// FUNCTIONS //
/**
* Tests the built-in `Object.keys()` implementation when provided `arguments`.
*
* @private
* @returns {boolean} boolean indicating whether the built-in implementation returns the expected number of keys
*/
function test() {
return ( keys( arguments ) || '' ).length !== 2;
}
// MAIN //
/**
* Tests whether the built-in `Object.keys()` implementation supports providing `arguments` as an input value.
*
* ## Notes
*
* - Safari 5.0 does **not** support `arguments` as an input value.
*
* @private
* @returns {boolean} boolean indicating whether a built-in implementation supports `arguments`
*/
function check() {
return test( 1, 2 );
}
// EXPORTS //
module.exports = check;
},{"./builtin.js":330}],334:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var indexOf = require( '@stdlib/utils/index-of' );
var typeOf = require( '@stdlib/utils/type-of' );
var isConstructorPrototype = require( './is_constructor_prototype.js' );
var EXCLUDED_KEYS = require( './excluded_keys.json' );
var win = require( './window.js' );
// VARIABLES //
var bool;
// FUNCTIONS //
/**
* Determines whether an environment throws when comparing to the prototype of a value's constructor (e.g., [IE9][1]).
*
* [1]: https://stackoverflow.com/questions/7688070/why-is-comparing-the-constructor-property-of-two-windows-unreliable
*
* @private
* @returns {boolean} boolean indicating whether an environment is buggy
*/
function check() {
var k;
if ( typeOf( win ) === 'undefined' ) {
return false;
}
for ( k in win ) { // eslint-disable-line guard-for-in
try {
if (
indexOf( EXCLUDED_KEYS, k ) === -1 &&
hasOwnProp( win, k ) &&
win[ k ] !== null &&
typeOf( win[ k ] ) === 'object'
) {
isConstructorPrototype( win[ k ] );
}
} catch ( err ) { // eslint-disable-line no-unused-vars
return true;
}
}
return false;
}
// MAIN //
bool = check();
// EXPORTS //
module.exports = bool;
},{"./excluded_keys.json":332,"./is_constructor_prototype.js":340,"./window.js":345,"@stdlib/assert/has-own-property":46,"@stdlib/utils/index-of":322,"@stdlib/utils/type-of":373}],335:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var bool = ( typeof Object.keys !== 'undefined' );
// EXPORTS //
module.exports = bool;
},{}],336:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isEnumerableProperty = require( '@stdlib/assert/is-enumerable-property' );
var noop = require( '@stdlib/utils/noop' );
// MAIN //
// Note: certain environments treat an object's prototype as enumerable, which, as a matter of convention, it shouldn't be...
var bool = isEnumerableProperty( noop, 'prototype' );
// EXPORTS //
module.exports = bool;
},{"@stdlib/assert/is-enumerable-property":84,"@stdlib/utils/noop":353}],337:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isEnumerableProperty = require( '@stdlib/assert/is-enumerable-property' );
// VARIABLES //
var obj = {
'toString': null
};
// MAIN //
// Note: certain environments don't allow enumeration of overwritten properties which are considered non-enumerable...
var bool = !isEnumerableProperty( obj, 'toString' );
// EXPORTS //
module.exports = bool;
},{"@stdlib/assert/is-enumerable-property":84}],338:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var bool = ( typeof window !== 'undefined' );
// EXPORTS //
module.exports = bool;
},{}],339:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Return an array of an object's own enumerable property names.
*
* @module @stdlib/utils/keys
*
* @example
* var keys = require( '@stdlib/utils/keys' );
*
* var obj = {
* 'beep': 'boop',
* 'foo': 3.14
* };
*
* var k = keys( obj );
* // e.g., returns [ 'beep', 'foo' ]
*/
// MODULES //
var keys = require( './main.js' );
// EXPORTS //
module.exports = keys;
},{"./main.js":342}],340:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Tests whether a value equals the prototype of its constructor.
*
* @private
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether a value equals the prototype of its constructor
*/
function isConstructorPrototype( value ) {
return ( value.constructor && value.constructor.prototype === value );
}
// EXPORTS //
module.exports = isConstructorPrototype;
},{}],341:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var hasAutomationEqualityBug = require( './has_automation_equality_bug.js' );
var isConstructorPrototype = require( './is_constructor_prototype.js' );
var HAS_WINDOW = require( './has_window.js' );
// MAIN //
/**
* Wraps the test for constructor prototype equality to accommodate buggy environments (e.g., environments which throw when testing equality).
*
* @private
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether a value equals the prototype of its constructor
*/
function wrapper( value ) {
if ( HAS_WINDOW === false && !hasAutomationEqualityBug ) {
return isConstructorPrototype( value );
}
try {
return isConstructorPrototype( value );
} catch ( error ) { // eslint-disable-line no-unused-vars
return false;
}
}
// EXPORTS //
module.exports = wrapper;
},{"./has_automation_equality_bug.js":334,"./has_window.js":338,"./is_constructor_prototype.js":340}],342:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var hasArgumentsBug = require( './has_arguments_bug.js' );
var HAS_BUILTIN = require( './has_builtin.js' );
var builtin = require( './builtin.js' );
var wrapper = require( './builtin_wrapper.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
/**
* Returns an array of an object's own enumerable property names.
*
* @name keys
* @type {Function}
* @param {*} value - input object
* @returns {Array} a list of own enumerable property names
*
* @example
* var obj = {
* 'beep': 'boop',
* 'foo': 3.14
* };
*
* var k = keys( obj );
* // e.g., returns [ 'beep', 'foo' ]
*/
var keys;
if ( HAS_BUILTIN ) {
if ( hasArgumentsBug() ) {
keys = wrapper;
} else {
keys = builtin;
}
} else {
keys = polyfill;
}
// EXPORTS //
module.exports = keys;
},{"./builtin.js":330,"./builtin_wrapper.js":331,"./has_arguments_bug.js":333,"./has_builtin.js":335,"./polyfill.js":344}],343:[function(require,module,exports){
module.exports=[
"toString",
"toLocaleString",
"valueOf",
"hasOwnProperty",
"isPrototypeOf",
"propertyIsEnumerable",
"constructor"
]
},{}],344:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isObjectLike = require( '@stdlib/assert/is-object-like' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var isArguments = require( '@stdlib/assert/is-arguments' );
var HAS_ENUM_PROTO_BUG = require( './has_enumerable_prototype_bug.js' );
var HAS_NON_ENUM_PROPS_BUG = require( './has_non_enumerable_properties_bug.js' );
var isConstructorPrototype = require( './is_constructor_prototype_wrapper.js' );
var NON_ENUMERABLE = require( './non_enumerable.json' );
// MAIN //
/**
* Returns an array of an object's own enumerable property names.
*
* @private
* @param {*} value - input object
* @returns {Array} a list of own enumerable property names
*
* @example
* var obj = {
* 'beep': 'boop',
* 'foo': 3.14
* };
*
* var k = keys( obj );
* // e.g., returns [ 'beep', 'foo' ]
*/
function keys( value ) {
var skipConstructor;
var skipPrototype;
var isFcn;
var out;
var k;
var p;
var i;
out = [];
if ( isArguments( value ) ) {
// Account for environments which treat `arguments` differently...
for ( i = 0; i < value.length; i++ ) {
out.push( i.toString() );
}
// Note: yes, we are precluding the `arguments` array-like object from having other enumerable properties; however, this should (1) be very rare and (2) not be encouraged (e.g., doing something like `arguments.a = 'b'`; in certain engines directly manipulating the `arguments` value results in automatic de-optimization).
return out;
}
if ( typeof value === 'string' ) {
// Account for environments which do not treat string character indices as "own" properties...
if ( value.length > 0 && !hasOwnProp( value, '0' ) ) {
for ( i = 0; i < value.length; i++ ) {
out.push( i.toString() );
}
}
} else {
isFcn = ( typeof value === 'function' );
if ( isFcn === false && !isObjectLike( value ) ) {
return out;
}
skipPrototype = ( HAS_ENUM_PROTO_BUG && isFcn );
}
for ( k in value ) {
if ( !( skipPrototype && k === 'prototype' ) && hasOwnProp( value, k ) ) {
out.push( String( k ) );
}
}
if ( HAS_NON_ENUM_PROPS_BUG ) {
skipConstructor = isConstructorPrototype( value );
for ( i = 0; i < NON_ENUMERABLE.length; i++ ) {
p = NON_ENUMERABLE[ i ];
if ( !( skipConstructor && p === 'constructor' ) && hasOwnProp( value, p ) ) {
out.push( String( p ) );
}
}
}
return out;
}
// EXPORTS //
module.exports = keys;
},{"./has_enumerable_prototype_bug.js":336,"./has_non_enumerable_properties_bug.js":337,"./is_constructor_prototype_wrapper.js":341,"./non_enumerable.json":343,"@stdlib/assert/has-own-property":46,"@stdlib/assert/is-arguments":65,"@stdlib/assert/is-object-like":134}],345:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var w = ( typeof window === 'undefined' ) ? void 0 : window;
// EXPORTS //
module.exports = w;
},{}],346:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Return a string value indicating a specification defined classification of an object.
*
* @module @stdlib/utils/native-class
*
* @example
* var nativeClass = require( '@stdlib/utils/native-class' );
*
* var str = nativeClass( 'a' );
* // returns '[object String]'
*
* str = nativeClass( 5 );
* // returns '[object Number]'
*
* function Beep() {
* return this;
* }
* str = nativeClass( new Beep() );
* // returns '[object Object]'
*/
// MODULES //
var hasToStringTag = require( '@stdlib/assert/has-tostringtag-support' );
var builtin = require( './native_class.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var nativeClass;
if ( hasToStringTag() ) {
nativeClass = polyfill;
} else {
nativeClass = builtin;
}
// EXPORTS //
module.exports = nativeClass;
},{"./native_class.js":347,"./polyfill.js":348,"@stdlib/assert/has-tostringtag-support":50}],347:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var toStr = require( './tostring.js' );
// MAIN //
/**
* Returns a string value indicating a specification defined classification (via the internal property `[[Class]]`) of an object.
*
* @param {*} v - input value
* @returns {string} string value indicating a specification defined classification of the input value
*
* @example
* var str = nativeClass( 'a' );
* // returns '[object String]'
*
* @example
* var str = nativeClass( 5 );
* // returns '[object Number]'
*
* @example
* function Beep() {
* return this;
* }
* var str = nativeClass( new Beep() );
* // returns '[object Object]'
*/
function nativeClass( v ) {
return toStr.call( v );
}
// EXPORTS //
module.exports = nativeClass;
},{"./tostring.js":349}],348:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var toStringTag = require( './tostringtag.js' );
var toStr = require( './tostring.js' );
// MAIN //
/**
* Returns a string value indicating a specification defined classification of an object in environments supporting `Symbol.toStringTag`.
*
* @param {*} v - input value
* @returns {string} string value indicating a specification defined classification of the input value
*
* @example
* var str = nativeClass( 'a' );
* // returns '[object String]'
*
* @example
* var str = nativeClass( 5 );
* // returns '[object Number]'
*
* @example
* function Beep() {
* return this;
* }
* var str = nativeClass( new Beep() );
* // returns '[object Object]'
*/
function nativeClass( v ) {
var isOwn;
var tag;
var out;
if ( v === null || v === void 0 ) {
return toStr.call( v );
}
tag = v[ toStringTag ];
isOwn = hasOwnProp( v, toStringTag );
// Attempt to override the `toStringTag` property. For built-ins having a `Symbol.toStringTag` property (e.g., `JSON`, `Math`, etc), the `Symbol.toStringTag` property is read-only (e.g., , so we need to wrap in a `try/catch`.
try {
v[ toStringTag ] = void 0;
} catch ( err ) { // eslint-disable-line no-unused-vars
return toStr.call( v );
}
out = toStr.call( v );
if ( isOwn ) {
v[ toStringTag ] = tag;
} else {
delete v[ toStringTag ];
}
return out;
}
// EXPORTS //
module.exports = nativeClass;
},{"./tostring.js":349,"./tostringtag.js":350,"@stdlib/assert/has-own-property":46}],349:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var toStr = Object.prototype.toString;
// EXPORTS //
module.exports = toStr;
},{}],350:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var toStrTag = ( typeof Symbol === 'function' ) ? Symbol.toStringTag : '';
// EXPORTS //
module.exports = toStrTag;
},{}],351:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2020 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Add a callback to the "next tick queue".
*
* @module @stdlib/utils/next-tick
*
* @example
* var nextTick = require( '@stdlib/utils/next-tick' );
*
* function beep() {
* console.log( 'boop' );
* }
*
* nextTick( beep );
*/
// MODULES //
var nextTick = require( './main.js' );
// EXPORTS //
module.exports = nextTick;
},{"./main.js":352}],352:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2020 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var proc = require( 'process' );
// MAIN //
/**
* Adds a callback to the "next tick queue".
*
* ## Notes
*
* - The queue is fully drained after the current operation on the JavaScript stack runs to completion and before the event loop is allowed to continue.
*
* @param {Callback} clbk - callback
* @param {...*} [args] - arguments to provide to the callback upon invocation
*
* @example
* function beep() {
* console.log( 'boop' );
* }
*
* nextTick( beep );
*/
function nextTick( clbk ) {
var args;
var i;
args = [];
for ( i = 1; i < arguments.length; i++ ) {
args.push( arguments[ i ] );
}
proc.nextTick( wrapper );
/**
* Callback wrapper.
*
* ## Notes
*
* - The ability to provide additional arguments was added in Node.js v1.8.1. The wrapper provides support for earlier Node.js versions.
*
* @private
*/
function wrapper() {
clbk.apply( null, args );
}
}
// EXPORTS //
module.exports = nextTick;
},{"process":389}],353:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* No operation.
*
* @module @stdlib/utils/noop
*
* @example
* var noop = require( '@stdlib/utils/noop' );
*
* noop();
* // ...does nothing.
*/
// MODULES //
var noop = require( './noop.js' );
// EXPORTS //
module.exports = noop;
},{"./noop.js":354}],354:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* No operation.
*
* @example
* noop();
* // ...does nothing.
*/
function noop() {
// Empty function...
}
// EXPORTS //
module.exports = noop;
},{}],355:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Return a partial object copy excluding specified keys.
*
* @module @stdlib/utils/omit
*
* @example
* var omit = require( '@stdlib/utils/omit' );
*
* var obj1 = {
* 'a': 1,
* 'b': 2
* };
*
* var obj2 = omit( obj1, 'b' );
* // returns { 'a': 1 }
*/
// MODULES //
var omit = require( './omit.js' );
// EXPORTS //
module.exports = omit;
},{"./omit.js":356}],356:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var objectKeys = require( '@stdlib/utils/keys' );
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
var isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;
var indexOf = require( '@stdlib/utils/index-of' );
// MAIN //
/**
* Returns a partial object copy excluding specified keys.
*
* @param {Object} obj - source object
* @param {(string|StringArray)} keys - keys to exclude
* @throws {TypeError} first argument must be an object
* @throws {TypeError} second argument must be either a string or an array of strings
* @returns {Object} new object
*
* @example
* var obj1 = {
* 'a': 1,
* 'b': 2
* };
*
* var obj2 = omit( obj1, 'b' );
* // returns { 'a': 1 }
*/
function omit( obj, keys ) {
var ownKeys;
var out;
var key;
var i;
if ( typeof obj !== 'object' || obj === null ) {
throw new TypeError( 'invalid argument. First argument must be an object. Value: `'+obj+'`.' );
}
ownKeys = objectKeys( obj );
out = {};
if ( isString( keys ) ) {
for ( i = 0; i < ownKeys.length; i++ ) {
key = ownKeys[ i ];
if ( key !== keys ) {
out[ key ] = obj[ key ];
}
}
return out;
}
if ( isStringArray( keys ) ) {
for ( i = 0; i < ownKeys.length; i++ ) {
key = ownKeys[ i ];
if ( indexOf( keys, key ) === -1 ) {
out[ key ] = obj[ key ];
}
}
return out;
}
throw new TypeError( 'invalid argument. Second argument must be either a string primitive or an array of string primitives. Value: `'+keys+'`.' );
}
// EXPORTS //
module.exports = omit;
},{"@stdlib/assert/is-string":149,"@stdlib/assert/is-string-array":148,"@stdlib/utils/index-of":322,"@stdlib/utils/keys":339}],357:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Return a partial object copy containing only specified keys.
*
* @module @stdlib/utils/pick
*
* @example
* var pick = require( '@stdlib/utils/pick' );
*
* var obj1 = {
* 'a': 1,
* 'b': 2
* };
*
* var obj2 = pick( obj1, 'b' );
* // returns { 'b': 2 }
*/
// MODULES //
var pick = require( './pick.js' );
// EXPORTS //
module.exports = pick;
},{"./pick.js":358}],358:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
var isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
// MAIN //
/**
* Returns a partial object copy containing only specified keys. If a key does not exist as an own property in a source object, the key is ignored.
*
* @param {Object} obj - source object
* @param {(string|StringArray)} keys - keys to copy
* @throws {TypeError} first argument must be an object
* @throws {TypeError} second argument must be either a string or an array of strings
* @returns {Object} new object
*
* @example
* var obj1 = {
* 'a': 1,
* 'b': 2
* };
*
* var obj2 = pick( obj1, 'b' );
* // returns { 'b': 2 }
*/
function pick( obj, keys ) {
var out;
var key;
var i;
if ( typeof obj !== 'object' || obj === null ) {
throw new TypeError( 'invalid argument. First argument must be an object. Value: `'+obj+'`.' );
}
out = {};
if ( isString( keys ) ) {
if ( hasOwnProp( obj, keys ) ) {
out[ keys ] = obj[ keys ];
}
return out;
}
if ( isStringArray( keys ) ) {
for ( i = 0; i < keys.length; i++ ) {
key = keys[ i ];
if ( hasOwnProp( obj, key ) ) {
out[ key ] = obj[ key ];
}
}
return out;
}
throw new TypeError( 'invalid argument. Second argument must be either a string primitive or an array of string primitives. Value: `'+keys+'`.' );
}
// EXPORTS //
module.exports = pick;
},{"@stdlib/assert/has-own-property":46,"@stdlib/assert/is-string":149,"@stdlib/assert/is-string-array":148}],359:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// VARIABLES //
var propertyDescriptor = Object.getOwnPropertyDescriptor;
// MAIN //
/**
* Returns a property descriptor for an object's own property.
*
* ## Notes
*
* - In contrast to the built-in `Object.getOwnPropertyDescriptor()`, this function returns `null` if provided `undefined` or `null`, rather than throwing an error.
* - In contrast to the built-in `Object.getOwnPropertyDescriptor()`, this function returns `null` if an object does not have a provided property, rather than `undefined`.
*
* @private
* @param {*} value - input object
* @param {(string|symbol)} property - property
* @returns {(Object|null)} property descriptor or null
*
* @example
* var obj = {
* 'beep': 'boop',
* 'foo': 3.14
* };
*
* var desc = getOwnPropertyDescriptor( obj, 'foo' );
* // returns {'configurable':true,'enumerable':true,'writable':true,'value':3.14}
*/
function getOwnPropertyDescriptor( value, property ) {
var desc;
if ( value === null || value === void 0 ) {
return null;
}
desc = propertyDescriptor( value, property );
return ( desc === void 0 ) ? null : desc;
}
// EXPORTS //
module.exports = getOwnPropertyDescriptor;
},{}],360:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var bool = ( typeof Object.getOwnPropertyDescriptor !== 'undefined' );
// EXPORTS //
module.exports = bool;
},{}],361:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Return a property descriptor for an object's own property.
*
* @module @stdlib/utils/property-descriptor
*
* @example
* var getOwnPropertyDescriptor = require( '@stdlib/utils/property-descriptor' );
*
* var obj = {
* 'foo': 'bar',
* 'beep': 'boop'
* };
*
* var keys = getOwnPropertyDescriptor( obj, 'foo' );
* // returns {'configurable':true,'enumerable':true,'writable':true,'value':'bar'}
*/
// MODULES //
var HAS_BUILTIN = require( './has_builtin.js' );
var builtin = require( './builtin.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var main;
if ( HAS_BUILTIN ) {
main = builtin;
} else {
main = polyfill;
}
// EXPORTS //
module.exports = main;
},{"./builtin.js":359,"./has_builtin.js":360,"./polyfill.js":362}],362:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
// MAIN //
/**
* Returns a property descriptor for an object's own property.
*
* ## Notes
*
* - In contrast to the built-in `Object.getOwnPropertyDescriptor()`, this function returns `null` if provided `undefined` or `null`, rather than throwing an error.
* - In contrast to the built-in `Object.getOwnPropertyDescriptor()`, this function returns `null` if an object does not have a provided property, rather than `undefined`.
* - In environments lacking `Object.getOwnPropertyDescriptor()` support, property descriptors do not exist. In non-supporting environment, if an object has a provided property, this function returns a descriptor object equivalent to that returned in a supporting environment; otherwise, the function returns `null`.
*
* @private
* @param {*} value - input object
* @param {(string|symbol)} property - property
* @returns {(Object|null)} property descriptor or null
*
* @example
* var obj = {
* 'beep': 'boop',
* 'foo': 3.14
* };
*
* var desc = getOwnPropertyDescriptor( obj, 'foo' );
* // returns {'configurable':true,'enumerable':true,'writable':true,'value':3.14}
*/
function getOwnPropertyDescriptor( value, property ) {
if ( hasOwnProp( value, property ) ) {
return {
'configurable': true,
'enumerable': true,
'writable': true,
'value': value[ property ]
};
}
return null;
}
// EXPORTS //
module.exports = getOwnPropertyDescriptor;
},{"@stdlib/assert/has-own-property":46}],363:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// VARIABLES //
var propertyNames = Object.getOwnPropertyNames;
// MAIN //
/**
* Returns an array of an object's own enumerable and non-enumerable property names.
*
* ## Notes
*
* - In contrast to the built-in `Object.getOwnPropertyNames()`, this function returns an empty array if provided `undefined` or `null`, rather than throwing an error.
*
* @private
* @param {*} value - input object
* @returns {Array} a list of own property names
*
* @example
* var obj = {
* 'beep': 'boop',
* 'foo': 3.14
* };
*
* var keys = getOwnPropertyNames( obj );
* // e.g., returns [ 'beep', 'foo' ]
*/
function getOwnPropertyNames( value ) {
return propertyNames( Object( value ) );
}
// EXPORTS //
module.exports = getOwnPropertyNames;
},{}],364:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var bool = ( typeof Object.getOwnPropertyNames !== 'undefined' );
// EXPORTS //
module.exports = bool;
},{}],365:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Return an array of an object's own enumerable and non-enumerable property names.
*
* @module @stdlib/utils/property-names
*
* @example
* var getOwnPropertyNames = require( '@stdlib/utils/property-names' );
*
* var keys = getOwnPropertyNames({
* 'foo': 'bar',
* 'beep': 'boop'
* });
* // e.g., returns [ 'foo', 'beep' ]
*/
// MODULES //
var HAS_BUILTIN = require( './has_builtin.js' );
var builtin = require( './builtin.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var main;
if ( HAS_BUILTIN ) {
main = builtin;
} else {
main = polyfill;
}
// EXPORTS //
module.exports = main;
},{"./builtin.js":363,"./has_builtin.js":364,"./polyfill.js":366}],366:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var keys = require( '@stdlib/utils/keys' );
// MAIN //
/**
* Returns an array of an object's own enumerable and non-enumerable property names.
*
* ## Notes
*
* - In contrast to the built-in `Object.getOwnPropertyNames()`, this function returns an empty array if provided `undefined` or `null`, rather than throwing an error.
* - In environments lacking support for `Object.getOwnPropertyNames()`, property descriptors are unavailable, and thus all properties can be safely assumed to be enumerable. Hence, we can defer to calling `Object.keys`, which retrieves all own enumerable property names.
*
* @private
* @param {*} value - input object
* @returns {Array} a list of own property names
*
* @example
* var obj = {
* 'beep': 'boop',
* 'foo': 3.14
* };
*
* var keys = getOwnPropertyNames( obj );
* // e.g., returns [ 'beep', 'foo' ]
*/
function getOwnPropertyNames( value ) {
return keys( Object( value ) );
}
// EXPORTS //
module.exports = getOwnPropertyNames;
},{"@stdlib/utils/keys":339}],367:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
var reRegExp = require( '@stdlib/regexp/regexp' );
// MAIN //
/**
* Parses a regular expression string and returns a new regular expression.
*
* @param {string} str - regular expression string
* @throws {TypeError} must provide a regular expression string
* @returns {(RegExp|null)} regular expression or null
*
* @example
* var re = reFromString( '/beep/' );
* // returns /beep/
*/
function reFromString( str ) {
if ( !isString( str ) ) {
throw new TypeError( 'invalid argument. Must provide a regular expression string. Value: `' + str + '`.' );
}
// Capture the regular expression pattern and any flags:
str = reRegExp().exec( str );
// Create a new regular expression:
return ( str ) ? new RegExp( str[1], str[2] ) : null;
}
// EXPORTS //
module.exports = reFromString;
},{"@stdlib/assert/is-string":149,"@stdlib/regexp/regexp":265}],368:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Create a regular expression from a regular expression string.
*
* @module @stdlib/utils/regexp-from-string
*
* @example
* var reFromString = require( '@stdlib/utils/regexp-from-string' );
*
* var re = reFromString( '/beep/' );
* // returns /beep/
*/
// MODULES //
var reFromString = require( './from_string.js' );
// EXPORTS //
module.exports = reFromString;
},{"./from_string.js":367}],369:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var RE = require( './fixtures/re.js' );
var nodeList = require( './fixtures/nodelist.js' );
var typedarray = require( './fixtures/typedarray.js' );
// MAIN //
/**
* Checks whether a polyfill is needed when using the `typeof` operator.
*
* @private
* @returns {boolean} boolean indicating whether a polyfill is needed
*/
function check() {
if (
// Chrome 1-12 returns 'function' for regular expression instances (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof):
typeof RE === 'function' ||
// Safari 8 returns 'object' for typed array and weak map constructors (underscore #1929):
typeof typedarray === 'object' ||
// PhantomJS 1.9 returns 'function' for `NodeList` instances (underscore #2236):
typeof nodeList === 'function'
) {
return true;
}
return false;
}
// EXPORTS //
module.exports = check;
},{"./fixtures/nodelist.js":370,"./fixtures/re.js":371,"./fixtures/typedarray.js":372}],370:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var getGlobal = require( '@stdlib/utils/global' );
// MAIN //
var root = getGlobal();
var nodeList = root.document && root.document.childNodes;
// EXPORTS //
module.exports = nodeList;
},{"@stdlib/utils/global":318}],371:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
var RE = /./;
// EXPORTS //
module.exports = RE;
},{}],372:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
var typedarray = Int8Array; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = typedarray;
},{}],373:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Determine a value's type.
*
* @module @stdlib/utils/type-of
*
* @example
* var typeOf = require( '@stdlib/utils/type-of' );
*
* var str = typeOf( 'a' );
* // returns 'string'
*
* str = typeOf( 5 );
* // returns 'number'
*/
// MODULES //
var usePolyfill = require( './check.js' );
var typeOf = require( './typeof.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var main = ( usePolyfill() ) ? polyfill : typeOf;
// EXPORTS //
module.exports = main;
},{"./check.js":369,"./polyfill.js":374,"./typeof.js":375}],374:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var ctorName = require( '@stdlib/utils/constructor-name' );
// MAIN //
/**
* Determines a value's type.
*
* @param {*} v - input value
* @returns {string} string indicating the value's type
*/
function typeOf( v ) {
return ctorName( v ).toLowerCase();
}
// EXPORTS //
module.exports = typeOf;
},{"@stdlib/utils/constructor-name":289}],375:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var ctorName = require( '@stdlib/utils/constructor-name' );
// NOTES //
/*
* Built-in `typeof` operator behavior:
*
* ```text
* typeof null => 'object'
* typeof undefined => 'undefined'
* typeof 'a' => 'string'
* typeof 5 => 'number'
* typeof NaN => 'number'
* typeof true => 'boolean'
* typeof false => 'boolean'
* typeof {} => 'object'
* typeof [] => 'object'
* typeof function foo(){} => 'function'
* typeof function* foo(){} => 'object'
* typeof Symbol() => 'symbol'
* ```
*
*/
// MAIN //
/**
* Determines a value's type.
*
* @param {*} v - input value
* @returns {string} string indicating the value's type
*/
function typeOf( v ) {
var type;
// Address `typeof null` => `object` (see http://wiki.ecmascript.org/doku.php?id=harmony:typeof_null):
if ( v === null ) {
return 'null';
}
type = typeof v;
// If the `typeof` operator returned something other than `object`, we are done. Otherwise, we need to check for an internal class name or search for a constructor.
if ( type === 'object' ) {
return ctorName( v ).toLowerCase();
}
return type;
}
// EXPORTS //
module.exports = typeOf;
},{"@stdlib/utils/constructor-name":289}],376:[function(require,module,exports){
'use strict'
exports.byteLength = byteLength
exports.toByteArray = toByteArray
exports.fromByteArray = fromByteArray
var lookup = []
var revLookup = []
var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
for (var i = 0, len = code.length; i < len; ++i) {
lookup[i] = code[i]
revLookup[code.charCodeAt(i)] = i
}
// Support decoding URL-safe base64 strings, as Node.js does.
// See: https://en.wikipedia.org/wiki/Base64#URL_applications
revLookup['-'.charCodeAt(0)] = 62
revLookup['_'.charCodeAt(0)] = 63
function getLens (b64) {
var len = b64.length
if (len % 4 > 0) {
throw new Error('Invalid string. Length must be a multiple of 4')
}
// Trim off extra bytes after placeholder bytes are found
// See: https://github.com/beatgammit/base64-js/issues/42
var validLen = b64.indexOf('=')
if (validLen === -1) validLen = len
var placeHoldersLen = validLen === len
? 0
: 4 - (validLen % 4)
return [validLen, placeHoldersLen]
}
// base64 is 4/3 + up to two characters of the original data
function byteLength (b64) {
var lens = getLens(b64)
var validLen = lens[0]
var placeHoldersLen = lens[1]
return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
}
function _byteLength (b64, validLen, placeHoldersLen) {
return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
}
function toByteArray (b64) {
var tmp
var lens = getLens(b64)
var validLen = lens[0]
var placeHoldersLen = lens[1]
var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
var curByte = 0
// if there are placeholders, only get up to the last complete 4 chars
var len = placeHoldersLen > 0
? validLen - 4
: validLen
var i
for (i = 0; i < len; i += 4) {
tmp =
(revLookup[b64.charCodeAt(i)] << 18) |
(revLookup[b64.charCodeAt(i + 1)] << 12) |
(revLookup[b64.charCodeAt(i + 2)] << 6) |
revLookup[b64.charCodeAt(i + 3)]
arr[curByte++] = (tmp >> 16) & 0xFF
arr[curByte++] = (tmp >> 8) & 0xFF
arr[curByte++] = tmp & 0xFF
}
if (placeHoldersLen === 2) {
tmp =
(revLookup[b64.charCodeAt(i)] << 2) |
(revLookup[b64.charCodeAt(i + 1)] >> 4)
arr[curByte++] = tmp & 0xFF
}
if (placeHoldersLen === 1) {
tmp =
(revLookup[b64.charCodeAt(i)] << 10) |
(revLookup[b64.charCodeAt(i + 1)] << 4) |
(revLookup[b64.charCodeAt(i + 2)] >> 2)
arr[curByte++] = (tmp >> 8) & 0xFF
arr[curByte++] = tmp & 0xFF
}
return arr
}
function tripletToBase64 (num) {
return lookup[num >> 18 & 0x3F] +
lookup[num >> 12 & 0x3F] +
lookup[num >> 6 & 0x3F] +
lookup[num & 0x3F]
}
function encodeChunk (uint8, start, end) {
var tmp
var output = []
for (var i = start; i < end; i += 3) {
tmp =
((uint8[i] << 16) & 0xFF0000) +
((uint8[i + 1] << 8) & 0xFF00) +
(uint8[i + 2] & 0xFF)
output.push(tripletToBase64(tmp))
}
return output.join('')
}
function fromByteArray (uint8) {
var tmp
var len = uint8.length
var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
var parts = []
var maxChunkLength = 16383 // must be multiple of 3
// go through the array every three bytes, we'll deal with trailing stuff later
for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
}
// pad the end with zeros, but make sure to not forget the extra bytes
if (extraBytes === 1) {
tmp = uint8[len - 1]
parts.push(
lookup[tmp >> 2] +
lookup[(tmp << 4) & 0x3F] +
'=='
)
} else if (extraBytes === 2) {
tmp = (uint8[len - 2] << 8) + uint8[len - 1]
parts.push(
lookup[tmp >> 10] +
lookup[(tmp >> 4) & 0x3F] +
lookup[(tmp << 2) & 0x3F] +
'='
)
}
return parts.join('')
}
},{}],377:[function(require,module,exports){
},{}],378:[function(require,module,exports){
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
'use strict';
var R = typeof Reflect === 'object' ? Reflect : null
var ReflectApply = R && typeof R.apply === 'function'
? R.apply
: function ReflectApply(target, receiver, args) {
return Function.prototype.apply.call(target, receiver, args);
}
var ReflectOwnKeys
if (R && typeof R.ownKeys === 'function') {
ReflectOwnKeys = R.ownKeys
} else if (Object.getOwnPropertySymbols) {
ReflectOwnKeys = function ReflectOwnKeys(target) {
return Object.getOwnPropertyNames(target)
.concat(Object.getOwnPropertySymbols(target));
};
} else {
ReflectOwnKeys = function ReflectOwnKeys(target) {
return Object.getOwnPropertyNames(target);
};
}
function ProcessEmitWarning(warning) {
if (console && console.warn) console.warn(warning);
}
var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {
return value !== value;
}
function EventEmitter() {
EventEmitter.init.call(this);
}
module.exports = EventEmitter;
module.exports.once = once;
// Backwards-compat with node 0.10.x
EventEmitter.EventEmitter = EventEmitter;
EventEmitter.prototype._events = undefined;
EventEmitter.prototype._eventsCount = 0;
EventEmitter.prototype._maxListeners = undefined;
// By default EventEmitters will print a warning if more than 10 listeners are
// added to it. This is a useful default which helps finding memory leaks.
var defaultMaxListeners = 10;
function checkListener(listener) {
if (typeof listener !== 'function') {
throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
}
}
Object.defineProperty(EventEmitter, 'defaultMaxListeners', {
enumerable: true,
get: function() {
return defaultMaxListeners;
},
set: function(arg) {
if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {
throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.');
}
defaultMaxListeners = arg;
}
});
EventEmitter.init = function() {
if (this._events === undefined ||
this._events === Object.getPrototypeOf(this)._events) {
this._events = Object.create(null);
this._eventsCount = 0;
}
this._maxListeners = this._maxListeners || undefined;
};
// Obviously not all Emitters should be limited to 10. This function allows
// that to be increased. Set to zero for unlimited.
EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {
throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.');
}
this._maxListeners = n;
return this;
};
function _getMaxListeners(that) {
if (that._maxListeners === undefined)
return EventEmitter.defaultMaxListeners;
return that._maxListeners;
}
EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
return _getMaxListeners(this);
};
EventEmitter.prototype.emit = function emit(type) {
var args = [];
for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);
var doError = (type === 'error');
var events = this._events;
if (events !== undefined)
doError = (doError && events.error === undefined);
else if (!doError)
return false;
// If there is no 'error' event listener then throw.
if (doError) {
var er;
if (args.length > 0)
er = args[0];
if (er instanceof Error) {
// Note: The comments on the `throw` lines are intentional, they show
// up in Node's output if this results in an unhandled exception.
throw er; // Unhandled 'error' event
}
// At least give some kind of context to the user
var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));
err.context = er;
throw err; // Unhandled 'error' event
}
var handler = events[type];
if (handler === undefined)
return false;
if (typeof handler === 'function') {
ReflectApply(handler, this, args);
} else {
var len = handler.length;
var listeners = arrayClone(handler, len);
for (var i = 0; i < len; ++i)
ReflectApply(listeners[i], this, args);
}
return true;
};
function _addListener(target, type, listener, prepend) {
var m;
var events;
var existing;
checkListener(listener);
events = target._events;
if (events === undefined) {
events = target._events = Object.create(null);
target._eventsCount = 0;
} else {
// To avoid recursion in the case that type === "newListener"! Before
// adding it to the listeners, first emit "newListener".
if (events.newListener !== undefined) {
target.emit('newListener', type,
listener.listener ? listener.listener : listener);
// Re-assign `events` because a newListener handler could have caused the
// this._events to be assigned to a new object
events = target._events;
}
existing = events[type];
}
if (existing === undefined) {
// Optimize the case of one listener. Don't need the extra array object.
existing = events[type] = listener;
++target._eventsCount;
} else {
if (typeof existing === 'function') {
// Adding the second element, need to change to array.
existing = events[type] =
prepend ? [listener, existing] : [existing, listener];
// If we've already got an array, just append.
} else if (prepend) {
existing.unshift(listener);
} else {
existing.push(listener);
}
// Check for listener leak
m = _getMaxListeners(target);
if (m > 0 && existing.length > m && !existing.warned) {
existing.warned = true;
// No error code for this since it is a Warning
// eslint-disable-next-line no-restricted-syntax
var w = new Error('Possible EventEmitter memory leak detected. ' +
existing.length + ' ' + String(type) + ' listeners ' +
'added. Use emitter.setMaxListeners() to ' +
'increase limit');
w.name = 'MaxListenersExceededWarning';
w.emitter = target;
w.type = type;
w.count = existing.length;
ProcessEmitWarning(w);
}
}
return target;
}
EventEmitter.prototype.addListener = function addListener(type, listener) {
return _addListener(this, type, listener, false);
};
EventEmitter.prototype.on = EventEmitter.prototype.addListener;
EventEmitter.prototype.prependListener =
function prependListener(type, listener) {
return _addListener(this, type, listener, true);
};
function onceWrapper() {
if (!this.fired) {
this.target.removeListener(this.type, this.wrapFn);
this.fired = true;
if (arguments.length === 0)
return this.listener.call(this.target);
return this.listener.apply(this.target, arguments);
}
}
function _onceWrap(target, type, listener) {
var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };
var wrapped = onceWrapper.bind(state);
wrapped.listener = listener;
state.wrapFn = wrapped;
return wrapped;
}
EventEmitter.prototype.once = function once(type, listener) {
checkListener(listener);
this.on(type, _onceWrap(this, type, listener));
return this;
};
EventEmitter.prototype.prependOnceListener =
function prependOnceListener(type, listener) {
checkListener(listener);
this.prependListener(type, _onceWrap(this, type, listener));
return this;
};
// Emits a 'removeListener' event if and only if the listener was removed.
EventEmitter.prototype.removeListener =
function removeListener(type, listener) {
var list, events, position, i, originalListener;
checkListener(listener);
events = this._events;
if (events === undefined)
return this;
list = events[type];
if (list === undefined)
return this;
if (list === listener || list.listener === listener) {
if (--this._eventsCount === 0)
this._events = Object.create(null);
else {
delete events[type];
if (events.removeListener)
this.emit('removeListener', type, list.listener || listener);
}
} else if (typeof list !== 'function') {
position = -1;
for (i = list.length - 1; i >= 0; i--) {
if (list[i] === listener || list[i].listener === listener) {
originalListener = list[i].listener;
position = i;
break;
}
}
if (position < 0)
return this;
if (position === 0)
list.shift();
else {
spliceOne(list, position);
}
if (list.length === 1)
events[type] = list[0];
if (events.removeListener !== undefined)
this.emit('removeListener', type, originalListener || listener);
}
return this;
};
EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
EventEmitter.prototype.removeAllListeners =
function removeAllListeners(type) {
var listeners, events, i;
events = this._events;
if (events === undefined)
return this;
// not listening for removeListener, no need to emit
if (events.removeListener === undefined) {
if (arguments.length === 0) {
this._events = Object.create(null);
this._eventsCount = 0;
} else if (events[type] !== undefined) {
if (--this._eventsCount === 0)
this._events = Object.create(null);
else
delete events[type];
}
return this;
}
// emit removeListener for all listeners on all events
if (arguments.length === 0) {
var keys = Object.keys(events);
var key;
for (i = 0; i < keys.length; ++i) {
key = keys[i];
if (key === 'removeListener') continue;
this.removeAllListeners(key);
}
this.removeAllListeners('removeListener');
this._events = Object.create(null);
this._eventsCount = 0;
return this;
}
listeners = events[type];
if (typeof listeners === 'function') {
this.removeListener(type, listeners);
} else if (listeners !== undefined) {
// LIFO order
for (i = listeners.length - 1; i >= 0; i--) {
this.removeListener(type, listeners[i]);
}
}
return this;
};
function _listeners(target, type, unwrap) {
var events = target._events;
if (events === undefined)
return [];
var evlistener = events[type];
if (evlistener === undefined)
return [];
if (typeof evlistener === 'function')
return unwrap ? [evlistener.listener || evlistener] : [evlistener];
return unwrap ?
unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
}
EventEmitter.prototype.listeners = function listeners(type) {
return _listeners(this, type, true);
};
EventEmitter.prototype.rawListeners = function rawListeners(type) {
return _listeners(this, type, false);
};
EventEmitter.listenerCount = function(emitter, type) {
if (typeof emitter.listenerCount === 'function') {
return emitter.listenerCount(type);
} else {
return listenerCount.call(emitter, type);
}
};
EventEmitter.prototype.listenerCount = listenerCount;
function listenerCount(type) {
var events = this._events;
if (events !== undefined) {
var evlistener = events[type];
if (typeof evlistener === 'function') {
return 1;
} else if (evlistener !== undefined) {
return evlistener.length;
}
}
return 0;
}
EventEmitter.prototype.eventNames = function eventNames() {
return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
};
function arrayClone(arr, n) {
var copy = new Array(n);
for (var i = 0; i < n; ++i)
copy[i] = arr[i];
return copy;
}
function spliceOne(list, index) {
for (; index + 1 < list.length; index++)
list[index] = list[index + 1];
list.pop();
}
function unwrapListeners(arr) {
var ret = new Array(arr.length);
for (var i = 0; i < ret.length; ++i) {
ret[i] = arr[i].listener || arr[i];
}
return ret;
}
function once(emitter, name) {
return new Promise(function (resolve, reject) {
function errorListener(err) {
emitter.removeListener(name, resolver);
reject(err);
}
function resolver() {
if (typeof emitter.removeListener === 'function') {
emitter.removeListener('error', errorListener);
}
resolve([].slice.call(arguments));
};
eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
if (name !== 'error') {
addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
}
});
}
function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
if (typeof emitter.on === 'function') {
eventTargetAgnosticAddListener(emitter, 'error', handler, flags);
}
}
function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
if (typeof emitter.on === 'function') {
if (flags.once) {
emitter.once(name, listener);
} else {
emitter.on(name, listener);
}
} else if (typeof emitter.addEventListener === 'function') {
// EventTarget does not have `error` event semantics like Node
// EventEmitters, we do not listen for `error` events here.
emitter.addEventListener(name, function wrapListener(arg) {
// IE does not have builtin `{ once: true }` support so we
// have to do it manually.
if (flags.once) {
emitter.removeEventListener(name, wrapListener);
}
listener(arg);
});
} else {
throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
}
}
},{}],379:[function(require,module,exports){
(function (Buffer){(function (){
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
/* eslint-disable no-proto */
'use strict'
var base64 = require('base64-js')
var ieee754 = require('ieee754')
exports.Buffer = Buffer
exports.SlowBuffer = SlowBuffer
exports.INSPECT_MAX_BYTES = 50
var K_MAX_LENGTH = 0x7fffffff
exports.kMaxLength = K_MAX_LENGTH
/**
* If `Buffer.TYPED_ARRAY_SUPPORT`:
* === true Use Uint8Array implementation (fastest)
* === false Print warning and recommend using `buffer` v4.x which has an Object
* implementation (most compatible, even IE6)
*
* Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
* Opera 11.6+, iOS 4.2+.
*
* We report that the browser does not support typed arrays if the are not subclassable
* using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`
* (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support
* for __proto__ and has a buggy typed array implementation.
*/
Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport()
if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&
typeof console.error === 'function') {
console.error(
'This browser lacks typed array (Uint8Array) support which is required by ' +
'`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'
)
}
function typedArraySupport () {
// Can typed array instances can be augmented?
try {
var arr = new Uint8Array(1)
arr.__proto__ = { __proto__: Uint8Array.prototype, foo: function () { return 42 } }
return arr.foo() === 42
} catch (e) {
return false
}
}
Object.defineProperty(Buffer.prototype, 'parent', {
enumerable: true,
get: function () {
if (!Buffer.isBuffer(this)) return undefined
return this.buffer
}
})
Object.defineProperty(Buffer.prototype, 'offset', {
enumerable: true,
get: function () {
if (!Buffer.isBuffer(this)) return undefined
return this.byteOffset
}
})
function createBuffer (length) {
if (length > K_MAX_LENGTH) {
throw new RangeError('The value "' + length + '" is invalid for option "size"')
}
// Return an augmented `Uint8Array` instance
var buf = new Uint8Array(length)
buf.__proto__ = Buffer.prototype
return buf
}
/**
* The Buffer constructor returns instances of `Uint8Array` that have their
* prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
* `Uint8Array`, so the returned instances will have all the node `Buffer` methods
* and the `Uint8Array` methods. Square bracket notation works as expected -- it
* returns a single octet.
*
* The `Uint8Array` prototype remains unmodified.
*/
function Buffer (arg, encodingOrOffset, length) {
// Common case.
if (typeof arg === 'number') {
if (typeof encodingOrOffset === 'string') {
throw new TypeError(
'The "string" argument must be of type string. Received type number'
)
}
return allocUnsafe(arg)
}
return from(arg, encodingOrOffset, length)
}
// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
if (typeof Symbol !== 'undefined' && Symbol.species != null &&
Buffer[Symbol.species] === Buffer) {
Object.defineProperty(Buffer, Symbol.species, {
value: null,
configurable: true,
enumerable: false,
writable: false
})
}
Buffer.poolSize = 8192 // not used by this implementation
function from (value, encodingOrOffset, length) {
if (typeof value === 'string') {
return fromString(value, encodingOrOffset)
}
if (ArrayBuffer.isView(value)) {
return fromArrayLike(value)
}
if (value == null) {
throw TypeError(
'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +
'or Array-like Object. Received type ' + (typeof value)
)
}
if (isInstance(value, ArrayBuffer) ||
(value && isInstance(value.buffer, ArrayBuffer))) {
return fromArrayBuffer(value, encodingOrOffset, length)
}
if (typeof value === 'number') {
throw new TypeError(
'The "value" argument must not be of type number. Received type number'
)
}
var valueOf = value.valueOf && value.valueOf()
if (valueOf != null && valueOf !== value) {
return Buffer.from(valueOf, encodingOrOffset, length)
}
var b = fromObject(value)
if (b) return b
if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&
typeof value[Symbol.toPrimitive] === 'function') {
return Buffer.from(
value[Symbol.toPrimitive]('string'), encodingOrOffset, length
)
}
throw new TypeError(
'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +
'or Array-like Object. Received type ' + (typeof value)
)
}
/**
* Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
* if value is a number.
* Buffer.from(str[, encoding])
* Buffer.from(array)
* Buffer.from(buffer)
* Buffer.from(arrayBuffer[, byteOffset[, length]])
**/
Buffer.from = function (value, encodingOrOffset, length) {
return from(value, encodingOrOffset, length)
}
// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:
// https://github.com/feross/buffer/pull/148
Buffer.prototype.__proto__ = Uint8Array.prototype
Buffer.__proto__ = Uint8Array
function assertSize (size) {
if (typeof size !== 'number') {
throw new TypeError('"size" argument must be of type number')
} else if (size < 0) {
throw new RangeError('The value "' + size + '" is invalid for option "size"')
}
}
function alloc (size, fill, encoding) {
assertSize(size)
if (size <= 0) {
return createBuffer(size)
}
if (fill !== undefined) {
// Only pay attention to encoding if it's a string. This
// prevents accidentally sending in a number that would
// be interpretted as a start offset.
return typeof encoding === 'string'
? createBuffer(size).fill(fill, encoding)
: createBuffer(size).fill(fill)
}
return createBuffer(size)
}
/**
* Creates a new filled Buffer instance.
* alloc(size[, fill[, encoding]])
**/
Buffer.alloc = function (size, fill, encoding) {
return alloc(size, fill, encoding)
}
function allocUnsafe (size) {
assertSize(size)
return createBuffer(size < 0 ? 0 : checked(size) | 0)
}
/**
* Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
* */
Buffer.allocUnsafe = function (size) {
return allocUnsafe(size)
}
/**
* Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
*/
Buffer.allocUnsafeSlow = function (size) {
return allocUnsafe(size)
}
function fromString (string, encoding) {
if (typeof encoding !== 'string' || encoding === '') {
encoding = 'utf8'
}
if (!Buffer.isEncoding(encoding)) {
throw new TypeError('Unknown encoding: ' + encoding)
}
var length = byteLength(string, encoding) | 0
var buf = createBuffer(length)
var actual = buf.write(string, encoding)
if (actual !== length) {
// Writing a hex string, for example, that contains invalid characters will
// cause everything after the first invalid character to be ignored. (e.g.
// 'abxxcd' will be treated as 'ab')
buf = buf.slice(0, actual)
}
return buf
}
function fromArrayLike (array) {
var length = array.length < 0 ? 0 : checked(array.length) | 0
var buf = createBuffer(length)
for (var i = 0; i < length; i += 1) {
buf[i] = array[i] & 255
}
return buf
}
function fromArrayBuffer (array, byteOffset, length) {
if (byteOffset < 0 || array.byteLength < byteOffset) {
throw new RangeError('"offset" is outside of buffer bounds')
}
if (array.byteLength < byteOffset + (length || 0)) {
throw new RangeError('"length" is outside of buffer bounds')
}
var buf
if (byteOffset === undefined && length === undefined) {
buf = new Uint8Array(array)
} else if (length === undefined) {
buf = new Uint8Array(array, byteOffset)
} else {
buf = new Uint8Array(array, byteOffset, length)
}
// Return an augmented `Uint8Array` instance
buf.__proto__ = Buffer.prototype
return buf
}
function fromObject (obj) {
if (Buffer.isBuffer(obj)) {
var len = checked(obj.length) | 0
var buf = createBuffer(len)
if (buf.length === 0) {
return buf
}
obj.copy(buf, 0, 0, len)
return buf
}
if (obj.length !== undefined) {
if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {
return createBuffer(0)
}
return fromArrayLike(obj)
}
if (obj.type === 'Buffer' && Array.isArray(obj.data)) {
return fromArrayLike(obj.data)
}
}
function checked (length) {
// Note: cannot use `length < K_MAX_LENGTH` here because that fails when
// length is NaN (which is otherwise coerced to zero.)
if (length >= K_MAX_LENGTH) {
throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')
}
return length | 0
}
function SlowBuffer (length) {
if (+length != length) { // eslint-disable-line eqeqeq
length = 0
}
return Buffer.alloc(+length)
}
Buffer.isBuffer = function isBuffer (b) {
return b != null && b._isBuffer === true &&
b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false
}
Buffer.compare = function compare (a, b) {
if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)
if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)
if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
throw new TypeError(
'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
)
}
if (a === b) return 0
var x = a.length
var y = b.length
for (var i = 0, len = Math.min(x, y); i < len; ++i) {
if (a[i] !== b[i]) {
x = a[i]
y = b[i]
break
}
}
if (x < y) return -1
if (y < x) return 1
return 0
}
Buffer.isEncoding = function isEncoding (encoding) {
switch (String(encoding).toLowerCase()) {
case 'hex':
case 'utf8':
case 'utf-8':
case 'ascii':
case 'latin1':
case 'binary':
case 'base64':
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return true
default:
return false
}
}
Buffer.concat = function concat (list, length) {
if (!Array.isArray(list)) {
throw new TypeError('"list" argument must be an Array of Buffers')
}
if (list.length === 0) {
return Buffer.alloc(0)
}
var i
if (length === undefined) {
length = 0
for (i = 0; i < list.length; ++i) {
length += list[i].length
}
}
var buffer = Buffer.allocUnsafe(length)
var pos = 0
for (i = 0; i < list.length; ++i) {
var buf = list[i]
if (isInstance(buf, Uint8Array)) {
buf = Buffer.from(buf)
}
if (!Buffer.isBuffer(buf)) {
throw new TypeError('"list" argument must be an Array of Buffers')
}
buf.copy(buffer, pos)
pos += buf.length
}
return buffer
}
function byteLength (string, encoding) {
if (Buffer.isBuffer(string)) {
return string.length
}
if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {
return string.byteLength
}
if (typeof string !== 'string') {
throw new TypeError(
'The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' +
'Received type ' + typeof string
)
}
var len = string.length
var mustMatch = (arguments.length > 2 && arguments[2] === true)
if (!mustMatch && len === 0) return 0
// Use a for loop to avoid recursion
var loweredCase = false
for (;;) {
switch (encoding) {
case 'ascii':
case 'latin1':
case 'binary':
return len
case 'utf8':
case 'utf-8':
return utf8ToBytes(string).length
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return len * 2
case 'hex':
return len >>> 1
case 'base64':
return base64ToBytes(string).length
default:
if (loweredCase) {
return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8
}
encoding = ('' + encoding).toLowerCase()
loweredCase = true
}
}
}
Buffer.byteLength = byteLength
function slowToString (encoding, start, end) {
var loweredCase = false
// No need to verify that "this.length <= MAX_UINT32" since it's a read-only
// property of a typed array.
// This behaves neither like String nor Uint8Array in that we set start/end
// to their upper/lower bounds if the value passed is out of range.
// undefined is handled specially as per ECMA-262 6th Edition,
// Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
if (start === undefined || start < 0) {
start = 0
}
// Return early if start > this.length. Done here to prevent potential uint32
// coercion fail below.
if (start > this.length) {
return ''
}
if (end === undefined || end > this.length) {
end = this.length
}
if (end <= 0) {
return ''
}
// Force coersion to uint32. This will also coerce falsey/NaN values to 0.
end >>>= 0
start >>>= 0
if (end <= start) {
return ''
}
if (!encoding) encoding = 'utf8'
while (true) {
switch (encoding) {
case 'hex':
return hexSlice(this, start, end)
case 'utf8':
case 'utf-8':
return utf8Slice(this, start, end)
case 'ascii':
return asciiSlice(this, start, end)
case 'latin1':
case 'binary':
return latin1Slice(this, start, end)
case 'base64':
return base64Slice(this, start, end)
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return utf16leSlice(this, start, end)
default:
if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
encoding = (encoding + '').toLowerCase()
loweredCase = true
}
}
}
// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)
// to detect a Buffer instance. It's not possible to use `instanceof Buffer`
// reliably in a browserify context because there could be multiple different
// copies of the 'buffer' package in use. This method works even for Buffer
// instances that were created from another copy of the `buffer` package.
// See: https://github.com/feross/buffer/issues/154
Buffer.prototype._isBuffer = true
function swap (b, n, m) {
var i = b[n]
b[n] = b[m]
b[m] = i
}
Buffer.prototype.swap16 = function swap16 () {
var len = this.length
if (len % 2 !== 0) {
throw new RangeError('Buffer size must be a multiple of 16-bits')
}
for (var i = 0; i < len; i += 2) {
swap(this, i, i + 1)
}
return this
}
Buffer.prototype.swap32 = function swap32 () {
var len = this.length
if (len % 4 !== 0) {
throw new RangeError('Buffer size must be a multiple of 32-bits')
}
for (var i = 0; i < len; i += 4) {
swap(this, i, i + 3)
swap(this, i + 1, i + 2)
}
return this
}
Buffer.prototype.swap64 = function swap64 () {
var len = this.length
if (len % 8 !== 0) {
throw new RangeError('Buffer size must be a multiple of 64-bits')
}
for (var i = 0; i < len; i += 8) {
swap(this, i, i + 7)
swap(this, i + 1, i + 6)
swap(this, i + 2, i + 5)
swap(this, i + 3, i + 4)
}
return this
}
Buffer.prototype.toString = function toString () {
var length = this.length
if (length === 0) return ''
if (arguments.length === 0) return utf8Slice(this, 0, length)
return slowToString.apply(this, arguments)
}
Buffer.prototype.toLocaleString = Buffer.prototype.toString
Buffer.prototype.equals = function equals (b) {
if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
if (this === b) return true
return Buffer.compare(this, b) === 0
}
Buffer.prototype.inspect = function inspect () {
var str = ''
var max = exports.INSPECT_MAX_BYTES
str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()
if (this.length > max) str += ' ... '
return '<Buffer ' + str + '>'
}
Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
if (isInstance(target, Uint8Array)) {
target = Buffer.from(target, target.offset, target.byteLength)
}
if (!Buffer.isBuffer(target)) {
throw new TypeError(
'The "target" argument must be one of type Buffer or Uint8Array. ' +
'Received type ' + (typeof target)
)
}
if (start === undefined) {
start = 0
}
if (end === undefined) {
end = target ? target.length : 0
}
if (thisStart === undefined) {
thisStart = 0
}
if (thisEnd === undefined) {
thisEnd = this.length
}
if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
throw new RangeError('out of range index')
}
if (thisStart >= thisEnd && start >= end) {
return 0
}
if (thisStart >= thisEnd) {
return -1
}
if (start >= end) {
return 1
}
start >>>= 0
end >>>= 0
thisStart >>>= 0
thisEnd >>>= 0
if (this === target) return 0
var x = thisEnd - thisStart
var y = end - start
var len = Math.min(x, y)
var thisCopy = this.slice(thisStart, thisEnd)
var targetCopy = target.slice(start, end)
for (var i = 0; i < len; ++i) {
if (thisCopy[i] !== targetCopy[i]) {
x = thisCopy[i]
y = targetCopy[i]
break
}
}
if (x < y) return -1
if (y < x) return 1
return 0
}
// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
// OR the last index of `val` in `buffer` at offset <= `byteOffset`.
//
// Arguments:
// - buffer - a Buffer to search
// - val - a string, Buffer, or number
// - byteOffset - an index into `buffer`; will be clamped to an int32
// - encoding - an optional encoding, relevant is val is a string
// - dir - true for indexOf, false for lastIndexOf
function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
// Empty buffer means no match
if (buffer.length === 0) return -1
// Normalize byteOffset
if (typeof byteOffset === 'string') {
encoding = byteOffset
byteOffset = 0
} else if (byteOffset > 0x7fffffff) {
byteOffset = 0x7fffffff
} else if (byteOffset < -0x80000000) {
byteOffset = -0x80000000
}
byteOffset = +byteOffset // Coerce to Number.
if (numberIsNaN(byteOffset)) {
// byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
byteOffset = dir ? 0 : (buffer.length - 1)
}
// Normalize byteOffset: negative offsets start from the end of the buffer
if (byteOffset < 0) byteOffset = buffer.length + byteOffset
if (byteOffset >= buffer.length) {
if (dir) return -1
else byteOffset = buffer.length - 1
} else if (byteOffset < 0) {
if (dir) byteOffset = 0
else return -1
}
// Normalize val
if (typeof val === 'string') {
val = Buffer.from(val, encoding)
}
// Finally, search either indexOf (if dir is true) or lastIndexOf
if (Buffer.isBuffer(val)) {
// Special case: looking for empty string/buffer always fails
if (val.length === 0) {
return -1
}
return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
} else if (typeof val === 'number') {
val = val & 0xFF // Search for a byte value [0-255]
if (typeof Uint8Array.prototype.indexOf === 'function') {
if (dir) {
return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
} else {
return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
}
}
return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
}
throw new TypeError('val must be string, number or Buffer')
}
function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
var indexSize = 1
var arrLength = arr.length
var valLength = val.length
if (encoding !== undefined) {
encoding = String(encoding).toLowerCase()
if (encoding === 'ucs2' || encoding === 'ucs-2' ||
encoding === 'utf16le' || encoding === 'utf-16le') {
if (arr.length < 2 || val.length < 2) {
return -1
}
indexSize = 2
arrLength /= 2
valLength /= 2
byteOffset /= 2
}
}
function read (buf, i) {
if (indexSize === 1) {
return buf[i]
} else {
return buf.readUInt16BE(i * indexSize)
}
}
var i
if (dir) {
var foundIndex = -1
for (i = byteOffset; i < arrLength; i++) {
if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
if (foundIndex === -1) foundIndex = i
if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
} else {
if (foundIndex !== -1) i -= i - foundIndex
foundIndex = -1
}
}
} else {
if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
for (i = byteOffset; i >= 0; i--) {
var found = true
for (var j = 0; j < valLength; j++) {
if (read(arr, i + j) !== read(val, j)) {
found = false
break
}
}
if (found) return i
}
}
return -1
}
Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
return this.indexOf(val, byteOffset, encoding) !== -1
}
Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
}
Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
}
function hexWrite (buf, string, offset, length) {
offset = Number(offset) || 0
var remaining = buf.length - offset
if (!length) {
length = remaining
} else {
length = Number(length)
if (length > remaining) {
length = remaining
}
}
var strLen = string.length
if (length > strLen / 2) {
length = strLen / 2
}
for (var i = 0; i < length; ++i) {
var parsed = parseInt(string.substr(i * 2, 2), 16)
if (numberIsNaN(parsed)) return i
buf[offset + i] = parsed
}
return i
}
function utf8Write (buf, string, offset, length) {
return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
}
function asciiWrite (buf, string, offset, length) {
return blitBuffer(asciiToBytes(string), buf, offset, length)
}
function latin1Write (buf, string, offset, length) {
return asciiWrite(buf, string, offset, length)
}
function base64Write (buf, string, offset, length) {
return blitBuffer(base64ToBytes(string), buf, offset, length)
}
function ucs2Write (buf, string, offset, length) {
return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
}
Buffer.prototype.write = function write (string, offset, length, encoding) {
// Buffer#write(string)
if (offset === undefined) {
encoding = 'utf8'
length = this.length
offset = 0
// Buffer#write(string, encoding)
} else if (length === undefined && typeof offset === 'string') {
encoding = offset
length = this.length
offset = 0
// Buffer#write(string, offset[, length][, encoding])
} else if (isFinite(offset)) {
offset = offset >>> 0
if (isFinite(length)) {
length = length >>> 0
if (encoding === undefined) encoding = 'utf8'
} else {
encoding = length
length = undefined
}
} else {
throw new Error(
'Buffer.write(string, encoding, offset[, length]) is no longer supported'
)
}
var remaining = this.length - offset
if (length === undefined || length > remaining) length = remaining
if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
throw new RangeError('Attempt to write outside buffer bounds')
}
if (!encoding) encoding = 'utf8'
var loweredCase = false
for (;;) {
switch (encoding) {
case 'hex':
return hexWrite(this, string, offset, length)
case 'utf8':
case 'utf-8':
return utf8Write(this, string, offset, length)
case 'ascii':
return asciiWrite(this, string, offset, length)
case 'latin1':
case 'binary':
return latin1Write(this, string, offset, length)
case 'base64':
// Warning: maxLength not taken into account in base64Write
return base64Write(this, string, offset, length)
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return ucs2Write(this, string, offset, length)
default:
if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
encoding = ('' + encoding).toLowerCase()
loweredCase = true
}
}
}
Buffer.prototype.toJSON = function toJSON () {
return {
type: 'Buffer',
data: Array.prototype.slice.call(this._arr || this, 0)
}
}
function base64Slice (buf, start, end) {
if (start === 0 && end === buf.length) {
return base64.fromByteArray(buf)
} else {
return base64.fromByteArray(buf.slice(start, end))
}
}
function utf8Slice (buf, start, end) {
end = Math.min(buf.length, end)
var res = []
var i = start
while (i < end) {
var firstByte = buf[i]
var codePoint = null
var bytesPerSequence = (firstByte > 0xEF) ? 4
: (firstByte > 0xDF) ? 3
: (firstByte > 0xBF) ? 2
: 1
if (i + bytesPerSequence <= end) {
var secondByte, thirdByte, fourthByte, tempCodePoint
switch (bytesPerSequence) {
case 1:
if (firstByte < 0x80) {
codePoint = firstByte
}
break
case 2:
secondByte = buf[i + 1]
if ((secondByte & 0xC0) === 0x80) {
tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
if (tempCodePoint > 0x7F) {
codePoint = tempCodePoint
}
}
break
case 3:
secondByte = buf[i + 1]
thirdByte = buf[i + 2]
if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
codePoint = tempCodePoint
}
}
break
case 4:
secondByte = buf[i + 1]
thirdByte = buf[i + 2]
fourthByte = buf[i + 3]
if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
codePoint = tempCodePoint
}
}
}
}
if (codePoint === null) {
// we did not generate a valid codePoint so insert a
// replacement char (U+FFFD) and advance only 1 byte
codePoint = 0xFFFD
bytesPerSequence = 1
} else if (codePoint > 0xFFFF) {
// encode to utf16 (surrogate pair dance)
codePoint -= 0x10000
res.push(codePoint >>> 10 & 0x3FF | 0xD800)
codePoint = 0xDC00 | codePoint & 0x3FF
}
res.push(codePoint)
i += bytesPerSequence
}
return decodeCodePointsArray(res)
}
// Based on http://stackoverflow.com/a/22747272/680742, the browser with
// the lowest limit is Chrome, with 0x10000 args.
// We go 1 magnitude less, for safety
var MAX_ARGUMENTS_LENGTH = 0x1000
function decodeCodePointsArray (codePoints) {
var len = codePoints.length
if (len <= MAX_ARGUMENTS_LENGTH) {
return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
}
// Decode in chunks to avoid "call stack size exceeded".
var res = ''
var i = 0
while (i < len) {
res += String.fromCharCode.apply(
String,
codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
)
}
return res
}
function asciiSlice (buf, start, end) {
var ret = ''
end = Math.min(buf.length, end)
for (var i = start; i < end; ++i) {
ret += String.fromCharCode(buf[i] & 0x7F)
}
return ret
}
function latin1Slice (buf, start, end) {
var ret = ''
end = Math.min(buf.length, end)
for (var i = start; i < end; ++i) {
ret += String.fromCharCode(buf[i])
}
return ret
}
function hexSlice (buf, start, end) {
var len = buf.length
if (!start || start < 0) start = 0
if (!end || end < 0 || end > len) end = len
var out = ''
for (var i = start; i < end; ++i) {
out += toHex(buf[i])
}
return out
}
function utf16leSlice (buf, start, end) {
var bytes = buf.slice(start, end)
var res = ''
for (var i = 0; i < bytes.length; i += 2) {
res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))
}
return res
}
Buffer.prototype.slice = function slice (start, end) {
var len = this.length
start = ~~start
end = end === undefined ? len : ~~end
if (start < 0) {
start += len
if (start < 0) start = 0
} else if (start > len) {
start = len
}
if (end < 0) {
end += len
if (end < 0) end = 0
} else if (end > len) {
end = len
}
if (end < start) end = start
var newBuf = this.subarray(start, end)
// Return an augmented `Uint8Array` instance
newBuf.__proto__ = Buffer.prototype
return newBuf
}
/*
* Need to make sure that buffer isn't trying to write out of bounds.
*/
function checkOffset (offset, ext, length) {
if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
}
Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
offset = offset >>> 0
byteLength = byteLength >>> 0
if (!noAssert) checkOffset(offset, byteLength, this.length)
var val = this[offset]
var mul = 1
var i = 0
while (++i < byteLength && (mul *= 0x100)) {
val += this[offset + i] * mul
}
return val
}
Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
offset = offset >>> 0
byteLength = byteLength >>> 0
if (!noAssert) {
checkOffset(offset, byteLength, this.length)
}
var val = this[offset + --byteLength]
var mul = 1
while (byteLength > 0 && (mul *= 0x100)) {
val += this[offset + --byteLength] * mul
}
return val
}
Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 1, this.length)
return this[offset]
}
Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 2, this.length)
return this[offset] | (this[offset + 1] << 8)
}
Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 2, this.length)
return (this[offset] << 8) | this[offset + 1]
}
Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 4, this.length)
return ((this[offset]) |
(this[offset + 1] << 8) |
(this[offset + 2] << 16)) +
(this[offset + 3] * 0x1000000)
}
Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 4, this.length)
return (this[offset] * 0x1000000) +
((this[offset + 1] << 16) |
(this[offset + 2] << 8) |
this[offset + 3])
}
Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
offset = offset >>> 0
byteLength = byteLength >>> 0
if (!noAssert) checkOffset(offset, byteLength, this.length)
var val = this[offset]
var mul = 1
var i = 0
while (++i < byteLength && (mul *= 0x100)) {
val += this[offset + i] * mul
}
mul *= 0x80
if (val >= mul) val -= Math.pow(2, 8 * byteLength)
return val
}
Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
offset = offset >>> 0
byteLength = byteLength >>> 0
if (!noAssert) checkOffset(offset, byteLength, this.length)
var i = byteLength
var mul = 1
var val = this[offset + --i]
while (i > 0 && (mul *= 0x100)) {
val += this[offset + --i] * mul
}
mul *= 0x80
if (val >= mul) val -= Math.pow(2, 8 * byteLength)
return val
}
Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 1, this.length)
if (!(this[offset] & 0x80)) return (this[offset])
return ((0xff - this[offset] + 1) * -1)
}
Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 2, this.length)
var val = this[offset] | (this[offset + 1] << 8)
return (val & 0x8000) ? val | 0xFFFF0000 : val
}
Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 2, this.length)
var val = this[offset + 1] | (this[offset] << 8)
return (val & 0x8000) ? val | 0xFFFF0000 : val
}
Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 4, this.length)
return (this[offset]) |
(this[offset + 1] << 8) |
(this[offset + 2] << 16) |
(this[offset + 3] << 24)
}
Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 4, this.length)
return (this[offset] << 24) |
(this[offset + 1] << 16) |
(this[offset + 2] << 8) |
(this[offset + 3])
}
Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 4, this.length)
return ieee754.read(this, offset, true, 23, 4)
}
Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 4, this.length)
return ieee754.read(this, offset, false, 23, 4)
}
Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 8, this.length)
return ieee754.read(this, offset, true, 52, 8)
}
Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 8, this.length)
return ieee754.read(this, offset, false, 52, 8)
}
function checkInt (buf, value, offset, ext, max, min) {
if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
if (offset + ext > buf.length) throw new RangeError('Index out of range')
}
Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
value = +value
offset = offset >>> 0
byteLength = byteLength >>> 0
if (!noAssert) {
var maxBytes = Math.pow(2, 8 * byteLength) - 1
checkInt(this, value, offset, byteLength, maxBytes, 0)
}
var mul = 1
var i = 0
this[offset] = value & 0xFF
while (++i < byteLength && (mul *= 0x100)) {
this[offset + i] = (value / mul) & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
value = +value
offset = offset >>> 0
byteLength = byteLength >>> 0
if (!noAssert) {
var maxBytes = Math.pow(2, 8 * byteLength) - 1
checkInt(this, value, offset, byteLength, maxBytes, 0)
}
var i = byteLength - 1
var mul = 1
this[offset + i] = value & 0xFF
while (--i >= 0 && (mul *= 0x100)) {
this[offset + i] = (value / mul) & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
this[offset] = (value & 0xff)
return offset + 1
}
Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
this[offset] = (value & 0xff)
this[offset + 1] = (value >>> 8)
return offset + 2
}
Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
this[offset] = (value >>> 8)
this[offset + 1] = (value & 0xff)
return offset + 2
}
Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
this[offset + 3] = (value >>> 24)
this[offset + 2] = (value >>> 16)
this[offset + 1] = (value >>> 8)
this[offset] = (value & 0xff)
return offset + 4
}
Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
this[offset] = (value >>> 24)
this[offset + 1] = (value >>> 16)
this[offset + 2] = (value >>> 8)
this[offset + 3] = (value & 0xff)
return offset + 4
}
Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) {
var limit = Math.pow(2, (8 * byteLength) - 1)
checkInt(this, value, offset, byteLength, limit - 1, -limit)
}
var i = 0
var mul = 1
var sub = 0
this[offset] = value & 0xFF
while (++i < byteLength && (mul *= 0x100)) {
if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
sub = 1
}
this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) {
var limit = Math.pow(2, (8 * byteLength) - 1)
checkInt(this, value, offset, byteLength, limit - 1, -limit)
}
var i = byteLength - 1
var mul = 1
var sub = 0
this[offset + i] = value & 0xFF
while (--i >= 0 && (mul *= 0x100)) {
if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
sub = 1
}
this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
if (value < 0) value = 0xff + value + 1
this[offset] = (value & 0xff)
return offset + 1
}
Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
this[offset] = (value & 0xff)
this[offset + 1] = (value >>> 8)
return offset + 2
}
Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
this[offset] = (value >>> 8)
this[offset + 1] = (value & 0xff)
return offset + 2
}
Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
this[offset] = (value & 0xff)
this[offset + 1] = (value >>> 8)
this[offset + 2] = (value >>> 16)
this[offset + 3] = (value >>> 24)
return offset + 4
}
Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
if (value < 0) value = 0xffffffff + value + 1
this[offset] = (value >>> 24)
this[offset + 1] = (value >>> 16)
this[offset + 2] = (value >>> 8)
this[offset + 3] = (value & 0xff)
return offset + 4
}
function checkIEEE754 (buf, value, offset, ext, max, min) {
if (offset + ext > buf.length) throw new RangeError('Index out of range')
if (offset < 0) throw new RangeError('Index out of range')
}
function writeFloat (buf, value, offset, littleEndian, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) {
checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
}
ieee754.write(buf, value, offset, littleEndian, 23, 4)
return offset + 4
}
Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
return writeFloat(this, value, offset, true, noAssert)
}
Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
return writeFloat(this, value, offset, false, noAssert)
}
function writeDouble (buf, value, offset, littleEndian, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) {
checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
}
ieee754.write(buf, value, offset, littleEndian, 52, 8)
return offset + 8
}
Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
return writeDouble(this, value, offset, true, noAssert)
}
Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
return writeDouble(this, value, offset, false, noAssert)
}
// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
Buffer.prototype.copy = function copy (target, targetStart, start, end) {
if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')
if (!start) start = 0
if (!end && end !== 0) end = this.length
if (targetStart >= target.length) targetStart = target.length
if (!targetStart) targetStart = 0
if (end > 0 && end < start) end = start
// Copy 0 bytes; we're done
if (end === start) return 0
if (target.length === 0 || this.length === 0) return 0
// Fatal error conditions
if (targetStart < 0) {
throw new RangeError('targetStart out of bounds')
}
if (start < 0 || start >= this.length) throw new RangeError('Index out of range')
if (end < 0) throw new RangeError('sourceEnd out of bounds')
// Are we oob?
if (end > this.length) end = this.length
if (target.length - targetStart < end - start) {
end = target.length - targetStart + start
}
var len = end - start
if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {
// Use built-in when available, missing from IE11
this.copyWithin(targetStart, start, end)
} else if (this === target && start < targetStart && targetStart < end) {
// descending copy from end
for (var i = len - 1; i >= 0; --i) {
target[i + targetStart] = this[i + start]
}
} else {
Uint8Array.prototype.set.call(
target,
this.subarray(start, end),
targetStart
)
}
return len
}
// Usage:
// buffer.fill(number[, offset[, end]])
// buffer.fill(buffer[, offset[, end]])
// buffer.fill(string[, offset[, end]][, encoding])
Buffer.prototype.fill = function fill (val, start, end, encoding) {
// Handle string cases:
if (typeof val === 'string') {
if (typeof start === 'string') {
encoding = start
start = 0
end = this.length
} else if (typeof end === 'string') {
encoding = end
end = this.length
}
if (encoding !== undefined && typeof encoding !== 'string') {
throw new TypeError('encoding must be a string')
}
if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
throw new TypeError('Unknown encoding: ' + encoding)
}
if (val.length === 1) {
var code = val.charCodeAt(0)
if ((encoding === 'utf8' && code < 128) ||
encoding === 'latin1') {
// Fast path: If `val` fits into a single byte, use that numeric value.
val = code
}
}
} else if (typeof val === 'number') {
val = val & 255
}
// Invalid ranges are not set to a default, so can range check early.
if (start < 0 || this.length < start || this.length < end) {
throw new RangeError('Out of range index')
}
if (end <= start) {
return this
}
start = start >>> 0
end = end === undefined ? this.length : end >>> 0
if (!val) val = 0
var i
if (typeof val === 'number') {
for (i = start; i < end; ++i) {
this[i] = val
}
} else {
var bytes = Buffer.isBuffer(val)
? val
: Buffer.from(val, encoding)
var len = bytes.length
if (len === 0) {
throw new TypeError('The value "' + val +
'" is invalid for argument "value"')
}
for (i = 0; i < end - start; ++i) {
this[i + start] = bytes[i % len]
}
}
return this
}
// HELPER FUNCTIONS
// ================
var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g
function base64clean (str) {
// Node takes equal signs as end of the Base64 encoding
str = str.split('=')[0]
// Node strips out invalid characters like \n and \t from the string, base64-js does not
str = str.trim().replace(INVALID_BASE64_RE, '')
// Node converts strings with length < 2 to ''
if (str.length < 2) return ''
// Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
while (str.length % 4 !== 0) {
str = str + '='
}
return str
}
function toHex (n) {
if (n < 16) return '0' + n.toString(16)
return n.toString(16)
}
function utf8ToBytes (string, units) {
units = units || Infinity
var codePoint
var length = string.length
var leadSurrogate = null
var bytes = []
for (var i = 0; i < length; ++i) {
codePoint = string.charCodeAt(i)
// is surrogate component
if (codePoint > 0xD7FF && codePoint < 0xE000) {
// last char was a lead
if (!leadSurrogate) {
// no lead yet
if (codePoint > 0xDBFF) {
// unexpected trail
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
continue
} else if (i + 1 === length) {
// unpaired lead
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
continue
}
// valid lead
leadSurrogate = codePoint
continue
}
// 2 leads in a row
if (codePoint < 0xDC00) {
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
leadSurrogate = codePoint
continue
}
// valid surrogate pair
codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
} else if (leadSurrogate) {
// valid bmp char, but last char was a lead
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
}
leadSurrogate = null
// encode utf8
if (codePoint < 0x80) {
if ((units -= 1) < 0) break
bytes.push(codePoint)
} else if (codePoint < 0x800) {
if ((units -= 2) < 0) break
bytes.push(
codePoint >> 0x6 | 0xC0,
codePoint & 0x3F | 0x80
)
} else if (codePoint < 0x10000) {
if ((units -= 3) < 0) break
bytes.push(
codePoint >> 0xC | 0xE0,
codePoint >> 0x6 & 0x3F | 0x80,
codePoint & 0x3F | 0x80
)
} else if (codePoint < 0x110000) {
if ((units -= 4) < 0) break
bytes.push(
codePoint >> 0x12 | 0xF0,
codePoint >> 0xC & 0x3F | 0x80,
codePoint >> 0x6 & 0x3F | 0x80,
codePoint & 0x3F | 0x80
)
} else {
throw new Error('Invalid code point')
}
}
return bytes
}
function asciiToBytes (str) {
var byteArray = []
for (var i = 0; i < str.length; ++i) {
// Node's code seems to be doing this and not & 0x7F..
byteArray.push(str.charCodeAt(i) & 0xFF)
}
return byteArray
}
function utf16leToBytes (str, units) {
var c, hi, lo
var byteArray = []
for (var i = 0; i < str.length; ++i) {
if ((units -= 2) < 0) break
c = str.charCodeAt(i)
hi = c >> 8
lo = c % 256
byteArray.push(lo)
byteArray.push(hi)
}
return byteArray
}
function base64ToBytes (str) {
return base64.toByteArray(base64clean(str))
}
function blitBuffer (src, dst, offset, length) {
for (var i = 0; i < length; ++i) {
if ((i + offset >= dst.length) || (i >= src.length)) break
dst[i + offset] = src[i]
}
return i
}
// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass
// the `instanceof` check but they should be treated as of that type.
// See: https://github.com/feross/buffer/issues/166
function isInstance (obj, type) {
return obj instanceof type ||
(obj != null && obj.constructor != null && obj.constructor.name != null &&
obj.constructor.name === type.name)
}
function numberIsNaN (obj) {
// For IE11 support
return obj !== obj // eslint-disable-line no-self-compare
}
}).call(this)}).call(this,require("buffer").Buffer)
},{"base64-js":376,"buffer":379,"ieee754":383}],380:[function(require,module,exports){
(function (Buffer){(function (){
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// NOTE: These type checking functions intentionally don't use `instanceof`
// because it is fragile and can be easily faked with `Object.create()`.
function isArray(arg) {
if (Array.isArray) {
return Array.isArray(arg);
}
return objectToString(arg) === '[object Array]';
}
exports.isArray = isArray;
function isBoolean(arg) {
return typeof arg === 'boolean';
}
exports.isBoolean = isBoolean;
function isNull(arg) {
return arg === null;
}
exports.isNull = isNull;
function isNullOrUndefined(arg) {
return arg == null;
}
exports.isNullOrUndefined = isNullOrUndefined;
function isNumber(arg) {
return typeof arg === 'number';
}
exports.isNumber = isNumber;
function isString(arg) {
return typeof arg === 'string';
}
exports.isString = isString;
function isSymbol(arg) {
return typeof arg === 'symbol';
}
exports.isSymbol = isSymbol;
function isUndefined(arg) {
return arg === void 0;
}
exports.isUndefined = isUndefined;
function isRegExp(re) {
return objectToString(re) === '[object RegExp]';
}
exports.isRegExp = isRegExp;
function isObject(arg) {
return typeof arg === 'object' && arg !== null;
}
exports.isObject = isObject;
function isDate(d) {
return objectToString(d) === '[object Date]';
}
exports.isDate = isDate;
function isError(e) {
return (objectToString(e) === '[object Error]' || e instanceof Error);
}
exports.isError = isError;
function isFunction(arg) {
return typeof arg === 'function';
}
exports.isFunction = isFunction;
function isPrimitive(arg) {
return arg === null ||
typeof arg === 'boolean' ||
typeof arg === 'number' ||
typeof arg === 'string' ||
typeof arg === 'symbol' || // ES6 symbol
typeof arg === 'undefined';
}
exports.isPrimitive = isPrimitive;
exports.isBuffer = Buffer.isBuffer;
function objectToString(o) {
return Object.prototype.toString.call(o);
}
}).call(this)}).call(this,{"isBuffer":require("../../is-buffer/index.js")})
},{"../../is-buffer/index.js":385}],381:[function(require,module,exports){
(function (process){(function (){
/**
* This is the web browser implementation of `debug()`.
*
* Expose `debug()` as the module.
*/
exports = module.exports = require('./debug');
exports.log = log;
exports.formatArgs = formatArgs;
exports.save = save;
exports.load = load;
exports.useColors = useColors;
exports.storage = 'undefined' != typeof chrome
&& 'undefined' != typeof chrome.storage
? chrome.storage.local
: localstorage();
/**
* Colors.
*/
exports.colors = [
'lightseagreen',
'forestgreen',
'goldenrod',
'dodgerblue',
'darkorchid',
'crimson'
];
/**
* Currently only WebKit-based Web Inspectors, Firefox >= v31,
* and the Firebug extension (any Firefox version) are known
* to support "%c" CSS customizations.
*
* TODO: add a `localStorage` variable to explicitly enable/disable colors
*/
function useColors() {
// NB: In an Electron preload script, document will be defined but not fully
// initialized. Since we know we're in Chrome, we'll just detect this case
// explicitly
if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {
return true;
}
// is webkit? http://stackoverflow.com/a/16459606/376773
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
// is firebug? http://stackoverflow.com/a/398120/376773
(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
// is firefox >= v31?
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
// double check webkit in userAgent just in case we are in a worker
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
}
/**
* Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
*/
exports.formatters.j = function(v) {
try {
return JSON.stringify(v);
} catch (err) {
return '[UnexpectedJSONParseError]: ' + err.message;
}
};
/**
* Colorize log arguments if enabled.
*
* @api public
*/
function formatArgs(args) {
var useColors = this.useColors;
args[0] = (useColors ? '%c' : '')
+ this.namespace
+ (useColors ? ' %c' : ' ')
+ args[0]
+ (useColors ? '%c ' : ' ')
+ '+' + exports.humanize(this.diff);
if (!useColors) return;
var c = 'color: ' + this.color;
args.splice(1, 0, c, 'color: inherit')
// the final "%c" is somewhat tricky, because there could be other
// arguments passed either before or after the %c, so we need to
// figure out the correct index to insert the CSS into
var index = 0;
var lastC = 0;
args[0].replace(/%[a-zA-Z%]/g, function(match) {
if ('%%' === match) return;
index++;
if ('%c' === match) {
// we only are interested in the *last* %c
// (the user may have provided their own)
lastC = index;
}
});
args.splice(lastC, 0, c);
}
/**
* Invokes `console.log()` when available.
* No-op when `console.log` is not a "function".
*
* @api public
*/
function log() {
// this hackery is required for IE8/9, where
// the `console.log` function doesn't have 'apply'
return 'object' === typeof console
&& console.log
&& Function.prototype.apply.call(console.log, console, arguments);
}
/**
* Save `namespaces`.
*
* @param {String} namespaces
* @api private
*/
function save(namespaces) {
try {
if (null == namespaces) {
exports.storage.removeItem('debug');
} else {
exports.storage.debug = namespaces;
}
} catch(e) {}
}
/**
* Load `namespaces`.
*
* @return {String} returns the previously persisted debug modes
* @api private
*/
function load() {
var r;
try {
r = exports.storage.debug;
} catch(e) {}
// If debug isn't set in LS, and we're in Electron, try to load $DEBUG
if (!r && typeof process !== 'undefined' && 'env' in process) {
r = process.env.DEBUG;
}
return r;
}
/**
* Enable namespaces listed in `localStorage.debug` initially.
*/
exports.enable(load());
/**
* Localstorage attempts to return the localstorage.
*
* This is necessary because safari throws
* when a user disables cookies/localstorage
* and you attempt to access it.
*
* @return {LocalStorage}
* @api private
*/
function localstorage() {
try {
return window.localStorage;
} catch (e) {}
}
}).call(this)}).call(this,require('_process'))
},{"./debug":382,"_process":389}],382:[function(require,module,exports){
/**
* This is the common logic for both the Node.js and web browser
* implementations of `debug()`.
*
* Expose `debug()` as the module.
*/
exports = module.exports = createDebug.debug = createDebug['default'] = createDebug;
exports.coerce = coerce;
exports.disable = disable;
exports.enable = enable;
exports.enabled = enabled;
exports.humanize = require('ms');
/**
* The currently active debug mode names, and names to skip.
*/
exports.names = [];
exports.skips = [];
/**
* Map of special "%n" handling functions, for the debug "format" argument.
*
* Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
*/
exports.formatters = {};
/**
* Previous log timestamp.
*/
var prevTime;
/**
* Select a color.
* @param {String} namespace
* @return {Number}
* @api private
*/
function selectColor(namespace) {
var hash = 0, i;
for (i in namespace) {
hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
hash |= 0; // Convert to 32bit integer
}
return exports.colors[Math.abs(hash) % exports.colors.length];
}
/**
* Create a debugger with the given `namespace`.
*
* @param {String} namespace
* @return {Function}
* @api public
*/
function createDebug(namespace) {
function debug() {
// disabled?
if (!debug.enabled) return;
var self = debug;
// set `diff` timestamp
var curr = +new Date();
var ms = curr - (prevTime || curr);
self.diff = ms;
self.prev = prevTime;
self.curr = curr;
prevTime = curr;
// turn the `arguments` into a proper Array
var args = new Array(arguments.length);
for (var i = 0; i < args.length; i++) {
args[i] = arguments[i];
}
args[0] = exports.coerce(args[0]);
if ('string' !== typeof args[0]) {
// anything else let's inspect with %O
args.unshift('%O');
}
// apply any `formatters` transformations
var index = 0;
args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
// if we encounter an escaped % then don't increase the array index
if (match === '%%') return match;
index++;
var formatter = exports.formatters[format];
if ('function' === typeof formatter) {
var val = args[index];
match = formatter.call(self, val);
// now we need to remove `args[index]` since it's inlined in the `format`
args.splice(index, 1);
index--;
}
return match;
});
// apply env-specific formatting (colors, etc.)
exports.formatArgs.call(self, args);
var logFn = debug.log || exports.log || console.log.bind(console);
logFn.apply(self, args);
}
debug.namespace = namespace;
debug.enabled = exports.enabled(namespace);
debug.useColors = exports.useColors();
debug.color = selectColor(namespace);
// env-specific initialization logic for debug instances
if ('function' === typeof exports.init) {
exports.init(debug);
}
return debug;
}
/**
* Enables a debug mode by namespaces. This can include modes
* separated by a colon and wildcards.
*
* @param {String} namespaces
* @api public
*/
function enable(namespaces) {
exports.save(namespaces);
exports.names = [];
exports.skips = [];
var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
var len = split.length;
for (var i = 0; i < len; i++) {
if (!split[i]) continue; // ignore empty strings
namespaces = split[i].replace(/\*/g, '.*?');
if (namespaces[0] === '-') {
exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
} else {
exports.names.push(new RegExp('^' + namespaces + '$'));
}
}
}
/**
* Disable debug output.
*
* @api public
*/
function disable() {
exports.enable('');
}
/**
* Returns true if the given mode name is enabled, false otherwise.
*
* @param {String} name
* @return {Boolean}
* @api public
*/
function enabled(name) {
var i, len;
for (i = 0, len = exports.skips.length; i < len; i++) {
if (exports.skips[i].test(name)) {
return false;
}
}
for (i = 0, len = exports.names.length; i < len; i++) {
if (exports.names[i].test(name)) {
return true;
}
}
return false;
}
/**
* Coerce `val`.
*
* @param {Mixed} val
* @return {Mixed}
* @api private
*/
function coerce(val) {
if (val instanceof Error) return val.stack || val.message;
return val;
}
},{"ms":387}],383:[function(require,module,exports){
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
exports.read = function (buffer, offset, isLE, mLen, nBytes) {
var e, m
var eLen = (nBytes * 8) - mLen - 1
var eMax = (1 << eLen) - 1
var eBias = eMax >> 1
var nBits = -7
var i = isLE ? (nBytes - 1) : 0
var d = isLE ? -1 : 1
var s = buffer[offset + i]
i += d
e = s & ((1 << (-nBits)) - 1)
s >>= (-nBits)
nBits += eLen
for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
m = e & ((1 << (-nBits)) - 1)
e >>= (-nBits)
nBits += mLen
for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
if (e === 0) {
e = 1 - eBias
} else if (e === eMax) {
return m ? NaN : ((s ? -1 : 1) * Infinity)
} else {
m = m + Math.pow(2, mLen)
e = e - eBias
}
return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
}
exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
var e, m, c
var eLen = (nBytes * 8) - mLen - 1
var eMax = (1 << eLen) - 1
var eBias = eMax >> 1
var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
var i = isLE ? 0 : (nBytes - 1)
var d = isLE ? 1 : -1
var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
value = Math.abs(value)
if (isNaN(value) || value === Infinity) {
m = isNaN(value) ? 1 : 0
e = eMax
} else {
e = Math.floor(Math.log(value) / Math.LN2)
if (value * (c = Math.pow(2, -e)) < 1) {
e--
c *= 2
}
if (e + eBias >= 1) {
value += rt / c
} else {
value += rt * Math.pow(2, 1 - eBias)
}
if (value * c >= 2) {
e++
c /= 2
}
if (e + eBias >= eMax) {
m = 0
e = eMax
} else if (e + eBias >= 1) {
m = ((value * c) - 1) * Math.pow(2, mLen)
e = e + eBias
} else {
m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
e = 0
}
}
for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
e = (e << mLen) | m
eLen += mLen
for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
buffer[offset + i - d] |= s * 128
}
},{}],384:[function(require,module,exports){
if (typeof Object.create === 'function') {
// implementation from standard node.js 'util' module
module.exports = function inherits(ctor, superCtor) {
if (superCtor) {
ctor.super_ = superCtor
ctor.prototype = Object.create(superCtor.prototype, {
constructor: {
value: ctor,
enumerable: false,
writable: true,
configurable: true
}
})
}
};
} else {
// old school shim for old browsers
module.exports = function inherits(ctor, superCtor) {
if (superCtor) {
ctor.super_ = superCtor
var TempCtor = function () {}
TempCtor.prototype = superCtor.prototype
ctor.prototype = new TempCtor()
ctor.prototype.constructor = ctor
}
}
}
},{}],385:[function(require,module,exports){
/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
// The _isBuffer check is for Safari 5-7 support, because it's missing
// Object.prototype.constructor. Remove this eventually
module.exports = function (obj) {
return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
}
function isBuffer (obj) {
return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
}
// For Node v0.10 support. Remove this eventually.
function isSlowBuffer (obj) {
return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
}
},{}],386:[function(require,module,exports){
var toString = {}.toString;
module.exports = Array.isArray || function (arr) {
return toString.call(arr) == '[object Array]';
};
},{}],387:[function(require,module,exports){
/**
* Helpers.
*/
var s = 1000;
var m = s * 60;
var h = m * 60;
var d = h * 24;
var y = d * 365.25;
/**
* Parse or format the given `val`.
*
* Options:
*
* - `long` verbose formatting [false]
*
* @param {String|Number} val
* @param {Object} [options]
* @throws {Error} throw an error if val is not a non-empty string or a number
* @return {String|Number}
* @api public
*/
module.exports = function(val, options) {
options = options || {};
var type = typeof val;
if (type === 'string' && val.length > 0) {
return parse(val);
} else if (type === 'number' && isNaN(val) === false) {
return options.long ? fmtLong(val) : fmtShort(val);
}
throw new Error(
'val is not a non-empty string or a valid number. val=' +
JSON.stringify(val)
);
};
/**
* Parse the given `str` and return milliseconds.
*
* @param {String} str
* @return {Number}
* @api private
*/
function parse(str) {
str = String(str);
if (str.length > 100) {
return;
}
var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(
str
);
if (!match) {
return;
}
var n = parseFloat(match[1]);
var type = (match[2] || 'ms').toLowerCase();
switch (type) {
case 'years':
case 'year':
case 'yrs':
case 'yr':
case 'y':
return n * y;
case 'days':
case 'day':
case 'd':
return n * d;
case 'hours':
case 'hour':
case 'hrs':
case 'hr':
case 'h':
return n * h;
case 'minutes':
case 'minute':
case 'mins':
case 'min':
case 'm':
return n * m;
case 'seconds':
case 'second':
case 'secs':
case 'sec':
case 's':
return n * s;
case 'milliseconds':
case 'millisecond':
case 'msecs':
case 'msec':
case 'ms':
return n;
default:
return undefined;
}
}
/**
* Short format for `ms`.
*
* @param {Number} ms
* @return {String}
* @api private
*/
function fmtShort(ms) {
if (ms >= d) {
return Math.round(ms / d) + 'd';
}
if (ms >= h) {
return Math.round(ms / h) + 'h';
}
if (ms >= m) {
return Math.round(ms / m) + 'm';
}
if (ms >= s) {
return Math.round(ms / s) + 's';
}
return ms + 'ms';
}
/**
* Long format for `ms`.
*
* @param {Number} ms
* @return {String}
* @api private
*/
function fmtLong(ms) {
return plural(ms, d, 'day') ||
plural(ms, h, 'hour') ||
plural(ms, m, 'minute') ||
plural(ms, s, 'second') ||
ms + ' ms';
}
/**
* Pluralization helper.
*/
function plural(ms, n, name) {
if (ms < n) {
return;
}
if (ms < n * 1.5) {
return Math.floor(ms / n) + ' ' + name;
}
return Math.ceil(ms / n) + ' ' + name + 's';
}
},{}],388:[function(require,module,exports){
(function (process){(function (){
'use strict';
if (typeof process === 'undefined' ||
!process.version ||
process.version.indexOf('v0.') === 0 ||
process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {
module.exports = { nextTick: nextTick };
} else {
module.exports = process
}
function nextTick(fn, arg1, arg2, arg3) {
if (typeof fn !== 'function') {
throw new TypeError('"callback" argument must be a function');
}
var len = arguments.length;
var args, i;
switch (len) {
case 0:
case 1:
return process.nextTick(fn);
case 2:
return process.nextTick(function afterTickOne() {
fn.call(null, arg1);
});
case 3:
return process.nextTick(function afterTickTwo() {
fn.call(null, arg1, arg2);
});
case 4:
return process.nextTick(function afterTickThree() {
fn.call(null, arg1, arg2, arg3);
});
default:
args = new Array(len - 1);
i = 0;
while (i < args.length) {
args[i++] = arguments[i];
}
return process.nextTick(function afterTick() {
fn.apply(null, args);
});
}
}
}).call(this)}).call(this,require('_process'))
},{"_process":389}],389:[function(require,module,exports){
// shim for using process in browser
var process = module.exports = {};
// cached from whatever global is present so that test runners that stub it
// don't break things. But we need to wrap it in a try catch in case it is
// wrapped in strict mode code which doesn't define any globals. It's inside a
// function because try/catches deoptimize in certain engines.
var cachedSetTimeout;
var cachedClearTimeout;
function defaultSetTimout() {
throw new Error('setTimeout has not been defined');
}
function defaultClearTimeout () {
throw new Error('clearTimeout has not been defined');
}
(function () {
try {
if (typeof setTimeout === 'function') {
cachedSetTimeout = setTimeout;
} else {
cachedSetTimeout = defaultSetTimout;
}
} catch (e) {
cachedSetTimeout = defaultSetTimout;
}
try {
if (typeof clearTimeout === 'function') {
cachedClearTimeout = clearTimeout;
} else {
cachedClearTimeout = defaultClearTimeout;
}
} catch (e) {
cachedClearTimeout = defaultClearTimeout;
}
} ())
function runTimeout(fun) {
if (cachedSetTimeout === setTimeout) {
//normal enviroments in sane situations
return setTimeout(fun, 0);
}
// if setTimeout wasn't available but was latter defined
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
cachedSetTimeout = setTimeout;
return setTimeout(fun, 0);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedSetTimeout(fun, 0);
} catch(e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedSetTimeout.call(null, fun, 0);
} catch(e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
return cachedSetTimeout.call(this, fun, 0);
}
}
}
function runClearTimeout(marker) {
if (cachedClearTimeout === clearTimeout) {
//normal enviroments in sane situations
return clearTimeout(marker);
}
// if clearTimeout wasn't available but was latter defined
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
cachedClearTimeout = clearTimeout;
return clearTimeout(marker);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedClearTimeout(marker);
} catch (e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedClearTimeout.call(null, marker);
} catch (e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
return cachedClearTimeout.call(this, marker);
}
}
}
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;
function cleanUpNextTick() {
if (!draining || !currentQueue) {
return;
}
draining = false;
if (currentQueue.length) {
queue = currentQueue.concat(queue);
} else {
queueIndex = -1;
}
if (queue.length) {
drainQueue();
}
}
function drainQueue() {
if (draining) {
return;
}
var timeout = runTimeout(cleanUpNextTick);
draining = true;
var len = queue.length;
while(len) {
currentQueue = queue;
queue = [];
while (++queueIndex < len) {
if (currentQueue) {
currentQueue[queueIndex].run();
}
}
queueIndex = -1;
len = queue.length;
}
currentQueue = null;
draining = false;
runClearTimeout(timeout);
}
process.nextTick = function (fun) {
var args = new Array(arguments.length - 1);
if (arguments.length > 1) {
for (var i = 1; i < arguments.length; i++) {
args[i - 1] = arguments[i];
}
}
queue.push(new Item(fun, args));
if (queue.length === 1 && !draining) {
runTimeout(drainQueue);
}
};
// v8 likes predictible objects
function Item(fun, array) {
this.fun = fun;
this.array = array;
}
Item.prototype.run = function () {
this.fun.apply(null, this.array);
};
process.title = 'browser';
process.browser = true;
process.env = {};
process.argv = [];
process.version = ''; // empty string to avoid regexp issues
process.versions = {};
function noop() {}
process.on = noop;
process.addListener = noop;
process.once = noop;
process.off = noop;
process.removeListener = noop;
process.removeAllListeners = noop;
process.emit = noop;
process.prependListener = noop;
process.prependOnceListener = noop;
process.listeners = function (name) { return [] }
process.binding = function (name) {
throw new Error('process.binding is not supported');
};
process.cwd = function () { return '/' };
process.chdir = function (dir) {
throw new Error('process.chdir is not supported');
};
process.umask = function() { return 0; };
},{}],390:[function(require,module,exports){
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// a duplex stream is just a stream that is both readable and writable.
// Since JS doesn't have multiple prototypal inheritance, this class
// prototypally inherits from Readable, and then parasitically from
// Writable.
'use strict';
/*<replacement>*/
var pna = require('process-nextick-args');
/*</replacement>*/
/*<replacement>*/
var objectKeys = Object.keys || function (obj) {
var keys = [];
for (var key in obj) {
keys.push(key);
}return keys;
};
/*</replacement>*/
module.exports = Duplex;
/*<replacement>*/
var util = Object.create(require('core-util-is'));
util.inherits = require('inherits');
/*</replacement>*/
var Readable = require('./_stream_readable');
var Writable = require('./_stream_writable');
util.inherits(Duplex, Readable);
{
// avoid scope creep, the keys array can then be collected
var keys = objectKeys(Writable.prototype);
for (var v = 0; v < keys.length; v++) {
var method = keys[v];
if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
}
}
function Duplex(options) {
if (!(this instanceof Duplex)) return new Duplex(options);
Readable.call(this, options);
Writable.call(this, options);
if (options && options.readable === false) this.readable = false;
if (options && options.writable === false) this.writable = false;
this.allowHalfOpen = true;
if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
this.once('end', onend);
}
Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', {
// making it explicit this property is not enumerable
// because otherwise some prototype manipulation in
// userland will fail
enumerable: false,
get: function () {
return this._writableState.highWaterMark;
}
});
// the no-half-open enforcer
function onend() {
// if we allow half-open state, or if the writable side ended,
// then we're ok.
if (this.allowHalfOpen || this._writableState.ended) return;
// no more data can be written.
// But allow more writes to happen in this tick.
pna.nextTick(onEndNT, this);
}
function onEndNT(self) {
self.end();
}
Object.defineProperty(Duplex.prototype, 'destroyed', {
get: function () {
if (this._readableState === undefined || this._writableState === undefined) {
return false;
}
return this._readableState.destroyed && this._writableState.destroyed;
},
set: function (value) {
// we ignore the value if the stream
// has not been initialized yet
if (this._readableState === undefined || this._writableState === undefined) {
return;
}
// backward compatibility, the user is explicitly
// managing destroyed
this._readableState.destroyed = value;
this._writableState.destroyed = value;
}
});
Duplex.prototype._destroy = function (err, cb) {
this.push(null);
this.end();
pna.nextTick(cb, err);
};
},{"./_stream_readable":392,"./_stream_writable":394,"core-util-is":380,"inherits":384,"process-nextick-args":388}],391:[function(require,module,exports){
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// a passthrough stream.
// basically just the most minimal sort of Transform stream.
// Every written chunk gets output as-is.
'use strict';
module.exports = PassThrough;
var Transform = require('./_stream_transform');
/*<replacement>*/
var util = Object.create(require('core-util-is'));
util.inherits = require('inherits');
/*</replacement>*/
util.inherits(PassThrough, Transform);
function PassThrough(options) {
if (!(this instanceof PassThrough)) return new PassThrough(options);
Transform.call(this, options);
}
PassThrough.prototype._transform = function (chunk, encoding, cb) {
cb(null, chunk);
};
},{"./_stream_transform":393,"core-util-is":380,"inherits":384}],392:[function(require,module,exports){
(function (process,global){(function (){
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
'use strict';
/*<replacement>*/
var pna = require('process-nextick-args');
/*</replacement>*/
module.exports = Readable;
/*<replacement>*/
var isArray = require('isarray');
/*</replacement>*/
/*<replacement>*/
var Duplex;
/*</replacement>*/
Readable.ReadableState = ReadableState;
/*<replacement>*/
var EE = require('events').EventEmitter;
var EElistenerCount = function (emitter, type) {
return emitter.listeners(type).length;
};
/*</replacement>*/
/*<replacement>*/
var Stream = require('./internal/streams/stream');
/*</replacement>*/
/*<replacement>*/
var Buffer = require('safe-buffer').Buffer;
var OurUint8Array = global.Uint8Array || function () {};
function _uint8ArrayToBuffer(chunk) {
return Buffer.from(chunk);
}
function _isUint8Array(obj) {
return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
}
/*</replacement>*/
/*<replacement>*/
var util = Object.create(require('core-util-is'));
util.inherits = require('inherits');
/*</replacement>*/
/*<replacement>*/
var debugUtil = require('util');
var debug = void 0;
if (debugUtil && debugUtil.debuglog) {
debug = debugUtil.debuglog('stream');
} else {
debug = function () {};
}
/*</replacement>*/
var BufferList = require('./internal/streams/BufferList');
var destroyImpl = require('./internal/streams/destroy');
var StringDecoder;
util.inherits(Readable, Stream);
var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
function prependListener(emitter, event, fn) {
// Sadly this is not cacheable as some libraries bundle their own
// event emitter implementation with them.
if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);
// This is a hack to make sure that our error handler is attached before any
// userland ones. NEVER DO THIS. This is here only because this code needs
// to continue to work with older versions of Node.js that do not include
// the prependListener() method. The goal is to eventually remove this hack.
if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];
}
function ReadableState(options, stream) {
Duplex = Duplex || require('./_stream_duplex');
options = options || {};
// Duplex streams are both readable and writable, but share
// the same options object.
// However, some cases require setting options to different
// values for the readable and the writable sides of the duplex stream.
// These options can be provided separately as readableXXX and writableXXX.
var isDuplex = stream instanceof Duplex;
// object stream flag. Used to make read(n) ignore n and to
// make all the buffer merging and length checks go away
this.objectMode = !!options.objectMode;
if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
// the point at which it stops calling _read() to fill the buffer
// Note: 0 is a valid value, means "don't call _read preemptively ever"
var hwm = options.highWaterMark;
var readableHwm = options.readableHighWaterMark;
var defaultHwm = this.objectMode ? 16 : 16 * 1024;
if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;
// cast to ints.
this.highWaterMark = Math.floor(this.highWaterMark);
// A linked list is used to store data chunks instead of an array because the
// linked list can remove elements from the beginning faster than
// array.shift()
this.buffer = new BufferList();
this.length = 0;
this.pipes = null;
this.pipesCount = 0;
this.flowing = null;
this.ended = false;
this.endEmitted = false;
this.reading = false;
// a flag to be able to tell if the event 'readable'/'data' is emitted
// immediately, or on a later tick. We set this to true at first, because
// any actions that shouldn't happen until "later" should generally also
// not happen before the first read call.
this.sync = true;
// whenever we return null, then we set a flag to say
// that we're awaiting a 'readable' event emission.
this.needReadable = false;
this.emittedReadable = false;
this.readableListening = false;
this.resumeScheduled = false;
// has it been destroyed
this.destroyed = false;
// Crypto is kind of old and crusty. Historically, its default string
// encoding is 'binary' so we have to make this configurable.
// Everything else in the universe uses 'utf8', though.
this.defaultEncoding = options.defaultEncoding || 'utf8';
// the number of writers that are awaiting a drain event in .pipe()s
this.awaitDrain = 0;
// if true, a maybeReadMore has been scheduled
this.readingMore = false;
this.decoder = null;
this.encoding = null;
if (options.encoding) {
if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
this.decoder = new StringDecoder(options.encoding);
this.encoding = options.encoding;
}
}
function Readable(options) {
Duplex = Duplex || require('./_stream_duplex');
if (!(this instanceof Readable)) return new Readable(options);
this._readableState = new ReadableState(options, this);
// legacy
this.readable = true;
if (options) {
if (typeof options.read === 'function') this._read = options.read;
if (typeof options.destroy === 'function') this._destroy = options.destroy;
}
Stream.call(this);
}
Object.defineProperty(Readable.prototype, 'destroyed', {
get: function () {
if (this._readableState === undefined) {
return false;
}
return this._readableState.destroyed;
},
set: function (value) {
// we ignore the value if the stream
// has not been initialized yet
if (!this._readableState) {
return;
}
// backward compatibility, the user is explicitly
// managing destroyed
this._readableState.destroyed = value;
}
});
Readable.prototype.destroy = destroyImpl.destroy;
Readable.prototype._undestroy = destroyImpl.undestroy;
Readable.prototype._destroy = function (err, cb) {
this.push(null);
cb(err);
};
// Manually shove something into the read() buffer.
// This returns true if the highWaterMark has not been hit yet,
// similar to how Writable.write() returns true if you should
// write() some more.
Readable.prototype.push = function (chunk, encoding) {
var state = this._readableState;
var skipChunkCheck;
if (!state.objectMode) {
if (typeof chunk === 'string') {
encoding = encoding || state.defaultEncoding;
if (encoding !== state.encoding) {
chunk = Buffer.from(chunk, encoding);
encoding = '';
}
skipChunkCheck = true;
}
} else {
skipChunkCheck = true;
}
return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
};
// Unshift should *always* be something directly out of read()
Readable.prototype.unshift = function (chunk) {
return readableAddChunk(this, chunk, null, true, false);
};
function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
var state = stream._readableState;
if (chunk === null) {
state.reading = false;
onEofChunk(stream, state);
} else {
var er;
if (!skipChunkCheck) er = chunkInvalid(state, chunk);
if (er) {
stream.emit('error', er);
} else if (state.objectMode || chunk && chunk.length > 0) {
if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
chunk = _uint8ArrayToBuffer(chunk);
}
if (addToFront) {
if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);
} else if (state.ended) {
stream.emit('error', new Error('stream.push() after EOF'));
} else {
state.reading = false;
if (state.decoder && !encoding) {
chunk = state.decoder.write(chunk);
if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);
} else {
addChunk(stream, state, chunk, false);
}
}
} else if (!addToFront) {
state.reading = false;
}
}
return needMoreData(state);
}
function addChunk(stream, state, chunk, addToFront) {
if (state.flowing && state.length === 0 && !state.sync) {
stream.emit('data', chunk);
stream.read(0);
} else {
// update the buffer info.
state.length += state.objectMode ? 1 : chunk.length;
if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
if (state.needReadable) emitReadable(stream);
}
maybeReadMore(stream, state);
}
function chunkInvalid(state, chunk) {
var er;
if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
er = new TypeError('Invalid non-string/buffer chunk');
}
return er;
}
// if it's past the high water mark, we can push in some more.
// Also, if we have no data yet, we can stand some
// more bytes. This is to work around cases where hwm=0,
// such as the repl. Also, if the push() triggered a
// readable event, and the user called read(largeNumber) such that
// needReadable was set, then we ought to push more, so that another
// 'readable' event will be triggered.
function needMoreData(state) {
return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
}
Readable.prototype.isPaused = function () {
return this._readableState.flowing === false;
};
// backwards compatibility.
Readable.prototype.setEncoding = function (enc) {
if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
this._readableState.decoder = new StringDecoder(enc);
this._readableState.encoding = enc;
return this;
};
// Don't raise the hwm > 8MB
var MAX_HWM = 0x800000;
function computeNewHighWaterMark(n) {
if (n >= MAX_HWM) {
n = MAX_HWM;
} else {
// Get the next highest power of 2 to prevent increasing hwm excessively in
// tiny amounts
n--;
n |= n >>> 1;
n |= n >>> 2;
n |= n >>> 4;
n |= n >>> 8;
n |= n >>> 16;
n++;
}
return n;
}
// This function is designed to be inlinable, so please take care when making
// changes to the function body.
function howMuchToRead(n, state) {
if (n <= 0 || state.length === 0 && state.ended) return 0;
if (state.objectMode) return 1;
if (n !== n) {
// Only flow one buffer at a time
if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
}
// If we're asking for more than the current hwm, then raise the hwm.
if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
if (n <= state.length) return n;
// Don't have enough
if (!state.ended) {
state.needReadable = true;
return 0;
}
return state.length;
}
// you can override either this method, or the async _read(n) below.
Readable.prototype.read = function (n) {
debug('read', n);
n = parseInt(n, 10);
var state = this._readableState;
var nOrig = n;
if (n !== 0) state.emittedReadable = false;
// if we're doing read(0) to trigger a readable event, but we
// already have a bunch of data in the buffer, then just trigger
// the 'readable' event and move on.
if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
debug('read: emitReadable', state.length, state.ended);
if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
return null;
}
n = howMuchToRead(n, state);
// if we've ended, and we're now clear, then finish it up.
if (n === 0 && state.ended) {
if (state.length === 0) endReadable(this);
return null;
}
// All the actual chunk generation logic needs to be
// *below* the call to _read. The reason is that in certain
// synthetic stream cases, such as passthrough streams, _read
// may be a completely synchronous operation which may change
// the state of the read buffer, providing enough data when
// before there was *not* enough.
//
// So, the steps are:
// 1. Figure out what the state of things will be after we do
// a read from the buffer.
//
// 2. If that resulting state will trigger a _read, then call _read.
// Note that this may be asynchronous, or synchronous. Yes, it is
// deeply ugly to write APIs this way, but that still doesn't mean
// that the Readable class should behave improperly, as streams are
// designed to be sync/async agnostic.
// Take note if the _read call is sync or async (ie, if the read call
// has returned yet), so that we know whether or not it's safe to emit
// 'readable' etc.
//
// 3. Actually pull the requested chunks out of the buffer and return.
// if we need a readable event, then we need to do some reading.
var doRead = state.needReadable;
debug('need readable', doRead);
// if we currently have less than the highWaterMark, then also read some
if (state.length === 0 || state.length - n < state.highWaterMark) {
doRead = true;
debug('length less than watermark', doRead);
}
// however, if we've ended, then there's no point, and if we're already
// reading, then it's unnecessary.
if (state.ended || state.reading) {
doRead = false;
debug('reading or ended', doRead);
} else if (doRead) {
debug('do read');
state.reading = true;
state.sync = true;
// if the length is currently zero, then we *need* a readable event.
if (state.length === 0) state.needReadable = true;
// call internal read method
this._read(state.highWaterMark);
state.sync = false;
// If _read pushed data synchronously, then `reading` will be false,
// and we need to re-evaluate how much data we can return to the user.
if (!state.reading) n = howMuchToRead(nOrig, state);
}
var ret;
if (n > 0) ret = fromList(n, state);else ret = null;
if (ret === null) {
state.needReadable = true;
n = 0;
} else {
state.length -= n;
}
if (state.length === 0) {
// If we have nothing in the buffer, then we want to know
// as soon as we *do* get something into the buffer.
if (!state.ended) state.needReadable = true;
// If we tried to read() past the EOF, then emit end on the next tick.
if (nOrig !== n && state.ended) endReadable(this);
}
if (ret !== null) this.emit('data', ret);
return ret;
};
function onEofChunk(stream, state) {
if (state.ended) return;
if (state.decoder) {
var chunk = state.decoder.end();
if (chunk && chunk.length) {
state.buffer.push(chunk);
state.length += state.objectMode ? 1 : chunk.length;
}
}
state.ended = true;
// emit 'readable' now to make sure it gets picked up.
emitReadable(stream);
}
// Don't emit readable right away in sync mode, because this can trigger
// another read() call => stack overflow. This way, it might trigger
// a nextTick recursion warning, but that's not so bad.
function emitReadable(stream) {
var state = stream._readableState;
state.needReadable = false;
if (!state.emittedReadable) {
debug('emitReadable', state.flowing);
state.emittedReadable = true;
if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);
}
}
function emitReadable_(stream) {
debug('emit readable');
stream.emit('readable');
flow(stream);
}
// at this point, the user has presumably seen the 'readable' event,
// and called read() to consume some data. that may have triggered
// in turn another _read(n) call, in which case reading = true if
// it's in progress.
// However, if we're not ended, or reading, and the length < hwm,
// then go ahead and try to read some more preemptively.
function maybeReadMore(stream, state) {
if (!state.readingMore) {
state.readingMore = true;
pna.nextTick(maybeReadMore_, stream, state);
}
}
function maybeReadMore_(stream, state) {
var len = state.length;
while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
debug('maybeReadMore read 0');
stream.read(0);
if (len === state.length)
// didn't get any data, stop spinning.
break;else len = state.length;
}
state.readingMore = false;
}
// abstract method. to be overridden in specific implementation classes.
// call cb(er, data) where data is <= n in length.
// for virtual (non-string, non-buffer) streams, "length" is somewhat
// arbitrary, and perhaps not very meaningful.
Readable.prototype._read = function (n) {
this.emit('error', new Error('_read() is not implemented'));
};
Readable.prototype.pipe = function (dest, pipeOpts) {
var src = this;
var state = this._readableState;
switch (state.pipesCount) {
case 0:
state.pipes = dest;
break;
case 1:
state.pipes = [state.pipes, dest];
break;
default:
state.pipes.push(dest);
break;
}
state.pipesCount += 1;
debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
var endFn = doEnd ? onend : unpipe;
if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);
dest.on('unpipe', onunpipe);
function onunpipe(readable, unpipeInfo) {
debug('onunpipe');
if (readable === src) {
if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
unpipeInfo.hasUnpiped = true;
cleanup();
}
}
}
function onend() {
debug('onend');
dest.end();
}
// when the dest drains, it reduces the awaitDrain counter
// on the source. This would be more elegant with a .once()
// handler in flow(), but adding and removing repeatedly is
// too slow.
var ondrain = pipeOnDrain(src);
dest.on('drain', ondrain);
var cleanedUp = false;
function cleanup() {
debug('cleanup');
// cleanup event handlers once the pipe is broken
dest.removeListener('close', onclose);
dest.removeListener('finish', onfinish);
dest.removeListener('drain', ondrain);
dest.removeListener('error', onerror);
dest.removeListener('unpipe', onunpipe);
src.removeListener('end', onend);
src.removeListener('end', unpipe);
src.removeListener('data', ondata);
cleanedUp = true;
// if the reader is waiting for a drain event from this
// specific writer, then it would cause it to never start
// flowing again.
// So, if this is awaiting a drain, then we just call it now.
// If we don't know, then assume that we are waiting for one.
if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
}
// If the user pushes more data while we're writing to dest then we'll end up
// in ondata again. However, we only want to increase awaitDrain once because
// dest will only emit one 'drain' event for the multiple writes.
// => Introduce a guard on increasing awaitDrain.
var increasedAwaitDrain = false;
src.on('data', ondata);
function ondata(chunk) {
debug('ondata');
increasedAwaitDrain = false;
var ret = dest.write(chunk);
if (false === ret && !increasedAwaitDrain) {
// If the user unpiped during `dest.write()`, it is possible
// to get stuck in a permanently paused state if that write
// also returned false.
// => Check whether `dest` is still a piping destination.
if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
debug('false write response, pause', src._readableState.awaitDrain);
src._readableState.awaitDrain++;
increasedAwaitDrain = true;
}
src.pause();
}
}
// if the dest has an error, then stop piping into it.
// however, don't suppress the throwing behavior for this.
function onerror(er) {
debug('onerror', er);
unpipe();
dest.removeListener('error', onerror);
if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);
}
// Make sure our error handler is attached before userland ones.
prependListener(dest, 'error', onerror);
// Both close and finish should trigger unpipe, but only once.
function onclose() {
dest.removeListener('finish', onfinish);
unpipe();
}
dest.once('close', onclose);
function onfinish() {
debug('onfinish');
dest.removeListener('close', onclose);
unpipe();
}
dest.once('finish', onfinish);
function unpipe() {
debug('unpipe');
src.unpipe(dest);
}
// tell the dest that it's being piped to
dest.emit('pipe', src);
// start the flow if it hasn't been started already.
if (!state.flowing) {
debug('pipe resume');
src.resume();
}
return dest;
};
function pipeOnDrain(src) {
return function () {
var state = src._readableState;
debug('pipeOnDrain', state.awaitDrain);
if (state.awaitDrain) state.awaitDrain--;
if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
state.flowing = true;
flow(src);
}
};
}
Readable.prototype.unpipe = function (dest) {
var state = this._readableState;
var unpipeInfo = { hasUnpiped: false };
// if we're not piping anywhere, then do nothing.
if (state.pipesCount === 0) return this;
// just one destination. most common case.
if (state.pipesCount === 1) {
// passed in one, but it's not the right one.
if (dest && dest !== state.pipes) return this;
if (!dest) dest = state.pipes;
// got a match.
state.pipes = null;
state.pipesCount = 0;
state.flowing = false;
if (dest) dest.emit('unpipe', this, unpipeInfo);
return this;
}
// slow case. multiple pipe destinations.
if (!dest) {
// remove all.
var dests = state.pipes;
var len = state.pipesCount;
state.pipes = null;
state.pipesCount = 0;
state.flowing = false;
for (var i = 0; i < len; i++) {
dests[i].emit('unpipe', this, unpipeInfo);
}return this;
}
// try to find the right one.
var index = indexOf(state.pipes, dest);
if (index === -1) return this;
state.pipes.splice(index, 1);
state.pipesCount -= 1;
if (state.pipesCount === 1) state.pipes = state.pipes[0];
dest.emit('unpipe', this, unpipeInfo);
return this;
};
// set up data events if they are asked for
// Ensure readable listeners eventually get something
Readable.prototype.on = function (ev, fn) {
var res = Stream.prototype.on.call(this, ev, fn);
if (ev === 'data') {
// Start flowing on next tick if stream isn't explicitly paused
if (this._readableState.flowing !== false) this.resume();
} else if (ev === 'readable') {
var state = this._readableState;
if (!state.endEmitted && !state.readableListening) {
state.readableListening = state.needReadable = true;
state.emittedReadable = false;
if (!state.reading) {
pna.nextTick(nReadingNextTick, this);
} else if (state.length) {
emitReadable(this);
}
}
}
return res;
};
Readable.prototype.addListener = Readable.prototype.on;
function nReadingNextTick(self) {
debug('readable nexttick read 0');
self.read(0);
}
// pause() and resume() are remnants of the legacy readable stream API
// If the user uses them, then switch into old mode.
Readable.prototype.resume = function () {
var state = this._readableState;
if (!state.flowing) {
debug('resume');
state.flowing = true;
resume(this, state);
}
return this;
};
function resume(stream, state) {
if (!state.resumeScheduled) {
state.resumeScheduled = true;
pna.nextTick(resume_, stream, state);
}
}
function resume_(stream, state) {
if (!state.reading) {
debug('resume read 0');
stream.read(0);
}
state.resumeScheduled = false;
state.awaitDrain = 0;
stream.emit('resume');
flow(stream);
if (state.flowing && !state.reading) stream.read(0);
}
Readable.prototype.pause = function () {
debug('call pause flowing=%j', this._readableState.flowing);
if (false !== this._readableState.flowing) {
debug('pause');
this._readableState.flowing = false;
this.emit('pause');
}
return this;
};
function flow(stream) {
var state = stream._readableState;
debug('flow', state.flowing);
while (state.flowing && stream.read() !== null) {}
}
// wrap an old-style stream as the async data source.
// This is *not* part of the readable stream interface.
// It is an ugly unfortunate mess of history.
Readable.prototype.wrap = function (stream) {
var _this = this;
var state = this._readableState;
var paused = false;
stream.on('end', function () {
debug('wrapped end');
if (state.decoder && !state.ended) {
var chunk = state.decoder.end();
if (chunk && chunk.length) _this.push(chunk);
}
_this.push(null);
});
stream.on('data', function (chunk) {
debug('wrapped data');
if (state.decoder) chunk = state.decoder.write(chunk);
// don't skip over falsy values in objectMode
if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
var ret = _this.push(chunk);
if (!ret) {
paused = true;
stream.pause();
}
});
// proxy all the other methods.
// important when wrapping filters and duplexes.
for (var i in stream) {
if (this[i] === undefined && typeof stream[i] === 'function') {
this[i] = function (method) {
return function () {
return stream[method].apply(stream, arguments);
};
}(i);
}
}
// proxy certain important events.
for (var n = 0; n < kProxyEvents.length; n++) {
stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
}
// when we try to consume some more bytes, simply unpause the
// underlying stream.
this._read = function (n) {
debug('wrapped _read', n);
if (paused) {
paused = false;
stream.resume();
}
};
return this;
};
Object.defineProperty(Readable.prototype, 'readableHighWaterMark', {
// making it explicit this property is not enumerable
// because otherwise some prototype manipulation in
// userland will fail
enumerable: false,
get: function () {
return this._readableState.highWaterMark;
}
});
// exposed for testing purposes only.
Readable._fromList = fromList;
// Pluck off n bytes from an array of buffers.
// Length is the combined lengths of all the buffers in the list.
// This function is designed to be inlinable, so please take care when making
// changes to the function body.
function fromList(n, state) {
// nothing buffered
if (state.length === 0) return null;
var ret;
if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
// read it all, truncate the list
if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);
state.buffer.clear();
} else {
// read part of list
ret = fromListPartial(n, state.buffer, state.decoder);
}
return ret;
}
// Extracts only enough buffered data to satisfy the amount requested.
// This function is designed to be inlinable, so please take care when making
// changes to the function body.
function fromListPartial(n, list, hasStrings) {
var ret;
if (n < list.head.data.length) {
// slice is the same for buffers and strings
ret = list.head.data.slice(0, n);
list.head.data = list.head.data.slice(n);
} else if (n === list.head.data.length) {
// first chunk is a perfect match
ret = list.shift();
} else {
// result spans more than one buffer
ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
}
return ret;
}
// Copies a specified amount of characters from the list of buffered data
// chunks.
// This function is designed to be inlinable, so please take care when making
// changes to the function body.
function copyFromBufferString(n, list) {
var p = list.head;
var c = 1;
var ret = p.data;
n -= ret.length;
while (p = p.next) {
var str = p.data;
var nb = n > str.length ? str.length : n;
if (nb === str.length) ret += str;else ret += str.slice(0, n);
n -= nb;
if (n === 0) {
if (nb === str.length) {
++c;
if (p.next) list.head = p.next;else list.head = list.tail = null;
} else {
list.head = p;
p.data = str.slice(nb);
}
break;
}
++c;
}
list.length -= c;
return ret;
}
// Copies a specified amount of bytes from the list of buffered data chunks.
// This function is designed to be inlinable, so please take care when making
// changes to the function body.
function copyFromBuffer(n, list) {
var ret = Buffer.allocUnsafe(n);
var p = list.head;
var c = 1;
p.data.copy(ret);
n -= p.data.length;
while (p = p.next) {
var buf = p.data;
var nb = n > buf.length ? buf.length : n;
buf.copy(ret, ret.length - n, 0, nb);
n -= nb;
if (n === 0) {
if (nb === buf.length) {
++c;
if (p.next) list.head = p.next;else list.head = list.tail = null;
} else {
list.head = p;
p.data = buf.slice(nb);
}
break;
}
++c;
}
list.length -= c;
return ret;
}
function endReadable(stream) {
var state = stream._readableState;
// If we get here before consuming all the bytes, then that is a
// bug in node. Should never happen.
if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream');
if (!state.endEmitted) {
state.ended = true;
pna.nextTick(endReadableNT, state, stream);
}
}
function endReadableNT(state, stream) {
// Check that we didn't get one last unshift.
if (!state.endEmitted && state.length === 0) {
state.endEmitted = true;
stream.readable = false;
stream.emit('end');
}
}
function indexOf(xs, x) {
for (var i = 0, l = xs.length; i < l; i++) {
if (xs[i] === x) return i;
}
return -1;
}
}).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"./_stream_duplex":390,"./internal/streams/BufferList":395,"./internal/streams/destroy":396,"./internal/streams/stream":397,"_process":389,"core-util-is":380,"events":378,"inherits":384,"isarray":386,"process-nextick-args":388,"safe-buffer":399,"string_decoder/":400,"util":377}],393:[function(require,module,exports){
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// a transform stream is a readable/writable stream where you do
// something with the data. Sometimes it's called a "filter",
// but that's not a great name for it, since that implies a thing where
// some bits pass through, and others are simply ignored. (That would
// be a valid example of a transform, of course.)
//
// While the output is causally related to the input, it's not a
// necessarily symmetric or synchronous transformation. For example,
// a zlib stream might take multiple plain-text writes(), and then
// emit a single compressed chunk some time in the future.
//
// Here's how this works:
//
// The Transform stream has all the aspects of the readable and writable
// stream classes. When you write(chunk), that calls _write(chunk,cb)
// internally, and returns false if there's a lot of pending writes
// buffered up. When you call read(), that calls _read(n) until
// there's enough pending readable data buffered up.
//
// In a transform stream, the written data is placed in a buffer. When
// _read(n) is called, it transforms the queued up data, calling the
// buffered _write cb's as it consumes chunks. If consuming a single
// written chunk would result in multiple output chunks, then the first
// outputted bit calls the readcb, and subsequent chunks just go into
// the read buffer, and will cause it to emit 'readable' if necessary.
//
// This way, back-pressure is actually determined by the reading side,
// since _read has to be called to start processing a new chunk. However,
// a pathological inflate type of transform can cause excessive buffering
// here. For example, imagine a stream where every byte of input is
// interpreted as an integer from 0-255, and then results in that many
// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
// 1kb of data being output. In this case, you could write a very small
// amount of input, and end up with a very large amount of output. In
// such a pathological inflating mechanism, there'd be no way to tell
// the system to stop doing the transform. A single 4MB write could
// cause the system to run out of memory.
//
// However, even in such a pathological case, only a single written chunk
// would be consumed, and then the rest would wait (un-transformed) until
// the results of the previous transformed chunk were consumed.
'use strict';
module.exports = Transform;
var Duplex = require('./_stream_duplex');
/*<replacement>*/
var util = Object.create(require('core-util-is'));
util.inherits = require('inherits');
/*</replacement>*/
util.inherits(Transform, Duplex);
function afterTransform(er, data) {
var ts = this._transformState;
ts.transforming = false;
var cb = ts.writecb;
if (!cb) {
return this.emit('error', new Error('write callback called multiple times'));
}
ts.writechunk = null;
ts.writecb = null;
if (data != null) // single equals check for both `null` and `undefined`
this.push(data);
cb(er);
var rs = this._readableState;
rs.reading = false;
if (rs.needReadable || rs.length < rs.highWaterMark) {
this._read(rs.highWaterMark);
}
}
function Transform(options) {
if (!(this instanceof Transform)) return new Transform(options);
Duplex.call(this, options);
this._transformState = {
afterTransform: afterTransform.bind(this),
needTransform: false,
transforming: false,
writecb: null,
writechunk: null,
writeencoding: null
};
// start out asking for a readable event once data is transformed.
this._readableState.needReadable = true;
// we have implemented the _read method, and done the other things
// that Readable wants before the first _read call, so unset the
// sync guard flag.
this._readableState.sync = false;
if (options) {
if (typeof options.transform === 'function') this._transform = options.transform;
if (typeof options.flush === 'function') this._flush = options.flush;
}
// When the writable side finishes, then flush out anything remaining.
this.on('prefinish', prefinish);
}
function prefinish() {
var _this = this;
if (typeof this._flush === 'function') {
this._flush(function (er, data) {
done(_this, er, data);
});
} else {
done(this, null, null);
}
}
Transform.prototype.push = function (chunk, encoding) {
this._transformState.needTransform = false;
return Duplex.prototype.push.call(this, chunk, encoding);
};
// This is the part where you do stuff!
// override this function in implementation classes.
// 'chunk' is an input chunk.
//
// Call `push(newChunk)` to pass along transformed output
// to the readable side. You may call 'push' zero or more times.
//
// Call `cb(err)` when you are done with this chunk. If you pass
// an error, then that'll put the hurt on the whole operation. If you
// never call cb(), then you'll never get another chunk.
Transform.prototype._transform = function (chunk, encoding, cb) {
throw new Error('_transform() is not implemented');
};
Transform.prototype._write = function (chunk, encoding, cb) {
var ts = this._transformState;
ts.writecb = cb;
ts.writechunk = chunk;
ts.writeencoding = encoding;
if (!ts.transforming) {
var rs = this._readableState;
if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
}
};
// Doesn't matter what the args are here.
// _transform does all the work.
// That we got here means that the readable side wants more data.
Transform.prototype._read = function (n) {
var ts = this._transformState;
if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
ts.transforming = true;
this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
} else {
// mark that we need a transform, so that any data that comes in
// will get processed, now that we've asked for it.
ts.needTransform = true;
}
};
Transform.prototype._destroy = function (err, cb) {
var _this2 = this;
Duplex.prototype._destroy.call(this, err, function (err2) {
cb(err2);
_this2.emit('close');
});
};
function done(stream, er, data) {
if (er) return stream.emit('error', er);
if (data != null) // single equals check for both `null` and `undefined`
stream.push(data);
// if there's nothing in the write buffer, then that means
// that nothing more will ever be provided
if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');
if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');
return stream.push(null);
}
},{"./_stream_duplex":390,"core-util-is":380,"inherits":384}],394:[function(require,module,exports){
(function (process,global,setImmediate){(function (){
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// A bit simpler than readable streams.
// Implement an async ._write(chunk, encoding, cb), and it'll handle all
// the drain event emission and buffering.
'use strict';
/*<replacement>*/
var pna = require('process-nextick-args');
/*</replacement>*/
module.exports = Writable;
/* <replacement> */
function WriteReq(chunk, encoding, cb) {
this.chunk = chunk;
this.encoding = encoding;
this.callback = cb;
this.next = null;
}
// It seems a linked list but it is not
// there will be only 2 of these for each stream
function CorkedRequest(state) {
var _this = this;
this.next = null;
this.entry = null;
this.finish = function () {
onCorkedFinish(_this, state);
};
}
/* </replacement> */
/*<replacement>*/
var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;
/*</replacement>*/
/*<replacement>*/
var Duplex;
/*</replacement>*/
Writable.WritableState = WritableState;
/*<replacement>*/
var util = Object.create(require('core-util-is'));
util.inherits = require('inherits');
/*</replacement>*/
/*<replacement>*/
var internalUtil = {
deprecate: require('util-deprecate')
};
/*</replacement>*/
/*<replacement>*/
var Stream = require('./internal/streams/stream');
/*</replacement>*/
/*<replacement>*/
var Buffer = require('safe-buffer').Buffer;
var OurUint8Array = global.Uint8Array || function () {};
function _uint8ArrayToBuffer(chunk) {
return Buffer.from(chunk);
}
function _isUint8Array(obj) {
return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
}
/*</replacement>*/
var destroyImpl = require('./internal/streams/destroy');
util.inherits(Writable, Stream);
function nop() {}
function WritableState(options, stream) {
Duplex = Duplex || require('./_stream_duplex');
options = options || {};
// Duplex streams are both readable and writable, but share
// the same options object.
// However, some cases require setting options to different
// values for the readable and the writable sides of the duplex stream.
// These options can be provided separately as readableXXX and writableXXX.
var isDuplex = stream instanceof Duplex;
// object stream flag to indicate whether or not this stream
// contains buffers or objects.
this.objectMode = !!options.objectMode;
if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
// the point at which write() starts returning false
// Note: 0 is a valid value, means that we always return false if
// the entire buffer is not flushed immediately on write()
var hwm = options.highWaterMark;
var writableHwm = options.writableHighWaterMark;
var defaultHwm = this.objectMode ? 16 : 16 * 1024;
if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;
// cast to ints.
this.highWaterMark = Math.floor(this.highWaterMark);
// if _final has been called
this.finalCalled = false;
// drain event flag.
this.needDrain = false;
// at the start of calling end()
this.ending = false;
// when end() has been called, and returned
this.ended = false;
// when 'finish' is emitted
this.finished = false;
// has it been destroyed
this.destroyed = false;
// should we decode strings into buffers before passing to _write?
// this is here so that some node-core streams can optimize string
// handling at a lower level.
var noDecode = options.decodeStrings === false;
this.decodeStrings = !noDecode;
// Crypto is kind of old and crusty. Historically, its default string
// encoding is 'binary' so we have to make this configurable.
// Everything else in the universe uses 'utf8', though.
this.defaultEncoding = options.defaultEncoding || 'utf8';
// not an actual buffer we keep track of, but a measurement
// of how much we're waiting to get pushed to some underlying
// socket or file.
this.length = 0;
// a flag to see when we're in the middle of a write.
this.writing = false;
// when true all writes will be buffered until .uncork() call
this.corked = 0;
// a flag to be able to tell if the onwrite cb is called immediately,
// or on a later tick. We set this to true at first, because any
// actions that shouldn't happen until "later" should generally also
// not happen before the first write call.
this.sync = true;
// a flag to know if we're processing previously buffered items, which
// may call the _write() callback in the same tick, so that we don't
// end up in an overlapped onwrite situation.
this.bufferProcessing = false;
// the callback that's passed to _write(chunk,cb)
this.onwrite = function (er) {
onwrite(stream, er);
};
// the callback that the user supplies to write(chunk,encoding,cb)
this.writecb = null;
// the amount that is being written when _write is called.
this.writelen = 0;
this.bufferedRequest = null;
this.lastBufferedRequest = null;
// number of pending user-supplied write callbacks
// this must be 0 before 'finish' can be emitted
this.pendingcb = 0;
// emit prefinish if the only thing we're waiting for is _write cbs
// This is relevant for synchronous Transform streams
this.prefinished = false;
// True if the error was already emitted and should not be thrown again
this.errorEmitted = false;
// count buffered requests
this.bufferedRequestCount = 0;
// allocate the first CorkedRequest, there is always
// one allocated and free to use, and we maintain at most two
this.corkedRequestsFree = new CorkedRequest(this);
}
WritableState.prototype.getBuffer = function getBuffer() {
var current = this.bufferedRequest;
var out = [];
while (current) {
out.push(current);
current = current.next;
}
return out;
};
(function () {
try {
Object.defineProperty(WritableState.prototype, 'buffer', {
get: internalUtil.deprecate(function () {
return this.getBuffer();
}, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')
});
} catch (_) {}
})();
// Test _writableState for inheritance to account for Duplex streams,
// whose prototype chain only points to Readable.
var realHasInstance;
if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
realHasInstance = Function.prototype[Symbol.hasInstance];
Object.defineProperty(Writable, Symbol.hasInstance, {
value: function (object) {
if (realHasInstance.call(this, object)) return true;
if (this !== Writable) return false;
return object && object._writableState instanceof WritableState;
}
});
} else {
realHasInstance = function (object) {
return object instanceof this;
};
}
function Writable(options) {
Duplex = Duplex || require('./_stream_duplex');
// Writable ctor is applied to Duplexes, too.
// `realHasInstance` is necessary because using plain `instanceof`
// would return false, as no `_writableState` property is attached.
// Trying to use the custom `instanceof` for Writable here will also break the
// Node.js LazyTransform implementation, which has a non-trivial getter for
// `_writableState` that would lead to infinite recursion.
if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {
return new Writable(options);
}
this._writableState = new WritableState(options, this);
// legacy.
this.writable = true;
if (options) {
if (typeof options.write === 'function') this._write = options.write;
if (typeof options.writev === 'function') this._writev = options.writev;
if (typeof options.destroy === 'function') this._destroy = options.destroy;
if (typeof options.final === 'function') this._final = options.final;
}
Stream.call(this);
}
// Otherwise people can pipe Writable streams, which is just wrong.
Writable.prototype.pipe = function () {
this.emit('error', new Error('Cannot pipe, not readable'));
};
function writeAfterEnd(stream, cb) {
var er = new Error('write after end');
// TODO: defer error events consistently everywhere, not just the cb
stream.emit('error', er);
pna.nextTick(cb, er);
}
// Checks that a user-supplied chunk is valid, especially for the particular
// mode the stream is in. Currently this means that `null` is never accepted
// and undefined/non-string values are only allowed in object mode.
function validChunk(stream, state, chunk, cb) {
var valid = true;
var er = false;
if (chunk === null) {
er = new TypeError('May not write null values to stream');
} else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
er = new TypeError('Invalid non-string/buffer chunk');
}
if (er) {
stream.emit('error', er);
pna.nextTick(cb, er);
valid = false;
}
return valid;
}
Writable.prototype.write = function (chunk, encoding, cb) {
var state = this._writableState;
var ret = false;
var isBuf = !state.objectMode && _isUint8Array(chunk);
if (isBuf && !Buffer.isBuffer(chunk)) {
chunk = _uint8ArrayToBuffer(chunk);
}
if (typeof encoding === 'function') {
cb = encoding;
encoding = null;
}
if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
if (typeof cb !== 'function') cb = nop;
if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {
state.pendingcb++;
ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
}
return ret;
};
Writable.prototype.cork = function () {
var state = this._writableState;
state.corked++;
};
Writable.prototype.uncork = function () {
var state = this._writableState;
if (state.corked) {
state.corked--;
if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
}
};
Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
// node::ParseEncoding() requires lower case.
if (typeof encoding === 'string') encoding = encoding.toLowerCase();
if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);
this._writableState.defaultEncoding = encoding;
return this;
};
function decodeChunk(state, chunk, encoding) {
if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
chunk = Buffer.from(chunk, encoding);
}
return chunk;
}
Object.defineProperty(Writable.prototype, 'writableHighWaterMark', {
// making it explicit this property is not enumerable
// because otherwise some prototype manipulation in
// userland will fail
enumerable: false,
get: function () {
return this._writableState.highWaterMark;
}
});
// if we're already writing something, then just put this
// in the queue, and wait our turn. Otherwise, call _write
// If we return false, then we need a drain event, so set that flag.
function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
if (!isBuf) {
var newChunk = decodeChunk(state, chunk, encoding);
if (chunk !== newChunk) {
isBuf = true;
encoding = 'buffer';
chunk = newChunk;
}
}
var len = state.objectMode ? 1 : chunk.length;
state.length += len;
var ret = state.length < state.highWaterMark;
// we must ensure that previous needDrain will not be reset to false.
if (!ret) state.needDrain = true;
if (state.writing || state.corked) {
var last = state.lastBufferedRequest;
state.lastBufferedRequest = {
chunk: chunk,
encoding: encoding,
isBuf: isBuf,
callback: cb,
next: null
};
if (last) {
last.next = state.lastBufferedRequest;
} else {
state.bufferedRequest = state.lastBufferedRequest;
}
state.bufferedRequestCount += 1;
} else {
doWrite(stream, state, false, len, chunk, encoding, cb);
}
return ret;
}
function doWrite(stream, state, writev, len, chunk, encoding, cb) {
state.writelen = len;
state.writecb = cb;
state.writing = true;
state.sync = true;
if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
state.sync = false;
}
function onwriteError(stream, state, sync, er, cb) {
--state.pendingcb;
if (sync) {
// defer the callback if we are being called synchronously
// to avoid piling up things on the stack
pna.nextTick(cb, er);
// this can emit finish, and it will always happen
// after error
pna.nextTick(finishMaybe, stream, state);
stream._writableState.errorEmitted = true;
stream.emit('error', er);
} else {
// the caller expect this to happen before if
// it is async
cb(er);
stream._writableState.errorEmitted = true;
stream.emit('error', er);
// this can emit finish, but finish must
// always follow error
finishMaybe(stream, state);
}
}
function onwriteStateUpdate(state) {
state.writing = false;
state.writecb = null;
state.length -= state.writelen;
state.writelen = 0;
}
function onwrite(stream, er) {
var state = stream._writableState;
var sync = state.sync;
var cb = state.writecb;
onwriteStateUpdate(state);
if (er) onwriteError(stream, state, sync, er, cb);else {
// Check if we're actually ready to finish, but don't emit yet
var finished = needFinish(state);
if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
clearBuffer(stream, state);
}
if (sync) {
/*<replacement>*/
asyncWrite(afterWrite, stream, state, finished, cb);
/*</replacement>*/
} else {
afterWrite(stream, state, finished, cb);
}
}
}
function afterWrite(stream, state, finished, cb) {
if (!finished) onwriteDrain(stream, state);
state.pendingcb--;
cb();
finishMaybe(stream, state);
}
// Must force callback to be called on nextTick, so that we don't
// emit 'drain' before the write() consumer gets the 'false' return
// value, and has a chance to attach a 'drain' listener.
function onwriteDrain(stream, state) {
if (state.length === 0 && state.needDrain) {
state.needDrain = false;
stream.emit('drain');
}
}
// if there's something in the buffer waiting, then process it
function clearBuffer(stream, state) {
state.bufferProcessing = true;
var entry = state.bufferedRequest;
if (stream._writev && entry && entry.next) {
// Fast case, write everything using _writev()
var l = state.bufferedRequestCount;
var buffer = new Array(l);
var holder = state.corkedRequestsFree;
holder.entry = entry;
var count = 0;
var allBuffers = true;
while (entry) {
buffer[count] = entry;
if (!entry.isBuf) allBuffers = false;
entry = entry.next;
count += 1;
}
buffer.allBuffers = allBuffers;
doWrite(stream, state, true, state.length, buffer, '', holder.finish);
// doWrite is almost always async, defer these to save a bit of time
// as the hot path ends with doWrite
state.pendingcb++;
state.lastBufferedRequest = null;
if (holder.next) {
state.corkedRequestsFree = holder.next;
holder.next = null;
} else {
state.corkedRequestsFree = new CorkedRequest(state);
}
state.bufferedRequestCount = 0;
} else {
// Slow case, write chunks one-by-one
while (entry) {
var chunk = entry.chunk;
var encoding = entry.encoding;
var cb = entry.callback;
var len = state.objectMode ? 1 : chunk.length;
doWrite(stream, state, false, len, chunk, encoding, cb);
entry = entry.next;
state.bufferedRequestCount--;
// if we didn't call the onwrite immediately, then
// it means that we need to wait until it does.
// also, that means that the chunk and cb are currently
// being processed, so move the buffer counter past them.
if (state.writing) {
break;
}
}
if (entry === null) state.lastBufferedRequest = null;
}
state.bufferedRequest = entry;
state.bufferProcessing = false;
}
Writable.prototype._write = function (chunk, encoding, cb) {
cb(new Error('_write() is not implemented'));
};
Writable.prototype._writev = null;
Writable.prototype.end = function (chunk, encoding, cb) {
var state = this._writableState;
if (typeof chunk === 'function') {
cb = chunk;
chunk = null;
encoding = null;
} else if (typeof encoding === 'function') {
cb = encoding;
encoding = null;
}
if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
// .end() fully uncorks
if (state.corked) {
state.corked = 1;
this.uncork();
}
// ignore unnecessary end() calls.
if (!state.ending && !state.finished) endWritable(this, state, cb);
};
function needFinish(state) {
return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
}
function callFinal(stream, state) {
stream._final(function (err) {
state.pendingcb--;
if (err) {
stream.emit('error', err);
}
state.prefinished = true;
stream.emit('prefinish');
finishMaybe(stream, state);
});
}
function prefinish(stream, state) {
if (!state.prefinished && !state.finalCalled) {
if (typeof stream._final === 'function') {
state.pendingcb++;
state.finalCalled = true;
pna.nextTick(callFinal, stream, state);
} else {
state.prefinished = true;
stream.emit('prefinish');
}
}
}
function finishMaybe(stream, state) {
var need = needFinish(state);
if (need) {
prefinish(stream, state);
if (state.pendingcb === 0) {
state.finished = true;
stream.emit('finish');
}
}
return need;
}
function endWritable(stream, state, cb) {
state.ending = true;
finishMaybe(stream, state);
if (cb) {
if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);
}
state.ended = true;
stream.writable = false;
}
function onCorkedFinish(corkReq, state, err) {
var entry = corkReq.entry;
corkReq.entry = null;
while (entry) {
var cb = entry.callback;
state.pendingcb--;
cb(err);
entry = entry.next;
}
if (state.corkedRequestsFree) {
state.corkedRequestsFree.next = corkReq;
} else {
state.corkedRequestsFree = corkReq;
}
}
Object.defineProperty(Writable.prototype, 'destroyed', {
get: function () {
if (this._writableState === undefined) {
return false;
}
return this._writableState.destroyed;
},
set: function (value) {
// we ignore the value if the stream
// has not been initialized yet
if (!this._writableState) {
return;
}
// backward compatibility, the user is explicitly
// managing destroyed
this._writableState.destroyed = value;
}
});
Writable.prototype.destroy = destroyImpl.destroy;
Writable.prototype._undestroy = destroyImpl.undestroy;
Writable.prototype._destroy = function (err, cb) {
this.end();
cb(err);
};
}).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("timers").setImmediate)
},{"./_stream_duplex":390,"./internal/streams/destroy":396,"./internal/streams/stream":397,"_process":389,"core-util-is":380,"inherits":384,"process-nextick-args":388,"safe-buffer":399,"timers":401,"util-deprecate":402}],395:[function(require,module,exports){
'use strict';
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var Buffer = require('safe-buffer').Buffer;
var util = require('util');
function copyBuffer(src, target, offset) {
src.copy(target, offset);
}
module.exports = function () {
function BufferList() {
_classCallCheck(this, BufferList);
this.head = null;
this.tail = null;
this.length = 0;
}
BufferList.prototype.push = function push(v) {
var entry = { data: v, next: null };
if (this.length > 0) this.tail.next = entry;else this.head = entry;
this.tail = entry;
++this.length;
};
BufferList.prototype.unshift = function unshift(v) {
var entry = { data: v, next: this.head };
if (this.length === 0) this.tail = entry;
this.head = entry;
++this.length;
};
BufferList.prototype.shift = function shift() {
if (this.length === 0) return;
var ret = this.head.data;
if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
--this.length;
return ret;
};
BufferList.prototype.clear = function clear() {
this.head = this.tail = null;
this.length = 0;
};
BufferList.prototype.join = function join(s) {
if (this.length === 0) return '';
var p = this.head;
var ret = '' + p.data;
while (p = p.next) {
ret += s + p.data;
}return ret;
};
BufferList.prototype.concat = function concat(n) {
if (this.length === 0) return Buffer.alloc(0);
if (this.length === 1) return this.head.data;
var ret = Buffer.allocUnsafe(n >>> 0);
var p = this.head;
var i = 0;
while (p) {
copyBuffer(p.data, ret, i);
i += p.data.length;
p = p.next;
}
return ret;
};
return BufferList;
}();
if (util && util.inspect && util.inspect.custom) {
module.exports.prototype[util.inspect.custom] = function () {
var obj = util.inspect({ length: this.length });
return this.constructor.name + ' ' + obj;
};
}
},{"safe-buffer":399,"util":377}],396:[function(require,module,exports){
'use strict';
/*<replacement>*/
var pna = require('process-nextick-args');
/*</replacement>*/
// undocumented cb() API, needed for core, not for public API
function destroy(err, cb) {
var _this = this;
var readableDestroyed = this._readableState && this._readableState.destroyed;
var writableDestroyed = this._writableState && this._writableState.destroyed;
if (readableDestroyed || writableDestroyed) {
if (cb) {
cb(err);
} else if (err && (!this._writableState || !this._writableState.errorEmitted)) {
pna.nextTick(emitErrorNT, this, err);
}
return this;
}
// we set destroyed to true before firing error callbacks in order
// to make it re-entrance safe in case destroy() is called within callbacks
if (this._readableState) {
this._readableState.destroyed = true;
}
// if this is a duplex stream mark the writable part as destroyed as well
if (this._writableState) {
this._writableState.destroyed = true;
}
this._destroy(err || null, function (err) {
if (!cb && err) {
pna.nextTick(emitErrorNT, _this, err);
if (_this._writableState) {
_this._writableState.errorEmitted = true;
}
} else if (cb) {
cb(err);
}
});
return this;
}
function undestroy() {
if (this._readableState) {
this._readableState.destroyed = false;
this._readableState.reading = false;
this._readableState.ended = false;
this._readableState.endEmitted = false;
}
if (this._writableState) {
this._writableState.destroyed = false;
this._writableState.ended = false;
this._writableState.ending = false;
this._writableState.finished = false;
this._writableState.errorEmitted = false;
}
}
function emitErrorNT(self, err) {
self.emit('error', err);
}
module.exports = {
destroy: destroy,
undestroy: undestroy
};
},{"process-nextick-args":388}],397:[function(require,module,exports){
module.exports = require('events').EventEmitter;
},{"events":378}],398:[function(require,module,exports){
exports = module.exports = require('./lib/_stream_readable.js');
exports.Stream = exports;
exports.Readable = exports;
exports.Writable = require('./lib/_stream_writable.js');
exports.Duplex = require('./lib/_stream_duplex.js');
exports.Transform = require('./lib/_stream_transform.js');
exports.PassThrough = require('./lib/_stream_passthrough.js');
},{"./lib/_stream_duplex.js":390,"./lib/_stream_passthrough.js":391,"./lib/_stream_readable.js":392,"./lib/_stream_transform.js":393,"./lib/_stream_writable.js":394}],399:[function(require,module,exports){
/* eslint-disable node/no-deprecated-api */
var buffer = require('buffer')
var Buffer = buffer.Buffer
// alternative to using Object.keys for old browsers
function copyProps (src, dst) {
for (var key in src) {
dst[key] = src[key]
}
}
if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
module.exports = buffer
} else {
// Copy properties from require('buffer')
copyProps(buffer, exports)
exports.Buffer = SafeBuffer
}
function SafeBuffer (arg, encodingOrOffset, length) {
return Buffer(arg, encodingOrOffset, length)
}
// Copy static methods from Buffer
copyProps(Buffer, SafeBuffer)
SafeBuffer.from = function (arg, encodingOrOffset, length) {
if (typeof arg === 'number') {
throw new TypeError('Argument must not be a number')
}
return Buffer(arg, encodingOrOffset, length)
}
SafeBuffer.alloc = function (size, fill, encoding) {
if (typeof size !== 'number') {
throw new TypeError('Argument must be a number')
}
var buf = Buffer(size)
if (fill !== undefined) {
if (typeof encoding === 'string') {
buf.fill(fill, encoding)
} else {
buf.fill(fill)
}
} else {
buf.fill(0)
}
return buf
}
SafeBuffer.allocUnsafe = function (size) {
if (typeof size !== 'number') {
throw new TypeError('Argument must be a number')
}
return Buffer(size)
}
SafeBuffer.allocUnsafeSlow = function (size) {
if (typeof size !== 'number') {
throw new TypeError('Argument must be a number')
}
return buffer.SlowBuffer(size)
}
},{"buffer":379}],400:[function(require,module,exports){
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
'use strict';
/*<replacement>*/
var Buffer = require('safe-buffer').Buffer;
/*</replacement>*/
var isEncoding = Buffer.isEncoding || function (encoding) {
encoding = '' + encoding;
switch (encoding && encoding.toLowerCase()) {
case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':
return true;
default:
return false;
}
};
function _normalizeEncoding(enc) {
if (!enc) return 'utf8';
var retried;
while (true) {
switch (enc) {
case 'utf8':
case 'utf-8':
return 'utf8';
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return 'utf16le';
case 'latin1':
case 'binary':
return 'latin1';
case 'base64':
case 'ascii':
case 'hex':
return enc;
default:
if (retried) return; // undefined
enc = ('' + enc).toLowerCase();
retried = true;
}
}
};
// Do not cache `Buffer.isEncoding` when checking encoding names as some
// modules monkey-patch it to support additional encodings
function normalizeEncoding(enc) {
var nenc = _normalizeEncoding(enc);
if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);
return nenc || enc;
}
// StringDecoder provides an interface for efficiently splitting a series of
// buffers into a series of JS strings without breaking apart multi-byte
// characters.
exports.StringDecoder = StringDecoder;
function StringDecoder(encoding) {
this.encoding = normalizeEncoding(encoding);
var nb;
switch (this.encoding) {
case 'utf16le':
this.text = utf16Text;
this.end = utf16End;
nb = 4;
break;
case 'utf8':
this.fillLast = utf8FillLast;
nb = 4;
break;
case 'base64':
this.text = base64Text;
this.end = base64End;
nb = 3;
break;
default:
this.write = simpleWrite;
this.end = simpleEnd;
return;
}
this.lastNeed = 0;
this.lastTotal = 0;
this.lastChar = Buffer.allocUnsafe(nb);
}
StringDecoder.prototype.write = function (buf) {
if (buf.length === 0) return '';
var r;
var i;
if (this.lastNeed) {
r = this.fillLast(buf);
if (r === undefined) return '';
i = this.lastNeed;
this.lastNeed = 0;
} else {
i = 0;
}
if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
return r || '';
};
StringDecoder.prototype.end = utf8End;
// Returns only complete characters in a Buffer
StringDecoder.prototype.text = utf8Text;
// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer
StringDecoder.prototype.fillLast = function (buf) {
if (this.lastNeed <= buf.length) {
buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
return this.lastChar.toString(this.encoding, 0, this.lastTotal);
}
buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
this.lastNeed -= buf.length;
};
// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a
// continuation byte. If an invalid byte is detected, -2 is returned.
function utf8CheckByte(byte) {
if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;
return byte >> 6 === 0x02 ? -1 : -2;
}
// Checks at most 3 bytes at the end of a Buffer in order to detect an
// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)
// needed to complete the UTF-8 character (if applicable) are returned.
function utf8CheckIncomplete(self, buf, i) {
var j = buf.length - 1;
if (j < i) return 0;
var nb = utf8CheckByte(buf[j]);
if (nb >= 0) {
if (nb > 0) self.lastNeed = nb - 1;
return nb;
}
if (--j < i || nb === -2) return 0;
nb = utf8CheckByte(buf[j]);
if (nb >= 0) {
if (nb > 0) self.lastNeed = nb - 2;
return nb;
}
if (--j < i || nb === -2) return 0;
nb = utf8CheckByte(buf[j]);
if (nb >= 0) {
if (nb > 0) {
if (nb === 2) nb = 0;else self.lastNeed = nb - 3;
}
return nb;
}
return 0;
}
// Validates as many continuation bytes for a multi-byte UTF-8 character as
// needed or are available. If we see a non-continuation byte where we expect
// one, we "replace" the validated continuation bytes we've seen so far with
// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding
// behavior. The continuation byte check is included three times in the case
// where all of the continuation bytes for a character exist in the same buffer.
// It is also done this way as a slight performance increase instead of using a
// loop.
function utf8CheckExtraBytes(self, buf, p) {
if ((buf[0] & 0xC0) !== 0x80) {
self.lastNeed = 0;
return '\ufffd';
}
if (self.lastNeed > 1 && buf.length > 1) {
if ((buf[1] & 0xC0) !== 0x80) {
self.lastNeed = 1;
return '\ufffd';
}
if (self.lastNeed > 2 && buf.length > 2) {
if ((buf[2] & 0xC0) !== 0x80) {
self.lastNeed = 2;
return '\ufffd';
}
}
}
}
// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.
function utf8FillLast(buf) {
var p = this.lastTotal - this.lastNeed;
var r = utf8CheckExtraBytes(this, buf, p);
if (r !== undefined) return r;
if (this.lastNeed <= buf.length) {
buf.copy(this.lastChar, p, 0, this.lastNeed);
return this.lastChar.toString(this.encoding, 0, this.lastTotal);
}
buf.copy(this.lastChar, p, 0, buf.length);
this.lastNeed -= buf.length;
}
// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a
// partial character, the character's bytes are buffered until the required
// number of bytes are available.
function utf8Text(buf, i) {
var total = utf8CheckIncomplete(this, buf, i);
if (!this.lastNeed) return buf.toString('utf8', i);
this.lastTotal = total;
var end = buf.length - (total - this.lastNeed);
buf.copy(this.lastChar, 0, end);
return buf.toString('utf8', i, end);
}
// For UTF-8, a replacement character is added when ending on a partial
// character.
function utf8End(buf) {
var r = buf && buf.length ? this.write(buf) : '';
if (this.lastNeed) return r + '\ufffd';
return r;
}
// UTF-16LE typically needs two bytes per character, but even if we have an even
// number of bytes available, we need to check if we end on a leading/high
// surrogate. In that case, we need to wait for the next two bytes in order to
// decode the last character properly.
function utf16Text(buf, i) {
if ((buf.length - i) % 2 === 0) {
var r = buf.toString('utf16le', i);
if (r) {
var c = r.charCodeAt(r.length - 1);
if (c >= 0xD800 && c <= 0xDBFF) {
this.lastNeed = 2;
this.lastTotal = 4;
this.lastChar[0] = buf[buf.length - 2];
this.lastChar[1] = buf[buf.length - 1];
return r.slice(0, -1);
}
}
return r;
}
this.lastNeed = 1;
this.lastTotal = 2;
this.lastChar[0] = buf[buf.length - 1];
return buf.toString('utf16le', i, buf.length - 1);
}
// For UTF-16LE we do not explicitly append special replacement characters if we
// end on a partial character, we simply let v8 handle that.
function utf16End(buf) {
var r = buf && buf.length ? this.write(buf) : '';
if (this.lastNeed) {
var end = this.lastTotal - this.lastNeed;
return r + this.lastChar.toString('utf16le', 0, end);
}
return r;
}
function base64Text(buf, i) {
var n = (buf.length - i) % 3;
if (n === 0) return buf.toString('base64', i);
this.lastNeed = 3 - n;
this.lastTotal = 3;
if (n === 1) {
this.lastChar[0] = buf[buf.length - 1];
} else {
this.lastChar[0] = buf[buf.length - 2];
this.lastChar[1] = buf[buf.length - 1];
}
return buf.toString('base64', i, buf.length - n);
}
function base64End(buf) {
var r = buf && buf.length ? this.write(buf) : '';
if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);
return r;
}
// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)
function simpleWrite(buf) {
return buf.toString(this.encoding);
}
function simpleEnd(buf) {
return buf && buf.length ? this.write(buf) : '';
}
},{"safe-buffer":399}],401:[function(require,module,exports){
(function (setImmediate,clearImmediate){(function (){
var nextTick = require('process/browser.js').nextTick;
var apply = Function.prototype.apply;
var slice = Array.prototype.slice;
var immediateIds = {};
var nextImmediateId = 0;
// DOM APIs, for completeness
exports.setTimeout = function() {
return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);
};
exports.setInterval = function() {
return new Timeout(apply.call(setInterval, window, arguments), clearInterval);
};
exports.clearTimeout =
exports.clearInterval = function(timeout) { timeout.close(); };
function Timeout(id, clearFn) {
this._id = id;
this._clearFn = clearFn;
}
Timeout.prototype.unref = Timeout.prototype.ref = function() {};
Timeout.prototype.close = function() {
this._clearFn.call(window, this._id);
};
// Does not start the time, just sets up the members needed.
exports.enroll = function(item, msecs) {
clearTimeout(item._idleTimeoutId);
item._idleTimeout = msecs;
};
exports.unenroll = function(item) {
clearTimeout(item._idleTimeoutId);
item._idleTimeout = -1;
};
exports._unrefActive = exports.active = function(item) {
clearTimeout(item._idleTimeoutId);
var msecs = item._idleTimeout;
if (msecs >= 0) {
item._idleTimeoutId = setTimeout(function onTimeout() {
if (item._onTimeout)
item._onTimeout();
}, msecs);
}
};
// That's not how node.js implements it but the exposed api is the same.
exports.setImmediate = typeof setImmediate === "function" ? setImmediate : function(fn) {
var id = nextImmediateId++;
var args = arguments.length < 2 ? false : slice.call(arguments, 1);
immediateIds[id] = true;
nextTick(function onNextTick() {
if (immediateIds[id]) {
// fn.call() is faster so we optimize for the common use-case
// @see http://jsperf.com/call-apply-segu
if (args) {
fn.apply(null, args);
} else {
fn.call(null);
}
// Prevent ids from leaking
exports.clearImmediate(id);
}
});
return id;
};
exports.clearImmediate = typeof clearImmediate === "function" ? clearImmediate : function(id) {
delete immediateIds[id];
};
}).call(this)}).call(this,require("timers").setImmediate,require("timers").clearImmediate)
},{"process/browser.js":389,"timers":401}],402:[function(require,module,exports){
(function (global){(function (){
/**
* Module exports.
*/
module.exports = deprecate;
/**
* Mark that a method should not be used.
* Returns a modified function which warns once by default.
*
* If `localStorage.noDeprecation = true` is set, then it is a no-op.
*
* If `localStorage.throwDeprecation = true` is set, then deprecated functions
* will throw an Error when invoked.
*
* If `localStorage.traceDeprecation = true` is set, then deprecated functions
* will invoke `console.trace()` instead of `console.error()`.
*
* @param {Function} fn - the function to deprecate
* @param {String} msg - the string to print to the console when `fn` is invoked
* @returns {Function} a new "deprecated" version of `fn`
* @api public
*/
function deprecate (fn, msg) {
if (config('noDeprecation')) {
return fn;
}
var warned = false;
function deprecated() {
if (!warned) {
if (config('throwDeprecation')) {
throw new Error(msg);
} else if (config('traceDeprecation')) {
console.trace(msg);
} else {
console.warn(msg);
}
warned = true;
}
return fn.apply(this, arguments);
}
return deprecated;
}
/**
* Checks `localStorage` for boolean values for the given `name`.
*
* @param {String} name
* @returns {Boolean}
* @api private
*/
function config (name) {
// accessing global.localStorage can trigger a DOMException in sandboxed iframes
try {
if (!global.localStorage) return false;
} catch (_) {
return false;
}
var val = global.localStorage[name];
if (null == val) return false;
return String(val).toLowerCase() === 'true';
}
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}]},{},[306]);
| stdlib-js/www | public/docs/api/latest/@stdlib/utils/every-by/benchmark_bundle.js | JavaScript | apache-2.0 | 750,474 |
package org.renjin.primitives;
import org.renjin.eval.Context;
import org.renjin.eval.EvalException;
import org.renjin.primitives.annotations.processor.ArgumentException;
import org.renjin.primitives.annotations.processor.ArgumentIterator;
import org.renjin.primitives.annotations.processor.WrapperRuntime;
import org.renjin.sexp.BuiltinFunction;
import org.renjin.sexp.Environment;
import org.renjin.sexp.FunctionCall;
import org.renjin.sexp.PairList;
import org.renjin.sexp.SEXP;
import org.renjin.sexp.StringVector;
import org.renjin.sexp.Vector;
public class R$primitive$attr$assign
extends BuiltinFunction
{
public R$primitive$attr$assign() {
super("attr<-");
}
public SEXP apply(Context context, Environment environment, FunctionCall call, PairList args) {
try {
ArgumentIterator argIt = new ArgumentIterator(context, environment, args);
SEXP s0 = argIt.evalNext();
SEXP s1 = argIt.evalNext();
SEXP s2 = argIt.evalNext();
if (!argIt.hasNext()) {
return this.doApply(context, environment, s0, s1, s2);
}
throw new EvalException("attr<-: too many arguments, expected at most 3.");
} catch (ArgumentException e) {
throw new EvalException(context, "Invalid argument: %s. Expected:\n\tattr<-(any, character(1), any)", e.getMessage());
} catch (EvalException e) {
e.initContext(context);
throw e;
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
throw new EvalException(e);
}
}
public static SEXP doApply(Context context, Environment environment, FunctionCall call, String[] argNames, SEXP[] args) {
try {
if ((args.length) == 3) {
return doApply(context, environment, args[ 0 ], args[ 1 ], args[ 2 ]);
}
} catch (EvalException e) {
e.initContext(context);
throw e;
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
throw new EvalException(e);
}
throw new EvalException("attr<-: max arity is 3");
}
public SEXP apply(Context context, Environment environment, FunctionCall call, String[] argNames, SEXP[] args) {
return R$primitive$attr$assign.doApply(context, environment, call, argNames, args);
}
public static SEXP doApply(Context context, Environment environment, SEXP arg0, SEXP arg1, SEXP arg2)
throws Exception
{
if (((arg0 instanceof SEXP)&&((arg1 instanceof Vector)&&StringVector.VECTOR_TYPE.isWiderThanOrEqualTo(((Vector) arg1))))&&(arg2 instanceof SEXP)) {
return Attributes.setAttribute(((SEXP) arg0), WrapperRuntime.convertToString(arg1), ((SEXP) arg2));
} else {
throw new EvalException(String.format("Invalid argument:\n\tattr<-(%s, %s, %s)\n\tExpected:\n\tattr<-(any, character(1), any)", arg0 .getTypeName(), arg1 .getTypeName(), arg2 .getTypeName()));
}
}
}
| bedatadriven/renjin-statet | org.renjin.core/src-gen/org/renjin/primitives/R$primitive$attr$assign.java | Java | apache-2.0 | 3,078 |
/**
--| ADAPTIVE RUNTIME PLATFORM |----------------------------------------------------------------------------------------
(C) Copyright 2013-2015 Carlos Lozano Diez t/a Adaptive.me <http://adaptive.me>.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless required by appli-
-cable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing
permissions and limitations under the License.
Original author:
* Carlos Lozano Diez
<http://github.com/carloslozano>
<http://twitter.com/adaptivecoder>
<mailto:[email protected]>
Contributors:
* Ferran Vila Conesa
<http://github.com/fnva>
<http://twitter.com/ferran_vila>
<mailto:[email protected]>
* See source code files for contributors.
Release:
* @version v2.2.0
-------------------------------------------| aut inveniam viam aut faciam |--------------------------------------------
*/
using System;
namespace Adaptive.Arp.Api
{
/**
Structure representing the binary attachment data.
@author Francisco Javier Martin Bueno
@since v2.0
@version 1.0
*/
public class EmailAttachmentData : APIBean
{
/**
The raw data for the current file attachment (byte array)
*/
public byte[] Data { get; set; }
/**
The name of the current file attachment
*/
public string FileName { get; set; }
/**
The mime type of the current attachment
*/
public string MimeType { get; set; }
/**
The relative path where the contents for the attachment file could be located.
*/
public string ReferenceUrl { get; set; }
/**
The data size (in bytes) of the current file attachment
*/
public long Size { get; set; }
/**
Default Constructor
@since V2.0
*/
public EmailAttachmentData() {
}
/**
Constructor with fields
@param Data raw data of the file attachment
@param Size size of the file attachment
@param FileName name of the file attachment
@param MimeType mime type of the file attachment
@param ReferenceUrl relative url of the file attachment
@since V2.0
*/
public EmailAttachmentData(byte[] data, long size, string fileName, string mimeType, string referenceUrl) : base () {
this.Data = Data;
this.Size = Size;
this.FileName = FileName;
this.MimeType = MimeType;
this.ReferenceUrl = ReferenceUrl;
}
/**
Returns the raw data in byte[]
@return Data Octet-binary content of the attachment payload.
@since V2.0
*/
public byte[] GetData() {
return this.Data;
}
/**
Set the data of the attachment as a byte[]
@param Data Sets the octet-binary content of the attachment.
@since V2.0
*/
public void SetData(byte[] Data) {
this.Data = Data;
}
/**
Returns the filename of the attachment
@return FileName Name of the attachment.
@since V2.0
*/
public string GetFileName() {
return this.FileName;
}
/**
Set the name of the file attachment
@param FileName Name of the attachment.
@since V2.0
*/
public void SetFileName(string FileName) {
this.FileName = FileName;
}
/**
Returns the mime type of the attachment
@return MimeType
@since V2.0
*/
public string GetMimeType() {
return this.MimeType;
}
/**
Set the mime type of the attachment
@param MimeType Mime-type of the attachment.
@since V2.0
*/
public void SetMimeType(string MimeType) {
this.MimeType = MimeType;
}
/**
Returns the absolute url of the file attachment
@return ReferenceUrl Absolute URL of the file attachment for either file:// or http:// access.
@since V2.0
*/
public string GetReferenceUrl() {
return this.ReferenceUrl;
}
/**
Set the absolute url of the attachment
@param ReferenceUrl Absolute URL of the file attachment for either file:// or http:// access.
@since V2.0
*/
public void SetReferenceUrl(string ReferenceUrl) {
this.ReferenceUrl = ReferenceUrl;
}
/**
Returns the size of the attachment as a long
@return Size Length in bytes of the octet-binary content.
@since V2.0
*/
public long GetSize() {
return this.Size;
}
/**
Set the size of the attachment as a long
@param Size Length in bytes of the octet-binary content ( should be same as data array length.)
@since V2.0
*/
public void SetSize(long Size) {
this.Size = Size;
}
}
}
/**
------------------------------------| Engineered with ♥ in Barcelona, Catalonia |--------------------------------------
*/
| AdaptiveMe/adaptive-arp-windows | adaptive-arp-lib/adaptive-arp-lib/Sources/Adaptive.Arp.Api/EmailAttachmentData.cs | C# | apache-2.0 | 6,042 |
# Crataegus peruviana K.Koch SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | mdoering/backbone | life/Plantae/Magnoliophyta/Magnoliopsida/Rosales/Rosaceae/Crataegus/Crataegus peruviana/README.md | Markdown | apache-2.0 | 176 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_75) on Sat May 16 22:22:26 CEST 2015 -->
<title>RangeTombstoneListTest</title>
<meta name="date" content="2015-05-16">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="RangeTombstoneListTest";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/cassandra/db/RangeTombstoneList.Serializer.html" title="class in org.apache.cassandra.db"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../org/apache/cassandra/db/RangeTombstoneTest.html" title="class in org.apache.cassandra.db"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/cassandra/db/RangeTombstoneListTest.html" target="_top">Frames</a></li>
<li><a href="RangeTombstoneListTest.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.cassandra.db</div>
<h2 title="Class RangeTombstoneListTest" class="title">Class RangeTombstoneListTest</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.apache.cassandra.db.RangeTombstoneListTest</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="strong">RangeTombstoneListTest</span>
extends java.lang.Object</pre>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../org/apache/cassandra/db/RangeTombstoneListTest.html#RangeTombstoneListTest()">RangeTombstoneListTest</a></strong>()</code> </td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/db/RangeTombstoneListTest.html#addAllIncludedTest()">addAllIncludedTest</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/db/RangeTombstoneListTest.html#addAllRandomTest()">addAllRandomTest</a></strong>()</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/db/RangeTombstoneListTest.html#addAllSequentialTest()">addAllSequentialTest</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/db/RangeTombstoneListTest.html#addAllTest()">addAllTest</a></strong>()</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/db/RangeTombstoneListTest.html#largeAdditionTest()">largeAdditionTest</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/db/RangeTombstoneListTest.html#minMaxTest()">minMaxTest</a></strong>()</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/db/RangeTombstoneListTest.html#nonSortedAdditionTest()">nonSortedAdditionTest</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/db/RangeTombstoneListTest.html#overlappingAdditionTest()">overlappingAdditionTest</a></strong>()</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/db/RangeTombstoneListTest.html#overlappingPreviousEndEqualsStartTest()">overlappingPreviousEndEqualsStartTest</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/db/RangeTombstoneListTest.html#purgetTest()">purgetTest</a></strong>()</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/db/RangeTombstoneListTest.html#searchTest()">searchTest</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/db/RangeTombstoneListTest.html#simpleOverlapTest()">simpleOverlapTest</a></strong>()</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/db/RangeTombstoneListTest.html#sortedAdditionTest()">sortedAdditionTest</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/db/RangeTombstoneListTest.html#testDiff()">testDiff</a></strong>()</code> </td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="RangeTombstoneListTest()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>RangeTombstoneListTest</h4>
<pre>public RangeTombstoneListTest()</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="testDiff()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>testDiff</h4>
<pre>public void testDiff()</pre>
</li>
</ul>
<a name="sortedAdditionTest()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sortedAdditionTest</h4>
<pre>public void sortedAdditionTest()</pre>
</li>
</ul>
<a name="nonSortedAdditionTest()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>nonSortedAdditionTest</h4>
<pre>public void nonSortedAdditionTest()</pre>
</li>
</ul>
<a name="overlappingAdditionTest()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>overlappingAdditionTest</h4>
<pre>public void overlappingAdditionTest()</pre>
</li>
</ul>
<a name="largeAdditionTest()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>largeAdditionTest</h4>
<pre>public void largeAdditionTest()</pre>
</li>
</ul>
<a name="simpleOverlapTest()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>simpleOverlapTest</h4>
<pre>public void simpleOverlapTest()</pre>
</li>
</ul>
<a name="overlappingPreviousEndEqualsStartTest()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>overlappingPreviousEndEqualsStartTest</h4>
<pre>public void overlappingPreviousEndEqualsStartTest()</pre>
</li>
</ul>
<a name="searchTest()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>searchTest</h4>
<pre>public void searchTest()</pre>
</li>
</ul>
<a name="addAllTest()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addAllTest</h4>
<pre>public void addAllTest()</pre>
</li>
</ul>
<a name="addAllSequentialTest()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addAllSequentialTest</h4>
<pre>public void addAllSequentialTest()</pre>
</li>
</ul>
<a name="addAllIncludedTest()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addAllIncludedTest</h4>
<pre>public void addAllIncludedTest()</pre>
</li>
</ul>
<a name="purgetTest()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>purgetTest</h4>
<pre>public void purgetTest()</pre>
</li>
</ul>
<a name="minMaxTest()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>minMaxTest</h4>
<pre>public void minMaxTest()</pre>
</li>
</ul>
<a name="addAllRandomTest()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>addAllRandomTest</h4>
<pre>public void addAllRandomTest()
throws java.lang.Throwable</pre>
<dl><dt><span class="strong">Throws:</span></dt>
<dd><code>java.lang.Throwable</code></dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/cassandra/db/RangeTombstoneList.Serializer.html" title="class in org.apache.cassandra.db"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../org/apache/cassandra/db/RangeTombstoneTest.html" title="class in org.apache.cassandra.db"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/cassandra/db/RangeTombstoneListTest.html" target="_top">Frames</a></li>
<li><a href="RangeTombstoneListTest.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
| sayanh/ViewMaintenanceCassandra | doc/org/apache/cassandra/db/RangeTombstoneListTest.html | HTML | apache-2.0 | 14,156 |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WpfApplicationLauncher.GUI;
namespace WpfApplicationLauncher.Logging
{
public static class Log
{
public enum EntrySeverity
{
Info,
Warning,
Error,
FatalError
}
public class Entry
{
public EntrySeverity Severity { get; private set; }
public String Message { get; private set; }
internal Entry(EntrySeverity severity, string message)
{
Severity = severity;
Message = message;
}
}
private static readonly object mutex = new object();
private static readonly LinkedList<Entry> logRoll = new LinkedList<Entry>();
private static LogViewer viewer;
public static IEnumerable<Entry> LogRoll
{
get
{
return new LinkedList<Entry>(logRoll);
}
}
public static void Trace(EntrySeverity severity, string message)
{
lock (mutex)
{
logRoll.AddLast(new Entry(severity, message));
}
if ((int)severity > (int)EntrySeverity.Info)
{
ShowLog();
}
}
public static void ShowLog()
{
if (viewer == null)
{
viewer = new LogViewer();
viewer.ShowDialog();
viewer = null;
}
else
{
viewer.Activate();
}
}
}
}
| tlmorgen/WpfApplicationLauncher | WpfApplicationLauncher/WpfApplicationLauncher/Logging/Log.cs | C# | apache-2.0 | 1,668 |
# Paramicropholis Aubrév. & Pellegr. GENUS
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | mdoering/backbone | life/Plantae/Magnoliophyta/Magnoliopsida/Ericales/Sapotaceae/Paramicropholis/README.md | Markdown | apache-2.0 | 183 |
package com.chinare.rop.server;
import javax.servlet.http.HttpServletRequest;
/**
* @author 王贵源([email protected])
*/
public interface RequestChecker {
public boolean check(HttpServletRequest request);
}
| ZHCS-CLUB/AXE | axe/axe-chinare-rop/axe-chinare-rop-server/src/main/java/com/chinare/rop/server/RequestChecker.java | Java | apache-2.0 | 242 |
/*
* Copyright (c) 2018.
* J. Melzer
*/
package com.jmelzer.jitty.utl;
import org.junit.Test;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
/**
* Created by J. Melzer on 27.03.2018.
*/
public class RandomUtilTest {
@Test
public void randomIntFromInterval() {
for (int i = 0; i < 20; i++) {
int n = RandomUtil.randomIntFromInterval(0, 10);
assertTrue("must be between 0 and 10 not " + n, n > -1 && n < 11);
}
}
@Test
public void nextInt() {
RandomUtil randomUtil = new RandomUtil(0, 10);
for (int i = 0; i < 11; i++) {
assertTrue(randomUtil.hasMoreNumbers());
int n = randomUtil.nextInt();
assertTrue("must be between 0 and 10 not " + n, n > -1 && n < 11);
}
assertFalse(randomUtil.hasMoreNumbers());
}
} | chokdee/jitty | data/src/test/java/com/jmelzer/jitty/utl/RandomUtilTest.java | Java | apache-2.0 | 890 |
using System;
using System.Xml.Serialization;
namespace SvnBridge.Protocol
{
[Serializable]
[XmlRoot("get-locks-report", Namespace = WebDav.Namespaces.SVN)]
public class GetLocksReportData
{
}
} | Dynamsoft/SVN-SourceAnywhere-Bridge | SvnBridgeLibrary/Protocol/GetLocksReportData.cs | C# | apache-2.0 | 215 |
google.maps.__gjsload__('drawing', '\'use strict\';function Hj(a){var b=this;a=a||{};a.drawingMode=a.drawingMode||l;b[ub](a);Mf(Re,function(a){new a.b(b)})}L(Hj,T);ig(Hj[H],{map:ye(vg),drawingMode:Ee});Jf.drawing=function(a){eval(a)};dd.google.maps.drawing={DrawingManager:Hj,OverlayType:{MARKER:"marker",POLYGON:"polygon",POLYLINE:"polyline",RECTANGLE:"rectangle",CIRCLE:"circle"}};Nf("drawing",{});\n') | 39mi/jtd | WebRoot/mapfiles/api-3/13/1/drawing.js | JavaScript | apache-2.0 | 404 |
# BridgeUserDataDownloadService
Bridge User Data Download (BUDD) Service
Pre-reqs:
Java Cryptography Extensions - http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html
(if using Oracle JDK, not required if using Open JDK)
Set-up:
In your home directory, add a file BridgeUserDataDownloadService.conf and add username, health code key, and stormpath
ID and secret. See main/resources/BridgeUserDatadownloadService.conf for an example. (Note that any attribute you don't
add to your local conf file will fall back to the bundled conf file.)
To run a full build (including compile, unit tests, findbugs, and jacoco test coverage), run:
mvn verify
(A full build takes about 20 sec on my laptop, from a clean workspace.)
To just run findbugs, run:
mvn compile findbugs:check
To run findbugs and get a friendly GUI to read about the bugs, run:
mvn compile findbugs:findbugs findbugs:gui
To run jacoco coverage reports and checks, run:
mvn test jacoco:report jacoco:check
Jacoco report will be in target/site/jacoco/index.html
To run this locally, run
mvn spring-boot:run
Useful Spring Boot / Maven development resouces:
http://stackoverflow.com/questions/27323104/spring-boot-and-maven-exec-plugin-issue
http://techblog.molindo.at/2007/11/maven-unable-to-find-resources-in-test-cases.html
| Sage-Bionetworks/BridgeUserDataDownloadService | README.md | Markdown | apache-2.0 | 1,323 |
/*
* Generated by the Jasper component of Apache Tomcat
* Version: Apache Tomcat/7.0.53
* Generated at: 2015-06-08 03:36:45 UTC
* Note: The last modified time of this file was set to
* the last modified time of the source file after
* generation to assist with modification tracking.
*/
package org.apache.jsp.prefs;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
public final class tab_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final javax.servlet.jsp.JspFactory _jspxFactory =
javax.servlet.jsp.JspFactory.getDefaultFactory();
private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005ff_005fview;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fsakai_005fview_005fcontainer_0026_005ftitle;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fsakai_005fstylesheet_0026_005fpath_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fsakai_005fview_005fcontent;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005ff_005fverbatim;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fstyleClass_005fstyle_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fh_005fform_0026_005fid;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fsakai_005ftool_005fbar;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fh_005fpanelGroup_0026_005fstyle_005frendered;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fh_005fcommandButton_0026_005fvalue_005fstyleClass_005fid_005faction_005faccesskey_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fsakai_005fmessages_0026_005frendered_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fescape_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fescape_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005ft_005fdataList_0026_005fvar_005fvalue_005frowIndexVar_005flayout_005fitemStyleClass_005fid;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005ftitle_005fstyleClass_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fh_005foutputFormat_0026_005fvalue;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005frendered_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fh_005fselectOneRadio_0026_005fvalue_005frendered_005flayout;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005ff_005fselectItem_0026_005fitemValue_005fitemLabel_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fh_005finputHidden_0026_005fvalue_005fid_005fnobody;
private javax.el.ExpressionFactory _el_expressionfactory;
private org.apache.tomcat.InstanceManager _jsp_instancemanager;
public java.util.Map<java.lang.String,java.lang.Long> getDependants() {
return _jspx_dependants;
}
public void _jspInit() {
_005fjspx_005ftagPool_005ff_005fview = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fsakai_005fview_005fcontainer_0026_005ftitle = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fsakai_005fstylesheet_0026_005fpath_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fsakai_005fview_005fcontent = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005ff_005fverbatim = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fstyleClass_005fstyle_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fh_005fform_0026_005fid = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fh_005fpanelGroup_0026_005fstyle_005frendered = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fh_005fcommandButton_0026_005fvalue_005fstyleClass_005fid_005faction_005faccesskey_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fsakai_005fmessages_0026_005frendered_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fescape_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fescape_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005ft_005fdataList_0026_005fvar_005fvalue_005frowIndexVar_005flayout_005fitemStyleClass_005fid = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005ftitle_005fstyleClass_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fh_005foutputFormat_0026_005fvalue = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005frendered_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fh_005fselectOneRadio_0026_005fvalue_005frendered_005flayout = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005ff_005fselectItem_0026_005fitemValue_005fitemLabel_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fh_005finputHidden_0026_005fvalue_005fid_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
_jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig());
}
public void _jspDestroy() {
_005fjspx_005ftagPool_005ff_005fview.release();
_005fjspx_005ftagPool_005fsakai_005fview_005fcontainer_0026_005ftitle.release();
_005fjspx_005ftagPool_005fsakai_005fstylesheet_0026_005fpath_005fnobody.release();
_005fjspx_005ftagPool_005fsakai_005fview_005fcontent.release();
_005fjspx_005ftagPool_005ff_005fverbatim.release();
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fstyleClass_005fstyle_005fnobody.release();
_005fjspx_005ftagPool_005fh_005fform_0026_005fid.release();
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar.release();
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.release();
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005fnobody.release();
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.release();
_005fjspx_005ftagPool_005fh_005fpanelGroup_0026_005fstyle_005frendered.release();
_005fjspx_005ftagPool_005fh_005fcommandButton_0026_005fvalue_005fstyleClass_005fid_005faction_005faccesskey_005fnobody.release();
_005fjspx_005ftagPool_005fsakai_005fmessages_0026_005frendered_005fnobody.release();
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fescape_005fnobody.release();
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fescape_005fnobody.release();
_005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.release();
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fnobody.release();
_005fjspx_005ftagPool_005ft_005fdataList_0026_005fvar_005fvalue_005frowIndexVar_005flayout_005fitemStyleClass_005fid.release();
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fnobody.release();
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005ftitle_005fstyleClass_005fnobody.release();
_005fjspx_005ftagPool_005fh_005foutputFormat_0026_005fvalue.release();
_005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody.release();
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005frendered_005fnobody.release();
_005fjspx_005ftagPool_005fh_005fselectOneRadio_0026_005fvalue_005frendered_005flayout.release();
_005fjspx_005ftagPool_005ff_005fselectItem_0026_005fitemValue_005fitemLabel_005fnobody.release();
_005fjspx_005ftagPool_005fh_005finputHidden_0026_005fvalue_005fid_005fnobody.release();
}
public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response)
throws java.io.IOException, javax.servlet.ServletException {
final javax.servlet.jsp.PageContext pageContext;
javax.servlet.http.HttpSession session = null;
final javax.servlet.ServletContext application;
final javax.servlet.ServletConfig config;
javax.servlet.jsp.JspWriter out = null;
final java.lang.Object page = this;
javax.servlet.jsp.JspWriter _jspx_out = null;
javax.servlet.jsp.PageContext _jspx_page_context = null;
try {
response.setContentType("text/html");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write('\n');
out.write('\n');
out.write('\n');
out.write('\n');
out.write('\n');
out.write('\n');
out.write('\n');
out.write('\n');
if (_jspx_meth_f_005fview_005f0(_jspx_page_context))
return;
out.write('\n');
out.write('\n');
} catch (java.lang.Throwable t) {
if (!(t instanceof javax.servlet.jsp.SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
try { out.clearBuffer(); } catch (java.io.IOException e) {}
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
else throw new ServletException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
private boolean _jspx_meth_f_005fview_005f0(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
javax.servlet.http.HttpServletRequest request = (javax.servlet.http.HttpServletRequest)_jspx_page_context.getRequest();
javax.servlet.http.HttpServletResponse response = (javax.servlet.http.HttpServletResponse)_jspx_page_context.getResponse();
// f:view
com.sun.faces.taglib.jsf_core.ViewTag _jspx_th_f_005fview_005f0 = (com.sun.faces.taglib.jsf_core.ViewTag) _005fjspx_005ftagPool_005ff_005fview.get(com.sun.faces.taglib.jsf_core.ViewTag.class);
_jspx_th_f_005fview_005f0.setPageContext(_jspx_page_context);
_jspx_th_f_005fview_005f0.setParent(null);
int _jspx_eval_f_005fview_005f0 = _jspx_th_f_005fview_005f0.doStartTag();
if (_jspx_eval_f_005fview_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fview_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fview_005f0.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fview_005f0.doInitBody();
}
do {
out.write('\n');
if (_jspx_meth_sakai_005fview_005fcontainer_005f0(_jspx_th_f_005fview_005f0, _jspx_page_context))
return true;
out.write('\n');
out.write('\n');
int evalDoAfterBody = _jspx_th_f_005fview_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fview_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fview_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fview.reuse(_jspx_th_f_005fview_005f0);
return true;
}
_005fjspx_005ftagPool_005ff_005fview.reuse(_jspx_th_f_005fview_005f0);
return false;
}
private boolean _jspx_meth_sakai_005fview_005fcontainer_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fview_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
javax.servlet.http.HttpServletRequest request = (javax.servlet.http.HttpServletRequest)_jspx_page_context.getRequest();
javax.servlet.http.HttpServletResponse response = (javax.servlet.http.HttpServletResponse)_jspx_page_context.getResponse();
// sakai:view_container
org.sakaiproject.jsf.tag.ViewTag _jspx_th_sakai_005fview_005fcontainer_005f0 = (org.sakaiproject.jsf.tag.ViewTag) _005fjspx_005ftagPool_005fsakai_005fview_005fcontainer_0026_005ftitle.get(org.sakaiproject.jsf.tag.ViewTag.class);
_jspx_th_sakai_005fview_005fcontainer_005f0.setPageContext(_jspx_page_context);
_jspx_th_sakai_005fview_005fcontainer_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fview_005f0);
// /prefs/tab.jsp(10,0) name = title type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005fview_005fcontainer_005f0.setTitle("#{msgs.prefs_title}");
int _jspx_eval_sakai_005fview_005fcontainer_005f0 = _jspx_th_sakai_005fview_005fcontainer_005f0.doStartTag();
if (_jspx_eval_sakai_005fview_005fcontainer_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
out.write('\n');
if (_jspx_meth_sakai_005fstylesheet_005f0(_jspx_th_sakai_005fview_005fcontainer_005f0, _jspx_page_context))
return true;
out.write('\n');
if (_jspx_meth_sakai_005fview_005fcontent_005f0(_jspx_th_sakai_005fview_005fcontainer_005f0, _jspx_page_context))
return true;
out.write('\n');
}
if (_jspx_th_sakai_005fview_005fcontainer_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005fview_005fcontainer_0026_005ftitle.reuse(_jspx_th_sakai_005fview_005fcontainer_005f0);
return true;
}
_005fjspx_005ftagPool_005fsakai_005fview_005fcontainer_0026_005ftitle.reuse(_jspx_th_sakai_005fview_005fcontainer_005f0);
return false;
}
private boolean _jspx_meth_sakai_005fstylesheet_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005fview_005fcontainer_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:stylesheet
org.sakaiproject.jsf.tag.StylesheetTag _jspx_th_sakai_005fstylesheet_005f0 = (org.sakaiproject.jsf.tag.StylesheetTag) _005fjspx_005ftagPool_005fsakai_005fstylesheet_0026_005fpath_005fnobody.get(org.sakaiproject.jsf.tag.StylesheetTag.class);
_jspx_th_sakai_005fstylesheet_005f0.setPageContext(_jspx_page_context);
_jspx_th_sakai_005fstylesheet_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005fview_005fcontainer_005f0);
// /prefs/tab.jsp(11,0) name = path type = java.lang.String reqTime = false required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005fstylesheet_005f0.setPath("/css/prefs.css");
int _jspx_eval_sakai_005fstylesheet_005f0 = _jspx_th_sakai_005fstylesheet_005f0.doStartTag();
if (_jspx_th_sakai_005fstylesheet_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005fstylesheet_0026_005fpath_005fnobody.reuse(_jspx_th_sakai_005fstylesheet_005f0);
return true;
}
_005fjspx_005ftagPool_005fsakai_005fstylesheet_0026_005fpath_005fnobody.reuse(_jspx_th_sakai_005fstylesheet_005f0);
return false;
}
private boolean _jspx_meth_sakai_005fview_005fcontent_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005fview_005fcontainer_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
javax.servlet.http.HttpServletRequest request = (javax.servlet.http.HttpServletRequest)_jspx_page_context.getRequest();
javax.servlet.http.HttpServletResponse response = (javax.servlet.http.HttpServletResponse)_jspx_page_context.getResponse();
// sakai:view_content
org.sakaiproject.jsf.tag.ViewContentTag _jspx_th_sakai_005fview_005fcontent_005f0 = (org.sakaiproject.jsf.tag.ViewContentTag) _005fjspx_005ftagPool_005fsakai_005fview_005fcontent.get(org.sakaiproject.jsf.tag.ViewContentTag.class);
_jspx_th_sakai_005fview_005fcontent_005f0.setPageContext(_jspx_page_context);
_jspx_th_sakai_005fview_005fcontent_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005fview_005fcontainer_005f0);
int _jspx_eval_sakai_005fview_005fcontent_005f0 = _jspx_th_sakai_005fview_005fcontent_005f0.doStartTag();
if (_jspx_eval_sakai_005fview_005fcontent_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
out.write('\n');
out.write('\n');
if (_jspx_meth_f_005fverbatim_005f0(_jspx_th_sakai_005fview_005fcontent_005f0, _jspx_page_context))
return true;
out.write('\n');
out.write(' ');
out.write(' ');
if (_jspx_meth_h_005fform_005f0(_jspx_th_sakai_005fview_005fcontent_005f0, _jspx_page_context))
return true;
out.write('\n');
}
if (_jspx_th_sakai_005fview_005fcontent_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005fview_005fcontent.reuse(_jspx_th_sakai_005fview_005fcontent_005f0);
return true;
}
_005fjspx_005ftagPool_005fsakai_005fview_005fcontent.reuse(_jspx_th_sakai_005fview_005fcontent_005f0);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005fview_005fcontent_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f0 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f0.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005fview_005fcontent_005f0);
int _jspx_eval_f_005fverbatim_005f0 = _jspx_th_f_005fverbatim_005f0.doStartTag();
if (_jspx_eval_f_005fverbatim_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f0.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f0.doInitBody();
}
do {
out.write("\n");
out.write(" <script type=\"text/javascript\" src=\"/library/js/jquery/jquery-1.9.1.min.js\">//</script>\n");
out.write(" <script type=\"text/javascript\" src=\"/library/js/fluid/1.4/MyInfusion.js\">//</script>\n");
out.write(" <script type=\"text/javascript\" src=\"/sakai-user-tool-prefs/js/prefs.js\">//</script>\n");
out.write("<script type=\"text/javascript\">\n");
out.write("<!--\n");
out.write("function checkReloadTop() {\n");
out.write(" check = jQuery('input[id$=reloadTop]').val();\n");
out.write(" if (check == 'true' ) parent.location.reload();\n");
out.write("}\n");
out.write("\n");
out.write("jQuery(document).ready(function () {\n");
out.write(" setTimeout('checkReloadTop();', 1500);\n");
out.write(" setupMultipleSelect();\n");
out.write(" setupPrefsGen();\n");
out.write("});\n");
out.write("//-->\n");
out.write("</script>\n");
if (_jspx_meth_t_005foutputText_005f0(_jspx_th_f_005fverbatim_005f0, _jspx_page_context))
return true;
out.write('\n');
out.write('\n');
if (_jspx_meth_t_005foutputText_005f1(_jspx_th_f_005fverbatim_005f0, _jspx_page_context))
return true;
out.write('\n');
if (_jspx_meth_t_005foutputText_005f2(_jspx_th_f_005fverbatim_005f0, _jspx_page_context))
return true;
out.write('\n');
if (_jspx_meth_t_005foutputText_005f3(_jspx_th_f_005fverbatim_005f0, _jspx_page_context))
return true;
out.write('\n');
if (_jspx_meth_t_005foutputText_005f4(_jspx_th_f_005fverbatim_005f0, _jspx_page_context))
return true;
out.write('\n');
out.write('\n');
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f0);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f0);
return false;
}
private boolean _jspx_meth_t_005foutputText_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// t:outputText
org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag _jspx_th_t_005foutputText_005f0 = (org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag) _005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fstyleClass_005fstyle_005fnobody.get(org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag.class);
_jspx_th_t_005foutputText_005f0.setPageContext(_jspx_page_context);
_jspx_th_t_005foutputText_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f0);
// /prefs/tab.jsp(32,0) name = style type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f0.setStyle("display:none");
// /prefs/tab.jsp(32,0) name = styleClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f0.setStyleClass("checkboxSelectMessage");
// /prefs/tab.jsp(32,0) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f0.setValue("#{msgs.prefs_checkbox_select_message}");
int _jspx_eval_t_005foutputText_005f0 = _jspx_th_t_005foutputText_005f0.doStartTag();
if (_jspx_th_t_005foutputText_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fstyleClass_005fstyle_005fnobody.reuse(_jspx_th_t_005foutputText_005f0);
return true;
}
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fstyleClass_005fstyle_005fnobody.reuse(_jspx_th_t_005foutputText_005f0);
return false;
}
private boolean _jspx_meth_t_005foutputText_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// t:outputText
org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag _jspx_th_t_005foutputText_005f1 = (org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag) _005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fstyleClass_005fstyle_005fnobody.get(org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag.class);
_jspx_th_t_005foutputText_005f1.setPageContext(_jspx_page_context);
_jspx_th_t_005foutputText_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f0);
// /prefs/tab.jsp(34,0) name = style type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f1.setStyle("display:none");
// /prefs/tab.jsp(34,0) name = styleClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f1.setStyleClass("movePanelMessage");
// /prefs/tab.jsp(34,0) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f1.setValue("Move selected sites to top of {0}");
int _jspx_eval_t_005foutputText_005f1 = _jspx_th_t_005foutputText_005f1.doStartTag();
if (_jspx_th_t_005foutputText_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fstyleClass_005fstyle_005fnobody.reuse(_jspx_th_t_005foutputText_005f1);
return true;
}
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fstyleClass_005fstyle_005fnobody.reuse(_jspx_th_t_005foutputText_005f1);
return false;
}
private boolean _jspx_meth_t_005foutputText_005f2(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// t:outputText
org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag _jspx_th_t_005foutputText_005f2 = (org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag) _005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fstyleClass_005fstyle_005fnobody.get(org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag.class);
_jspx_th_t_005foutputText_005f2.setPageContext(_jspx_page_context);
_jspx_th_t_005foutputText_005f2.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f0);
// /prefs/tab.jsp(35,0) name = style type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f2.setStyle("display:none");
// /prefs/tab.jsp(35,0) name = styleClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f2.setStyleClass("checkboxFromMessFav");
// /prefs/tab.jsp(35,0) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f2.setValue("#{msgs.prefs_fav_sites_short}");
int _jspx_eval_t_005foutputText_005f2 = _jspx_th_t_005foutputText_005f2.doStartTag();
if (_jspx_th_t_005foutputText_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fstyleClass_005fstyle_005fnobody.reuse(_jspx_th_t_005foutputText_005f2);
return true;
}
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fstyleClass_005fstyle_005fnobody.reuse(_jspx_th_t_005foutputText_005f2);
return false;
}
private boolean _jspx_meth_t_005foutputText_005f3(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// t:outputText
org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag _jspx_th_t_005foutputText_005f3 = (org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag) _005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fstyleClass_005fstyle_005fnobody.get(org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag.class);
_jspx_th_t_005foutputText_005f3.setPageContext(_jspx_page_context);
_jspx_th_t_005foutputText_005f3.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f0);
// /prefs/tab.jsp(36,0) name = style type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f3.setStyle("display:none");
// /prefs/tab.jsp(36,0) name = styleClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f3.setStyleClass("checkboxFromMessAct");
// /prefs/tab.jsp(36,0) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f3.setValue("#{msgs.prefs_active_sites_short}");
int _jspx_eval_t_005foutputText_005f3 = _jspx_th_t_005foutputText_005f3.doStartTag();
if (_jspx_th_t_005foutputText_005f3.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fstyleClass_005fstyle_005fnobody.reuse(_jspx_th_t_005foutputText_005f3);
return true;
}
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fstyleClass_005fstyle_005fnobody.reuse(_jspx_th_t_005foutputText_005f3);
return false;
}
private boolean _jspx_meth_t_005foutputText_005f4(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// t:outputText
org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag _jspx_th_t_005foutputText_005f4 = (org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag) _005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fstyleClass_005fstyle_005fnobody.get(org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag.class);
_jspx_th_t_005foutputText_005f4.setPageContext(_jspx_page_context);
_jspx_th_t_005foutputText_005f4.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f0);
// /prefs/tab.jsp(37,0) name = style type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f4.setStyle("display:none");
// /prefs/tab.jsp(37,0) name = styleClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f4.setStyleClass("checkboxFromMessArc");
// /prefs/tab.jsp(37,0) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f4.setValue("#{msgs.prefs_archive_sites_short}");
int _jspx_eval_t_005foutputText_005f4 = _jspx_th_t_005foutputText_005f4.doStartTag();
if (_jspx_th_t_005foutputText_005f4.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fstyleClass_005fstyle_005fnobody.reuse(_jspx_th_t_005foutputText_005f4);
return true;
}
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fstyleClass_005fstyle_005fnobody.reuse(_jspx_th_t_005foutputText_005f4);
return false;
}
private boolean _jspx_meth_h_005fform_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005fview_005fcontent_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
javax.servlet.http.HttpServletRequest request = (javax.servlet.http.HttpServletRequest)_jspx_page_context.getRequest();
javax.servlet.http.HttpServletResponse response = (javax.servlet.http.HttpServletResponse)_jspx_page_context.getResponse();
// h:form
com.sun.faces.taglib.html_basic.FormTag _jspx_th_h_005fform_005f0 = (com.sun.faces.taglib.html_basic.FormTag) _005fjspx_005ftagPool_005fh_005fform_0026_005fid.get(com.sun.faces.taglib.html_basic.FormTag.class);
_jspx_th_h_005fform_005f0.setPageContext(_jspx_page_context);
_jspx_th_h_005fform_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005fview_005fcontent_005f0);
// /prefs/tab.jsp(40,2) name = id type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fform_005f0.setId("prefs_form");
int _jspx_eval_h_005fform_005f0 = _jspx_th_h_005fform_005f0.doStartTag();
if (_jspx_eval_h_005fform_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
out.write("\n");
out.write("\t\t\t\t");
if (_jspx_meth_sakai_005ftool_005fbar_005f0(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write("\n");
out.write("\t\t\t\t<h3>\n");
out.write("\t\t\t\t\t");
if (_jspx_meth_h_005foutputText_005f0(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write("\t\t\t\t\t");
if (_jspx_meth_h_005fpanelGroup_005f0(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write("\t\t\t\t</h3>\n");
out.write(" <div class=\"act\">\n");
out.write(" ");
if (_jspx_meth_h_005fcommandButton_005f0(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_h_005fcommandButton_005f1(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" </div>\t\t\t\t\n");
out.write("\t\t\t\t\n");
out.write(" ");
if (_jspx_meth_sakai_005fmessages_005f0(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write('\n');
if (_jspx_meth_f_005fverbatim_005f1(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fverbatim_005f2(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write('\n');
out.write(' ');
out.write(' ');
if (_jspx_meth_t_005fdataList_005f0(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fverbatim_005f7(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fverbatim_005f8(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write('\n');
out.write(' ');
out.write(' ');
if (_jspx_meth_t_005fdataList_005f1(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fverbatim_005f13(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fverbatim_005f14(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write('\n');
out.write(' ');
out.write(' ');
if (_jspx_meth_t_005fdataList_005f2(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fverbatim_005f19(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fverbatim_005f20(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write('\n');
out.write('\n');
out.write('\n');
if (_jspx_meth_f_005fverbatim_005f21(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write('\n');
if (_jspx_meth_h_005foutputText_005f19(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write('\n');
if (_jspx_meth_h_005fselectOneRadio_005f0(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write('\n');
if (_jspx_meth_f_005fverbatim_005f22(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\t \t");
if (_jspx_meth_h_005fcommandButton_005f2(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write("\t\t ");
if (_jspx_meth_h_005fcommandButton_005f3(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write('\n');
out.write(' ');
out.write(' ');
if (_jspx_meth_h_005finputHidden_005f0(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write('\n');
out.write(' ');
out.write(' ');
if (_jspx_meth_h_005finputHidden_005f1(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write('\n');
out.write(' ');
out.write(' ');
if (_jspx_meth_h_005finputHidden_005f2(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write('\n');
out.write(' ');
out.write(' ');
if (_jspx_meth_h_005finputHidden_005f3(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write('\n');
if (_jspx_meth_f_005fverbatim_005f23(_jspx_th_h_005fform_005f0, _jspx_page_context))
return true;
out.write('\n');
}
if (_jspx_th_h_005fform_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005fform_0026_005fid.reuse(_jspx_th_h_005fform_005f0);
return true;
}
_005fjspx_005ftagPool_005fh_005fform_0026_005fid.reuse(_jspx_th_h_005fform_005f0);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar
org.sakaiproject.jsf.tag.ToolBarTag _jspx_th_sakai_005ftool_005fbar_005f0 = (org.sakaiproject.jsf.tag.ToolBarTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar.get(org.sakaiproject.jsf.tag.ToolBarTag.class);
_jspx_th_sakai_005ftool_005fbar_005f0.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
int _jspx_eval_sakai_005ftool_005fbar_005f0 = _jspx_th_sakai_005ftool_005fbar_005f0.doStartTag();
if (_jspx_eval_sakai_005ftool_005fbar_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
out.write("\n");
out.write("\t\t\t ");
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f0(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f1(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f2(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f3(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f4(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t \n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f5(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f6(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f7(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f8(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f9(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t \n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f10(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f11(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f12(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f13(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f14(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t \n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f15(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f16(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f17(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f18(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f19(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t \n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f20(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f21(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f22(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f23(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t ");
if (_jspx_meth_sakai_005ftool_005fbar_005fitem_005f24(_jspx_th_sakai_005ftool_005fbar_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" \t\t \n");
out.write(" \t \t");
}
if (_jspx_th_sakai_005ftool_005fbar_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar.reuse(_jspx_th_sakai_005ftool_005fbar_005f0);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar.reuse(_jspx_th_sakai_005ftool_005fbar_005f0);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f0 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f0.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(43,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f0.setAction("#{UserPrefsTool.processActionNotiFrmEdit}");
// /prefs/tab.jsp(43,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f0.setValue("#{msgs.prefs_noti_title}");
// /prefs/tab.jsp(43,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f0.setRendered("#{UserPrefsTool.noti_selection == 1}");
// /prefs/tab.jsp(43,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f0.setCurrent("false");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f0 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f0.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f0);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f0);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f1 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f1.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(44,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f1.setValue("#{msgs.prefs_tab_title}");
// /prefs/tab.jsp(44,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f1.setRendered("#{UserPrefsTool.tab_selection == 1}");
// /prefs/tab.jsp(44,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f1.setCurrent("true");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f1 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f1.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f1);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f1);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f2(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f2 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f2.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f2.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(45,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f2.setAction("#{UserPrefsTool.processActionTZFrmEdit}");
// /prefs/tab.jsp(45,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f2.setValue("#{msgs.prefs_timezone_title}");
// /prefs/tab.jsp(45,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f2.setRendered("#{UserPrefsTool.timezone_selection == 1}");
// /prefs/tab.jsp(45,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f2.setCurrent("false");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f2 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f2.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f2);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f2);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f3(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f3 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f3.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f3.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(46,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f3.setAction("#{UserPrefsTool.processActionLocFrmEdit}");
// /prefs/tab.jsp(46,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f3.setValue("#{msgs.prefs_lang_title}");
// /prefs/tab.jsp(46,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f3.setRendered("#{UserPrefsTool.language_selection == 1}");
// /prefs/tab.jsp(46,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f3.setCurrent("false");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f3 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f3.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f3.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f3);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f3);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f4(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f4 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f4.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f4.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(47,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f4.setAction("#{UserPrefsTool.processActionPrivFrmEdit}");
// /prefs/tab.jsp(47,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f4.setValue("#{msgs.prefs_privacy}");
// /prefs/tab.jsp(47,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f4.setRendered("#{UserPrefsTool.privacy_selection == 1}");
// /prefs/tab.jsp(47,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f4.setCurrent("false");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f4 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f4.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f4.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f4);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f4);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f5(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f5 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f5.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f5.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(49,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f5.setAction("#{UserPrefsTool.processActionNotiFrmEdit}");
// /prefs/tab.jsp(49,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f5.setValue("#{msgs.prefs_noti_title}");
// /prefs/tab.jsp(49,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f5.setRendered("#{UserPrefsTool.noti_selection == 2}");
// /prefs/tab.jsp(49,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f5.setCurrent("false");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f5 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f5.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f5.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f5);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f5);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f6(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f6 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f6.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f6.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(50,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f6.setValue("#{msgs.prefs_tab_title}");
// /prefs/tab.jsp(50,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f6.setRendered("#{UserPrefsTool.tab_selection == 2}");
// /prefs/tab.jsp(50,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f6.setCurrent("true");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f6 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f6.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f6.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f6);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f6);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f7(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f7 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f7.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f7.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(51,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f7.setAction("#{UserPrefsTool.processActionTZFrmEdit}");
// /prefs/tab.jsp(51,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f7.setValue("#{msgs.prefs_timezone_title}");
// /prefs/tab.jsp(51,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f7.setRendered("#{UserPrefsTool.timezone_selection == 2}");
// /prefs/tab.jsp(51,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f7.setCurrent("false");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f7 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f7.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f7.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f7);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f7);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f8(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f8 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f8.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f8.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(52,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f8.setAction("#{UserPrefsTool.processActionLocFrmEdit}");
// /prefs/tab.jsp(52,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f8.setValue("#{msgs.prefs_lang_title}");
// /prefs/tab.jsp(52,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f8.setRendered("#{UserPrefsTool.language_selection == 2}");
// /prefs/tab.jsp(52,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f8.setCurrent("false");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f8 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f8.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f8.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f8);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f8);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f9(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f9 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f9.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f9.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(53,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f9.setAction("#{UserPrefsTool.processActionPrivFrmEdit}");
// /prefs/tab.jsp(53,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f9.setValue("#{msgs.prefs_privacy}");
// /prefs/tab.jsp(53,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f9.setRendered("#{UserPrefsTool.privacy_selection == 2}");
// /prefs/tab.jsp(53,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f9.setCurrent("false");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f9 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f9.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f9.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f9);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f9);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f10(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f10 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f10.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f10.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(55,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f10.setAction("#{UserPrefsTool.processActionNotiFrmEdit}");
// /prefs/tab.jsp(55,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f10.setValue("#{msgs.prefs_noti_title}");
// /prefs/tab.jsp(55,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f10.setRendered("#{UserPrefsTool.noti_selection == 3}");
// /prefs/tab.jsp(55,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f10.setCurrent("false");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f10 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f10.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f10.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f10);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f10);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f11(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f11 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f11.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f11.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(56,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f11.setValue("#{msgs.prefs_tab_title}");
// /prefs/tab.jsp(56,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f11.setRendered("#{UserPrefsTool.tab_selection == 3}");
// /prefs/tab.jsp(56,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f11.setCurrent("true");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f11 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f11.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f11.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f11);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f11);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f12(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f12 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f12.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f12.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(57,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f12.setAction("#{UserPrefsTool.processActionTZFrmEdit}");
// /prefs/tab.jsp(57,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f12.setValue("#{msgs.prefs_timezone_title}");
// /prefs/tab.jsp(57,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f12.setRendered("#{UserPrefsTool.timezone_selection == 3}");
// /prefs/tab.jsp(57,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f12.setCurrent("false");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f12 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f12.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f12.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f12);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f12);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f13(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f13 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f13.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f13.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(58,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f13.setAction("#{UserPrefsTool.processActionLocFrmEdit}");
// /prefs/tab.jsp(58,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f13.setValue("#{msgs.prefs_lang_title}");
// /prefs/tab.jsp(58,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f13.setRendered("#{UserPrefsTool.language_selection == 3}");
// /prefs/tab.jsp(58,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f13.setCurrent("false");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f13 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f13.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f13.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f13);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f13);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f14(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f14 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f14.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f14.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(59,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f14.setAction("#{UserPrefsTool.processActionPrivFrmEdit}");
// /prefs/tab.jsp(59,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f14.setValue("#{msgs.prefs_privacy}");
// /prefs/tab.jsp(59,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f14.setRendered("#{UserPrefsTool.privacy_selection == 3}");
// /prefs/tab.jsp(59,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f14.setCurrent("false");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f14 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f14.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f14.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f14);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f14);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f15(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f15 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f15.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f15.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(61,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f15.setAction("#{UserPrefsTool.processActionNotiFrmEdit}");
// /prefs/tab.jsp(61,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f15.setValue("#{msgs.prefs_noti_title}");
// /prefs/tab.jsp(61,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f15.setRendered("#{UserPrefsTool.noti_selection == 4}");
// /prefs/tab.jsp(61,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f15.setCurrent("false");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f15 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f15.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f15.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f15);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f15);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f16(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f16 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f16.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f16.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(62,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f16.setValue("#{msgs.prefs_tab_title}");
// /prefs/tab.jsp(62,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f16.setRendered("#{UserPrefsTool.tab_selection == 4}");
// /prefs/tab.jsp(62,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f16.setCurrent("true");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f16 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f16.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f16.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f16);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f16);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f17(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f17 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f17.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f17.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(63,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f17.setAction("#{UserPrefsTool.processActionTZFrmEdit}");
// /prefs/tab.jsp(63,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f17.setValue("#{msgs.prefs_timezone_title}");
// /prefs/tab.jsp(63,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f17.setRendered("#{UserPrefsTool.timezone_selection == 4}");
// /prefs/tab.jsp(63,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f17.setCurrent("false");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f17 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f17.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f17.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f17);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f17);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f18(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f18 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f18.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f18.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(64,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f18.setAction("#{UserPrefsTool.processActionLocFrmEdit}");
// /prefs/tab.jsp(64,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f18.setValue("#{msgs.prefs_lang_title}");
// /prefs/tab.jsp(64,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f18.setRendered("#{UserPrefsTool.language_selection == 4}");
// /prefs/tab.jsp(64,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f18.setCurrent("false");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f18 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f18.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f18.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f18);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f18);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f19(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f19 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f19.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f19.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(65,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f19.setAction("#{UserPrefsTool.processActionPrivFrmEdit}");
// /prefs/tab.jsp(65,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f19.setValue("#{msgs.prefs_privacy}");
// /prefs/tab.jsp(65,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f19.setRendered("#{UserPrefsTool.privacy_selection == 4}");
// /prefs/tab.jsp(65,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f19.setCurrent("false");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f19 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f19.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f19.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f19);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f19);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f20(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f20 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f20.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f20.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(67,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f20.setAction("#{UserPrefsTool.processActionNotiFrmEdit}");
// /prefs/tab.jsp(67,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f20.setValue("#{msgs.prefs_noti_title}");
// /prefs/tab.jsp(67,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f20.setRendered("#{UserPrefsTool.noti_selection == 5}");
// /prefs/tab.jsp(67,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f20.setCurrent("false");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f20 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f20.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f20.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f20);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f20);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f21(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f21 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f21.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f21.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(68,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f21.setValue("#{msgs.prefs_tab_title}");
// /prefs/tab.jsp(68,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f21.setRendered("#{UserPrefsTool.tab_selection == 5}");
// /prefs/tab.jsp(68,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f21.setCurrent("true");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f21 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f21.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f21.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f21);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f21);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f22(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f22 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f22.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f22.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(69,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f22.setAction("#{UserPrefsTool.processActionTZFrmEdit}");
// /prefs/tab.jsp(69,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f22.setValue("#{msgs.prefs_timezone_title}");
// /prefs/tab.jsp(69,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f22.setRendered("#{UserPrefsTool.timezone_selection == 5}");
// /prefs/tab.jsp(69,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f22.setCurrent("false");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f22 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f22.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f22.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f22);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f22);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f23(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f23 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f23.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f23.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(70,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f23.setAction("#{UserPrefsTool.processActionLocFrmEdit}");
// /prefs/tab.jsp(70,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f23.setValue("#{msgs.prefs_lang_title}");
// /prefs/tab.jsp(70,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f23.setRendered("#{UserPrefsTool.language_selection == 5}");
// /prefs/tab.jsp(70,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f23.setCurrent("false");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f23 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f23.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f23.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f23);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f23);
return false;
}
private boolean _jspx_meth_sakai_005ftool_005fbar_005fitem_005f24(javax.servlet.jsp.tagext.JspTag _jspx_th_sakai_005ftool_005fbar_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:tool_bar_item
org.sakaiproject.jsf.tag.ToolBarItemTag _jspx_th_sakai_005ftool_005fbar_005fitem_005f24 = (org.sakaiproject.jsf.tag.ToolBarItemTag) _005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.get(org.sakaiproject.jsf.tag.ToolBarItemTag.class);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f24.setPageContext(_jspx_page_context);
_jspx_th_sakai_005ftool_005fbar_005fitem_005f24.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_sakai_005ftool_005fbar_005f0);
// /prefs/tab.jsp(71,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f24.setAction("#{UserPrefsTool.processActionPrivFrmEdit}");
// /prefs/tab.jsp(71,7) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f24.setValue("#{msgs.prefs_privacy}");
// /prefs/tab.jsp(71,7) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f24.setRendered("#{UserPrefsTool.privacy_selection == 5}");
// /prefs/tab.jsp(71,7) name = current type = boolean reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005ftool_005fbar_005fitem_005f24.setCurrent("false");
int _jspx_eval_sakai_005ftool_005fbar_005fitem_005f24 = _jspx_th_sakai_005ftool_005fbar_005fitem_005f24.doStartTag();
if (_jspx_th_sakai_005ftool_005fbar_005fitem_005f24.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f24);
return true;
}
_005fjspx_005ftagPool_005fsakai_005ftool_005fbar_005fitem_0026_005fvalue_005frendered_005fcurrent_005faction_005fnobody.reuse(_jspx_th_sakai_005ftool_005fbar_005fitem_005f24);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f0 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f0.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
// /prefs/tab.jsp(76,5) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f0.setValue("#{msgs.prefs_tab_title}");
int _jspx_eval_h_005foutputText_005f0 = _jspx_th_h_005foutputText_005f0.doStartTag();
if (_jspx_th_h_005foutputText_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f0);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f0);
return false;
}
private boolean _jspx_meth_h_005fpanelGroup_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
javax.servlet.http.HttpServletRequest request = (javax.servlet.http.HttpServletRequest)_jspx_page_context.getRequest();
javax.servlet.http.HttpServletResponse response = (javax.servlet.http.HttpServletResponse)_jspx_page_context.getResponse();
// h:panelGroup
com.sun.faces.taglib.html_basic.PanelGroupTag _jspx_th_h_005fpanelGroup_005f0 = (com.sun.faces.taglib.html_basic.PanelGroupTag) _005fjspx_005ftagPool_005fh_005fpanelGroup_0026_005fstyle_005frendered.get(com.sun.faces.taglib.html_basic.PanelGroupTag.class);
_jspx_th_h_005fpanelGroup_005f0.setPageContext(_jspx_page_context);
_jspx_th_h_005fpanelGroup_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
// /prefs/tab.jsp(77,5) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fpanelGroup_005f0.setRendered("#{UserPrefsTool.tabUpdated}");
// /prefs/tab.jsp(77,5) name = style type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fpanelGroup_005f0.setStyle("margin:0 3em;font-weight:normal");
int _jspx_eval_h_005fpanelGroup_005f0 = _jspx_th_h_005fpanelGroup_005f0.doStartTag();
if (_jspx_eval_h_005fpanelGroup_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
out.write("\n");
out.write("\t\t\t\t\t\t");
org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "prefUpdatedMsg.jsp", out, false);
out.write("\t\n");
out.write("\t\t\t\t\t");
}
if (_jspx_th_h_005fpanelGroup_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005fpanelGroup_0026_005fstyle_005frendered.reuse(_jspx_th_h_005fpanelGroup_005f0);
return true;
}
_005fjspx_005ftagPool_005fh_005fpanelGroup_0026_005fstyle_005frendered.reuse(_jspx_th_h_005fpanelGroup_005f0);
return false;
}
private boolean _jspx_meth_h_005fcommandButton_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:commandButton
com.sun.faces.taglib.html_basic.CommandButtonTag _jspx_th_h_005fcommandButton_005f0 = (com.sun.faces.taglib.html_basic.CommandButtonTag) _005fjspx_005ftagPool_005fh_005fcommandButton_0026_005fvalue_005fstyleClass_005fid_005faction_005faccesskey_005fnobody.get(com.sun.faces.taglib.html_basic.CommandButtonTag.class);
_jspx_th_h_005fcommandButton_005f0.setPageContext(_jspx_page_context);
_jspx_th_h_005fcommandButton_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
// /prefs/tab.jsp(82,12) name = accesskey type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fcommandButton_005f0.setAccesskey("s");
// /prefs/tab.jsp(82,12) name = id type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fcommandButton_005f0.setId("prefAllSub");
// /prefs/tab.jsp(82,12) name = styleClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fcommandButton_005f0.setStyleClass("active formButton");
// /prefs/tab.jsp(82,12) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fcommandButton_005f0.setValue("#{msgs.update_pref}");
// /prefs/tab.jsp(82,12) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fcommandButton_005f0.setAction("#{UserPrefsTool.processActionSaveOrder}");
int _jspx_eval_h_005fcommandButton_005f0 = _jspx_th_h_005fcommandButton_005f0.doStartTag();
if (_jspx_th_h_005fcommandButton_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005fcommandButton_0026_005fvalue_005fstyleClass_005fid_005faction_005faccesskey_005fnobody.reuse(_jspx_th_h_005fcommandButton_005f0);
return true;
}
_005fjspx_005ftagPool_005fh_005fcommandButton_0026_005fvalue_005fstyleClass_005fid_005faction_005faccesskey_005fnobody.reuse(_jspx_th_h_005fcommandButton_005f0);
return false;
}
private boolean _jspx_meth_h_005fcommandButton_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:commandButton
com.sun.faces.taglib.html_basic.CommandButtonTag _jspx_th_h_005fcommandButton_005f1 = (com.sun.faces.taglib.html_basic.CommandButtonTag) _005fjspx_005ftagPool_005fh_005fcommandButton_0026_005fvalue_005fstyleClass_005fid_005faction_005faccesskey_005fnobody.get(com.sun.faces.taglib.html_basic.CommandButtonTag.class);
_jspx_th_h_005fcommandButton_005f1.setPageContext(_jspx_page_context);
_jspx_th_h_005fcommandButton_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
// /prefs/tab.jsp(83,12) name = accesskey type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fcommandButton_005f1.setAccesskey("x");
// /prefs/tab.jsp(83,12) name = id type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fcommandButton_005f1.setId("cancel");
// /prefs/tab.jsp(83,12) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fcommandButton_005f1.setValue("#{msgs.cancel_pref}");
// /prefs/tab.jsp(83,12) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fcommandButton_005f1.setAction("#{UserPrefsTool.processActionCancel}");
// /prefs/tab.jsp(83,12) name = styleClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fcommandButton_005f1.setStyleClass("formButton");
int _jspx_eval_h_005fcommandButton_005f1 = _jspx_th_h_005fcommandButton_005f1.doStartTag();
if (_jspx_th_h_005fcommandButton_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005fcommandButton_0026_005fvalue_005fstyleClass_005fid_005faction_005faccesskey_005fnobody.reuse(_jspx_th_h_005fcommandButton_005f1);
return true;
}
_005fjspx_005ftagPool_005fh_005fcommandButton_0026_005fvalue_005fstyleClass_005fid_005faction_005faccesskey_005fnobody.reuse(_jspx_th_h_005fcommandButton_005f1);
return false;
}
private boolean _jspx_meth_sakai_005fmessages_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// sakai:messages
org.sakaiproject.jsf.tag.MessagesTag _jspx_th_sakai_005fmessages_005f0 = (org.sakaiproject.jsf.tag.MessagesTag) _005fjspx_005ftagPool_005fsakai_005fmessages_0026_005frendered_005fnobody.get(org.sakaiproject.jsf.tag.MessagesTag.class);
_jspx_th_sakai_005fmessages_005f0.setPageContext(_jspx_page_context);
_jspx_th_sakai_005fmessages_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
// /prefs/tab.jsp(86,26) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_sakai_005fmessages_005f0.setRendered("#{!empty facesContext.maximumSeverity}");
int _jspx_eval_sakai_005fmessages_005f0 = _jspx_th_sakai_005fmessages_005f0.doStartTag();
if (_jspx_th_sakai_005fmessages_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fsakai_005fmessages_0026_005frendered_005fnobody.reuse(_jspx_th_sakai_005fmessages_005f0);
return true;
}
_005fjspx_005ftagPool_005fsakai_005fmessages_0026_005frendered_005fnobody.reuse(_jspx_th_sakai_005fmessages_005f0);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f1 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f1.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
int _jspx_eval_f_005fverbatim_005f1 = _jspx_th_f_005fverbatim_005f1.doStartTag();
if (_jspx_eval_f_005fverbatim_005f1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f1.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f1.doInitBody();
}
do {
out.write("\n");
out.write("<div class=\"layoutReorderer-container fl-container-flex\" id=\"layoutReorderer\" style=\"margin:.5em 0\">\n");
out.write(" <p>\n");
out.write(" ");
if (_jspx_meth_h_005foutputText_005f1(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
out.write("\n");
out.write(" </p>\n");
out.write(" <p>\n");
out.write(" ");
if (_jspx_meth_h_005foutputText_005f2(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
out.write("\n");
out.write(" </p>\n");
out.write(" <p>\n");
out.write(" ");
if (_jspx_meth_h_005foutputText_005f3(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
out.write("\n");
out.write(" <p>\n");
out.write(" ");
if (_jspx_meth_h_005foutputText_005f4(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
out.write("\n");
out.write(" </p>\n");
out.write("\n");
out.write(" <div id=\"movePanel\">\n");
out.write(" <h4 class=\"skip\">");
if (_jspx_meth_h_005foutputText_005f5(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
out.write("</h4>\n");
out.write(" <div id=\"movePanelTop\" style=\"display:none\"><a href=\"#\" accesskey=\"6\" title=\"");
if (_jspx_meth_h_005foutputText_005f6(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
out.write('"');
out.write('>');
if (_jspx_meth_h_005fgraphicImage_005f0(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
if (_jspx_meth_h_005foutputText_005f7(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
out.write("</a></div>\n");
out.write(" <div id=\"movePanelTopDummy\" class=\"dummy\">");
if (_jspx_meth_h_005fgraphicImage_005f1(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
out.write("</div>\n");
out.write(" <div id=\"movePanelLeftRight\">\n");
out.write(" <a href=\"#\" id=\"movePanelLeft\" style=\"display:none\" accesskey=\"7\" title=\"");
if (_jspx_meth_h_005foutputText_005f8(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
out.write('"');
out.write('>');
if (_jspx_meth_h_005fgraphicImage_005f2(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
if (_jspx_meth_h_005foutputText_005f9(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
out.write("</a>\n");
out.write(" <span id=\"movePanelLeftDummy\">");
if (_jspx_meth_h_005fgraphicImage_005f3(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
out.write("</span> \n");
out.write(" \n");
out.write(" <a href=\"#\" id=\"movePanelRight\" style=\"display:none\" accesskey=\"8\" title=\"");
if (_jspx_meth_h_005foutputText_005f10(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
out.write('"');
out.write('>');
if (_jspx_meth_h_005fgraphicImage_005f4(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
if (_jspx_meth_h_005foutputText_005f11(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
out.write("</a>\n");
out.write(" <span id=\"movePanelRightDummy\"class=\"dummy\">");
if (_jspx_meth_h_005fgraphicImage_005f5(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
out.write("</span> \n");
out.write(" </div>\n");
out.write(" \n");
out.write(" <div id=\"movePanelBottom\" style=\"display:none\"><a href=\"#\" accesskey=\"9\" title=\"");
if (_jspx_meth_h_005foutputText_005f12(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
out.write('"');
out.write('>');
if (_jspx_meth_h_005fgraphicImage_005f6(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
if (_jspx_meth_h_005foutputText_005f13(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
out.write("</a></div>\n");
out.write(" <div id=\"movePanelBottomDummy\"class=\"dummy\">");
if (_jspx_meth_h_005fgraphicImage_005f7(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
out.write("</div>\n");
out.write(" </div> \n");
out.write("<div class=\"columnSetup3 fluid-vertical-order\">\n");
out.write("<!-- invalid drag n drop message template -->\n");
out.write("<p class=\"flc-reorderer-dropWarning layoutReorderer-dropWarning\">\n");
if (_jspx_meth_h_005foutputText_005f14(_jspx_th_f_005fverbatim_005f1, _jspx_page_context))
return true;
out.write("\n");
out.write("</p>\n");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f1.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f1);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f1);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f1 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fescape_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f1.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(90,8) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f1.setValue("#{msgs.prefs_mouse_instructions}");
// /prefs/tab.jsp(90,8) name = escape type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f1.setEscape("false");
int _jspx_eval_h_005foutputText_005f1 = _jspx_th_h_005foutputText_005f1.doStartTag();
if (_jspx_th_h_005foutputText_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fescape_005fnobody.reuse(_jspx_th_h_005foutputText_005f1);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fescape_005fnobody.reuse(_jspx_th_h_005foutputText_005f1);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f2(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f2 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fescape_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f2.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f2.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(93,8) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f2.setValue("#{msgs.prefs_keyboard_instructions}");
// /prefs/tab.jsp(93,8) name = escape type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f2.setEscape("false");
int _jspx_eval_h_005foutputText_005f2 = _jspx_th_h_005foutputText_005f2.doStartTag();
if (_jspx_th_h_005foutputText_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fescape_005fnobody.reuse(_jspx_th_h_005foutputText_005f2);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fescape_005fnobody.reuse(_jspx_th_h_005foutputText_005f2);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f3(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f3 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fescape_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f3.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f3.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(96,8) name = styleClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f3.setStyleClass("skip");
// /prefs/tab.jsp(96,8) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f3.setValue("#{msgs.prefs_multitples_instructions_scru}");
// /prefs/tab.jsp(96,8) name = escape type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f3.setEscape("false");
int _jspx_eval_h_005foutputText_005f3 = _jspx_th_h_005foutputText_005f3.doStartTag();
if (_jspx_th_h_005foutputText_005f3.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fescape_005fnobody.reuse(_jspx_th_h_005foutputText_005f3);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fescape_005fnobody.reuse(_jspx_th_h_005foutputText_005f3);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f4(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f4 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fescape_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f4.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f4.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(98,8) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f4.setValue("#{msgs.prefs_multitples_instructions}");
// /prefs/tab.jsp(98,8) name = escape type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f4.setEscape("false");
int _jspx_eval_h_005foutputText_005f4 = _jspx_th_h_005foutputText_005f4.doStartTag();
if (_jspx_th_h_005foutputText_005f4.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fescape_005fnobody.reuse(_jspx_th_h_005foutputText_005f4);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fescape_005fnobody.reuse(_jspx_th_h_005foutputText_005f4);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f5(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f5 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fescape_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f5.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f5.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(102,25) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f5.setValue("#{msgs.prefs_multitples_instructions_panel_title}");
// /prefs/tab.jsp(102,25) name = escape type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f5.setEscape("false");
int _jspx_eval_h_005foutputText_005f5 = _jspx_th_h_005foutputText_005f5.doStartTag();
if (_jspx_th_h_005foutputText_005f5.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fescape_005fnobody.reuse(_jspx_th_h_005foutputText_005f5);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fescape_005fnobody.reuse(_jspx_th_h_005foutputText_005f5);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f6(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f6 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f6.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f6.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(103,85) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f6.setValue("#{msgs.tabs_move_top}");
int _jspx_eval_h_005foutputText_005f6 = _jspx_th_h_005foutputText_005f6.doStartTag();
if (_jspx_th_h_005foutputText_005f6.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f6);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f6);
return false;
}
private boolean _jspx_meth_h_005fgraphicImage_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:graphicImage
com.sun.faces.taglib.html_basic.GraphicImageTag _jspx_th_h_005fgraphicImage_005f0 = (com.sun.faces.taglib.html_basic.GraphicImageTag) _005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.get(com.sun.faces.taglib.html_basic.GraphicImageTag.class);
_jspx_th_h_005fgraphicImage_005f0.setPageContext(_jspx_page_context);
_jspx_th_h_005fgraphicImage_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(103,132) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fgraphicImage_005f0.setValue("prefs/to-top.png");
// /prefs/tab.jsp(103,132) name = alt type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fgraphicImage_005f0.setAlt("");
int _jspx_eval_h_005fgraphicImage_005f0 = _jspx_th_h_005fgraphicImage_005f0.doStartTag();
if (_jspx_th_h_005fgraphicImage_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.reuse(_jspx_th_h_005fgraphicImage_005f0);
return true;
}
_005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.reuse(_jspx_th_h_005fgraphicImage_005f0);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f7(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f7 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f7.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f7.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(103,182) name = styleClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f7.setStyleClass("skip");
// /prefs/tab.jsp(103,182) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f7.setValue("#{msgs.tabs_move_top}");
int _jspx_eval_h_005foutputText_005f7 = _jspx_th_h_005foutputText_005f7.doStartTag();
if (_jspx_th_h_005foutputText_005f7.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fnobody.reuse(_jspx_th_h_005foutputText_005f7);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fnobody.reuse(_jspx_th_h_005foutputText_005f7);
return false;
}
private boolean _jspx_meth_h_005fgraphicImage_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:graphicImage
com.sun.faces.taglib.html_basic.GraphicImageTag _jspx_th_h_005fgraphicImage_005f1 = (com.sun.faces.taglib.html_basic.GraphicImageTag) _005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.get(com.sun.faces.taglib.html_basic.GraphicImageTag.class);
_jspx_th_h_005fgraphicImage_005f1.setPageContext(_jspx_page_context);
_jspx_th_h_005fgraphicImage_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(104,50) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fgraphicImage_005f1.setValue("prefs/to-top-dis.png");
// /prefs/tab.jsp(104,50) name = alt type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fgraphicImage_005f1.setAlt("");
int _jspx_eval_h_005fgraphicImage_005f1 = _jspx_th_h_005fgraphicImage_005f1.doStartTag();
if (_jspx_th_h_005fgraphicImage_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.reuse(_jspx_th_h_005fgraphicImage_005f1);
return true;
}
_005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.reuse(_jspx_th_h_005fgraphicImage_005f1);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f8(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f8 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f8.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f8.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(106,86) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f8.setValue("#{msgs.tabs_move_left}");
int _jspx_eval_h_005foutputText_005f8 = _jspx_th_h_005foutputText_005f8.doStartTag();
if (_jspx_th_h_005foutputText_005f8.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f8);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f8);
return false;
}
private boolean _jspx_meth_h_005fgraphicImage_005f2(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:graphicImage
com.sun.faces.taglib.html_basic.GraphicImageTag _jspx_th_h_005fgraphicImage_005f2 = (com.sun.faces.taglib.html_basic.GraphicImageTag) _005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.get(com.sun.faces.taglib.html_basic.GraphicImageTag.class);
_jspx_th_h_005fgraphicImage_005f2.setPageContext(_jspx_page_context);
_jspx_th_h_005fgraphicImage_005f2.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(106,134) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fgraphicImage_005f2.setValue("prefs/to-left.png");
// /prefs/tab.jsp(106,134) name = alt type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fgraphicImage_005f2.setAlt("");
int _jspx_eval_h_005fgraphicImage_005f2 = _jspx_th_h_005fgraphicImage_005f2.doStartTag();
if (_jspx_th_h_005fgraphicImage_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.reuse(_jspx_th_h_005fgraphicImage_005f2);
return true;
}
_005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.reuse(_jspx_th_h_005fgraphicImage_005f2);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f9(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f9 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f9.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f9.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(106,185) name = styleClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f9.setStyleClass("skip");
// /prefs/tab.jsp(106,185) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f9.setValue("#{msgs.tabs_move_left}");
int _jspx_eval_h_005foutputText_005f9 = _jspx_th_h_005foutputText_005f9.doStartTag();
if (_jspx_th_h_005foutputText_005f9.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fnobody.reuse(_jspx_th_h_005foutputText_005f9);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fnobody.reuse(_jspx_th_h_005foutputText_005f9);
return false;
}
private boolean _jspx_meth_h_005fgraphicImage_005f3(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:graphicImage
com.sun.faces.taglib.html_basic.GraphicImageTag _jspx_th_h_005fgraphicImage_005f3 = (com.sun.faces.taglib.html_basic.GraphicImageTag) _005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.get(com.sun.faces.taglib.html_basic.GraphicImageTag.class);
_jspx_th_h_005fgraphicImage_005f3.setPageContext(_jspx_page_context);
_jspx_th_h_005fgraphicImage_005f3.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(107,42) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fgraphicImage_005f3.setValue("prefs/to-left-dis.png");
// /prefs/tab.jsp(107,42) name = alt type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fgraphicImage_005f3.setAlt("");
int _jspx_eval_h_005fgraphicImage_005f3 = _jspx_th_h_005fgraphicImage_005f3.doStartTag();
if (_jspx_th_h_005fgraphicImage_005f3.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.reuse(_jspx_th_h_005fgraphicImage_005f3);
return true;
}
_005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.reuse(_jspx_th_h_005fgraphicImage_005f3);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f10(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f10 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f10.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f10.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(109,87) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f10.setValue("#{msgs.tabs_move_right}");
int _jspx_eval_h_005foutputText_005f10 = _jspx_th_h_005foutputText_005f10.doStartTag();
if (_jspx_th_h_005foutputText_005f10.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f10);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f10);
return false;
}
private boolean _jspx_meth_h_005fgraphicImage_005f4(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:graphicImage
com.sun.faces.taglib.html_basic.GraphicImageTag _jspx_th_h_005fgraphicImage_005f4 = (com.sun.faces.taglib.html_basic.GraphicImageTag) _005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.get(com.sun.faces.taglib.html_basic.GraphicImageTag.class);
_jspx_th_h_005fgraphicImage_005f4.setPageContext(_jspx_page_context);
_jspx_th_h_005fgraphicImage_005f4.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(109,136) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fgraphicImage_005f4.setValue("prefs/to-right.png");
// /prefs/tab.jsp(109,136) name = alt type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fgraphicImage_005f4.setAlt("");
int _jspx_eval_h_005fgraphicImage_005f4 = _jspx_th_h_005fgraphicImage_005f4.doStartTag();
if (_jspx_th_h_005fgraphicImage_005f4.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.reuse(_jspx_th_h_005fgraphicImage_005f4);
return true;
}
_005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.reuse(_jspx_th_h_005fgraphicImage_005f4);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f11(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f11 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f11.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f11.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(109,188) name = styleClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f11.setStyleClass("skip");
// /prefs/tab.jsp(109,188) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f11.setValue("#{msgs.tabs_move_right}");
int _jspx_eval_h_005foutputText_005f11 = _jspx_th_h_005foutputText_005f11.doStartTag();
if (_jspx_th_h_005foutputText_005f11.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fnobody.reuse(_jspx_th_h_005foutputText_005f11);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fnobody.reuse(_jspx_th_h_005foutputText_005f11);
return false;
}
private boolean _jspx_meth_h_005fgraphicImage_005f5(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:graphicImage
com.sun.faces.taglib.html_basic.GraphicImageTag _jspx_th_h_005fgraphicImage_005f5 = (com.sun.faces.taglib.html_basic.GraphicImageTag) _005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.get(com.sun.faces.taglib.html_basic.GraphicImageTag.class);
_jspx_th_h_005fgraphicImage_005f5.setPageContext(_jspx_page_context);
_jspx_th_h_005fgraphicImage_005f5.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(110,56) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fgraphicImage_005f5.setValue("prefs/to-right-dis.png");
// /prefs/tab.jsp(110,56) name = alt type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fgraphicImage_005f5.setAlt("");
int _jspx_eval_h_005fgraphicImage_005f5 = _jspx_th_h_005fgraphicImage_005f5.doStartTag();
if (_jspx_th_h_005fgraphicImage_005f5.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.reuse(_jspx_th_h_005fgraphicImage_005f5);
return true;
}
_005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.reuse(_jspx_th_h_005fgraphicImage_005f5);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f12(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f12 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f12.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f12.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(113,88) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f12.setValue("#{msgs.tabs_move_bottom}");
int _jspx_eval_h_005foutputText_005f12 = _jspx_th_h_005foutputText_005f12.doStartTag();
if (_jspx_th_h_005foutputText_005f12.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f12);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f12);
return false;
}
private boolean _jspx_meth_h_005fgraphicImage_005f6(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:graphicImage
com.sun.faces.taglib.html_basic.GraphicImageTag _jspx_th_h_005fgraphicImage_005f6 = (com.sun.faces.taglib.html_basic.GraphicImageTag) _005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.get(com.sun.faces.taglib.html_basic.GraphicImageTag.class);
_jspx_th_h_005fgraphicImage_005f6.setPageContext(_jspx_page_context);
_jspx_th_h_005fgraphicImage_005f6.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(113,138) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fgraphicImage_005f6.setValue("prefs/to-bottom.png");
// /prefs/tab.jsp(113,138) name = alt type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fgraphicImage_005f6.setAlt("");
int _jspx_eval_h_005fgraphicImage_005f6 = _jspx_th_h_005fgraphicImage_005f6.doStartTag();
if (_jspx_th_h_005fgraphicImage_005f6.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.reuse(_jspx_th_h_005fgraphicImage_005f6);
return true;
}
_005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.reuse(_jspx_th_h_005fgraphicImage_005f6);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f13(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f13 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f13.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f13.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(113,191) name = styleClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f13.setStyleClass("skip");
// /prefs/tab.jsp(113,191) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f13.setValue("#{msgs.tabs_move_bottom}");
int _jspx_eval_h_005foutputText_005f13 = _jspx_th_h_005foutputText_005f13.doStartTag();
if (_jspx_th_h_005foutputText_005f13.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fnobody.reuse(_jspx_th_h_005foutputText_005f13);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fstyleClass_005fnobody.reuse(_jspx_th_h_005foutputText_005f13);
return false;
}
private boolean _jspx_meth_h_005fgraphicImage_005f7(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:graphicImage
com.sun.faces.taglib.html_basic.GraphicImageTag _jspx_th_h_005fgraphicImage_005f7 = (com.sun.faces.taglib.html_basic.GraphicImageTag) _005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.get(com.sun.faces.taglib.html_basic.GraphicImageTag.class);
_jspx_th_h_005fgraphicImage_005f7.setPageContext(_jspx_page_context);
_jspx_th_h_005fgraphicImage_005f7.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(114,52) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fgraphicImage_005f7.setValue("prefs/to-bottom-dis.png");
// /prefs/tab.jsp(114,52) name = alt type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fgraphicImage_005f7.setAlt("");
int _jspx_eval_h_005fgraphicImage_005f7 = _jspx_th_h_005fgraphicImage_005f7.doStartTag();
if (_jspx_th_h_005fgraphicImage_005f7.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.reuse(_jspx_th_h_005fgraphicImage_005f7);
return true;
}
_005fjspx_005ftagPool_005fh_005fgraphicImage_0026_005fvalue_005falt_005fnobody.reuse(_jspx_th_h_005fgraphicImage_005f7);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f14(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f14 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f14.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f14.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f1);
// /prefs/tab.jsp(119,0) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f14.setValue("#{msgs.prefs_element_locked}");
int _jspx_eval_h_005foutputText_005f14 = _jspx_th_h_005foutputText_005f14.doStartTag();
if (_jspx_th_h_005foutputText_005f14.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f14);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f14);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f2(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f2 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f2.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f2.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
int _jspx_eval_f_005fverbatim_005f2 = _jspx_th_f_005fverbatim_005f2.doStartTag();
if (_jspx_eval_f_005fverbatim_005f2 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f2 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f2.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f2.doInitBody();
}
do {
out.write("\n");
out.write("\t\t\t<!-- Column #1 -->\n");
out.write(" <div class=\"flc-reorderer-column col1\" id=\"reorderCol1\">\n");
out.write(" <div class=\"colTitle layoutReorderer-locked\"><h4>");
if (_jspx_meth_h_005foutputText_005f15(_jspx_th_f_005fverbatim_005f2, _jspx_page_context))
return true;
out.write("</h4></div>\n");
out.write("\n");
out.write("<div class=\"flc-reorderer-module layoutReorderer-module layoutReorderer-locked\">\n");
out.write("<div class=\"demoSelector-layoutReorderer layoutReorderer-module-dragbar\">");
if (_jspx_meth_h_005foutputText_005f16(_jspx_th_f_005fverbatim_005f2, _jspx_page_context))
return true;
out.write("</div></div>\n");
out.write("\n");
out.write("\t\t");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f2.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f2 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f2);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f2);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f15(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f2, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f15 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f15.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f15.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f2);
// /prefs/tab.jsp(125,77) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f15.setValue("#{msgs.prefs_fav_sites}");
int _jspx_eval_h_005foutputText_005f15 = _jspx_th_h_005foutputText_005f15.doStartTag();
if (_jspx_th_h_005foutputText_005f15.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f15);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f15);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f16(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f2, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f16 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f16.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f16.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f2);
// /prefs/tab.jsp(128,73) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f16.setValue("#{msgs.prefs_my_workspace}");
int _jspx_eval_h_005foutputText_005f16 = _jspx_th_h_005foutputText_005f16.doStartTag();
if (_jspx_th_h_005foutputText_005f16.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f16);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f16);
return false;
}
private boolean _jspx_meth_t_005fdataList_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// t:dataList
org.apache.myfaces.custom.datalist.HtmlDataListTag _jspx_th_t_005fdataList_005f0 = (org.apache.myfaces.custom.datalist.HtmlDataListTag) _005fjspx_005ftagPool_005ft_005fdataList_0026_005fvar_005fvalue_005frowIndexVar_005flayout_005fitemStyleClass_005fid.get(org.apache.myfaces.custom.datalist.HtmlDataListTag.class);
_jspx_th_t_005fdataList_005f0.setPageContext(_jspx_page_context);
_jspx_th_t_005fdataList_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
// /prefs/tab.jsp(131,2) name = id type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005fdataList_005f0.setId("dt1");
// /prefs/tab.jsp(131,2) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005fdataList_005f0.setValue("#{UserPrefsTool.prefTabItems}");
// /prefs/tab.jsp(131,2) name = var type = java.lang.String reqTime = false required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005fdataList_005f0.setVar("item");
// /prefs/tab.jsp(131,2) name = layout type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005fdataList_005f0.setLayout("simple");
// /prefs/tab.jsp(131,2) name = rowIndexVar type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005fdataList_005f0.setRowIndexVar("counter");
// /prefs/tab.jsp(131,2) name = itemStyleClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005fdataList_005f0.setItemStyleClass("dataListStyle");
int _jspx_eval_t_005fdataList_005f0 = _jspx_th_t_005fdataList_005f0.doStartTag();
if (_jspx_eval_t_005fdataList_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_t_005fdataList_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_t_005fdataList_005f0.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_t_005fdataList_005f0.doInitBody();
}
do {
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fverbatim_005f3(_jspx_th_t_005fdataList_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_t_005foutputText_005f5(_jspx_th_t_005fdataList_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fverbatim_005f4(_jspx_th_t_005fdataList_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_t_005foutputText_005f6(_jspx_th_t_005fdataList_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fverbatim_005f5(_jspx_th_t_005fdataList_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_h_005foutputFormat_005f0(_jspx_th_t_005fdataList_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fverbatim_005f6(_jspx_th_t_005fdataList_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\t\t");
int evalDoAfterBody = _jspx_th_t_005fdataList_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_t_005fdataList_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_t_005fdataList_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ft_005fdataList_0026_005fvar_005fvalue_005frowIndexVar_005flayout_005fitemStyleClass_005fid.reuse(_jspx_th_t_005fdataList_005f0);
return true;
}
_005fjspx_005ftagPool_005ft_005fdataList_0026_005fvar_005fvalue_005frowIndexVar_005flayout_005fitemStyleClass_005fid.reuse(_jspx_th_t_005fdataList_005f0);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f3(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f3 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f3.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f3.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f0);
int _jspx_eval_f_005fverbatim_005f3 = _jspx_th_f_005fverbatim_005f3.doStartTag();
if (_jspx_eval_f_005fverbatim_005f3 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f3 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f3.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f3.doInitBody();
}
do {
out.write("\n");
out.write(" <div class=\"flc-reorderer-module layoutReorderer-module last-login\"\n");
out.write("\t\t\tid=\"");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f3.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f3 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f3.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f3);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f3);
return false;
}
private boolean _jspx_meth_t_005foutputText_005f5(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// t:outputText
org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag _jspx_th_t_005foutputText_005f5 = (org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag) _005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fnobody.get(org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag.class);
_jspx_th_t_005foutputText_005f5.setPageContext(_jspx_page_context);
_jspx_th_t_005foutputText_005f5.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f0);
// /prefs/tab.jsp(138,18) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f5.setValue("#{item.value}");
int _jspx_eval_t_005foutputText_005f5 = _jspx_th_t_005foutputText_005f5.doStartTag();
if (_jspx_th_t_005foutputText_005f5.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_t_005foutputText_005f5);
return true;
}
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_t_005foutputText_005f5);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f4(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f4 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f4.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f4.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f0);
int _jspx_eval_f_005fverbatim_005f4 = _jspx_th_f_005fverbatim_005f4.doStartTag();
if (_jspx_eval_f_005fverbatim_005f4 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f4 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f4.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f4.doInitBody();
}
do {
out.write("\">\n");
out.write(" <div class=\"demoSelector-layoutReorderer layoutReorderer-module-dragbar\">\n");
out.write("\t\t");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f4.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f4 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f4.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f4);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f4);
return false;
}
private boolean _jspx_meth_t_005foutputText_005f6(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// t:outputText
org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag _jspx_th_t_005foutputText_005f6 = (org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag) _005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005ftitle_005fstyleClass_005fnobody.get(org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag.class);
_jspx_th_t_005foutputText_005f6.setPageContext(_jspx_page_context);
_jspx_th_t_005foutputText_005f6.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f0);
// /prefs/tab.jsp(142,16) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f6.setValue("#{item.label}");
// /prefs/tab.jsp(142,16) name = styleClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f6.setStyleClass("siteLabel");
// /prefs/tab.jsp(142,16) name = title type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f6.setTitle("#{item.description}");
int _jspx_eval_t_005foutputText_005f6 = _jspx_th_t_005foutputText_005f6.doStartTag();
if (_jspx_th_t_005foutputText_005f6.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005ftitle_005fstyleClass_005fnobody.reuse(_jspx_th_t_005foutputText_005f6);
return true;
}
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005ftitle_005fstyleClass_005fnobody.reuse(_jspx_th_t_005foutputText_005f6);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f5(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f5 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f5.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f5.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f0);
int _jspx_eval_f_005fverbatim_005f5 = _jspx_th_f_005fverbatim_005f5.doStartTag();
if (_jspx_eval_f_005fverbatim_005f5 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f5 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f5.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f5.doInitBody();
}
do {
out.write("\n");
out.write(" <div class=\"checkBoxContainer\">\n");
out.write(" <input type=\"checkbox\" class=\"selectSiteCheck\" title=\"\n");
out.write(" ");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f5.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f5 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f5.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f5);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f5);
return false;
}
private boolean _jspx_meth_h_005foutputFormat_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputFormat
com.sun.faces.taglib.html_basic.OutputFormatTag _jspx_th_h_005foutputFormat_005f0 = (com.sun.faces.taglib.html_basic.OutputFormatTag) _005fjspx_005ftagPool_005fh_005foutputFormat_0026_005fvalue.get(com.sun.faces.taglib.html_basic.OutputFormatTag.class);
_jspx_th_h_005foutputFormat_005f0.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputFormat_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f0);
// /prefs/tab.jsp(147,16) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputFormat_005f0.setValue("#{msgs.prefs_checkbox_select_message}");
int _jspx_eval_h_005foutputFormat_005f0 = _jspx_th_h_005foutputFormat_005f0.doStartTag();
if (_jspx_eval_h_005foutputFormat_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fparam_005f0(_jspx_th_h_005foutputFormat_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fparam_005f1(_jspx_th_h_005foutputFormat_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
}
if (_jspx_th_h_005foutputFormat_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputFormat_0026_005fvalue.reuse(_jspx_th_h_005foutputFormat_005f0);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputFormat_0026_005fvalue.reuse(_jspx_th_h_005foutputFormat_005f0);
return false;
}
private boolean _jspx_meth_f_005fparam_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005foutputFormat_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:param
com.sun.faces.taglib.jsf_core.ParameterTag _jspx_th_f_005fparam_005f0 = (com.sun.faces.taglib.jsf_core.ParameterTag) _005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody.get(com.sun.faces.taglib.jsf_core.ParameterTag.class);
_jspx_th_f_005fparam_005f0.setPageContext(_jspx_page_context);
_jspx_th_f_005fparam_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005foutputFormat_005f0);
// /prefs/tab.jsp(148,20) name = value type = java.lang.String reqTime = false required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_f_005fparam_005f0.setValue("#{item.label}");
int _jspx_eval_f_005fparam_005f0 = _jspx_th_f_005fparam_005f0.doStartTag();
if (_jspx_th_f_005fparam_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody.reuse(_jspx_th_f_005fparam_005f0);
return true;
}
_005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody.reuse(_jspx_th_f_005fparam_005f0);
return false;
}
private boolean _jspx_meth_f_005fparam_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005foutputFormat_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:param
com.sun.faces.taglib.jsf_core.ParameterTag _jspx_th_f_005fparam_005f1 = (com.sun.faces.taglib.jsf_core.ParameterTag) _005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody.get(com.sun.faces.taglib.jsf_core.ParameterTag.class);
_jspx_th_f_005fparam_005f1.setPageContext(_jspx_page_context);
_jspx_th_f_005fparam_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005foutputFormat_005f0);
// /prefs/tab.jsp(149,20) name = value type = java.lang.String reqTime = false required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_f_005fparam_005f1.setValue("#{msgs.prefs_fav_sites_short}");
int _jspx_eval_f_005fparam_005f1 = _jspx_th_f_005fparam_005f1.doStartTag();
if (_jspx_th_f_005fparam_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody.reuse(_jspx_th_f_005fparam_005f1);
return true;
}
_005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody.reuse(_jspx_th_f_005fparam_005f1);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f6(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f6 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f6.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f6.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f0);
int _jspx_eval_f_005fverbatim_005f6 = _jspx_th_f_005fverbatim_005f6.doStartTag();
if (_jspx_eval_f_005fverbatim_005f6 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f6 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f6.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f6.doInitBody();
}
do {
out.write("\"/></div></div></div>");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f6.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f6 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f6.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f6);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f6);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f7(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f7 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f7.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f7.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
int _jspx_eval_f_005fverbatim_005f7 = _jspx_th_f_005fverbatim_005f7.doStartTag();
if (_jspx_eval_f_005fverbatim_005f7 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f7 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f7.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f7.doInitBody();
}
do {
out.write("</div>");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f7.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f7 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f7.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f7);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f7);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f8(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f8 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f8.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f8.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
int _jspx_eval_f_005fverbatim_005f8 = _jspx_th_f_005fverbatim_005f8.doStartTag();
if (_jspx_eval_f_005fverbatim_005f8 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f8 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f8.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f8.doInitBody();
}
do {
out.write("\n");
out.write("\t\t\t<!-- Column #2 -->\n");
out.write(" <div class=\"flc-reorderer-column col2\" id=\"reorderCol2\">\n");
out.write(" <div class=\"colTitle layoutReorderer-locked\"><h4>");
if (_jspx_meth_h_005foutputText_005f17(_jspx_th_f_005fverbatim_005f8, _jspx_page_context))
return true;
out.write("</h4></div>\n");
out.write("\t\t");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f8.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f8 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f8.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f8);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f8);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f17(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f8, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f17 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f17.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f17.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f8);
// /prefs/tab.jsp(160,77) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f17.setValue("#{msgs.prefs_active_sites}");
int _jspx_eval_h_005foutputText_005f17 = _jspx_th_h_005foutputText_005f17.doStartTag();
if (_jspx_th_h_005foutputText_005f17.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f17);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f17);
return false;
}
private boolean _jspx_meth_t_005fdataList_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// t:dataList
org.apache.myfaces.custom.datalist.HtmlDataListTag _jspx_th_t_005fdataList_005f1 = (org.apache.myfaces.custom.datalist.HtmlDataListTag) _005fjspx_005ftagPool_005ft_005fdataList_0026_005fvar_005fvalue_005frowIndexVar_005flayout_005fitemStyleClass_005fid.get(org.apache.myfaces.custom.datalist.HtmlDataListTag.class);
_jspx_th_t_005fdataList_005f1.setPageContext(_jspx_page_context);
_jspx_th_t_005fdataList_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
// /prefs/tab.jsp(162,2) name = id type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005fdataList_005f1.setId("dt2");
// /prefs/tab.jsp(162,2) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005fdataList_005f1.setValue("#{UserPrefsTool.prefDrawerItems}");
// /prefs/tab.jsp(162,2) name = var type = java.lang.String reqTime = false required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005fdataList_005f1.setVar("item");
// /prefs/tab.jsp(162,2) name = layout type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005fdataList_005f1.setLayout("simple");
// /prefs/tab.jsp(162,2) name = rowIndexVar type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005fdataList_005f1.setRowIndexVar("counter");
// /prefs/tab.jsp(162,2) name = itemStyleClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005fdataList_005f1.setItemStyleClass("dataListStyle");
int _jspx_eval_t_005fdataList_005f1 = _jspx_th_t_005fdataList_005f1.doStartTag();
if (_jspx_eval_t_005fdataList_005f1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_t_005fdataList_005f1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_t_005fdataList_005f1.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_t_005fdataList_005f1.doInitBody();
}
do {
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fverbatim_005f9(_jspx_th_t_005fdataList_005f1, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_t_005foutputText_005f7(_jspx_th_t_005fdataList_005f1, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fverbatim_005f10(_jspx_th_t_005fdataList_005f1, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_t_005foutputText_005f8(_jspx_th_t_005fdataList_005f1, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fverbatim_005f11(_jspx_th_t_005fdataList_005f1, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_h_005foutputFormat_005f1(_jspx_th_t_005fdataList_005f1, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fverbatim_005f12(_jspx_th_t_005fdataList_005f1, _jspx_page_context))
return true;
out.write('\n');
out.write(' ');
out.write(' ');
int evalDoAfterBody = _jspx_th_t_005fdataList_005f1.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_t_005fdataList_005f1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_t_005fdataList_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ft_005fdataList_0026_005fvar_005fvalue_005frowIndexVar_005flayout_005fitemStyleClass_005fid.reuse(_jspx_th_t_005fdataList_005f1);
return true;
}
_005fjspx_005ftagPool_005ft_005fdataList_0026_005fvar_005fvalue_005frowIndexVar_005flayout_005fitemStyleClass_005fid.reuse(_jspx_th_t_005fdataList_005f1);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f9(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f9 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f9.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f9.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f1);
int _jspx_eval_f_005fverbatim_005f9 = _jspx_th_f_005fverbatim_005f9.doStartTag();
if (_jspx_eval_f_005fverbatim_005f9 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f9 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f9.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f9.doInitBody();
}
do {
out.write("\n");
out.write(" <div class=\"flc-reorderer-module layoutReorderer-module last-login\"\n");
out.write("\t\t\tid=\"");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f9.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f9 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f9.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f9);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f9);
return false;
}
private boolean _jspx_meth_t_005foutputText_005f7(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// t:outputText
org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag _jspx_th_t_005foutputText_005f7 = (org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag) _005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fnobody.get(org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag.class);
_jspx_th_t_005foutputText_005f7.setPageContext(_jspx_page_context);
_jspx_th_t_005foutputText_005f7.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f1);
// /prefs/tab.jsp(169,18) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f7.setValue("#{item.value}");
int _jspx_eval_t_005foutputText_005f7 = _jspx_th_t_005foutputText_005f7.doStartTag();
if (_jspx_th_t_005foutputText_005f7.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_t_005foutputText_005f7);
return true;
}
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_t_005foutputText_005f7);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f10(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f10 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f10.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f10.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f1);
int _jspx_eval_f_005fverbatim_005f10 = _jspx_th_f_005fverbatim_005f10.doStartTag();
if (_jspx_eval_f_005fverbatim_005f10 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f10 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f10.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f10.doInitBody();
}
do {
out.write("\">\n");
out.write(" <div class=\"demoSelector-layoutReorderer layoutReorderer-module-dragbar\">\n");
out.write("\t\t");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f10.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f10 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f10.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f10);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f10);
return false;
}
private boolean _jspx_meth_t_005foutputText_005f8(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// t:outputText
org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag _jspx_th_t_005foutputText_005f8 = (org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag) _005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005ftitle_005fstyleClass_005fnobody.get(org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag.class);
_jspx_th_t_005foutputText_005f8.setPageContext(_jspx_page_context);
_jspx_th_t_005foutputText_005f8.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f1);
// /prefs/tab.jsp(173,16) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f8.setValue("#{item.label}");
// /prefs/tab.jsp(173,16) name = styleClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f8.setStyleClass("siteLabel");
// /prefs/tab.jsp(173,16) name = title type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f8.setTitle("#{item.description}");
int _jspx_eval_t_005foutputText_005f8 = _jspx_th_t_005foutputText_005f8.doStartTag();
if (_jspx_th_t_005foutputText_005f8.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005ftitle_005fstyleClass_005fnobody.reuse(_jspx_th_t_005foutputText_005f8);
return true;
}
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005ftitle_005fstyleClass_005fnobody.reuse(_jspx_th_t_005foutputText_005f8);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f11(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f11 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f11.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f11.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f1);
int _jspx_eval_f_005fverbatim_005f11 = _jspx_th_f_005fverbatim_005f11.doStartTag();
if (_jspx_eval_f_005fverbatim_005f11 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f11 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f11.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f11.doInitBody();
}
do {
out.write("\n");
out.write(" <div class=\"checkBoxContainer\">\n");
out.write(" <input type=\"checkbox\" class=\"selectSiteCheck\" title=\"\n");
out.write(" ");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f11.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f11 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f11.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f11);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f11);
return false;
}
private boolean _jspx_meth_h_005foutputFormat_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputFormat
com.sun.faces.taglib.html_basic.OutputFormatTag _jspx_th_h_005foutputFormat_005f1 = (com.sun.faces.taglib.html_basic.OutputFormatTag) _005fjspx_005ftagPool_005fh_005foutputFormat_0026_005fvalue.get(com.sun.faces.taglib.html_basic.OutputFormatTag.class);
_jspx_th_h_005foutputFormat_005f1.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputFormat_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f1);
// /prefs/tab.jsp(178,16) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputFormat_005f1.setValue("#{msgs.prefs_checkbox_select_message}");
int _jspx_eval_h_005foutputFormat_005f1 = _jspx_th_h_005foutputFormat_005f1.doStartTag();
if (_jspx_eval_h_005foutputFormat_005f1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fparam_005f2(_jspx_th_h_005foutputFormat_005f1, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fparam_005f3(_jspx_th_h_005foutputFormat_005f1, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
}
if (_jspx_th_h_005foutputFormat_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputFormat_0026_005fvalue.reuse(_jspx_th_h_005foutputFormat_005f1);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputFormat_0026_005fvalue.reuse(_jspx_th_h_005foutputFormat_005f1);
return false;
}
private boolean _jspx_meth_f_005fparam_005f2(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005foutputFormat_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:param
com.sun.faces.taglib.jsf_core.ParameterTag _jspx_th_f_005fparam_005f2 = (com.sun.faces.taglib.jsf_core.ParameterTag) _005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody.get(com.sun.faces.taglib.jsf_core.ParameterTag.class);
_jspx_th_f_005fparam_005f2.setPageContext(_jspx_page_context);
_jspx_th_f_005fparam_005f2.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005foutputFormat_005f1);
// /prefs/tab.jsp(179,20) name = value type = java.lang.String reqTime = false required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_f_005fparam_005f2.setValue("#{item.label}");
int _jspx_eval_f_005fparam_005f2 = _jspx_th_f_005fparam_005f2.doStartTag();
if (_jspx_th_f_005fparam_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody.reuse(_jspx_th_f_005fparam_005f2);
return true;
}
_005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody.reuse(_jspx_th_f_005fparam_005f2);
return false;
}
private boolean _jspx_meth_f_005fparam_005f3(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005foutputFormat_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:param
com.sun.faces.taglib.jsf_core.ParameterTag _jspx_th_f_005fparam_005f3 = (com.sun.faces.taglib.jsf_core.ParameterTag) _005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody.get(com.sun.faces.taglib.jsf_core.ParameterTag.class);
_jspx_th_f_005fparam_005f3.setPageContext(_jspx_page_context);
_jspx_th_f_005fparam_005f3.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005foutputFormat_005f1);
// /prefs/tab.jsp(180,20) name = value type = java.lang.String reqTime = false required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_f_005fparam_005f3.setValue("#{msgs.prefs_active_sites_short}");
int _jspx_eval_f_005fparam_005f3 = _jspx_th_f_005fparam_005f3.doStartTag();
if (_jspx_th_f_005fparam_005f3.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody.reuse(_jspx_th_f_005fparam_005f3);
return true;
}
_005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody.reuse(_jspx_th_f_005fparam_005f3);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f12(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f12 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f12.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f12.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f1);
int _jspx_eval_f_005fverbatim_005f12 = _jspx_th_f_005fverbatim_005f12.doStartTag();
if (_jspx_eval_f_005fverbatim_005f12 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f12 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f12.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f12.doInitBody();
}
do {
out.write("\"/></div></div></div>");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f12.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f12 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f12.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f12);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f12);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f13(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f13 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f13.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f13.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
int _jspx_eval_f_005fverbatim_005f13 = _jspx_th_f_005fverbatim_005f13.doStartTag();
if (_jspx_eval_f_005fverbatim_005f13 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f13 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f13.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f13.doInitBody();
}
do {
out.write("</div>");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f13.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f13 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f13.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f13);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f13);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f14(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f14 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f14.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f14.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
int _jspx_eval_f_005fverbatim_005f14 = _jspx_th_f_005fverbatim_005f14.doStartTag();
if (_jspx_eval_f_005fverbatim_005f14 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f14 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f14.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f14.doInitBody();
}
do {
out.write("\n");
out.write("\t\t\t<!-- Column #3 -->\n");
out.write(" <div class=\"flc-reorderer-column fl-container-flex25 fl-force-left col3\" id=\"reorderCol3\">\n");
out.write(" <div class=\"colTitle layoutReorderer-locked\"><h4>");
if (_jspx_meth_h_005foutputText_005f18(_jspx_th_f_005fverbatim_005f14, _jspx_page_context))
return true;
out.write("</h4></div>\n");
out.write("\t\t");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f14.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f14 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f14.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f14);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f14);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f18(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f14, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f18 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f18.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f18.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f14);
// /prefs/tab.jsp(189,77) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f18.setValue("#{msgs.prefs_archive_sites}");
int _jspx_eval_h_005foutputText_005f18 = _jspx_th_h_005foutputText_005f18.doStartTag();
if (_jspx_th_h_005foutputText_005f18.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f18);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f18);
return false;
}
private boolean _jspx_meth_t_005fdataList_005f2(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// t:dataList
org.apache.myfaces.custom.datalist.HtmlDataListTag _jspx_th_t_005fdataList_005f2 = (org.apache.myfaces.custom.datalist.HtmlDataListTag) _005fjspx_005ftagPool_005ft_005fdataList_0026_005fvar_005fvalue_005frowIndexVar_005flayout_005fitemStyleClass_005fid.get(org.apache.myfaces.custom.datalist.HtmlDataListTag.class);
_jspx_th_t_005fdataList_005f2.setPageContext(_jspx_page_context);
_jspx_th_t_005fdataList_005f2.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
// /prefs/tab.jsp(191,2) name = id type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005fdataList_005f2.setId("dt3");
// /prefs/tab.jsp(191,2) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005fdataList_005f2.setValue("#{UserPrefsTool.prefHiddenItems}");
// /prefs/tab.jsp(191,2) name = var type = java.lang.String reqTime = false required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005fdataList_005f2.setVar("item");
// /prefs/tab.jsp(191,2) name = layout type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005fdataList_005f2.setLayout("simple");
// /prefs/tab.jsp(191,2) name = rowIndexVar type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005fdataList_005f2.setRowIndexVar("counter");
// /prefs/tab.jsp(191,2) name = itemStyleClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005fdataList_005f2.setItemStyleClass("dataListStyle");
int _jspx_eval_t_005fdataList_005f2 = _jspx_th_t_005fdataList_005f2.doStartTag();
if (_jspx_eval_t_005fdataList_005f2 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_t_005fdataList_005f2 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_t_005fdataList_005f2.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_t_005fdataList_005f2.doInitBody();
}
do {
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fverbatim_005f15(_jspx_th_t_005fdataList_005f2, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_t_005foutputText_005f9(_jspx_th_t_005fdataList_005f2, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fverbatim_005f16(_jspx_th_t_005fdataList_005f2, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_t_005foutputText_005f10(_jspx_th_t_005fdataList_005f2, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fverbatim_005f17(_jspx_th_t_005fdataList_005f2, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_h_005foutputFormat_005f2(_jspx_th_t_005fdataList_005f2, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fverbatim_005f18(_jspx_th_t_005fdataList_005f2, _jspx_page_context))
return true;
out.write("\n");
out.write("\n");
out.write("\t\t");
int evalDoAfterBody = _jspx_th_t_005fdataList_005f2.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_t_005fdataList_005f2 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_t_005fdataList_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ft_005fdataList_0026_005fvar_005fvalue_005frowIndexVar_005flayout_005fitemStyleClass_005fid.reuse(_jspx_th_t_005fdataList_005f2);
return true;
}
_005fjspx_005ftagPool_005ft_005fdataList_0026_005fvar_005fvalue_005frowIndexVar_005flayout_005fitemStyleClass_005fid.reuse(_jspx_th_t_005fdataList_005f2);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f15(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f2, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f15 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f15.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f15.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f2);
int _jspx_eval_f_005fverbatim_005f15 = _jspx_th_f_005fverbatim_005f15.doStartTag();
if (_jspx_eval_f_005fverbatim_005f15 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f15 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f15.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f15.doInitBody();
}
do {
out.write("\n");
out.write(" <div class=\"flc-reorderer-module layoutReorderer-module last-login\"\n");
out.write("\t\t\tid=\"");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f15.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f15 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f15.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f15);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f15);
return false;
}
private boolean _jspx_meth_t_005foutputText_005f9(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f2, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// t:outputText
org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag _jspx_th_t_005foutputText_005f9 = (org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag) _005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fnobody.get(org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag.class);
_jspx_th_t_005foutputText_005f9.setPageContext(_jspx_page_context);
_jspx_th_t_005foutputText_005f9.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f2);
// /prefs/tab.jsp(198,18) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f9.setValue("#{item.value}");
int _jspx_eval_t_005foutputText_005f9 = _jspx_th_t_005foutputText_005f9.doStartTag();
if (_jspx_th_t_005foutputText_005f9.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_t_005foutputText_005f9);
return true;
}
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_t_005foutputText_005f9);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f16(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f2, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f16 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f16.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f16.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f2);
int _jspx_eval_f_005fverbatim_005f16 = _jspx_th_f_005fverbatim_005f16.doStartTag();
if (_jspx_eval_f_005fverbatim_005f16 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f16 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f16.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f16.doInitBody();
}
do {
out.write("\">\n");
out.write(" <div class=\"demoSelector-layoutReorderer layoutReorderer-module-dragbar\">\n");
out.write("\t\t");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f16.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f16 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f16.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f16);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f16);
return false;
}
private boolean _jspx_meth_t_005foutputText_005f10(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f2, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// t:outputText
org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag _jspx_th_t_005foutputText_005f10 = (org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag) _005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005ftitle_005fstyleClass_005fnobody.get(org.apache.myfaces.generated.taglib.html.ext.HtmlOutputTextTag.class);
_jspx_th_t_005foutputText_005f10.setPageContext(_jspx_page_context);
_jspx_th_t_005foutputText_005f10.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f2);
// /prefs/tab.jsp(202,16) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f10.setValue("#{item.label}");
// /prefs/tab.jsp(202,16) name = styleClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f10.setStyleClass("siteLabel");
// /prefs/tab.jsp(202,16) name = title type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_t_005foutputText_005f10.setTitle("#{item.description}");
int _jspx_eval_t_005foutputText_005f10 = _jspx_th_t_005foutputText_005f10.doStartTag();
if (_jspx_th_t_005foutputText_005f10.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005ftitle_005fstyleClass_005fnobody.reuse(_jspx_th_t_005foutputText_005f10);
return true;
}
_005fjspx_005ftagPool_005ft_005foutputText_0026_005fvalue_005ftitle_005fstyleClass_005fnobody.reuse(_jspx_th_t_005foutputText_005f10);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f17(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f2, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f17 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f17.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f17.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f2);
int _jspx_eval_f_005fverbatim_005f17 = _jspx_th_f_005fverbatim_005f17.doStartTag();
if (_jspx_eval_f_005fverbatim_005f17 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f17 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f17.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f17.doInitBody();
}
do {
out.write("\n");
out.write(" <div class=\"checkBoxContainer\">\n");
out.write(" <input type=\"checkbox\" class=\"selectSiteCheck\" title=\"\n");
out.write(" ");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f17.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f17 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f17.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f17);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f17);
return false;
}
private boolean _jspx_meth_h_005foutputFormat_005f2(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f2, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputFormat
com.sun.faces.taglib.html_basic.OutputFormatTag _jspx_th_h_005foutputFormat_005f2 = (com.sun.faces.taglib.html_basic.OutputFormatTag) _005fjspx_005ftagPool_005fh_005foutputFormat_0026_005fvalue.get(com.sun.faces.taglib.html_basic.OutputFormatTag.class);
_jspx_th_h_005foutputFormat_005f2.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputFormat_005f2.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f2);
// /prefs/tab.jsp(207,16) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputFormat_005f2.setValue("#{msgs.prefs_checkbox_select_message}");
int _jspx_eval_h_005foutputFormat_005f2 = _jspx_th_h_005foutputFormat_005f2.doStartTag();
if (_jspx_eval_h_005foutputFormat_005f2 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fparam_005f4(_jspx_th_h_005foutputFormat_005f2, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fparam_005f5(_jspx_th_h_005foutputFormat_005f2, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
}
if (_jspx_th_h_005foutputFormat_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputFormat_0026_005fvalue.reuse(_jspx_th_h_005foutputFormat_005f2);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputFormat_0026_005fvalue.reuse(_jspx_th_h_005foutputFormat_005f2);
return false;
}
private boolean _jspx_meth_f_005fparam_005f4(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005foutputFormat_005f2, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:param
com.sun.faces.taglib.jsf_core.ParameterTag _jspx_th_f_005fparam_005f4 = (com.sun.faces.taglib.jsf_core.ParameterTag) _005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody.get(com.sun.faces.taglib.jsf_core.ParameterTag.class);
_jspx_th_f_005fparam_005f4.setPageContext(_jspx_page_context);
_jspx_th_f_005fparam_005f4.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005foutputFormat_005f2);
// /prefs/tab.jsp(208,20) name = value type = java.lang.String reqTime = false required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_f_005fparam_005f4.setValue("#{item.label}");
int _jspx_eval_f_005fparam_005f4 = _jspx_th_f_005fparam_005f4.doStartTag();
if (_jspx_th_f_005fparam_005f4.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody.reuse(_jspx_th_f_005fparam_005f4);
return true;
}
_005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody.reuse(_jspx_th_f_005fparam_005f4);
return false;
}
private boolean _jspx_meth_f_005fparam_005f5(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005foutputFormat_005f2, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:param
com.sun.faces.taglib.jsf_core.ParameterTag _jspx_th_f_005fparam_005f5 = (com.sun.faces.taglib.jsf_core.ParameterTag) _005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody.get(com.sun.faces.taglib.jsf_core.ParameterTag.class);
_jspx_th_f_005fparam_005f5.setPageContext(_jspx_page_context);
_jspx_th_f_005fparam_005f5.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005foutputFormat_005f2);
// /prefs/tab.jsp(209,20) name = value type = java.lang.String reqTime = false required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_f_005fparam_005f5.setValue("#{msgs.prefs_archive_sites_short}");
int _jspx_eval_f_005fparam_005f5 = _jspx_th_f_005fparam_005f5.doStartTag();
if (_jspx_th_f_005fparam_005f5.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody.reuse(_jspx_th_f_005fparam_005f5);
return true;
}
_005fjspx_005ftagPool_005ff_005fparam_0026_005fvalue_005fnobody.reuse(_jspx_th_f_005fparam_005f5);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f18(javax.servlet.jsp.tagext.JspTag _jspx_th_t_005fdataList_005f2, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f18 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f18.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f18.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_t_005fdataList_005f2);
int _jspx_eval_f_005fverbatim_005f18 = _jspx_th_f_005fverbatim_005f18.doStartTag();
if (_jspx_eval_f_005fverbatim_005f18 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f18 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f18.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f18.doInitBody();
}
do {
out.write("\"/></div></div></div>");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f18.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f18 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f18.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f18);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f18);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f19(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f19 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f19.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f19.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
int _jspx_eval_f_005fverbatim_005f19 = _jspx_th_f_005fverbatim_005f19.doStartTag();
if (_jspx_eval_f_005fverbatim_005f19 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f19 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f19.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f19.doInitBody();
}
do {
out.write("</div>");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f19.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f19 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f19.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f19);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f19);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f20(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f20 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f20.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f20.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
int _jspx_eval_f_005fverbatim_005f20 = _jspx_th_f_005fverbatim_005f20.doStartTag();
if (_jspx_eval_f_005fverbatim_005f20 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f20 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f20.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f20.doInitBody();
}
do {
out.write("</div></div>\n");
out.write("<div style=\"float:none;clear:both;margin:2em 0\">\n");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f20.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f20 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f20.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f20);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f20);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f21(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f21 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f21.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f21.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
int _jspx_eval_f_005fverbatim_005f21 = _jspx_th_f_005fverbatim_005f21.doStartTag();
if (_jspx_eval_f_005fverbatim_005f21 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f21 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f21.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f21.doInitBody();
}
do {
out.write("\n");
out.write("<div id=\"top-text\">\n");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f21.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f21 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f21.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f21);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f21);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f19(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f19 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005frendered_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f19.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f19.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
// /prefs/tab.jsp(223,0) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f19.setValue("#{msgs.tabDisplay_prompt}");
// /prefs/tab.jsp(223,0) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f19.setRendered("#{UserPrefsTool.prefShowTabLabelOption==true}");
int _jspx_eval_h_005foutputText_005f19 = _jspx_th_h_005foutputText_005f19.doStartTag();
if (_jspx_th_h_005foutputText_005f19.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005frendered_005fnobody.reuse(_jspx_th_h_005foutputText_005f19);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005frendered_005fnobody.reuse(_jspx_th_h_005foutputText_005f19);
return false;
}
private boolean _jspx_meth_h_005fselectOneRadio_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:selectOneRadio
com.sun.faces.taglib.html_basic.SelectOneRadioTag _jspx_th_h_005fselectOneRadio_005f0 = (com.sun.faces.taglib.html_basic.SelectOneRadioTag) _005fjspx_005ftagPool_005fh_005fselectOneRadio_0026_005fvalue_005frendered_005flayout.get(com.sun.faces.taglib.html_basic.SelectOneRadioTag.class);
_jspx_th_h_005fselectOneRadio_005f0.setPageContext(_jspx_page_context);
_jspx_th_h_005fselectOneRadio_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
// /prefs/tab.jsp(224,0) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fselectOneRadio_005f0.setValue("#{UserPrefsTool.selectedTabLabel}");
// /prefs/tab.jsp(224,0) name = layout type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fselectOneRadio_005f0.setLayout("pageDirection");
// /prefs/tab.jsp(224,0) name = rendered type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fselectOneRadio_005f0.setRendered("#{UserPrefsTool.prefShowTabLabelOption==true}");
int _jspx_eval_h_005fselectOneRadio_005f0 = _jspx_th_h_005fselectOneRadio_005f0.doStartTag();
if (_jspx_eval_h_005fselectOneRadio_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fselectItem_005f0(_jspx_th_h_005fselectOneRadio_005f0, _jspx_page_context))
return true;
out.write("\n");
out.write(" ");
if (_jspx_meth_f_005fselectItem_005f1(_jspx_th_h_005fselectOneRadio_005f0, _jspx_page_context))
return true;
out.write('\n');
}
if (_jspx_th_h_005fselectOneRadio_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005fselectOneRadio_0026_005fvalue_005frendered_005flayout.reuse(_jspx_th_h_005fselectOneRadio_005f0);
return true;
}
_005fjspx_005ftagPool_005fh_005fselectOneRadio_0026_005fvalue_005frendered_005flayout.reuse(_jspx_th_h_005fselectOneRadio_005f0);
return false;
}
private boolean _jspx_meth_f_005fselectItem_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fselectOneRadio_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:selectItem
com.sun.faces.taglib.jsf_core.SelectItemTag _jspx_th_f_005fselectItem_005f0 = (com.sun.faces.taglib.jsf_core.SelectItemTag) _005fjspx_005ftagPool_005ff_005fselectItem_0026_005fitemValue_005fitemLabel_005fnobody.get(com.sun.faces.taglib.jsf_core.SelectItemTag.class);
_jspx_th_f_005fselectItem_005f0.setPageContext(_jspx_page_context);
_jspx_th_f_005fselectItem_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fselectOneRadio_005f0);
// /prefs/tab.jsp(225,24) name = itemValue type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_f_005fselectItem_005f0.setItemValue("1");
// /prefs/tab.jsp(225,24) name = itemLabel type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_f_005fselectItem_005f0.setItemLabel("#{msgs.tabDisplay_coursecode}");
int _jspx_eval_f_005fselectItem_005f0 = _jspx_th_f_005fselectItem_005f0.doStartTag();
if (_jspx_th_f_005fselectItem_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fselectItem_0026_005fitemValue_005fitemLabel_005fnobody.reuse(_jspx_th_f_005fselectItem_005f0);
return true;
}
_005fjspx_005ftagPool_005ff_005fselectItem_0026_005fitemValue_005fitemLabel_005fnobody.reuse(_jspx_th_f_005fselectItem_005f0);
return false;
}
private boolean _jspx_meth_f_005fselectItem_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fselectOneRadio_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:selectItem
com.sun.faces.taglib.jsf_core.SelectItemTag _jspx_th_f_005fselectItem_005f1 = (com.sun.faces.taglib.jsf_core.SelectItemTag) _005fjspx_005ftagPool_005ff_005fselectItem_0026_005fitemValue_005fitemLabel_005fnobody.get(com.sun.faces.taglib.jsf_core.SelectItemTag.class);
_jspx_th_f_005fselectItem_005f1.setPageContext(_jspx_page_context);
_jspx_th_f_005fselectItem_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fselectOneRadio_005f0);
// /prefs/tab.jsp(226,24) name = itemValue type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_f_005fselectItem_005f1.setItemValue("2");
// /prefs/tab.jsp(226,24) name = itemLabel type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_f_005fselectItem_005f1.setItemLabel("#{msgs.tabDisplay_coursename}");
int _jspx_eval_f_005fselectItem_005f1 = _jspx_th_f_005fselectItem_005f1.doStartTag();
if (_jspx_th_f_005fselectItem_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fselectItem_0026_005fitemValue_005fitemLabel_005fnobody.reuse(_jspx_th_f_005fselectItem_005f1);
return true;
}
_005fjspx_005ftagPool_005ff_005fselectItem_0026_005fitemValue_005fitemLabel_005fnobody.reuse(_jspx_th_f_005fselectItem_005f1);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f22(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f22 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f22.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f22.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
int _jspx_eval_f_005fverbatim_005f22 = _jspx_th_f_005fverbatim_005f22.doStartTag();
if (_jspx_eval_f_005fverbatim_005f22 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f22 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f22.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f22.doInitBody();
}
do {
out.write("\n");
out.write("</div>\n");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f22.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f22 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f22.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f22);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f22);
return false;
}
private boolean _jspx_meth_h_005fcommandButton_005f2(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:commandButton
com.sun.faces.taglib.html_basic.CommandButtonTag _jspx_th_h_005fcommandButton_005f2 = (com.sun.faces.taglib.html_basic.CommandButtonTag) _005fjspx_005ftagPool_005fh_005fcommandButton_0026_005fvalue_005fstyleClass_005fid_005faction_005faccesskey_005fnobody.get(com.sun.faces.taglib.html_basic.CommandButtonTag.class);
_jspx_th_h_005fcommandButton_005f2.setPageContext(_jspx_page_context);
_jspx_th_h_005fcommandButton_005f2.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
// /prefs/tab.jsp(233,3) name = accesskey type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fcommandButton_005f2.setAccesskey("s");
// /prefs/tab.jsp(233,3) name = id type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fcommandButton_005f2.setId("prefAllSub");
// /prefs/tab.jsp(233,3) name = styleClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fcommandButton_005f2.setStyleClass("active formButton");
// /prefs/tab.jsp(233,3) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fcommandButton_005f2.setValue("#{msgs.update_pref}");
// /prefs/tab.jsp(233,3) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fcommandButton_005f2.setAction("#{UserPrefsTool.processActionSaveOrder}");
int _jspx_eval_h_005fcommandButton_005f2 = _jspx_th_h_005fcommandButton_005f2.doStartTag();
if (_jspx_th_h_005fcommandButton_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005fcommandButton_0026_005fvalue_005fstyleClass_005fid_005faction_005faccesskey_005fnobody.reuse(_jspx_th_h_005fcommandButton_005f2);
return true;
}
_005fjspx_005ftagPool_005fh_005fcommandButton_0026_005fvalue_005fstyleClass_005fid_005faction_005faccesskey_005fnobody.reuse(_jspx_th_h_005fcommandButton_005f2);
return false;
}
private boolean _jspx_meth_h_005fcommandButton_005f3(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:commandButton
com.sun.faces.taglib.html_basic.CommandButtonTag _jspx_th_h_005fcommandButton_005f3 = (com.sun.faces.taglib.html_basic.CommandButtonTag) _005fjspx_005ftagPool_005fh_005fcommandButton_0026_005fvalue_005fstyleClass_005fid_005faction_005faccesskey_005fnobody.get(com.sun.faces.taglib.html_basic.CommandButtonTag.class);
_jspx_th_h_005fcommandButton_005f3.setPageContext(_jspx_page_context);
_jspx_th_h_005fcommandButton_005f3.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
// /prefs/tab.jsp(234,3) name = accesskey type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fcommandButton_005f3.setAccesskey("x");
// /prefs/tab.jsp(234,3) name = id type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fcommandButton_005f3.setId("cancel");
// /prefs/tab.jsp(234,3) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fcommandButton_005f3.setValue("#{msgs.cancel_pref}");
// /prefs/tab.jsp(234,3) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fcommandButton_005f3.setAction("#{UserPrefsTool.processActionCancel}");
// /prefs/tab.jsp(234,3) name = styleClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005fcommandButton_005f3.setStyleClass("formButton");
int _jspx_eval_h_005fcommandButton_005f3 = _jspx_th_h_005fcommandButton_005f3.doStartTag();
if (_jspx_th_h_005fcommandButton_005f3.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005fcommandButton_0026_005fvalue_005fstyleClass_005fid_005faction_005faccesskey_005fnobody.reuse(_jspx_th_h_005fcommandButton_005f3);
return true;
}
_005fjspx_005ftagPool_005fh_005fcommandButton_0026_005fvalue_005fstyleClass_005fid_005faction_005faccesskey_005fnobody.reuse(_jspx_th_h_005fcommandButton_005f3);
return false;
}
private boolean _jspx_meth_h_005finputHidden_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:inputHidden
com.sun.faces.taglib.html_basic.InputHiddenTag _jspx_th_h_005finputHidden_005f0 = (com.sun.faces.taglib.html_basic.InputHiddenTag) _005fjspx_005ftagPool_005fh_005finputHidden_0026_005fvalue_005fid_005fnobody.get(com.sun.faces.taglib.html_basic.InputHiddenTag.class);
_jspx_th_h_005finputHidden_005f0.setPageContext(_jspx_page_context);
_jspx_th_h_005finputHidden_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
// /prefs/tab.jsp(235,2) name = id type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005finputHidden_005f0.setId("prefTabString");
// /prefs/tab.jsp(235,2) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005finputHidden_005f0.setValue("#{UserPrefsTool.prefTabString}");
int _jspx_eval_h_005finputHidden_005f0 = _jspx_th_h_005finputHidden_005f0.doStartTag();
if (_jspx_th_h_005finputHidden_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005finputHidden_0026_005fvalue_005fid_005fnobody.reuse(_jspx_th_h_005finputHidden_005f0);
return true;
}
_005fjspx_005ftagPool_005fh_005finputHidden_0026_005fvalue_005fid_005fnobody.reuse(_jspx_th_h_005finputHidden_005f0);
return false;
}
private boolean _jspx_meth_h_005finputHidden_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:inputHidden
com.sun.faces.taglib.html_basic.InputHiddenTag _jspx_th_h_005finputHidden_005f1 = (com.sun.faces.taglib.html_basic.InputHiddenTag) _005fjspx_005ftagPool_005fh_005finputHidden_0026_005fvalue_005fid_005fnobody.get(com.sun.faces.taglib.html_basic.InputHiddenTag.class);
_jspx_th_h_005finputHidden_005f1.setPageContext(_jspx_page_context);
_jspx_th_h_005finputHidden_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
// /prefs/tab.jsp(236,2) name = id type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005finputHidden_005f1.setId("prefDrawerString");
// /prefs/tab.jsp(236,2) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005finputHidden_005f1.setValue("#{UserPrefsTool.prefDrawerString}");
int _jspx_eval_h_005finputHidden_005f1 = _jspx_th_h_005finputHidden_005f1.doStartTag();
if (_jspx_th_h_005finputHidden_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005finputHidden_0026_005fvalue_005fid_005fnobody.reuse(_jspx_th_h_005finputHidden_005f1);
return true;
}
_005fjspx_005ftagPool_005fh_005finputHidden_0026_005fvalue_005fid_005fnobody.reuse(_jspx_th_h_005finputHidden_005f1);
return false;
}
private boolean _jspx_meth_h_005finputHidden_005f2(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:inputHidden
com.sun.faces.taglib.html_basic.InputHiddenTag _jspx_th_h_005finputHidden_005f2 = (com.sun.faces.taglib.html_basic.InputHiddenTag) _005fjspx_005ftagPool_005fh_005finputHidden_0026_005fvalue_005fid_005fnobody.get(com.sun.faces.taglib.html_basic.InputHiddenTag.class);
_jspx_th_h_005finputHidden_005f2.setPageContext(_jspx_page_context);
_jspx_th_h_005finputHidden_005f2.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
// /prefs/tab.jsp(237,2) name = id type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005finputHidden_005f2.setId("prefHiddenString");
// /prefs/tab.jsp(237,2) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005finputHidden_005f2.setValue("#{UserPrefsTool.prefHiddenString}");
int _jspx_eval_h_005finputHidden_005f2 = _jspx_th_h_005finputHidden_005f2.doStartTag();
if (_jspx_th_h_005finputHidden_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005finputHidden_0026_005fvalue_005fid_005fnobody.reuse(_jspx_th_h_005finputHidden_005f2);
return true;
}
_005fjspx_005ftagPool_005fh_005finputHidden_0026_005fvalue_005fid_005fnobody.reuse(_jspx_th_h_005finputHidden_005f2);
return false;
}
private boolean _jspx_meth_h_005finputHidden_005f3(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:inputHidden
com.sun.faces.taglib.html_basic.InputHiddenTag _jspx_th_h_005finputHidden_005f3 = (com.sun.faces.taglib.html_basic.InputHiddenTag) _005fjspx_005ftagPool_005fh_005finputHidden_0026_005fvalue_005fid_005fnobody.get(com.sun.faces.taglib.html_basic.InputHiddenTag.class);
_jspx_th_h_005finputHidden_005f3.setPageContext(_jspx_page_context);
_jspx_th_h_005finputHidden_005f3.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
// /prefs/tab.jsp(238,2) name = id type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005finputHidden_005f3.setId("reloadTop");
// /prefs/tab.jsp(238,2) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005finputHidden_005f3.setValue("#{UserPrefsTool.reloadTop}");
int _jspx_eval_h_005finputHidden_005f3 = _jspx_th_h_005finputHidden_005f3.doStartTag();
if (_jspx_th_h_005finputHidden_005f3.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005finputHidden_0026_005fvalue_005fid_005fnobody.reuse(_jspx_th_h_005finputHidden_005f3);
return true;
}
_005fjspx_005ftagPool_005fh_005finputHidden_0026_005fvalue_005fid_005fnobody.reuse(_jspx_th_h_005finputHidden_005f3);
return false;
}
private boolean _jspx_meth_f_005fverbatim_005f23(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// f:verbatim
com.sun.faces.taglib.jsf_core.VerbatimTag _jspx_th_f_005fverbatim_005f23 = (com.sun.faces.taglib.jsf_core.VerbatimTag) _005fjspx_005ftagPool_005ff_005fverbatim.get(com.sun.faces.taglib.jsf_core.VerbatimTag.class);
_jspx_th_f_005fverbatim_005f23.setPageContext(_jspx_page_context);
_jspx_th_f_005fverbatim_005f23.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
int _jspx_eval_f_005fverbatim_005f23 = _jspx_th_f_005fverbatim_005f23.doStartTag();
if (_jspx_eval_f_005fverbatim_005f23 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_f_005fverbatim_005f23 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_f_005fverbatim_005f23.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_f_005fverbatim_005f23.doInitBody();
}
do {
out.write("\n");
out.write("<p>\n");
if (_jspx_meth_h_005foutputText_005f20(_jspx_th_f_005fverbatim_005f23, _jspx_page_context))
return true;
out.write("\n");
out.write("</p>\n");
out.write("</div>\n");
out.write("<script type=\"text/javascript\">\n");
out.write(" initlayoutReorderer();\n");
out.write("</script>\n");
out.write("\n");
int evalDoAfterBody = _jspx_th_f_005fverbatim_005f23.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_f_005fverbatim_005f23 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_f_005fverbatim_005f23.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f23);
return true;
}
_005fjspx_005ftagPool_005ff_005fverbatim.reuse(_jspx_th_f_005fverbatim_005f23);
return false;
}
private boolean _jspx_meth_h_005foutputText_005f20(javax.servlet.jsp.tagext.JspTag _jspx_th_f_005fverbatim_005f23, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// h:outputText
com.sun.faces.taglib.html_basic.OutputTextTag _jspx_th_h_005foutputText_005f20 = (com.sun.faces.taglib.html_basic.OutputTextTag) _005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.get(com.sun.faces.taglib.html_basic.OutputTextTag.class);
_jspx_th_h_005foutputText_005f20.setPageContext(_jspx_page_context);
_jspx_th_h_005foutputText_005f20.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fverbatim_005f23);
// /prefs/tab.jsp(241,0) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_h_005foutputText_005f20.setValue("#{msgs.prefs_auto_refresh}");
int _jspx_eval_h_005foutputText_005f20 = _jspx_th_h_005foutputText_005f20.doStartTag();
if (_jspx_th_h_005foutputText_005f20.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f20);
return true;
}
_005fjspx_005ftagPool_005fh_005foutputText_0026_005fvalue_005fnobody.reuse(_jspx_th_h_005foutputText_005f20);
return false;
}
}
| freedomkk-qfeng/docker-sakai | demo/10.2-fudan/sakai-demo-10.2/work/Catalina/localhost/sakai-user-tool-prefs/org/apache/jsp/prefs/tab_jsp.java | Java | apache-2.0 | 292,251 |
# Aeodes lanceolata var. lanceolata VARIETY
#### Status
ACCEPTED
#### According to
NUB Generator [autonym]
#### Published in
null
#### Original name
null
### Remarks
null | mdoering/backbone | life/Plantae/Rhodophyta/Florideophyceae/Halymeniales/Halymeniaceae/Aeodes/Aeodes lanceolata/Aeodes lanceolata lanceolata/README.md | Markdown | apache-2.0 | 175 |
<!-- Intro Header -->
<header class="intro">
<div class="intro-body">
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<h1 class="brand-heading">Crowdlift</h1>
<p class="intro-text">Growth hacking for kickass, crowdfunding products. Kickstarter, IndieGoGo, and self-hosted.</p>
<a href="#about" class="btn btn-circle page-scroll">
<i class="fa fa-angle-double-down animated"></i>
</a>
</div>
</div>
</div>
</div>
</header>
| crowdlift/crowdlift.github.io | _includes/header.html | HTML | apache-2.0 | 703 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_151) on Thu Feb 08 09:04:08 MST 2018 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Class org.wildfly.swarm.transactions.TransactionsFraction (BOM: * : All 2018.2.0 API)</title>
<meta name="date" content="2018-02-08">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class org.wildfly.swarm.transactions.TransactionsFraction (BOM: * : All 2018.2.0 API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../org/wildfly/swarm/transactions/TransactionsFraction.html" title="class in org.wildfly.swarm.transactions">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../../../../../overview-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">WildFly Swarm API, 2018.2.0</div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/wildfly/swarm/transactions/class-use/TransactionsFraction.html" target="_top">Frames</a></li>
<li><a href="TransactionsFraction.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class org.wildfly.swarm.transactions.TransactionsFraction" class="title">Uses of Class<br>org.wildfly.swarm.transactions.TransactionsFraction</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../../../org/wildfly/swarm/transactions/TransactionsFraction.html" title="class in org.wildfly.swarm.transactions">TransactionsFraction</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="#org.wildfly.swarm.transactions">org.wildfly.swarm.transactions</a></td>
<td class="colLast"> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="org.wildfly.swarm.transactions">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../org/wildfly/swarm/transactions/TransactionsFraction.html" title="class in org.wildfly.swarm.transactions">TransactionsFraction</a> in <a href="../../../../../org/wildfly/swarm/transactions/package-summary.html">org.wildfly.swarm.transactions</a></h3>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../org/wildfly/swarm/transactions/package-summary.html">org.wildfly.swarm.transactions</a> that return <a href="../../../../../org/wildfly/swarm/transactions/TransactionsFraction.html" title="class in org.wildfly.swarm.transactions">TransactionsFraction</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../org/wildfly/swarm/transactions/TransactionsFraction.html" title="class in org.wildfly.swarm.transactions">TransactionsFraction</a></code></td>
<td class="colLast"><span class="typeNameLabel">TransactionsFraction.</span><code><span class="memberNameLink"><a href="../../../../../org/wildfly/swarm/transactions/TransactionsFraction.html#applyDefaults--">applyDefaults</a></span>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="../../../../../org/wildfly/swarm/transactions/TransactionsFraction.html" title="class in org.wildfly.swarm.transactions">TransactionsFraction</a></code></td>
<td class="colLast"><span class="typeNameLabel">TransactionsFraction.</span><code><span class="memberNameLink"><a href="../../../../../org/wildfly/swarm/transactions/TransactionsFraction.html#createDefaultFraction--">createDefaultFraction</a></span>()</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../org/wildfly/swarm/transactions/TransactionsFraction.html" title="class in org.wildfly.swarm.transactions">TransactionsFraction</a></code></td>
<td class="colLast"><span class="typeNameLabel">TransactionsFraction.</span><code><span class="memberNameLink"><a href="../../../../../org/wildfly/swarm/transactions/TransactionsFraction.html#port-int-">port</a></span>(int port)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/wildfly/swarm/transactions/TransactionsFraction.html" title="class in org.wildfly.swarm.transactions">TransactionsFraction</a></code></td>
<td class="colLast"><span class="typeNameLabel">TransactionsFraction.</span><code><span class="memberNameLink"><a href="../../../../../org/wildfly/swarm/transactions/TransactionsFraction.html#statusPort-int-">statusPort</a></span>(int statusPort)</code> </td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../org/wildfly/swarm/transactions/TransactionsFraction.html" title="class in org.wildfly.swarm.transactions">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../../../../../overview-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">WildFly Swarm API, 2018.2.0</div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/wildfly/swarm/transactions/class-use/TransactionsFraction.html" target="_top">Frames</a></li>
<li><a href="TransactionsFraction.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2018 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p>
</body>
</html>
| wildfly-swarm/wildfly-swarm-javadocs | 2018.2.0/apidocs/org/wildfly/swarm/transactions/class-use/TransactionsFraction.html | HTML | apache-2.0 | 8,598 |
package com.hotcloud.util;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class CookieUtil {
public static Map<String, String> getCookies(HttpServletRequest request) {
Map<String, String> sCookie = new HashMap<>();
Cookie[] cookies = request.getCookies();
if (cookies != null) {
String cookiePre = ConfigUtil.config.get("cookiePre");
int prelength = Common.strlen(cookiePre);
for (Cookie cookie : cookies) {
String name = cookie.getName();
if (name != null && name.startsWith(cookiePre)) {
sCookie.put(name.substring(prelength), Common.urlDecode(Common.addSlashes(cookie.getValue())));
}
}
}
return sCookie;
}
public static Cookie getCookie(HttpServletRequest request, String name) {
Cookie[] cookies = request.getCookies();
if (cookies != null) {
for (Cookie cookie : cookies) {
if (name != null && cookie.getName().equals(name)) {
return cookie;
}
}
}
return null;
}
public static void removeCookie(HttpServletRequest request, HttpServletResponse response, String key) {
setCookie(request, response, key, "", 0);
}
public static void setCookie(HttpServletRequest request, HttpServletResponse response, String key, String value) {
setCookie(request, response, key, value, -1);/*-1表示关闭浏览器时立即清除cookie*/
}
/** 将cookie写入到response中 */
public static void setCookie(HttpServletRequest request, HttpServletResponse response, String key, String value,
int maxAge) {
Cookie cookie = new Cookie(ConfigUtil.config.get("cookiePre") + key, Common.urlEncode(value));
cookie.setMaxAge(maxAge);
cookie.setPath(ConfigUtil.config.get("cookiePath"));
if (!Common.empty(ConfigUtil.config.get("cookieDomain"))) {
cookie.setDomain(ConfigUtil.config.get("cookieDomain"));
}
cookie.setSecure(request.getServerPort() == 443 ? true : false);
response.addCookie(cookie);
}
@SuppressWarnings("unchecked")
public static void clearCookie(HttpServletRequest request, HttpServletResponse response) {
removeCookie(request, response, "auth");
Map<String, Object> sGlobal = (Map<String, Object>) request.getAttribute("sGlobal");
sGlobal.put("supe_uid", 0);
sGlobal.put("supe_username", "");
sGlobal.remove("member");
}
} | shizicheng/spring_mvc_template | src/main/java/com/hotcloud/util/CookieUtil.java | Java | apache-2.0 | 2,493 |
/********************************************************************************
* Copyright (c) 2019 Stephane Bastian
*
* This program and the accompanying materials are made available under the 2
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0 3
*
* Contributors: 4
* Stephane Bastian - initial API and implementation
********************************************************************************/
package io.vertx.ext.auth.authorization.impl;
import java.util.Objects;
import io.vertx.ext.auth.authorization.Authorization;
import io.vertx.ext.auth.authorization.AuthorizationContext;
import io.vertx.ext.auth.authorization.PermissionBasedAuthorization;
import io.vertx.ext.auth.User;
import io.vertx.ext.auth.authorization.WildcardPermissionBasedAuthorization;
public class PermissionBasedAuthorizationImpl implements PermissionBasedAuthorization {
private final String permission;
private VariableAwareExpression resource;
public PermissionBasedAuthorizationImpl(String permission) {
this.permission = Objects.requireNonNull(permission);
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!(obj instanceof PermissionBasedAuthorizationImpl))
return false;
PermissionBasedAuthorizationImpl other = (PermissionBasedAuthorizationImpl) obj;
return Objects.equals(permission, other.permission) && Objects.equals(resource, other.resource);
}
@Override
public String getPermission() {
return permission;
}
@Override
public int hashCode() {
return Objects.hash(permission, resource);
}
@Override
public boolean match(AuthorizationContext context) {
Objects.requireNonNull(context);
User user = context.user();
if (user != null) {
Authorization resolvedAuthorization = getResolvedAuthorization(context);
for (String providerId: user.authorizations().getProviderIds()) {
for (Authorization authorization : user.authorizations().get(providerId)) {
if (authorization.verify(resolvedAuthorization)) {
return true;
}
}
}
}
return false;
}
private PermissionBasedAuthorization getResolvedAuthorization(AuthorizationContext context) {
if (resource == null || !resource.hasVariable()) {
return this;
}
return PermissionBasedAuthorization.create(this.permission).setResource(resource.resolve(context));
}
@Override
public boolean verify(Authorization otherAuthorization) {
Objects.requireNonNull(otherAuthorization);
if (otherAuthorization instanceof PermissionBasedAuthorization) {
PermissionBasedAuthorization otherPermissionBasedAuthorization = (PermissionBasedAuthorization) otherAuthorization;
if (permission.equals(otherPermissionBasedAuthorization.getPermission())) {
if (getResource() == null) {
return otherPermissionBasedAuthorization.getResource() == null;
}
return getResource().equals(otherPermissionBasedAuthorization.getResource());
}
}
else if (otherAuthorization instanceof WildcardPermissionBasedAuthorization) {
WildcardPermissionBasedAuthorization otherWildcardPermissionBasedAuthorization = (WildcardPermissionBasedAuthorization) otherAuthorization;
if (permission.equals(otherWildcardPermissionBasedAuthorization.getPermission())) {
if (getResource() == null) {
return otherWildcardPermissionBasedAuthorization.getResource() == null;
}
return getResource().equals(otherWildcardPermissionBasedAuthorization.getResource());
}
}
return false;
}
@Override
public String getResource() {
return resource != null ? resource.getValue() : null;
}
@Override
public PermissionBasedAuthorization setResource(String resource) {
Objects.requireNonNull(resource);
this.resource = new VariableAwareExpression(resource);
return this;
}
}
| vert-x3/vertx-auth | vertx-auth-common/src/main/java/io/vertx/ext/auth/authorization/impl/PermissionBasedAuthorizationImpl.java | Java | apache-2.0 | 4,026 |
<?php
/**
* @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
*/
namespace Magento\Framework\Stdlib\DateTime;
interface DateInterface
{
/**
* Sets class wide options, if no option was given, the actual set options will be returned
*
* @param array $options \Options to set
* @throws \Zend_Date_Exception
* @return array of options if no option was given
*/
public static function setOptions(array $options = []);
/**
* Returns this object's internal UNIX timestamp (equivalent to \Zend_Date::TIMESTAMP).
* If the timestamp is too large for integers, then the return value will be a string.
* This function does not return the timestamp as an object.
* Use clone() or copyPart() instead.
*
* @return integer|string UNIX timestamp
*/
public function getTimestamp();
/**
* Sets a new timestamp
*
* @param integer|string|array|\Magento\Framework\Stdlib\DateTime\DateInterface $timestamp Timestamp to set
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function setTimestamp($timestamp);
/**
* Adds a timestamp
*
* @param integer|string|array|\Magento\Framework\Stdlib\DateTime\DateInterface $timestamp Timestamp to add
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function addTimestamp($timestamp);
/**
* Subtracts a timestamp
*
* @param integer|string|array|\Magento\Framework\Stdlib\DateTime\DateInterface $timestamp Timestamp to sub
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function subTimestamp($timestamp);
/**
* Compares two timestamps, returning the difference as integer
*
* @param integer|string|array|\Magento\Framework\Stdlib\DateTime\DateInterface $timestamp Timestamp to compare
* @return integer 0 = equal, 1 = later, -1 = earlier
* @throws \Zend_Date_Exception
*/
public function compareTimestamp($timestamp);
/**
* Returns a string representation of the object
* Supported format tokens are:
* G - era, y - year, Y - ISO year, M - month, w - week of year, D - day of year, d - day of month
* E - day of week, e - number of weekday (1-7), h - hour 1-12, H - hour 0-23, m - minute, s - second
* A - milliseconds of day, z - timezone, Z - timezone offset, S - fractional second, a - period of day
*
* Additionally format tokens but non ISO conform are:
* SS - day suffix, eee - php number of weekday(0-6), ddd - number of days per month
* l - Leap year, B - swatch internet time, I - daylight saving time, X - timezone offset in seconds
* r - RFC2822 format, U - unix timestamp
*
* Not supported ISO tokens are
* u - extended year, Q - quarter, q - quarter, L - stand alone month, W - week of month
* F - day of week of month, g - modified julian, c - stand alone weekday, k - hour 0-11, K - hour 1-24
* v - wall zone
*
* @param string $format OPTIONAL Rule for formatting output. If null the default date format is used
* @param string $type OPTIONAL Type for the format string which overrides the standard setting
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return string
*/
public function toString($format = null, $type = null, $locale = null);
/**
* Returns a string representation of the date which is equal with the timestamp
*
* @return string
*/
public function __toString();
/**
* Returns a integer representation of the object
* But returns false when the given part is no value f.e. Month-Name
*
* @param string|integer|\Magento\Framework\Stdlib\DateTime\DateInterface $part OPTIONAL Defines the date or datepart to return as integer
* @return integer|false
*/
public function toValue($part = null);
/**
* Returns an array representation of the object
*
* @return array
*/
public function toArray();
/**
* Returns a representation of a date or datepart
* This could be for example a localized monthname, the time without date,
* the era or only the fractional seconds. There are about 50 different supported date parts.
* For a complete list of supported datepart values look into the docu
*
* @param string $part OPTIONAL Part of the date to return, if null the timestamp is returned
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return string date or datepart
*/
public function get($part = null, $locale = null);
/**
* Counts the exact year number
* < 70 - 2000 added, >70 < 100 - 1900, others just returned
*
* @param integer $value year number
* @return integer Number of year
*/
public static function getFullYear($value);
/**
* Sets the given date as new date or a given datepart as new datepart returning the new datepart
* This could be for example a localized dayname, the date without time,
* the month or only the seconds. There are about 50 different supported date parts.
* For a complete list of supported datepart values look into the docu
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $date Date or datepart to set
* @param string $part OPTIONAL Part of the date to set, if null the timestamp is set
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return $this Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function set($date, $part = null, $locale = null);
/**
* Adds a date or datepart to the existing date, by extracting $part from $date,
* and modifying this object by adding that part. The $part is then extracted from
* this object and returned as an integer or numeric string (for large values, or $part's
* corresponding to pre-defined formatted date strings).
* This could be for example a ISO 8601 date, the hour the monthname or only the minute.
* There are about 50 different supported date parts.
* For a complete list of supported datepart values look into the docu.
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $date Date or datepart to add
* @param string $part OPTIONAL Part of the date to add, if null the timestamp is added
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return $this Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function add($date, $part = \Zend_Date::TIMESTAMP, $locale = null);
/**
* Subtracts a date from another date.
* This could be for example a RFC2822 date, the time,
* the year or only the timestamp. There are about 50 different supported date parts.
* For a complete list of supported datepart values look into the docu
* Be aware: Adding -2 Months is not equal to Subtracting 2 Months !!!
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $date Date or datepart to subtract
* @param string $part OPTIONAL Part of the date to sub, if null the timestamp is subtracted
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return $this Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function sub($date, $part = \Zend_Date::TIMESTAMP, $locale = null);
/**
* Compares a date or datepart with the existing one.
* Returns -1 if earlier, 0 if equal and 1 if later.
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $date Date or datepart to compare with the date object
* @param string $part OPTIONAL Part of the date to compare, if null the timestamp is subtracted
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return integer 0 = equal, 1 = later, -1 = earlier
* @throws \Zend_Date_Exception
*/
public function compare($date, $part = \Zend_Date::TIMESTAMP, $locale = null);
/**
* Returns a new instance of \Magento\Framework\Stdlib\DateTime\DateInterface with the selected part copied.
* To make an exact copy, use PHP's clone keyword.
* For a complete list of supported date part values look into the docu.
* If a date part is copied, all other date parts are set to standard values.
* For example: If only YEAR is copied, the returned date object is equal to
* 01-01-YEAR 00:00:00 (01-01-1970 00:00:00 is equal to timestamp 0)
* If only HOUR is copied, the returned date object is equal to
* 01-01-1970 HOUR:00:00 (so $this contains a timestamp equal to a timestamp of 0 plus HOUR).
*
* @param string $part Part of the date to compare, if null the timestamp is subtracted
* @param string|\Zend_Locale $locale OPTIONAL New object's locale. No adjustments to timezone are made.
* @return \Magento\Framework\Stdlib\DateTime\DateInterface New clone with requested part
*/
public function copyPart($part, $locale = null);
/**
* Internal function, returns the offset of a given timezone
*
* @param string $zone
* @return integer
*/
public function getTimezoneFromString($zone);
/**
* Returns true when both date objects or date parts are equal.
* For example:
* 15.May.2000 <-> 15.June.2000 Equals only for Day or Year... all other will return false
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $date Date or datepart to equal with
* @param string $part OPTIONAL Part of the date to compare, if null the timestamp is used
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return boolean
* @throws \Zend_Date_Exception
*/
public function equals($date, $part = \Zend_Date::TIMESTAMP, $locale = null);
/**
* Returns if the given date or datepart is earlier
* For example:
* 15.May.2000 <-> 13.June.1999 will return true for day, year and date, but not for month
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $date Date or datepart to compare with
* @param string $part OPTIONAL Part of the date to compare, if null the timestamp is used
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return boolean
* @throws \Zend_Date_Exception
*/
public function isEarlier($date, $part = null, $locale = null);
/**
* Returns if the given date or datepart is later
* For example:
* 15.May.2000 <-> 13.June.1999 will return true for month but false for day, year and date
* Returns if the given date is later
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $date Date or datepart to compare with
* @param string $part OPTIONAL Part of the date to compare, if null the timestamp is used
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return boolean
* @throws \Zend_Date_Exception
*/
public function isLater($date, $part = null, $locale = null);
/**
* Returns only the time of the date as new \Magento\Framework\Stdlib\DateTime\Date object
* For example:
* 15.May.2000 10:11:23 will return a dateobject equal to 01.Jan.1970 10:11:23
*
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface
*/
public function getTime($locale = null);
/**
* Sets a new time for the date object. Format defines how to parse the time string.
* Also a complete date can be given, but only the time is used for setting.
* For example: dd.MMMM.yyTHH:mm' and 'ss sec'-> 10.May.07T25:11 and 44 sec => 1h11min44sec + 1 day
* Returned is the new date object and the existing date is left as it was before
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $time Time to set
* @param string $format OPTIONAL Timeformat for parsing input
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function setTime($time, $format = null, $locale = null);
/**
* Adds a time to the existing date. Format defines how to parse the time string.
* If only parts are given the other parts are set to 0.
* If no format is given, the standardformat of this locale is used.
* For example: HH:mm:ss -> 10 -> +10 hours
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $time Time to add
* @param string $format OPTIONAL Timeformat for parsing input
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function addTime($time, $format = null, $locale = null);
/**
* Subtracts a time from the existing date. Format defines how to parse the time string.
* If only parts are given the other parts are set to 0.
* If no format is given, the standardformat of this locale is used.
* For example: HH:mm:ss -> 10 -> -10 hours
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $time Time to sub
* @param string $format OPTIONAL Timeformat for parsing input
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid inteface
* @throws \Zend_Date_Exception
*/
public function subTime($time, $format = null, $locale = null);
/**
* Compares the time from the existing date. Format defines how to parse the time string.
* If only parts are given the other parts are set to default.
* If no format us given, the standardformat of this locale is used.
* For example: HH:mm:ss -> 10 -> 10 hours
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $time Time to compare
* @param string $format OPTIONAL Timeformat for parsing input
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return integer 0 = equal, 1 = later, -1 = earlier
* @throws \Zend_Date_Exception
*/
public function compareTime($time, $format = null, $locale = null);
/**
* Returns a clone of $this, with the time part set to 00:00:00.
*
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface
*/
public function getDate($locale = null);
/**
* Sets a new date for the date object. Format defines how to parse the date string.
* Also a complete date with time can be given, but only the date is used for setting.
* For example: MMMM.yy HH:mm-> May.07 22:11 => 01.May.07 00:00
* Returned is the new date object and the existing time is left as it was before
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $date Date to set
* @param string $format OPTIONAL Date format for parsing
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function setDate($date, $format = null, $locale = null);
/**
* Adds a date to the existing date object. Format defines how to parse the date string.
* If only parts are given the other parts are set to 0.
* If no format is given, the standardformat of this locale is used.
* For example: MM.dd.YYYY -> 10 -> +10 months
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $date Date to add
* @param string $format OPTIONAL Date format for parsing input
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function addDate($date, $format = null, $locale = null);
/**
* Subtracts a date from the existing date object. Format defines how to parse the date string.
* If only parts are given the other parts are set to 0.
* If no format is given, the standardformat of this locale is used.
* For example: MM.dd.YYYY -> 10 -> -10 months
* Be aware: Subtracting 2 months is not equal to Adding -2 months !!!
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $date Date to sub
* @param string $format OPTIONAL Date format for parsing input
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function subDate($date, $format = null, $locale = null);
/**
* Compares the date from the existing date object, ignoring the time.
* Format defines how to parse the date string.
* If only parts are given the other parts are set to 0.
* If no format is given, the standardformat of this locale is used.
* For example: 10.01.2000 => 10.02.1999 -> false
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $date Date to compare
* @param string $format OPTIONAL Date format for parsing input
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return integer 0 = equal, 1 = later, -1 = earlier
* @throws \Zend_Date_Exception
*/
public function compareDate($date, $format = null, $locale = null);
/**
* Returns the full ISO 8601 date from the date object.
* Always the complete ISO 8601 specifiction is used. If an other ISO date is needed
* (ISO 8601 defines several formats) use toString() instead.
* This function does not return the ISO date as object. Use copy() instead.
*
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return string
*/
public function getIso($locale = null);
/**
* Sets a new date for the date object. Not given parts are set to default.
* Only supported ISO 8601 formats are accepted.
* For example: 050901 -> 01.Sept.2005 00:00:00, 20050201T10:00:30 -> 01.Feb.2005 10h00m30s
* Returned is the new date object
*
* @param string|integer|\Magento\Framework\Stdlib\DateTime\DateInterface $date ISO Date to set
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function setIso($date, $locale = null);
/**
* Adds a ISO date to the date object. Not given parts are set to default.
* Only supported ISO 8601 formats are accepted.
* For example: 050901 -> + 01.Sept.2005 00:00:00, 10:00:00 -> +10h
* Returned is the new date object
*
* @param string|integer|\Magento\Framework\Stdlib\DateTime\DateInterface $date ISO Date to add
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function addIso($date, $locale = null);
/**
* Subtracts a ISO date from the date object. Not given parts are set to default.
* Only supported ISO 8601 formats are accepted.
* For example: 050901 -> - 01.Sept.2005 00:00:00, 10:00:00 -> -10h
* Returned is the new date object
*
* @param string|integer|\Magento\Framework\Stdlib\DateTime\DateInterface $date ISO Date to sub
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function subIso($date, $locale = null);
/**
* Compares a ISO date with the date object. Not given parts are set to default.
* Only supported ISO 8601 formats are accepted.
* For example: 050901 -> - 01.Sept.2005 00:00:00, 10:00:00 -> -10h
* Returns if equal, earlier or later
*
* @param string|integer|\Magento\Framework\Stdlib\DateTime\DateInterface $date ISO Date to sub
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return integer 0 = equal, 1 = later, -1 = earlier
* @throws \Zend_Date_Exception
*/
public function compareIso($date, $locale = null);
/**
* Returns a RFC 822 compilant datestring from the date object.
* This function does not return the RFC date as object. Use copy() instead.
*
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return string
*/
public function getArpa($locale = null);
/**
* Sets a RFC 822 date as new date for the date object.
* Only RFC 822 compilant date strings are accepted.
* For example: Sat, 14 Feb 09 00:31:30 +0100
* Returned is the new date object
*
* @param string|integer|\Magento\Framework\Stdlib\DateTime\DateInterface $date RFC 822 to set
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function setArpa($date, $locale = null);
/**
* Adds a RFC 822 date to the date object.
* ARPA messages are used in emails or HTTP Headers.
* Only RFC 822 compilant date strings are accepted.
* For example: Sat, 14 Feb 09 00:31:30 +0100
* Returned is the new date object
*
* @param string|integer|\Magento\Framework\Stdlib\DateTime\DateInterface $date RFC 822 Date to add
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function addArpa($date, $locale = null);
/**
* Subtracts a RFC 822 date from the date object.
* ARPA messages are used in emails or HTTP Headers.
* Only RFC 822 compilant date strings are accepted.
* For example: Sat, 14 Feb 09 00:31:30 +0100
* Returned is the new date object
*
* @param string|integer|\Magento\Framework\Stdlib\DateTime\DateInterface $date RFC 822 Date to sub
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function subArpa($date, $locale = null);
/**
* Compares a RFC 822 compilant date with the date object.
* ARPA messages are used in emails or HTTP Headers.
* Only RFC 822 compilant date strings are accepted.
* For example: Sat, 14 Feb 09 00:31:30 +0100
* Returns if equal, earlier or later
*
* @param string|integer|\Magento\Framework\Stdlib\DateTime\DateInterface $date RFC 822 Date to sub
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return integer 0 = equal, 1 = later, -1 = earlier
* @throws \Zend_Date_Exception
*/
public function compareArpa($date, $locale = null);
/**
* Returns the time of sunrise for this date and a given location as new date object
* For a list of cities and correct locations use the class \Zend_Date_Cities
*
* @param $location array - location of sunrise
* ['horizon'] -> civil, nautic, astronomical, effective (default)
* ['longitude'] -> longitude of location
* ['latitude'] -> latitude of location
* @return \Magento\Framework\Stdlib\DateTime\DateInterface
* @throws \Zend_Date_Exception
*/
public function getSunrise($location);
/**
* Returns the time of sunset for this date and a given location as new date object
* For a list of cities and correct locations use the class \Zend_Date_Cities
*
* @param $location array - location of sunset
* ['horizon'] -> civil, nautic, astronomical, effective (default)
* ['longitude'] -> longitude of location
* ['latitude'] -> latitude of location
* @return \Magento\Framework\Stdlib\DateTime\DateInterface
* @throws \Zend_Date_Exception
*/
public function getSunset($location);
/**
* Returns an array with the sunset and sunrise dates for all horizon types
* For a list of cities and correct locations use the class \Zend_Date_Cities
*
* @param $location array - location of suninfo
* ['horizon'] -> civil, nautic, astronomical, effective (default)
* ['longitude'] -> longitude of location
* ['latitude'] -> latitude of location
* @return array - [sunset|sunrise][effective|civil|nautic|astronomic]
* @throws \Zend_Date_Exception
*/
public function getSunInfo($location);
/**
* Check a given year for leap year.
*
* @param integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $year Year to check
* @return boolean
*/
public static function checkLeapYear($year);
/**
* Returns true, if the year is a leap year.
*
* @return boolean
*/
public function isLeapYear();
/**
* Returns if the set date is todays date
*
* @return boolean
*/
public function isToday();
/**
* Returns if the set date is yesterdays date
*
* @return boolean
*/
public function isYesterday();
/**
* Returns if the set date is tomorrows date
*
* @return boolean
*/
public function isTomorrow();
/**
* Returns the actual date as new date object
*
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface
*/
public static function now($locale = null);
/**
* Returns only the year from the date object as new object.
* For example: 10.May.2000 10:30:00 -> 01.Jan.2000 00:00:00
*
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface
*/
public function getYear($locale = null);
/**
* Sets a new year
* If the year is between 0 and 69, 2000 will be set (2000-2069)
* If the year if between 70 and 99, 1999 will be set (1970-1999)
* 3 or 4 digit years are set as expected. If you need to set year 0-99
* use set() instead.
* Returned is the new date object
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $date Year to set
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function setYear($year, $locale = null);
/**
* Adds the year to the existing date object
* If the year is between 0 and 69, 2000 will be added (2000-2069)
* If the year if between 70 and 99, 1999 will be added (1970-1999)
* 3 or 4 digit years are added as expected. If you need to add years from 0-99
* use add() instead.
* Returned is the new date object
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $date Year to add
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function addYear($year, $locale = null);
/**
* Subs the year from the existing date object
* If the year is between 0 and 69, 2000 will be subtracted (2000-2069)
* If the year if between 70 and 99, 1999 will be subtracted (1970-1999)
* 3 or 4 digit years are subtracted as expected. If you need to subtract years from 0-99
* use sub() instead.
* Returned is the new date object
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $date Year to sub
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function subYear($year, $locale = null);
/**
* Compares the year with the existing date object, ignoring other date parts.
* For example: 10.03.2000 -> 15.02.2000 -> true
* Returns if equal, earlier or later
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $year Year to compare
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return integer 0 = equal, 1 = later, -1 = earlier
* @throws \Zend_Date_Exception
*/
public function compareYear($year, $locale = null);
/**
* Returns only the month from the date object as new object.
* For example: 10.May.2000 10:30:00 -> 01.May.1970 00:00:00
*
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Zend_Date
*/
public function getMonth($locale = null);
/**
* Sets a new month
* The month can be a number or a string. Setting months lower than 0 and greater then 12
* will result in adding or subtracting the relevant year. (12 months equal one year)
* If a localized monthname is given it will be parsed with the default locale or the optional
* set locale.
* Returned is the new date object
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $month Month to set
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function setMonth($month, $locale = null);
/**
* Adds months to the existing date object.
* The month can be a number or a string. Adding months lower than 0 and greater then 12
* will result in adding or subtracting the relevant year. (12 months equal one year)
* If a localized monthname is given it will be parsed with the default locale or the optional
* set locale.
* Returned is the new date object
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $month Month to add
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function addMonth($month, $locale = null);
/**
* Subtracts months from the existing date object.
* The month can be a number or a string. Subtracting months lower than 0 and greater then 12
* will result in adding or subtracting the relevant year. (12 months equal one year)
* If a localized monthname is given it will be parsed with the default locale or the optional
* set locale.
* Returned is the new date object
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $month Month to sub
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function subMonth($month, $locale = null);
/**
* Compares the month with the existing date object, ignoring other date parts.
* For example: 10.03.2000 -> 15.03.1950 -> true
* Returns if equal, earlier or later
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $month Month to compare
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return integer 0 = equal, 1 = later, -1 = earlier
* @throws \Zend_Date_Exception
*/
public function compareMonth($month, $locale = null);
/**
* Returns the day as new date object
* Example: 20.May.1986 -> 20.Jan.1970 00:00:00
*
* @param $locale string|\Zend_Locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface
*/
public function getDay($locale = null);
/**
* Sets a new day
* The day can be a number or a string. Setting days lower then 0 or greater than the number of this months days
* will result in adding or subtracting the relevant month.
* If a localized dayname is given it will be parsed with the default locale or the optional
* set locale.
* Returned is the new date object
* Example: setDay('Montag', 'de_AT'); will set the monday of this week as day.
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $month Day to set
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function setDay($day, $locale = null);
/**
* Adds days to the existing date object.
* The day can be a number or a string. Adding days lower then 0 or greater than the number of this months days
* will result in adding or subtracting the relevant month.
* If a localized dayname is given it will be parsed with the default locale or the optional
* set locale.
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $month Day to add
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function addDay($day, $locale = null);
/**
* Subtracts days from the existing date object.
* The day can be a number or a string. Subtracting days lower then 0 or greater than the number of this months days
* will result in adding or subtracting the relevant month.
* If a localized dayname is given it will be parsed with the default locale or the optional
* set locale.
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $month Day to sub
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function subDay($day, $locale = null);
/**
* Compares the day with the existing date object, ignoring other date parts.
* For example: 'Monday', 'en' -> 08.Jan.2007 -> 0
* Returns if equal, earlier or later
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $day Day to compare
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return integer 0 = equal, 1 = later, -1 = earlier
* @throws \Zend_Date_Exception
*/
public function compareDay($day, $locale = null);
/**
* Returns the weekday as new date object
* Weekday is always from 1-7
* Example: 09-Jan-2007 -> 2 = Tuesday -> 02-Jan-1970 (when 02.01.1970 is also Tuesday)
*
* @param $locale string|\Zend_Locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface
*/
public function getWeekday($locale = null);
/**
* Sets a new weekday
* The weekday can be a number or a string. If a localized weekday name is given,
* then it will be parsed as a date in $locale (defaults to the same locale as $this).
* Returned is the new date object.
* Example: setWeekday(3); will set the wednesday of this week as day.
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $month Weekday to set
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function setWeekday($weekday, $locale = null);
/**
* Adds weekdays to the existing date object.
* The weekday can be a number or a string.
* If a localized dayname is given it will be parsed with the default locale or the optional
* set locale.
* Returned is the new date object
* Example: addWeekday(3); will add the difference of days from the beginning of the month until
* wednesday.
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $month Weekday to add
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function addWeekday($weekday, $locale = null);
/**
* Subtracts weekdays from the existing date object.
* The weekday can be a number or a string.
* If a localized dayname is given it will be parsed with the default locale or the optional
* set locale.
* Returned is the new date object
* Example: subWeekday(3); will subtract the difference of days from the beginning of the month until
* wednesday.
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $month Weekday to sub
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function subWeekday($weekday, $locale = null);
/**
* Compares the weekday with the existing date object, ignoring other date parts.
* For example: 'Monday', 'en' -> 08.Jan.2007 -> 0
* Returns if equal, earlier or later
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $weekday Weekday to compare
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return integer 0 = equal, 1 = later, -1 = earlier
* @throws \Zend_Date_Exception
*/
public function compareWeekday($weekday, $locale = null);
/**
* Returns the day of year as new date object
* Example: 02.Feb.1986 10:00:00 -> 02.Feb.1970 00:00:00
*
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface
*/
public function getDayOfYear($locale = null);
/**
* Sets a new day of year
* The day of year is always a number.
* Returned is the new date object
* Example: 04.May.2004 -> setDayOfYear(10) -> 10.Jan.2004
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $day Day of Year to set
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function setDayOfYear($day, $locale = null);
/**
* Adds a day of year to the existing date object.
* The day of year is always a number.
* Returned is the new date object
* Example: addDayOfYear(10); will add 10 days to the existing date object.
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $day Day of Year to add
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function addDayOfYear($day, $locale = null);
/**
* Subtracts a day of year from the existing date object.
* The day of year is always a number.
* Returned is the new date object
* Example: subDayOfYear(10); will subtract 10 days from the existing date object.
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $day Day of Year to sub
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function subDayOfYear($day, $locale = null);
/**
* Compares the day of year with the existing date object.
* For example: compareDayOfYear(33) -> 02.Feb.2007 -> 0
* Returns if equal, earlier or later
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $day Day of Year to compare
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return integer 0 = equal, 1 = later, -1 = earlier
* @throws \Zend_Date_Exception
*/
public function compareDayOfYear($day, $locale = null);
/**
* Returns the hour as new date object
* Example: 02.Feb.1986 10:30:25 -> 01.Jan.1970 10:00:00
*
* @param $locale string|\Zend_Locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface
*/
public function getHour($locale = null);
/**
* Sets a new hour
* The hour is always a number.
* Returned is the new date object
* Example: 04.May.1993 13:07:25 -> setHour(7); -> 04.May.1993 07:07:25
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $hour Hour to set
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function setHour($hour, $locale = null);
/**
* Adds hours to the existing date object.
* The hour is always a number.
* Returned is the new date object
* Example: 04.May.1993 13:07:25 -> addHour(12); -> 05.May.1993 01:07:25
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $hour Hour to add
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function addHour($hour, $locale = null);
/**
* Subtracts hours from the existing date object.
* The hour is always a number.
* Returned is the new date object
* Example: 04.May.1993 13:07:25 -> subHour(6); -> 05.May.1993 07:07:25
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $hour Hour to sub
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function subHour($hour, $locale = null);
/**
* Compares the hour with the existing date object.
* For example: 10:30:25 -> compareHour(10) -> 0
* Returns if equal, earlier or later
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $hour Hour to compare
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return integer 0 = equal, 1 = later, -1 = earlier
* @throws \Zend_Date_Exception
*/
public function compareHour($hour, $locale = null);
/**
* Returns the minute as new date object
* Example: 02.Feb.1986 10:30:25 -> 01.Jan.1970 00:30:00
*
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface
*/
public function getMinute($locale = null);
/**
* Sets a new minute
* The minute is always a number.
* Returned is the new date object
* Example: 04.May.1993 13:07:25 -> setMinute(29); -> 04.May.1993 13:29:25
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $minute Minute to set
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function setMinute($minute, $locale = null);
/**
* Adds minutes to the existing date object.
* The minute is always a number.
* Returned is the new date object
* Example: 04.May.1993 13:07:25 -> addMinute(65); -> 04.May.1993 13:12:25
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $minute Minute to add
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function addMinute($minute, $locale = null);
/**
* Subtracts minutes from the existing date object.
* The minute is always a number.
* Returned is the new date object
* Example: 04.May.1993 13:07:25 -> subMinute(9); -> 04.May.1993 12:58:25
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $minute Minute to sub
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function subMinute($minute, $locale = null);
/**
* Compares the minute with the existing date object.
* For example: 10:30:25 -> compareMinute(30) -> 0
* Returns if equal, earlier or later
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $minute Hour to compare
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return integer 0 = equal, 1 = later, -1 = earlier
* @throws \Zend_Date_Exception
*/
public function compareMinute($minute, $locale = null);
/**
* Returns the second as new date object
* Example: 02.Feb.1986 10:30:25 -> 01.Jan.1970 00:00:25
*
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface
*/
public function getSecond($locale = null);
/**
* Sets new seconds to the existing date object.
* The second is always a number.
* Returned is the new date object
* Example: 04.May.1993 13:07:25 -> setSecond(100); -> 04.May.1993 13:08:40
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $second Second to set
* @param string|\Zend_Locale $locale (Optional) Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function setSecond($second, $locale = null);
/**
* Adds seconds to the existing date object.
* The second is always a number.
* Returned is the new date object
* Example: 04.May.1993 13:07:25 -> addSecond(65); -> 04.May.1993 13:08:30
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $second Second to add
* @param string|\Zend_Locale $locale (Optional) Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function addSecond($second, $locale = null);
/**
* Subtracts seconds from the existing date object.
* The second is always a number.
* Returned is the new date object
* Example: 04.May.1993 13:07:25 -> subSecond(10); -> 04.May.1993 13:07:15
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $second Second to sub
* @param string|\Zend_Locale $locale (Optional) Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function subSecond($second, $locale = null);
/**
* Compares the second with the existing date object.
* For example: 10:30:25 -> compareSecond(25) -> 0
* Returns if equal, earlier or later
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $second Second to compare
* @param string|\Zend_Locale $locale (Optional) Locale for parsing input
* @return integer 0 = equal, 1 = later, -1 = earlier
* @throws \Zend_Date_Exception
*/
public function compareSecond($second, $locale = null);
/**
* Returns the precision for fractional seconds
*
* @return integer
*/
public function getFractionalPrecision();
/**
* Sets a new precision for fractional seconds
*
* @param integer $precision Precision for the fractional datepart 3 = milliseconds
* @throws \Zend_Date_Exception
* @return $this Provides fluid interface
*/
public function setFractionalPrecision($precision);
/**
* Returns the milliseconds of the date object
*
* @return string
*/
public function getMilliSecond();
/**
* Sets new milliseconds for the date object
* Example: setMilliSecond(550, 2) -> equals +5 Sec +50 MilliSec
*
* @param integer|\Magento\Framework\Stdlib\DateTime\DateInterface $milli (Optional) Millisecond to set, when null the actual millisecond is set
* @param integer $precision (Optional) Fraction precision of the given milliseconds
* @return $this Provides fluid interface
*/
public function setMilliSecond($milli = null, $precision = null);
/**
* Adds milliseconds to the date object
*
* @param integer|\Magento\Framework\Stdlib\DateTime\DateInterface $milli (Optional) Millisecond to add, when null the actual millisecond is added
* @param integer $precision (Optional) Fractional precision for the given milliseconds
* @return $this Provides fluid interface
*/
public function addMilliSecond($milli = null, $precision = null);
/**
* Subtracts a millisecond
*
* @param integer|\Magento\Framework\Stdlib\DateTime\DateInterface $milli (Optional) Millisecond to sub, when null the actual millisecond is subtracted
* @param integer $precision (Optional) Fractional precision for the given milliseconds
* @return $this Provides fluid interface
*/
public function subMilliSecond($milli = null, $precision = null);
/**
* Compares only the millisecond part, returning the difference
*
* @param integer|\Magento\Framework\Stdlib\DateTime\DateInterface $milli OPTIONAL Millisecond to compare, when null the actual millisecond is compared
* @param integer $precision OPTIONAL Fractional precision for the given milliseconds
* @throws \Zend_Date_Exception On invalid input
* @return integer 0 = equal, 1 = later, -1 = earlier
*/
public function compareMilliSecond($milli = null, $precision = null);
/**
* Returns the week as new date object using monday as beginning of the week
* Example: 12.Jan.2007 -> 08.Jan.1970 00:00:00
*
* @param $locale string|\Zend_Locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface
*/
public function getWeek($locale = null);
/**
* Sets a new week. The week is always a number. The day of week is not changed.
* Returned is the new date object
* Example: 09.Jan.2007 13:07:25 -> setWeek(1); -> 02.Jan.2007 13:07:25
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $week Week to set
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function setWeek($week, $locale = null);
/**
* Adds a week. The week is always a number. The day of week is not changed.
* Returned is the new date object
* Example: 09.Jan.2007 13:07:25 -> addWeek(1); -> 16.Jan.2007 13:07:25
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $week Week to add
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function addWeek($week, $locale = null);
/**
* Subtracts a week. The week is always a number. The day of week is not changed.
* Returned is the new date object
* Example: 09.Jan.2007 13:07:25 -> subWeek(1); -> 02.Jan.2007 13:07:25
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $week Week to sub
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return \Magento\Framework\Stdlib\DateTime\DateInterface Provides fluid interface
* @throws \Zend_Date_Exception
*/
public function subWeek($week, $locale = null);
/**
* Compares only the week part, returning the difference
* Returned is the new date object
* Returns if equal, earlier or later
* Example: 09.Jan.2007 13:07:25 -> compareWeek(2); -> 0
*
* @param string|integer|array|\Magento\Framework\Stdlib\DateTime\DateInterface $week Week to compare
* @param string|\Zend_Locale $locale OPTIONAL Locale for parsing input
* @return integer 0 = equal, 1 = later, -1 = earlier
*/
public function compareWeek($week, $locale = null);
/**
* Sets a new standard locale for the date object.
* This locale will be used for all functions
* Returned is the really set locale.
* Example: 'de_XX' will be set to 'de' because 'de_XX' does not exist
* 'xx_YY' will be set to 'root' because 'xx' does not exist
*
* @param string|\Zend_Locale $locale (Optional) Locale for parsing input
* @throws \Zend_Date_Exception When the given locale does not exist
* @return $this Provides fluent interface
*/
public function setLocale($locale = null);
/**
* Returns the actual set locale
*
* @return string
*/
public function getLocale();
/**
* Checks if the given date is a real date or datepart.
* Returns false if a expected datepart is missing or a datepart exceeds its possible border.
* But the check will only be done for the expected dateparts which are given by format.
* If no format is given the standard dateformat for the actual locale is used.
* f.e. 30.February.2007 will return false if format is 'dd.MMMM.YYYY'
*
* @param string|array|\Magento\Framework\Stdlib\DateTime\DateInterface $date Date to parse for correctness
* @param string $format (Optional) Format for parsing the date string
* @param string|\Zend_Locale $locale (Optional) Locale for parsing date parts
* @return boolean True when all date parts are correct
*/
public static function isDate($date, $format = null, $locale = null);
/**
* Sets a new timezone for calculation of $this object's gmt offset.
* For a list of supported timezones look here: http://php.net/timezones
* If no timezone can be detected or the given timezone is wrong UTC will be set.
*
* @param string $zone OPTIONAL timezone for date calculation; defaults to date_default_timezone_get()
* @return \Zend_Date_DateObject Provides fluent interface
* @throws \Zend_Date_Exception
*/
public function setTimezone($zone = null);
/**
* Return the timezone of $this object.
* The timezone is initially set when the object is instantiated.
*
* @return string actual set timezone string
*/
public function getTimezone();
/**
* Return the offset to GMT of $this object's timezone.
* The offset to GMT is initially set when the object is instantiated using the currently,
* in effect, default timezone for PHP functions.
*
* @return integer seconds difference between GMT timezone and timezone when object was instantiated
*/
public function getGmtOffset();
}
| webadvancedservicescom/magento | lib/internal/Magento/Framework/Stdlib/DateTime/DateInterface.php | PHP | apache-2.0 | 59,193 |
package org.polyglotted.xpathstax.model;
import com.google.common.base.Splitter;
import com.google.common.collect.Iterables;
import org.codehaus.stax2.XMLStreamReader2;
import org.polyglotted.xpathstax.data.Value;
import javax.annotation.concurrent.ThreadSafe;
import java.util.Iterator;
import java.util.Map.Entry;
import java.util.concurrent.atomic.AtomicInteger;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
@SuppressWarnings("WeakerAccess")
@ThreadSafe
public class XmlAttribute {
private static final String NP_SPACE = String.valueOf((char) 22);
private static final String EQUALS = "=";
private static final Splitter SPACE_SPLITTER = Splitter.on(" ").trimResults().omitEmptyStrings();
private static final Splitter NPSPACE_SPLITTER = Splitter.on(NP_SPACE).trimResults().omitEmptyStrings();
private static final Splitter EQUALS_SPLITTER = Splitter.on(EQUALS).trimResults().omitEmptyStrings();
public static final XmlAttribute EMPTY = XmlAttribute.from("");
private final StringBuffer buffer = new StringBuffer();
private AtomicInteger count = new AtomicInteger(0);
public static XmlAttribute from(String attributeString) {
XmlAttribute attr = new XmlAttribute();
Iterable<String> attributes = SPACE_SPLITTER.split(attributeString);
for (String value : attributes) {
Iterator<String> iter = splitByEquals(value);
attr.add(iter.next(), iter.hasNext() ? iter.next() : "");
}
return attr;
}
public static XmlAttribute from(XMLStreamReader2 xmlr) {
XmlAttribute attr = new XmlAttribute();
for (int i = 0; i < xmlr.getAttributeCount(); i++) {
attr.add(xmlr.getAttributeLocalName(i), xmlr.getAttributeValue(i));
}
return attr;
}
public void add(String name, String value) {
checkArgument(!name.contains(EQUALS));
buffer.append(buildKey(name));
buffer.append(buildValue(value));
count.incrementAndGet();
}
public int count() {
return count.get();
}
public boolean contains(String name) {
return buffer.indexOf(buildKey(name)) >= 0;
}
public boolean contains(String name, String value) {
return buffer.indexOf(buildKey(name) + buildValue(value)) >= 0;
}
public boolean contains(XmlAttribute inner) {
if (inner == null)
return false;
if (inner == this)
return true;
if (inner.count() == 1) {
return buffer.indexOf(inner.buffer.toString()) >= 0;
}
boolean result = true;
for (String part : NPSPACE_SPLITTER.split(inner.buffer)) {
if (buffer.indexOf(NP_SPACE + part) < 0) {
result = false;
break;
}
}
return result;
}
public Value get(String name) {
String result = null;
final String key = buildKey(name);
int keyIndex = buffer.indexOf(key);
if (keyIndex >= 0) {
int fromIndex = keyIndex + key.length();
int lastIndex = buffer.indexOf(NP_SPACE, fromIndex);
result = (lastIndex >= 0) ? buffer.substring(fromIndex, lastIndex) : buffer.substring(fromIndex);
}
return Value.of(result);
}
public Iterable<Entry<String, Value>> iterate() {
return Iterables.transform(NPSPACE_SPLITTER.split(buffer), AttrEntry::new);
}
@Override
public String toString() {
return buffer.toString();
}
private static String buildKey(String name) {
return NP_SPACE + checkNotNull(name) + EQUALS;
}
private static String buildValue(String value) {
return checkNotNull(value).replaceAll("'", "").replaceAll("\"", "");
}
private static Iterator<String> splitByEquals(String value) {
Iterator<String> iter = EQUALS_SPLITTER.split(value).iterator();
checkArgument(iter.hasNext(), "unable to parse attribute " + value);
return iter;
}
private static class AttrEntry implements Entry<String, Value> {
private final String key;
private final Value value;
AttrEntry(String data) {
Iterator<String> iter = splitByEquals(data);
this.key = iter.next();
this.value = iter.hasNext() ? Value.of(iter.next()) : Value.of(null);
}
@Override
public String getKey() {
return key;
}
@Override
public Value getValue() {
return value;
}
@Override
public Value setValue(Value value) {
throw new UnsupportedOperationException();
}
}
}
| polyglotted/xpath-stax | src/main/java/org/polyglotted/xpathstax/model/XmlAttribute.java | Java | apache-2.0 | 4,780 |
<head>
<title>Vault Search</title>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<link rel="stylesheet" href="vapir.min.css">
</head>
<body>
<div class="container">
<h1>VAULT Search</h1>
<!-- note: jQuery 1.4.1 is what we have on Drupal & Millennium -->
<form method="GET" name="vapir" id="search" class="form-inline" role="form">
<input class="form-control" type="text" name="q">
<button type="submit" class="btn btn-primary">Search</button>
</form>
<div id="vapir-results" style="display:none;"></div>
<p>Try <a href="https://vault.cca.edu/logon.do">logging in</a> to see more results.</p>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
<script src="vapir.js"></script>
<script>
// param in URL? then search for it
try {
var query = decodeURIComponent(location.search.match(/searcharg=(.*)?&?/)[1].split('&')[0].replace('+', ' '));
$('#search input[type=text]').val(query);
vapir(query, '#vapir-results');
} catch (e) {}
$('#search').submit(function (event) {
var query = $(this).find('input').val();
event.preventDefault();
vapir(query, '#vapir-results');
});
</script>
| cca/equella_api | vapir.html | HTML | apache-2.0 | 1,244 |
# Navicula capitata luneburgensis (Grunow) Patr. SUBSPECIES
#### Status
ACCEPTED
#### According to
The National Checklist of Taiwan
#### Published in
null
#### Original name
null
### Remarks
null | mdoering/backbone | life/Plantae/Bacillariophyta/Bacillariophyceae/Naviculales/Naviculaceae/Navicula/Navicula capitata/Navicula capitata luneburgensis/README.md | Markdown | apache-2.0 | 200 |
package com.caozeal.practice;
import static org.assertj.core.api.Assertions.*;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
public class TestTryTest {
// @OdevityMain2
// public void seleniumTest(){
// WebDriver driver = new FirefoxDriver();
// driver.get("http://www.baidu.com");
//// WebElement query = driver.findElement(By.name("search"));
//// query.sendKeys("傲然绝唳的测试");
////
//// WebElement goButton = driver.findElement(By.name("go"));
//// goButton.click();
////
//// assertThat(driver.getTitle()).startsWith("傲然绝唳的测试");
// driver.quit();
// }
}
| caozeal/Utopia | Source/UtopiaLand/test/com/caozeal/someTry/TestTryTest.java | Java | apache-2.0 | 786 |
package org.javarosa.model.xform;
import org.javarosa.core.data.IDataPointer;
import org.javarosa.core.model.IAnswerDataSerializer;
import org.javarosa.core.model.instance.FormInstance;
import org.javarosa.core.model.instance.TreeElement;
import org.javarosa.core.model.instance.TreeReference;
import org.javarosa.core.model.utils.IInstanceSerializingVisitor;
import org.javarosa.core.services.transport.payload.ByteArrayPayload;
import org.javarosa.core.services.transport.payload.DataPointerPayload;
import org.javarosa.core.services.transport.payload.IDataPayload;
import org.javarosa.core.services.transport.payload.MultiMessagePayload;
import org.javarosa.xform.util.XFormAnswerDataSerializer;
import org.javarosa.xform.util.XFormSerializer;
import org.kxml2.kdom.Document;
import org.kxml2.kdom.Element;
import org.kxml2.kdom.Node;
import java.io.IOException;
import java.util.Enumeration;
import java.util.Vector;
/**
* A visitor-esque class which walks a FormInstance and constructs an XML document
* containing its instance.
*
* The XML node elements are constructed in a depth-first manner, consistent with
* standard XML document parsing.
*
* @author Clayton Sims
*/
public class XFormSerializingVisitor implements IInstanceSerializingVisitor {
/**
* The XML document containing the instance that is to be returned
*/
Document theXmlDoc;
/**
* The serializer to be used in constructing XML for AnswerData elements
*/
IAnswerDataSerializer serializer;
/**
* The root of the xml document which should be included in the serialization *
*/
TreeReference rootRef;
Vector<IDataPointer> dataPointers;
boolean respectRelevance = true;
public XFormSerializingVisitor() {
this(true);
}
public XFormSerializingVisitor(boolean respectRelevance) {
this.respectRelevance = respectRelevance;
}
private void init() {
theXmlDoc = null;
dataPointers = new Vector<IDataPointer>();
}
@Override
public byte[] serializeInstance(FormInstance model) throws IOException {
return serializeInstance(model, new XPathReference("/"));
}
@Override
public byte[] serializeInstance(FormInstance model, XPathReference ref) throws IOException {
init();
rootRef = FormInstance.unpackReference(ref);
if (this.serializer == null) {
this.setAnswerDataSerializer(new XFormAnswerDataSerializer());
}
model.accept(this);
if (theXmlDoc != null) {
return XFormSerializer.getUtfBytesFromDocument(theXmlDoc);
} else {
return null;
}
}
@Override
public IDataPayload createSerializedPayload(FormInstance model) throws IOException {
return createSerializedPayload(model, new XPathReference("/"));
}
@Override
public IDataPayload createSerializedPayload(FormInstance model, XPathReference ref) throws IOException {
init();
rootRef = FormInstance.unpackReference(ref);
if (this.serializer == null) {
this.setAnswerDataSerializer(new XFormAnswerDataSerializer());
}
model.accept(this);
if (theXmlDoc != null) {
//TODO: Did this strip necessary data?
byte[] form = XFormSerializer.getUtfBytesFromDocument(theXmlDoc);
if (dataPointers.size() == 0) {
return new ByteArrayPayload(form, null, IDataPayload.PAYLOAD_TYPE_XML);
}
MultiMessagePayload payload = new MultiMessagePayload();
payload.addPayload(new ByteArrayPayload(form, "xml_submission_file", IDataPayload.PAYLOAD_TYPE_XML));
Enumeration en = dataPointers.elements();
while (en.hasMoreElements()) {
IDataPointer pointer = (IDataPointer)en.nextElement();
payload.addPayload(new DataPointerPayload(pointer));
}
return payload;
} else {
return null;
}
}
@Override
public void visit(FormInstance tree) {
theXmlDoc = new Document();
TreeElement root = tree.resolveReference(rootRef);
//For some reason resolveReference won't ever return the root, so we'll
//catch that case and just start at the root.
if (root == null) {
root = tree.getRoot();
}
if (root != null) {
theXmlDoc.addChild(Node.ELEMENT, serializeNode(root));
}
Element top = theXmlDoc.getElement(0);
String[] prefixes = tree.getNamespacePrefixes();
for (String prefix : prefixes) {
top.setPrefix(prefix, tree.getNamespaceURI(prefix));
}
if (tree.schema != null) {
top.setNamespace(tree.schema);
top.setPrefix("", tree.schema);
}
}
private Element serializeNode(TreeElement instanceNode) {
Element e = new Element(); //don't set anything on this element yet, as it might get overwritten
//don't serialize template nodes or non-relevant nodes
if ((respectRelevance && !instanceNode.isRelevant()) || instanceNode.getMult() == TreeReference.INDEX_TEMPLATE) {
return null;
}
if (instanceNode.getValue() != null) {
Object serializedAnswer = serializer.serializeAnswerData(instanceNode.getValue(), instanceNode.getDataType());
if (serializedAnswer instanceof Element) {
e = (Element)serializedAnswer;
} else if (serializedAnswer instanceof String) {
e = new Element();
e.addChild(Node.TEXT, serializedAnswer);
} else {
throw new RuntimeException("Can't handle serialized output for" + instanceNode.getValue().toString() + ", " + serializedAnswer);
}
if (serializer.containsExternalData(instanceNode.getValue()).booleanValue()) {
IDataPointer[] pointers = serializer.retrieveExternalDataPointer(instanceNode.getValue());
for (IDataPointer pointer : pointers) {
dataPointers.addElement(pointer);
}
}
} else {
//make sure all children of the same tag name are written en bloc
Vector<String> childNames = new Vector<String>();
for (int i = 0; i < instanceNode.getNumChildren(); i++) {
String childName = instanceNode.getChildAt(i).getName();
if (!childNames.contains(childName))
childNames.addElement(childName);
}
for (int i = 0; i < childNames.size(); i++) {
String childName = childNames.elementAt(i);
int mult = instanceNode.getChildMultiplicity(childName);
for (int j = 0; j < mult; j++) {
Element child = serializeNode(instanceNode.getChild(childName, j));
if (child != null) {
e.addChild(Node.ELEMENT, child);
}
}
}
}
e.setName(instanceNode.getName());
// add hard-coded attributes
for (int i = 0; i < instanceNode.getAttributeCount(); i++) {
String namespace = instanceNode.getAttributeNamespace(i);
String name = instanceNode.getAttributeName(i);
String val = instanceNode.getAttributeValue(i);
// is it legal for getAttributeValue() to return null? playing it safe for now and assuming yes
if (val == null) {
val = "";
}
e.setAttribute(namespace, name, val);
}
if (instanceNode.getNamespace() != null) {
e.setNamespace(instanceNode.getNamespace());
}
return e;
}
@Override
public void setAnswerDataSerializer(IAnswerDataSerializer ads) {
this.serializer = ads;
}
@Override
public IInstanceSerializingVisitor newInstance() {
XFormSerializingVisitor modelSerializer = new XFormSerializingVisitor();
modelSerializer.setAnswerDataSerializer(this.serializer);
return modelSerializer;
}
}
| dimagi/javarosa | javarosa/core/src/main/java/org/javarosa/model/xform/XFormSerializingVisitor.java | Java | apache-2.0 | 8,206 |
package io.silverspoon.bulldog.beagleboneblack.devicetree;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
public class DeviceTreeCompiler {
private static final String FIRMWARE_PATH = "/lib/firmware/";
private static final String OBJECT_FILE_PATTERN = "%s%s.dtbo";
private static final String DEFINITION_FILE_PATTERN = "%s%s.dts";
private static final String COMPILER_CALL = "dtc -O dtb -o %s -b 0 -@ %s";
public static void compileOverlay(String overlay, String deviceName) throws IOException, InterruptedException {
String objectFile = String.format(OBJECT_FILE_PATTERN, FIRMWARE_PATH, deviceName);
String overlayFile = String.format(DEFINITION_FILE_PATTERN, FIRMWARE_PATH, deviceName);
File file = new File(overlayFile);
FileOutputStream outputStream = new FileOutputStream(file);
PrintWriter writer = new PrintWriter(outputStream);
writer.write(overlay);
writer.close();
Process compile = Runtime.getRuntime().exec(String.format(COMPILER_CALL, objectFile, overlayFile));
int code = compile.waitFor();
if (code > 0) {
throw new RuntimeException("Device Tree Overlay compilation failed: " + overlayFile + " could not be compiled");
}
}
}
| xjaros1/bulldog | bulldog-board-beagleboneblack/src/main/java/io/silverspoon/bulldog/beagleboneblack/devicetree/DeviceTreeCompiler.java | Java | apache-2.0 | 1,303 |
/*
* DO NOT EDIT. THIS FILE IS GENERATED FROM e:/builds/moz2_slave/rel-2.0-xr-w32-bld/build/dom/interfaces/html/nsIDOMHTMLMapElement.idl
*/
#ifndef __gen_nsIDOMHTMLMapElement_h__
#define __gen_nsIDOMHTMLMapElement_h__
#ifndef __gen_nsIDOMHTMLElement_h__
#include "nsIDOMHTMLElement.h"
#endif
/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
/* starting interface: nsIDOMHTMLMapElement */
#define NS_IDOMHTMLMAPELEMENT_IID_STR "a6cf90af-15b3-11d2-932e-00805f8add32"
#define NS_IDOMHTMLMAPELEMENT_IID \
{0xa6cf90af, 0x15b3, 0x11d2, \
{ 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 }}
/**
* The nsIDOMHTMLMapElement interface is the interface to a [X]HTML
* map element.
*
* This interface is trying to follow the DOM Level 2 HTML specification:
* http://www.w3.org/TR/DOM-Level-2-HTML/
*
* with changes from the work-in-progress WHATWG HTML specification:
* http://www.whatwg.org/specs/web-apps/current-work/
*/
class NS_NO_VTABLE NS_SCRIPTABLE nsIDOMHTMLMapElement : public nsIDOMHTMLElement {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMHTMLMAPELEMENT_IID)
/* readonly attribute nsIDOMHTMLCollection areas; */
NS_SCRIPTABLE NS_IMETHOD GetAreas(nsIDOMHTMLCollection **aAreas) = 0;
/* attribute DOMString name; */
NS_SCRIPTABLE NS_IMETHOD GetName(nsAString & aName) = 0;
NS_SCRIPTABLE NS_IMETHOD SetName(const nsAString & aName) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMHTMLMapElement, NS_IDOMHTMLMAPELEMENT_IID)
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMHTMLMAPELEMENT \
NS_SCRIPTABLE NS_IMETHOD GetAreas(nsIDOMHTMLCollection **aAreas); \
NS_SCRIPTABLE NS_IMETHOD GetName(nsAString & aName); \
NS_SCRIPTABLE NS_IMETHOD SetName(const nsAString & aName);
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDOMHTMLMAPELEMENT(_to) \
NS_SCRIPTABLE NS_IMETHOD GetAreas(nsIDOMHTMLCollection **aAreas) { return _to GetAreas(aAreas); } \
NS_SCRIPTABLE NS_IMETHOD GetName(nsAString & aName) { return _to GetName(aName); } \
NS_SCRIPTABLE NS_IMETHOD SetName(const nsAString & aName) { return _to SetName(aName); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIDOMHTMLMAPELEMENT(_to) \
NS_SCRIPTABLE NS_IMETHOD GetAreas(nsIDOMHTMLCollection **aAreas) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAreas(aAreas); } \
NS_SCRIPTABLE NS_IMETHOD GetName(nsAString & aName) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetName(aName); } \
NS_SCRIPTABLE NS_IMETHOD SetName(const nsAString & aName) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetName(aName); }
#if 0
/* Use the code below as a template for the implementation class for this interface. */
/* Header file */
class nsDOMHTMLMapElement : public nsIDOMHTMLMapElement
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIDOMHTMLMAPELEMENT
nsDOMHTMLMapElement();
private:
~nsDOMHTMLMapElement();
protected:
/* additional members */
};
/* Implementation file */
NS_IMPL_ISUPPORTS1(nsDOMHTMLMapElement, nsIDOMHTMLMapElement)
nsDOMHTMLMapElement::nsDOMHTMLMapElement()
{
/* member initializers and constructor code */
}
nsDOMHTMLMapElement::~nsDOMHTMLMapElement()
{
/* destructor code */
}
/* readonly attribute nsIDOMHTMLCollection areas; */
NS_IMETHODIMP nsDOMHTMLMapElement::GetAreas(nsIDOMHTMLCollection **aAreas)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* attribute DOMString name; */
NS_IMETHODIMP nsDOMHTMLMapElement::GetName(nsAString & aName)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsDOMHTMLMapElement::SetName(const nsAString & aName)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* End of implementation class template. */
#endif
#endif /* __gen_nsIDOMHTMLMapElement_h__ */
| akiellor/selenium | third_party/gecko-2/win32/include/nsIDOMHTMLMapElement.h | C | apache-2.0 | 4,045 |
# Copyright 2016 Nuage Netowrks USA Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import abc
import copy
import os
import oslo_messaging
import six
from neutron.agent.linux import ip_lib
from neutron.common import rpc as n_rpc
from neutron import context
from neutron_lib import constants
from neutron_lib.plugins import directory
from neutron_vpnaas.services.vpn import device_drivers
from neutron_vpnaas.services.vpn.device_drivers import fedora_strongswan_ipsec
from neutron_vpnaas.services.vpn.device_drivers import ipsec
from neutron_vpnaas.services.vpn.device_drivers import strongswan_ipsec
from nuage_neutron.vpnaas.common import topics
from nuage_neutron.vpnaas.nuage_interface import NuageInterfaceDriver
from oslo_concurrency import lockutils
from oslo_config import cfg
from oslo_log import log as logging
from oslo_service import loopingcall
LOG = logging.getLogger(__name__)
TEMPLATE_PATH = os.path.dirname(os.path.abspath(__file__))
IPSEC_CONNS = 'ipsec_site_connections'
class NuageIPsecVpnDriverApi(object):
"""IPSecVpnDriver RPC api."""
def __init__(self, topic):
target = oslo_messaging.Target(topic=topic, version='1.0')
self.client = n_rpc.get_client(target)
def get_vpn_services_on_host(self, context, host):
"""Get list of vpnservices.
The vpnservices including related ipsec_site_connection,
ikepolicy and ipsecpolicy on this host
"""
cctxt = self.client.prepare()
return cctxt.call(context, 'get_vpn_services_on_host', host=host)
def update_status(self, context, status):
"""Update local status.
This method call updates status attribute of
VPNServices.
"""
cctxt = self.client.prepare()
return cctxt.call(context, 'update_status', status=status)
@six.add_metaclass(abc.ABCMeta)
class NuageIPsecDriver(device_drivers.DeviceDriver):
def __init__(self, vpn_service, host):
self.conf = vpn_service.conf
self.host = host
self.conn = n_rpc.create_connection(new=True)
self.context = context.get_admin_context_without_session()
self.topic = topics.NUAGE_IPSEC_AGENT_TOPIC
self.processes = {}
self.routers = {}
self.process_status_cache = {}
self.endpoints = [self]
self.conn.create_consumer(self.topic, self.endpoints)
self.conn.consume_in_threads()
self.agent_rpc = NuageIPsecVpnDriverApi(
topics.NUAGE_IPSEC_DRIVER_TOPIC)
self.process_status_cache_check = loopingcall.FixedIntervalLoopingCall(
self.report_status, self.context)
self.process_status_cache_check.start(
interval=20)
self.nuage_if_driver = NuageInterfaceDriver(cfg.CONF)
def _get_l3_plugin(self):
return directory.get_plugin(constants.L3)
def get_namespace(self, router_id):
"""Get namespace of router.
:router_id: router_id
:returns: namespace string.
"""
return 'vpn-' + router_id
def vpnservice_updated(self, context, **kwargs):
"""Vpnservice updated rpc handler
VPN Service Driver will call this method
when vpnservices updated.
Then this method start sync with server.
"""
router = kwargs.get('router', None)
self.sync(context, [router] if router else [])
def tracking(self, context, **kwargs):
"""Handling create router event.
Agent calls this method, when the process namespace is ready.
Note: process_id == router_id == vpnservice_id
"""
router = kwargs.get('router', None)
process_id = router['id']
self.routers[process_id] = process_id
if process_id in self.processes:
# In case of vpnservice is created
# before vpn service namespace
process = self.processes[process_id]
process.enable()
def non_tracking(self, context, **kwargs):
router = kwargs.get('router', None)
process_id = router['id']
self.destroy_process(process_id)
if process_id in self.routers:
del self.routers[process_id]
def ensure_process(self, process_id, vpnservice=None):
"""Ensuring process.
If the process doesn't exist, it will create process
and store it in self.processs
"""
process = self.processes.get(process_id)
if not process or not process.namespace:
namespace = self.get_namespace(process_id)
process = self.create_process(
process_id,
vpnservice,
namespace)
self.processes[process_id] = process
elif vpnservice:
process.update_vpnservice(vpnservice)
return process
@lockutils.synchronized('vpn-agent', 'neutron-')
def sync(self, context, routers):
"""Sync status with server side.
:param context: context object for RPC call
:param routers: Router objects which is created in this sync event
There could be many failure cases should be
considered including the followings.
1) Agent class restarted
2) Failure on process creation
3) VpnService is deleted during agent down
4) RPC failure
In order to handle, these failure cases,
the driver needs to take sync strategies.
"""
vpnservices = self.agent_rpc.get_vpn_services_on_host(
context, self.host)
router_ids = [vpnservice['router_id'] for vpnservice in vpnservices]
sync_router_ids = [router['id'] for router in routers]
self._sync_vpn_processes(vpnservices, sync_router_ids)
self._delete_vpn_processes(sync_router_ids, router_ids)
self._cleanup_stale_vpn_processes(router_ids)
self.report_status(context)
def get_process_status_cache(self, process):
if not self.process_status_cache.get(process.id):
self.process_status_cache[process.id] = {
'status': None,
'id': process.vpnservice['id'],
'updated_pending_status': False,
'ipsec_site_connections': {}}
return self.process_status_cache[process.id]
def report_status(self, context):
status_changed_vpn_services = []
for process in self.processes.values():
previous_status = self.get_process_status_cache(process)
if self.is_status_updated(process, previous_status):
new_status = self.copy_process_status(process)
self.update_downed_connections(process.id, new_status)
status_changed_vpn_services.append(new_status)
self.process_status_cache[process.id] = (
self.copy_process_status(process))
# We need unset updated_pending status after it
# is reported to the server side
self.unset_updated_pending_status(process)
if status_changed_vpn_services:
self.agent_rpc.update_status(context,
status_changed_vpn_services)
def _sync_vpn_processes(self, vpnservices, sync_router_ids):
for vpnservice in vpnservices:
if vpnservice['router_id'] not in self.processes or (
vpnservice['router_id'] in sync_router_ids):
process = self.ensure_process(vpnservice['router_id'],
vpnservice=vpnservice)
router = self.routers.get(vpnservice['router_id'])
if not router:
continue
process.update()
def _delete_vpn_processes(self, sync_router_ids, vpn_router_ids):
for process_id in sync_router_ids:
if process_id not in vpn_router_ids:
self.destroy_process(process_id)
def _cleanup_stale_vpn_processes(self, vpn_router_ids):
process_ids = [pid for pid in self.processes
if pid not in vpn_router_ids]
for process_id in process_ids:
self.destroy_process(process_id)
def is_status_updated(self, process, previous_status):
if process.updated_pending_status:
return True
if process.status != previous_status['status']:
return True
if (process.connection_status !=
previous_status['ipsec_site_connections']):
return True
def unset_updated_pending_status(self, process):
process.updated_pending_status = False
for connection_status in process.connection_status.values():
connection_status['updated_pending_status'] = False
def copy_process_status(self, process):
return {
'id': process.vpnservice['id'],
'status': process.status,
'updated_pending_status': process.updated_pending_status,
'ipsec_site_connections': copy.deepcopy(process.connection_status)
}
def update_downed_connections(self, process_id, new_status):
"""Update info to be reported, if connections just went down.
If there is no longer any information for a connection, because it
has been removed (e.g. due to an admin down of VPN service or IPSec
connection), but there was previous status information for the
connection, mark the connection as down for reporting purposes.
"""
if process_id in self.process_status_cache:
for conn in self.process_status_cache[process_id][IPSEC_CONNS]:
if conn not in new_status[IPSEC_CONNS]:
new_status[IPSEC_CONNS][conn] = {
'status': constants.DOWN,
'updated_pending_status': True
}
def create_router(self, router):
"""Handling create router event."""
pass
def destroy_router(self, process_id):
pass
def destroy_process(self, process_id):
"""Destroy process.
Disable the process and remove the process
manager for the processes that no longer are running vpn service.
"""
if process_id in self.processes:
process = self.processes[process_id]
process.disable()
if process_id in self.processes:
del self.processes[process_id]
def plug_to_ovs(self, context, **kwargs):
self.nuage_if_driver.plug(kwargs['network_id'], kwargs['port_id'],
kwargs['device_name'], kwargs['mac'],
'alubr0', kwargs['ns_name'])
self.nuage_if_driver.init_l3(kwargs['device_name'], kwargs['cidr'],
kwargs['ns_name'])
device = ip_lib.IPDevice(kwargs['device_name'],
namespace=kwargs['ns_name'])
for gateway_ip in kwargs['gw_ip']:
device.route.add_gateway(gateway_ip)
def unplug_from_ovs(self, context, **kwargs):
self.nuage_if_driver.unplug(kwargs['device_name'], 'alubr0',
kwargs['ns_name'])
ip = ip_lib.IPWrapper(kwargs['ns_name'])
ip.garbage_collect_namespace()
# On Redhat deployments an additional directory is created named
# 'ip_vti0' in the namespace which prevents the cleanup
# of namespace by the neutron agent in 'ip_lib.py' which we clean.
if kwargs['ns_name'] in ip.get_namespaces():
ip.netns.delete(kwargs['ns_name'])
class NuageOpenSwanDriver(NuageIPsecDriver):
def create_process(self, process_id, vpnservice, namespace):
return ipsec.OpenSwanProcess(
self.conf,
process_id,
vpnservice,
namespace)
class NuageStrongSwanDriver(NuageIPsecDriver):
def create_process(self, process_id, vpnservice, namespace):
return strongswan_ipsec.StrongSwanProcess(
self.conf,
process_id,
vpnservice,
namespace)
class NuageStrongSwanDriverFedora(NuageIPsecDriver):
def create_process(self, process_id, vpnservice, namespace):
return fedora_strongswan_ipsec.FedoraStrongSwanProcess(
self.conf,
process_id,
vpnservice,
namespace)
| naveensan1/nuage-openstack-neutron | nuage_neutron/vpnaas/device_drivers/driver.py | Python | apache-2.0 | 12,933 |
package com.xyp.sapidoc.idoc.enumeration;
import java.util.HashSet;
import java.util.Set;
/**
*
* @author Yunpeng_Xu
*/
public enum TagEnum {
FIELDS("FIELDS"),
RECORD_SECTION("RECORD_SECTION"),
CONTROL_RECORD("CONTROL_RECORD"),
DATA_RECORD("DATA_RECORD"),
STATUS_RECORD("STATUS_RECORD"),
SEGMENT_SECTION("SEGMENT_SECTION"),
IDOC("IDOC"),
SEGMENT("SEGMENT"),
GROUP("GROUP"),
;
private String tag;
private TagEnum(String tag) {
this.tag = tag;
}
public String getTagBegin() {
return "BEGIN_" + tag;
}
public String getTagEnd() {
return "END_" + tag;
}
public static Set<String> getAllTags(){
Set<String> tags = new HashSet<String>();
TagEnum[] tagEnums = TagEnum.values();
for (TagEnum tagEnum : tagEnums) {
tags.add(tagEnum.getTagBegin());
tags.add(tagEnum.getTagEnd());
}
return tags;
}
}
| PeterXyp/sapidoc | src/main/java/com/xyp/sapidoc/idoc/enumeration/TagEnum.java | Java | apache-2.0 | 1,036 |
/*******************************************************************************
* Copyright 2016 Intuit
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
package com.intuit.wasabi.auditlogobjects;
import com.intuit.wasabi.eventlog.events.BucketCreateEvent;
import com.intuit.wasabi.eventlog.events.BucketEvent;
import com.intuit.wasabi.eventlog.events.ChangeEvent;
import com.intuit.wasabi.eventlog.events.EventLogEvent;
import com.intuit.wasabi.eventlog.events.ExperimentChangeEvent;
import com.intuit.wasabi.eventlog.events.ExperimentCreateEvent;
import com.intuit.wasabi.eventlog.events.ExperimentEvent;
import com.intuit.wasabi.eventlog.events.SimpleEvent;
import com.intuit.wasabi.experimentobjects.Bucket;
import com.intuit.wasabi.experimentobjects.Experiment;
import org.junit.Assert;
import org.junit.Test;
import org.mockito.Mockito;
import java.lang.reflect.Field;
/**
* Tests for {@link AuditLogEntryFactory}.
*/
public class AuditLogEntryFactoryTest {
@Test
public void testCreateFromEvent() throws Exception {
new AuditLogEntryFactory();
EventLogEvent[] events = new EventLogEvent[]{
new SimpleEvent("SimpleEvent"),
new ExperimentChangeEvent(Mockito.mock(Experiment.class), "Property", "before", "after"),
new ExperimentCreateEvent(Mockito.mock(Experiment.class)),
new BucketCreateEvent(Mockito.mock(Experiment.class), Mockito.mock(Bucket.class))
};
Field[] fields = AuditLogEntry.class.getFields();
for (Field field : fields) {
field.setAccessible(true);
}
for (EventLogEvent event : events) {
AuditLogEntry aleFactory = AuditLogEntryFactory.createFromEvent(event);
AuditLogEntry aleManual = new AuditLogEntry(
event.getTime(), event.getUser(), AuditLogAction.getActionForEvent(event),
event instanceof ExperimentEvent ? ((ExperimentEvent) event).getExperiment() : null,
event instanceof BucketEvent ? ((BucketEvent) event).getBucket().getLabel() : null,
event instanceof ChangeEvent ? ((ChangeEvent) event).getPropertyName() : null,
event instanceof ChangeEvent ? ((ChangeEvent) event).getBefore() : null,
event instanceof ChangeEvent ? ((ChangeEvent) event).getAfter() : null
);
for (Field field : fields) {
Assert.assertEquals(field.get(aleManual), field.get(aleFactory));
}
}
}
}
| intuit/wasabi | modules/auditlog-objects/src/test/java/com/intuit/wasabi/auditlogobjects/AuditLogEntryFactoryTest.java | Java | apache-2.0 | 3,157 |
package org.artifactory.ui.rest.service.admin.configuration.mail;
import org.artifactory.api.config.CentralConfigService;
import org.artifactory.descriptor.config.MutableCentralConfigDescriptor;
import org.artifactory.rest.common.service.ArtifactoryRestRequest;
import org.artifactory.rest.common.service.RestResponse;
import org.artifactory.rest.common.service.RestService;
import org.artifactory.ui.rest.model.admin.configuration.mail.MailServer;
import org.artifactory.ui.rest.service.utils.AolUtils;
import org.artifactory.util.HttpUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
/**
* @author Chen Keinan
*/
@Component
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
public class GetMailService implements RestService {
@Autowired
private CentralConfigService centralConfigService;
@Override
public void execute(ArtifactoryRestRequest request, RestResponse response) {
AolUtils.assertNotAol("GetMail");
String contextUrl = HttpUtils.getServletContextUrl(request.getServletRequest());
MailServer mailServer = getMailServerFromConfigDescriptor(contextUrl);
// update response with mail server model
response.iModel(mailServer);
}
/**
* get mail server from config descriptor and populate data to mail server model
*
* @return mail server model
* @param contextUrl
*/
private MailServer getMailServerFromConfigDescriptor(String contextUrl) {
MutableCentralConfigDescriptor configDescriptor = centralConfigService.getMutableDescriptor();
if (configDescriptor.getMailServer() != null) {
return new MailServer(configDescriptor.getMailServer());
} else {
MailServer mailServer = new MailServer();
mailServer.setArtifactoryUrl(contextUrl);
return mailServer;
}
}
}
| alancnet/artifactory | web/rest-ui/src/main/java/org/artifactory/ui/rest/service/admin/configuration/mail/GetMailService.java | Java | apache-2.0 | 2,025 |
from django.conf.urls import patterns, include, url
from django.contrib import admin
from api import views
admin.autodiscover()
from rest_framework.routers import DefaultRouter
router = DefaultRouter()
router.register(r'headings', views.HeadingViewSet)
router.register(r'users', views.UserViewSet)
urlpatterns = patterns('',
url(r'^', include(router.urls)),
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework'))
) | timokoola/okrest | okrest/okrest/urls.py | Python | apache-2.0 | 449 |
<!DOCTYPE html>
<html>
<head>
<title>OzzA - Apresentação do Layout</title>
<meta charset="utf-8" />
<meta lang="pt-BR" />
<meta name="description" content="OzzA - Apresentação do Layout" />
<meta name="keywords" content="OzzA - Apresentação do Layout" />
<meta name="author" content="Mais Interativo" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
</head>
<body>
<div class="editarperfil-loja-dadospessoais-hover">
<div class="clearfix"></div>
</div>
</body>
</html> | RuanBoaventura/ozza | editarperfil-loja-dadospessoais-hover.html | HTML | apache-2.0 | 566 |
/**
* Autogenerated by Thrift Compiler (0.9.3)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.hadoop.hive.metastore.api;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.server.AbstractNonblockingServer.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import javax.annotation.Generated;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
@org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public class WriteNotificationLogRequest implements org.apache.thrift.TBase<WriteNotificationLogRequest, WriteNotificationLogRequest._Fields>, java.io.Serializable, Cloneable, Comparable<WriteNotificationLogRequest> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("WriteNotificationLogRequest");
private static final org.apache.thrift.protocol.TField TXN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("txnId", org.apache.thrift.protocol.TType.I64, (short)1);
private static final org.apache.thrift.protocol.TField WRITE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("writeId", org.apache.thrift.protocol.TType.I64, (short)2);
private static final org.apache.thrift.protocol.TField DB_FIELD_DESC = new org.apache.thrift.protocol.TField("db", org.apache.thrift.protocol.TType.STRING, (short)3);
private static final org.apache.thrift.protocol.TField TABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("table", org.apache.thrift.protocol.TType.STRING, (short)4);
private static final org.apache.thrift.protocol.TField FILE_INFO_FIELD_DESC = new org.apache.thrift.protocol.TField("fileInfo", org.apache.thrift.protocol.TType.STRUCT, (short)5);
private static final org.apache.thrift.protocol.TField PARTITION_VALS_FIELD_DESC = new org.apache.thrift.protocol.TField("partitionVals", org.apache.thrift.protocol.TType.LIST, (short)6);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new WriteNotificationLogRequestStandardSchemeFactory());
schemes.put(TupleScheme.class, new WriteNotificationLogRequestTupleSchemeFactory());
}
private long txnId; // required
private long writeId; // required
private String db; // required
private String table; // required
private InsertEventRequestData fileInfo; // required
private List<String> partitionVals; // optional
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
TXN_ID((short)1, "txnId"),
WRITE_ID((short)2, "writeId"),
DB((short)3, "db"),
TABLE((short)4, "table"),
FILE_INFO((short)5, "fileInfo"),
PARTITION_VALS((short)6, "partitionVals");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // TXN_ID
return TXN_ID;
case 2: // WRITE_ID
return WRITE_ID;
case 3: // DB
return DB;
case 4: // TABLE
return TABLE;
case 5: // FILE_INFO
return FILE_INFO;
case 6: // PARTITION_VALS
return PARTITION_VALS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __TXNID_ISSET_ID = 0;
private static final int __WRITEID_ISSET_ID = 1;
private byte __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.PARTITION_VALS};
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.TXN_ID, new org.apache.thrift.meta_data.FieldMetaData("txnId", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.WRITE_ID, new org.apache.thrift.meta_data.FieldMetaData("writeId", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.DB, new org.apache.thrift.meta_data.FieldMetaData("db", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.TABLE, new org.apache.thrift.meta_data.FieldMetaData("table", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.FILE_INFO, new org.apache.thrift.meta_data.FieldMetaData("fileInfo", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InsertEventRequestData.class)));
tmpMap.put(_Fields.PARTITION_VALS, new org.apache.thrift.meta_data.FieldMetaData("partitionVals", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(WriteNotificationLogRequest.class, metaDataMap);
}
public WriteNotificationLogRequest() {
}
public WriteNotificationLogRequest(
long txnId,
long writeId,
String db,
String table,
InsertEventRequestData fileInfo)
{
this();
this.txnId = txnId;
setTxnIdIsSet(true);
this.writeId = writeId;
setWriteIdIsSet(true);
this.db = db;
this.table = table;
this.fileInfo = fileInfo;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public WriteNotificationLogRequest(WriteNotificationLogRequest other) {
__isset_bitfield = other.__isset_bitfield;
this.txnId = other.txnId;
this.writeId = other.writeId;
if (other.isSetDb()) {
this.db = other.db;
}
if (other.isSetTable()) {
this.table = other.table;
}
if (other.isSetFileInfo()) {
this.fileInfo = new InsertEventRequestData(other.fileInfo);
}
if (other.isSetPartitionVals()) {
List<String> __this__partitionVals = new ArrayList<String>(other.partitionVals);
this.partitionVals = __this__partitionVals;
}
}
public WriteNotificationLogRequest deepCopy() {
return new WriteNotificationLogRequest(this);
}
@Override
public void clear() {
setTxnIdIsSet(false);
this.txnId = 0;
setWriteIdIsSet(false);
this.writeId = 0;
this.db = null;
this.table = null;
this.fileInfo = null;
this.partitionVals = null;
}
public long getTxnId() {
return this.txnId;
}
public void setTxnId(long txnId) {
this.txnId = txnId;
setTxnIdIsSet(true);
}
public void unsetTxnId() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TXNID_ISSET_ID);
}
/** Returns true if field txnId is set (has been assigned a value) and false otherwise */
public boolean isSetTxnId() {
return EncodingUtils.testBit(__isset_bitfield, __TXNID_ISSET_ID);
}
public void setTxnIdIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TXNID_ISSET_ID, value);
}
public long getWriteId() {
return this.writeId;
}
public void setWriteId(long writeId) {
this.writeId = writeId;
setWriteIdIsSet(true);
}
public void unsetWriteId() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __WRITEID_ISSET_ID);
}
/** Returns true if field writeId is set (has been assigned a value) and false otherwise */
public boolean isSetWriteId() {
return EncodingUtils.testBit(__isset_bitfield, __WRITEID_ISSET_ID);
}
public void setWriteIdIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __WRITEID_ISSET_ID, value);
}
public String getDb() {
return this.db;
}
public void setDb(String db) {
this.db = db;
}
public void unsetDb() {
this.db = null;
}
/** Returns true if field db is set (has been assigned a value) and false otherwise */
public boolean isSetDb() {
return this.db != null;
}
public void setDbIsSet(boolean value) {
if (!value) {
this.db = null;
}
}
public String getTable() {
return this.table;
}
public void setTable(String table) {
this.table = table;
}
public void unsetTable() {
this.table = null;
}
/** Returns true if field table is set (has been assigned a value) and false otherwise */
public boolean isSetTable() {
return this.table != null;
}
public void setTableIsSet(boolean value) {
if (!value) {
this.table = null;
}
}
public InsertEventRequestData getFileInfo() {
return this.fileInfo;
}
public void setFileInfo(InsertEventRequestData fileInfo) {
this.fileInfo = fileInfo;
}
public void unsetFileInfo() {
this.fileInfo = null;
}
/** Returns true if field fileInfo is set (has been assigned a value) and false otherwise */
public boolean isSetFileInfo() {
return this.fileInfo != null;
}
public void setFileInfoIsSet(boolean value) {
if (!value) {
this.fileInfo = null;
}
}
public int getPartitionValsSize() {
return (this.partitionVals == null) ? 0 : this.partitionVals.size();
}
public java.util.Iterator<String> getPartitionValsIterator() {
return (this.partitionVals == null) ? null : this.partitionVals.iterator();
}
public void addToPartitionVals(String elem) {
if (this.partitionVals == null) {
this.partitionVals = new ArrayList<String>();
}
this.partitionVals.add(elem);
}
public List<String> getPartitionVals() {
return this.partitionVals;
}
public void setPartitionVals(List<String> partitionVals) {
this.partitionVals = partitionVals;
}
public void unsetPartitionVals() {
this.partitionVals = null;
}
/** Returns true if field partitionVals is set (has been assigned a value) and false otherwise */
public boolean isSetPartitionVals() {
return this.partitionVals != null;
}
public void setPartitionValsIsSet(boolean value) {
if (!value) {
this.partitionVals = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case TXN_ID:
if (value == null) {
unsetTxnId();
} else {
setTxnId((Long)value);
}
break;
case WRITE_ID:
if (value == null) {
unsetWriteId();
} else {
setWriteId((Long)value);
}
break;
case DB:
if (value == null) {
unsetDb();
} else {
setDb((String)value);
}
break;
case TABLE:
if (value == null) {
unsetTable();
} else {
setTable((String)value);
}
break;
case FILE_INFO:
if (value == null) {
unsetFileInfo();
} else {
setFileInfo((InsertEventRequestData)value);
}
break;
case PARTITION_VALS:
if (value == null) {
unsetPartitionVals();
} else {
setPartitionVals((List<String>)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case TXN_ID:
return getTxnId();
case WRITE_ID:
return getWriteId();
case DB:
return getDb();
case TABLE:
return getTable();
case FILE_INFO:
return getFileInfo();
case PARTITION_VALS:
return getPartitionVals();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case TXN_ID:
return isSetTxnId();
case WRITE_ID:
return isSetWriteId();
case DB:
return isSetDb();
case TABLE:
return isSetTable();
case FILE_INFO:
return isSetFileInfo();
case PARTITION_VALS:
return isSetPartitionVals();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof WriteNotificationLogRequest)
return this.equals((WriteNotificationLogRequest)that);
return false;
}
public boolean equals(WriteNotificationLogRequest that) {
if (that == null)
return false;
boolean this_present_txnId = true;
boolean that_present_txnId = true;
if (this_present_txnId || that_present_txnId) {
if (!(this_present_txnId && that_present_txnId))
return false;
if (this.txnId != that.txnId)
return false;
}
boolean this_present_writeId = true;
boolean that_present_writeId = true;
if (this_present_writeId || that_present_writeId) {
if (!(this_present_writeId && that_present_writeId))
return false;
if (this.writeId != that.writeId)
return false;
}
boolean this_present_db = true && this.isSetDb();
boolean that_present_db = true && that.isSetDb();
if (this_present_db || that_present_db) {
if (!(this_present_db && that_present_db))
return false;
if (!this.db.equals(that.db))
return false;
}
boolean this_present_table = true && this.isSetTable();
boolean that_present_table = true && that.isSetTable();
if (this_present_table || that_present_table) {
if (!(this_present_table && that_present_table))
return false;
if (!this.table.equals(that.table))
return false;
}
boolean this_present_fileInfo = true && this.isSetFileInfo();
boolean that_present_fileInfo = true && that.isSetFileInfo();
if (this_present_fileInfo || that_present_fileInfo) {
if (!(this_present_fileInfo && that_present_fileInfo))
return false;
if (!this.fileInfo.equals(that.fileInfo))
return false;
}
boolean this_present_partitionVals = true && this.isSetPartitionVals();
boolean that_present_partitionVals = true && that.isSetPartitionVals();
if (this_present_partitionVals || that_present_partitionVals) {
if (!(this_present_partitionVals && that_present_partitionVals))
return false;
if (!this.partitionVals.equals(that.partitionVals))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_txnId = true;
list.add(present_txnId);
if (present_txnId)
list.add(txnId);
boolean present_writeId = true;
list.add(present_writeId);
if (present_writeId)
list.add(writeId);
boolean present_db = true && (isSetDb());
list.add(present_db);
if (present_db)
list.add(db);
boolean present_table = true && (isSetTable());
list.add(present_table);
if (present_table)
list.add(table);
boolean present_fileInfo = true && (isSetFileInfo());
list.add(present_fileInfo);
if (present_fileInfo)
list.add(fileInfo);
boolean present_partitionVals = true && (isSetPartitionVals());
list.add(present_partitionVals);
if (present_partitionVals)
list.add(partitionVals);
return list.hashCode();
}
@Override
public int compareTo(WriteNotificationLogRequest other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetTxnId()).compareTo(other.isSetTxnId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetTxnId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.txnId, other.txnId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetWriteId()).compareTo(other.isSetWriteId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetWriteId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.writeId, other.writeId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetDb()).compareTo(other.isSetDb());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetDb()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.db, other.db);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetTable()).compareTo(other.isSetTable());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetTable()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table, other.table);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetFileInfo()).compareTo(other.isSetFileInfo());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetFileInfo()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fileInfo, other.fileInfo);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetPartitionVals()).compareTo(other.isSetPartitionVals());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetPartitionVals()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.partitionVals, other.partitionVals);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("WriteNotificationLogRequest(");
boolean first = true;
sb.append("txnId:");
sb.append(this.txnId);
first = false;
if (!first) sb.append(", ");
sb.append("writeId:");
sb.append(this.writeId);
first = false;
if (!first) sb.append(", ");
sb.append("db:");
if (this.db == null) {
sb.append("null");
} else {
sb.append(this.db);
}
first = false;
if (!first) sb.append(", ");
sb.append("table:");
if (this.table == null) {
sb.append("null");
} else {
sb.append(this.table);
}
first = false;
if (!first) sb.append(", ");
sb.append("fileInfo:");
if (this.fileInfo == null) {
sb.append("null");
} else {
sb.append(this.fileInfo);
}
first = false;
if (isSetPartitionVals()) {
if (!first) sb.append(", ");
sb.append("partitionVals:");
if (this.partitionVals == null) {
sb.append("null");
} else {
sb.append(this.partitionVals);
}
first = false;
}
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (!isSetTxnId()) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'txnId' is unset! Struct:" + toString());
}
if (!isSetWriteId()) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'writeId' is unset! Struct:" + toString());
}
if (!isSetDb()) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'db' is unset! Struct:" + toString());
}
if (!isSetTable()) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'table' is unset! Struct:" + toString());
}
if (!isSetFileInfo()) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'fileInfo' is unset! Struct:" + toString());
}
// check for sub-struct validity
if (fileInfo != null) {
fileInfo.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class WriteNotificationLogRequestStandardSchemeFactory implements SchemeFactory {
public WriteNotificationLogRequestStandardScheme getScheme() {
return new WriteNotificationLogRequestStandardScheme();
}
}
private static class WriteNotificationLogRequestStandardScheme extends StandardScheme<WriteNotificationLogRequest> {
public void read(org.apache.thrift.protocol.TProtocol iprot, WriteNotificationLogRequest struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // TXN_ID
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.txnId = iprot.readI64();
struct.setTxnIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // WRITE_ID
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.writeId = iprot.readI64();
struct.setWriteIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 3: // DB
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.db = iprot.readString();
struct.setDbIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 4: // TABLE
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.table = iprot.readString();
struct.setTableIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 5: // FILE_INFO
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.fileInfo = new InsertEventRequestData();
struct.fileInfo.read(iprot);
struct.setFileInfoIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 6: // PARTITION_VALS
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
org.apache.thrift.protocol.TList _list812 = iprot.readListBegin();
struct.partitionVals = new ArrayList<String>(_list812.size);
String _elem813;
for (int _i814 = 0; _i814 < _list812.size; ++_i814)
{
_elem813 = iprot.readString();
struct.partitionVals.add(_elem813);
}
iprot.readListEnd();
}
struct.setPartitionValsIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, WriteNotificationLogRequest struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldBegin(TXN_ID_FIELD_DESC);
oprot.writeI64(struct.txnId);
oprot.writeFieldEnd();
oprot.writeFieldBegin(WRITE_ID_FIELD_DESC);
oprot.writeI64(struct.writeId);
oprot.writeFieldEnd();
if (struct.db != null) {
oprot.writeFieldBegin(DB_FIELD_DESC);
oprot.writeString(struct.db);
oprot.writeFieldEnd();
}
if (struct.table != null) {
oprot.writeFieldBegin(TABLE_FIELD_DESC);
oprot.writeString(struct.table);
oprot.writeFieldEnd();
}
if (struct.fileInfo != null) {
oprot.writeFieldBegin(FILE_INFO_FIELD_DESC);
struct.fileInfo.write(oprot);
oprot.writeFieldEnd();
}
if (struct.partitionVals != null) {
if (struct.isSetPartitionVals()) {
oprot.writeFieldBegin(PARTITION_VALS_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.partitionVals.size()));
for (String _iter815 : struct.partitionVals)
{
oprot.writeString(_iter815);
}
oprot.writeListEnd();
}
oprot.writeFieldEnd();
}
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class WriteNotificationLogRequestTupleSchemeFactory implements SchemeFactory {
public WriteNotificationLogRequestTupleScheme getScheme() {
return new WriteNotificationLogRequestTupleScheme();
}
}
private static class WriteNotificationLogRequestTupleScheme extends TupleScheme<WriteNotificationLogRequest> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, WriteNotificationLogRequest struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
oprot.writeI64(struct.txnId);
oprot.writeI64(struct.writeId);
oprot.writeString(struct.db);
oprot.writeString(struct.table);
struct.fileInfo.write(oprot);
BitSet optionals = new BitSet();
if (struct.isSetPartitionVals()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetPartitionVals()) {
{
oprot.writeI32(struct.partitionVals.size());
for (String _iter816 : struct.partitionVals)
{
oprot.writeString(_iter816);
}
}
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, WriteNotificationLogRequest struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
struct.txnId = iprot.readI64();
struct.setTxnIdIsSet(true);
struct.writeId = iprot.readI64();
struct.setWriteIdIsSet(true);
struct.db = iprot.readString();
struct.setDbIsSet(true);
struct.table = iprot.readString();
struct.setTableIsSet(true);
struct.fileInfo = new InsertEventRequestData();
struct.fileInfo.read(iprot);
struct.setFileInfoIsSet(true);
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
{
org.apache.thrift.protocol.TList _list817 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
struct.partitionVals = new ArrayList<String>(_list817.size);
String _elem818;
for (int _i819 = 0; _i819 < _list817.size; ++_i819)
{
_elem818 = iprot.readString();
struct.partitionVals.add(_elem818);
}
}
struct.setPartitionValsIsSet(true);
}
}
}
}
| alanfgates/hive | standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WriteNotificationLogRequest.java | Java | apache-2.0 | 30,759 |
//
// Ingredient.cs
//
// Author:
// Benito Palacios <[email protected]>
//
// Copyright (c) 2015 Benito Palacios
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using System;
namespace Downlitor
{
public struct Ingredient
{
public Ingredient(string name, int quantity)
: this()
{
Name = name;
Quantity = quantity;
}
public Ingredient(int itemId, int quantity)
: this()
{
Name = ItemManager.Instance.GetItem(itemId);
Quantity = quantity;
}
public string Name {
get;
private set;
}
public int Quantity {
get;
private set;
}
public override string ToString()
{
return string.Format("{0} (x{1})", Name, Quantity);
}
}
}
| pleonex/Ninokuni | Programs/Downlitor/Downlitor/Ingredient.cs | C# | apache-2.0 | 1,310 |
/*
* Copyright (c) 2009, Rickard Öberg. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.qi4j.bootstrap;
/**
* Base class for assembly visitors. Subclass and override
* the particular methods you are interested in.
*/
public class AssemblyVisitorAdapter<ThrowableType extends Throwable>
implements AssemblyVisitor<ThrowableType>
{
public void visitApplication( ApplicationAssembly assembly )
throws ThrowableType
{
}
public void visitLayer( LayerAssembly assembly )
throws ThrowableType
{
}
public void visitModule( ModuleAssembly assembly )
throws ThrowableType
{
}
public void visitComposite( TransientDeclaration declaration )
throws ThrowableType
{
}
public void visitEntity( EntityDeclaration declaration )
throws ThrowableType
{
}
public void visitService( ServiceDeclaration declaration )
throws ThrowableType
{
}
public void visitImportedService( ImportedServiceDeclaration declaration )
throws ThrowableType
{
}
public void visitValue( ValueDeclaration declaration )
throws ThrowableType
{
}
public void visitObject( ObjectDeclaration declaration )
throws ThrowableType
{
}
}
| Qi4j/qi4j-core | bootstrap/src/main/java/org/qi4j/bootstrap/AssemblyVisitorAdapter.java | Java | apache-2.0 | 1,820 |
package com.ctrip.framework.cs.enterprise;
import com.ctrip.framework.cs.configuration.ConfigurationManager;
import com.ctrip.framework.cs.configuration.InitConfigurationException;
import com.ctrip.framework.cs.util.HttpUtil;
import com.ctrip.framework.cs.util.PomUtil;
import com.google.gson.Gson;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.net.HttpURLConnection;
import java.net.URL;
/**
* Created by jiang.j on 2016/10/20.
*/
public class NexusEnMaven implements EnMaven {
class NexusPomInfo{
String groupId;
String artifactId;
String version;
}
class RepoDetail{
String repositoryURL;
String repositoryKind;
}
class SearchResult{
RepoDetail[] repoDetails;
NexusPomInfo[] data;
}
class ResourceResult{
ResourceInfo[] data;
}
class ResourceInfo{
String text;
}
Logger logger = LoggerFactory.getLogger(getClass());
private InputStream getContentByName(String[] av,String fileName) throws InitConfigurationException {
InputStream rtn = null;
String endsWith = ".pom";
if(av == null && fileName == null){
return null;
}else if(av==null) {
endsWith = "-sources.jar";
av = PomUtil.getArtifactIdAndVersion(fileName);
}
if(av == null){
return null;
}
String searchUrl = (ConfigurationManager.getConfigInstance().getString("vi.maven.repository.url") +
"/nexus/service/local/lucene/search?a=" + av[0] + "&v=" + av[1]);
if(av.length >2){
searchUrl += "&g="+av[2];
}
logger.debug(searchUrl);
try {
URL url = new URL(searchUrl);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setConnectTimeout(200);
conn.setReadTimeout(500);
conn.setRequestMethod("GET");
conn.setRequestProperty("Content-Type", "application/json; charset=UTF-8");
conn.setRequestProperty("Accept", "application/json");
try (Reader rd = new InputStreamReader(conn.getInputStream(), "UTF-8")) {
Gson gson = new Gson();
SearchResult results = gson.fromJson(rd, SearchResult.class);
if(results.repoDetails!=null && results.data !=null && results.repoDetails.length>0 && results.data.length>0){
NexusPomInfo pomInfo = results.data[0];
String repositoryUrl = null;
if(results.repoDetails.length>1){
for(RepoDetail repoDetail:results.repoDetails){
if("hosted".equalsIgnoreCase(repoDetail.repositoryKind)){
repositoryUrl = repoDetail.repositoryURL;
break;
}
}
}
if(repositoryUrl == null)
{
repositoryUrl = results.repoDetails[0].repositoryURL;
}
String pomUrl = repositoryUrl +"/content/"+pomInfo.groupId.replace(".","/")+"/"+pomInfo.artifactId+"/"
+pomInfo.version+"/";
if(fileName == null){
ResourceResult resourceResult = HttpUtil.doGet(new URL(pomUrl), ResourceResult.class);
for(ResourceInfo rinfo:resourceResult.data){
if(rinfo.text.endsWith(endsWith) && (
fileName == null || fileName.compareTo(rinfo.text)>0)){
fileName = rinfo.text;
}
}
pomUrl += fileName;
}else {
pomUrl += fileName + endsWith;
}
logger.debug(pomUrl);
HttpURLConnection pomConn = (HttpURLConnection) new URL(pomUrl).openConnection();
pomConn.setRequestMethod("GET");
rtn = pomConn.getInputStream();
}
}
}catch (Throwable e){
logger.warn("get pominfo by jar name["+av[0] + ' '+av[1]+"] failed",e);
}
return rtn;
}
@Override
public InputStream getPomInfoByFileName(String[] av, String fileName) {
try {
return getContentByName(av, fileName);
}catch (Throwable e){
logger.warn("getPomInfoByFileName failed!",e);
return null;
}
}
@Override
public InputStream getSourceJarByFileName(String fileName) {
try {
return getContentByName(null,fileName);
}catch (Throwable e){
logger.warn("getPomInfoByFileName failed!",e);
return null;
}
}
}
| ctripcorp/cornerstone | cornerstone/src/main/java/com/ctrip/framework/cs/enterprise/NexusEnMaven.java | Java | apache-2.0 | 5,024 |
<div class="navbar-default sidebar" role="navigation">
<div class="sidebar-nav navbar-collapse collapse">
<ul class="nav in" id="side-menu">
<!--<sidebar-search></sidebar-search>-->
<li>
<a href="" style="border:none; text-align:left;" class="btn btn-default" ng-click="showAbout=!showAbout"><i class="fa fa-question-circle"></i> Help</a>
</li>
<li>
<a ui-sref="main.dashboard" ui-sref-active-if="main.dashboard"> Dashboard</a>
</li>
<li id="Explore" ng-class="{active: Explore}">
<a href="" ng-click="Explore=!Explore">
<!--<i class="fa fa-sitemap fa-fw"></i> -->
Explore<span class="fa arrow"></span></a>
<ul class="nav nav-second-level" uib-collapse="!Explore">
<li>
<a ui-sref="main.explore" ui-sref-active-if="main.explore"> Explore risks </a>
</li>
<li>
<a target="_blank" href="http://www.pubmed.gov"> Search PubMed </a>
</li>
<!--<li>-->
<!-- <a ui-sref="main.mineLiterature" ui-sref-active-if="main.mineLiterature"> Mine literature </a>-->
<!--</li>-->
</ul>
</li>
<li id="carreElements" ng-class="{active: carreElements}">
<a href="" ng-click="carreElements=!carreElements">
<!--<i class="fa fa-sitemap fa-fw"></i> -->
CARRE elements<span class="fa arrow"></span></a>
<ul class="nav nav-second-level" uib-collapse="!carreElements">
<li>
<a ui-sref="main.risk_factors.list" ui-sref-active-if="main.risk_factors"> Risk Factors </a>
</li>
<li>
<a ui-sref="main.risk_evidences.list" ui-sref-active-if="main.risk_evidences"> Risk Evidences </a>
</li>
<li>
<a ui-sref="main.risk_elements.list" ui-sref-active-if="main.risk_elements"> Risk Elements </a>
</li>
<li>
<a ui-sref="main.observables.list" ui-sref-active-if="main.observables"> Observables </a>
</li>
<li>
<a ui-sref="main.citations.list" ui-sref-active-if="main.citations"> Citations </a>
</li>
<li>
<a ui-sref="main.measurement_types.list" ui-sref-active-if="main.measurement_types"> Measurement Types </a>
</li>
</ul>
</li>
<li>
<a ui-sref="main.medical_experts.list" ui-sref-active-if="main.medical_experts"> Medical experts </a>
</li>
</ul>
</div>
<!-- /.sidebar-collapse -->
<div pageslide ps-size="{{slideWidth}}px" ps-open="showAbout" ps-side="right">
<div class="row" style="padding:30px; padding-top:15px; padding-bottom:0; margin-bottom:0;">
<a href="" ng-click="showAbout=!showAbout" class="btn btn-primary pull-left"><i class="fa fa-times fa-lg"></i></a>
</div>
<div class="row" style="padding:50px; margin-top:0; padding-top:0; overflow: auto; height: 90%;">
<div autoscroll ng-include src="'app/about/about.html'"></div>
</div>
</div>
</div>
| carre-project/carre-entry-system | src/app/components/sidebar/sidebar.html | HTML | apache-2.0 | 3,575 |
#
# Copyright 2013 Quantopian, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import functools
import logbook
import math
import numpy as np
import numpy.linalg as la
from six import iteritems
from zipline.finance import trading
import pandas as pd
from . import risk
from . risk import (
alpha,
check_entry,
information_ratio,
sharpe_ratio,
sortino_ratio,
)
log = logbook.Logger('Risk Period')
choose_treasury = functools.partial(risk.choose_treasury,
risk.select_treasury_duration)
class RiskMetricsPeriod(object):
def __init__(self, start_date, end_date, returns,
benchmark_returns=None):
treasury_curves = trading.environment.treasury_curves
if treasury_curves.index[-1] >= start_date:
mask = ((treasury_curves.index >= start_date) &
(treasury_curves.index <= end_date))
self.treasury_curves = treasury_curves[mask]
else:
# our test is beyond the treasury curve history
# so we'll use the last available treasury curve
self.treasury_curves = treasury_curves[-1:]
self.start_date = start_date
self.end_date = end_date
if benchmark_returns is None:
br = trading.environment.benchmark_returns
benchmark_returns = br[(br.index >= returns.index[0]) &
(br.index <= returns.index[-1])]
self.algorithm_returns = self.mask_returns_to_period(returns)
self.benchmark_returns = self.mask_returns_to_period(benchmark_returns)
self.calculate_metrics()
def calculate_metrics(self):
self.benchmark_period_returns = \
self.calculate_period_returns(self.benchmark_returns)
self.algorithm_period_returns = \
self.calculate_period_returns(self.algorithm_returns)
if not self.algorithm_returns.index.equals(
self.benchmark_returns.index
):
message = "Mismatch between benchmark_returns ({bm_count}) and \
algorithm_returns ({algo_count}) in range {start} : {end}"
message = message.format(
bm_count=len(self.benchmark_returns),
algo_count=len(self.algorithm_returns),
start=self.start_date,
end=self.end_date
)
raise Exception(message)
self.num_trading_days = len(self.benchmark_returns)
self.benchmark_volatility = self.calculate_volatility(
self.benchmark_returns)
self.algorithm_volatility = self.calculate_volatility(
self.algorithm_returns)
self.treasury_period_return = choose_treasury(
self.treasury_curves,
self.start_date,
self.end_date
)
self.sharpe = self.calculate_sharpe()
self.sortino = self.calculate_sortino()
self.information = self.calculate_information()
self.beta, self.algorithm_covariance, self.benchmark_variance, \
self.condition_number, self.eigen_values = self.calculate_beta()
self.alpha = self.calculate_alpha()
self.excess_return = self.algorithm_period_returns - \
self.treasury_period_return
self.max_drawdown = self.calculate_max_drawdown()
def to_dict(self):
"""
Creates a dictionary representing the state of the risk report.
Returns a dict object of the form:
"""
period_label = self.end_date.strftime("%Y-%m")
rval = {
'trading_days': self.num_trading_days,
'benchmark_volatility': self.benchmark_volatility,
'algo_volatility': self.algorithm_volatility,
'treasury_period_return': self.treasury_period_return,
'algorithm_period_return': self.algorithm_period_returns,
'benchmark_period_return': self.benchmark_period_returns,
'sharpe': self.sharpe,
'sortino': self.sortino,
'information': self.information,
'beta': self.beta,
'alpha': self.alpha,
'excess_return': self.excess_return,
'max_drawdown': self.max_drawdown,
'period_label': period_label
}
return {k: None if check_entry(k, v) else v
for k, v in iteritems(rval)}
def __repr__(self):
statements = []
metrics = [
"algorithm_period_returns",
"benchmark_period_returns",
"excess_return",
"num_trading_days",
"benchmark_volatility",
"algorithm_volatility",
"sharpe",
"sortino",
"information",
"algorithm_covariance",
"benchmark_variance",
"beta",
"alpha",
"max_drawdown",
"algorithm_returns",
"benchmark_returns",
"condition_number",
"eigen_values"
]
for metric in metrics:
value = getattr(self, metric)
statements.append("{m}:{v}".format(m=metric, v=value))
return '\n'.join(statements)
def mask_returns_to_period(self, daily_returns):
if isinstance(daily_returns, list):
returns = pd.Series([x.returns for x in daily_returns],
index=[x.date for x in daily_returns])
else: # otherwise we're receiving an index already
returns = daily_returns
trade_days = trading.environment.trading_days
trade_day_mask = returns.index.normalize().isin(trade_days)
mask = ((returns.index >= self.start_date) &
(returns.index <= self.end_date) & trade_day_mask)
returns = returns[mask]
return returns
def calculate_period_returns(self, returns):
period_returns = (1. + returns).prod() - 1
return period_returns
def calculate_volatility(self, daily_returns):
return np.std(daily_returns, ddof=1) * math.sqrt(self.num_trading_days)
def calculate_sharpe(self):
"""
http://en.wikipedia.org/wiki/Sharpe_ratio
"""
return sharpe_ratio(self.algorithm_volatility,
self.algorithm_period_returns,
self.treasury_period_return)
def calculate_sortino(self, mar=None):
"""
http://en.wikipedia.org/wiki/Sortino_ratio
"""
if mar is None:
mar = self.treasury_period_return
return sortino_ratio(self.algorithm_returns,
self.algorithm_period_returns,
mar)
def calculate_information(self):
"""
http://en.wikipedia.org/wiki/Information_ratio
"""
return information_ratio(self.algorithm_returns,
self.benchmark_returns)
def calculate_beta(self):
"""
.. math::
\\beta_a = \\frac{\mathrm{Cov}(r_a,r_p)}{\mathrm{Var}(r_p)}
http://en.wikipedia.org/wiki/Beta_(finance)
"""
# it doesn't make much sense to calculate beta for less than two days,
# so return none.
if len(self.algorithm_returns) < 2:
return 0.0, 0.0, 0.0, 0.0, []
returns_matrix = np.vstack([self.algorithm_returns,
self.benchmark_returns])
C = np.cov(returns_matrix, ddof=1)
eigen_values = la.eigvals(C)
condition_number = max(eigen_values) / min(eigen_values)
algorithm_covariance = C[0][1]
benchmark_variance = C[1][1]
beta = algorithm_covariance / benchmark_variance
return (
beta,
algorithm_covariance,
benchmark_variance,
condition_number,
eigen_values
)
def calculate_alpha(self):
"""
http://en.wikipedia.org/wiki/Alpha_(investment)
"""
return alpha(self.algorithm_period_returns,
self.treasury_period_return,
self.benchmark_period_returns,
self.beta)
def calculate_max_drawdown(self):
compounded_returns = []
cur_return = 0.0
for r in self.algorithm_returns:
try:
cur_return += math.log(1.0 + r)
# this is a guard for a single day returning -100%
except ValueError:
log.debug("{cur} return, zeroing the returns".format(
cur=cur_return))
cur_return = 0.0
# BUG? Shouldn't this be set to log(1.0 + 0) ?
compounded_returns.append(cur_return)
cur_max = None
max_drawdown = None
for cur in compounded_returns:
if cur_max is None or cur > cur_max:
cur_max = cur
drawdown = (cur - cur_max)
if max_drawdown is None or drawdown < max_drawdown:
max_drawdown = drawdown
if max_drawdown is None:
return 0.0
return 1.0 - math.exp(max_drawdown)
| lsbardel/zipline | zipline/finance/risk/period.py | Python | apache-2.0 | 9,654 |
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
/*
* This code was generated by https://github.com/googleapis/google-api-java-client-services/
* Modify at your own risk.
*/
package com.google.api.services.speech.v1.model;
/**
* Word-specific information for recognized words.
*
* <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is
* transmitted over HTTP when working with the Cloud Speech-to-Text API. For a detailed explanation
* see:
* <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a>
* </p>
*
* @author Google, Inc.
*/
@SuppressWarnings("javadoc")
public final class WordInfo extends com.google.api.client.json.GenericJson {
/**
* The confidence estimate between 0.0 and 1.0. A higher number indicates an estimated greater
* likelihood that the recognized words are correct. This field is set only for the top
* alternative of a non-streaming result or, of a streaming result where `is_final=true`. This
* field is not guaranteed to be accurate and users should not rely on it to be always provided.
* The default of 0.0 is a sentinel value indicating `confidence` was not set.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.Float confidence;
/**
* Time offset relative to the beginning of the audio, and corresponding to the end of the spoken
* word. This field is only set if `enable_word_time_offsets=true` and only in the top hypothesis.
* This is an experimental feature and the accuracy of the time offset can vary.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private String endTime;
/**
* Output only. A distinct integer value is assigned for every speaker within the audio. This
* field specifies which one of those speakers was detected to have spoken this word. Value ranges
* from '1' to diarization_speaker_count. speaker_tag is set if enable_speaker_diarization =
* 'true' and only in the top alternative.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.Integer speakerTag;
/**
* Time offset relative to the beginning of the audio, and corresponding to the start of the
* spoken word. This field is only set if `enable_word_time_offsets=true` and only in the top
* hypothesis. This is an experimental feature and the accuracy of the time offset can vary.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private String startTime;
/**
* The word corresponding to this set of information.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String word;
/**
* The confidence estimate between 0.0 and 1.0. A higher number indicates an estimated greater
* likelihood that the recognized words are correct. This field is set only for the top
* alternative of a non-streaming result or, of a streaming result where `is_final=true`. This
* field is not guaranteed to be accurate and users should not rely on it to be always provided.
* The default of 0.0 is a sentinel value indicating `confidence` was not set.
* @return value or {@code null} for none
*/
public java.lang.Float getConfidence() {
return confidence;
}
/**
* The confidence estimate between 0.0 and 1.0. A higher number indicates an estimated greater
* likelihood that the recognized words are correct. This field is set only for the top
* alternative of a non-streaming result or, of a streaming result where `is_final=true`. This
* field is not guaranteed to be accurate and users should not rely on it to be always provided.
* The default of 0.0 is a sentinel value indicating `confidence` was not set.
* @param confidence confidence or {@code null} for none
*/
public WordInfo setConfidence(java.lang.Float confidence) {
this.confidence = confidence;
return this;
}
/**
* Time offset relative to the beginning of the audio, and corresponding to the end of the spoken
* word. This field is only set if `enable_word_time_offsets=true` and only in the top hypothesis.
* This is an experimental feature and the accuracy of the time offset can vary.
* @return value or {@code null} for none
*/
public String getEndTime() {
return endTime;
}
/**
* Time offset relative to the beginning of the audio, and corresponding to the end of the spoken
* word. This field is only set if `enable_word_time_offsets=true` and only in the top hypothesis.
* This is an experimental feature and the accuracy of the time offset can vary.
* @param endTime endTime or {@code null} for none
*/
public WordInfo setEndTime(String endTime) {
this.endTime = endTime;
return this;
}
/**
* Output only. A distinct integer value is assigned for every speaker within the audio. This
* field specifies which one of those speakers was detected to have spoken this word. Value ranges
* from '1' to diarization_speaker_count. speaker_tag is set if enable_speaker_diarization =
* 'true' and only in the top alternative.
* @return value or {@code null} for none
*/
public java.lang.Integer getSpeakerTag() {
return speakerTag;
}
/**
* Output only. A distinct integer value is assigned for every speaker within the audio. This
* field specifies which one of those speakers was detected to have spoken this word. Value ranges
* from '1' to diarization_speaker_count. speaker_tag is set if enable_speaker_diarization =
* 'true' and only in the top alternative.
* @param speakerTag speakerTag or {@code null} for none
*/
public WordInfo setSpeakerTag(java.lang.Integer speakerTag) {
this.speakerTag = speakerTag;
return this;
}
/**
* Time offset relative to the beginning of the audio, and corresponding to the start of the
* spoken word. This field is only set if `enable_word_time_offsets=true` and only in the top
* hypothesis. This is an experimental feature and the accuracy of the time offset can vary.
* @return value or {@code null} for none
*/
public String getStartTime() {
return startTime;
}
/**
* Time offset relative to the beginning of the audio, and corresponding to the start of the
* spoken word. This field is only set if `enable_word_time_offsets=true` and only in the top
* hypothesis. This is an experimental feature and the accuracy of the time offset can vary.
* @param startTime startTime or {@code null} for none
*/
public WordInfo setStartTime(String startTime) {
this.startTime = startTime;
return this;
}
/**
* The word corresponding to this set of information.
* @return value or {@code null} for none
*/
public java.lang.String getWord() {
return word;
}
/**
* The word corresponding to this set of information.
* @param word word or {@code null} for none
*/
public WordInfo setWord(java.lang.String word) {
this.word = word;
return this;
}
@Override
public WordInfo set(String fieldName, Object value) {
return (WordInfo) super.set(fieldName, value);
}
@Override
public WordInfo clone() {
return (WordInfo) super.clone();
}
}
| googleapis/google-api-java-client-services | clients/google-api-services-speech/v1/1.31.0/com/google/api/services/speech/v1/model/WordInfo.java | Java | apache-2.0 | 7,866 |
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2009-2012 by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*
* WARNING: This is generated code. Modify at your own risk and without support.
*/
#import "TiProxy.h"
#import "TiAnimation.h"
#import "TiGradient.h"
#import "LayoutConstraint.h"
//By declaring a scrollView protocol, TiUITextWidget can access
@class TiUIView;
/**
The protocol for scrolling.
*/
@protocol TiScrolling
/**
Tells the scroll view that keyboard did show.
@param keyboardTop The keyboard height.
*/
-(void)keyboardDidShowAtHeight:(CGFloat)keyboardTop;
/**
Tells the scroll view to scroll to make the specified view visible.
@param firstResponderView The view to make visible.
@param keyboardTop The keyboard height.
*/
-(void)scrollToShowView:(TiUIView *)firstResponderView withKeyboardHeight:(CGFloat)keyboardTop;
@end
void InsetScrollViewForKeyboard(UIScrollView * scrollView,CGFloat keyboardTop,CGFloat minimumContentHeight);
void OffsetScrollViewForRect(UIScrollView * scrollView,CGFloat keyboardTop,CGFloat minimumContentHeight,CGRect responderRect);
void ModifyScrollViewForKeyboardHeightAndContentHeightWithResponderRect(UIScrollView * scrollView,CGFloat keyboardTop,CGFloat minimumContentHeight,CGRect responderRect);
@class TiViewProxy;
/**
Base class for all Symble views.
@see TiViewProxy
*/
@interface TiUIView : UIView<TiProxyDelegate,LayoutAutosizing>
{
@protected
BOOL configurationSet;
@private
TiProxy *proxy;
TiAnimation *animation;
CALayer *gradientLayer;
CGAffineTransform virtualParentTransform;
id transformMatrix;
BOOL childrenInitialized;
BOOL touchEnabled;
unsigned int animationDelayGuard;
// Touch detection
BOOL changedInteraction;
BOOL handlesTouches;
UIView *touchDelegate; // used for touch delegate forwarding
BOOL animating;
UITapGestureRecognizer* singleTapRecognizer;
UITapGestureRecognizer* doubleTapRecognizer;
UITapGestureRecognizer* twoFingerTapRecognizer;
UIPinchGestureRecognizer* pinchRecognizer;
UISwipeGestureRecognizer* leftSwipeRecognizer;
UISwipeGestureRecognizer* rightSwipeRecognizer;
UISwipeGestureRecognizer* upSwipeRecognizer;
UISwipeGestureRecognizer* downSwipeRecognizer;
UILongPressGestureRecognizer* longPressRecognizer;
//Resizing handling
CGSize oldSize;
// Image capping/backgrounds
id backgroundImage;
BOOL backgroundRepeat;
TiDimension leftCap;
TiDimension topCap;
}
/**
Returns current status of the view animation.
@return _YES_ if view is being animated, _NO_ otherwise.
*/
-(BOOL)animating;
/**
Provides access to a proxy object of the view.
*/
@property(nonatomic,readwrite,assign) TiProxy *proxy;
/**
Provides access to touch delegate of the view.
Touch delegate is the control that receives all touch events.
*/
@property(nonatomic,readwrite,assign) UIView *touchDelegate;
/**
Returns view's transformation matrix.
*/
@property(nonatomic,readonly) id transformMatrix;
/**
Provides access to background image of the view.
*/
@property(nonatomic,readwrite,retain) id backgroundImage;
/**
Returns enablement of touch events.
@see updateTouchHandling
*/
@property(nonatomic,readonly) BOOL touchEnabled;
@property(nonatomic,readonly) UITapGestureRecognizer* singleTapRecognizer;
@property(nonatomic,readonly) UITapGestureRecognizer* doubleTapRecognizer;
@property(nonatomic,readonly) UITapGestureRecognizer* twoFingerTapRecognizer;
@property(nonatomic,readonly) UIPinchGestureRecognizer* pinchRecognizer;
@property(nonatomic,readonly) UISwipeGestureRecognizer* leftSwipeRecognizer;
@property(nonatomic,readonly) UISwipeGestureRecognizer* rightSwipeRecognizer;
@property(nonatomic,readonly) UILongPressGestureRecognizer* longPressRecognizer;
-(void)configureGestureRecognizer:(UIGestureRecognizer*)gestureRecognizer;
- (UIGestureRecognizer *)gestureRecognizerForEvent:(NSString *)event;
/**
Returns CA layer for the background of the view.
*/
-(CALayer *)backgroundImageLayer;
/**
Tells the view to start specified animation.
@param newAnimation The animation to start.
*/
-(void)animate:(TiAnimation *)newAnimation;
#pragma mark Framework
/**
Performs view's initialization procedure.
*/
-(void)initializeState;
/**
Performs view's configuration procedure.
*/
-(void)configurationSet;
/**
Sets virtual parent transformation for the view.
@param newTransform The transformation to set.
*/
-(void)setVirtualParentTransform:(CGAffineTransform)newTransform;
-(void)setTransform_:(id)matrix;
/*
Tells the view to load an image.
@param image The string referring the image.
@return The loaded image.
*/
-(UIImage*)loadImage:(id)image;
-(id)proxyValueForKey:(NSString *)key;
-(void)readProxyValuesWithKeys:(id<NSFastEnumeration>)keys;
/*
Tells the view to change its proxy to the new one provided.
@param newProxy The new proxy to set on the view.
*/
-(void)transferProxy:(TiViewProxy*)newProxy;
/**
Tells the view to update its touch handling state.
@see touchEnabled
*/
-(void)updateTouchHandling;
/**
Tells the view that its frame and/or bounds has chnaged.
@param frame The frame rect
@param bounds The bounds rect
*/
-(void)frameSizeChanged:(CGRect)frame bounds:(CGRect)bounds;
/**
Tells the view to make its root view a first responder.
*/
-(void)makeRootViewFirstResponder;
-(void)animationCompleted;
/**
The convenience method to raise an exception for the view.
@param reason The exception reason.
@param subreason The exception subreason.
@param location The exception location.
*/
+(void)throwException:(NSString *) reason subreason:(NSString*)subreason location:(NSString *)location;
-(void)throwException:(NSString *) reason subreason:(NSString*)subreason location:(NSString *)location;
/**
Returns default enablement for interactions.
Subclasses may override.
@return _YES_ if the control has interactions enabled by default, _NO_ otherwise.
*/
-(BOOL)interactionDefault;
-(BOOL)interactionEnabled;
/**
Whether or not the view has any touchable listeners attached.
@return _YES_ if the control has any touchable listener attached, _NO_ otherwise.
*/
-(BOOL)hasTouchableListener;
-(void)handleControlEvents:(UIControlEvents)events;
-(void)setVisible_:(id)visible;
-(UIView *)gradientWrapperView;
-(void)checkBounds;
/**
Whether or not a view not normally picked up by the Symble view hierarchy (such as wrapped iOS UIViews) was touched.
@return _YES_ if the view contains specialized content (such as a system view) which should register as a touch for this view, _NO_ otherwise.
*/
-(BOOL)touchedContentViewWithEvent:(UIEvent*)event;
- (void)processTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)processTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)processTouchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)processTouchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event;
@end
#pragma mark TO REMOVE, used only during transition.
#define USE_PROXY_FOR_METHOD(resultType,methodname,inputType) \
-(resultType)methodname:(inputType)value \
{ \
DeveloperLog(@"[DEBUG] Using view proxy via redirection instead of directly for %@.",self); \
return [(TiViewProxy *)[self proxy] methodname:value]; \
}
#define USE_PROXY_FOR_VERIFY_AUTORESIZING USE_PROXY_FOR_METHOD(UIViewAutoresizing,verifyAutoresizing,UIViewAutoresizing)
| irosenb/symble-app | build/iphone/Classes/TiUIView.h | C | apache-2.0 | 7,509 |
<!doctype html>
<html class="theme-next use-motion ">
<head>
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link href="/vendors/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css"/>
<link href="//fonts.googleapis.com/css?family=Lato:300,400,700,400italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
<link href="/vendors/font-awesome/css/font-awesome.min.css?v=4.4.0" rel="stylesheet" type="text/css" />
<link href="/css/main.css?v=0.4.5.2" rel="stylesheet" type="text/css" />
<meta name="keywords" content="Hexo, NexT" />
<link rel="alternate" href="http://AfirSraftGarrier.github.io/atom.xml" title="酷我酷" type="application/atom+xml" />
<link rel="shortcut icon" type="image/x-icon" href="/images/favicon.png?v=0.4.5.2" />
<meta name="description" content="分享即帮助">
<meta property="og:type" content="website">
<meta property="og:title" content="酷我酷">
<meta property="og:url" content="http://www.kuwoku.com/tags/CDN/index.html">
<meta property="og:site_name" content="酷我酷">
<meta property="og:description" content="分享即帮助">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="酷我酷">
<meta name="twitter:description" content="分享即帮助">
<script type="text/javascript" id="hexo.configuration">
var CONFIG = {
scheme: '',
sidebar: 'post',
motion: true
};
</script>
<title> 标签: CDN | 酷我酷 </title>
</head>
<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">
<!--[if lte IE 8]>
<div style=' clear: both; height: 59px; padding:0 0 0 15px; position: relative;margin:0 auto;'>
<a href="http://windows.microsoft.com/en-US/internet-explorer/products/ie/home?ocid=ie6_countdown_bannercode">
<img src="http://7u2nvr.com1.z0.glb.clouddn.com/picouterie.jpg" border="0" height="42" width="820"
alt="You are using an outdated browser. For a faster, safer browsing experience, upgrade for free today or use other browser ,like chrome firefox safari."
style='margin-left:auto;margin-right:auto;display: block;'/>
</a>
</div>
<![endif]-->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-57622011-1', 'auto');
ga('send', 'pageview');
</script>
<script type="text/javascript">
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?227bdbffbd87a1ca50e432dcc6b0960e";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<div class="container one-column ">
<div class="headband"></div>
<header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
<div class="header-inner"><div class="site-meta ">
<div class="custom-logo-site-title">
<a href="/" class="brand" rel="start">
<span class="logo-line-before"><i></i></span>
<span class="site-title">酷我酷</span>
<span class="logo-line-after"><i></i></span>
</a>
</div>
<p class="site-subtitle" style="border-bottom:none;cursor:pointer" onclick='javascript:(function() {
function c() {
var e = document.createElement("link");
e.setAttribute("type", "text/css");
e.setAttribute("rel", "stylesheet");
e.setAttribute("href", f);
e.setAttribute("class", l);
document.body.appendChild(e)
}
function h() {
var e = document.getElementsByClassName(l);
for (var t = 0; t < e.length; t++) {
document.body.removeChild(e[t])
}
}
function p() {
var e = document.createElement("div");
e.setAttribute("class", a);
document.body.appendChild(e);
setTimeout(function() {
document.body.removeChild(e)
}, 100)
}
function d(e) {
return {
height : e.offsetHeight,
width : e.offsetWidth
}
}
function v(i) {
var s = d(i);
return s.height > e && s.height < n && s.width > t && s.width < r
}
function m(e) {
var t = e;
var n = 0;
while (!!t) {
n += t.offsetTop;
t = t.offsetParent
}
return n
}
function g() {
var e = document.documentElement;
if (!!window.innerWidth) {
return window.innerHeight
} else if (e && !isNaN(e.clientHeight)) {
return e.clientHeight
}
return 0
}
function y() {
if (window.pageYOffset) {
return window.pageYOffset
}
return Math.max(document.documentElement.scrollTop, document.body.scrollTop)
}
function E(e) {
var t = m(e);
return t >= w && t <= b + w
}
function S() {
var e = document.createElement("audio");
e.setAttribute("class", l);
e.src = i;
e.loop = false;
e.addEventListener("canplay", function() {
setTimeout(function() {
x(k)
}, 500);
setTimeout(function() {
N();
p();
for (var e = 0; e < O.length; e++) {
T(O[e])
}
}, 15500)
}, true);
e.addEventListener("ended", function() {
N();
h()
}, true);
e.innerHTML = " <p>If you are reading this, it is because your browser does not support the audio element. We recommend that you get a new browser.</p> <p>";
document.body.appendChild(e);
e.play()
}
function x(e) {
e.className += " " + s + " " + o
}
function T(e) {
e.className += " " + s + " " + u[Math.floor(Math.random() * u.length)]
}
function N() {
var e = document.getElementsByClassName(s);
var t = new RegExp("\\b" + s + "\\b");
for (var n = 0; n < e.length; ) {
e[n].className = e[n].className.replace(t, "")
}
}
var e = 30;
var t = 30;
var n = 350;
var r = 350;
var i = "//s3.amazonaws.com/moovweb-marketing/playground/harlem-shake.mp3";
var s = "mw-harlem_shake_me";
var o = "im_first";
var u = ["im_drunk", "im_baked", "im_trippin", "im_blown"];
var a = "mw-strobe_light";
var f = "//s3.amazonaws.com/moovweb-marketing/playground/harlem-shake-style.css";
var l = "mw_added_css";
var b = g();
var w = y();
var C = document.getElementsByTagName("*");
var k = null;
for (var L = 0; L < C.length; L++) {
var A = C[L];
if (v(A)) {
if (E(A)) {
k = A;
break
}
}
}
if (A === null) {
console.warn("Could not find a node of the right size. Please try a different page.");
return
}
c();
S();
var O = [];
for (var L = 0; L < C.length; L++) {
var A = C[L];
if (v(A)) {
O.push(A)
}
}
})() '>给世界酷出我的酷</p>
</div>
<div class="site-nav-toggle">
<button>
<span class="btn-bar"></span>
<span class="btn-bar"></span>
<span class="btn-bar"></span>
</button>
</div>
<nav class="site-nav">
<ul id="menu" class="menu menu-left">
<li class="menu-item menu-item-home">
<a href="/" rel="section">
<i class="menu-item-icon fa fa-home fa-fw"></i> <br />
首页
</a>
</li>
<li class="menu-item menu-item-categories">
<a href="/categories" rel="section">
<i class="menu-item-icon fa fa-th fa-fw"></i> <br />
分类
</a>
</li>
<li class="menu-item menu-item-about">
<a href="/about" rel="section">
<i class="menu-item-icon fa fa-user fa-fw"></i> <br />
关于
</a>
</li>
<li class="menu-item menu-item-archives">
<a href="/archives" rel="section">
<i class="menu-item-icon fa fa-archive fa-fw"></i> <br />
归档
</a>
</li>
<li class="menu-item menu-item-tags">
<a href="/tags" rel="section">
<i class="menu-item-icon fa fa-tags fa-fw"></i> <br />
标签
</a>
</li>
<li class="menu-item menu-item-commonweal">
<a href="/404.html" rel="section">
<i class="menu-item-icon fa fa-heartbeat fa-fw"></i> <br />
公益
</a>
</li>
<li class="menu-item menu-item-search">
<a href="#" class="st-search-show-outputs">
<i class="menu-item-icon fa fa-search fa-fw"></i> <br />
搜索
</a>
</li>
</ul>
<div class="site-search">
<script type="text/javascript">
(function(w,d,t,u,n,s,e){w['SwiftypeObject']=n;w[n]=w[n]||function(){
(w[n].q=w[n].q||[]).push(arguments);};s=d.createElement(t);
e=d.getElementsByTagName(t)[0];s.async=1;s.src=u;e.parentNode.insertBefore(s,e);
})(window,document,'script','//s.swiftypecdn.com/install/v2/st.js','_st');
_st('install', 'Uf3M4iHJGy3DkfZN1kNM','2.0.0');
</script>
</div>
</nav>
</div>
</header>
<main id="main" class="main">
<div class="main-inner">
<div id="content" class="content">
<div id="posts" class="posts-collapse">
<div class="collection-title">
<h2 >
CDN
<small>标签</small>
</h2>
</div>
<article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
<header class="post-header">
<h1 class="post-title">
<a class="post-title-link" href="/2015/12/28/坑爹CDN给在线测试带来的问题/" itemprop="url">
<span itemprop="name">坑爹CDN给在线测试带来的问题</span>
</a>
</h1>
<div class="post-meta">
<time class="post-time" itemprop="dateCreated"
datetime="2015-12-28T22:57:12+08:00"
content="2015-12-28" >
12-28
</time>
</div>
</header>
</article>
</div>
</div>
</div>
<div class="sidebar-toggle">
<div class="sidebar-toggle-line-wrap">
<span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
<span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
<span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
</div>
</div>
<aside id="sidebar" class="sidebar">
<div class="sidebar-inner">
<section class="site-overview sidebar-panel sidebar-panel-active ">
<div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
<img class="site-author-image" src="/images/default_avatar.jpg" alt="酷我酷" itemprop="image"/>
<p class="site-author-name" itemprop="name">酷我酷</p>
</div>
<p class="site-description motion-element" itemprop="description">分享即帮助</p>
<nav class="site-state motion-element">
<div class="site-state-item site-state-posts">
<a href="/archives">
<span class="site-state-item-count">43</span>
<span class="site-state-item-name">日志</span>
</a>
</div>
<div class="site-state-item site-state-categories">
<a href="/categories">
<span class="site-state-item-count">29</span>
<span class="site-state-item-name">分类</span>
</a>
</div>
<div class="site-state-item site-state-tags">
<a href="/tags">
<span class="site-state-item-count">43</span>
<span class="site-state-item-name">标签</span>
</a>
</div>
</nav>
<div class="feed-link motion-element">
<a href="http://AfirSraftGarrier.github.io/atom.xml" rel="alternate">
<i class="fa fa-rss"></i>
RSS
</a>
</div>
<div class="links-of-author motion-element">
<span class="links-of-author-item">
<a href="https://github.com/AfirSraftGarrier" target="_blank">
<i class="fa fa-github"></i> GitHub
</a>
</span>
<span class="links-of-author-item">
<a href="https://twitter.com/AfirSraftGarrie" target="_blank">
<i class="fa fa-twitter"></i> Twitter
</a>
</span>
<span class="links-of-author-item">
<a href="http://weibo.com/u/1940794292" target="_blank">
<i class="fa fa-weibo"></i> Weibo
</a>
</span>
<span class="links-of-author-item">
<a href="http://www.douban.com/people/db-acc/" target="_blank">
<i class="fa fa-globe"></i> DouBan
</a>
</span>
<span class="links-of-author-item">
<a href="http://www.zhihu.com/people/afirsraftgarrier-29" target="_blank">
<i class="fa fa-globe"></i> ZhiHu
</a>
</span>
</div>
<div class="links-of-author motion-element">
<p class="site-author-name">友情链接</p>
<span class="links-of-author-item">
<a href="http://www.lianquna.com" target="_blank">链去哪</a>
</span>
<span class="links-of-author-item">
<a href="http://www.kuwoku.com" target="_blank">酷我酷</a>
</span>
<span class="links-of-author-item">
<a href="http://www.keheji.com" target="_blank">壳合集</a>
</span>
</div>
<div class="cc-license motion-element" itemprop="license" style="opacity: 1; display: block; transform: translateX(0px);">
<a href="http://creativecommons.org/licenses/by-nc-sa/4.0" class="cc-opacity" target="_blank" rel="external nofollow">
<img src="/images/cc-by-nc-sa.svg" alt="Creative Commons">
</a>
</div>
</section>
</div>
</aside>
</main>
<footer id="footer" class="footer">
<div class="footer-inner">
<div class="copyright" >
© 2015 -
<span itemprop="copyrightYear">2016</span>
<span class="with-love">
<i class="icon-next-heart fa fa-heart"></i>
</span>
<span class="author" itemprop="copyrightHolder"><a class="theme-link" href="http://www.kuwoku.com" style="color:red">酷我酷</a></span>
</div>
<div class="powered-by">
由 <a class="theme-link" href="http://hexo.io" target="_blank" style="color:gray">HEXO</a> 强力驱动
</div>
<div class="theme-info">
主题 -
<a class="theme-link" href="https://github.com/iissnan/hexo-theme-next" target="_blank" style="color:gray">
NEXT
</a>
<script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<span id="busuanzi_container_site_pv"> | 本站总访问量<span id="busuanzi_value_site_pv"></span>次</span>
</div>
<div class="theme-info">
<script>
(function(){
var bp = document.createElement('script');
bp.src = '//push.zhanzhang.baidu.com/push.js';
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(bp, s);
})();
</script>
<script type="text/javascript">var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");document.write(unescape("%3Cspan id='cnzz_stat_icon_1257066910'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s95.cnzz.com/z_stat.php%3Fid%3D1257066910%26online%3D1%26show%3Dline' type='text/javascript'%3E%3C/script%3E"));</script>
</div>
<p style="margin-bottom:-10px;">COPYRIGHT © 酷我酷 粤ICP备14100221号</p>
</div>
</footer>
<div class="back-to-top"></div>
<div class="top-to-back"></div>
<div class="left-to-right" onClick="leftToRightClick()"></div>
<div class="right-to-left" onClick="rightToLeftClick()"></div>
<script type="text/javascript">
function leftToRightClick() {
nextNaviClick();
}
function rightToLeftClick() {
preNaviClick();
}
function preNaviClick() {
if($('i').hasClass("fa-angle-right")) {
$('.fa-angle-right').click();
}
}
function nextNaviClick() {
if($('i').hasClass("fa-angle-left")) {
$('.fa-angle-left').click();
}
}
</script>
</div>
<script type="text/javascript" src="/vendors/jquery/index.js?v=2.1.3"></script>
<script type="text/javascript">
postMotionOptions = {stagger: 100, drag: true};
</script>
<script type="text/javascript">
var duoshuoQuery = {short_name:"AfirSraftGarrier"};
(function() {
var ds = document.createElement('script');
ds.type = 'text/javascript';ds.async = true;
ds.id = 'duoshuo-script';
ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
ds.charset = 'UTF-8';
(document.getElementsByTagName('head')[0]
|| document.getElementsByTagName('body')[0]).appendChild(ds);
})();
</script>
<script type="text/javascript">
var duoshuo_user_ID = 6224780871593887000
var duoshuo_admin_nickname="酷我酷"
</script>
<script src="/js/ua-parser.min.js"></script>
<script src="/js/hook-duoshuo.js"></script>
<script type="text/javascript" src="/vendors/fancybox/source/jquery.fancybox.pack.js"></script>
<script type="text/javascript" src="/js/fancy-box.js?v=0.4.5.2"></script>
<script type="text/javascript" src="/js/helpers.js?v=0.4.5.2"></script>
<script type="text/javascript" src="/vendors/velocity/velocity.min.js"></script>
<script type="text/javascript" src="/vendors/velocity/velocity.ui.min.js"></script>
<script type="text/javascript" src="/js/motion.js?v=0.4.5.2" id="motion.global"></script>
<script type="text/javascript" src="/vendors/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
<script type="text/javascript" src="/vendors/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
<script type="text/javascript" src="/js/bootstrap.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
processEscapes: true,
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
}
});
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Queue(function() {
var all = MathJax.Hub.getAllJax(), i;
for (i=0; i < all.length; i += 1) {
all[i].SourceElement().parentNode.className += ' has-jax';
}
});
</script>
<script type="text/javascript" src="http://cdn.staticfile.org/mathjax/2.4.0/MathJax.js"></script>
<script type="text/javascript" src="http://cdn.staticfile.org/mathjax/2.4.0/config/TeX-AMS-MML_HTMLorMML.js"></script>
<!-- custom analytics part create by xiamo -->
<script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.1.js"></script>
<script>AV.initialize("t2rSFICpuTnyyi6nOFHsnHaM", "s1slrYanIAFr41TM32fuwKAi");</script>
<script>
function showTime(Counter) {
var query = new AV.Query(Counter);
$(".leancloud_visitors").each(function() {
var url = $(this).attr("id").trim();
query.equalTo("url", url);
query.find({
success: function(results) {
if (results.length == 0) {
var content = $(document.getElementById(url)).text() + ': 0';
$(document.getElementById(url)).text(content);
return;
}
for (var i = 0; i < results.length; i++) {
var object = results[i];
var content = $(document.getElementById(url)).text() + ': ' + object.get('time');
$(document.getElementById(url)).text(content);
}
},
error: function(object, error) {
console.log("Error: " + error.code + " " + error.message);
}
});
});
}
function addCount(Counter) {
var Counter = AV.Object.extend("Counter");
url = $(".leancloud_visitors").attr('id').trim();
title = $(".leancloud_visitors").attr('data-flag-title').trim();
var query = new AV.Query(Counter);
query.equalTo("url", url);
query.find({
success: function(results) {
if (results.length > 0) {
var counter = results[0];
counter.fetchWhenSave(true);
counter.increment("time");
counter.save(null, {
success: function(counter) {
var content = $(document.getElementById(url)).text() + ': ' + counter.get('time');
$(document.getElementById(url)).text(content);
},
error: function(counter, error) {
console.log('Failed to save Visitor num, with error message: ' + error.message);
}
});
} else {
var newcounter = new Counter();
newcounter.set("title", title);
newcounter.set("url", url);
newcounter.set("time", 1);
newcounter.save(null, {
success: function(newcounter) {
console.log("newcounter.get('time')="+newcounter.get('time'));
var content = $(document.getElementById(url)).text() + ': ' + newcounter.get('time');
$(document.getElementById(url)).text(content);
},
error: function(newcounter, error) {
console.log('Failed to create');
}
});
}
},
error: function(error) {
console.log('Error:' + error.code + " " + error.message);
}
});
}
$(function() {
var Counter = AV.Object.extend("Counter");
if ($('.leancloud_visitors').length == 1) {
addCount(Counter);
} else if ($('.post-title-link').length > 1) {
showTime(Counter);
}
});
</script>
</body>
</html>
| AfirSraftGarrier/AfirSraftGarrier.github.io | tags/CDN/index.html | HTML | apache-2.0 | 27,288 |
package org.squbs.httpclient.japi
import org.squbs.httpclient.endpoint.Endpoint
/**
* Created by lma on 7/15/2015.
*/
object EndpointFactory {
def create(uri: String) = Endpoint(uri)
}
| keshin/squbs | squbs-httpclient/src/main/scala/org/squbs/httpclient/japi/EndpointFactory.scala | Scala | apache-2.0 | 193 |
#!/usr/bin/python
#-*-coding:utf8-*-
from bs4 import BeautifulSoup as Soup
#import pandas as pd
import glob
import sys
import re
"""
Version xml de cfdi 3.3
"""
class CFDI(object):
def __init__(self, f):
"""
Constructor que requiere en el parámetro una cadena con el nombre del
cfdi.
"""
fxml = open(f,'r').read()
soup = Soup(fxml,'lxml')
#============componentes del cfdi============
emisor = soup.find('cfdi:emisor')
receptor = soup.find('cfdi:receptor')
comprobante = soup.find('cfdi:comprobante')
tfd = soup.find('tfd:timbrefiscaldigital')
self.__version = comprobante['version']
self.__folio = comprobante['folio']
self.__uuid = tfd['uuid']
self.__fechatimbrado = tfd['fechatimbrado']
self.__traslados = soup.find_all(lambda e: e.name=='cfdi:traslado' and
sorted(e.attrs.keys())==['importe','impuesto','tasaocuota','tipofactor'])
self.__retenciones = soup.find_all(lambda e: e.name=='cfdi:retencion' and
sorted(e.attrs.keys())==['importe','impuesto'])
#============emisor==========================
self.__emisorrfc = emisor['rfc']
try:
self.__emisornombre = emisor['nombre']
except:
self.__emisornombre = emisor['rfc']
#============receptor========================
self.__receptorrfc = receptor['rfc']
try:
self.__receptornombre = receptor['nombre']
except:
self.__receptornombre = receptor['rfc']
#============comprobante=====================
self.__certificado = comprobante['certificado']
self.__sello = comprobante['sello']
self.__total = round(float(comprobante['total']),2)
self.__subtotal = round(float(comprobante['subtotal']),2)
self.__fecha_cfdi = comprobante['fecha']
self.__conceptos = soup.find_all(lambda e: e.name=='cfdi:concepto')
self.__n_conceptos = len(self.__conceptos)
try:
self.__moneda = comprobante['moneda']
except KeyError as k:
self.__moneda = 'MXN'
try:
self.__lugar = comprobante['lugarexpedicion']
except KeyError as k:
self.__lugar = u'México'
tipo = comprobante['tipodecomprobante']
if(float(self.__version)==3.2):
self.__tipo = tipo
else:
tcomprobantes = {'I':'Ingreso', 'E':'Egreso', 'N':'Nomina', 'P':'Pagado'}
self.__tipo = tcomprobantes[tipo]
try:
self.__tcambio = float(comprobante['tipocambio'])
except:
self.__tcambio = 1.
triva, trieps, trisr = self.__calcula_traslados()
self.__triva = round(triva,2)
self.__trieps = round(trieps,2)
self.__trisr = round(trisr,2)
retiva, retisr = self.__calcula_retenciones()
self.__retiva = round(retiva,2)
self.__retisr = round(retisr,2)
def __str__(self):
"""
Imprime el cfdi en el siguiente orden
emisor, fecha de timbrado, tipo de comprobante, rfc emisor, uuid,_
receptor, rfc receptor, subtotal, ieps, iva, retiva, retisr, tc, total
"""
respuesta = '\t'.join( map(str, self.lista_valores))
return respuesta
def __calcula_traslados(self):
triva, trieps, trisr = 0., 0., 0
for t in self.__traslados:
impuesto = t['impuesto']
importe = float(t['importe'])
if(self.__version=='3.2'):
if impuesto=='IVA':
triva += importe
elif impuesto=='ISR':
trisr += importe
elif impuesto=='IEPS':
trieps += importe
elif(self.__version=='3.3'):
if impuesto=='002':
triva += importe
elif impuesto=='001':
trisr += importe
elif impuesto=='003':
trieps += importe
return triva, trieps, trisr
def __calcula_retenciones(self):
retiva, retisr = 0., 0.
for t in self.__retenciones:
impuesto = t['impuesto']
importe = float(t['importe'])
if(self.__version=='3.2'):
if(impuesto=='ISR'):
retisr += importe
elif(impuesto=='IVA'):
retiva += importe
elif(self.__version=='3.3'):
if(impuesto=='002'):
retiva += importe
elif(impuesto=='001'):
retisr += importe
return retiva, retisr
@property
def lista_valores(self):
v = [self.__emisornombre,self.__fechatimbrado, self.__tipo, self.__emisorrfc ]
v += [self.__uuid, self.__folio, self.__receptornombre, self.__receptorrfc ]
v += [self.__subtotal, self.__trieps, self.__triva]
v += [self.__retiva, self.__retisr, self.__tcambio, self.__total]
return v
@property
def dic_cfdi(self):
d = {}
d["Emisor"] = self.__emisornombre
d["Fecha_CFDI"] = self.__fechatimbrado
d["Tipo"] = self.__tipo
d["RFC_Emisor"] = self.__emisorrfc
d["Folio_fiscal"] = self.__uuid
d["Folio"] = self.__folio
d["Receptor"] = self.__receptornombre
d["RFC_Receptor"] = self.__receptorrfc
d["Subtotal"] = self.__subtotal
d["IEPS"] = self.__trieps
d["IVA"] = self.__triva
d["Ret IVA"] = self.__retiva
d["Ret ISR"] = self.__retisr
d["TC"] = self.__tcambio
d["Total"] = self.__total
return d
@property
def certificado(self):
return self.__certificado
@property
def sello(self):
return self.__sello
@property
def total(self):
return self.__total
@property
def subtotal(self):
return self.__subtotal
@property
def fechatimbrado(self):
return self.__fechatimbrado
@property
def tipodecambio(self):
return self.__tcambio
@property
def lugar(self):
return self.__lugar
@property
def moneda(self):
return self.__moneda
@property
def traslado_iva(self):
return self.__triva
@property
def traslado_isr(self):
return self.__trisr
@property
def traslado_ieps(self):
return self.__trieps
@property
def n_conceptos(self):
return self.__n_conceptos
@property
def conceptos(self):
return self.__conceptos
@property
def folio(self):
return self.__folio
@staticmethod
def columnas():
return ["Emisor","Fecha_CFDI","Tipo","RFC_Emisor","Folio_fiscal","Folio","Receptor",
"RFC_Receptor", "Subtotal","IEPS","IVA","Ret IVA","Ret ISR","TC","Total"]
@staticmethod
def imprime_reporte(nf, nr):
reporte = "Número de archivos procesados:\t {}\n".format(nf)
reporte += "Número de filas en tsv:\t {}\n".format(nr)
if(nf!=nr):
reporte += "\n\n**** Atención ****\n"
return reporte
L = glob.glob('./*.xml')
#R = [ patt[1:].strip().lower() for patt in re.findall('(<cfdi:[A-z]*\s|<tfd:[A-z]*\s)',fxml)]
if __name__=='__main__':
salida = sys.argv[1]
fout = open(salida,'w')
columnas = CFDI.columnas()
titulo = '\t'.join(columnas)+'\n'
fout.write(titulo)
nl = 0
for f in L:
try:
#print("abriendo {0}".format(f))
rcfdi = CFDI(f)
dic = rcfdi.dic_cfdi
vals = [dic[c] for c in columnas]
strvals = ' \t '.join(map(str, vals))+'\n'
fout.write(strvals)
nl += 1
except:
assert "Error en archivo {0}".format(f)
fout.close()
nr = len(L)
rep = CFDI.imprime_reporte(nr, nl)
print(rep)
| sergiohzlz/lectorcfdi | extrainfo.py | Python | apache-2.0 | 8,345 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-GB" xml:lang="en-GB" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Statistics of Degree in UD_Croatian-SET</title>
<link rel="root" href=""/> <!-- for JS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="../../css/jquery-ui-redmond.css"/>
<link rel="stylesheet" type="text/css" href="../../css/style.css"/>
<link rel="stylesheet" type="text/css" href="../../css/style-vis.css"/>
<link rel="stylesheet" type="text/css" href="../../css/hint.css"/>
<script type="text/javascript" src="../../lib/ext/head.load.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/3.2.2/anchor.min.js"></script>
<script>document.addEventListener("DOMContentLoaded", function(event) {anchors.add();});</script>
<!-- Set up this custom Google search at https://cse.google.com/cse/business/settings?cx=001145188882102106025:dl1mehhcgbo -->
<!-- DZ 2021-01-22: I am temporarily hiding the search field to find out whether it slows down loading of the title page.
<script>
(function() {
var cx = '001145188882102106025:dl1mehhcgbo';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script> -->
<!-- <link rel="shortcut icon" href="favicon.ico"/> -->
</head>
<body>
<div id="main" class="center">
<div id="hp-header">
<table width="100%"><tr><td width="50%">
<span class="header-text"><a href="http://universaldependencies.org/#language-">home</a></span>
<span class="header-text"><a href="https://github.com/universaldependencies/docs/edit/pages-source/treebanks/hr_set/hr_set-feat-Degree.md" target="#">edit page</a></span>
<span class="header-text"><a href="https://github.com/universaldependencies/docs/issues">issue tracker</a></span>
</td><td>
<gcse:search></gcse:search>
</td></tr></table>
</div>
<hr/>
<div class="v2complete">
This page pertains to UD version 2.
</div>
<div id="content">
<noscript>
<div id="noscript">
It appears that you have Javascript disabled.
Please consider enabling Javascript for this page to see the visualizations.
</div>
</noscript>
<!-- The content may include scripts and styles, hence we must load the shared libraries before the content. -->
<script type="text/javascript">
console.time('loading libraries');
var root = '../../'; // filled in by jekyll
head.js(
// External libraries
// DZ: Copied from embedding.html. I don't know which one is needed for what, so I'm currently keeping them all.
root + 'lib/ext/jquery.min.js',
root + 'lib/ext/jquery.svg.min.js',
root + 'lib/ext/jquery.svgdom.min.js',
root + 'lib/ext/jquery.timeago.js',
root + 'lib/ext/jquery-ui.min.js',
root + 'lib/ext/waypoints.min.js',
root + 'lib/ext/jquery.address.min.js'
);
</script>
<h2 id="treebank-statistics-ud_croatian-set-features-degree">Treebank Statistics: UD_Croatian-SET: Features: <code class="language-plaintext highlighter-rouge">Degree</code></h2>
<p>This feature is universal.
It occurs with 3 different values: <code class="language-plaintext highlighter-rouge">Cmp</code>, <code class="language-plaintext highlighter-rouge">Pos</code>, <code class="language-plaintext highlighter-rouge">Sup</code>.</p>
<p>31236 tokens (16%) have a non-empty value of <code class="language-plaintext highlighter-rouge">Degree</code>.
11316 types (32%) occur at least once with a non-empty value of <code class="language-plaintext highlighter-rouge">Degree</code>.
4920 lemmas (27%) occur at least once with a non-empty value of <code class="language-plaintext highlighter-rouge">Degree</code>.
The feature is used with 3 part-of-speech tags: <tt><a href="hr_set-pos-ADJ.html">ADJ</a></tt> (22931; 11% instances), <tt><a href="hr_set-pos-ADV.html">ADV</a></tt> (7943; 4% instances), <tt><a href="hr_set-pos-DET.html">DET</a></tt> (362; 0% instances).</p>
<h3 id="adj"><code class="language-plaintext highlighter-rouge">ADJ</code></h3>
<p>22931 <tt><a href="hr_set-pos-ADJ.html">ADJ</a></tt> tokens (95% of all <code class="language-plaintext highlighter-rouge">ADJ</code> tokens) have a non-empty value of <code class="language-plaintext highlighter-rouge">Degree</code>.</p>
<p>The most frequent other feature values with which <code class="language-plaintext highlighter-rouge">ADJ</code> and <code class="language-plaintext highlighter-rouge">Degree</code> co-occurred: <tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt> (20684; 90%), <tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Sing</tt> (15101; 66%).</p>
<p><code class="language-plaintext highlighter-rouge">ADJ</code> tokens may have the following values of <code class="language-plaintext highlighter-rouge">Degree</code>:</p>
<ul>
<li><code class="language-plaintext highlighter-rouge">Cmp</code> (588; 3% of non-empty <code class="language-plaintext highlighter-rouge">Degree</code>): <em>veći, veće, manji, veća, veću, većeg, bolje, bolji, niže, većim</em></li>
<li><code class="language-plaintext highlighter-rouge">Pos</code> (21823; 95% of non-empty <code class="language-plaintext highlighter-rouge">Degree</code>): <em>novi, prvi, drugi, sve, svi, vanjskih, glavni, novih, nove, prošle</em></li>
<li><code class="language-plaintext highlighter-rouge">Sup</code> (520; 2% of non-empty <code class="language-plaintext highlighter-rouge">Degree</code>): <em>najveći, najbolji, najveća, najveće, najvećih, najbolje, najboljeg, najvažnije, najvećim, najvećem</em></li>
<li><code class="language-plaintext highlighter-rouge">EMPTY</code> (1206): <em>1., 2004., 2008., 2007., 2009., 2006., 2., 2005., 2010., 21.</em></li>
</ul>
<table>
<tr><th>Paradigm <i>velik</i></th><th><tt>Pos</tt></th><th><tt>Cmp</tt></th><th><tt>Sup</tt></th></tr>
<tr><td><tt><tt><a href="hr_set-feat-Animacy.html">Animacy</a></tt><tt>=Inan</tt>|<tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Acc</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Masc</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Sing</tt></tt></td><td><em>veliki</em></td><td><em>veći</em></td><td><em>najveći</em></td></tr>
<tr><td><tt><tt><a href="hr_set-feat-Animacy.html">Animacy</a></tt><tt>=Inan</tt>|<tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Acc</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Ind</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Masc</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Sing</tt></tt></td><td><em>velik, veći</em></td><td></td><td></td></tr>
<tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Acc</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Masc</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Plur</tt></tt></td><td><em>velike</em></td><td><em>veće</em></td><td><em>najveće</em></td></tr>
<tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Acc</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Fem</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Sing</tt></tt></td><td><em>veliku</em></td><td><em>veću</em></td><td><em>najveću</em></td></tr>
<tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Acc</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Fem</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Plur</tt></tt></td><td><em>velike</em></td><td><em>veće</em></td><td></td></tr>
<tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Acc</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Neut</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Sing</tt></tt></td><td></td><td><em>veće</em></td><td><em>najveće</em></td></tr>
<tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Acc</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Neut</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Plur</tt></tt></td><td><em>veća</em></td><td></td><td><em>najveća</em></td></tr>
<tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Dat</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Masc</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Sing</tt></tt></td><td><em>velikom</em></td><td></td><td><em>najvećem</em></td></tr>
<tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Dat</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Fem</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Sing</tt></tt></td><td><em>velikoj</em></td><td><em>većoj</em></td><td><em>najvećim</em></td></tr>
<tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Dat</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Fem</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Plur</tt></tt></td><td><em>velikim</em></td><td></td><td><em>najvećim</em></td></tr>
<tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Gen</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Masc</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Sing</tt></tt></td><td><em>velikog, velika, velikoga</em></td><td><em>većeg</em></td><td><em>najvećeg, najveća</em></td></tr>
<tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Gen</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Masc</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Plur</tt></tt></td><td><em>velikih</em></td><td><em>većih</em></td><td><em>najvećih</em></td></tr>
<tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Gen</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Fem</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Sing</tt></tt></td><td><em>velike</em></td><td><em>veće</em></td><td><em>najveće</em></td></tr>
<tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Gen</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Fem</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Plur</tt></tt></td><td><em>velikih</em></td><td><em>većih</em></td><td><em>najvećih</em></td></tr>
<tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Gen</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Neut</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Sing</tt></tt></td><td><em>velikog, najvećeg</em></td><td><em>većeg</em></td><td></td></tr>
<tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Gen</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Neut</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Plur</tt></tt></td><td><em>velikih</em></td><td></td><td><em>najvećih</em></td></tr>
<tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Ins</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Masc</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Sing</tt></tt></td><td><em>velikim</em></td><td><em>većim</em></td><td><em>najvećim</em></td></tr>
<tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Ins</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Masc</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Plur</tt></tt></td><td><em>velikim</em></td><td></td><td><em>najvećim</em></td></tr>
<tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Ins</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Fem</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Sing</tt></tt></td><td><em>velikom</em></td><td><em>većom</em></td><td><em>najvećom</em></td></tr>
<tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Ins</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Fem</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Plur</tt></tt></td><td><em>velikim</em></td><td><em>većim</em></td><td><em>najvećima</em></td></tr>
<tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Ins</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Neut</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Sing</tt></tt></td><td><em>najvećim</em></td><td></td><td></td></tr>
<tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Loc</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Masc</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Sing</tt></tt></td><td><em>velikom</em></td><td><em>većem</em></td><td><em>najvećem</em></td></tr>
<tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Loc</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Masc</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Plur</tt></tt></td><td><em>velikim</em></td><td></td><td></td></tr>
<tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Loc</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Fem</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Sing</tt></tt></td><td><em>velikoj</em></td><td><em>većoj</em></td><td><em>najvećoj</em></td></tr>
<tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Loc</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Fem</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Plur</tt></tt></td><td><em>velikim</em></td><td></td><td></td></tr>
<tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Loc</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Neut</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Sing</tt></tt></td><td><em>velikom</em></td><td></td><td></td></tr>
<tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Loc</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Neut</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Plur</tt></tt></td><td><em>velikim</em></td><td></td><td><em>najvećim</em></td></tr>
<tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Nom</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Masc</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Sing</tt></tt></td><td><em>veliki</em></td><td><em>veći</em></td><td><em>najveći</em></td></tr>
<tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Nom</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Masc</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Plur</tt></tt></td><td><em>veliki</em></td><td></td><td><em>najveći</em></td></tr>
<tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Nom</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Fem</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Sing</tt></tt></td><td><em>velika</em></td><td><em>veća</em></td><td><em>najveća</em></td></tr>
<tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Nom</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Fem</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Plur</tt></tt></td><td><em>velike</em></td><td></td><td><em>najveće</em></td></tr>
<tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Nom</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Neut</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Sing</tt></tt></td><td><em>veliko</em></td><td><em>veće</em></td><td><em>najveće</em></td></tr>
<tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Nom</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Neut</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Plur</tt></tt></td><td><em>velika</em></td><td><em>veća</em></td><td><em>najveća</em></td></tr>
<tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Nom</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Ind</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Masc</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Sing</tt></tt></td><td><em>velik</em></td><td></td><td></td></tr>
</table>
<p><code class="language-plaintext highlighter-rouge">Degree</code> seems to be <strong>lexical feature</strong> of <code class="language-plaintext highlighter-rouge">ADJ</code>. 96% lemmas (4025) occur only with one value of <code class="language-plaintext highlighter-rouge">Degree</code>.</p>
<h3 id="adv"><code class="language-plaintext highlighter-rouge">ADV</code></h3>
<p>7943 <tt><a href="hr_set-pos-ADV.html">ADV</a></tt> tokens (94% of all <code class="language-plaintext highlighter-rouge">ADV</code> tokens) have a non-empty value of <code class="language-plaintext highlighter-rouge">Degree</code>.</p>
<p>The most frequent other feature values with which <code class="language-plaintext highlighter-rouge">ADV</code> and <code class="language-plaintext highlighter-rouge">Degree</code> co-occurred: <tt><a href="hr_set-feat-PronType.html">PronType</a></tt><tt>=EMPTY</tt> (6480; 82%).</p>
<p><code class="language-plaintext highlighter-rouge">ADV</code> tokens may have the following values of <code class="language-plaintext highlighter-rouge">Degree</code>:</p>
<ul>
<li><code class="language-plaintext highlighter-rouge">Cmp</code> (603; 8% of non-empty <code class="language-plaintext highlighter-rouge">Degree</code>): <em>više, dalje, manje, kasnije, bolje, ranije, brže, češće, lakše, dulje</em></li>
<li><code class="language-plaintext highlighter-rouge">Pos</code> (7224; 91% of non-empty <code class="language-plaintext highlighter-rouge">Degree</code>): <em>samo, još, također, već, posto, međutim, oko, vrlo, danas, kada</em></li>
<li><code class="language-plaintext highlighter-rouge">Sup</code> (116; 1% of non-empty <code class="language-plaintext highlighter-rouge">Degree</code>): <em>najviše, najmanje, najbolje, najčešće, najvjerojatnije, najradije, najgore, najteže, Najdalje, najbrže</em></li>
<li><code class="language-plaintext highlighter-rouge">EMPTY</code> (485): <em>uključujući, zahvaljujući, govoreći, ističući, dodajući, ukazujući, tražeći, opisujući, pozivajući, sl.</em></li>
</ul>
<table>
<tr><th>Paradigm <i>mnogo</i></th><th><tt>Pos</tt></th><th><tt>Cmp</tt></th><th><tt>Sup</tt></th></tr>
<tr><td><tt></tt></td><td><em>mnogo, više</em></td><td><em>više</em></td><td><em>najviše</em></td></tr>
</table>
<p><code class="language-plaintext highlighter-rouge">Degree</code> seems to be <strong>lexical feature</strong> of <code class="language-plaintext highlighter-rouge">ADV</code>. 95% lemmas (749) occur only with one value of <code class="language-plaintext highlighter-rouge">Degree</code>.</p>
<h3 id="det"><code class="language-plaintext highlighter-rouge">DET</code></h3>
<p>362 <tt><a href="hr_set-pos-DET.html">DET</a></tt> tokens (5% of all <code class="language-plaintext highlighter-rouge">DET</code> tokens) have a non-empty value of <code class="language-plaintext highlighter-rouge">Degree</code>.</p>
<p>The most frequent other feature values with which <code class="language-plaintext highlighter-rouge">DET</code> and <code class="language-plaintext highlighter-rouge">Degree</code> co-occurred: <tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=EMPTY</tt> (362; 100%), <tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=EMPTY</tt> (362; 100%), <tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=EMPTY</tt> (362; 100%), <tt><a href="hr_set-feat-Number-psor.html">Number[psor]</a></tt><tt>=EMPTY</tt> (362; 100%), <tt><a href="hr_set-feat-Person.html">Person</a></tt><tt>=EMPTY</tt> (362; 100%), <tt><a href="hr_set-feat-Poss.html">Poss</a></tt><tt>=EMPTY</tt> (362; 100%), <tt><a href="hr_set-feat-PronType.html">PronType</a></tt><tt>=EMPTY</tt> (199; 55%).</p>
<p><code class="language-plaintext highlighter-rouge">DET</code> tokens may have the following values of <code class="language-plaintext highlighter-rouge">Degree</code>:</p>
<ul>
<li><code class="language-plaintext highlighter-rouge">Cmp</code> (93; 26% of non-empty <code class="language-plaintext highlighter-rouge">Degree</code>): <em>više, manje</em></li>
<li><code class="language-plaintext highlighter-rouge">Pos</code> (263; 73% of non-empty <code class="language-plaintext highlighter-rouge">Degree</code>): <em>nekoliko, mnogo, pola, puno, posto, malo, dosta, dovoljno, previše, koliko</em></li>
<li><code class="language-plaintext highlighter-rouge">Sup</code> (6; 2% of non-empty <code class="language-plaintext highlighter-rouge">Degree</code>): <em>najviše</em></li>
<li><code class="language-plaintext highlighter-rouge">EMPTY</code> (7332): <em>koji, to, koje, koja, svoje, ove, toga, sve, kojima, koju</em></li>
</ul>
<table>
<tr><th>Paradigm <i>mnogo</i></th><th><tt>Pos</tt></th><th><tt>Cmp</tt></th><th><tt>Sup</tt></th></tr>
<tr><td><tt></tt></td><td><em>mnogo</em></td><td><em>više</em></td><td><em>najviše</em></td></tr>
</table>
<h2 id="relations-with-agreement-in-degree">Relations with Agreement in <code class="language-plaintext highlighter-rouge">Degree</code></h2>
<p>The 10 most frequent relations where parent and child node agree in <code class="language-plaintext highlighter-rouge">Degree</code>:
<tt>ADJ –[<tt><a href="hr_set-dep-advmod.html">advmod</a></tt>]–> ADV</tt> (1139; 83%),
<tt>ADJ –[<tt><a href="hr_set-dep-conj.html">conj</a></tt>]–> ADJ</tt> (803; 97%),
<tt>ADV –[<tt><a href="hr_set-dep-advmod.html">advmod</a></tt>]–> ADV</tt> (296; 75%),
<tt>ADV –[<tt><a href="hr_set-dep-conj.html">conj</a></tt>]–> ADV</tt> (83; 86%),
<tt>ADJ –[<tt><a href="hr_set-dep-amod.html">amod</a></tt>]–> ADJ</tt> (59; 72%),
<tt>ADJ –[<tt><a href="hr_set-dep-discourse.html">discourse</a></tt>]–> ADV</tt> (56; 80%),
<tt>ADV –[<tt><a href="hr_set-dep-amod.html">amod</a></tt>]–> ADJ</tt> (44; 94%),
<tt>ADJ –[<tt><a href="hr_set-dep-advcl.html">advcl</a></tt>]–> ADJ</tt> (39; 89%),
<tt>ADJ –[<tt><a href="hr_set-dep-nsubj.html">nsubj</a></tt>]–> ADJ</tt> (23; 100%),
<tt>ADJ –[<tt><a href="hr_set-dep-parataxis.html">parataxis</a></tt>]–> ADJ</tt> (23; 96%).</p>
</div>
<!-- support for embedded visualizations -->
<script type="text/javascript">
var root = '../../'; // filled in by jekyll
head.js(
// We assume that external libraries such as jquery.min.js have already been loaded outside!
// (See _layouts/base.html.)
// brat helper modules
root + 'lib/brat/configuration.js',
root + 'lib/brat/util.js',
root + 'lib/brat/annotation_log.js',
root + 'lib/ext/webfont.js',
// brat modules
root + 'lib/brat/dispatcher.js',
root + 'lib/brat/url_monitor.js',
root + 'lib/brat/visualizer.js',
// embedding configuration
root + 'lib/local/config.js',
// project-specific collection data
root + 'lib/local/collections.js',
// Annodoc
root + 'lib/annodoc/annodoc.js',
// NOTE: non-local libraries
'https://spyysalo.github.io/conllu.js/conllu.js'
);
var webFontURLs = [
// root + 'static/fonts/Astloch-Bold.ttf',
root + 'static/fonts/PT_Sans-Caption-Web-Regular.ttf',
root + 'static/fonts/Liberation_Sans-Regular.ttf'
];
var setupTimeago = function() {
jQuery("time.timeago").timeago();
};
head.ready(function() {
setupTimeago();
// mark current collection (filled in by Jekyll)
Collections.listing['_current'] = '';
// perform all embedding and support functions
Annodoc.activate(Config.bratCollData, Collections.listing);
});
</script>
<!-- google analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-55233688-1', 'auto');
ga('send', 'pageview');
</script>
<div id="footer">
<p class="footer-text">© 2014–2021
<a href="http://universaldependencies.org/introduction.html#contributors" style="color:gray">Universal Dependencies contributors</a>.
Site powered by <a href="http://spyysalo.github.io/annodoc" style="color:gray">Annodoc</a> and <a href="http://brat.nlplab.org/" style="color:gray">brat</a></p>.
</div>
</div>
</body>
</html>
| UniversalDependencies/universaldependencies.github.io | treebanks/hr_set/hr_set-feat-Degree.html | HTML | apache-2.0 | 27,672 |
require "decoplan/algorithm"
require "decoplan/dive_profile"
module Decoplan
class Algorithm
class Buhlmann < Algorithm
attr_accessor :lo
attr_accessor :hi
attr_accessor :compartments
N2_HALF = [ 4.0, 5.0, 8.0, 12.5, 18.5, 27.0, 38.3, 54.3, 77.0, 109.0, 146.0, 187.0, 239.0, 305.0, 390.0, 498.0, 635.0 ]
N2_A = [ 1.2599, 1.2599, 1.0000, 0.8618, 0.7562, 0.6667, 0.5600, 0.4947, 0.4500, 0.4187, 0.3798, 0.3497, 0.3223, 0.2971, 0.2737, 0.2523, 0.2327 ]
N2_B = [ 0.5050, 0.5050, 0.6514, 0.7222, 0.7725, 0.8125, 0.8434, 0.8693, 0.8910, 0.9092, 0.9222, 0.9319, 0.9403, 0.9477, 0.9544, 0.9602, 0.9653 ]
HE_HALF = [ 1.51, 1.88, 3.02, 4.72, 6.99, 10.21, 14.48, 20.53, 29.11, 41.20, 55.19, 70.69, 90.34, 115.29, 147.42, 188.24, 240.03 ]
HE_A = [ 1.7424, 1.6189, 1.3830, 1.1919, 1.0458, 0.9220, 0.8205, 0.7305, 0.6502, 0.5950, 0.5545, 0.5333, 0.5189, 0.5181, 0.5176, 0.5172, 0.5119 ]
HE_B = [ 0.4245, 0.4770, 0.5747, 0.6527, 0.7223, 0.7582, 0.7957, 0.8279, 0.8553, 0.8757, 0.8903, 0.8997, 0.9073, 0.9122, 0.9171, 0.9217, 0.9267 ]
name :buhlmann, :zhl16b
def initialize(profile, lo: 100, hi: 100)
super
@lo = lo
@hi = hi
end
def compute
reset_compartments!
deco_profile = DiveProfile.new
apply_profile(deco_profile)
compute_deco(deco_profile)
deco_profile
end
def reset_compartments!
@compartments = (0..15).map { { n2: 0.79, he: 0.0 } }
end
private
def apply_profile(deco_profile)
profile.levels.each do |level|
deco_profile.level level
haldane_step(level)
end
end
def haldane_step(level)
@compartments = compartments.map.with_index do |p_inert, i|
# FIXME: alveolar pressure
{
n2: haldane_equation(p_inert[:n2], level.depth * (1.0 - level.he - level.o2), N2_HALF[i], level.time),
he: haldane_equation(p_inert[:he], level.depth * level.he, HE_HALF[i], level.time),
}
end
end
def compute_deco(deco_profile)
deco_profile
end
end
end
end
| lamont-granquist/decoplan | lib/decoplan/algorithm/buhlmann.rb | Ruby | apache-2.0 | 2,171 |
#!/usr/bin/python3
from colorama import Fore, Back
class frets:
tuning = list()
max_string_name_len = 0;
frets_count = 0;
strings = dict()
NOTES = ('E', 'F', 'F#', 'G', 'G#', 'A', 'A#', 'B', 'C', 'C#', 'D', 'D#')
def __init__(self,
tuning=('E', 'A', 'D', 'G'),
frets_count=24):
self.tuning = tuning
self.frets_count = frets_count
for string in tuning:
if len(string) > self.max_string_name_len:
self.max_string_name_len = len(string)
padding_count = 0;
padding = ''
self.strings[string] = list()
starting_note = self.NOTES.index(string) + 1
for i in range(frets_count):
padding = '^' * int(((starting_note + i) / len(self.NOTES)))
self.strings[string].append(self.NOTES[(starting_note + i) % len(self.NOTES)] + padding)
#print('{}{} ({}) = {}'.format(string,
# i,
# int(((starting_note + i) / len(self.NOTES))),
# self.NOTES[(starting_note + i) % len(self.NOTES)] + padding))
def debug_strings(self):
print(self.strings)
def show_me_plz(self,
seek_note=None,
seek_string=None):
if (seek_string):
seek_note = self.strings[seek_string[0]][int(seek_string[1]) - 1]
upper_seek_note = None
lower_seek_note = None
if seek_note and seek_note.endswith('^'):
lower_seek_note = seek_note[0:-1]
if seek_note:
upper_seek_note = seek_note + '^'
upper_found_position = list()
found_position = list()
lower_found_position = list()
print(Fore.WHITE + \
' ' * (self.max_string_name_len + 2),
end='')
for fret_nr in range(1, self.frets_count + 1):
print(Fore.WHITE + \
(' ' * (4 - len(str(fret_nr)))) + str(fret_nr),
end='')
print(Fore.YELLOW + '|', end='')
print('')
for string in reversed(self.tuning):
color = Fore.WHITE + Back.BLACK
if string == seek_note:
color = Fore.WHITE + Back.RED
found_position.append(string + "0")
elif string == upper_seek_note:
color = Fore.WHITE + Back.CYAN
upper_found_position.append(string + "0")
elif string == lower_seek_note:
color = Fore.WHITE + Back.MAGENTA
lower_found_position.append(string + "0")
print(color + \
(' ' * (self.max_string_name_len - len(string))) + \
string, end='')
print(Fore.YELLOW + '||', end='')
fret_nr = 1
for note in self.strings[string]:
color = Fore.WHITE + Back.BLACK
if note == seek_note:
color = Fore.WHITE + Back.RED
found_position.append(string + str(fret_nr))
elif note == upper_seek_note:
color = Fore.WHITE + Back.CYAN
upper_found_position.append(string + str(fret_nr))
elif note == lower_seek_note:
color = Fore.WHITE + Back.MAGENTA
lower_found_position.append(string + str(fret_nr))
print(color + \
note[0:4] + \
'-' * (4 - len(note)), end='')
print(Fore.YELLOW + Back.BLACK + '|', end='')
fret_nr += 1
print(Fore.WHITE + Back.BLACK + '')
print(Fore.WHITE + '\n')
print(Back.CYAN + ' ' + Back.BLACK + \
' Found octave-higher note {} on: {}'.format(upper_seek_note,
upper_found_position))
print(Back.RED + ' ' + Back.BLACK + \
' Found note {} on: {}'.format(seek_note,
found_position))
print(Fore.WHITE + \
Back.MAGENTA + ' ' + Back.BLACK + \
' Found octave-lower note {} on: {}'.format(lower_seek_note,
lower_found_position))
| mariuszlitwin/frets | frets.py | Python | apache-2.0 | 4,690 |
/*
* PartitioningOperators.java Feb 3 2014, 03:44
*
* Copyright 2014 Drunken Dev.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.drunkendev.lambdas;
import com.drunkendev.lambdas.domain.DomainService;
import com.drunkendev.lambdas.domain.Order;
import com.drunkendev.lambdas.helper.IndexHolder;
import com.drunkendev.lambdas.helper.MutableBoolean;
import java.util.ArrayList;
import java.util.Arrays;
/**
*
* @author Brett Ryan
*/
public class PartitioningOperators {
private final DomainService ds;
/**
* Creates a new {@code PartitioningOperators} instance.
*/
public PartitioningOperators() {
this.ds = new DomainService();
}
public static void main(String[] args) {
PartitioningOperators po = new PartitioningOperators();
po.lambda20();
po.lambda21();
po.lambda22();
po.lambda23();
po.lambda24();
po.lambda25();
po.lambda26();
po.lambda27();
}
public void lambda20() {
System.out.println("\nFirst 3 numbers:");
int[] numbers = {5, 4, 1, 3, 9, 8, 6, 7, 2, 0};
Arrays.stream(numbers)
.limit(3)
.forEach(System.out::println);
}
public void lambda21() {
System.out.println("\nFirst 3 orders in WA:");
ds.getCustomerList().stream()
.filter(c -> "WA".equalsIgnoreCase(c.getRegion()))
.flatMap(c -> c.getOrders().stream()
.map(n -> new CustOrder(c.getCustomerId(), n))
).limit(3)
.forEach(System.out::println);
}
public void lambda22() {
System.out.println("\nAll but first 4 numbers:");
int[] numbers = {5, 4, 1, 3, 9, 8, 6, 7, 2, 0};
Arrays.stream(numbers)
.skip(4)
.forEach(System.out::println);
}
public void lambda23() {
System.out.println("\nAll but first 2 orders in WA:");
ds.getCustomerList().stream()
.filter(c -> "WA".equalsIgnoreCase(c.getRegion()))
.flatMap(c -> c.getOrders().stream()
.map(n -> new CustOrder(c.getCustomerId(), n))
).skip(2)
.forEach(System.out::println);
}
/**
* Unfortunately this method will not short circuit and will continue to
* iterate until the end of the stream. I need to figure out a better way to
* handle this.
*/
public void lambda24() {
System.out.println("\nFirst numbers less than 6:");
int[] numbers = {5, 4, 1, 3, 9, 8, 6, 7, 2, 0};
MutableBoolean mb = new MutableBoolean(true);
Arrays.stream(numbers)
.collect(ArrayList<Integer>::new,
(output, v) -> {
if (mb.isTrue()) {
if (v < 6) {
output.add(v);
} else {
mb.flip();
}
}
},
(c1, c2) -> c1.addAll(c2))
.forEach(System.out::println);
}
public void lambda25() {
System.out.println("\nFirst numbers not less than their position:");
int[] numbers = {5, 4, 1, 3, 9, 8, 6, 7, 2, 0};
IndexHolder i = new IndexHolder();
MutableBoolean mb = new MutableBoolean(true);
Arrays.stream(numbers)
.collect(ArrayList<Integer>::new,
(output, v) -> {
if (mb.isTrue()) {
if (v > i.postIncrement()) {
output.add(v);
} else {
mb.flip();
}
}
},
(c1, c2) -> c1.addAll(c2))
.forEach(System.out::println);
}
public void lambda26() {
System.out.println("\nAll elements starting from first element divisible by 3:");
int[] numbers = {5, 4, 1, 3, 9, 8, 6, 7, 2, 0};
MutableBoolean mb = new MutableBoolean(false);
Arrays.stream(numbers)
.collect(ArrayList<Integer>::new,
(output, v) -> {
if (mb.isTrue()) {
output.add(v);
} else if (v % 3 == 0) {
output.add(v);
mb.flip();
}
},
(c1, c2) -> c1.addAll(c2))
.forEach(System.out::println);
}
public void lambda27() {
System.out.println("\nAll elements starting from first element less than its position:");
int[] numbers = {5, 4, 1, 3, 9, 8, 6, 7, 2, 0};
IndexHolder i = new IndexHolder();
MutableBoolean mb = new MutableBoolean(false);
Arrays.stream(numbers)
.collect(ArrayList<Integer>::new,
(output, v) -> {
if (mb.isTrue()) {
output.add(v);
} else if (v < i.postIncrement()) {
output.add(v);
mb.flip();
}
},
(c1, c2) -> c1.addAll(c2)
)
.forEach(System.out::println);
}
private static class CustOrder {
private final String customerId;
private final Order order;
public CustOrder(String customerId, Order order) {
this.customerId = customerId;
this.order = order;
}
public String getCustomerId() {
return customerId;
}
public Order getOrder() {
return order;
}
@Override
public String toString() {
return String.format("CustOrder[customerId=%s,orderId=%d,orderDate=%s]",
customerId, order.getOrderId(), order.getOrderDate());
}
}
}
| brettryan/jdk8-lambda-samples | src/main/java/com/drunkendev/lambdas/PartitioningOperators.java | Java | apache-2.0 | 6,846 |
package com.esri.mapred;
import com.esri.io.PointFeatureWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.mapred.InputSplit;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapred.RecordReader;
import org.apache.hadoop.mapred.Reporter;
import java.io.IOException;
/**
*/
public class PointFeatureInputFormat
extends AbstractInputFormat<PointFeatureWritable>
{
private final class PointFeatureReader
extends AbstractFeatureReader<PointFeatureWritable>
{
private final PointFeatureWritable m_pointFeatureWritable = new PointFeatureWritable();
public PointFeatureReader(
final InputSplit inputSplit,
final JobConf jobConf) throws IOException
{
super(inputSplit, jobConf);
}
@Override
public PointFeatureWritable createValue()
{
return m_pointFeatureWritable;
}
@Override
protected void next() throws IOException
{
m_shpReader.queryPoint(m_pointFeatureWritable.point);
putAttributes(m_pointFeatureWritable.attributes);
}
}
@Override
public RecordReader<LongWritable, PointFeatureWritable> getRecordReader(
final InputSplit inputSplit,
final JobConf jobConf,
final Reporter reporter) throws IOException
{
return new PointFeatureReader(inputSplit, jobConf);
}
}
| syntelos/shapefile-java | src/com/esri/mapred/PointFeatureInputFormat.java | Java | apache-2.0 | 1,483 |
## Ghost.org
##### Downloading & Using Theme
```bash
apt-get update && apt-get install git-core -y # needed to clone theme
git clone https://github.com/polygonix/N-Coded.git /var/www/ghost/content/themes/ # clone theme
# Login to admin and go this url to change it /ghost/settings/general/
```
| Fuxingloh/Cheatsheet | ghost.md | Markdown | apache-2.0 | 297 |
// -----------------------------------------------------------------------------------------
// <copyright file="TableSasUnitTests.cs" company="Microsoft">
// Copyright 2013 Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
// -----------------------------------------------------------------------------------------
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Auth;
using Microsoft.WindowsAzure.Storage.Shared.Protocol;
using Microsoft.WindowsAzure.Storage.Table.Entities;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Threading;
using System.Xml.Linq;
namespace Microsoft.WindowsAzure.Storage.Table
{
#pragma warning disable 0618
[TestClass]
public class TableSasUnitTests : TableTestBase
{
#region Locals + Ctors
public TableSasUnitTests()
{
}
private TestContext testContextInstance;
/// <summary>
///Gets or sets the test context which provides
///information about and functionality for the current test run.
///</summary>
public TestContext TestContext
{
get
{
return testContextInstance;
}
set
{
testContextInstance = value;
}
}
#endregion
#region Additional test attributes
//
// You can use the following additional attributes as you write your tests:
//
// Use ClassInitialize to run code before running the first test in the class
// [ClassInitialize()]
// public static void MyClassInitialize(TestContext testContext) { }
//
// Use ClassCleanup to run code after all tests in a class have run
// [ClassCleanup()]
// public static void MyClassCleanup() { }
//
// Use TestInitialize to run code before running each test
//
//
// Use TestInitialize to run code before running each test
[TestInitialize()]
public void MyTestInitialize()
{
if (TestBase.TableBufferManager != null)
{
TestBase.TableBufferManager.OutstandingBufferCount = 0;
}
}
//
// Use TestCleanup to run code after each test has run
[TestCleanup()]
public void MyTestCleanup()
{
if (TestBase.TableBufferManager != null)
{
Assert.AreEqual(0, TestBase.TableBufferManager.OutstandingBufferCount);
}
}
#endregion
#region Constructor Tests
[TestMethod]
[Description("Test TableSas via various constructors")]
[TestCategory(ComponentCategory.Table)]
[TestCategory(TestTypeCategory.UnitTest)]
[TestCategory(SmokeTestCategory.NonSmoke)]
[TestCategory(TenantTypeCategory.DevFabric), TestCategory(TenantTypeCategory.Cloud)]
public void TableSASConstructors()
{
CloudTableClient tableClient = GenerateCloudTableClient();
CloudTable table = tableClient.GetTableReference("T" + Guid.NewGuid().ToString("N"));
try
{
table.Create();
table.Execute(TableOperation.Insert(new BaseEntity("PK", "RK")));
// Prepare SAS authentication with full permissions
string sasToken = table.GetSharedAccessSignature(
new SharedAccessTablePolicy
{
Permissions = SharedAccessTablePermissions.Add | SharedAccessTablePermissions.Delete | SharedAccessTablePermissions.Query,
SharedAccessExpiryTime = DateTimeOffset.Now.AddMinutes(30)
},
null /* accessPolicyIdentifier */,
null /* startPk */,
null /* startRk */,
null /* endPk */,
null /* endRk */);
CloudStorageAccount sasAccount;
StorageCredentials sasCreds;
CloudTableClient sasClient;
CloudTable sasTable;
Uri baseUri = new Uri(TestBase.TargetTenantConfig.TableServiceEndpoint);
// SAS via connection string parse
sasAccount = CloudStorageAccount.Parse(string.Format("TableEndpoint={0};SharedAccessSignature={1}", baseUri.AbsoluteUri, sasToken));
sasClient = sasAccount.CreateCloudTableClient();
sasTable = sasClient.GetTableReference(table.Name);
Assert.AreEqual(1, sasTable.ExecuteQuery(new TableQuery<BaseEntity>()).Count());
// SAS via account constructor
sasCreds = new StorageCredentials(sasToken);
sasAccount = new CloudStorageAccount(sasCreds, null, null, baseUri, null);
sasClient = sasAccount.CreateCloudTableClient();
sasTable = sasClient.GetTableReference(table.Name);
Assert.AreEqual(1, sasTable.ExecuteQuery(new TableQuery<BaseEntity>()).Count());
// SAS via client constructor URI + Creds
sasCreds = new StorageCredentials(sasToken);
sasClient = new CloudTableClient(baseUri, sasCreds);
sasTable = sasClient.GetTableReference(table.Name);
Assert.AreEqual(1, sasTable.ExecuteQuery(new TableQuery<BaseEntity>()).Count());
// SAS via CloudTable constructor Uri + Client
sasCreds = new StorageCredentials(sasToken);
sasTable = new CloudTable(table.Uri, tableClient.Credentials);
sasClient = sasTable.ServiceClient;
Assert.AreEqual(1, sasTable.ExecuteQuery(new TableQuery<BaseEntity>()).Count());
}
finally
{
table.DeleteIfExists();
}
}
#endregion
#region Permissions
[TestMethod]
[Description("Tests setting and getting table permissions")]
[TestCategory(ComponentCategory.Table)]
[TestCategory(TestTypeCategory.UnitTest)]
[TestCategory(SmokeTestCategory.NonSmoke)]
[TestCategory(TenantTypeCategory.DevFabric), TestCategory(TenantTypeCategory.Cloud)]
public void TableSetGetPermissions()
{
CloudTableClient tableClient = GenerateCloudTableClient();
CloudTable table = tableClient.GetTableReference("T" + Guid.NewGuid().ToString("N"));
try
{
table.Create();
table.Execute(TableOperation.Insert(new BaseEntity("PK", "RK")));
TablePermissions expectedPermissions = new TablePermissions();
TablePermissions testPermissions = table.GetPermissions();
AssertPermissionsEqual(expectedPermissions, testPermissions);
// Add a policy, check setting and getting.
expectedPermissions.SharedAccessPolicies.Add(Guid.NewGuid().ToString(), new SharedAccessTablePolicy
{
Permissions = SharedAccessTablePermissions.Query,
SharedAccessStartTime = DateTimeOffset.Now - TimeSpan.FromHours(1),
SharedAccessExpiryTime = DateTimeOffset.Now + TimeSpan.FromHours(1)
});
table.SetPermissions(expectedPermissions);
Thread.Sleep(30 * 1000);
testPermissions = table.GetPermissions();
AssertPermissionsEqual(expectedPermissions, testPermissions);
}
finally
{
table.DeleteIfExists();
}
}
[TestMethod]
[Description("Tests Null Access Policy")]
[TestCategory(ComponentCategory.Table)]
[TestCategory(TestTypeCategory.UnitTest)]
[TestCategory(SmokeTestCategory.NonSmoke)]
[TestCategory(TenantTypeCategory.DevFabric), TestCategory(TenantTypeCategory.Cloud)]
public void TableSASNullAccessPolicy()
{
CloudTableClient tableClient = GenerateCloudTableClient();
CloudTable table = tableClient.GetTableReference("T" + Guid.NewGuid().ToString("N"));
try
{
table.Create();
table.Execute(TableOperation.Insert(new BaseEntity("PK", "RK")));
TablePermissions expectedPermissions = new TablePermissions();
// Add a policy
expectedPermissions.SharedAccessPolicies.Add(Guid.NewGuid().ToString(), new SharedAccessTablePolicy
{
Permissions = SharedAccessTablePermissions.Query | SharedAccessTablePermissions.Add,
SharedAccessStartTime = DateTimeOffset.Now - TimeSpan.FromHours(1),
SharedAccessExpiryTime = DateTimeOffset.Now + TimeSpan.FromHours(1)
});
table.SetPermissions(expectedPermissions);
Thread.Sleep(30 * 1000);
// Generate the sasToken the user should use
string sasToken = table.GetSharedAccessSignature(null, expectedPermissions.SharedAccessPolicies.First().Key, "AAAA", null, "AAAA", null);
CloudTable sasTable = new CloudTable(table.Uri, new StorageCredentials(sasToken));
sasTable.Execute(TableOperation.Insert(new DynamicTableEntity("AAAA", "foo")));
TableResult result = sasTable.Execute(TableOperation.Retrieve("AAAA", "foo"));
Assert.IsNotNull(result.Result);
// revoke table permissions
table.SetPermissions(new TablePermissions());
Thread.Sleep(30 * 1000);
OperationContext opContext = new OperationContext();
try
{
sasTable.Execute(TableOperation.Insert(new DynamicTableEntity("AAAA", "foo2")), null, opContext);
Assert.Fail();
}
catch (Exception)
{
Assert.AreEqual(opContext.LastResult.HttpStatusCode, (int)HttpStatusCode.Forbidden);
}
opContext = new OperationContext();
try
{
result = sasTable.Execute(TableOperation.Retrieve("AAAA", "foo"), null, opContext);
Assert.Fail();
}
catch (Exception)
{
Assert.AreEqual(opContext.LastResult.HttpStatusCode, (int)HttpStatusCode.Forbidden);
}
}
finally
{
table.DeleteIfExists();
}
}
#endregion
#region SAS Operations
[TestMethod]
[Description("Tests table SAS with query permissions.")]
[TestCategory(ComponentCategory.Table)]
[TestCategory(TestTypeCategory.UnitTest)]
[TestCategory(SmokeTestCategory.NonSmoke)]
[TestCategory(TenantTypeCategory.DevFabric), TestCategory(TenantTypeCategory.Cloud)]
public void TableSasQueryTestSync()
{
TestTableSas(SharedAccessTablePermissions.Query);
}
[TestMethod]
[Description("Tests table SAS with delete permissions.")]
[TestCategory(ComponentCategory.Table)]
[TestCategory(TestTypeCategory.UnitTest)]
[TestCategory(SmokeTestCategory.NonSmoke)]
[TestCategory(TenantTypeCategory.DevFabric), TestCategory(TenantTypeCategory.Cloud)]
public void TableSasDeleteTestSync()
{
TestTableSas(SharedAccessTablePermissions.Delete);
}
[TestMethod]
[Description("Tests table SAS with process and update permissions.")]
[TestCategory(ComponentCategory.Table)]
[TestCategory(TestTypeCategory.UnitTest)]
[TestCategory(SmokeTestCategory.NonSmoke)]
[TestCategory(TenantTypeCategory.DevFabric), TestCategory(TenantTypeCategory.Cloud)]
public void TableSasUpdateTestSync()
{
TestTableSas(SharedAccessTablePermissions.Update);
}
[TestMethod]
[Description("Tests table SAS with add permissions.")]
[TestCategory(ComponentCategory.Table)]
[TestCategory(TestTypeCategory.UnitTest)]
[TestCategory(SmokeTestCategory.NonSmoke)]
[TestCategory(TenantTypeCategory.DevFabric), TestCategory(TenantTypeCategory.Cloud)]
public void TableSasAddTestSync()
{
TestTableSas(SharedAccessTablePermissions.Add);
}
[TestMethod]
[Description("Tests table SAS with full permissions.")]
[TestCategory(ComponentCategory.Table)]
[TestCategory(TestTypeCategory.UnitTest)]
[TestCategory(SmokeTestCategory.NonSmoke)]
[TestCategory(TenantTypeCategory.DevFabric), TestCategory(TenantTypeCategory.Cloud)]
public void TableSasFullTestSync()
{
TestTableSas(SharedAccessTablePermissions.Query | SharedAccessTablePermissions.Delete | SharedAccessTablePermissions.Update | SharedAccessTablePermissions.Add);
}
/// <summary>
/// Tests table access permissions with SAS, using a stored policy and using permissions on the URI.
/// Various table range constraints are tested.
/// </summary>
/// <param name="accessPermissions">The permissions to test.</param>
internal void TestTableSas(SharedAccessTablePermissions accessPermissions)
{
string startPk = "M";
string startRk = "F";
string endPk = "S";
string endRk = "T";
// No ranges specified
TestTableSasWithRange(accessPermissions, null, null, null, null);
// All ranges specified
TestTableSasWithRange(accessPermissions, startPk, startRk, endPk, endRk);
// StartPk & StartRK specified
TestTableSasWithRange(accessPermissions, startPk, startRk, null, null);
// StartPk specified
TestTableSasWithRange(accessPermissions, startPk, null, null, null);
// EndPk & EndRK specified
TestTableSasWithRange(accessPermissions, null, null, endPk, endRk);
// EndPk specified
TestTableSasWithRange(accessPermissions, null, null, endPk, null);
// StartPk and EndPk specified
TestTableSasWithRange(accessPermissions, startPk, null, endPk, null);
// StartRk and StartRK and EndPk specified
TestTableSasWithRange(accessPermissions, startPk, startRk, endPk, null);
// StartRk and EndPK and EndPk specified
TestTableSasWithRange(accessPermissions, startPk, null, endPk, endRk);
}
/// <summary>
/// Tests table access permissions with SAS, using a stored policy and using permissions on the URI.
/// </summary>
/// <param name="accessPermissions">The permissions to test.</param>
/// <param name="startPk">The start partition key range.</param>
/// <param name="startRk">The start row key range.</param>
/// <param name="endPk">The end partition key range.</param>
/// <param name="endRk">The end row key range.</param>
internal void TestTableSasWithRange(
SharedAccessTablePermissions accessPermissions,
string startPk,
string startRk,
string endPk,
string endRk)
{
CloudTableClient tableClient = GenerateCloudTableClient();
CloudTable table = tableClient.GetTableReference("T" + Guid.NewGuid().ToString("N"));
try
{
table.Create();
// Set up a policy
string identifier = Guid.NewGuid().ToString();
TablePermissions permissions = new TablePermissions();
permissions.SharedAccessPolicies.Add(identifier, new SharedAccessTablePolicy
{
Permissions = accessPermissions,
SharedAccessExpiryTime = DateTimeOffset.Now.AddDays(1)
});
table.SetPermissions(permissions);
Thread.Sleep(30 * 1000);
// Prepare SAS authentication using access identifier
string sasString = table.GetSharedAccessSignature(new SharedAccessTablePolicy(), identifier, startPk, startRk, endPk, endRk);
CloudTableClient identifierSasClient = new CloudTableClient(tableClient.BaseUri, new StorageCredentials(sasString));
// Prepare SAS authentication using explicit policy
sasString = table.GetSharedAccessSignature(
new SharedAccessTablePolicy
{
Permissions = accessPermissions,
SharedAccessExpiryTime = DateTimeOffset.Now.AddMinutes(30)
},
null,
startPk,
startRk,
endPk,
endRk);
CloudTableClient explicitSasClient = new CloudTableClient(tableClient.BaseUri, new StorageCredentials(sasString));
// Point query
TestPointQuery(identifierSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk);
TestPointQuery(explicitSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk);
// Add row
TestAdd(identifierSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk);
TestAdd(explicitSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk);
// Update row (merge)
TestUpdateMerge(identifierSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk);
TestUpdateMerge(explicitSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk);
// Update row (replace)
TestUpdateReplace(identifierSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk);
TestUpdateReplace(explicitSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk);
// Delete row
TestDelete(identifierSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk);
TestDelete(explicitSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk);
// Upsert row (merge)
TestUpsertMerge(identifierSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk);
TestUpsertMerge(explicitSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk);
// Upsert row (replace)
TestUpsertReplace(identifierSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk);
TestUpsertReplace(explicitSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk);
}
finally
{
table.DeleteIfExists();
}
}
/// <summary>
/// Test point queries entities inside and outside the given range.
/// </summary>
/// <param name="testClient">The table client to test.</param>
/// <param name="tableName">The name of the table to test.</param>
/// <param name="accessPermissions">The access permissions of the table client.</param>
/// <param name="startPk">The start partition key range.</param>
/// <param name="startRk">The start row key range.</param>
/// <param name="endPk">The end partition key range.</param>
/// <param name="endRk">The end row key range.</param>
private void TestPointQuery(
CloudTableClient testClient,
string tableName,
SharedAccessTablePermissions accessPermissions,
string startPk,
string startRk,
string endPk,
string endRk)
{
bool expectSuccess = ((accessPermissions & SharedAccessTablePermissions.Query) != 0);
Action<BaseEntity, OperationContext> queryDelegate = (tableEntity, ctx) =>
{
TableResult retrieveResult = testClient.GetTableReference(tableName).Execute(TableOperation.Retrieve<BaseEntity>(tableEntity.PartitionKey, tableEntity.RowKey), null, ctx);
if (expectSuccess)
{
Assert.IsNotNull(retrieveResult.Result);
}
else
{
Assert.AreEqual(ctx.LastResult.HttpStatusCode, (int)HttpStatusCode.OK);
}
};
// Perform test
TestOperationWithRange(
tableName,
startPk,
startRk,
endPk,
endRk,
queryDelegate,
"point query",
expectSuccess,
expectSuccess ? HttpStatusCode.OK : HttpStatusCode.NotFound,
false,
expectSuccess);
}
/// <summary>
/// Test update (merge) on entities inside and outside the given range.
/// </summary>
/// <param name="testClient">The table client to test.</param>
/// <param name="tableName">The name of the table to test.</param>
/// <param name="accessPermissions">The access permissions of the table client.</param>
/// <param name="startPk">The start partition key range.</param>
/// <param name="startRk">The start row key range.</param>
/// <param name="endPk">The end partition key range.</param>
/// <param name="endRk">The end row key range.</param>
private void TestUpdateMerge(
CloudTableClient testClient,
string tableName,
SharedAccessTablePermissions accessPermissions,
string startPk,
string startRk,
string endPk,
string endRk)
{
Action<BaseEntity, OperationContext> updateDelegate = (tableEntity, ctx) =>
{
// Merge entity
tableEntity.A = "10";
tableEntity.ETag = "*";
testClient.GetTableReference(tableName).Execute(TableOperation.Merge(tableEntity), null, ctx);
};
bool expectSuccess = (accessPermissions & SharedAccessTablePermissions.Update) != 0;
// Perform test
TestOperationWithRange(
tableName,
startPk,
startRk,
endPk,
endRk,
updateDelegate,
"update merge",
expectSuccess,
expectSuccess ? HttpStatusCode.NoContent : HttpStatusCode.Forbidden);
}
/// <summary>
/// Test update (replace) on entities inside and outside the given range.
/// </summary>
/// <param name="testClient">The table client to test.</param>
/// <param name="tableName">The name of the table to test.</param>
/// <param name="accessPermissions">The access permissions of the table client.</param>
/// <param name="startPk">The start partition key range.</param>
/// <param name="startRk">The start row key range.</param>
/// <param name="endPk">The end partition key range.</param>
/// <param name="endRk">The end row key range.</param>
private void TestUpdateReplace(
CloudTableClient testClient,
string tableName,
SharedAccessTablePermissions accessPermissions,
string startPk,
string startRk,
string endPk,
string endRk)
{
Action<BaseEntity, OperationContext> updateDelegate = (tableEntity, ctx) =>
{
// replace entity
tableEntity.A = "20";
tableEntity.ETag = "*";
testClient.GetTableReference(tableName).Execute(TableOperation.Replace(tableEntity), null, ctx);
};
bool expectSuccess = (accessPermissions & SharedAccessTablePermissions.Update) != 0;
// Perform test
TestOperationWithRange(
tableName,
startPk,
startRk,
endPk,
endRk,
updateDelegate,
"update replace",
expectSuccess,
expectSuccess ? HttpStatusCode.NoContent : HttpStatusCode.Forbidden);
}
/// <summary>
/// Test adding entities inside and outside the given range.
/// </summary>
/// <param name="testClient">The table client to test.</param>
/// <param name="tableName">The name of the table to test.</param>
/// <param name="accessPermissions">The access permissions of the table client.</param>
/// <param name="startPk">The start partition key range.</param>
/// <param name="startRk">The start row key range.</param>
/// <param name="endPk">The end partition key range.</param>
/// <param name="endRk">The end row key range.</param>
private void TestAdd(
CloudTableClient testClient,
string tableName,
SharedAccessTablePermissions accessPermissions,
string startPk,
string startRk,
string endPk,
string endRk)
{
Action<BaseEntity, OperationContext> addDelegate = (tableEntity, ctx) =>
{
// insert entity
tableEntity.A = "10";
testClient.GetTableReference(tableName).Execute(TableOperation.Insert(tableEntity), null, ctx);
};
bool expectSuccess = (accessPermissions & SharedAccessTablePermissions.Add) != 0;
// Perform test
TestOperationWithRange(
tableName,
startPk,
startRk,
endPk,
endRk,
addDelegate,
"add",
expectSuccess,
expectSuccess ? HttpStatusCode.Created : HttpStatusCode.Forbidden);
}
/// <summary>
/// Test deleting entities inside and outside the given range.
/// </summary>
/// <param name="testClient">The table client to test.</param>
/// <param name="tableName">The name of the table to test.</param>
/// <param name="accessPermissions">The access permissions of the table client.</param>
/// <param name="startPk">The start partition key range.</param>
/// <param name="startRk">The start row key range.</param>
/// <param name="endPk">The end partition key range.</param>
/// <param name="endRk">The end row key range.</param>
private void TestDelete(
CloudTableClient testClient,
string tableName,
SharedAccessTablePermissions accessPermissions,
string startPk,
string startRk,
string endPk,
string endRk)
{
Action<BaseEntity, OperationContext> deleteDelegate = (tableEntity, ctx) =>
{
// delete entity
tableEntity.A = "10";
tableEntity.ETag = "*";
testClient.GetTableReference(tableName).Execute(TableOperation.Delete(tableEntity), null, ctx);
};
bool expectSuccess = (accessPermissions & SharedAccessTablePermissions.Delete) != 0;
// Perform test
TestOperationWithRange(
tableName,
startPk,
startRk,
endPk,
endRk,
deleteDelegate,
"delete",
expectSuccess,
expectSuccess ? HttpStatusCode.NoContent : HttpStatusCode.Forbidden);
}
/// <summary>
/// Test upsert (insert or merge) on entities inside and outside the given range.
/// </summary>
/// <param name="testClient">The table client to test.</param>
/// <param name="tableName">The name of the table to test.</param>
/// <param name="accessPermissions">The access permissions of the table client.</param>
/// <param name="startPk">The start partition key range.</param>
/// <param name="startRk">The start row key range.</param>
/// <param name="endPk">The end partition key range.</param>
/// <param name="endRk">The end row key range.</param>
private void TestUpsertMerge(
CloudTableClient testClient,
string tableName,
SharedAccessTablePermissions accessPermissions,
string startPk,
string startRk,
string endPk,
string endRk)
{
Action<BaseEntity, OperationContext> upsertDelegate = (tableEntity, ctx) =>
{
// insert or merge entity
tableEntity.A = "10";
testClient.GetTableReference(tableName).Execute(TableOperation.InsertOrMerge(tableEntity), null, ctx);
};
SharedAccessTablePermissions upsertPermissions = (SharedAccessTablePermissions.Update | SharedAccessTablePermissions.Add);
bool expectSuccess = (accessPermissions & upsertPermissions) == upsertPermissions;
// Perform test
TestOperationWithRange(
tableName,
startPk,
startRk,
endPk,
endRk,
upsertDelegate,
"upsert merge",
expectSuccess,
expectSuccess ? HttpStatusCode.NoContent : HttpStatusCode.Forbidden);
}
/// <summary>
/// Test upsert (insert or replace) on entities inside and outside the given range.
/// </summary>
/// <param name="testClient">The table client to test.</param>
/// <param name="tableName">The name of the table to test.</param>
/// <param name="accessPermissions">The access permissions of the table client.</param>
/// <param name="startPk">The start partition key range.</param>
/// <param name="startRk">The start row key range.</param>
/// <param name="endPk">The end partition key range.</param>
/// <param name="endRk">The end row key range.</param>
private void TestUpsertReplace(
CloudTableClient testClient,
string tableName,
SharedAccessTablePermissions accessPermissions,
string startPk,
string startRk,
string endPk,
string endRk)
{
Action<BaseEntity, OperationContext> upsertDelegate = (tableEntity, ctx) =>
{
// insert or replace entity
tableEntity.A = "10";
testClient.GetTableReference(tableName).Execute(TableOperation.InsertOrReplace(tableEntity), null, ctx);
};
SharedAccessTablePermissions upsertPermissions = (SharedAccessTablePermissions.Update | SharedAccessTablePermissions.Add);
bool expectSuccess = (accessPermissions & upsertPermissions) == upsertPermissions;
// Perform test
TestOperationWithRange(
tableName,
startPk,
startRk,
endPk,
endRk,
upsertDelegate,
"upsert replace",
expectSuccess,
expectSuccess ? HttpStatusCode.NoContent : HttpStatusCode.Forbidden);
}
/// <summary>
/// Test a table operation on entities inside and outside the given range.
/// </summary>
/// <param name="tableName">The name of the table to test.</param>
/// <param name="startPk">The start partition key range.</param>
/// <param name="startRk">The start row key range.</param>
/// <param name="endPk">The end partition key range.</param>
/// <param name="endRk">The end row key range.</param>
/// <param name="runOperationDelegate">A delegate with the table operation to test.</param>
/// <param name="opName">The name of the operation being tested.</param>
/// <param name="expectSuccess">Whether the operation should succeed on entities within the range.</param>
private void TestOperationWithRange(
string tableName,
string startPk,
string startRk,
string endPk,
string endRk,
Action<BaseEntity, OperationContext> runOperationDelegate,
string opName,
bool expectSuccess,
HttpStatusCode expectedStatusCode)
{
TestOperationWithRange(
tableName,
startPk,
startRk,
endPk,
endRk,
runOperationDelegate,
opName,
expectSuccess,
expectedStatusCode,
false /* isRangeQuery */);
}
/// <summary>
/// Test a table operation on entities inside and outside the given range.
/// </summary>
/// <param name="tableName">The name of the table to test.</param>
/// <param name="startPk">The start partition key range.</param>
/// <param name="startRk">The start row key range.</param>
/// <param name="endPk">The end partition key range.</param>
/// <param name="endRk">The end row key range.</param>
/// <param name="runOperationDelegate">A delegate with the table operation to test.</param>
/// <param name="opName">The name of the operation being tested.</param>
/// <param name="expectSuccess">Whether the operation should succeed on entities within the range.</param>
/// <param name="expectedStatusCode">The status code expected for the response.</param>
/// <param name="isRangeQuery">Specifies if the operation is a range query.</param>
private void TestOperationWithRange(
string tableName,
string startPk,
string startRk,
string endPk,
string endRk,
Action<BaseEntity, OperationContext> runOperationDelegate,
string opName,
bool expectSuccess,
HttpStatusCode expectedStatusCode,
bool isRangeQuery)
{
TestOperationWithRange(
tableName,
startPk,
startRk,
endPk,
endRk,
runOperationDelegate,
opName,
expectSuccess,
expectedStatusCode,
isRangeQuery,
false /* isPointQuery */);
}
/// <summary>
/// Test a table operation on entities inside and outside the given range.
/// </summary>
/// <param name="tableName">The name of the table to test.</param>
/// <param name="startPk">The start partition key range.</param>
/// <param name="startRk">The start row key range.</param>
/// <param name="endPk">The end partition key range.</param>
/// <param name="endRk">The end row key range.</param>
/// <param name="runOperationDelegate">A delegate with the table operation to test.</param>
/// <param name="opName">The name of the operation being tested.</param>
/// <param name="expectSuccess">Whether the operation should succeed on entities within the range.</param>
/// <param name="expectedStatusCode">The status code expected for the response.</param>
/// <param name="isRangeQuery">Specifies if the operation is a range query.</param>
/// <param name="isPointQuery">Specifies if the operation is a point query.</param>
private void TestOperationWithRange(
string tableName,
string startPk,
string startRk,
string endPk,
string endRk,
Action<BaseEntity, OperationContext> runOperationDelegate,
string opName,
bool expectSuccess,
HttpStatusCode expectedStatusCode,
bool isRangeQuery,
bool isPointQuery)
{
CloudTableClient referenceClient = GenerateCloudTableClient();
string partitionKey = startPk ?? endPk ?? "M";
string rowKey = startRk ?? endRk ?? "S";
// if we expect a success for creation - avoid inserting duplicate entities
BaseEntity tableEntity = new BaseEntity(partitionKey, rowKey);
if (expectedStatusCode == HttpStatusCode.Created)
{
try
{
tableEntity.ETag = "*";
referenceClient.GetTableReference(tableName).Execute(TableOperation.Delete(tableEntity));
}
catch (Exception)
{
}
}
else
{
// only for add we should not be adding the entity
referenceClient.GetTableReference(tableName).Execute(TableOperation.InsertOrReplace(tableEntity));
}
if (expectSuccess)
{
runOperationDelegate(tableEntity, null);
}
else
{
TestHelper.ExpectedException(
(ctx) => runOperationDelegate(tableEntity, ctx),
string.Format("{0} without appropriate permission.", opName),
(int)HttpStatusCode.Forbidden);
}
if (startPk != null)
{
tableEntity.PartitionKey = "A";
if (startPk.CompareTo(tableEntity.PartitionKey) <= 0)
{
Assert.Inconclusive("Test error: partition key for this test must not be less than or equal to \"A\"");
}
TestHelper.ExpectedException(
(ctx) => runOperationDelegate(tableEntity, ctx),
string.Format("{0} before allowed partition key range", opName),
(int)(isPointQuery ? HttpStatusCode.NotFound : HttpStatusCode.Forbidden));
tableEntity.PartitionKey = partitionKey;
}
if (endPk != null)
{
tableEntity.PartitionKey = "Z";
if (endPk.CompareTo(tableEntity.PartitionKey) >= 0)
{
Assert.Inconclusive("Test error: partition key for this test must not be greater than or equal to \"Z\"");
}
TestHelper.ExpectedException(
(ctx) => runOperationDelegate(tableEntity, ctx),
string.Format("{0} after allowed partition key range", opName),
(int)(isPointQuery ? HttpStatusCode.NotFound : HttpStatusCode.Forbidden));
tableEntity.PartitionKey = partitionKey;
}
if (startRk != null)
{
if (isRangeQuery || startPk != null)
{
tableEntity.PartitionKey = startPk;
tableEntity.RowKey = "A";
if (startRk.CompareTo(tableEntity.RowKey) <= 0)
{
Assert.Inconclusive("Test error: row key for this test must not be less than or equal to \"A\"");
}
TestHelper.ExpectedException(
(ctx) => runOperationDelegate(tableEntity, ctx),
string.Format("{0} before allowed row key range", opName),
(int)(isPointQuery ? HttpStatusCode.NotFound : HttpStatusCode.Forbidden));
tableEntity.RowKey = rowKey;
}
}
if (endRk != null)
{
if (isRangeQuery || endPk != null)
{
tableEntity.PartitionKey = endPk;
tableEntity.RowKey = "Z";
if (endRk.CompareTo(tableEntity.RowKey) >= 0)
{
Assert.Inconclusive("Test error: row key for this test must not be greater than or equal to \"Z\"");
}
TestHelper.ExpectedException(
(ctx) => runOperationDelegate(tableEntity, ctx),
string.Format("{0} after allowed row key range", opName),
(int)(isPointQuery ? HttpStatusCode.NotFound : HttpStatusCode.Forbidden));
tableEntity.RowKey = rowKey;
}
}
}
#endregion
#region SAS Error Conditions
//[TestMethod] // Disabled until service bug is fixed
[Description("Attempt to use SAS to authenticate table operations that must not work with SAS.")]
[TestCategory(ComponentCategory.Table)]
[TestCategory(TestTypeCategory.UnitTest)]
[TestCategory(SmokeTestCategory.NonSmoke)]
[TestCategory(TenantTypeCategory.DevFabric), TestCategory(TenantTypeCategory.Cloud)]
public void TableSasInvalidOperations()
{
CloudTableClient tableClient = GenerateCloudTableClient();
CloudTable table = tableClient.GetTableReference("T" + Guid.NewGuid().ToString("N"));
try
{
table.Create();
// Prepare SAS authentication with full permissions
string sasString = table.GetSharedAccessSignature(
new SharedAccessTablePolicy
{
Permissions = SharedAccessTablePermissions.Delete,
SharedAccessExpiryTime = DateTimeOffset.UtcNow.AddMinutes(30)
},
null,
null,
null,
null,
null);
CloudTableClient sasClient = new CloudTableClient(tableClient.BaseUri, new StorageCredentials(sasString));
// Construct a valid set of service properties to upload.
ServiceProperties properties = new ServiceProperties();
properties.Logging.Version = Constants.AnalyticsConstants.LoggingVersionV1;
properties.HourMetrics.Version = Constants.AnalyticsConstants.MetricsVersionV1;
properties.Logging.RetentionDays = 9;
sasClient.GetServiceProperties();
sasClient.SetServiceProperties(properties);
// Test invalid client operations
// BUGBUG: ListTables hides the exception. We should fix this
// TestHelpers.ExpectedException(() => sasClient.ListTablesSegmented(), "List tables with SAS", HttpStatusCode.Forbidden);
TestHelper.ExpectedException((ctx) => sasClient.GetServiceProperties(), "Get service properties with SAS", (int)HttpStatusCode.Forbidden);
TestHelper.ExpectedException((ctx) => sasClient.SetServiceProperties(properties), "Set service properties with SAS", (int)HttpStatusCode.Forbidden);
CloudTable sasTable = sasClient.GetTableReference(table.Name);
// Verify that creation fails with SAS
TestHelper.ExpectedException((ctx) => sasTable.Create(null, ctx), "Create a table with SAS", (int)HttpStatusCode.Forbidden);
// Create the table.
table.Create();
// Test invalid table operations
TestHelper.ExpectedException((ctx) => sasTable.Delete(null, ctx), "Delete a table with SAS", (int)HttpStatusCode.Forbidden);
TestHelper.ExpectedException((ctx) => sasTable.GetPermissions(null, ctx), "Get ACL with SAS", (int)HttpStatusCode.Forbidden);
TestHelper.ExpectedException((ctx) => sasTable.SetPermissions(new TablePermissions(), null, ctx), "Set ACL with SAS", (int)HttpStatusCode.Forbidden);
}
finally
{
table.DeleteIfExists();
}
}
#endregion
#region Update SAS token
[TestMethod]
[Description("Update table SAS.")]
[TestCategory(ComponentCategory.Table)]
[TestCategory(TestTypeCategory.UnitTest)]
[TestCategory(SmokeTestCategory.NonSmoke)]
[TestCategory(TenantTypeCategory.DevFabric), TestCategory(TenantTypeCategory.Cloud)]
public void TableUpdateSasTestSync()
{
CloudTableClient tableClient = GenerateCloudTableClient();
CloudTable table = tableClient.GetTableReference("T" + Guid.NewGuid().ToString("N"));
try
{
table.Create();
BaseEntity entity = new BaseEntity("PK", "RK");
table.Execute(TableOperation.Insert(entity));
SharedAccessTablePolicy policy = new SharedAccessTablePolicy()
{
SharedAccessStartTime = DateTimeOffset.UtcNow.AddMinutes(-5),
SharedAccessExpiryTime = DateTimeOffset.UtcNow.AddMinutes(30),
Permissions = SharedAccessTablePermissions.Delete,
};
string sasToken = table.GetSharedAccessSignature(policy);
StorageCredentials creds = new StorageCredentials(sasToken);
CloudTable sasTable = new CloudTable(table.Uri, creds);
TestHelper.ExpectedException(
() => sasTable.Execute(TableOperation.Insert(new BaseEntity("PK", "RK2"))),
"Try to insert an entity when SAS doesn't allow inserts",
HttpStatusCode.Forbidden);
sasTable.Execute(TableOperation.Delete(entity));
SharedAccessTablePolicy policy2 = new SharedAccessTablePolicy()
{
SharedAccessStartTime = DateTimeOffset.UtcNow.AddMinutes(-5),
SharedAccessExpiryTime = DateTimeOffset.UtcNow.AddMinutes(30),
Permissions = SharedAccessTablePermissions.Delete | SharedAccessTablePermissions.Add,
};
string sasToken2 = table.GetSharedAccessSignature(policy2);
creds.UpdateSASToken(sasToken2);
sasTable = new CloudTable(table.Uri, creds);
sasTable.Execute(TableOperation.Insert(new BaseEntity("PK", "RK2")));
}
finally
{
table.DeleteIfExists();
}
}
#endregion
#region SasUri
[TestMethod]
[Description("Use table SasUri.")]
[TestCategory(ComponentCategory.Table)]
[TestCategory(TestTypeCategory.UnitTest)]
[TestCategory(SmokeTestCategory.NonSmoke)]
[TestCategory(TenantTypeCategory.DevFabric), TestCategory(TenantTypeCategory.Cloud)]
public void TableSasUriTestSync()
{
CloudTableClient tableClient = GenerateCloudTableClient();
CloudTable table = tableClient.GetTableReference("T" + Guid.NewGuid().ToString("N"));
try
{
table.Create();
BaseEntity entity = new BaseEntity("PK", "RK");
BaseEntity entity1 = new BaseEntity("PK", "RK1");
table.Execute(TableOperation.Insert(entity));
table.Execute(TableOperation.Insert(entity1));
SharedAccessTablePolicy policy = new SharedAccessTablePolicy()
{
SharedAccessStartTime = DateTimeOffset.UtcNow.AddMinutes(-5),
SharedAccessExpiryTime = DateTimeOffset.UtcNow.AddMinutes(30),
Permissions = SharedAccessTablePermissions.Delete,
};
string sasToken = table.GetSharedAccessSignature(policy);
StorageCredentials creds = new StorageCredentials(sasToken);
CloudStorageAccount sasAcc = new CloudStorageAccount(creds, null /* blobEndpoint */, null /* queueEndpoint */, new Uri(TestBase.TargetTenantConfig.TableServiceEndpoint), null /* fileEndpoint */);
CloudTableClient client = sasAcc.CreateCloudTableClient();
CloudTable sasTable = new CloudTable(client.Credentials.TransformUri(table.Uri));
sasTable.Execute(TableOperation.Delete(entity));
CloudTable sasTable2 = new CloudTable(new Uri(table.Uri.ToString() + sasToken));
sasTable2.Execute(TableOperation.Delete(entity1));
}
finally
{
table.DeleteIfExists();
}
}
[TestMethod]
[Description("Use table SasUri.")]
[TestCategory(ComponentCategory.Table)]
[TestCategory(TestTypeCategory.UnitTest)]
[TestCategory(SmokeTestCategory.NonSmoke)]
[TestCategory(TenantTypeCategory.DevFabric), TestCategory(TenantTypeCategory.Cloud)]
public void TableSasUriPkRkTestSync()
{
CloudTableClient tableClient = GenerateCloudTableClient();
CloudTable table = tableClient.GetTableReference("T" + Guid.NewGuid().ToString("N"));
try
{
table.Create();
SharedAccessTablePolicy policy = new SharedAccessTablePolicy()
{
SharedAccessStartTime = DateTimeOffset.UtcNow.AddMinutes(-5),
SharedAccessExpiryTime = DateTimeOffset.UtcNow.AddMinutes(30),
Permissions = SharedAccessTablePermissions.Add,
};
string sasTokenPkRk = table.GetSharedAccessSignature(policy, null, "tables_batch_0", "00",
"tables_batch_1", "04");
StorageCredentials credsPkRk = new StorageCredentials(sasTokenPkRk);
// transform uri from credentials
CloudTable sasTableTransformed = new CloudTable(credsPkRk.TransformUri(table.Uri));
// create uri by appending sas
CloudTable sasTableDirect = new CloudTable(new Uri(table.Uri.ToString() + sasTokenPkRk));
BaseEntity pkrkEnt = new BaseEntity("tables_batch_0", "00");
sasTableTransformed.Execute(TableOperation.Insert(pkrkEnt));
pkrkEnt = new BaseEntity("tables_batch_0", "01");
sasTableDirect.Execute(TableOperation.Insert(pkrkEnt));
Action<BaseEntity, CloudTable, OperationContext> insertDelegate = (tableEntity, sasTable1, ctx) =>
{
sasTable1.Execute(TableOperation.Insert(tableEntity), null, ctx);
};
pkrkEnt = new BaseEntity("tables_batch_2", "00");
TestHelper.ExpectedException(
(ctx) => insertDelegate(pkrkEnt, sasTableTransformed, ctx),
string.Format("Inserted entity without appropriate SAS permissions."),
(int)HttpStatusCode.Forbidden);
TestHelper.ExpectedException(
(ctx) => insertDelegate(pkrkEnt, sasTableDirect, ctx),
string.Format("Inserted entity without appropriate SAS permissions."),
(int)HttpStatusCode.Forbidden);
pkrkEnt = new BaseEntity("tables_batch_1", "05");
TestHelper.ExpectedException(
(ctx) => insertDelegate(pkrkEnt, sasTableTransformed, ctx),
string.Format("Inserted entity without appropriate SAS permissions."),
(int)HttpStatusCode.Forbidden);
TestHelper.ExpectedException(
(ctx) => insertDelegate(pkrkEnt, sasTableDirect, ctx),
string.Format("Inserted entity without appropriate SAS permissions."),
(int)HttpStatusCode.Forbidden);
}
finally
{
table.DeleteIfExists();
}
}
#endregion
#region SASIPAddressTests
/// <summary>
/// Helper function for testing the IPAddressOrRange funcitonality for tables
/// </summary>
/// <param name="generateInitialIPAddressOrRange">Function that generates an initial IPAddressOrRange object to use. This is expected to fail on the service.</param>
/// <param name="generateFinalIPAddressOrRange">Function that takes in the correct IP address (according to the service) and returns the IPAddressOrRange object
/// that should be accepted by the service</param>
public void CloudTableSASIPAddressHelper(Func<IPAddressOrRange> generateInitialIPAddressOrRange, Func<IPAddress, IPAddressOrRange> generateFinalIPAddressOrRange)
{
CloudTableClient tableClient = GenerateCloudTableClient();
CloudTable table = tableClient.GetTableReference("T" + Guid.NewGuid().ToString("N"));
try
{
table.Create();
SharedAccessTablePolicy policy = new SharedAccessTablePolicy()
{
Permissions = SharedAccessTablePermissions.Query,
SharedAccessStartTime = DateTimeOffset.UtcNow.AddMinutes(-5),
SharedAccessExpiryTime = DateTimeOffset.UtcNow.AddMinutes(30),
};
DynamicTableEntity entity = new DynamicTableEntity("PK", "RK", null, new Dictionary<string, EntityProperty>() {{"prop", new EntityProperty(4)}});
table.Execute(new TableOperation(entity, TableOperationType.Insert));
// The plan then is to use an incorrect IP address to make a call to the service
// ensure that we get an error message
// parse the error message to get my actual IP (as far as the service sees)
// then finally test the success case to ensure we can actually make requests
IPAddressOrRange ipAddressOrRange = generateInitialIPAddressOrRange();
string tableToken = table.GetSharedAccessSignature(policy, null, null, null, null, null, null, ipAddressOrRange);
StorageCredentials tableSAS = new StorageCredentials(tableToken);
Uri tableSASUri = tableSAS.TransformUri(table.Uri);
StorageUri tableSASStorageUri = tableSAS.TransformUri(table.StorageUri);
CloudTable tableWithSAS = new CloudTable(tableSASUri);
OperationContext opContext = new OperationContext();
IPAddress actualIP = null;
bool exceptionThrown = false;
TableResult result = null;
DynamicTableEntity resultEntity = new DynamicTableEntity();
TableOperation retrieveOp = new TableOperation(resultEntity, TableOperationType.Retrieve);
retrieveOp.RetrievePartitionKey = entity.PartitionKey;
retrieveOp.RetrieveRowKey = entity.RowKey;
try
{
result = tableWithSAS.Execute(retrieveOp, null, opContext);
}
catch (StorageException e)
{
string[] parts = e.RequestInformation.HttpStatusMessage.Split(' ');
actualIP = IPAddress.Parse(parts[parts.Length - 1].Trim('.'));
exceptionThrown = true;
Assert.IsNotNull(actualIP);
}
Assert.IsTrue(exceptionThrown);
ipAddressOrRange = generateFinalIPAddressOrRange(actualIP);
tableToken = table.GetSharedAccessSignature(policy, null, null, null, null, null, null, ipAddressOrRange);
tableSAS = new StorageCredentials(tableToken);
tableSASUri = tableSAS.TransformUri(table.Uri);
tableSASStorageUri = tableSAS.TransformUri(table.StorageUri);
tableWithSAS = new CloudTable(tableSASUri);
resultEntity = new DynamicTableEntity();
retrieveOp = new TableOperation(resultEntity, TableOperationType.Retrieve);
retrieveOp.RetrievePartitionKey = entity.PartitionKey;
retrieveOp.RetrieveRowKey = entity.RowKey;
resultEntity = (DynamicTableEntity)tableWithSAS.Execute(retrieveOp).Result;
Assert.AreEqual(entity.Properties["prop"].PropertyType, resultEntity.Properties["prop"].PropertyType);
Assert.AreEqual(entity.Properties["prop"].Int32Value.Value, resultEntity.Properties["prop"].Int32Value.Value);
Assert.IsTrue(table.StorageUri.PrimaryUri.Equals(tableWithSAS.Uri));
Assert.IsNull(tableWithSAS.StorageUri.SecondaryUri);
tableWithSAS = new CloudTable(tableSASStorageUri, null);
resultEntity = new DynamicTableEntity();
retrieveOp = new TableOperation(resultEntity, TableOperationType.Retrieve);
retrieveOp.RetrievePartitionKey = entity.PartitionKey;
retrieveOp.RetrieveRowKey = entity.RowKey;
resultEntity = (DynamicTableEntity)tableWithSAS.Execute(retrieveOp).Result;
Assert.AreEqual(entity.Properties["prop"].PropertyType, resultEntity.Properties["prop"].PropertyType);
Assert.AreEqual(entity.Properties["prop"].Int32Value.Value, resultEntity.Properties["prop"].Int32Value.Value);
Assert.IsTrue(table.StorageUri.Equals(tableWithSAS.StorageUri));
}
finally
{
table.DeleteIfExists();
}
}
[TestMethod]
[Description("Perform a SAS request specifying an IP address or range and ensure that everything works properly.")]
[TestCategory(ComponentCategory.Table)]
[TestCategory(TestTypeCategory.UnitTest)]
[TestCategory(SmokeTestCategory.NonSmoke)]
[TestCategory(TenantTypeCategory.DevStore), TestCategory(TenantTypeCategory.DevFabric), TestCategory(TenantTypeCategory.Cloud)]
public void CloudTableSASIPAddressQueryParam()
{
CloudTableSASIPAddressHelper(() =>
{
// We need an IP address that will never be a valid source
IPAddress invalidIP = IPAddress.Parse("255.255.255.255");
return new IPAddressOrRange(invalidIP.ToString());
},
(IPAddress actualIP) =>
{
return new IPAddressOrRange(actualIP.ToString());
});
}
[TestMethod]
[Description("Perform a SAS request specifying an IP address or range and ensure that everything works properly.")]
[TestCategory(ComponentCategory.Table)]
[TestCategory(TestTypeCategory.UnitTest)]
[TestCategory(SmokeTestCategory.NonSmoke)]
[TestCategory(TenantTypeCategory.DevStore), TestCategory(TenantTypeCategory.DevFabric), TestCategory(TenantTypeCategory.Cloud)]
public void CloudTableSASIPRangeQueryParam()
{
CloudTableSASIPAddressHelper(() =>
{
// We need an IP address that will never be a valid source
IPAddress invalidIPBegin = IPAddress.Parse("255.255.255.0");
IPAddress invalidIPEnd = IPAddress.Parse("255.255.255.255");
return new IPAddressOrRange(invalidIPBegin.ToString(), invalidIPEnd.ToString());
},
(IPAddress actualIP) =>
{
byte[] actualAddressBytes = actualIP.GetAddressBytes();
byte[] initialAddressBytes = actualAddressBytes.ToArray();
initialAddressBytes[0]--;
byte[] finalAddressBytes = actualAddressBytes.ToArray();
finalAddressBytes[0]++;
return new IPAddressOrRange(new IPAddress(initialAddressBytes).ToString(), new IPAddress(finalAddressBytes).ToString());
});
}
#endregion
#region SASHttpsTests
[TestMethod]
[Description("Perform a SAS request specifying a shared protocol and ensure that everything works properly.")]
[TestCategory(ComponentCategory.Table)]
[TestCategory(TestTypeCategory.UnitTest)]
[TestCategory(SmokeTestCategory.NonSmoke)]
[TestCategory(TenantTypeCategory.DevFabric), TestCategory(TenantTypeCategory.Cloud)]
public void CloudTableSASSharedProtocolsQueryParam()
{
CloudTableClient tableClient = GenerateCloudTableClient();
CloudTable table = tableClient.GetTableReference("T" + Guid.NewGuid().ToString("N"));
try
{
table.Create();
SharedAccessTablePolicy policy = new SharedAccessTablePolicy()
{
Permissions = SharedAccessTablePermissions.Query,
SharedAccessStartTime = DateTimeOffset.UtcNow.AddMinutes(-5),
SharedAccessExpiryTime = DateTimeOffset.UtcNow.AddMinutes(30),
};
DynamicTableEntity entity = new DynamicTableEntity("PK", "RK", null, new Dictionary<string, EntityProperty>() { { "prop", new EntityProperty(4) } });
table.Execute(new TableOperation(entity, TableOperationType.Insert));
foreach (SharedAccessProtocol? protocol in new SharedAccessProtocol?[] { null, SharedAccessProtocol.HttpsOrHttp, SharedAccessProtocol.HttpsOnly })
{
string tableToken = table.GetSharedAccessSignature(policy, null, null, null, null, null, protocol, null);
StorageCredentials tableSAS = new StorageCredentials(tableToken);
Uri tableSASUri = new Uri(table.Uri + tableSAS.SASToken);
StorageUri tableSASStorageUri = new StorageUri(new Uri(table.StorageUri.PrimaryUri + tableSAS.SASToken), new Uri(table.StorageUri.SecondaryUri + tableSAS.SASToken));
int httpPort = tableSASUri.Port;
int securePort = 443;
if (!string.IsNullOrEmpty(TestBase.TargetTenantConfig.TableSecurePortOverride))
{
securePort = Int32.Parse(TestBase.TargetTenantConfig.TableSecurePortOverride);
}
var schemesAndPorts = new[] {
new { scheme = Uri.UriSchemeHttp, port = httpPort},
new { scheme = Uri.UriSchemeHttps, port = securePort}
};
CloudTable tableWithSAS = null;
TableOperation retrieveOp = TableOperation.Retrieve(entity.PartitionKey, entity.RowKey);
foreach (var item in schemesAndPorts)
{
tableSASUri = TransformSchemeAndPort(tableSASUri, item.scheme, item.port);
tableSASStorageUri = new StorageUri(TransformSchemeAndPort(tableSASStorageUri.PrimaryUri, item.scheme, item.port), TransformSchemeAndPort(tableSASStorageUri.SecondaryUri, item.scheme, item.port));
if (protocol.HasValue && protocol.Value == SharedAccessProtocol.HttpsOnly && string.CompareOrdinal(item.scheme, Uri.UriSchemeHttp) == 0)
{
tableWithSAS = new CloudTable(tableSASUri);
TestHelper.ExpectedException(() => tableWithSAS.Execute(retrieveOp), "Access a table using SAS with a shared protocols that does not match", HttpStatusCode.Unused);
tableWithSAS = new CloudTable(tableSASStorageUri, null);
TestHelper.ExpectedException(() => tableWithSAS.Execute(retrieveOp), "Access a table using SAS with a shared protocols that does not match", HttpStatusCode.Unused);
}
else
{
tableWithSAS = new CloudTable(tableSASUri);
TableResult result = tableWithSAS.Execute(retrieveOp);
Assert.AreEqual(entity.Properties["prop"], ((DynamicTableEntity)result.Result).Properties["prop"]);
tableWithSAS = new CloudTable(tableSASStorageUri, null);
result = tableWithSAS.Execute(retrieveOp);
Assert.AreEqual(entity.Properties["prop"], ((DynamicTableEntity)result.Result).Properties["prop"]);
}
}
}
}
finally
{
table.DeleteIfExists();
}
}
private static Uri TransformSchemeAndPort(Uri input, string scheme, int port)
{
UriBuilder builder = new UriBuilder(input);
builder.Scheme = scheme;
builder.Port = port;
return builder.Uri;
}
#endregion
#region Test Helpers
internal static void AssertPermissionsEqual(TablePermissions permissions1, TablePermissions permissions2)
{
Assert.AreEqual(permissions1.SharedAccessPolicies.Count, permissions2.SharedAccessPolicies.Count);
foreach (KeyValuePair<string, SharedAccessTablePolicy> pair in permissions1.SharedAccessPolicies)
{
SharedAccessTablePolicy policy1 = pair.Value;
SharedAccessTablePolicy policy2 = permissions2.SharedAccessPolicies[pair.Key];
Assert.IsNotNull(policy1);
Assert.IsNotNull(policy2);
Assert.AreEqual(policy1.Permissions, policy2.Permissions);
if (policy1.SharedAccessStartTime != null)
{
Assert.IsTrue(Math.Floor((policy1.SharedAccessStartTime.Value - policy2.SharedAccessStartTime.Value).TotalSeconds) == 0);
}
if (policy1.SharedAccessExpiryTime != null)
{
Assert.IsTrue(Math.Floor((policy1.SharedAccessExpiryTime.Value - policy2.SharedAccessExpiryTime.Value).TotalSeconds) == 0);
}
}
}
#endregion
}
#pragma warning restore 0618
}
| MatthewSteeples/azure-storage-net | Test/ClassLibraryCommon/Table/SAS/TableSasUnitTests.cs | C# | apache-2.0 | 67,776 |
/* Copyright 2018 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package com.google.swarm.sqlserver.migration.common;
import java.util.HashMap;
public enum SqlDataType {
VARCHAR(0),
NVARCHAR(1),
CHAR(2),
NCHAR(3),
TEXT(4),
NTEXT(5),
BIGINT(6),
INT(7),
TINYINT(8),
SMALLINT(9),
NUMERIC(10),
DECIMAL(11),
MONEY(12),
SMALLMONEY(13),
FLOAT(14),
REAL(15),
BIT(16),
DATE(17),
TIME(18),
DATETIME(19),
DATETIME2(20),
DATETIMEOFFSET(21),
SMALLDATETIME(22),
BINARY(23),
IMAGE(24),
VARBINARY(25),
UNIQUEIDENTIFIER(26),
TIMESTAMP(27);
private int codeValue;
private static HashMap<Integer, SqlDataType> codeValueMap = new HashMap<Integer, SqlDataType>();
private SqlDataType(int codeValue) {
this.codeValue = codeValue;
}
static {
for (SqlDataType type : SqlDataType.values()) {
codeValueMap.put(type.codeValue, type);
}
}
public static SqlDataType getInstanceFromCodeValue(int codeValue) {
return codeValueMap.get(codeValue);
}
public int getCodeValue() {
return codeValue;
}
}
| GoogleCloudPlatform/dlp-rdb-bq-import | src/main/java/com/google/swarm/sqlserver/migration/common/SqlDataType.java | Java | apache-2.0 | 1,596 |
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;
using AODGameLibrary.GamePlay;
using AODGameLibrary.Weapons;
using AODGameLibrary.AODObjects;
using AODGameLibrary.Gamehelpers;
using AODGameLibrary.Effects;
using AODGameLibrary.Units;
using AODGameLibrary.Effects.ParticleShapes;
using AODGameLibrary.CollisionChecking;
namespace CombatLibrary.Spells
{
/// <summary>
/// 空间炸弹,造成范围伤害并炸飞,大地无敌-范若余于2010年6月6日从Skill类中移出
/// </summary>
public class SpaceBomb : Skill
{
/// <summary>
/// 判断是否符合施放条件
/// </summary>
/// <returns></returns>
public override bool ConditionCheck()
{
if (true)
{
return true;
}
else return false;
}
/// <summary>
/// 技能行为发生时的动作
/// </summary>
public override void SkillAction()
{
List<VioableUnit> dn = GameWorld.GameItemManager.ItemInRange(MargedUnit.Position, FloatValues[1]);
foreach (VioableUnit u in dn)
{
if (u.UnitState == UnitState.alive && u.Group != MargedUnit.Group && u.Heavy == false)
{
u.GetDamage(Damage);
if (u.Position != MargedUnit.Position)
{
u.GetImpulse(FloatValues[0] * Vector3.Normalize(u.Position - MargedUnit.Position));//造成冲量,弹飞
}
else u.GetImpulse(FloatValues[0] * Vector3.Up);
}
}
GameWorld.ScreenEffectManager.Blink();
}
/// <summary>
/// Update时的动作
/// </summary>
public override void UpdateAction(GameTime gameTime)
{
}
/// <summary>
/// 被中断时的动作
/// </summary>
public override void InterruptAction()
{
}
/// <summary>
/// 开始准备施放的动作
/// </summary>
public override void StartCastingAction()
{
}
/// <summary>
/// 开始通道施放的动作
/// </summary>
public override void StartChannellingAction()
{
}
}
}
| WindyDarian/Art-of-Destiny | CombatLibrary/Spells/SpaceBomb.cs | C# | apache-2.0 | 2,681 |
/**
* echarts组件:孤岛数据
*
* @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。
* @author Kener (@Kener-林峰, [email protected])
*
*/
define(function (require) {
/**
* 构造函数
* @param {Object} messageCenter echart消息中心
* @param {ZRender} zr zrender实例
* @param {Object} option 图表选项
*/
function Island(messageCenter, zr) {
// 基类装饰
var ComponentBase = require('../component/base');
ComponentBase.call(this, zr);
// 可计算特性装饰
var CalculableBase = require('./calculableBase');
CalculableBase.call(this, zr);
var ecConfig = require('../config');
var ecData = require('../util/ecData');
var zrEvent = require('zrender/tool/event');
var self = this;
self.type = ecConfig.CHART_TYPE_ISLAND;
var option;
var _zlevelBase = self.getZlevelBase();
var _nameConnector;
var _valueConnector;
var _zrHeight = zr.getHeight();
var _zrWidth = zr.getWidth();
/**
* 孤岛合并
*
* @param {string} tarShapeIndex 目标索引
* @param {Object} srcShape 源目标,合入目标后删除
*/
function _combine(tarShape, srcShape) {
var zrColor = require('zrender/tool/color');
var value = ecData.get(tarShape, 'value')
+ ecData.get(srcShape, 'value');
var name = ecData.get(tarShape, 'name')
+ _nameConnector
+ ecData.get(srcShape, 'name');
tarShape.style.text = name + _valueConnector + value;
ecData.set(tarShape, 'value', value);
ecData.set(tarShape, 'name', name);
tarShape.style.r = option.island.r;
tarShape.style.color = zrColor.mix(
tarShape.style.color,
srcShape.style.color
);
}
/**
* 刷新
*/
function refresh(newOption) {
if (newOption) {
newOption.island = self.reformOption(newOption.island);
option = newOption;
_nameConnector = option.nameConnector;
_valueConnector = option.valueConnector;
}
}
function render(newOption) {
refresh(newOption);
for (var i = 0, l = self.shapeList.length; i < l; i++) {
zr.addShape(self.shapeList[i]);
}
}
function getOption() {
return option;
}
function resize() {
var newWidth = zr.getWidth();
var newHieght = zr.getHeight();
var xScale = newWidth / (_zrWidth || newWidth);
var yScale = newHieght / (_zrHeight || newHieght);
if (xScale == 1 && yScale == 1) {
return;
}
_zrWidth = newWidth;
_zrHeight = newHieght;
for (var i = 0, l = self.shapeList.length; i < l; i++) {
zr.modShape(
self.shapeList[i].id,
{
style: {
x: Math.round(self.shapeList[i].style.x * xScale),
y: Math.round(self.shapeList[i].style.y * yScale)
}
}
);
}
}
function add(shape) {
var name = ecData.get(shape, 'name');
var value = ecData.get(shape, 'value');
var seriesName = typeof ecData.get(shape, 'series') != 'undefined'
? ecData.get(shape, 'series').name
: '';
var font = self.getFont(option.island.textStyle);
var islandShape = {
shape : 'circle',
id : zr.newShapeId(self.type),
zlevel : _zlevelBase,
style : {
x : shape.style.x,
y : shape.style.y,
r : option.island.r,
color : shape.style.color || shape.style.strokeColor,
text : name + _valueConnector + value,
textFont : font
},
draggable : true,
hoverable : true,
onmousewheel : self.shapeHandler.onmousewheel,
_type : 'island'
};
if (islandShape.style.color == '#fff') {
islandShape.style.color = shape.style.strokeColor;
}
self.setCalculable(islandShape);
ecData.pack(
islandShape,
{name:seriesName}, -1,
value, -1,
name
);
self.shapeList.push(islandShape);
zr.addShape(islandShape);
}
function del(shape) {
zr.delShape(shape.id);
var newShapeList = [];
for (var i = 0, l = self.shapeList.length; i < l; i++) {
if (self.shapeList[i].id != shape.id) {
newShapeList.push(self.shapeList[i]);
}
}
self.shapeList = newShapeList;
}
/**
* 数据项被拖拽进来, 重载基类方法
*/
function ondrop(param, status) {
if (!self.isDrop || !param.target) {
// 没有在当前实例上发生拖拽行为则直接返回
return;
}
// 拖拽产生孤岛数据合并
var target = param.target; // 拖拽安放目标
var dragged = param.dragged; // 当前被拖拽的图形对象
_combine(target, dragged);
zr.modShape(target.id, target);
status.dragIn = true;
// 处理完拖拽事件后复位
self.isDrop = false;
return;
}
/**
* 数据项被拖拽出去, 重载基类方法
*/
function ondragend(param, status) {
var target = param.target; // 拖拽安放目标
if (!self.isDragend) {
// 拖拽的不是孤岛数据,如果没有图表接受孤岛数据,需要新增孤岛数据
if (!status.dragIn) {
target.style.x = zrEvent.getX(param.event);
target.style.y = zrEvent.getY(param.event);
add(target);
status.needRefresh = true;
}
}
else {
// 拖拽的是孤岛数据,如果有图表接受了孤岛数据,需要删除孤岛数据
if (status.dragIn) {
del(target);
status.needRefresh = true;
}
}
// 处理完拖拽事件后复位
self.isDragend = false;
return;
}
/**
* 滚轮改变孤岛数据值
*/
self.shapeHandler.onmousewheel = function(param) {
var shape = param.target;
var event = param.event;
var delta = zrEvent.getDelta(event);
delta = delta > 0 ? (-1) : 1;
shape.style.r -= delta;
shape.style.r = shape.style.r < 5 ? 5 : shape.style.r;
var value = ecData.get(shape, 'value');
var dvalue = value * option.island.calculateStep;
if (dvalue > 1) {
value = Math.round(value - dvalue * delta);
}
else {
value = (value - dvalue * delta).toFixed(2) - 0;
}
var name = ecData.get(shape, 'name');
shape.style.text = name + ':' + value;
ecData.set(shape, 'value', value);
ecData.set(shape, 'name', name);
zr.modShape(shape.id, shape);
zr.refresh();
zrEvent.stop(event);
};
self.refresh = refresh;
self.render = render;
self.resize = resize;
self.getOption = getOption;
self.add = add;
self.del = del;
self.ondrop = ondrop;
self.ondragend = ondragend;
}
// 图表注册
require('../chart').define('island', Island);
return Island;
}); | ghostry/Gadmin | Public/Lib/echarts/chart/island.js | JavaScript | apache-2.0 | 8,473 |
/*
* Copyright 2004-2013 the Seasar Foundation and the Others.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
package org.docksidestage.mysql.dbflute.bsentity;
import java.util.List;
import java.util.ArrayList;
import org.dbflute.dbmeta.DBMeta;
import org.dbflute.dbmeta.AbstractEntity;
import org.dbflute.dbmeta.accessory.DomainEntity;
import org.docksidestage.mysql.dbflute.allcommon.DBMetaInstanceHandler;
import org.docksidestage.mysql.dbflute.exentity.*;
/**
* The entity of WHITE_IMPLICIT_REVERSE_FK_REF as TABLE. <br>
* <pre>
* [primary-key]
* WHITE_IMPLICIT_REVERSE_FK_REF_ID
*
* [column]
* WHITE_IMPLICIT_REVERSE_FK_REF_ID, WHITE_IMPLICIT_REVERSE_FK_ID, VALID_BEGIN_DATE, VALID_END_DATE
*
* [sequence]
*
*
* [identity]
* WHITE_IMPLICIT_REVERSE_FK_REF_ID
*
* [version-no]
*
*
* [foreign table]
*
*
* [referrer table]
*
*
* [foreign property]
*
*
* [referrer property]
*
*
* [get/set template]
* /= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Integer whiteImplicitReverseFkRefId = entity.getWhiteImplicitReverseFkRefId();
* Integer whiteImplicitReverseFkId = entity.getWhiteImplicitReverseFkId();
* java.time.LocalDate validBeginDate = entity.getValidBeginDate();
* java.time.LocalDate validEndDate = entity.getValidEndDate();
* entity.setWhiteImplicitReverseFkRefId(whiteImplicitReverseFkRefId);
* entity.setWhiteImplicitReverseFkId(whiteImplicitReverseFkId);
* entity.setValidBeginDate(validBeginDate);
* entity.setValidEndDate(validEndDate);
* = = = = = = = = = =/
* </pre>
* @author DBFlute(AutoGenerator)
*/
public abstract class BsWhiteImplicitReverseFkRef extends AbstractEntity implements DomainEntity {
// ===================================================================================
// Definition
// ==========
/** The serial version UID for object serialization. (Default) */
private static final long serialVersionUID = 1L;
// ===================================================================================
// Attribute
// =========
/** WHITE_IMPLICIT_REVERSE_FK_REF_ID: {PK, ID, NotNull, INT(10)} */
protected Integer _whiteImplicitReverseFkRefId;
/** WHITE_IMPLICIT_REVERSE_FK_ID: {UQ+, NotNull, INT(10)} */
protected Integer _whiteImplicitReverseFkId;
/** VALID_BEGIN_DATE: {+UQ, NotNull, DATE(10)} */
protected java.time.LocalDate _validBeginDate;
/** VALID_END_DATE: {NotNull, DATE(10)} */
protected java.time.LocalDate _validEndDate;
// ===================================================================================
// DB Meta
// =======
/** {@inheritDoc} */
public DBMeta asDBMeta() {
return DBMetaInstanceHandler.findDBMeta(asTableDbName());
}
/** {@inheritDoc} */
public String asTableDbName() {
return "white_implicit_reverse_fk_ref";
}
// ===================================================================================
// Key Handling
// ============
/** {@inheritDoc} */
public boolean hasPrimaryKeyValue() {
if (_whiteImplicitReverseFkRefId == null) { return false; }
return true;
}
/**
* To be unique by the unique column. <br>
* You can update the entity by the key when entity update (NOT batch update).
* @param whiteImplicitReverseFkId : UQ+, NotNull, INT(10). (NotNull)
* @param validBeginDate : +UQ, NotNull, DATE(10). (NotNull)
*/
public void uniqueBy(Integer whiteImplicitReverseFkId, java.time.LocalDate validBeginDate) {
__uniqueDrivenProperties.clear();
__uniqueDrivenProperties.addPropertyName("whiteImplicitReverseFkId");
__uniqueDrivenProperties.addPropertyName("validBeginDate");
setWhiteImplicitReverseFkId(whiteImplicitReverseFkId);setValidBeginDate(validBeginDate);
}
// ===================================================================================
// Foreign Property
// ================
// ===================================================================================
// Referrer Property
// =================
protected <ELEMENT> List<ELEMENT> newReferrerList() { // overriding to import
return new ArrayList<ELEMENT>();
}
// ===================================================================================
// Basic Override
// ==============
@Override
protected boolean doEquals(Object obj) {
if (obj instanceof BsWhiteImplicitReverseFkRef) {
BsWhiteImplicitReverseFkRef other = (BsWhiteImplicitReverseFkRef)obj;
if (!xSV(_whiteImplicitReverseFkRefId, other._whiteImplicitReverseFkRefId)) { return false; }
return true;
} else {
return false;
}
}
@Override
protected int doHashCode(int initial) {
int hs = initial;
hs = xCH(hs, asTableDbName());
hs = xCH(hs, _whiteImplicitReverseFkRefId);
return hs;
}
@Override
protected String doBuildStringWithRelation(String li) {
return "";
}
@Override
protected String doBuildColumnString(String dm) {
StringBuilder sb = new StringBuilder();
sb.append(dm).append(xfND(_whiteImplicitReverseFkRefId));
sb.append(dm).append(xfND(_whiteImplicitReverseFkId));
sb.append(dm).append(xfND(_validBeginDate));
sb.append(dm).append(xfND(_validEndDate));
if (sb.length() > dm.length()) {
sb.delete(0, dm.length());
}
sb.insert(0, "{").append("}");
return sb.toString();
}
@Override
protected String doBuildRelationString(String dm) {
return "";
}
@Override
public WhiteImplicitReverseFkRef clone() {
return (WhiteImplicitReverseFkRef)super.clone();
}
// ===================================================================================
// Accessor
// ========
/**
* [get] WHITE_IMPLICIT_REVERSE_FK_REF_ID: {PK, ID, NotNull, INT(10)} <br>
* @return The value of the column 'WHITE_IMPLICIT_REVERSE_FK_REF_ID'. (basically NotNull if selected: for the constraint)
*/
public Integer getWhiteImplicitReverseFkRefId() {
checkSpecifiedProperty("whiteImplicitReverseFkRefId");
return _whiteImplicitReverseFkRefId;
}
/**
* [set] WHITE_IMPLICIT_REVERSE_FK_REF_ID: {PK, ID, NotNull, INT(10)} <br>
* @param whiteImplicitReverseFkRefId The value of the column 'WHITE_IMPLICIT_REVERSE_FK_REF_ID'. (basically NotNull if update: for the constraint)
*/
public void setWhiteImplicitReverseFkRefId(Integer whiteImplicitReverseFkRefId) {
registerModifiedProperty("whiteImplicitReverseFkRefId");
_whiteImplicitReverseFkRefId = whiteImplicitReverseFkRefId;
}
/**
* [get] WHITE_IMPLICIT_REVERSE_FK_ID: {UQ+, NotNull, INT(10)} <br>
* @return The value of the column 'WHITE_IMPLICIT_REVERSE_FK_ID'. (basically NotNull if selected: for the constraint)
*/
public Integer getWhiteImplicitReverseFkId() {
checkSpecifiedProperty("whiteImplicitReverseFkId");
return _whiteImplicitReverseFkId;
}
/**
* [set] WHITE_IMPLICIT_REVERSE_FK_ID: {UQ+, NotNull, INT(10)} <br>
* @param whiteImplicitReverseFkId The value of the column 'WHITE_IMPLICIT_REVERSE_FK_ID'. (basically NotNull if update: for the constraint)
*/
public void setWhiteImplicitReverseFkId(Integer whiteImplicitReverseFkId) {
registerModifiedProperty("whiteImplicitReverseFkId");
_whiteImplicitReverseFkId = whiteImplicitReverseFkId;
}
/**
* [get] VALID_BEGIN_DATE: {+UQ, NotNull, DATE(10)} <br>
* @return The value of the column 'VALID_BEGIN_DATE'. (basically NotNull if selected: for the constraint)
*/
public java.time.LocalDate getValidBeginDate() {
checkSpecifiedProperty("validBeginDate");
return _validBeginDate;
}
/**
* [set] VALID_BEGIN_DATE: {+UQ, NotNull, DATE(10)} <br>
* @param validBeginDate The value of the column 'VALID_BEGIN_DATE'. (basically NotNull if update: for the constraint)
*/
public void setValidBeginDate(java.time.LocalDate validBeginDate) {
registerModifiedProperty("validBeginDate");
_validBeginDate = validBeginDate;
}
/**
* [get] VALID_END_DATE: {NotNull, DATE(10)} <br>
* @return The value of the column 'VALID_END_DATE'. (basically NotNull if selected: for the constraint)
*/
public java.time.LocalDate getValidEndDate() {
checkSpecifiedProperty("validEndDate");
return _validEndDate;
}
/**
* [set] VALID_END_DATE: {NotNull, DATE(10)} <br>
* @param validEndDate The value of the column 'VALID_END_DATE'. (basically NotNull if update: for the constraint)
*/
public void setValidEndDate(java.time.LocalDate validEndDate) {
registerModifiedProperty("validEndDate");
_validEndDate = validEndDate;
}
}
| dbflute-test/dbflute-test-dbms-mysql | src/main/java/org/docksidestage/mysql/dbflute/bsentity/BsWhiteImplicitReverseFkRef.java | Java | apache-2.0 | 10,962 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.6.0_27) on Wed Mar 18 13:57:07 CET 2015 -->
<title>Uses of Class com.tailf.maapi.MaapiSchemas.ListRestrictionTypeMethodsImpl (CONF API Version 5.4)</title>
<meta name="date" content="2015-03-18">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class com.tailf.maapi.MaapiSchemas.ListRestrictionTypeMethodsImpl (CONF API Version 5.4)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../com/tailf/maapi/MaapiSchemas.ListRestrictionTypeMethodsImpl.html" title="class in com.tailf.maapi">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/tailf/maapi//class-useMaapiSchemas.ListRestrictionTypeMethodsImpl.html" target="_top">Frames</a></li>
<li><a href="MaapiSchemas.ListRestrictionTypeMethodsImpl.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class com.tailf.maapi.MaapiSchemas.ListRestrictionTypeMethodsImpl" class="title">Uses of Class<br>com.tailf.maapi.MaapiSchemas.ListRestrictionTypeMethodsImpl</h2>
</div>
<div class="classUseContainer">No usage of com.tailf.maapi.MaapiSchemas.ListRestrictionTypeMethodsImpl</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../com/tailf/maapi/MaapiSchemas.ListRestrictionTypeMethodsImpl.html" title="class in com.tailf.maapi">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/tailf/maapi//class-useMaapiSchemas.ListRestrictionTypeMethodsImpl.html" target="_top">Frames</a></li>
<li><a href="MaapiSchemas.ListRestrictionTypeMethodsImpl.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
| ralph-mikera/routeflow5 | rftest/confd_src/confd-basic-5.4/doc/api/java/com/tailf/maapi/class-use/MaapiSchemas.ListRestrictionTypeMethodsImpl.html | HTML | apache-2.0 | 4,375 |
## 重要提示:
> 请点击以下链接查看最新[YMP v2](https://gitee.com/suninformation/ymate-platform-v2)版本仓库:
>
> - [码云:https://gitee.com/suninformation/ymate-platform-v2](https://gitee.com/suninformation/ymate-platform-v2)
> - [GitHub:https://github.com/suninformation/ymate-platform-v2](https://github.com/suninformation/ymate-platform-v2)
>
> 当前代码库为旧版本,已停止更新:p!!
### **One More Thing**:
YMP不仅提供便捷的Web及其它Java项目的快速开发体验,也将不断提供更多丰富的项目实践经验。
感兴趣的小伙伴儿们可以加入 官方QQ群480374360,一起交流学习,帮助YMP成长!
了解更多有关YMP框架的内容,请访问官网:http://www.ymate.net/
| suninformation/ymateplatform | README.md | Markdown | apache-2.0 | 777 |
# Myrica vidaliana Rolfe SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | mdoering/backbone | life/Plantae/Magnoliophyta/Magnoliopsida/Fagales/Myricaceae/Myrica/Myrica vidaliana/README.md | Markdown | apache-2.0 | 172 |
class Addon < ActiveRecord::Base
has_many :server_addons
has_many :servers, through: :server_addons
scope :available, -> { where(hidden: false).order(:created_at) }
end
| OnApp/cloudnet | app/models/addon.rb | Ruby | apache-2.0 | 184 |
/**
* Copyright (c) 2016 Lemur Consulting Ltd.
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package uk.co.flax.biosolr.elasticsearch;
import org.apache.commons.lang3.StringUtils;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.threadpool.ThreadPool;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import uk.co.flax.biosolr.elasticsearch.mapper.ontology.ElasticOntologyHelperFactory;
import uk.co.flax.biosolr.elasticsearch.mapper.ontology.OntologySettings;
import uk.co.flax.biosolr.ontology.core.OntologyHelper;
import uk.co.flax.biosolr.ontology.core.OntologyHelperException;
import java.io.Closeable;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
* Created by mlp on 09/02/16.
* @author mlp
*/
public class OntologyHelperBuilder implements Closeable {
private static final Logger LOGGER = LoggerFactory.getLogger(OntologyHelperBuilder.class);
private ThreadPool threadPool;
private static OntologyHelperBuilder instance;
private Map<String, OntologyHelper> helpers = new ConcurrentHashMap<>();
@Inject
public OntologyHelperBuilder(ThreadPool threadPool) {
this.threadPool = threadPool;
setInstance(this);
}
private static void setInstance(OntologyHelperBuilder odb) {
instance = odb;
}
public static OntologyHelperBuilder getInstance() {
return instance;
}
private OntologyHelper getHelper(OntologySettings settings) throws OntologyHelperException {
String helperKey = buildHelperKey(settings);
OntologyHelper helper = helpers.get(helperKey);
if (helper == null) {
helper = new ElasticOntologyHelperFactory(settings).buildOntologyHelper();
OntologyCheckRunnable checker = new OntologyCheckRunnable(helperKey, settings.getThreadCheckMs());
threadPool.scheduleWithFixedDelay(checker, TimeValue.timeValueMillis(settings.getThreadCheckMs()));
helpers.put(helperKey, helper);
helper.updateLastCallTime();
}
return helper;
}
public static OntologyHelper getOntologyHelper(OntologySettings settings) throws OntologyHelperException {
OntologyHelperBuilder builder = getInstance();
return builder.getHelper(settings);
}
@Override
public void close() {
// Explicitly dispose of any remaining helpers
for (Map.Entry<String, OntologyHelper> helperEntry : helpers.entrySet()) {
if (helperEntry.getValue() != null) {
LOGGER.info("Disposing of helper for {}", helperEntry.getKey());
helperEntry.getValue().dispose();
}
}
}
private static String buildHelperKey(OntologySettings settings) {
String key;
if (StringUtils.isNotBlank(settings.getOntologyUri())) {
key = settings.getOntologyUri();
} else {
if (StringUtils.isNotBlank(settings.getOlsOntology())) {
key = settings.getOlsBaseUrl() + "_" + settings.getOlsOntology();
} else {
key = settings.getOlsBaseUrl();
}
}
return key;
}
private final class OntologyCheckRunnable implements Runnable {
final String threadKey;
final long deleteCheckMs;
public OntologyCheckRunnable(String threadKey, long deleteCheckMs) {
this.threadKey = threadKey;
this.deleteCheckMs = deleteCheckMs;
}
@Override
public void run() {
OntologyHelper helper = helpers.get(threadKey);
if (helper != null) {
// Check if the last call time was longer ago than the maximum
if (System.currentTimeMillis() - deleteCheckMs > helper.getLastCallTime()) {
// Assume helper is out of use - dispose of it to allow memory to be freed
helper.dispose();
helpers.remove(threadKey);
}
}
}
}
}
| flaxsearch/BioSolr | ontology/ontology-annotator/elasticsearch-ontology-annotator/es-ontology-annotator-es2.2/src/main/java/uk/co/flax/biosolr/elasticsearch/OntologyHelperBuilder.java | Java | apache-2.0 | 4,116 |
'use strict';
/**
* @ngdoc function
* @name freshcardUiApp.controller:TemplatesCtrl
* @description
* # TemplatesCtrl
* Controller of the freshcardUiApp
*/
angular.module('freshcardUiApp')
.controller('TemplatesCtrl', function (
$scope,
$rootScope,
$localStorage,
$filter,
$timeout,
FileUploader,
OrganizationService,
configuration
) {
$scope.templateLayoutSaved = false;
$scope.templateLayoutError = false;
$scope.templateLayoutPublished = false;
$scope.templateLayoutPublishError = false;
$scope.templateImagePath = $rootScope.currentOrganizationTemplate;
$scope.fields = [ false, false, false, false, false, false, false ];
$scope.fieldNames = [
'NAME',
'EMAIL_ADDRESS',
'STREET_ADDRESS',
'POSTAL_CODE',
'CITY',
'PHONE_NUMBER',
'WEBSITE'
];
$scope.fieldMappings = [
$filter('translate')('NAME'),
$filter('translate')('EMAIL_ADDRESS'),
$filter('translate')('STREET_ADDRESS'),
$filter('translate')('POSTAL_CODE'),
$filter('translate')('CITY'),
$filter('translate')('PHONE_NUMBER'),
$filter('translate')('WEBSITE')
];
$scope.showGrid = false;
$scope.snapToGrid = false;
$scope.fonts = [ 'Helvetica Neue', 'Open Sans', 'Helvetica', 'Arial', 'Times New Roman' ];
$scope.fontSizes = [ 14, 16, 18, 20, 24, 28 ];
$scope.selectedFont = $scope.fonts[0];
$scope.selectedFontSize = $scope.fontSizes[3];
$scope.templateLayout = { fields: { }, font: $scope.selectedFont, fontSize: $scope.selectedFontSize, showGrid: $scope.showGrid, snapToGrid: $scope.snapToGrid };
OrganizationService.get(
{
organizationId: $rootScope.user.currentOrganizationId
},
function(organization) {
if (organization.templateLayout) {
$scope.templateLayout = JSON.parse(organization.templateLayout);
$scope.selectedFont = $scope.templateLayout.font;
$scope.selectedFontSize = $scope.templateLayout.fontSize;
$scope.fields = [ false, false, false, false, false, false, false ];
for (var field in $scope.templateLayout.fields) {
for (var i = 0; i < $scope.fieldMappings.length; i++) {
if ($scope.fieldMappings[i] === $filter('translate')(field)) {
$scope.fields[i] = true;
}
}
}
}
}
);
var imageUploader = $scope.imageUploader = new FileUploader(
{
url: configuration.apiRootURL + 'api/v1/organizations/uploadTemplateImage/' + $rootScope.user.currentOrganizationId,
headers: {
'X-Auth-Token': $rootScope.authToken
}
}
);
imageUploader.onAfterAddingFile = function() {
$scope.imageUploadCompleted = false;
};
imageUploader.onCompleteItem = function(fileItem, response) {
if (response.imagePath !== null && response.imagePath !== undefined) {
$scope.templateImagePath = $localStorage.currentOrganizationTemplate = $rootScope.currentOrganizationTemplate = response.imagePath;
$scope.imageUploadCompleted = true;
}
};
$scope.saveTemplate = function() {
$scope.templateLayout.font = $scope.selectedFont;
$scope.templateLayout.fontSize = $scope.selectedFontSize;
var svgResult = $scope.canvas.toSVG();
for (var i = 0; i < $scope.fieldMappings.length; i++) {
svgResult = svgResult.replace($scope.fieldMappings[i], $scope.fieldNames[i]);
}
OrganizationService.update(
{
id: $rootScope.user.currentOrganizationId,
templateLayout: JSON.stringify($scope.templateLayout),
templateAsSVG: svgResult
},
function() {
$scope.templateLayoutPublished = false;
$scope.templateLayoutPublishError = false;
$scope.templateLayoutSaved = true;
$scope.templateLayoutError = false;
$timeout(
function() {
$scope.templateLayoutSaved = false;
},
5000
);
},
function() {
$scope.templateLayoutPublished = false;
$scope.templateLayoutPublishError = false;
$scope.templateLayoutSaved = false;
$scope.templateLayoutError = true;
}
);
};
$scope.publishTemplate = function() {
OrganizationService.publishTemplate(
{
id: $rootScope.user.currentOrganizationId
},
function() {
$scope.templateLayoutPublished = true;
$scope.templateLayoutPublishError = false;
$scope.templateLayoutSaved = false;
$scope.templateLayoutError = false;
$timeout(
function() {
$scope.templateLayoutPublished = false;
},
5000
);
},
function() {
$scope.templateLayoutPublished = false;
$scope.templateLayoutPublishError = true;
$scope.templateLayoutSaved = false;
$scope.templateLayoutError = false;
}
);
};
});
| BjoernKW/FreshcardUI | app/scripts/controllers/templates.js | JavaScript | apache-2.0 | 4,492 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import os_resource_classes as orc
import os_traits
import six
from nova import context as nova_context
from nova import exception
from nova import objects
from nova.tests.functional.api import client as api_client
from nova.tests.functional import integrated_helpers
from nova import utils
class TestServicesAPI(integrated_helpers.ProviderUsageBaseTestCase):
compute_driver = 'fake.SmallFakeDriver'
def test_compute_service_delete_ensure_related_cleanup(self):
"""Tests deleting a compute service and the related cleanup associated
with that like the compute_nodes table entry, removing the host
from any aggregates, the host mapping in the API DB and the associated
resource provider in Placement.
"""
compute = self._start_compute('host1')
# Make sure our compute host is represented as expected.
services = self.admin_api.get_services(binary='nova-compute')
self.assertEqual(1, len(services))
service = services[0]
# Now create a host aggregate and add our host to it.
aggregate = self.admin_api.post_aggregate(
{'aggregate': {'name': 'agg1'}})
self.admin_api.add_host_to_aggregate(aggregate['id'], service['host'])
# Make sure the host is in the aggregate.
aggregate = self.admin_api.api_get(
'/os-aggregates/%s' % aggregate['id']).body['aggregate']
self.assertEqual([service['host']], aggregate['hosts'])
rp_uuid = self._get_provider_uuid_by_host(service['host'])
# We'll know there is a host mapping implicitly if os-hypervisors
# returned something in _get_provider_uuid_by_host, but let's also
# make sure the host mapping is there like we expect.
ctxt = nova_context.get_admin_context()
objects.HostMapping.get_by_host(ctxt, service['host'])
# Make sure there is a resource provider for that compute node based
# on the uuid.
resp = self.placement_api.get('/resource_providers/%s' % rp_uuid)
self.assertEqual(200, resp.status)
# Make sure the resource provider has inventory.
inventories = self._get_provider_inventory(rp_uuid)
# Expect a minimal set of inventory for the fake virt driver.
for resource_class in [orc.VCPU, orc.MEMORY_MB, orc.DISK_GB]:
self.assertIn(resource_class, inventories)
# Now create a server so that the resource provider has some allocation
# records.
flavor = self.api.get_flavors()[0]
server = self._boot_and_check_allocations(flavor, service['host'])
# Now the fun part, delete the compute service and make sure related
# resources are cleaned up, like the compute node, host mapping, and
# resource provider. We have to first stop the compute service so
# it doesn't recreate the compute node during the
# update_available_resource periodic task.
self.admin_api.put_service(service['id'], {'forced_down': True})
compute.stop()
# The first attempt should fail since there is an instance on the
# compute host.
ex = self.assertRaises(api_client.OpenStackApiException,
self.admin_api.api_delete,
'/os-services/%s' % service['id'])
self.assertIn('Unable to delete compute service that is hosting '
'instances.', six.text_type(ex))
self.assertEqual(409, ex.response.status_code)
# Now delete the instance and wait for it to be gone.
self._delete_and_check_allocations(server)
# Now we can delete the service.
self.admin_api.api_delete('/os-services/%s' % service['id'])
# Make sure the service is deleted.
services = self.admin_api.get_services(binary='nova-compute')
self.assertEqual(0, len(services))
# Make sure the host was removed from the aggregate.
aggregate = self.admin_api.api_get(
'/os-aggregates/%s' % aggregate['id']).body['aggregate']
self.assertEqual([], aggregate['hosts'])
# Trying to get the hypervisor should result in a 404.
self.admin_api.api_get(
'os-hypervisors?hypervisor_hostname_pattern=%s' % service['host'],
check_response_status=[404])
# The host mapping should also be gone.
self.assertRaises(exception.HostMappingNotFound,
objects.HostMapping.get_by_host,
ctxt, service['host'])
# And finally, the resource provider should also be gone. The API
# will perform a cascading delete of the resource provider inventory
# and allocation information.
resp = self.placement_api.get('/resource_providers/%s' % rp_uuid)
self.assertEqual(404, resp.status)
def test_evacuate_then_delete_compute_service(self):
"""Tests a scenario where a server is created on a host, the host
goes down, the server is evacuated to another host, and then the
source host compute service is deleted. After that the deleted
compute service is restarted. Related placement resources are checked
throughout.
"""
# Create our source host that we will evacuate *from* later.
host1 = self._start_compute('host1')
# Create a server which will go on host1 since it is the only host.
flavor = self.api.get_flavors()[0]
server = self._boot_and_check_allocations(flavor, 'host1')
# Get the compute service record for host1 so we can manage it.
service = self.admin_api.get_services(
binary='nova-compute', host='host1')[0]
# Get the corresponding resource provider uuid for host1.
rp_uuid = self._get_provider_uuid_by_host(service['host'])
# Make sure there is a resource provider for that compute node based
# on the uuid.
resp = self.placement_api.get('/resource_providers/%s' % rp_uuid)
self.assertEqual(200, resp.status)
# Down the compute service for host1 so we can evacuate from it.
self.admin_api.put_service(service['id'], {'forced_down': True})
host1.stop()
# Start another host and trigger the server evacuate to that host.
self._start_compute('host2')
self.admin_api.post_server_action(server['id'], {'evacuate': {}})
# The host does not change until after the status is changed to ACTIVE
# so wait for both parameters.
self._wait_for_server_parameter(server, {
'status': 'ACTIVE',
'OS-EXT-SRV-ATTR:host': 'host2'})
# Delete the compute service for host1 and check the related
# placement resources for that host.
self.admin_api.api_delete('/os-services/%s' % service['id'])
# Make sure the service is gone.
services = self.admin_api.get_services(
binary='nova-compute', host='host1')
self.assertEqual(0, len(services), services)
# FIXME(mriedem): This is bug 1829479 where the compute service is
# deleted but the resource provider is not because there are still
# allocations against the provider from the evacuated server.
resp = self.placement_api.get('/resource_providers/%s' % rp_uuid)
self.assertEqual(200, resp.status)
self.assertFlavorMatchesUsage(rp_uuid, flavor)
# Try to restart the host1 compute service to create a new resource
# provider.
self.restart_compute_service(host1)
# FIXME(mriedem): This is bug 1817833 where restarting the now-deleted
# compute service attempts to create a new resource provider with a
# new uuid but the same name which results in a conflict. The service
# does not die, however, because _update_available_resource_for_node
# catches and logs but does not re-raise the error.
log_output = self.stdlog.logger.output
self.assertIn('Error updating resources for node host1.', log_output)
self.assertIn('Failed to create resource provider host1', log_output)
def test_migrate_confirm_after_deleted_source_compute(self):
"""Tests a scenario where a server is cold migrated and while in
VERIFY_RESIZE status the admin attempts to delete the source compute
and then the user tries to confirm the resize.
"""
# Start a compute service and create a server there.
self._start_compute('host1')
host1_rp_uuid = self._get_provider_uuid_by_host('host1')
flavor = self.api.get_flavors()[0]
server = self._boot_and_check_allocations(flavor, 'host1')
# Start a second compute service so we can cold migrate there.
self._start_compute('host2')
host2_rp_uuid = self._get_provider_uuid_by_host('host2')
# Cold migrate the server to host2.
self._migrate_and_check_allocations(
server, flavor, host1_rp_uuid, host2_rp_uuid)
# Delete the source compute service.
service = self.admin_api.get_services(
binary='nova-compute', host='host1')[0]
# We expect the delete request to fail with a 409 error because of the
# instance in VERIFY_RESIZE status even though that instance is marked
# as being on host2 now.
ex = self.assertRaises(api_client.OpenStackApiException,
self.admin_api.api_delete,
'/os-services/%s' % service['id'])
self.assertEqual(409, ex.response.status_code)
self.assertIn('Unable to delete compute service that has in-progress '
'migrations', six.text_type(ex))
self.assertIn('There are 1 in-progress migrations involving the host',
self.stdlog.logger.output)
# The provider is still around because we did not delete the service.
resp = self.placement_api.get('/resource_providers/%s' % host1_rp_uuid)
self.assertEqual(200, resp.status)
self.assertFlavorMatchesUsage(host1_rp_uuid, flavor)
# Now try to confirm the migration.
self._confirm_resize(server)
# Delete the host1 service since the migration is confirmed and the
# server is on host2.
self.admin_api.api_delete('/os-services/%s' % service['id'])
# The host1 resource provider should be gone.
resp = self.placement_api.get('/resource_providers/%s' % host1_rp_uuid)
self.assertEqual(404, resp.status)
def test_resize_revert_after_deleted_source_compute(self):
"""Tests a scenario where a server is resized and while in
VERIFY_RESIZE status the admin attempts to delete the source compute
and then the user tries to revert the resize.
"""
# Start a compute service and create a server there.
self._start_compute('host1')
host1_rp_uuid = self._get_provider_uuid_by_host('host1')
flavors = self.api.get_flavors()
flavor1 = flavors[0]
flavor2 = flavors[1]
server = self._boot_and_check_allocations(flavor1, 'host1')
# Start a second compute service so we can resize there.
self._start_compute('host2')
host2_rp_uuid = self._get_provider_uuid_by_host('host2')
# Resize the server to host2.
self._resize_and_check_allocations(
server, flavor1, flavor2, host1_rp_uuid, host2_rp_uuid)
# Delete the source compute service.
service = self.admin_api.get_services(
binary='nova-compute', host='host1')[0]
# We expect the delete request to fail with a 409 error because of the
# instance in VERIFY_RESIZE status even though that instance is marked
# as being on host2 now.
ex = self.assertRaises(api_client.OpenStackApiException,
self.admin_api.api_delete,
'/os-services/%s' % service['id'])
self.assertEqual(409, ex.response.status_code)
self.assertIn('Unable to delete compute service that has in-progress '
'migrations', six.text_type(ex))
self.assertIn('There are 1 in-progress migrations involving the host',
self.stdlog.logger.output)
# The provider is still around because we did not delete the service.
resp = self.placement_api.get('/resource_providers/%s' % host1_rp_uuid)
self.assertEqual(200, resp.status)
self.assertFlavorMatchesUsage(host1_rp_uuid, flavor1)
# Now revert the resize.
self._revert_resize(server)
self.assertFlavorMatchesUsage(host1_rp_uuid, flavor1)
zero_flavor = {'vcpus': 0, 'ram': 0, 'disk': 0, 'extra_specs': {}}
self.assertFlavorMatchesUsage(host2_rp_uuid, zero_flavor)
# Delete the host2 service since the migration is reverted and the
# server is on host1 again.
service2 = self.admin_api.get_services(
binary='nova-compute', host='host2')[0]
self.admin_api.api_delete('/os-services/%s' % service2['id'])
# The host2 resource provider should be gone.
resp = self.placement_api.get('/resource_providers/%s' % host2_rp_uuid)
self.assertEqual(404, resp.status)
class ComputeStatusFilterTest(integrated_helpers.ProviderUsageBaseTestCase):
"""Tests the API, compute service and Placement interaction with the
COMPUTE_STATUS_DISABLED trait when a compute service is enable/disabled.
This version of the test uses the 2.latest microversion for testing the
2.53+ behavior of the PUT /os-services/{service_id} API.
"""
compute_driver = 'fake.SmallFakeDriver'
def _update_service(self, service, disabled, forced_down=None):
"""Update the service using the 2.53 request schema.
:param service: dict representing the service resource in the API
:param disabled: True if the service should be disabled, False if the
service should be enabled
:param forced_down: Optionally change the forced_down value.
"""
status = 'disabled' if disabled else 'enabled'
req = {'status': status}
if forced_down is not None:
req['forced_down'] = forced_down
self.admin_api.put_service(service['id'], req)
def test_compute_status_filter(self):
"""Tests the compute_status_filter placement request filter"""
# Start a compute service so a compute node and resource provider is
# created.
compute = self._start_compute('host1')
# Get the UUID of the resource provider that was created.
rp_uuid = self._get_provider_uuid_by_host('host1')
# Get the service from the compute API.
services = self.admin_api.get_services(binary='nova-compute',
host='host1')
self.assertEqual(1, len(services))
service = services[0]
# At this point, the service should be enabled and the
# COMPUTE_STATUS_DISABLED trait should not be set on the
# resource provider in placement.
self.assertEqual('enabled', service['status'])
rp_traits = self._get_provider_traits(rp_uuid)
trait = os_traits.COMPUTE_STATUS_DISABLED
self.assertNotIn(trait, rp_traits)
# Now disable the compute service via the API.
self._update_service(service, disabled=True)
# The update to placement should be synchronous so check the provider
# traits and COMPUTE_STATUS_DISABLED should be set.
rp_traits = self._get_provider_traits(rp_uuid)
self.assertIn(trait, rp_traits)
# Try creating a server which should fail because nothing is available.
networks = [{'port': self.neutron.port_1['id']}]
server_req = self._build_server(networks=networks)
server = self.api.post_server({'server': server_req})
server = self._wait_for_state_change(server, 'ERROR')
# There should be a NoValidHost fault recorded.
self.assertIn('fault', server)
self.assertIn('No valid host', server['fault']['message'])
# Now enable the service and the trait should be gone.
self._update_service(service, disabled=False)
rp_traits = self._get_provider_traits(rp_uuid)
self.assertNotIn(trait, rp_traits)
# Try creating another server and it should be OK.
server = self.api.post_server({'server': server_req})
self._wait_for_state_change(server, 'ACTIVE')
# Stop, force-down and disable the service so the API cannot call
# the compute service to sync the trait.
compute.stop()
self._update_service(service, disabled=True, forced_down=True)
# The API should have logged a message about the service being down.
self.assertIn('Compute service on host host1 is down. The '
'COMPUTE_STATUS_DISABLED trait will be synchronized '
'when the service is restarted.',
self.stdlog.logger.output)
# The trait should not be on the provider even though the node is
# disabled.
rp_traits = self._get_provider_traits(rp_uuid)
self.assertNotIn(trait, rp_traits)
# Restart the compute service which should sync and set the trait on
# the provider in placement.
self.restart_compute_service(compute)
rp_traits = self._get_provider_traits(rp_uuid)
self.assertIn(trait, rp_traits)
class ComputeStatusFilterTest211(ComputeStatusFilterTest):
"""Extends ComputeStatusFilterTest and uses the 2.11 API for the
legacy os-services disable/enable/force-down API behavior
"""
microversion = '2.11'
def _update_service(self, service, disabled, forced_down=None):
"""Update the service using the 2.11 request schema.
:param service: dict representing the service resource in the API
:param disabled: True if the service should be disabled, False if the
service should be enabled
:param forced_down: Optionally change the forced_down value.
"""
# Before 2.53 the service is uniquely identified by host and binary.
body = {
'host': service['host'],
'binary': service['binary']
}
# Handle forced_down first if provided since the enable/disable
# behavior in the API depends on it.
if forced_down is not None:
body['forced_down'] = forced_down
self.admin_api.api_put('/os-services/force-down', body)
if disabled:
self.admin_api.api_put('/os-services/disable', body)
else:
self.admin_api.api_put('/os-services/enable', body)
def _get_provider_uuid_by_host(self, host):
# We have to temporarily mutate to 2.53 to get the hypervisor UUID.
with utils.temporary_mutation(self.admin_api, microversion='2.53'):
return super(ComputeStatusFilterTest211,
self)._get_provider_uuid_by_host(host)
| rahulunair/nova | nova/tests/functional/wsgi/test_services.py | Python | apache-2.0 | 19,683 |
/*
* Copyright 2004-2013 the Seasar Foundation and the Others.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
package org.docksidestage.mysql.dbflute.immuhama.bsbhv.loader;
import java.util.List;
import org.dbflute.bhv.*;
import org.docksidestage.mysql.dbflute.immuhama.exbhv.*;
import org.docksidestage.mysql.dbflute.immuhama.exentity.*;
/**
* The referrer loader of (会員ログイン情報)MEMBER_LOGIN as TABLE. <br>
* <pre>
* [primary key]
* MEMBER_LOGIN_ID
*
* [column]
* MEMBER_LOGIN_ID, MEMBER_ID, LOGIN_DATETIME, MOBILE_LOGIN_FLG, LOGIN_MEMBER_STATUS_CODE
*
* [sequence]
*
*
* [identity]
* MEMBER_LOGIN_ID
*
* [version-no]
*
*
* [foreign table]
* MEMBER_STATUS, MEMBER
*
* [referrer table]
*
*
* [foreign property]
* memberStatus, member
*
* [referrer property]
*
* </pre>
* @author DBFlute(AutoGenerator)
*/
public class ImmuLoaderOfMemberLogin {
// ===================================================================================
// Attribute
// =========
protected List<ImmuMemberLogin> _selectedList;
protected BehaviorSelector _selector;
protected ImmuMemberLoginBhv _myBhv; // lazy-loaded
// ===================================================================================
// Ready for Loading
// =================
public ImmuLoaderOfMemberLogin ready(List<ImmuMemberLogin> selectedList, BehaviorSelector selector)
{ _selectedList = selectedList; _selector = selector; return this; }
protected ImmuMemberLoginBhv myBhv()
{ if (_myBhv != null) { return _myBhv; } else { _myBhv = _selector.select(ImmuMemberLoginBhv.class); return _myBhv; } }
// ===================================================================================
// Pull out Foreign
// ================
protected ImmuLoaderOfMemberStatus _foreignMemberStatusLoader;
public ImmuLoaderOfMemberStatus pulloutMemberStatus() {
if (_foreignMemberStatusLoader == null)
{ _foreignMemberStatusLoader = new ImmuLoaderOfMemberStatus().ready(myBhv().pulloutMemberStatus(_selectedList), _selector); }
return _foreignMemberStatusLoader;
}
protected ImmuLoaderOfMember _foreignMemberLoader;
public ImmuLoaderOfMember pulloutMember() {
if (_foreignMemberLoader == null)
{ _foreignMemberLoader = new ImmuLoaderOfMember().ready(myBhv().pulloutMember(_selectedList), _selector); }
return _foreignMemberLoader;
}
// ===================================================================================
// Accessor
// ========
public List<ImmuMemberLogin> getSelectedList() { return _selectedList; }
public BehaviorSelector getSelector() { return _selector; }
}
| dbflute-test/dbflute-test-dbms-mysql | src/main/java/org/docksidestage/mysql/dbflute/immuhama/bsbhv/loader/ImmuLoaderOfMemberLogin.java | Java | apache-2.0 | 3,938 |
/*
*
* Copyright 2015 Netflix, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
using System;
using System.Data;
using Fido_Main.Fido_Support.ErrorHandling;
namespace Fido_Main.Fido_Support.Objects.Fido
{
public class Object_Fido_ConfigClass
{
internal class ParseConfigs
{
internal int Primkey { get; set; }
internal string DetectorType { get; set; }
internal string Detector { get; set; }
internal string Vendor { get; set; }
internal string Server { get; set; }
internal string Folder { get; set; }
internal string FolderTest { get; set; }
internal string File { get; set; }
internal string EmailFrom { get; set; }
internal string Lastevent { get; set; }
internal string UserID { get; set; }
internal string Pwd { get; set; }
internal string Acek { get; set; }
internal string DB { get; set; }
internal string ConnString { get; set; }
internal string Query { get; set; }
internal string Query3 { get; set; }
internal string Query2 { get; set; }
internal string APIKey { get; set; }
}
internal static ParseConfigs FormatParse(DataTable dbReturn)
{
try
{
var reformat = new ParseConfigs
{
DetectorType = Convert.ToString(dbReturn.Rows[0].ItemArray[1]),
Detector = Convert.ToString(dbReturn.Rows[0].ItemArray[2]),
Vendor = Convert.ToString(dbReturn.Rows[0].ItemArray[3]),
Server = Convert.ToString(dbReturn.Rows[0].ItemArray[4]),
Folder = Convert.ToString(dbReturn.Rows[0].ItemArray[5]),
FolderTest = Convert.ToString(dbReturn.Rows[0].ItemArray[6]),
File = Convert.ToString(dbReturn.Rows[0].ItemArray[7]),
EmailFrom = Convert.ToString(dbReturn.Rows[0].ItemArray[8]),
Lastevent = Convert.ToString(dbReturn.Rows[0].ItemArray[9]),
UserID = Convert.ToString(dbReturn.Rows[0].ItemArray[10]),
Pwd = Convert.ToString(dbReturn.Rows[0].ItemArray[11]),
Acek = Convert.ToString(dbReturn.Rows[0].ItemArray[12]),
DB = Convert.ToString(dbReturn.Rows[0].ItemArray[13]),
ConnString = Convert.ToString(dbReturn.Rows[0].ItemArray[14]),
Query = Convert.ToString(dbReturn.Rows[0].ItemArray[15]),
Query2 = Convert.ToString(dbReturn.Rows[0].ItemArray[16]),
Query3 = Convert.ToString(dbReturn.Rows[0].ItemArray[17]),
APIKey = Convert.ToString(dbReturn.Rows[0].ItemArray[18])
};
return reformat;
}
catch (Exception e)
{
Fido_EventHandler.SendEmail("Fido Error", "Fido Failed: {0} Unable to format datatable return." + e);
}
return null;
}
}
}
| Netflix/Fido | Fido_Support/Objects/Fido/Object_Fido_ConfigClass.cs | C# | apache-2.0 | 3,292 |
export const VERSION = 1;
/** Same as DexieExportJsonStructure but without the data.data array */
export interface DexieExportJsonMeta {
formatName: 'dexie';
formatVersion: typeof VERSION;
data: {
databaseName: string;
databaseVersion: number;
tables: Array<{
name: string;
schema: string;
rowCount: number;
}>;
}
}
export interface DexieExportJsonStructure extends DexieExportJsonMeta {
formatName: 'dexie';
formatVersion: typeof VERSION;
data: {
databaseName: string;
databaseVersion: number;
tables: Array<{
name: string;
schema: string;
rowCount: number;
}>;
data: Array<{
tableName: string;
inbound: boolean;
rows: any[];
}>;
}
}
export type DexieExportedDatabase = DexieExportJsonStructure["data"];
export type DexieExportedTable = DexieExportedDatabase["data"][number];
| dfahlander/Dexie.js | addons/dexie-export-import/src/json-structure.ts | TypeScript | apache-2.0 | 890 |
/*
* Copyright © 2009 HotPads ([email protected])
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.datarouter.webappinstance.storage.webappinstancelog;
import java.util.List;
import javax.inject.Inject;
import javax.inject.Singleton;
import io.datarouter.model.databean.FieldlessIndexEntry;
import io.datarouter.scanner.Scanner;
import io.datarouter.storage.Datarouter;
import io.datarouter.storage.client.ClientId;
import io.datarouter.storage.dao.BaseDao;
import io.datarouter.storage.dao.BaseRedundantDaoParams;
import io.datarouter.storage.node.factory.IndexingNodeFactory;
import io.datarouter.storage.node.factory.NodeFactory;
import io.datarouter.storage.node.op.combo.IndexedSortedMapStorage.IndexedSortedMapStorageNode;
import io.datarouter.storage.node.op.index.IndexReader;
import io.datarouter.storage.tag.Tag;
import io.datarouter.util.tuple.Range;
import io.datarouter.virtualnode.redundant.RedundantIndexedSortedMapStorageNode;
import io.datarouter.webappinstance.storage.webappinstancelog.WebappInstanceLog.WebappInstanceLogFielder;
@Singleton
public class DatarouterWebappInstanceLogDao extends BaseDao{
public static class DatarouterWebappInstanceLogDaoParams extends BaseRedundantDaoParams{
public DatarouterWebappInstanceLogDaoParams(List<ClientId> clientIds){
super(clientIds);
}
}
private final IndexedSortedMapStorageNode<WebappInstanceLogKey,WebappInstanceLog,WebappInstanceLogFielder> node;
private final IndexReader<WebappInstanceLogKey,WebappInstanceLog,WebappInstanceLogByBuildInstantKey,
FieldlessIndexEntry<WebappInstanceLogByBuildInstantKey,WebappInstanceLogKey,WebappInstanceLog>>
byBuildInstant;
@Inject
public DatarouterWebappInstanceLogDao(
Datarouter datarouter,
NodeFactory nodeFactory,
IndexingNodeFactory indexingNodeFactory,
DatarouterWebappInstanceLogDaoParams params){
super(datarouter);
node = Scanner.of(params.clientIds)
.map(clientId -> {
IndexedSortedMapStorageNode<WebappInstanceLogKey,WebappInstanceLog,WebappInstanceLogFielder> node =
nodeFactory.create(clientId, WebappInstanceLog::new, WebappInstanceLogFielder::new)
.withTag(Tag.DATAROUTER)
.build();
return node;
})
.listTo(RedundantIndexedSortedMapStorageNode::makeIfMulti);
byBuildInstant = indexingNodeFactory.createKeyOnlyManagedIndex(WebappInstanceLogByBuildInstantKey::new, node)
.build();
datarouter.register(node);
}
public void put(WebappInstanceLog log){
node.put(log);
}
public Scanner<WebappInstanceLog> scan(){
return node.scan();
}
public Scanner<WebappInstanceLog> scanWithPrefix(WebappInstanceLogKey key){
return node.scanWithPrefix(key);
}
public Scanner<WebappInstanceLog> scanDatabeans(Range<WebappInstanceLogByBuildInstantKey> range){
return byBuildInstant.scanDatabeans(range);
}
}
| hotpads/datarouter | datarouter-webapp-instance/src/main/java/io/datarouter/webappinstance/storage/webappinstancelog/DatarouterWebappInstanceLogDao.java | Java | apache-2.0 | 3,351 |
package nl.galesloot_ict.efjenergy.MeterReading;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;
import java.util.ArrayList;
/**
* Created by FlorisJan on 23-11-2014.
*/
public class MeterReadingsList extends ArrayList<MeterReading> {
@JsonCreator
public static MeterReadingsList Create(String jsonString) throws JsonParseException, JsonMappingException, IOException {
ObjectMapper mapper = new ObjectMapper();
MeterReadingsList meterReading = null;
meterReading = mapper.readValue(jsonString, MeterReadingsList.class);
return meterReading;
}
}
| fjgalesloot/eFJenergy | Android/app/src/main/java/nl/galesloot_ict/efjenergy/MeterReading/MeterReadingsList.java | Java | apache-2.0 | 794 |
@route += '/' + ARGV[0] + '/' + ARGV[1] + '/'+ ARGV[2] + '/' + ARGV[3]
@route += '/' + ARGV[4] if ARGV.count == 5
perform_get | EnginesOS/System | src/client/commands/schedules.rb | Ruby | apache-2.0 | 128 |
# AUTOGENERATED FILE
FROM balenalib/odroid-ux3-alpine:3.10-run
ENV GO_VERSION 1.16.3
# set up nsswitch.conf for Go's "netgo" implementation
# - https://github.com/golang/go/blob/go1.9.1/src/net/conf.go#L194-L275
# - docker run --rm debian:stretch grep '^hosts:' /etc/nsswitch.conf
RUN [ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf
# gcc for cgo
RUN apk add --no-cache git gcc ca-certificates
RUN fetchDeps='curl' \
&& set -x \
&& apk add --no-cache $fetchDeps \
&& mkdir -p /usr/local/go \
&& curl -SLO "http://resin-packages.s3.amazonaws.com/golang/v$GO_VERSION/go$GO_VERSION.linux-alpine-armv7hf.tar.gz" \
&& echo "82d3d01d1f341b3afb21b1c650fe7edc6b1b4757bfef78a46a39faa4ee411b8d go$GO_VERSION.linux-alpine-armv7hf.tar.gz" | sha256sum -c - \
&& tar -xzf "go$GO_VERSION.linux-alpine-armv7hf.tar.gz" -C /usr/local/go --strip-components=1 \
&& rm -f go$GO_VERSION.linux-alpine-armv7hf.tar.gz
ENV GOROOT /usr/local/go
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
WORKDIR $GOPATH
CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"]
RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/[email protected]" \
&& echo "Running test-stack@golang" \
&& chmod +x [email protected] \
&& bash [email protected] \
&& rm -rf [email protected]
RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo $'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v7 \nOS: Alpine Linux 3.10 \nVariant: run variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nGo v1.16.3 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info
RUN echo $'#!/bin/bash\nbalena-info\nbusybox ln -sf /bin/busybox /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \
&& chmod +x /bin/sh-shim \
&& ln -f /bin/sh /bin/sh.real \
&& ln -f /bin/sh-shim /bin/sh | nghiant2710/base-images | balena-base-images/golang/odroid-ux3/alpine/3.10/1.16.3/run/Dockerfile | Dockerfile | apache-2.0 | 2,467 |
package com.walmart.labs.pcs.normalize.MongoDB.SpringBoot.service;
import com.walmart.labs.pcs.normalize.MongoDB.SpringBoot.entity.Person;
import com.walmart.labs.pcs.normalize.MongoDB.SpringBoot.repository.PersonRepository;
import com.walmart.labs.pcs.normalize.MongoDB.SpringBoot.repository.PersonRepositoryImp;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/**
* Created by pzhong1 on 1/23/15.
*/
public class PersonService {
@Autowired
private PersonRepository personRepository;
public List<Person> getAllPersons(){
return personRepository.findAll();
}
public Person searchPerson(String id){
return personRepository.findOne(id);
}
public void insertPersonWithNameJohnAndRandomAge(Person person){
personRepository.save(person);
}
public void dropPersonCollection() {
personRepository.deleteAll();
}
}
| ArthurZhong/SparkStormKafkaTest | src/main/java/com/walmart/labs/pcs/normalize/MongoDB/SpringBoot/service/PersonService.java | Java | apache-2.0 | 925 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>WPILIB: Class Members</title>
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.8 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="files.html"><span>File List</span></a></li>
<li class="current"><a href="globals.html"><span>File Members</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li class="current"><a href="globals.html"><span>All</span></a></li>
<li><a href="globals_func.html"><span>Functions</span></a></li>
<li><a href="globals_vars.html"><span>Variables</span></a></li>
<li><a href="globals_type.html"><span>Typedefs</span></a></li>
<li><a href="globals_enum.html"><span>Enumerations</span></a></li>
<li><a href="globals_eval.html"><span>Enumerator</span></a></li>
<li><a href="globals_defs.html"><span>Defines</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="globals.html#index__"><span>_</span></a></li>
<li><a href="globals_0x61.html#index_a"><span>a</span></a></li>
<li><a href="globals_0x62.html#index_b"><span>b</span></a></li>
<li><a href="globals_0x63.html#index_c"><span>c</span></a></li>
<li><a href="globals_0x64.html#index_d"><span>d</span></a></li>
<li><a href="globals_0x65.html#index_e"><span>e</span></a></li>
<li><a href="globals_0x66.html#index_f"><span>f</span></a></li>
<li><a href="globals_0x67.html#index_g"><span>g</span></a></li>
<li><a href="globals_0x68.html#index_h"><span>h</span></a></li>
<li><a href="globals_0x69.html#index_i"><span>i</span></a></li>
<li><a href="globals_0x6a.html#index_j"><span>j</span></a></li>
<li><a href="globals_0x6b.html#index_k"><span>k</span></a></li>
<li class="current"><a href="globals_0x6c.html#index_l"><span>l</span></a></li>
<li><a href="globals_0x6d.html#index_m"><span>m</span></a></li>
<li><a href="globals_0x6e.html#index_n"><span>n</span></a></li>
<li><a href="globals_0x6f.html#index_o"><span>o</span></a></li>
<li><a href="globals_0x70.html#index_p"><span>p</span></a></li>
<li><a href="globals_0x71.html#index_q"><span>q</span></a></li>
<li><a href="globals_0x72.html#index_r"><span>r</span></a></li>
<li><a href="globals_0x73.html#index_s"><span>s</span></a></li>
<li><a href="globals_0x74.html#index_t"><span>t</span></a></li>
<li><a href="globals_0x75.html#index_u"><span>u</span></a></li>
<li><a href="globals_0x76.html#index_v"><span>v</span></a></li>
<li><a href="globals_0x77.html#index_w"><span>w</span></a></li>
</ul>
</div>
</div>
<div class="contents">
Here is a list of all file members with links to the files they belong to:
<p>
<h3><a class="anchor" name="index_l">- l -</a></h3><ul>
<li>LCDOptions
: <a class="el" href="nivision_8h.html#aa3ce0a2ba425c09e16683eb9a65b858">nivision.h</a>
<li>LCDReport
: <a class="el" href="nivision_8h.html#8bec28eeb0437e0fc40177923e57c92d">nivision.h</a>
<li>LCDSegments
: <a class="el" href="nivision_8h.html#52dc96535da0eb8768fb45d97e481ad1">nivision.h</a>
<li>LearnCalibrationOptions
: <a class="el" href="nivision_8h.html#fac80df95a4b166758af8e68c78a427a">nivision.h</a>
<li>LearnColorPatternOptions
: <a class="el" href="nivision_8h.html#6ca40662dca8edd71e633aba67db706d">nivision.h</a>
<li>LearnGeometricPatternAdvancedOptions
: <a class="el" href="nivision_8h.html#394286c01394588a3ac0ac1d49b7b82a">nivision.h</a>
<li>LearningMode
: <a class="el" href="nivision_8h.html#0645ec2a0d2f9d7ff7772e91ec92cb5a">nivision.h</a>
<li>LearningMode_enum
: <a class="el" href="nivision_8h.html#d516a13e50020a4fadba800dd7fb1efe">nivision.h</a>
<li>LearnPatternAdvancedOptions
: <a class="el" href="nivision_8h.html#4ecb2f6fb10aa389f78cccda126a7c4a">nivision.h</a>
<li>LearnPatternAdvancedRotationOptions
: <a class="el" href="nivision_8h.html#11d6cec781d3da21a5c2797139d61ff0">nivision.h</a>
<li>LearnPatternAdvancedShiftOptions
: <a class="el" href="nivision_8h.html#f1e1e438fdba54eaa804b3495361c864">nivision.h</a>
<li>LedInput()
: <a class="el" href="Utility_8cpp.html#ba092a586de5e741805be93e8b2338dc">Utility.cpp</a>
<li>LedOutput()
: <a class="el" href="Utility_8cpp.html#d3dca96687fcaabf6873aeb98ee01766">Utility.cpp</a>
<li>LegFeature
: <a class="el" href="nivision_8h.html#1ab9e288ad849c08a4172a372e48e44c">nivision.h</a>
<li>LevelType
: <a class="el" href="nivision_8h.html#e4b077296d11f290ca4997af72e6906b">nivision.h</a>
<li>LevelType_enum
: <a class="el" href="nivision_8h.html#31c3c8095f1ccdb7a0df899a4ee2c6d5">nivision.h</a>
<li>Line
: <a class="el" href="nivision_8h.html#38131fb0373f08bcee39a79665b990a1">nivision.h</a>
<li>LinearAverages
: <a class="el" href="nivision_8h.html#f41b7cd85e84c90cec588c9dd19457dd">nivision.h</a>
<li>LinearAveragesMode
: <a class="el" href="nivision_8h.html#29f01f91fa394a77ddca33c7b3fec682">nivision.h</a>
<li>LinearAveragesMode_enum
: <a class="el" href="nivision_8h.html#11081b729bd1b2111a26381525144b76">nivision.h</a>
<li>LineDescriptor
: <a class="el" href="nivision_8h.html#fbe78ced018bd1dcb9eb8ae1bb86c619">nivision.h</a>
<li>LineEquation
: <a class="el" href="nivision_8h.html#14ffe21d2c9c3e6fa21e8841fbf73165">nivision.h</a>
<li>LineFeature
: <a class="el" href="nivision_8h.html#a5f4503a8b633f2ff5049b64ec91cf32">nivision.h</a>
<li>LineFloat
: <a class="el" href="nivision_8h.html#386678d12111381a5f8220f39a4aeb61">nivision.h</a>
<li>LineGaugeMethod
: <a class="el" href="nivision_8h.html#ed2eeb32b069e1c23184fb464eb9fcfd">nivision.h</a>
<li>LineGaugeMethod_enum
: <a class="el" href="nivision_8h.html#67ea655dd9037ccbfa88b7282b3b2588">nivision.h</a>
<li>LineMatch
: <a class="el" href="nivision_8h.html#6d079e6cb43690dc1331cbbb73538048">nivision.h</a>
<li>LineProfile
: <a class="el" href="nivision_8h.html#5ea6683e1dd20d41f78fa80bb2a41651">nivision.h</a>
<li>LocalThresholdMethod
: <a class="el" href="nivision_8h.html#19de5df1d763d70207d53e2457e926ce">nivision.h</a>
<li>LocalThresholdMethod_enum
: <a class="el" href="nivision_8h.html#9bd1bfbdbb8f4977a139e3ed06d5be07">nivision.h</a>
</ul>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Wed Feb 9 11:20:56 2011 for WPILIB by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address>
</body>
</html>
| rubik951/Neat-Team-1943 | Documentation/WPILib-doxygen/html/globals_0x6c.html | HTML | apache-2.0 | 6,933 |
package edu.wsu.weather.agweathernet.helpers;
import java.io.Serializable;
public class StationModel implements Serializable {
private static final long serialVersionUID = 1L;
private String unitId;
private String name;
private String county;
private String city;
private String state;
private String installationDate;
private String distance;
private boolean isFavourite;
// stations details data
private String airTemp;
private String relHumid;
private String windSpeed;
private String precip;
public StationModel() {
}
public StationModel(String unitId, String name, String county,
String installationDate) {
this.setUnitId(unitId);
this.setName(name);
this.setCounty(county);
this.setInstallationDate(installationDate);
}
public String getUnitId() {
return unitId;
}
public void setUnitId(String unitId) {
this.unitId = unitId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCounty() {
return county;
}
public void setCounty(String county) {
this.county = county;
}
public String getInstallationDate() {
return installationDate;
}
public void setInstallationDate(String installationDate) {
this.installationDate = installationDate;
}
@Override
public String toString() {
return this.name + " " + this.county;
}
public boolean isFavourite() {
return isFavourite;
}
public void setFavourite(boolean isFavourite) {
this.isFavourite = isFavourite;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getDistance() {
return distance;
}
public void setDistance(String distance) {
this.distance = distance;
}
public String getAirTemp() {
return airTemp;
}
public void setAirTemp(String airTemp) {
this.airTemp = airTemp;
}
public String getWindSpeed() {
return windSpeed;
}
public void setWindSpeed(String windSpeed) {
this.windSpeed = windSpeed;
}
public String getPrecip() {
return precip;
}
public void setPrecip(String precip) {
this.precip = precip;
}
public String getRelHumid() {
return relHumid;
}
public void setRelHumid(String relHumid) {
this.relHumid = relHumid;
}
}
| levanlevi/AgWeatherNet | src/edu/wsu/weather/agweathernet/helpers/StationModel.java | Java | apache-2.0 | 2,366 |
# Burmeistera matthaei (DC.) Hook.f. & B.D.Jacks. SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | mdoering/backbone | life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Campanulaceae/Burmeistera/Burmeistera matthaei/README.md | Markdown | apache-2.0 | 197 |
module Bosh
module Director
end
end
require 'digest/sha1'
require 'erb'
require 'fileutils'
require 'forwardable'
require 'logger'
require 'logging'
require 'monitor'
require 'optparse'
require 'ostruct'
require 'pathname'
require 'pp'
require 'tmpdir'
require 'yaml'
require 'time'
require 'zlib'
require 'ipaddr'
require 'common/exec'
require 'bosh/template/evaluation_context'
require 'common/version/release_version_list'
require 'bcrypt'
require 'eventmachine'
require 'netaddr'
require 'delayed_job'
require 'sequel'
require 'sinatra/base'
require 'securerandom'
require 'nats/client'
require 'securerandom'
require 'delayed_job_sequel'
require 'common/thread_formatter'
require 'bosh/director/cloud_factory'
require 'bosh/director/az_cloud_factory.rb'
require 'bosh/director/api'
require 'bosh/director/dns/local_dns_repo'
require 'bosh/director/dns/blobstore_dns_publisher'
require 'bosh/director/dns/canonicalizer'
require 'bosh/director/dns/dns_name_generator'
require 'bosh/director/dns/director_dns_state_updater'
require 'bosh/director/dns/dns_version_converger'
require 'bosh/director/dns/dns_encoder'
require 'bosh/director/dns/local_dns_encoder_manager'
require 'bosh/director/dns/local_dns_manager'
require 'bosh/director/dns/power_dns_manager'
require 'bosh/director/dns/dns_records'
require 'bosh/director/errors'
require 'bosh/director/ext'
require 'bosh/director/ip_util'
require 'bosh/director/cidr_range_combiner'
require 'bosh/director/lock_helper'
require 'bosh/director/validation_helper'
require 'bosh/director/download_helper'
require 'bosh/director/formatter_helper'
require 'bosh/director/tagged_logger'
require 'bosh/director/legacy_deployment_helper'
require 'bosh/director/duplicate_detector'
require 'bosh/director/version'
require 'bosh/director/config'
require 'bosh/director/event_log'
require 'bosh/director/task_db_writer'
require 'bosh/director/task_appender'
require 'bosh/director/blob_util'
require 'bosh/director/digest/bosh_digest'
require 'bosh/director/agent_client'
require 'cloud'
require 'cloud/external_cpi'
require 'cloud/errors'
require 'bosh/director/compile_task'
require 'bosh/director/key_generator'
require 'bosh/director/package_dependencies_manager'
require 'bosh/director/job_renderer'
require 'bosh/director/rendered_templates_persister'
require 'bosh/director/audit_logger'
require 'bosh/director/cycle_helper'
require 'bosh/director/worker'
require 'bosh/director/password_helper'
require 'bosh/director/vm_creator'
require 'bosh/director/vm_deleter'
require 'bosh/director/orphaned_vm_deleter'
require 'bosh/director/metadata_updater'
require 'bosh/director/instance_reuser'
require 'bosh/director/deployment_plan'
require 'bosh/director/deployment_plan/variables_parser'
require 'bosh/director/deployment_plan/variables'
require 'bosh/director/deployment_plan/deployment_features_parser'
require 'bosh/director/deployment_plan/deployment_features'
require 'bosh/director/runtime_config'
require 'bosh/director/cloud_config'
require 'bosh/director/cpi_config'
require 'bosh/director/compiled_release'
require 'bosh/director/errand'
require 'bosh/director/duration'
require 'bosh/director/hash_string_vals'
require 'bosh/director/instance_deleter'
require 'bosh/director/instance_updater'
require 'bosh/director/instance_updater/instance_state'
require 'bosh/director/instance_updater/recreate_handler'
require 'bosh/director/instance_updater/state_applier'
require 'bosh/director/instance_updater/update_procedure'
require 'bosh/director/disk_manager'
require 'bosh/director/orphan_disk_manager'
require 'bosh/director/stopper'
require 'bosh/director/job_runner'
require 'bosh/director/instance_group_updater'
require 'bosh/director/instance_group_updater_factory'
require 'bosh/director/job_queue'
require 'bosh/director/lock'
require 'bosh/director/nats_rpc'
require 'bosh/director/network_reservation'
require 'bosh/director/problem_scanner/scanner'
require 'bosh/director/problem_resolver'
require 'bosh/director/post_deployment_script_runner'
require 'bosh/director/error_ignorer'
require 'bosh/director/deployment_deleter'
require 'bosh/director/permission_authorizer'
require 'bosh/director/transactor'
require 'bosh/director/sequel'
require 'bosh/director/agent_broadcaster'
require 'bosh/director/timeout'
require 'bosh/director/nats_client_cert_generator'
require 'common/thread_pool'
require 'bosh/director/config_server/deep_hash_replacement'
require 'bosh/director/config_server/uaa_auth_provider'
require 'bosh/director/config_server/auth_http_client'
require 'bosh/director/config_server/retryable_http_client'
require 'bosh/director/config_server/config_server_http_client'
require 'bosh/director/config_server/client'
require 'bosh/director/config_server/client_factory'
require 'bosh/director/config_server/variables_interpolator'
require 'bosh/director/config_server/config_server_helper'
require 'bosh/director/links/links_manager'
require 'bosh/director/links/links_error_builder'
require 'bosh/director/links/links_parser'
require 'bosh/director/disk/persistent_disk_comparators'
require 'bosh/director/manifest/manifest'
require 'bosh/director/manifest/changeset'
require 'bosh/director/manifest/redactor'
require 'bosh/director/manifest/diff_lines'
require 'bosh/director/log_bundles_cleaner'
require 'bosh/director/logs_fetcher'
require 'bosh/director/cloudcheck_helper'
require 'bosh/director/problem_handlers/base'
require 'bosh/director/problem_handlers/invalid_problem'
require 'bosh/director/problem_handlers/inactive_disk'
require 'bosh/director/problem_handlers/missing_disk'
require 'bosh/director/problem_handlers/unresponsive_agent'
require 'bosh/director/problem_handlers/mount_info_mismatch'
require 'bosh/director/problem_handlers/missing_vm'
require 'bosh/director/jobs/base_job'
require 'bosh/director/jobs/backup'
require 'bosh/director/jobs/scheduled_backup'
require 'bosh/director/jobs/scheduled_orphaned_disk_cleanup'
require 'bosh/director/jobs/scheduled_orphaned_vm_cleanup'
require 'bosh/director/jobs/scheduled_events_cleanup'
require 'bosh/director/jobs/scheduled_dns_blobs_cleanup'
require 'bosh/director/jobs/create_snapshot'
require 'bosh/director/jobs/snapshot_deployment'
require 'bosh/director/jobs/snapshot_deployments'
require 'bosh/director/jobs/snapshot_self'
require 'bosh/director/jobs/delete_deployment'
require 'bosh/director/jobs/delete_deployment_snapshots'
require 'bosh/director/jobs/delete_release'
require 'bosh/director/jobs/delete_snapshots'
require 'bosh/director/jobs/delete_orphan_disks'
require 'bosh/director/jobs/delete_stemcell'
require 'bosh/director/jobs/cleanup_artifacts'
require 'bosh/director/jobs/export_release'
require 'bosh/director/jobs/update_deployment'
require 'bosh/director/jobs/update_release'
require 'bosh/director/jobs/update_stemcell'
require 'bosh/director/jobs/fetch_logs'
require 'bosh/director/jobs/vm_state'
require 'bosh/director/jobs/run_errand'
require 'bosh/director/jobs/cloud_check/scan'
require 'bosh/director/jobs/cloud_check/scan_and_fix'
require 'bosh/director/jobs/cloud_check/apply_resolutions'
require 'bosh/director/jobs/release/release_job'
require 'bosh/director/jobs/ssh'
require 'bosh/director/jobs/attach_disk'
require 'bosh/director/jobs/delete_vm'
require 'bosh/director/jobs/helpers'
require 'bosh/director/jobs/db_job'
require 'bosh/director/jobs/orphan_disk'
require 'bosh/director/models/helpers/model_helper'
require 'bosh/director/db_backup'
require 'bosh/director/blobstores'
require 'bosh/director/api/director_uuid_provider'
require 'bosh/director/api/local_identity_provider'
require 'bosh/director/api/uaa_identity_provider'
require 'bosh/director/api/event_manager'
require 'bosh/director/app'
module Bosh::Director
autoload :Models, 'bosh/director/models' # Defining model classes relies on a database connection
end
require 'bosh/director/thread_pool'
require 'bosh/director/api/extensions/scoping'
require 'bosh/director/api/extensions/request_logger'
require 'bosh/director/api/controllers/backups_controller'
require 'bosh/director/api/controllers/cleanup_controller'
require 'bosh/director/api/controllers/deployments_controller'
require 'bosh/director/api/controllers/disks_controller'
require 'bosh/director/api/controllers/orphan_disks_controller'
require 'bosh/director/api/controllers/orphaned_vms_controller'
require 'bosh/director/api/controllers/packages_controller'
require 'bosh/director/api/controllers/info_controller'
require 'bosh/director/api/controllers/jobs_controller'
require 'bosh/director/api/controllers/releases_controller'
require 'bosh/director/api/controllers/resources_controller'
require 'bosh/director/api/controllers/resurrection_controller'
require 'bosh/director/api/controllers/stemcells_controller'
require 'bosh/director/api/controllers/stemcell_uploads_controller'
require 'bosh/director/api/controllers/tasks_controller'
require 'bosh/director/api/controllers/task_controller'
require 'bosh/director/api/controllers/configs_controller'
require 'bosh/director/api/controllers/deployment_configs_controller'
require 'bosh/director/api/controllers/cloud_configs_controller'
require 'bosh/director/api/controllers/runtime_configs_controller'
require 'bosh/director/api/controllers/cpi_configs_controller'
require 'bosh/director/api/controllers/locks_controller'
require 'bosh/director/api/controllers/restore_controller'
require 'bosh/director/api/controllers/events_controller'
require 'bosh/director/api/controllers/vms_controller'
require 'bosh/director/api/controllers/link_providers_controller'
require 'bosh/director/api/controllers/link_consumers_controller'
require 'bosh/director/api/controllers/links_controller'
require 'bosh/director/api/controllers/link_address_controller'
require 'bosh/director/api/route_configuration'
require 'bosh/director/step_executor'
require 'common/common'
require 'bosh/blobstore_client/errors'
require 'bosh/blobstore_client/client'
Bosh::Blobstore.autoload(:BaseClient, 'bosh/blobstore_client/base')
require 'bosh/blobstore_client/retryable_blobstore_client'
require 'bosh/blobstore_client/sha1_verifiable_blobstore_client'
Bosh::Blobstore.autoload(:SimpleBlobstoreClient, 'bosh/blobstore_client/simple_blobstore_client')
Bosh::Blobstore.autoload(:LocalClient, 'bosh/blobstore_client/local_client')
Bosh::Blobstore.autoload(:DavcliBlobstoreClient, 'bosh/blobstore_client/davcli_blobstore_client')
Bosh::Blobstore.autoload(:S3cliBlobstoreClient, 'bosh/blobstore_client/s3cli_blobstore_client')
Bosh::Blobstore.autoload(:GcscliBlobstoreClient, 'bosh/blobstore_client/gcscli_blobstore_client')
| barthy1/bosh | src/bosh-director/lib/bosh/director.rb | Ruby | apache-2.0 | 10,606 |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang='en'>
<head>
<meta name="generator" content="AWStats 6.7 (build 1.892) from config file awstats.2818332.conf (http://awstats.sourceforge.net)">
<meta name="robots" content="noindex,nofollow">
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta http-equiv="description" content="Awstats - Advanced Web Statistics for 0340a95.netsolhost.com (2013-09)">
<title>Statistics for 0340a95.netsolhost.com (2013-09)</title>
<style type="text/css">
<!--
body { font: 11px verdana, arial, helvetica, sans-serif; background-color: #FFFFFF; margin-top: 0; margin-bottom: 0; }
.aws_bodyl { }
.aws_border { border-collapse: collapse; background-color: #CCCCDD; padding: 1px 1px 1px 1px; margin-top: 0px; margin-bottom: 0px; }
.aws_title { font: 13px verdana, arial, helvetica, sans-serif; font-weight: bold; background-color: #CCCCDD; text-align: center; margin-top: 0; margin-bottom: 0; padding: 1px 1px 1px 1px; color: #000000; }
.aws_blank { font: 13px verdana, arial, helvetica, sans-serif; background-color: #FFFFFF; text-align: center; margin-bottom: 0; padding: 1px 1px 1px 1px; }
.aws_data {
background-color: #FFFFFF;
border-top-width: 1px;
border-left-width: 0px;
border-right-width: 0px;
border-bottom-width: 0px;
}
.aws_formfield { font: 13px verdana, arial, helvetica; }
.aws_button {
font-family: arial,verdana,helvetica, sans-serif;
font-size: 12px;
border: 1px solid #ccd7e0;
background-image : url(/awstats/icon/other/button.gif);
}
th { border-color: #ECECEC; border-left-width: 0px; border-right-width: 1px; border-top-width: 0px; border-bottom-width: 1px; padding: 1px 2px 1px 1px; font: 11px verdana, arial, helvetica, sans-serif; text-align:center; color: #000000; }
th.aws { border-color: #ECECEC; border-left-width: 0px; border-right-width: 1px; border-top-width: 0px; border-bottom-width: 1px; padding: 1px 2px 1px 1px; font-size: 13px; font-weight: bold; }
td { border-color: #ECECEC; border-left-width: 0px; border-right-width: 1px; border-top-width: 0px; border-bottom-width: 1px; font: 11px verdana, arial, helvetica, sans-serif; text-align:center; color: #000000; }
td.aws { border-color: #ECECEC; border-left-width: 0px; border-right-width: 1px; border-top-width: 0px; border-bottom-width: 1px; font: 11px verdana, arial, helvetica, sans-serif; text-align:left; color: #000000; padding: 0px;}
td.awsm { border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; font: 11px verdana, arial, helvetica, sans-serif; text-align:left; color: #000000; padding: 0px; }
b { font-weight: bold; }
a { font: 11px verdana, arial, helvetica, sans-serif; }
a:link { color: #0011BB; text-decoration: none; }
a:visited { color: #0011BB; text-decoration: none; }
a:hover { color: #605040; text-decoration: underline; }
.currentday { font-weight: bold; }
//-->
</style>
</head>
<body style="margin-top: 0px">
<a name="top"> </a>
<a name="menu"> </a>
<form name="FormDateFilter" action="/cgi-bin/awstats.pl?config=2818332.1309&configdir=/data/22/2/81/47/2570699/meta/2818332/config&output=urldetail" style="padding: 0px 0px 0px 0px; margin-top: 0">
<table class="aws_border" border="0" cellpadding="2" cellspacing="0" width="100%">
<tr><td>
<table class="aws_data" border="0" cellpadding="1" cellspacing="0" width="100%">
<tr><td class="aws" valign="middle"><b>Statistics for:</b> </td><td class="aws" valign="middle"><span style="font-size: 14px;">0340a95.netsolhost.com</span></td><td align="right" rowspan="3"><a href="http://awstats.sourceforge.net" target="awstatshome"><img src="/awstats/icon/other/awstats_logo6.png" border="0" alt='Awstats Web Site' title='Awstats Web Site' /></a></td></tr>
<tr valign="middle"><td class="aws" valign="middle" width="150"><b>Last Update:</b> </td><td class="aws" valign="middle"><span style="font-size: 12px;">01 Oct 2013 - 01:49</span></td></tr>
<tr><td class="aws" valign="middle"><b>Reported period:</b></td><td class="aws" valign="middle"><span style="font-size: 14px;">Month Sep 2013</span></td></tr>
</table>
</td></tr></table>
</form>
<table>
<tr><td class="aws"><a href="javascript:parent.window.close();">Close window</a></td></tr>
</table>
<a name="urls"> </a><br />
<table class="aws_border" border="0" cellpadding="2" cellspacing="0" width="100%">
<tr><td class="aws_title" width="70%">Pages-URL </td><td class="aws_blank"> </td></tr>
<tr><td colspan="2">
<table class="aws_data" border="1" cellpadding="2" cellspacing="0" width="100%">
<tr bgcolor="#ECECEC"><th>Total: 12 different pages-url</th><th bgcolor="#4477DD" width="80">Viewed</th><th bgcolor="#2EA495" width="80">Average size</th><th bgcolor="#CEC2E8" width="80">Entry</th><th bgcolor="#C1B2E2" width="80">Exit</th><th> </th></tr>
<tr><td class="aws"><a href="http://0340a95.netsolhost.com/cd-risc/bibliography.shtml" target="url">/cd-risc/bibliography.shtml</a></td><td>1293</td><td>55.78 KB</td><td>367</td><td>391</td><td class="aws"><img src="/awstats/icon/other/hp.png" width="261" height="4" /><br /><img src="/awstats/icon/other/hk.png" width="105" height="4" /><br /><img src="/awstats/icon/other/he.png" width="74" height="4" /><br /><img src="/awstats/icon/other/hx.png" width="79" height="4" /></td></tr>
<tr><td class="aws"><a href="http://0340a95.netsolhost.com/" target="url">/</a></td><td>1202</td><td>7.66 KB</td><td>904</td><td>527</td><td class="aws"><img src="/awstats/icon/other/hp.png" width="242" height="4" /><br /><img src="/awstats/icon/other/hk.png" width="15" height="4" /><br /><img src="/awstats/icon/other/he.png" width="182" height="4" /><br /><img src="/awstats/icon/other/hx.png" width="106" height="4" /></td></tr>
<tr><td class="aws"><a href="http://0340a95.netsolhost.com/cd-risc/userguide.shtml" target="url">/cd-risc/userguide.shtml</a></td><td>479</td><td>103.47 KB</td><td>77</td><td>122</td><td class="aws"><img src="/awstats/icon/other/hp.png" width="97" height="4" /><br /><img src="/awstats/icon/other/hk.png" width="194" height="4" /><br /><img src="/awstats/icon/other/he.png" width="16" height="4" /><br /><img src="/awstats/icon/other/hx.png" width="25" height="4" /></td></tr>
<tr><td class="aws"><a href="http://0340a95.netsolhost.com/cd-risc/requestform.shtml" target="url">/cd-risc/requestform.shtml</a></td><td>361</td><td>12.43 KB</td><td>73</td><td>112</td><td class="aws"><img src="/awstats/icon/other/hp.png" width="73" height="4" /><br /><img src="/awstats/icon/other/hk.png" width="24" height="4" /><br /><img src="/awstats/icon/other/he.png" width="15" height="4" /><br /><img src="/awstats/icon/other/hx.png" width="23" height="4" /></td></tr>
<tr><td class="aws"><a href="http://0340a95.netsolhost.com/cd-risc/faq.shtml" target="url">/cd-risc/faq.shtml</a></td><td>308</td><td>9.20 KB</td><td>55</td><td>127</td><td class="aws"><img src="/awstats/icon/other/hp.png" width="62" height="4" /><br /><img src="/awstats/icon/other/hk.png" width="18" height="4" /><br /><img src="/awstats/icon/other/he.png" width="12" height="4" /><br /><img src="/awstats/icon/other/hx.png" width="26" height="4" /></td></tr>
<tr><td class="aws"><a href="http://0340a95.netsolhost.com/index.shtml" target="url">/index.shtml</a></td><td>297</td><td>7.64 KB</td><td>27</td><td>112</td><td class="aws"><img src="/awstats/icon/other/hp.png" width="60" height="4" /><br /><img src="/awstats/icon/other/hk.png" width="15" height="4" /><br /><img src="/awstats/icon/other/he.png" width="6" height="4" /><br /><img src="/awstats/icon/other/hx.png" width="23" height="4" /></td></tr>
<tr><td class="aws"><a href="http://0340a95.netsolhost.com/cd-risc/translations.shtml" target="url">/cd-risc/translations.shtml</a></td><td>274</td><td>4.43 KB</td><td>33</td><td>59</td><td class="aws"><img src="/awstats/icon/other/hp.png" width="56" height="4" /><br /><img src="/awstats/icon/other/hk.png" width="9" height="4" /><br /><img src="/awstats/icon/other/he.png" width="7" height="4" /><br /><img src="/awstats/icon/other/hx.png" width="12" height="4" /></td></tr>
<tr><td class="aws"><a href="http://0340a95.netsolhost.com/cd-risc/request-form.pdf" target="url">/cd-risc/request-form.pdf</a></td><td>176</td><td>138.91 KB</td><td>28</td><td>81</td><td class="aws"><img src="/awstats/icon/other/hp.png" width="36" height="4" /><br /><img src="/awstats/icon/other/hk.png" width="261" height="4" /><br /><img src="/awstats/icon/other/he.png" width="6" height="4" /><br /><img src="/awstats/icon/other/hx.png" width="17" height="4" /></td></tr>
<tr><td class="aws"><a href="http://0340a95.netsolhost.com/cd-risc/requestform.php" target="url">/cd-risc/requestform.php</a></td><td>158</td><td>170 Bytes</td><td>12</td><td>32</td><td class="aws"><img src="/awstats/icon/other/hp.png" width="32" height="4" /><br /><img src="/awstats/icon/other/hk.png" width="2" height="4" /><br /><img src="/awstats/icon/other/he.png" width="3" height="4" /><br /><img src="/awstats/icon/other/hx.png" width="7" height="4" /></td></tr>
<tr><td class="aws"><a href="http://0340a95.netsolhost.com/cd-risc/termsofservice.shtml" target="url">/cd-risc/termsofservice.shtml</a></td><td>132</td><td>21.02 KB</td><td>45</td><td>45</td><td class="aws"><img src="/awstats/icon/other/hp.png" width="27" height="4" /><br /><img src="/awstats/icon/other/hk.png" width="40" height="4" /><br /><img src="/awstats/icon/other/he.png" width="10" height="4" /><br /><img src="/awstats/icon/other/hx.png" width="10" height="4" /></td></tr>
<tr><td class="aws"><a href="http://0340a95.netsolhost.com/cd-risc/privacypolicy.shtml" target="url">/cd-risc/privacypolicy.shtml</a></td><td>84</td><td>11.77 KB</td><td>7</td><td>18</td><td class="aws"><img src="/awstats/icon/other/hp.png" width="17" height="4" /><br /><img src="/awstats/icon/other/hk.png" width="23" height="4" /><br /><img src="/awstats/icon/other/he.png" width="2" height="4" /><br /><img src="/awstats/icon/other/hx.png" width="4" height="4" /></td></tr>
<tr><td class="aws"><a href="http://0340a95.netsolhost.com/BingSiteAuth.xml" target="url">/BingSiteAuth.xml</a></td><td>3</td><td>85 Bytes</td><td>3</td><td>3</td><td class="aws"><img src="/awstats/icon/other/hp.png" width="2" height="4" /><br /><img src="/awstats/icon/other/hk.png" width="2" height="4" /><br /><img src="/awstats/icon/other/he.png" width="2" height="4" /><br /><img src="/awstats/icon/other/hx.png" width="2" height="4" /></td></tr>
</table></td></tr></table><br />
<br /><br />
<span dir="ltr" style="font: 11px verdana, arial, helvetica; color: #000000;"><b>Advanced Web Statistics 6.7 (build 1.892)</b> - <a href="http://awstats.sourceforge.net" target="awstatshome">Created by awstats</a></span><br />
<br />
</body>
</html>
| zparnold/cd-risc | awstats/1309/awstats.2818332.1309.urldetail.html | HTML | apache-2.0 | 10,779 |
#!/usr/bin/env python
# SIM-CITY client
#
# Copyright 2015 Netherlands eScience Center <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import tarfile
class load_data:
'''
class to load txt data
'''
def __init__(self, filename):
self.filename = filename
tfile, members = self.get_archive_object_tar()
self.read_files(tfile, members)
def get_archive_object_tar(self):
'''
return tarfile object and its members
'''
tfile = tarfile.open(name=self.filename)
members = tfile.getnames()
return tfile, members
def read_files(self, tfile, members):
'''
array with txt data from tarfile object
'''
self.data = [tfile.extractfile(member).read() for member in members if
tfile.extractfile(member) is not None]
def main():
load_data('enron_mail_clean.tar.gz')
import pdb
pdb.set_trace()
if __name__ == "__main__":
main()
| nlesc-sherlock/analyzing-corpora | corpora/load_archive.py | Python | apache-2.0 | 1,507 |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Question_04_09_BSTSequences")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Question_04_09_BSTSequences")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("c2609554-6dab-48f4-862f-3d82a62b7a99")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| qulia/CrackingTheCodingInterview | Question_04_09_BSTSequences/Properties/AssemblyInfo.cs | C# | apache-2.0 | 1,430 |
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
<meta content="2013-12-25 10:18:47 -0700" http-equiv="change-date" />
<title>EX 32</title>
<script src='../js/jquery-3.1.1.min.js' type='text/javascript' charset='utf-8'></script>
<script src='../js/bpi.js' type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" href='../css/bpi.css' >
</head>
<body>
<div class="header"><h1 id="titulo">Êxodo 32<span id="trecho"></span></h1></div>
<div id="passagem">
<div class="bible1 verses">
<p class="verse" verse="1"><sup>1</sup>Mas o povo, vendo que Moisés tardava em descer do monte, acercou-se de Arão, e lhe disse: Levanta-te, faze-nos um deus que vá adiante de nós; porque, quanto a esse Moisés, o homem que nos tirou da terra do Egito, não sabemos o que lhe aconteceu.</p>
<p class="verse" verse="2"><sup>2</sup>E Arão lhes disse: Tirai os pendentes de ouro que estão nas orelhas de vossas mulheres, de vossos filhos e de vossas filhas, e trazei-mos.</p>
<p class="verse" verse="3"><sup>3</sup>Então todo o povo, tirando os pendentes de ouro que estavam nas suas orelhas, os trouxe a Arão;</p>
<p class="verse" verse="4"><sup>4</sup>ele os recebeu de suas mãos, e com um buril deu forma ao ouro, e dele fez um bezerro de fundição. Então eles exclamaram: Eis aqui, ó Israel, o teu deus, que te tirou da terra do Egito.</p>
<p class="verse" verse="5"><sup>5</sup>E Arão, vendo isto, edificou um altar diante do bezerro e, fazendo uma proclamação, disse: Amanhã haverá festa ao Senhor.</p>
<p class="verse" verse="6"><sup>6</sup>No dia seguinte levantaram-se cedo, ofereceram holocaustos, e trouxeram ofertas pacíficas; e o povo sentou-se a comer e a beber; depois levantou-se para folgar.</p>
<p class="verse" verse="7"><sup>7</sup>Então disse o Senhor a Moisés: Vai, desce; porque o teu povo, que fizeste subir da terra do Egito, se corrompeu;</p>
<p class="verse" verse="8"><sup>8</sup>depressa se desviou do caminho que eu lhe ordenei; eles fizeram para si um bezerro de fundição, e adoraram-no, e lhe ofereceram sacrifícios, e disseram: Eis aqui, ó Israel, o teu deus, que te tirou da terra do Egito.</p>
<p class="verse" verse="9"><sup>9</sup>Disse mais o Senhor a Moisés: Tenho observado este povo, e eis que é povo de dura cerviz.</p>
<p class="verse" verse="10"><sup>10</sup>Agora, pois, deixa-me, para que a minha ira se acenda contra eles, e eu os consuma; e eu farei de ti uma grande nação.</p>
<p class="verse" verse="11"><sup>11</sup>Moisés, porém, suplicou ao Senhor seu Deus, e disse: Ó Senhor, por que se acende a tua ira contra o teu povo, que tiraste da terra do Egito com grande força e com forte mão?</p>
<p class="verse" verse="12"><sup>12</sup>Por que hão de falar os egípcios, dizendo: Para mal os tirou, para matá-los nos montes, e para destruí-los da face da terra?. Torna-te da tua ardente ira, e arrepende-te deste mal contra o teu povo.</p>
<p class="verse" verse="13"><sup>13</sup>Lembra-te de Abraão, de Isaque, e de Israel, teus servos, aos quais por ti mesmo juraste, e lhes disseste: Multiplicarei os vossos descendentes como as estrelas do céu, e lhes darei toda esta terra de que tenho falado, e eles a possuirão por herança para sempre.</p>
<p class="verse" verse="14"><sup>14</sup>Então o Senhor se arrependeu do mal que dissera que havia de fazer ao seu povo.</p>
<p class="verse" verse="15"><sup>15</sup>E virou-se Moisés, e desceu do monte com as duas tábuas do testemunho na mão, tábuas escritas de ambos os lados; de um e de outro lado estavam escritas.</p>
<p class="verse" verse="16"><sup>16</sup>E aquelas tábuas eram obra de Deus; também a escritura era a mesma escritura de Deus, esculpida nas tábuas.</p>
<p class="verse" verse="17"><sup>17</sup>Ora, ouvindo Josué a voz do povo que jubilava, disse a Moisés: Alarido de guerra há no arraial.</p>
<p class="verse" verse="18"><sup>18</sup>Respondeu-lhe Moisés: Não é alarido dos vitoriosos, nem alarido dos vencidos, mas é a voz dos que cantam que eu ouço.</p>
<p class="verse" verse="19"><sup>19</sup>Chegando ele ao arraial e vendo o bezerro e as danças, acendeu-se-lhe a ira, e ele arremessou das mãos as tábuas, e as despedaçou ao pé do monte.</p>
<p class="verse" verse="20"><sup>20</sup>Então tomou o bezerro que tinham feito, e queimou-o no fogo; e, moendo-o até que se tornou em pó, o espargiu sobre a água, e deu-o a beber aos filhos de Israel.</p>
<p class="verse" verse="21"><sup>21</sup>E perguntou Moisés a Arão: Que te fez este povo, que sobre ele trouxeste tamanho pecado?.</p>
<p class="verse" verse="22"><sup>22</sup>Ao que respondeu Arão: Não se acenda a ira do meu senhor; tu conheces o povo, como ele é inclinado ao mal.</p>
<p class="verse" verse="23"><sup>23</sup>Pois eles me disseram: Faze-nos um deus que vá adiante de nós; porque, quanto a esse Moisés, o homem que nos tirou da terra do Egito, não sabemos o que lhe aconteceu.</p>
<p class="verse" verse="24"><sup>24</sup>Então eu lhes disse: Quem tem ouro, arranque-o. Assim mo deram; e eu o lancei no fogo, e saiu este bezerro.</p>
<p class="verse" verse="25"><sup>25</sup>Quando, pois, Moisés viu que o povo estava desenfreado {porque Arão o havia desenfreado, para escárnio entre os seus inimigos},</p>
<p class="verse" verse="26"><sup>26</sup>pôs-se em pé à entrada do arraial, e disse: Quem está ao lado do Senhor, venha a mim. Ao que se ajuntaram a ele todos os filhos de Levi.</p>
<p class="verse" verse="27"><sup>27</sup>Então ele lhes disse: Assim diz o Senhor, o Deus de Israel: Cada um ponha a sua espada sobre a coxa; e passai e tornai pelo arraial de porta em porta, e mate cada um a seu irmão, e cada um a seu amigo, e cada um a seu vizinho.</p>
<p class="verse" verse="28"><sup>28</sup>E os filhos de Levi fizeram conforme a palavra de Moisés; e caíram do povo naquele dia cerca de três mil homens.</p>
<p class="verse" verse="29"><sup>29</sup>Porquanto Moisés tinha dito: Consagrai-vos hoje ao Senhor; porque cada um será contra o seu filho, e contra o seu irmão; para que o Senhor vos conceda hoje uma bênção.</p>
<p class="verse" verse="30"><sup>30</sup>No dia seguinte disse Moisés ao povo Vós tendes cometido grande pecado; agora porém subirei ao Senhor; porventura farei expiação por vosso pecado.</p>
<p class="verse" verse="31"><sup>31</sup>Assim tornou Moisés ao Senhor, e disse: Oh! este povo cometeu um grande pecado, fazendo para si um deus de ouro.</p>
<p class="verse" verse="32"><sup>32</sup>Agora, pois, perdoa o seu pecado; ou se não, risca-me do teu livro, que tens escrito.</p>
<p class="verse" verse="33"><sup>33</sup>Então disse o Senhor a Moisés: Aquele que tiver pecado contra mim, a este riscarei do meu livro.</p>
<p class="verse" verse="34"><sup>34</sup>Vai pois agora, conduze este povo para o lugar de que te hei dito; eis que o meu anjo irá adiante de ti; porém no dia da minha visitação, sobre eles visitarei o seu pecado.</p>
<p class="verse" verse="35"><sup>35</sup>Feriu, pois, o Senhor ao povo, por ter feito o bezerro que Arão formara.</p>
</div>
</div>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<p class="copyright">Almeida Revista e Atualizada© Copyright © 1993 Sociedade Bíblica do Brasil. Todos os direitos reservados. Texto bíblico utilizado com autorização. Saiba mais sobre a Sociedade Bíblica do Brasil. A Sociedade Bíblica do Brasil trabalha para que a Bíblia esteja, efetivamente, ao alcance de todos e seja lida por todos. A SBB é uma entidade sem fins lucrativos, dedicada a promover o desenvolvimento integral do ser humano.</p>
<br/>
<br/>
<br/>
<br/></body>
</html>
| ahsbjunior/biblia-para-igrejas | ara/2-32.html | HTML | apache-2.0 | 8,041 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.