code
stringlengths
5
1.01M
repo_name
stringlengths
5
84
path
stringlengths
4
311
language
stringclasses
30 values
license
stringclasses
15 values
size
int64
5
1.01M
input_ids
listlengths
502
502
token_type_ids
listlengths
502
502
attention_mask
listlengths
502
502
labels
listlengths
502
502
{% load staticfiles %} <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>{% block title %}Bijgeschaafd{% endblock %}</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content="Bijgeschaafd.nl geeft een overzicht van alle wijzigingen die er gemaakt zijn in nieuwsartikelen."> <meta name="author" content="Alexander Schrijver"> <link href="{% static 'bower_components/bootstrap/dist/css/bootstrap.css' %}" rel="stylesheet" media ="screen"> <script src="{% static 'bower_components/jquery/dist/jquery.min.js' %}"></script> <script src="{% static 'bower_components/bootstrap/dist/js/bootstrap.min.js' %}"></script> {% block head %} {% endblock %} </head> <body> <div class="navbar navbar-dark bg-primary navbar-static-top m-b-2"> <a class="navbar-brand" href="{% url 'root' %}">Bijgeschaafd</a> <ul class="nav navbar-nav"> <li class="nav-item"><a class="nav-link{% block active_browse %}{% endblock %}" href="{% url 'browse' %}">Veranderingen</a></li> <li class="nav-item"><a class="nav-link{% block active_verwant %}{% endblock %}" href="{% url 'similararticle_list' %}">Verwant</a></li> <li class="nav-item"><a class="nav-link{% block active_about %}{% endblock %}" href="{% url 'about' %}">Over bijgeschaafd</a></li> <li class="nav-item"><a class="nav-link{% block active_search %}{% endblock %}" href="{% url 'search' %}">Zoeken</a></li> </ul> </div> <div class="container"> <div class="row"> {% block content %} {% endblock content%} </div> </div> </body> </html>
flupzor/newsdiffs
news/templates/template.html
HTML
mit
1,688
[ 30522, 1063, 1003, 7170, 10763, 8873, 4244, 1003, 1065, 1026, 999, 9986, 13874, 16129, 1028, 1026, 16129, 11374, 1027, 1000, 4372, 1000, 1028, 1026, 2132, 1028, 1026, 18804, 25869, 13462, 1027, 1000, 21183, 2546, 1011, 1022, 1000, 1028, 102...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* GStreamer * Copyright (C) 2011 Andoni Morales Alastruey <ylatuya@gmail.com> * * gsturidownloader.h: * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * Youshould have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef __GSTURI_DOWNLOADER_H__ #define __GSTURI_DOWNLOADER_H__ #include <glib-object.h> #include <gst/gst.h> #include "gstfragment.h" G_BEGIN_DECLS #define GST_TYPE_URI_DOWNLOADER (gst_uri_downloader_get_type()) #define GST_URI_DOWNLOADER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_URI_DOWNLOADER,GstUriDownloader)) #define GST_URI_DOWNLOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_URI_DOWNLOADER,GstUriDownloaderClass)) #define GST_IS_URI_DOWNLOADER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_URI_DOWNLOADER)) #define GST_IS_URI_DOWNLOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_URI_DOWNLOADER)) typedef struct _GstUriDownloader GstUriDownloader; typedef struct _GstUriDownloaderPrivate GstUriDownloaderPrivate; typedef struct _GstUriDownloaderClass GstUriDownloaderClass; struct _GstUriDownloader { GstObject parent; GstUriDownloaderPrivate *priv; }; struct _GstUriDownloaderClass { GstObjectClass parent_class; /*< private >*/ gpointer _gst_reserved[GST_PADDING]; }; GType gst_uri_downloader_get_type (void); GstUriDownloader * gst_uri_downloader_new (void); GstFragment * gst_uri_downloader_fetch_uri (GstUriDownloader * downloader, const gchar * uri, const gchar * referer, gboolean compress, gboolean refresh, gboolean allow_cache, GError ** err); GstFragment * gst_uri_downloader_fetch_uri_with_range (GstUriDownloader * downloader, const gchar * uri, const gchar * referer, gboolean compress, gboolean refresh, gboolean allow_cache, gint64 range_start, gint64 range_end, GError ** err); void gst_uri_downloader_reset (GstUriDownloader *downloader); void gst_uri_downloader_cancel (GstUriDownloader *downloader); void gst_uri_downloader_free (GstUriDownloader *downloader); G_END_DECLS #endif /* __GSTURIDOWNLOADER_H__ */
cee1/gst-plugins-bad
gst-libs/gst/uridownloader/gsturidownloader.h
C
gpl-2.0
2,647
[ 30522, 1013, 1008, 28177, 25379, 2121, 1008, 9385, 1006, 1039, 1007, 2249, 1998, 10698, 17103, 21862, 3367, 6820, 3240, 1026, 1061, 20051, 26230, 2050, 1030, 20917, 4014, 1012, 4012, 1028, 1008, 1008, 28177, 20689, 13820, 7962, 11066, 2121, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package com.example.many_to_one; import static org.junit.jupiter.api.Assertions.*; import javax.persistence.EntityManager; import javax.transaction.Transactional; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; @SpringJUnitConfig @SpringBootTest @Transactional class ManyToOneTest { @Autowired private EntityManager em; private Long author1; private Long book1; private Long book2; private Long book3; @BeforeEach void setUp() throws Exception { final AuthorM2O a = new AuthorM2O(); a.setName("コナン・ドイル"); final BookM2O b1 = new BookM2O(); b1.setTitle("緋色の研究"); final BookM2O b2 = new BookM2O(); b2.setTitle("四つの署名"); final BookM2O b3 = new BookM2O(); b3.setTitle("恐怖の谷"); b3.setAuthor(a); em.persist(a); em.persist(b1); em.persist(b2); em.persist(b3); em.flush(); author1 = a.getId(); book1 = b1.getId(); book2 = b2.getId(); book3 = b3.getId(); } @AfterEach void tearDown() throws Exception { em.remove(em.find(AuthorM2O.class, author1)); em.remove(em.find(BookM2O.class, book1)); em.remove(em.find(BookM2O.class, book2)); em.remove(em.find(BookM2O.class, book3)); } @Test void getAuthorViaBook() throws Exception { final BookM2O b = em.find(BookM2O.class, book3); assertEquals("コナン・ドイル", b.getAuthor().getName()); } }
backpaper0/spring-boot-sandbox
jpa-example/src/test/java/com/example/many_to_one/ManyToOneTest.java
Java
mit
1,808
[ 30522, 7427, 4012, 1012, 2742, 1012, 2116, 1035, 2000, 1035, 2028, 1025, 12324, 10763, 8917, 1012, 12022, 4183, 1012, 13035, 1012, 17928, 1012, 23617, 2015, 1012, 1008, 1025, 12324, 9262, 2595, 1012, 28297, 1012, 9178, 24805, 4590, 1025, 12...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/*=================================================================== BlueBerry Platform Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __BERRY_OR_EXPRESSION_H__ #define __BERRY_OR_EXPRESSION_H__ #include "berryCompositeExpression.h" namespace berry { class OrExpression : public CompositeExpression { public: EvaluationResult::ConstPointer Evaluate(IEvaluationContext* context) const override; bool operator==(const Object* object) const override; }; } // namespace berry #endif // __BERRY_OR_EXPRESSION_H__
RabadanLab/MITKats
Plugins/org.blueberry.core.expressions/src/internal/berryOrExpression.h
C
bsd-3-clause
865
[ 30522, 1013, 1008, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 102...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/** * Copyright (C) 2015 Fernando Cejas Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package es.intelygenz.rss.presentation.internal.di; import java.lang.annotation.Retention; import javax.inject.Scope; import static java.lang.annotation.RetentionPolicy.RUNTIME; /** * Created by davidtorralbo on 02/11/16. */ /** * A scoping annotation to permit objects whose lifetime should * conform to the life of the activity to be memorized in the * correct component. */ @Scope @Retention(RUNTIME) public @interface PerActivity {}
Sca09/intelygenz_rss
app/src/main/java/es/intelygenz/rss/presentation/internal/di/PerActivity.java
Java
apache-2.0
1,072
[ 30522, 1013, 1008, 1008, 1008, 9385, 1006, 1039, 1007, 2325, 9158, 8292, 17386, 2330, 3120, 2622, 1008, 1008, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1000, 6105, 1000, 1007, 1025, 1008, 2017, 2089, 2025, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
require 'spec_helper' module Alchemy describe Cell do let(:cell) { build(:alchemy_cell) } # class methods describe '.definitions' do it "should return an Array" do expect(Cell.definitions).to be_a(Array) end it "should allow erb generated definitions" do expect(Cell.definitions.collect { |d| d['name'] }).to include('erb_cell') end end describe '.definition_for' do subject { Cell.definition_for('right_column') } it "returns a definition for given name" do eq({'name' => 'right_column', 'elements' => %w(search)}) end end describe '.all_definitions_for' do subject { Cell.all_definitions_for(%(right_column)) } it "returns definitions for given names" do eq([{'name' => 'right_column', 'elements' => %w(search)}]) end end describe ".definitions_for_element" do before do allow(Cell).to receive(:definitions).and_return([ {'name' => 'cell_1', 'elements' => ['target', 'other']}, {'name' => 'cell_2', 'elements' => ['other', 'other']}, {'name' => 'cell_3', 'elements' => ['other', 'target']} ]) end it "should return all cell definitions that includes the given element name" do expect(Cell.definitions_for_element('target')).to eq([ {'name' => 'cell_1', 'elements' => ['target', 'other']}, {'name' => 'cell_3', 'elements' => ['other', 'target']} ]) end end describe '.translated_label_for' do subject { Cell.translated_label_for('right_column') } it "returns a translated label" do eq('Right column') end end # instance methods describe "#available_elements" do context "without assigned elements" do it "should return an empty Array" do allow(cell).to receive(:definition).and_return({}) expect(cell.available_elements).to eq([]) end end context "with assigned elements" do it "should return an Array of element names" do allow(cell).to receive(:definition).and_return({'elements' => ['test_element', 'test_element_2']}) expect(cell.available_elements).to eq(['test_element', 'test_element_2']) end end end describe "#definition" do context "without a definition for the expected cellname" do it "should return an empty Hash" do allow(Cell).to receive(:definition_for).and_return({}) expect(cell.definition).to eq({}) end end context "with a definition for the expected cellname found" do it "should return its definition Hash" do allow(Cell).to receive(:definition_for).and_return({'name' => 'test_cell', 'elements' => ['test_element', 'test_element_2']}) expect(cell.definition).to eq({'name' => 'test_cell', 'elements' => ['test_element', 'test_element_2']}) end end end describe "#name_for_label" do it "should call translated_label_for" do expect(Cell).to receive(:translated_label_for).with(cell.name) cell.name_for_label end end describe "#elements" do context 'with nestable elements' do let(:nestable_element) { create(:alchemy_element, :with_nestable_elements) } before do nestable_element.nested_elements << create(:alchemy_element, name: 'test_element') cell.elements << nestable_element end it 'does not contain nested elements of an element' do expect(nestable_element.nested_elements).to_not be_empty expect(cell.elements).to_not include(nestable_element.nested_elements.first) end end end end end
mtomov/alchemy_cms
spec/models/alchemy/cell_spec.rb
Ruby
bsd-3-clause
3,760
[ 30522, 5478, 1005, 28699, 1035, 2393, 2121, 1005, 11336, 2632, 5403, 8029, 6235, 3526, 2079, 2292, 1006, 1024, 3526, 1007, 1063, 3857, 1006, 1024, 2632, 5403, 8029, 1035, 3526, 1007, 1065, 1001, 2465, 4725, 6235, 1005, 1012, 15182, 1005, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>18 --> 19</title> <link href="./../../assets/style.css" rel="stylesheet"> </head> <body> <h2>You have to be fast</h2> <a href="./033c6ca0fa26da0113c2419f362e4a8b1e2c53b5f915025961f4af8bd4769c77.html">Teleport</a> <hr> <a href="./../../about.md">About</a> (Spoilers! ) <script src="./../../assets/md5.js"></script> <script> window.currentLevel = 7; </script> <script src="./../../assets/script.js"></script> </body> </html>
simonmysun/praxis
TAIHAO2019/pub/SmallGame/AsFastAsYouCan2/e7149fca6752bb6e7362b434e3ac0fd9eced8eb027dcaae5f3608dfcd10dc73e.html
HTML
mit
550
[ 30522, 1026, 999, 9986, 13874, 16129, 1028, 1026, 16129, 11374, 1027, 1000, 4372, 1000, 1028, 1026, 2132, 1028, 1026, 18804, 25869, 13462, 1027, 1000, 21183, 30524, 1026, 2516, 1028, 2324, 1011, 1011, 1028, 2539, 1026, 1013, 2516, 1028, 102...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/** * Standalone Window. * * A window in standalone display mode. */ /** * Standalone Window Constructor. * * @extends BaseWindow. * @param {number} id Window ID to give standalone window. * @param {string} url URL to navigate to. * @param {Object} webApp WebApp with metadata to generate window from. */ var StandaloneWindow = function(id, url, webApp) { this.currentUrl = url; if (webApp && webApp.name) { this.name = webApp.name; } else if (webApp && webApp.shortName) { this.name = webApp.shortName; } else { try { this.name = new URL(url).hostname; } catch(e) { this.name = ''; } } if (webApp && webApp.themeColor) { this.themeColor = webApp.themeColor; } BaseWindow.call(this, id); return this; }; StandaloneWindow.prototype = Object.create(BaseWindow.prototype); /** * Window View. */ StandaloneWindow.prototype.view = function() { var titleBarStyle = ''; var titleBarClass = 'standalone-window-title-bar'; if (this.themeColor) { titleBarStyle = 'background-color: ' + this.themeColor + ';'; var rgb = this.hexToRgb(this.themeColor); backgroundBrightness = this.darkOrLight(rgb); titleBarClass += ' ' + backgroundBrightness; } return '<div id="window' + this.id + '"class="standalone-window">' + '<div class="' + titleBarClass + '" style="' + titleBarStyle + '">' + '<span id="standalone-window-title' + this.id + '" class="standalone-window-title">' + this.name + '</span>' + '<button type="button" id="close-window-button' + this.id + '" ' + 'class="close-window-button">' + '</div>' + '<webview src="' + this.currentUrl + '" id="standalone-window-frame' + this.id + '" class="standalone-window-frame">' + '</div>'; }; /** * Render the window. */ StandaloneWindow.prototype.render = function() { this.container.insertAdjacentHTML('beforeend', this.view()); this.element = document.getElementById('window' + this.id); this.title = document.getElementById('standalone-window-title' + this.id); this.closeButton = document.getElementById('close-window-button' + this.id); this.closeButton.addEventListener('click', this.close.bind(this)); this.frame = document.getElementById('standalone-window-frame' + this.id); this.frame.addEventListener('did-navigate', this.handleLocationChange.bind(this)); this.frame.addEventListener('did-navigate-in-page', this.handleLocationChange.bind(this)); this.frame.addEventListener('new-window', this.handleOpenWindow.bind(this)); }; /** * Show the Window. */ StandaloneWindow.prototype.show = function() { this.element.classList.remove('hidden'); }; /** * Hide the window. */ StandaloneWindow.prototype.hide = function() { this.element.classList.add('hidden'); }; /** * Handle location change. * * @param {Event} e mozbrowserlocationchange event. */ StandaloneWindow.prototype.handleLocationChange = function(e) { this.currentUrl = e.url; }; /** * Convert hex color value to rgb. * * @argument {String} hex color string e.g. #ff0000 * @returns {Object} RGB object with separate r, g and b properties */ StandaloneWindow.prototype.hexToRgb = function(hex) { var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); return result ? { r: parseInt(result[1], 16), g: parseInt(result[2], 16), b: parseInt(result[3], 16) } : null; }; /** * Measure whether color is dark or light. * * @param {Object} RGB object with r, g, b properties. * @return {String} 'dark' or 'light'. */ StandaloneWindow.prototype.darkOrLight = function(rgb) { if ((rgb.r*0.299 + rgb.g*0.587 + rgb.b*0.114) > 186) { return 'light'; } else { return 'dark'; } };
webianproject/shell
chrome/desktop/js/StandaloneWindow.js
JavaScript
gpl-3.0
3,719
[ 30522, 1013, 1008, 1008, 1008, 26609, 3332, 1012, 1008, 1008, 1037, 3332, 1999, 26609, 4653, 5549, 1012, 1008, 1013, 1013, 1008, 1008, 1008, 26609, 3332, 9570, 2953, 1012, 1008, 1008, 1030, 8908, 2918, 11101, 5004, 1012, 1008, 1030, 11498, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php namespace Laravella\Ravel\Facades; Class Facade { protected static $resolvedInstance; /** * Get the registered name of the component. * * @return string */ protected static function getFacadeAccessor() { throw new \RuntimeException("Facade does not implement getFacadeAccessor method."); } /** * Resolve the facade root instance from the container. * * @param string $name * @return mixed */ protected static function resolveFacadeInstance($name) { if (is_object($name)) return $name; if (isset(static::$resolvedInstance[$name])) { return static::$resolvedInstance[$name]; } $NP = ucfirst($name); $classInstance = "Laravella\\Ravel\\$NP\\$NP"; return static::$resolvedInstance[$name] = new $classInstance; } public static function resolveMethod($method, $args) { $instance = static::resolveFacadeInstance(static::getFacadeAccessor()); return call_user_func_array(array($instance, $method), $args); } public static function __callStatic($method, $args) { return static::resolveMethod($method, $args); } public function __call($method, $args) { return static::resolveMethod($method, $args); } }
laravella/ravel
src/Laravella/Ravel/Facades/Facade.php
PHP
bsd-3-clause
1,183
[ 30522, 1026, 1029, 25718, 3415, 15327, 13679, 15985, 2721, 1032, 23289, 2140, 1032, 28708, 1025, 2465, 8508, 1063, 5123, 10763, 1002, 10395, 7076, 26897, 1025, 1013, 1008, 1008, 1008, 2131, 1996, 5068, 2171, 1997, 1996, 6922, 1012, 1008, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!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_152-release) on Mon Dec 04 22:36:37 MST 2017 --> <title>Habit</title> <meta name="date" content="2017-12-04"> <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="Habit"; } } catch(err) { } //--> var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-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="../../../../com/example/habitup/Model/Attributes.html" title="class in com.example.habitup.Model"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../com/example/habitup/Model/HabitEvent.html" title="class in com.example.habitup.Model"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?com/example/habitup/Model/Habit.html" target="_top">Frames</a></li> <li><a href="Habit.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">com.example.habitup.Model</div> <h2 title="Class Habit" class="title">Class Habit</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li>com.example.habitup.Model.Habit</li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Implemented Interfaces:</dt> <dd>java.lang.Comparable&lt;<a href="../../../../com/example/habitup/Model/Habit.html" title="class in com.example.habitup.Model">Habit</a>&gt;</dd> </dl> <hr> <br> <pre>public class <span class="typeNameLabel">Habit</span> extends java.lang.Object implements java.lang.Comparable&lt;<a href="../../../../com/example/habitup/Model/Habit.html" title="class in com.example.habitup.Model">Habit</a>&gt;</pre> <div class="block">Habit is the object representing a habit type, belonging to a specific user. It specifies a name, reason, schedule of days of the week it should be completed on, the date to start, and the attribute it is associated with (the attribute it will increase each time the habit is done). The Habit stores some utility data for calculating statistics, namely how many times it was done on schedule, how many times it could have been done if always done on schedule, and how many non-scheduled times it was done. Javadoc last updated 2017-11-13 by @gojeffcho.</div> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><span class="memberNameLink"><a href="../../../../com/example/habitup/Model/Habit.html#Habit-int-">Habit</a></span>(int&nbsp;uid)</code> <div class="block">Empty constructor - UID is set from ES to the next possible HID.</div> </td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/example/habitup/Model/Habit.html#compareTo-com.example.habitup.Model.Habit-">compareTo</a></span>(<a href="../../../../com/example/habitup/Model/Habit.html" title="class in com.example.habitup.Model">Habit</a>&nbsp;h)</code> <div class="block">Comparator implementation - to sort lexicographically based on name.</div> </td> </tr> <tr id="i1" class="rowColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/example/habitup/Model/Habit.html#equals-java.lang.Object-">equals</a></span>(java.lang.Object&nbsp;obj)</code> <div class="block">When two habit are compared, they should be equal if they have the same HIDs</div> </td> </tr> <tr id="i2" class="altColor"> <td class="colFirst"><code>java.lang.String</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/example/habitup/Model/Habit.html#getHabitAttribute--">getHabitAttribute</a></span>()</code> <div class="block">getHabitAttribute Gets the associated attribute of the Habit</div> </td> </tr> <tr id="i3" class="rowColor"> <td class="colFirst"><code>java.lang.String</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/example/habitup/Model/Habit.html#getHabitName--">getHabitName</a></span>()</code> <div class="block">getHabitName Gets the String of the Habit's name</div> </td> </tr> <tr id="i4" class="altColor"> <td class="colFirst"><code>java.lang.String</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/example/habitup/Model/Habit.html#getHabitReason--">getHabitReason</a></span>()</code> <div class="block">getHabitReason Gets the Habit's reason as a String</div> </td> </tr> <tr id="i5" class="rowColor"> <td class="colFirst"><code>boolean[]</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/example/habitup/Model/Habit.html#getHabitSchedule--">getHabitSchedule</a></span>()</code> <div class="block">getHabitSchedule Returns habit schedule</div> </td> </tr> <tr id="i6" class="altColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/example/habitup/Model/Habit.html#getHabitsDone-com.example.habitup.Model.UserAccount-">getHabitsDone</a></span>(<a href="../../../../com/example/habitup/Model/UserAccount.html" title="class in com.example.habitup.Model">UserAccount</a>&nbsp;user)</code> <div class="block">Get how many times Habit was done on schedule.</div> </td> </tr> <tr id="i7" class="rowColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/example/habitup/Model/Habit.html#getHabitsDoneExtra-com.example.habitup.Model.UserAccount-">getHabitsDoneExtra</a></span>(<a href="../../../../com/example/habitup/Model/UserAccount.html" title="class in com.example.habitup.Model">UserAccount</a>&nbsp;user)</code> <div class="block">Get how many times Habit was done outside of schedule.</div> </td> </tr> <tr id="i8" class="altColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/example/habitup/Model/Habit.html#getHabitsPossible--">getHabitsPossible</a></span>()</code> <div class="block">Get how many times Habit could have been done if schedule was followed from start date.</div> </td> </tr> <tr id="i9" class="rowColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/example/habitup/Model/Habit.html#getHID--">getHID</a></span>()</code> <div class="block">getHID Gets the unique identifier of habit</div> </td> </tr> <tr id="i10" class="altColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/example/habitup/Model/Habit.html#getPercent--">getPercent</a></span>()</code> <div class="block">Get the percentage of the habit's progression status</div> </td> </tr> <tr id="i11" class="rowColor"> <td class="colFirst"><code>java.time.LocalDate</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/example/habitup/Model/Habit.html#getStartDate--">getStartDate</a></span>()</code> <div class="block">getStartDate Gets the Habit's start date</div> </td> </tr> <tr id="i12" class="altColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/example/habitup/Model/Habit.html#getUID--">getUID</a></span>()</code> <div class="block">getUID Gets the uid of habit</div> </td> </tr> <tr id="i13" class="rowColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/example/habitup/Model/Habit.html#hashCode--">hashCode</a></span>()</code> <div class="block">Override hash code to include HID</div> </td> </tr> <tr id="i14" class="altColor"> <td class="colFirst"><code>java.lang.Boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/example/habitup/Model/Habit.html#isLegalAttribute-java.lang.String-">isLegalAttribute</a></span>(java.lang.String&nbsp;attribute)</code> <div class="block">isLegalAttribute Checks for Habit attribute is from the established list of attributes</div> </td> </tr> <tr id="i15" class="rowColor"> <td class="colFirst"><code>java.lang.Boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/example/habitup/Model/Habit.html#isLegalNameLength-java.lang.String-">isLegalNameLength</a></span>(java.lang.String&nbsp;name)</code> <div class="block">isLegalNameLength Checks for Habit name length between 1 - 20</div> </td> </tr> <tr id="i16" class="altColor"> <td class="colFirst"><code>java.lang.Boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/example/habitup/Model/Habit.html#isLegalReasonLength-java.lang.String-">isLegalReasonLength</a></span>(java.lang.String&nbsp;reason)</code> <div class="block">isLegalReasonLength Checks for Habit reason length between 1 - 30</div> </td> </tr> <tr id="i17" class="rowColor"> <td class="colFirst"><code>java.lang.Boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/example/habitup/Model/Habit.html#isLegalSchedule-boolean:A-">isLegalSchedule</a></span>(boolean[]&nbsp;schedule)</code> <div class="block">isLegalSchedule Checks for Habit schedule containing at least 1 day scheduled for the Habit</div> </td> </tr> <tr id="i18" class="altColor"> <td class="colFirst"><code>java.lang.Boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/example/habitup/Model/Habit.html#isTodayHabit--">isTodayHabit</a></span>()</code> <div class="block">Returns True if this Habit is set for today in its schedule.</div> </td> </tr> <tr id="i19" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/example/habitup/Model/Habit.html#setAttribute-java.lang.String-">setAttribute</a></span>(java.lang.String&nbsp;attribute)</code> <div class="block">setAttribute Sets the Habit's attribute into the provided</div> </td> </tr> <tr id="i20" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/example/habitup/Model/Habit.html#setHabitName-java.lang.String-">setHabitName</a></span>(java.lang.String&nbsp;name)</code> <div class="block">setHabitName Sets the Habit's name into String name</div> </td> </tr> <tr id="i21" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/example/habitup/Model/Habit.html#setReason-java.lang.String-">setReason</a></span>(java.lang.String&nbsp;reason)</code> <div class="block">setReason Sets the Habit's reason as the provided String</div> </td> </tr> <tr id="i22" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/example/habitup/Model/Habit.html#setSchedule-boolean:A-">setSchedule</a></span>(boolean[]&nbsp;schedule)</code> <div class="block">setSchedule Changes the schedule accordingly with input schedule</div> </td> </tr> <tr id="i23" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/example/habitup/Model/Habit.html#setStartDate-java.time.LocalDate-">setStartDate</a></span>(java.time.LocalDate&nbsp;startDate)</code> <div class="block">Set start date for the Habit - can be in the past, present, or future</div> </td> </tr> <tr id="i24" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/example/habitup/Model/Habit.html#setUniqueHID--">setUniqueHID</a></span>()</code> <div class="block">Sets the next available HID from ElasticSearch - ensures no duplicate HIDs</div> </td> </tr> <tr id="i25" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/example/habitup/Model/Habit.html#updateHabitsPossible--">updateHabitsPossible</a></span>()</code> <div class="block">Utility function for stats calculation - updates the number of possible Habit executions if it were done every day it was scheduled for since its start date.</div> </td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.Object</h3> <code>clone, finalize, getClass, 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="Habit-int-"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>Habit</h4> <pre>public&nbsp;Habit(int&nbsp;uid)</pre> <div class="block">Empty constructor - UID is set from ES to the next possible HID. Habit is then built using setters to set the additional fields.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>uid</code> - int (user to whom the Habit belongs)</dd> </dl> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="isLegalNameLength-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>isLegalNameLength</h4> <pre>public&nbsp;java.lang.Boolean&nbsp;isLegalNameLength(java.lang.String&nbsp;name)</pre> <div class="block">isLegalNameLength Checks for Habit name length between 1 - 20</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>name</code> - String (Habit name)</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>Boolean (True if legal, False if not)</dd> </dl> </li> </ul> <a name="isLegalReasonLength-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>isLegalReasonLength</h4> <pre>public&nbsp;java.lang.Boolean&nbsp;isLegalReasonLength(java.lang.String&nbsp;reason)</pre> <div class="block">isLegalReasonLength Checks for Habit reason length between 1 - 30</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>reason</code> - String (Habit reason)</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>Boolean (True if legal, False if not)</dd> </dl> </li> </ul> <a name="isLegalSchedule-boolean:A-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>isLegalSchedule</h4> <pre>public&nbsp;java.lang.Boolean&nbsp;isLegalSchedule(boolean[]&nbsp;schedule)</pre> <div class="block">isLegalSchedule Checks for Habit schedule containing at least 1 day scheduled for the Habit</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>schedule</code> - boolean[8] (0 is unused, 1 for Mon, 2 for Tue...)</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>Boolean (True if legal, False if not)</dd> </dl> </li> </ul> <a name="isLegalAttribute-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>isLegalAttribute</h4> <pre>public&nbsp;java.lang.Boolean&nbsp;isLegalAttribute(java.lang.String&nbsp;attribute)</pre> <div class="block">isLegalAttribute Checks for Habit attribute is from the established list of attributes</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>attribute</code> - String (Name of attribute)</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>Boolean (True if legal, False if not)</dd> </dl> </li> </ul> <a name="getUID--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getUID</h4> <pre>public&nbsp;int&nbsp;getUID()</pre> <div class="block">getUID Gets the uid of habit</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>int (UID of associated user)</dd> </dl> </li> </ul> <a name="getHID--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getHID</h4> <pre>public&nbsp;int&nbsp;getHID()</pre> <div class="block">getHID Gets the unique identifier of habit</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>int (habitID)</dd> </dl> </li> </ul> <a name="getHabitName--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getHabitName</h4> <pre>public&nbsp;java.lang.String&nbsp;getHabitName()</pre> <div class="block">getHabitName Gets the String of the Habit's name</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>String (Name of Habit)</dd> </dl> </li> </ul> <a name="getHabitSchedule--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getHabitSchedule</h4> <pre>public&nbsp;boolean[]&nbsp;getHabitSchedule()</pre> <div class="block">getHabitSchedule Returns habit schedule</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>boolean[8] (0 is unused, 1 for Mon, 2 for Tue...)</dd> </dl> </li> </ul> <a name="getHabitReason--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getHabitReason</h4> <pre>public&nbsp;java.lang.String&nbsp;getHabitReason()</pre> <div class="block">getHabitReason Gets the Habit's reason as a String</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>String (Habit reason)</dd> </dl> </li> </ul> <a name="getHabitAttribute--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getHabitAttribute</h4> <pre>public&nbsp;java.lang.String&nbsp;getHabitAttribute()</pre> <div class="block">getHabitAttribute Gets the associated attribute of the Habit</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>String (Attribute that the Habit increases each time when done)</dd> </dl> </li> </ul> <a name="getStartDate--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getStartDate</h4> <pre>public&nbsp;java.time.LocalDate&nbsp;getStartDate()</pre> <div class="block">getStartDate Gets the Habit's start date</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>Date (Start date of Habit)</dd> </dl> </li> </ul> <a name="setUniqueHID--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setUniqueHID</h4> <pre>public&nbsp;void&nbsp;setUniqueHID()</pre> <div class="block">Sets the next available HID from ElasticSearch - ensures no duplicate HIDs</div> </li> </ul> <a name="setHabitName-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setHabitName</h4> <pre>public&nbsp;void&nbsp;setHabitName(java.lang.String&nbsp;name) throws java.lang.IllegalArgumentException</pre> <div class="block">setHabitName Sets the Habit's name into String name</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>name</code> - String (Intended Habit name)</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code>java.lang.IllegalArgumentException</code> - (if Habit name not legal)</dd> </dl> </li> </ul> <a name="setSchedule-boolean:A-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setSchedule</h4> <pre>public&nbsp;void&nbsp;setSchedule(boolean[]&nbsp;schedule) throws java.lang.IllegalArgumentException</pre> <div class="block">setSchedule Changes the schedule accordingly with input schedule</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>schedule</code> - boolean[8] (0 unused, 1 for Mon, 2 for Tue...)</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code>java.lang.IllegalArgumentException</code></dd> </dl> </li> </ul> <a name="setReason-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setReason</h4> <pre>public&nbsp;void&nbsp;setReason(java.lang.String&nbsp;reason) throws java.lang.IllegalArgumentException</pre> <div class="block">setReason Sets the Habit's reason as the provided String</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>reason</code> - String (Intended Habit reason)</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code>java.lang.IllegalArgumentException</code> - (if Reason not legal)</dd> </dl> </li> </ul> <a name="setAttribute-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setAttribute</h4> <pre>public&nbsp;void&nbsp;setAttribute(java.lang.String&nbsp;attribute) throws java.lang.IllegalArgumentException</pre> <div class="block">setAttribute Sets the Habit's attribute into the provided</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>attribute</code> - String (Attribute associated to the Habit)</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code>java.lang.IllegalArgumentException</code> - (if attribute not legal)</dd> </dl> </li> </ul> <a name="setStartDate-java.time.LocalDate-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setStartDate</h4> <pre>public&nbsp;void&nbsp;setStartDate(java.time.LocalDate&nbsp;startDate)</pre> <div class="block">Set start date for the Habit - can be in the past, present, or future</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>startDate</code> - LocalDate (Intended start date of Habit)</dd> </dl> </li> </ul> <a name="isTodayHabit--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>isTodayHabit</h4> <pre>public&nbsp;java.lang.Boolean&nbsp;isTodayHabit()</pre> <div class="block">Returns True if this Habit is set for today in its schedule.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>Boolean (True if Habit is scheduled for current day)</dd> </dl> </li> </ul> <a name="updateHabitsPossible--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>updateHabitsPossible</h4> <pre>public&nbsp;void&nbsp;updateHabitsPossible()</pre> <div class="block">Utility function for stats calculation - updates the number of possible Habit executions if it were done every day it was scheduled for since its start date.</div> </li> </ul> <a name="compareTo-com.example.habitup.Model.Habit-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>compareTo</h4> <pre>public&nbsp;int&nbsp;compareTo(<a href="../../../../com/example/habitup/Model/Habit.html" title="class in com.example.habitup.Model">Habit</a>&nbsp;h)</pre> <div class="block">Comparator implementation - to sort lexicographically based on name.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code>compareTo</code>&nbsp;in interface&nbsp;<code>java.lang.Comparable&lt;<a href="../../../../com/example/habitup/Model/Habit.html" title="class in com.example.habitup.Model">Habit</a>&gt;</code></dd> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>h</code> - Habit (to compare to)</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>int (comparison)</dd> </dl> </li> </ul> <a name="getHabitsDone-com.example.habitup.Model.UserAccount-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getHabitsDone</h4> <pre>public&nbsp;int&nbsp;getHabitsDone(<a href="../../../../com/example/habitup/Model/UserAccount.html" title="class in com.example.habitup.Model">UserAccount</a>&nbsp;user)</pre> <div class="block">Get how many times Habit was done on schedule.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>int (Number of times Habit was done on schedule)</dd> </dl> </li> </ul> <a name="getHabitsDoneExtra-com.example.habitup.Model.UserAccount-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getHabitsDoneExtra</h4> <pre>public&nbsp;int&nbsp;getHabitsDoneExtra(<a href="../../../../com/example/habitup/Model/UserAccount.html" title="class in com.example.habitup.Model">UserAccount</a>&nbsp;user)</pre> <div class="block">Get how many times Habit was done outside of schedule.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>int (Number of times Habit was done outside of schedule)</dd> </dl> </li> </ul> <a name="getHabitsPossible--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getHabitsPossible</h4> <pre>public&nbsp;int&nbsp;getHabitsPossible()</pre> <div class="block">Get how many times Habit could have been done if schedule was followed from start date.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>int (Number of times Habit could have been done if schedule was followed from start date)</dd> </dl> </li> </ul> <a name="getPercent--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getPercent</h4> <pre>public&nbsp;int&nbsp;getPercent()</pre> <div class="block">Get the percentage of the habit's progression status</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>the percentage</dd> </dl> </li> </ul> <a name="equals-java.lang.Object-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>equals</h4> <pre>public&nbsp;boolean&nbsp;equals(java.lang.Object&nbsp;obj)</pre> <div class="block">When two habit are compared, they should be equal if they have the same HIDs</div> <dl> <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> <dd><code>equals</code>&nbsp;in class&nbsp;<code>java.lang.Object</code></dd> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>obj</code> - the other habit to compare with</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>true if the two habits have the same HID</dd> </dl> </li> </ul> <a name="hashCode--"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>hashCode</h4> <pre>public&nbsp;int&nbsp;hashCode()</pre> <div class="block">Override hash code to include HID</div> <dl> <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> <dd><code>hashCode</code>&nbsp;in class&nbsp;<code>java.lang.Object</code></dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the habit's hash 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> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-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="../../../../com/example/habitup/Model/Attributes.html" title="class in com.example.habitup.Model"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../com/example/habitup/Model/HabitEvent.html" title="class in com.example.habitup.Model"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?com/example/habitup/Model/Habit.html" target="_top">Frames</a></li> <li><a href="Habit.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
CMPUT301F17T29/HabitUp
javadoc/com/example/habitup/Model/Habit.html
HTML
gpl-3.0
32,387
[ 30522, 1026, 999, 9986, 13874, 16129, 2270, 1000, 1011, 1013, 1013, 1059, 2509, 2278, 1013, 1013, 26718, 2094, 16129, 1018, 1012, 5890, 17459, 1013, 1013, 4372, 1000, 1000, 8299, 1024, 1013, 1013, 7479, 1012, 1059, 2509, 1012, 8917, 1013, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php /** * @package snow-monkey * @author inc2734 * @license GPL-2.0+ * @version 15.13.0 */ use Inc2734\WP_Customizer_Framework\Framework; use Framework\Helper; Framework::control( 'select', 'footer-widget-area-column-size', [ 'label' => __( 'Number of columns in the footer widget area on PC', 'snow-monkey' ), 'priority' => 110, 'default' => '1-4', 'choices' => [ '1-1' => __( '1 column', 'snow-monkey' ), '1-2' => __( '2 columns', 'snow-monkey' ), '1-3' => __( '3 columns', 'snow-monkey' ), '1-4' => __( '4 columns', 'snow-monkey' ), ], 'active_callback' => function() { return Helper::is_active_sidebar( 'footer-widget-area' ); }, ] ); if ( ! is_customize_preview() ) { return; } $panel = Framework::get_panel( 'design' ); $section = Framework::get_section( 'footer' ); $control = Framework::get_control( 'footer-widget-area-column-size' ); $control->join( $section )->join( $panel );
inc2734/snow-monkey
app/customizer/design/sections/footer/controls/footer-widget-area-column-size.php
PHP
gpl-2.0
968
[ 30522, 1026, 1029, 25718, 1013, 1008, 1008, 1008, 1030, 7427, 4586, 1011, 10608, 1008, 1030, 3166, 4297, 22907, 22022, 1008, 1030, 6105, 14246, 2140, 1011, 1016, 1012, 1014, 1009, 1008, 1030, 2544, 2321, 1012, 2410, 1012, 1014, 1008, 1013, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _index = require('../../isSameWeek/index.js'); var _index2 = _interopRequireDefault(_index); var _index3 = require('../_lib/convertToFP/index.js'); var _index4 = _interopRequireDefault(_index3); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // This file is generated automatically by `scripts/build/fp.js`. Please, don't change it. var isSameWeekWithOptions = (0, _index4.default)(_index2.default, 3); exports.default = isSameWeekWithOptions; module.exports = exports['default'];
lucionei/chamadotecnico
chamadosTecnicosFinal-app/node_modules/date-fns/fp/isSameWeekWithOptions/index.js
JavaScript
mit
621
[ 30522, 1005, 2224, 9384, 1005, 1025, 4874, 1012, 9375, 21572, 4842, 3723, 1006, 14338, 1010, 1000, 1035, 1035, 9686, 5302, 8566, 2571, 1000, 1010, 1063, 3643, 1024, 2995, 1065, 1007, 1025, 13075, 1035, 5950, 1027, 5478, 1006, 1005, 1012, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# Rhexia reticulata Humb. & Bonpl. SPECIES #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Myrtales/Melastomataceae/Rhexia/Rhexia reticulata/README.md
Markdown
apache-2.0
182
[ 30522, 1001, 1054, 5369, 14787, 2128, 4588, 18060, 14910, 2497, 1012, 1004, 14753, 24759, 1012, 2427, 1001, 1001, 1001, 1001, 3570, 3970, 1001, 1001, 1001, 1001, 2429, 2000, 2248, 30524, 19701, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
{% extends "layout_unbranded.html" %} {% block page_title %} GOV.UK prototype kit {% endblock %} {% block content %} <main id="content" role="main"> <div class="grid-row"> <div class="column-full"> <div id="global-breadcrumb" class="breadcrumb"> <a class="link-back" href="results_confirm2?search=QQ123456C">Back</a> </div> <h1 class="heading-large">QQ123456C</h1> <div class="tab-content"> <div class="js-tabs nav-tabs"> <ul class="tabs-nav" role="tablist"> <li class="active"><a href="#current-sp-value" id="tab-overview">Overview</a></li> <li><a href="#options-sp-value" id="tab-options">Filling gaps</a></li> <li><a href="#improve-sp-value" id="tab-contracting-out">Starting amount</a></li> <li><a href="#contracted-out" id="tab-ni-record">National Insurance summary</a></li> </ul> </div> </div> </div> <div id="forecast" class="tab-pane"> <div class="column-half"> <div class="forecast-wrapper2"> <span class="forecast-label2">State Pension date</span> <span class="forecast-data-bold2">4 May 2034</span> </div> <div class="forecast-wrapper2"> <span class="forecast-label2">Final relevant year (FRY)</span> <span class="forecast-data-bold2">2033-34</span> <span class="forecast-label2">&nbsp;</span><span class="forecast-data-bold2 forecast-label2-inline">18 years to FRY </span> </div> <div class="forecast-wrapper2"> <span class="forecast-label2">COPE estimate</span> <span class="forecast-data-bold2">£18.84 a week</span> <span class="forecast-no-data forecast-header forecast-label2-inline">Was contracted out</span> </div> </div> <div class="column-half"> <div class="forecast-wrapper2"> <span class="forecast-label2">Estimate up to 5 April 2016 </span> <span class="forecast-data-bold2">£120.10 a week</span> <span class="forecast-label2 forecast-label2-inline">Qualifying years</span> <span class="forecast-data-bold2 forecast-label2-inline">28</span> </div> <div class="forecast-wrapper2"> <span class="forecast-label2">Forecast contributing future years</span> <span class="forecast-data-bold2">£159.55 a week</span> <span class="forecast-label2 forecast-label2-inline">Future years needed</span> <span class="forecast-data-bold2 forecast-label2-inline">9</span> </div> <div class="forecast-wrapper2"> <span class="forecast-label2">Most they can get</span> <span class="forecast-data-bold2">£159.55 a week</span> </div> </div> </div> <div id="options" class="tab-pane"> <div class="column-two-thirds"> <h3 class="heading-small">Improve by filling gaps</h3> <table class="vnics"><tr><th>Gaps filled</th><th>Old rules</th><th>New rules</th></tr> <tr><td>Estimate 05 April 2016</td><td class="vnics_bold">£120.10 a week</td><td>£108.33 a week</td></tr> <tr><td>1</td><td class="vnics_bold">£124.17 a week</td><td>£112.89 a week</td></tr> <tr><td>2</td><td class="vnics_bold">£128.24 a week<td>£117.45 a week</td></tr> <tr><td>3</td><td><td>£122.00 a week</td></tr> <tr><td>4</td><td><td>£126.56 a week</td></tr> <tr><td>5</td><td><td class="vnics_bold">£131.12 a week</td></tr> </table> </div> </div> <div id="contracting-out" class="tab-pane"> <div class="column-two-thirds"> <h3 class="heading-small">Starting amount at April 2016 is £117.16 a week</h3> </div> <div class="column-one-half column-half-left"> <div class="forecast-wrapper2"> <p class="heading-small">Old rules</p> <span class="forecast-label2">Basic</span> <span class="forecast-data2">£111.35 a week</span> <span class="forecast-label2 forecast-label2-inline">Additional Pension and Grad</span> <span class="forecast-data2 forecast-label2-inline">£5.81 a week</span> <span class="forecast-label2 forecast-label2-inline">Total</span> <span class="forecast-data-bold2 forecast-label2-inline">£117.16 a week </span> </div> </div> <div class="column-one-half column-half-right"> <div class="forecast-wrapper2"> <p class="heading-small">New rules</p> <span class="forecast-label2">New State Pension</span> <span class="forecast-data2">£124.52 a week</span> <span class="forecast-label2 forecast-label2-inline">RDA</span> <span class="forecast-data2 forecast-label2-inline">£18.84 a week</span> <span class="forecast-label2 forecast-label2-inline">Total</span> <span class="forecast-data-bold2 forecast-label2-inline">£105.68 a week</span> </div> </div> </div> <div id="ni-record" class="tab-pane"> <div class="column-two-thirds"> <h2 class="heading-small">Shortfalls in record</h2> <p>5 years can be filled</p> <dl class="accordion2"> <dt> <div class="ni-wrapper"> <div class="ni-years2">2016-17</div> <div class="ni-notfull">This year is not available yet</div> </div> </dt> <dt> <div class="ni-wrapper"> <div class="ni-years2">2015-16</div> <div class="ni-notfull">£733.20 shortfall</div> </div> </dt> <dt> <div class="ni-wrapper"> <div class="ni-years2">2014-15</div> <div class="ni-notfull">£722.80 shortfall</div> </div> </dt> <dt> <div class="ni-wrapper"> <div class="ni-years2">2013-14</div> <div class="ni-notfull">£704.60 shortfall</div> </div> </dt> <dt> <div class="ni-wrapper"> <div class="ni-years2">2012-13</div> <div class="ni-notfull">£689.00 shortfall</div> </div> </dt> <dt> <div class="ni-wrapper"> <div class="ni-years2">2011-12</div> <div class="ni-notfull">£289.80 shortfall</div> </div> </dt> </dl> </div> <div class="column-one-third"> <aside class="govuk-related-items dwp-related-items" role="complementary"> <h2 class="heading-small" id="subsection-title">Full years and shortfalls</h2> <nav role="navigation" aria-labelledby="subsection-title"> <ul class="font-xsmall"> <nav role="navigation" aria-labelledby="parent-subsection"> <ul class="list-bullets"> <li><span style="font-size: 16px"><span style="font-weight: 700">28</span> qualifying years </span> </li> <li><span style="font-size: 16px"><span style="font-weight: 700">18</span> years to contribute before 05 April 2034</span> </li> <li><span style="font-size: 16px"><span style="font-weight: 700">5</span> years with a shortfall</span> </li> </ul> </ul> </nav> </aside> </div> </div> </div> </main> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script type="text/javascript"> // function show(elementId) { // document.getElementById("id1").style.display = "none"; // document.getElementById("id2").style.display = "block"; // document.getElementById(elementId).style.display = "block"; // } jQuery(document).ready(function($){ $("a#tab-overview").click(function() { $(".tabs-nav li").removeClass("active"); $(this).parent().addClass("active"); $("#forecast").show(); $("#ni-record").hide(); $("#contracting-out").hide(); $("#contracting-out").hide(); $("#options").hide(); window.location.hash = "#lie-forecast"; return false; }); $("a#tab-options").click(function() { $(".tabs-nav li").removeClass("active"); $(this).parent().addClass("active"); $("#options").show(); $("#forecast").hide(); $("#ni-record").hide(); $("#contracting-out").hide(); window.location.hash = "#lie-options"; return false; }); $("a#tab-ni-record").click(function() { $(".tabs-nav li").removeClass("active"); $(this).parent().addClass("active"); $("#ni-record").show(); $("#contracting-out").hide(); $("#forecast").hide(); $("#options").hide(); window.location.hash = "#lie-ni-record"; return false; }); $("a#tab-contracting-out").click(function() { $(".tabs-nav li").removeClass("active"); $(this).parent().addClass("active"); $("#contracting-out").show(); $("#ni-record").hide(); $("#forecast").hide(); $("#options").hide(); window.location.hash = "#lie-contracting-out"; return false; }); if(window.location.hash === "#lie-forecast") { $("a#tab-overview").trigger('click'); } else if (window.location.hash === "#lie-ni-record") { $("a#tab-ni-record").trigger('click'); } else if (window.location.hash === "#lie-contracting-out") { $("a#tab-contracting-out").trigger('click'); } else if (window.location.hash === "#lie-optionst") { $("a#tab-options").trigger('click'); } }); </script> </div> </main> <script type="text/javascript"> function removeWhitespaces() { var txtbox = document.getElementById('search-main'); txtbox.value = txtbox.value.replace(/\s/g, ""); } </script> {% endblock %}
steven-borthwick/check-support
app/views/volnicsv1a/forecast_QQ123456C.html
HTML
mit
9,847
[ 30522, 1063, 1003, 8908, 1000, 9621, 1035, 4895, 23544, 2098, 1012, 16129, 1000, 1003, 1065, 1063, 1003, 3796, 3931, 1035, 2516, 1003, 1065, 18079, 1012, 2866, 8773, 8934, 1063, 1003, 2203, 23467, 1003, 1065, 1063, 1003, 3796, 4180, 1003, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copyright 2016 Crown Copyright * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT 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 stroom.util.client; import com.google.gwt.json.client.JSONArray; import com.google.gwt.json.client.JSONNumber; import com.google.gwt.json.client.JSONObject; import com.google.gwt.json.client.JSONParser; import com.google.gwt.json.client.JSONString; import com.google.gwt.json.client.JSONValue; public class JSONUtil { private JSONUtil() { // Utility class. } public static JSONValue parse(final String json) { if (json != null && !json.isEmpty()) { return JSONParser.parseStrict(json); } return null; } public static JSONObject getObject(final JSONValue v) { if (v != null) { return v.isObject(); } return null; } public static JSONArray getArray(final JSONValue v) { if (v != null) { return v.isArray(); } return null; } public static String getString(final JSONValue v) { if (v != null) { final JSONString jsonString = v.isString(); if (jsonString != null) { return jsonString.stringValue(); } } return null; } public static Integer getInteger(final JSONValue v) { if (v != null) { final JSONNumber jsonNumber = v.isNumber(); if (jsonNumber != null) { return Integer.valueOf((int) jsonNumber.doubleValue()); } } return null; } public static Double getDouble(final JSONValue v) { if (v != null) { final JSONNumber jsonNumber = v.isNumber(); if (jsonNumber != null) { return Double.valueOf(jsonNumber.doubleValue()); } } return null; } public static String[] getStrings(final JSONValue v) { String[] strings = new String[0]; final JSONArray array = getArray(v); if (array != null) { strings = new String[array.size()]; for (int i = 0; i < array.size(); i++) { strings[i] = getString(array.get(i)); } } return strings; } }
gchq/stroom
stroom-core-client/src/main/java/stroom/util/client/JSONUtil.java
Java
apache-2.0
2,742
[ 30522, 1013, 1008, 1008, 9385, 2355, 4410, 9385, 1008, 1008, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1000, 6105, 1000, 1007, 1025, 1008, 2017, 2089, 2025, 2224, 2023, 5371, 3272, 1999, 12646, 2007, 1996, 6...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
import Ember from 'ember'; const DELAY = 100; export default Ember.Component.extend({ classNameBindings : ['inlineBlock:inline-block','clip:clip'], tooltipService : Ember.inject.service('tooltip'), inlineBlock : true, clip : false, model : null, size : 'default', ariaRole : ['tooltip'], textChangedEvent : null, showTimer : null, textChanged: Ember.observer('textChangedEvent', function() { this.show(this.get('textChangedEvent')); }), mouseEnter(evt) { if ( !this.get('tooltipService.requireClick') ) { let tgt = Ember.$(evt.currentTarget); if (this.get('tooltipService.tooltipOpts')) { this.set('tooltipService.tooltipOpts', null); } // Wait for a little bit of time so that the mouse can pass through // another tooltip-element on the way to the dropdown trigger of a // tooltip-action-menu without changing the tooltip. this.set('showTimer', Ember.run.later(() => { this.show(tgt); }, DELAY)); } }, show(node) { if ( this._state === 'destroying' ) { return; } let svc = this.get('tooltipService'); this.set('showTimer', null); svc.cancelTimer(); let out = { type : this.get('type'), baseClass : this.get('baseClass'), eventPosition : node.offset(), originalNode : node, model : this.get('model'), template : this.get('tooltipTemplate'), }; if ( this.get('isCopyTo') ) { out.isCopyTo = true; } svc.set('tooltipOpts', out); }, mouseLeave: function() { if (!this.get('tooltipService.openedViaContextClick')) { if ( this.get('showTimer') ) { Ember.run.cancel(this.get('showTimer')); } else { this.get('tooltipService').leave(); } } }, modelObserver: Ember.observer('model', 'textChangedEvent', function() { let opts = this.get('tooltipService.tooltipOpts'); if (opts) { this.set('tooltipService.tooltipOpts.model', this.get('model')); } }) });
nrvale0/ui
app/components/tooltip-element/component.js
JavaScript
apache-2.0
2,144
[ 30522, 12324, 7861, 5677, 2013, 1005, 7861, 5677, 1005, 1025, 9530, 3367, 8536, 1027, 2531, 1025, 9167, 12398, 7861, 5677, 1012, 6922, 1012, 7949, 1006, 1063, 2465, 18442, 8428, 4667, 2015, 1024, 1031, 1005, 23881, 23467, 1024, 23881, 1011,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package net.viperfish.bookManager.core; public abstract class TransactionWithResult<T> implements Transaction { private boolean isDone; private T result; protected void setResult(T result) { this.result = result; isDone = true; } /** * check whether this has finished executing * * @return is complete */ public boolean isDone() { return isDone; } /** * get the result * * This method gets the result of the operation. It blocks until the result * is available. It will block for no more 1 minute. If exceeds one minute, * it is interrupted and a {@link RuntimeException} is thrown. * * @return the result of the operation */ public T getResult() { return result; } }
shilongdai/bookManager
src/main/java/net/viperfish/bookManager/core/TransactionWithResult.java
Java
bsd-3-clause
719
[ 30522, 7427, 5658, 1012, 17947, 7529, 1012, 2338, 24805, 4590, 1012, 4563, 1025, 2270, 10061, 2465, 12598, 24415, 6072, 11314, 1026, 1056, 1028, 22164, 12598, 1063, 2797, 22017, 20898, 2003, 5280, 2063, 1025, 2797, 1056, 2765, 1025, 5123, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php if (!get_option('users_can_register')) return; add_action('login_enqueue_scripts','sfc_register_enqueue_scripts'); function sfc_register_enqueue_scripts() { wp_enqueue_script('jquery'); } add_action('sfc_login_new_fb_user', 'sfc_register_redirect'); function sfc_register_redirect() { wp_redirect(site_url('wp-login.php?action=register', 'login')); exit; } remove_action('login_form','sfc_login_add_login_button'); add_action('login_form','sfc_register_add_login_button'); function sfc_register_add_login_button() { global $action; if ($action == 'login') echo '<p><fb:login-button v="2" registration-url="'.site_url('wp-login.php?action=register', 'login').'" scope="email,user_website" onlogin="window.location.reload();" /></p><br />'; } add_action('register_form','sfc_register_form'); function sfc_register_form() { add_action('sfc_async_init', 'sfc_register_form_script'); $fields = json_encode( apply_filters('sfc_register_fields',array( array('name'=>'name', 'view'=>'prefilled'), array('name'=>'username', 'description'=>__('Choose a username','sfc'), 'type'=>'text'), array('name'=>'email'), array('name'=>'captcha'), ) ) ); ?> <fb:registration fields='<?php echo $fields; ?>' redirect-uri="<?php echo apply_filters('sfc_register_redirect', site_url('wp-login.php?action=register', 'login') ); ?>" width="262" > </fb:registration> <?php } function sfc_register_form_script() { ?> jQuery('#registerform p').hide(); jQuery('#reg_passmail').show(); <?php } add_action('register_form','sfc_add_base_js',20); // catch the signed request add_action('login_form_register','sfc_register_handle_signed_request'); function sfc_register_handle_signed_request() { global $wpdb; $options = get_option('sfc_options'); if (!empty($_POST['signed_request'])) { list($encoded_sig, $payload) = explode('.', $_POST['signed_request'], 2); // decode the data $sig = sfc_base64_url_decode($encoded_sig); $data = json_decode(sfc_base64_url_decode($payload), true); if (!isset($data['algorithm']) || strtoupper($data['algorithm']) !== 'HMAC-SHA256') { return; } // check sig $expected_sig = hash_hmac('sha256', $payload, $options['app_secret'], true); if ($sig !== $expected_sig) { return; } if (isset($data['registration'])) { $info = $data['registration']; if (isset($info['username']) && isset($info['email'])) { // first check to see if this user already exists in the db $user_id = $wpdb->get_var( $wpdb->prepare("SELECT ID FROM $wpdb->users WHERE user_email = %s", $info['email']) ); if ($user_id) { $fbuid = $data['user_id']; update_usermeta($user_id, 'fbuid', $fbuid); // connect the account so we don't have to query this again // redirect to admin and exit wp_redirect( add_query_arg( array('updated' => 'true'), self_admin_url( 'profile.php' ) ) ); exit; } else { // new user, set the registration info $_POST['user_login'] = $info['username']; $_POST['user_email'] = $info['email']; do_action('sfc_register_request',$info); } } } } }
tahitinuiarena/site
wp-content/plugins/simple-facebook-connect/sfc-register.php
PHP
gpl-2.0
3,192
[ 30522, 1026, 1029, 25718, 2065, 1006, 999, 2131, 1035, 5724, 1006, 1005, 5198, 1035, 2064, 1035, 4236, 1005, 1007, 1007, 2709, 1025, 5587, 1035, 2895, 1006, 1005, 8833, 2378, 1035, 4372, 4226, 5657, 1035, 14546, 1005, 1010, 1005, 16420, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* Mesquite source code. Copyright 1997 and onward, W. Maddison and D. Maddison. Disclaimer: The Mesquite source code is lengthy and we are few. There are no doubt inefficiencies and goofs in this code. The commenting leaves much to be desired. Please approach this source code with the spirit of helping out. Perhaps with your help we can be more than a few, and make Mesquite better. Mesquite is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. Mesquite's web site is http://mesquiteproject.org This source code and its compiled class files are free and modifiable under the terms of GNU Lesser General Public License. (http://www.gnu.org/copyleft/lesser.html) */ package mesquite.distance.PDistance; /*~~ */ import java.awt.Checkbox; import mesquite.lib.*; import mesquite.lib.characters.*; import mesquite.categ.lib.DNAData; import mesquite.distance.lib.*; /* ======================================================================== */ /* incrementable, with each being based on a different matrix */ public class PDistance extends DNATaxaDistFromMatrix { MesquiteBoolean transversionsOnly = new MesquiteBoolean(false); MesquiteBoolean transitionsOnly = new MesquiteBoolean(false); /*.................................................................................................................*/ public boolean startJob(String arguments, Object condition, boolean hiredByName) { addCheckMenuItemToSubmenu(null, distParamSubmenu, "Transversions Only", MesquiteModule.makeCommand("toggleTransversionsOnly", this), transversionsOnly); addCheckMenuItemToSubmenu(null, distParamSubmenu, "Transitions Only", MesquiteModule.makeCommand("toggleTransitionsOnly", this), transitionsOnly); return true; } public boolean optionsAdded() { return true; } RadioButtons radios; public void addOptions(ExtensibleDialog dialog) { super.addOptions(dialog); String[] labels = {"all changes", "transversions only", "transitions only"}; int defaultValue= 0; if (transversionsOnly.getValue()) defaultValue = 1; else if (transitionsOnly.getValue()) defaultValue = 2; radios = dialog.addRadioButtons(labels, defaultValue); } public void processOptions(ExtensibleDialog dialog) { super.processOptions(dialog); if (radios.getValue()==0) { transversionsOnly.setValue(false); transitionsOnly.setValue(false); } else if (radios.getValue()==1) { transversionsOnly.setValue(true); transitionsOnly.setValue(false); } else if (radios.getValue()==2) { transversionsOnly.setValue(false); transitionsOnly.setValue(true); } } /*.................................................................................................................*/ public Snapshot getSnapshot(MesquiteFile file) { Snapshot snapshot = new Snapshot(); snapshot.addLine("toggleTransversionsOnly " + transversionsOnly.toOffOnString()); snapshot.addLine("toggleTransitionsOnly " + transitionsOnly.toOffOnString()); return snapshot; } /*.................................................................................................................*/ public Object doCommand(String commandName, String arguments, CommandChecker checker) { if (checker.compare(this.getClass(), "Sets whether only transversions are counted.", "[on; off]", commandName, "toggleTransversionsOnly")) { transversionsOnly.toggleValue(new Parser().getFirstToken(arguments)); if (transversionsOnly.getValue()) transitionsOnly.setValue(false); parametersChanged(); } else if (checker.compare(this.getClass(), "Sets whether only transitions are counted.", "[on; off]", commandName, "toggleTransitionsOnly")) { transitionsOnly.toggleValue(new Parser().getFirstToken(arguments)); if (transitionsOnly.getValue()) transversionsOnly.setValue(false); parametersChanged(); } else return super.doCommand(commandName, arguments, checker); return null; } /*.................................................................................................................*/ public boolean getTransversionsOnly(){ return transversionsOnly.getValue(); } /*.................................................................................................................*/ public boolean getTransitionsOnly(){ return transitionsOnly.getValue(); } /*.................................................................................................................*/ public String getParameters(){ String s = super.getParameters(); if (getTransversionsOnly()) s+= " Transversions only."; if (getTransitionsOnly()) s+= " Transitions only."; return s; } /*.................................................................................................................*/ public TaxaDistance getTaxaDistance(Taxa taxa, MCharactersDistribution observedStates){ if (observedStates==null) { MesquiteMessage.warnProgrammer("Observed states null in "+ getName()); return null; } if (!(observedStates.getParentData() instanceof DNAData)) { return null; } PTD simpleTD = new PTD( this,taxa, observedStates,getEstimateAmbiguityDifferences(), getCountDifferencesIfGapInPair()); return simpleTD; } /*.................................................................................................................*/ public String getName() { return "Uncorrected (p) distance (DNA)"; } /*.................................................................................................................*/ /** returns an explanation of what the module does.*/ public String getExplanation() { return "Uncorrected (p) distance from a DNA matrix." ; } public boolean requestPrimaryChoice(){ return true; } /*.................................................................................................................*/ /** returns the version number at which this module was first released. If 0, then no version number is claimed. If a POSITIVE integer * then the number refers to the Mesquite version. This should be used only by modules part of the core release of Mesquite. * If a NEGATIVE integer, then the number refers to the local version of the package, e.g. a third party package*/ public int getVersionOfFirstRelease(){ return 110; } /*.................................................................................................................*/ public boolean isPrerelease(){ return false; } /*.................................................................................................................*/ public boolean showCitation(){ return true; } } class PTD extends DNATaxaDistance { PDistance PD; public PTD(MesquiteModule ownerModule, Taxa taxa, MCharactersDistribution observedStates, boolean estimateAmbiguityDifferences, boolean countDifferencesIfGapInPair){ super(ownerModule, taxa, observedStates,estimateAmbiguityDifferences, countDifferencesIfGapInPair); PD = (PDistance)ownerModule; MesquiteDouble N = new MesquiteDouble(); MesquiteDouble D = new MesquiteDouble(); setEstimateAmbiguityDifferences(((DNATaxaDistFromMatrix)ownerModule).getEstimateAmbiguityDifferences()); for (int taxon1=0; taxon1<getNumTaxa(); taxon1++) { for (int taxon2=taxon1; taxon2<getNumTaxa(); taxon2++) { double[][] fxy = calcPairwiseDistance(taxon1, taxon2, N, D); if (PD.getTransversionsOnly()) distances[taxon1][taxon2]= fxy[0][1] + fxy[1][0] + fxy[0][3] + fxy[3][0] + fxy[1][2] + fxy[2][1] + fxy[2][3] + fxy[3][2]; //trasnversion else if (PD.getTransitionsOnly()) distances[taxon1][taxon2]= fxy[0][2] + fxy[2][0] + fxy[1][3] + fxy[3][1]; //transitions else distances[taxon1][taxon2]= D.getValue(); } } copyDistanceTriangle(); logDistancesIfDesired(ownerModule.getName()); } public String getName() { return PD.getName(); } }
MesquiteProject/MesquiteCore
Source/mesquite/distance/PDistance/PDistance.java
Java
lgpl-3.0
7,876
[ 30522, 1013, 1008, 2033, 2015, 15549, 2618, 3120, 3642, 1012, 9385, 2722, 1998, 15834, 1010, 1059, 1012, 5506, 10521, 2239, 1998, 1040, 1012, 5506, 30524, 12401, 1998, 2057, 2024, 2261, 1012, 2045, 2024, 2053, 4797, 1999, 12879, 8873, 23402...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* (C) IT Sky Consulting GmbH 2015 * http://www.it-sky-consulting.com/ * Author: Karl Brodowsky * Date: 2016-06-05 * License: GPL v2 (See https://de.wikipedia.org/wiki/GNU_General_Public_License ) */ /* implements tests for c-arithmetic */ /* enable qsort_r */ #define _GNU_SOURCE #include <stdio.h> #include <string.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> #include <string.h> #include <CUnit/Basic.h> #include <math.h> #include <time.h> #include <sqrt.h> // static const uint128 MAX_UINT128 = (uint128) -1; // static const uint128 MAX_UINT128_POW2 = ((uint128) 1) << 127; // static const uint64 MAX_UINT64 = (uint64) -1; // static const uint64 MAX_UINT64_POW2 = ((uint64) 1) << 63; // static const uint32 MAX_UINT32 = (uint32) -1; // static const uint32 MAX_UINT32_POW2 = ((uint32) 1) << 31; /* The suite initialization function. * Opens the temporary file used by the tests. * Returns zero on success, non-zero otherwise. */ int init_suite1() { return 0; } /* The suite cleanup function. * Closes the temporary file used by the tests. * Returns zero on success, non-zero otherwise. */ int clean_suite1(void) { return 0; } void test_ffff() { printf("\n"); uint128 x = (((uint128) 1) << 126) + 1; uint64 yb = sqrt_bit_wise(x); uint64 yw = sqrt_word_wise(x); uint64 y_expected = ((uint64) 1) << 63; char bufd[1024]; char bufx[1024]; sprint_uint128_dec(bufd, x); sprint_uint128_hex(bufx, x, 1); printf(" 0x40000000000000000000000000000001\n"); printf(" x=%s (%s)\n", bufd, bufx); printf("yb=%llu (0x%llx)\n", yb, yb); printf("yw=%llu (0x%llx)\n", yw, yw); CU_ASSERT_EQUAL(y_expected, yb); CU_ASSERT_EQUAL(y_expected, yw); } /* The main() function for setting up and running the tests. * Returns a CUE_SUCCESS on successful running, another * CUnit error code on failure. */ int main() { CU_pSuite pSuite = NULL; /* initialize the CUnit test registry */ if (CUE_SUCCESS != CU_initialize_registry()) { return CU_get_error(); } /* add a suite to the registry */ pSuite = CU_add_suite("Suite_1", init_suite1, clean_suite1); if (NULL == pSuite) { CU_cleanup_registry(); return CU_get_error(); } /* add the tests to the suite */ if ((NULL == CU_add_test(pSuite, "test near max uint128", test_ffff)) ) { CU_cleanup_registry(); return CU_get_error(); } /* Run all tests using the CUnit Basic interface */ CU_basic_set_mode(CU_BRM_VERBOSE); CU_basic_run_tests(); CU_cleanup_registry(); return CU_get_error(); }
bk1/c-arithmetic
test/test-sqrt-ffff.c
C
gpl-2.0
2,562
[ 30522, 1013, 1008, 1006, 1039, 1007, 2009, 3712, 10552, 18289, 2325, 1008, 8299, 1024, 1013, 1013, 7479, 1012, 2009, 1011, 3712, 1011, 10552, 1012, 4012, 1013, 1008, 3166, 1024, 6382, 22953, 3527, 9333, 4801, 1008, 3058, 1024, 2355, 1011, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<html> <head> <base href="/"> <title>Digital Display Garden</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"> <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Comfortaa" rel="stylesheet"> </head> <body style=""> <div id="container"> <div id="inner-body"> <app>Loading...</app> </div> <footer> <p class="info-text">West Central Research and Outreach Center <br/> 46352 State Hwy 329 <br/> Morris MN, 56267 <br/> </p> <a href='https://www.facebook.com/HorticultureDisplayGarden/' class="btn btn-fb" style="background-color: #4264aa; color: white"> <i class="fa fa-facebook left" aria-hidden="true"></i> <b>Facebook</b> </a> <a href='https://twitter.com/wcrocmorris' class="btn btn-tw" style="background-color: #55acee; color: white"> <i class="fa fa-twitter left" aria-hidden="true"></i> <b>Twitter</b> </a> <a href='https://wcroc.cfans.umn.edu/' class="btn btn-tw" style="background-color: goldenrod; color: white"> <i class="fa fa-leaf left" aria-hidden="true"></i> <b>WCROC</b> </a> </footer> </div> </body> <style> html { margin: 0; padding: 0; height: 100% } body { margin: 0; padding: 0; height: 100%; background-color:#f3eddc; min-width: 320px } /* IntelliJ lies: #container IS being used!!! */ #container { min-height:100%; position:relative; } /* see comment above */ .info-text { padding-top: 5px; margin-bottom: 5px; } /* see comment above */ #inner-body { padding-top: 115px; padding-bottom: 114px; } footer { font-weight: bold; width: 100%; background-color: maroon; color: gold; position: absolute; bottom: 0px; text-align: center; padding-bottom: 10px; } .btn-fb, .btn-tw { margin-right: 3px; } </style> </html>
UMM-CSci-3601-S17/digital-display-garden-iteration-3-dorfner
client/src/index.html
HTML
mit
2,244
[ 30522, 1026, 16129, 1028, 1026, 2132, 1028, 1026, 2918, 17850, 12879, 1027, 1000, 1013, 1000, 1028, 1026, 2516, 1028, 3617, 4653, 3871, 1026, 1013, 2516, 1028, 1026, 18804, 25869, 13462, 1027, 1000, 21183, 2546, 1011, 1022, 1000, 1028, 1026...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
W3C CSS Test Suite Repository ----------------------------- This repository contains top level directories for all of CSS specs for which we currently have tests. Place tests in the appropriate directory based on the first rel="help" link in the test. If you are writing tests for a spec and it doesn't yet have a directory here, feel free to create it. There are a few directories that do not map to specifications: support/ contains common image files to which many of the tests link in this location tools/ is random scripts that may be useful when administering tests. vendor-imports/ is where third parties may import their tests that originate and are maintained in an external repo. Files in this directory should never be modified in this repo, but should go through the vendor's process to be imported here. work-in-progress/ is a legacy directory that contains all the work that was once submitted to the repo, but was not yet ready for review. Since the CSSWG has adopted the GitHub pull request process, no new files should be landed here. The subdirectories here are named by test author or contributing organization. Linking Your Tests to Specifications ----------------------------------- In addition to placing your tests in the appropriate directory in this repository, you must also include at least one specification link in the test metadata, following [these guidelines][speclinks]. For CSS tests, you must also be sure you’re linking to a specific level of the spec, generally the first level where the feature being tested is defined. Where possible, it’s preferable to link to the official version of the spec, which will start with http://www.w3.org/TR/. This can usually be found as the ‘Latest version’ link in the spec itself and will include the level of the spec in the URL. For example, the proper link to level 1 of the CSS Flexbox spec is: http://www.w3.org/TR/css-flexbox-1/#RELEVANT_SECTION When testing features not yet available in an official draft, link to the appropriate Editor’s Draft found at http://dev.w3.org/csswg/. Be sure to include the level of the specification in the link. For example, the proper link to the CSS Flexbox Level 1 Editor’s Draft is: http://dev.w3.org/csswg/css-flexbox-1/#RELEVANT_SECTION Contributing ------------- Absolutely everyone is welcome (and even encouraged) to contribute to test development, so long as you fulfill the contribution requirements detailed in the [Contributing Guidelines][contributing]. No test is too small or too simple, especially if it corresponds to something for which you've noted an interoperability bug in a browser. Write Access ------------ This section only applies if you have cloned the repository from Mercurial. If you've cloned it from GitHub, which is a mirror of the canonical Mercurial repo, you can submit your tests via a [pull request][github101]. To gain write access to this Mercurial repository, sign up for an account on the CSS Test Suite Manager (aka Shepherd) at: https://test.csswg.org/shepherd/register and then submit a request on the Repository Access page at: https://test.csswg.org/shepherd/account/access/ You will be notified by email when your request is processed. Please note that although we will grant write access directly to the Mercurial repo, it is strongly advised to use GitHub for test submissions to enable reviewers to use its built-in review tools. Direct submissions to Mercurial should be limited to administrative or housekeeping tasks, very minor changes that don't require a review, or from advanced users of the system. [contributing]: https://github.com/rhauck/csswg-test/blob/master/CONTRIBUTING.md [github101]: http://testthewebforward.org/docs/github-101.html [speclinks]: http://testthewebforward.org/docs/test-templates.html#specification-links
modulexcite/blink
LayoutTests/imported/csswg-test/README.md
Markdown
bsd-3-clause
3,837
[ 30522, 1059, 2509, 2278, 20116, 2015, 3231, 7621, 22409, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 2023, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package de.mud.jta.plugin; import de.mud.jta.FilterPlugin; import de.mud.jta.Plugin; import de.mud.jta.PluginBus; import de.mud.jta.event.ConfigurationListener; import de.mud.jta.event.OnlineStatus; import de.mud.jta.event.SocketListener; import java.io.IOException; // import java.io.InputStream; // import java.io.OutputStream; /** * The shell plugin is the backend component for terminal emulation using * a shell. It provides the i/o streams of the shell as data source. * <p> * <B>Maintainer:</B> Matthias L. Jugel * * @author Matthias L. Jugel, Marcus Mei�ner, Pete Zaitcev * @version $Id: Shell.java 499 2005-09-29 08:24:54Z leo $ */ public class Shell extends Plugin implements FilterPlugin { protected String shellCommand; private HandlerPTY pty; public Shell(final PluginBus bus, final String id) { super(bus, id); bus.registerPluginListener((ConfigurationListener) cfg -> { String tmp; if ((tmp = cfg.getProperty("Shell", id, "command")) != null) { shellCommand = tmp; // System.out.println("Shell: Setting config " + tmp); // P3 } else { // System.out.println("Shell: Not setting config"); // P3 shellCommand = "/bin/sh"; } }); bus.registerPluginListener(new SocketListener() { // we do actually ignore these parameters public void connect(String host, int port) { // XXX Fix this together with window size changes // String ttype = (String)bus.broadcast(new TerminalTypeRequest()); // String ttype = getTerminalType(); // if(ttype == null) ttype = "dumb"; // XXX Add try around here to catch missing DLL/.so. pty = new HandlerPTY(); if (pty.start(shellCommand) == 0) { bus.broadcast(new OnlineStatus(true)); } else { bus.broadcast(new OnlineStatus(false)); } } public void disconnect() { bus.broadcast(new OnlineStatus(false)); pty = null; } }); } public void setFilterSource(FilterPlugin plugin) { // we do not have a source other than our socket } public FilterPlugin getFilterSource() { return null; } public int read(byte[] b) throws IOException { if (pty == null) { return 0; } int ret = pty.read(b); if (ret <= 0) { throw new IOException("EOF on PTY"); } return ret; } public void write(byte[] b) throws IOException { if (pty != null) { pty.write(b); } } }
timrs2998/JTA-Fork
src/main/java/de/mud/jta/plugin/Shell.java
Java
gpl-3.0
2,794
[ 30522, 7427, 2139, 1012, 8494, 1012, 1046, 2696, 1012, 13354, 2378, 1025, 12324, 2139, 1012, 8494, 1012, 1046, 2696, 1012, 11307, 24759, 15916, 2378, 1025, 12324, 2139, 1012, 8494, 1012, 1046, 2696, 1012, 13354, 2378, 1025, 12324, 2139, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# jsdoc-generator output jsdoc. ## Update v0.2.3 update description v0.2.2 update README.md --- ## Installation `$ apm install jsdoc-generator` --- ## Settings ### jsdoc options 1. open settings pane. 2. select `Jsdoc Generator` from `Packages`. 3. `Options` section. **example** ``` --debug --nocolor ``` ### output dir 1. open settings pane. 2. select `Jsdoc Generator` from `Packages`. 3. `Output Directory` section. ***example*** Active Text Editor or Select Tree source Path: `/project/src/js/sample.js` out put document path: `/project/doc` Setting: ``` {pwd}/../../doc ``` `{pwd}` is directory in select file.
t-ishii/jsdoc-generator
README.md
Markdown
mit
637
[ 30522, 1001, 1046, 16150, 10085, 1011, 13103, 6434, 1046, 16150, 10085, 1012, 1001, 1001, 10651, 1058, 2692, 1012, 1016, 1012, 1017, 10651, 6412, 1058, 2692, 1012, 1016, 1012, 1016, 10651, 3191, 4168, 1012, 9108, 1011, 1011, 1011, 1001, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<html> <head> <meta http-equiv="content-type" content="text/html; charset=windows-1252" /> <title> About permissions to manage the Kaspersky Security Service </title> <link rel="stylesheet" type="text/css" href="css.css" /> <link rel="stylesheet" type="text/css" href="stylesheet.css" /> <link rel="stylesheet" type="text/css" href="stylesheet_chm.css" /> <script language="JavaScript" src="script_KL.js"></script> </head> <body id="content"> <table class="w100 h100"> <tr> <td class="header"> <table class="w100" height="30px"> <tr> <td></td> <td class="links links-icon"> <a href="javascript:printWindow();" class="bt-print" title="Print this help topic" alt="Print">Print</a> <a href="https://support.kaspersky.com" class="bt-support" title="Go to the Kaspersky Lab Technical Support website" alt="Technical Support" target="blank">Technical Support</a> <a href="https://support.kaspersky.com/docloc" class="bt-feedback" title="Leave feedback about this Help" alt="Help Feedback" target="blank">Help Feedback</a> <a href="https://help.kaspersky.com" class="bt-pdf" target="blank">Administrator's Guide</a> </td> </tr> </table> </td> </tr> <tr> <td class="h100 t" style="padding:15px 15px 0"> <h3 id="t177573" class="heading3">About permissions to manage the Kaspersky Security Service</h3> <p class="bodytext">During installation, Kaspersky Embedded Systems Security 2.2 registers Kaspersky Security Service (KAVFS) in Windows, and internally enables functional components started at operating system startup. To reduce the risk of third-party access to application functions and security settings on the protected computer through management of the Kaspersky Security Service, you can restrict permissions for managing the Kaspersky Security Service from the Application Console or the Administration Plug-in.</p> <p class="bodytext">By default, access permissions for managing the Kaspersky Security Service are granted to users in the &quot;Administrators&quot; group on the protected computer as well as to the SERVICE and INTERACTIVE groups with read permissions and to the SYSTEM group with read and execute permissions.</p> <p class="attentionbody">You cannot delete the SYSTEM user account or edit permissions for this account. If the SYSTEM user account permissions were edited, the maximum privileges are restored for this this account when you save the changes. </p> <p class="bodytext">Users who have <a id="h146765" class="crossreferencetemplate" title="About permissions to manage Kaspersky Embedded Systems Security 2.2" href="146611.html" target="_self">access to functions</a> of the Edit permissions level can grant access permissions for managing Kaspersky Security Service to other users registered on the protected computer or included in the domain.</p> <p class="bodytext">You can choose one of the following preset levels of access permissions for a user or group of users of Kaspersky Embedded Systems Security 2.2 for managing Kaspersky Security Service:</p> <ul class="listbullet1"><li class="listbullet1"><span class="guicharacter">Full control</span>: ability to view and edit general settings and user permissions for the Kaspersky Security Service, and to start and stop the Kaspersky Security Service.</li><li class="listbullet1"><span class="guicharacter">Read</span>: ability to view Kaspersky Security Service general settings and user permissions.</li><li class="listbullet1"><span class="guicharacter">Modification</span>: ability to view and edit Kaspersky Security Service general settings and user permissions.</li><li class="listbullet1"><span class="guicharacter">Execution</span>: ability to start and stop the Kaspersky Security Service.</li></ul><p class="bodytext">You can also configure advanced access permissions: allow or deny access to specific Kaspersky Embedded Systems Security 2.2 functions (see the table below).</p> <p class="bodytext">If you have manually configured access permissions for a user or group, then the <span class="boldcharacter">Special permissions</span> access level is set for this user or group.</p> <p class="tablename">Delimitation of access permissions for Kaspersky Embedded Systems Security 2.2 functions</p> <p class="spacer"></p> <table class="tableintopic" width="651" cellpadding="2" cellspacing="0" border="1" style="border-collapse:collapse; border:1px solid #010101"> <tr align="left" valign="top"> <th bgcolor="#E0E0E0" style="border:1px solid #010101;" width="222"><p class="tableheading">Feature</p> </th> <th bgcolor="#E0E0E0" style="border:1px solid #010101;" width="429"><p class="tableheading">Description</p> </th> </tr> <tr align="left" valign="top"> <td style="border:1px solid #010101;" width="222"><p class="tablebodytext">Viewing service configurations</p> </td> <td style="border:1px solid #010101;" width="429"><p class="tablebodytext">Viewing: ability to view Kaspersky Security Service general settings and user permissions.</p> </td> </tr> <tr align="left" valign="top"> <td style="border:1px solid #010101;" width="222"><p class="tablebodytext">Request service status from Service Manager</p> </td> <td style="border:1px solid #010101;" width="429"><p class="tablebodytext">Ability to request the execution status of the Kaspersky Security Service from Microsoft Windows Service Control Manager.</p> </td> </tr> <tr align="left" valign="top"> <td style="border:1px solid #010101;" width="222"><p class="tablebodytext">Request status from service</p> </td> <td style="border:1px solid #010101;" width="429"><p class="tablebodytext">Ability to request the service execution status from the Kaspersky Security Service.</p> </td> </tr> <tr align="left" valign="top"> <td style="border:1px solid #010101;" width="222"><p class="tablebodytext">List dependent services</p> </td> <td style="border:1px solid #010101;" width="429"><p class="tablebodytext">Ability to view a list of services on which the Kaspersky Security Service depends and which depend on the Kaspersky Security Service.</p> </td> </tr> <tr align="left" valign="top"> <td style="border:1px solid #010101;" width="222"><p class="tablebodytext">Editing service settings</p> </td> <td style="border:1px solid #010101;" width="429"><p class="tablebodytext">Ability to view and edit Kaspersky Security Service general settings and user permissions.</p> </td> </tr> <tr align="left" valign="top"> <td style="border:1px solid #010101;" width="222"><p class="tablebodytext">Start the service</p> </td> <td style="border:1px solid #010101;" width="429"><p class="tablebodytext">Ability to start the Kaspersky Security Service.</p> </td> </tr> <tr align="left" valign="top"> <td style="border:1px solid #010101;" width="222"><p class="tablebodytext">Stop the service</p> </td> <td style="border:1px solid #010101;" width="429"><p class="tablebodytext">Ability to stop the Kaspersky Security Service.</p> </td> </tr> <tr align="left" valign="top"> <td style="border:1px solid #010101;" width="222"><p class="tablebodytext">Pause / Resume the service</p> </td> <td style="border:1px solid #010101;" width="429"><p class="tablebodytext">Ability to pause and resume the Kaspersky Security Service.</p> </td> </tr> <tr align="left" valign="top"> <td style="border:1px solid #010101;" width="222"><p class="tablebodytext">Read permissions</p> </td> <td style="border:1px solid #010101;" width="429"><p class="tablebodytext">Ability to view the list of Kaspersky Security Service users and each user's access privileges.</p> </td> </tr> <tr align="left" valign="top"> <td style="border:1px solid #010101;" width="222"><p class="tablebodytext">Edit permissions</p> </td> <td style="border:1px solid #010101;" width="429"><p class="tablebodytext">Ability to:</p> <ul class="tablelistbullet"><li class="tablelistbullet">Add and remove Kaspersky Security Service users.</li><li class="tablelistbullet">Edit user access permissions for Kaspersky Security Service.</li></ul></td> </tr> <tr align="left" valign="top"> <td style="border:1px solid #010101;" width="222"><p class="tablebodytext">Delete the service</p> </td> <td style="border:1px solid #010101;" width="429"><p class="tablebodytext">Ability to unregister the Kaspersky Security Service in the Microsoft Windows Service Control Manager.</p> </td> </tr> <tr align="left" valign="top"> <td style="border:1px solid #010101;" width="222"><p class="tablebodytext">User defined requests to service</p> </td> <td style="border:1px solid #010101;" width="429"><p class="tablebodytext">Ability to create and send user requests to the Kaspersky Security Service.</p> </td> </tr> </table> <p class="introheading">Registering the Kaspersky Security Service as a protected service</p> <p class="bodytext"><em class="emphasischaracter">Protected Process Light</em> (also referred to as &quot;PPL&quot;) technology ensures that the operating system only loads trusted services and processes. For a service to run as a protected service, an <em class="emphasischaracter">Early Launch Antimalware </em>driver must be installed on the protected computer.</p> <p class="bodytext">An <em class="emphasischaracter">Early Launch AntiMalware</em> (also referred to as &quot;ELAM&quot;) driver provides protection for the computers in your network when they start and before third-party drivers are initialized. </p> <p class="bodytext">The ELAM driver is automatically installed during the Kaspersky Embedded Systems Security 2.2 installation and is used for registering the Kaspersky Security Service as a PPL when the operating system starts. When the Kaspersky Security Service (kavfs.exe) is started as a system protected process, other non-protected processes on the system are not able to inject threads, write into the virtual memory of the protected process, or stop the service.</p> <p class="warningbody">When a process is started as a PPL, it cannot be managed by user disregarding the assigned user permissions. The Kaspersky Security Service registration as PPL using the ELAM driver is supported on the Microsoft Windows 10 and higher operating systems. If you install Kaspersky Embedded Systems Security 2.2 on a computer running PPL-supporting operating system, the permission management for Kaspersky Security Service (KAVFS) will not be available.</p> <p class="bodytext">The Kaspersky Security Service starts all child processes as PPLs. </p> <p class="procedureheading">To install Kaspersky Embedded Systems Security 2.2 as PPL run the following command:</p> <p class="bodytextindent"><code class="programcharacter">msiexec /i ks4ws_x64.msi NOPPL=0 EULA=1 PRIVACYPOLICY=1 /qn</code></p> <p class="bodytext">You can use the command line to configure the PPL usage.</p> <p class="bodytext"></p> <p class="introheading"></p> </td> </tr> <tr> <td class="links links-icon" style="padding:15px 15px 10px"> <a href="#" class="bt-home" nowrap>Page top</a> </td> </tr> <tr> <td class="footer wrap"> <div class="fl" style="padding-left:15px"> <a href="https://www.kaspersky.com" title="Go to the Kaspersky Lab website" alt="Kaspersky Lab Logo" target="blank"><img src="who-bottom-logo.png" alt=""></a> </div> <div class="fl copy"> &copy; 2018 AO Kaspersky Lab. All Rights Reserved.<br/> <div class="fl b-menu"> <a href="https://help.kaspersky.com" target="blank" title="Go to Kaspersky Lab Online Help website">Kaspersky Online Help</a> </div> </div> </td> </tr> </table> </body> </html>
MemsourceDemo/MemsourceDemo
Directory/146612.html
HTML
gpl-3.0
11,714
[ 30522, 1026, 16129, 1028, 1026, 2132, 1028, 1026, 18804, 8299, 1011, 1041, 15549, 2615, 1027, 1000, 4180, 1011, 2828, 1000, 4180, 1027, 1000, 3793, 1013, 16129, 1025, 25869, 13462, 1027, 3645, 1011, 8732, 2475, 1000, 1013, 1028, 1026, 2516,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
class MoviesController < ApplicationController def index @movies = Movie.all.sort { |a,b| a.title <=> b.title } end def show @movie = Movie.find(params[:id]) @roles = @movie.roles.sort { |a,b| a.actor.name <=> b.actor.name } @suckr = ImageSuckr::GoogleSuckr.new end def new @movie = Movie.new end def create @movie = Movie.create(movie_params) redirect_to movie_path(@movie.id) end private def movie_params params.require(:movie).permit(:title, :year) end end
cjord01/imdb_clone
imdb/app/controllers/movies_controller.rb
Ruby
mit
491
[ 30522, 2465, 5691, 8663, 13181, 10820, 30524, 1028, 1038, 1012, 2516, 1065, 2203, 13366, 2265, 1030, 3185, 1027, 3185, 1012, 2424, 1006, 11498, 5244, 1031, 1024, 8909, 1033, 1007, 1030, 4395, 1027, 1030, 3185, 1012, 4395, 1012, 4066, 1063, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package errors func NewEmptyResourceError() *EmptyResourceError { return &EmptyResourceError{} } type EmptyResourceError struct{} func (e *EmptyResourceError) Error() string { return "EmptyResourceError" }
konjoot/reeky
errors/empty_resource.go
GO
mit
211
[ 30522, 7427, 10697, 4569, 2278, 2047, 6633, 13876, 16363, 6499, 3126, 3401, 2121, 29165, 1006, 1007, 1008, 4064, 6072, 8162, 3401, 2121, 29165, 1063, 2709, 1004, 4064, 6072, 8162, 3401, 2121, 29165, 1063, 1065, 1065, 2828, 4064, 6072, 8162,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * * Copyright (C) 2009-2011 Ali <aliov@xfce.org> * * Copyright (C) 2012-2013 Sean Davis <smd.seandavis@gmail.com> * * Copyright (C) 2012-2013 Simon Steinbeiß <ochosi@xfce.org * * Licensed under the GNU General Public License Version 2 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __PAROLE_MODULE_H #define __PAROLE_MODULE_H #include <glib-object.h> #include <src/misc/parole.h> #include "parole-plugin-player.h" G_BEGIN_DECLS #define PAROLE_TYPE_PROVIDER_MODULE (parole_provider_module_get_type () ) #define PAROLE_PROVIDER_MODULE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), PAROLE_TYPE_PROVIDER_MODULE, ParoleProviderModule)) #define PAROLE_PROVIDER_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PAROLE_TYPE_PROVIDER_MODULE, ParoleProviderModuleClass)) #define PAROLE_IS_PROVIDER_MODULE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), PAROLE_TYPE_PROVIDER_MODULE)) #define PAROLE_IS_PROVIDER_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PAROLE_TYPE_PROVIDER_MODULE)) #define PAROLE_PROVIDER_MODULE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), PAROLE_TYPE_PROVIDER_MODULE, ParoleProviderModuleClass)) typedef struct _ParoleProviderModuleClass ParoleProviderModuleClass; typedef struct _ParoleProviderModule ParoleProviderModule; struct _ParoleProviderModule { GTypeModule parent; GModule *library; ParolePluginPlayer *player; GType (*initialize) (ParoleProviderModule *module); void (*shutdown) (void); GType provider_type; gboolean active; gpointer instance; gchar *desktop_file; }; struct _ParoleProviderModuleClass { GTypeModuleClass parent_class; } ; GType parole_provider_module_get_type (void) G_GNUC_CONST; ParoleProviderModule *parole_provider_module_new (const gchar *filename, const gchar *desktop_file); gboolean parole_provider_module_new_plugin (ParoleProviderModule *module); void parole_provider_module_free_plugin (ParoleProviderModule *module); gboolean parole_provider_module_get_is_active (ParoleProviderModule *module); G_END_DECLS #endif /* __PAROLE_MODULE_H */
aquaherd/parole-mpris2
src/parole-module.h
C
gpl-2.0
3,128
[ 30522, 1013, 1008, 1008, 1008, 9385, 1006, 1039, 1007, 2268, 1011, 2249, 4862, 1026, 4862, 4492, 1030, 1060, 11329, 2063, 1012, 8917, 1028, 1008, 1008, 9385, 1006, 1039, 1007, 2262, 1011, 2286, 5977, 4482, 1026, 15488, 2094, 1012, 5977, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* maxflow.h */ /* Written by Andrew Makhorin <mao@gnu.org>, October 2015. */ #ifndef MAXFLOW_H #define MAXFLOW_H int max_flow(int nn, int ne, const int beg[/*1+ne*/], const int end[/*1+ne*/], const int cap[/*1+ne*/], int s, int t, int x[/*1+ne*/]); /* find max flow in undirected capacitated network */ int max_flow_lp(int nn, int ne, const int beg[/*1+ne*/], const int end[/*1+ne*/], const int cap[/*1+ne*/], int s, int t, int x[/*1+ne*/]); /* find max flow with simplex method */ #endif /* eof */
moves-rwth/storm
resources/3rdparty/glpk-4.65/examples/tsp/maxflow.h
C
gpl-3.0
530
[ 30522, 1013, 1008, 4098, 12314, 1012, 1044, 1008, 1013, 1013, 1008, 2517, 2011, 4080, 5003, 10023, 28741, 1026, 15158, 1030, 27004, 1012, 8917, 1028, 1010, 2255, 2325, 1012, 1008, 1013, 1001, 2065, 13629, 2546, 4098, 12314, 1035, 1044, 1001...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package fpr9.com.nbalivefeed.entities; /** * Created by FranciscoPR on 07/11/16. */ public class RecordContainer { private String id; private Record record; public String getId() { return id; } public void setId(String id) { this.id = id; } public Record getRecord() { return record; } public void setRecord(Record record) { this.record = record; } }
FranPR9/NBALIVEFEED
app/src/main/java/fpr9/com/nbalivefeed/entities/RecordContainer.java
Java
mit
430
[ 30522, 7427, 1042, 18098, 2683, 1012, 4012, 1012, 6452, 3669, 3726, 7959, 2098, 1012, 11422, 1025, 1013, 1008, 1008, 1008, 2580, 2011, 30524, 1007, 1063, 2709, 8909, 1025, 1065, 2270, 11675, 2275, 3593, 1006, 5164, 8909, 1007, 1063, 2023, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* Copyright (C) 1991,92,96,97,99,2000,2001,2009 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #ifndef _STRINGS_H #define _STRINGS_H 1 /* We don't need and should not read this file if <string.h> was already read. The one exception being that if __USE_BSD isn't defined, then these aren't defined in string.h, so we need to define them here. */ /* keep this file in sync w/ string.h, the glibc version is out of date */ #if !defined _STRING_H || !defined __USE_BSD # include <features.h> # define __need_size_t # include <stddef.h> __BEGIN_DECLS # ifdef __UCLIBC_SUSV3_LEGACY__ /* Copy N bytes of SRC to DEST (like memmove, but args reversed). */ extern void bcopy (__const void *__src, void *__dest, size_t __n) __THROW __nonnull ((1, 2)); /* Set N bytes of S to 0. */ extern void bzero (void *__s, size_t __n) __THROW __nonnull ((1)); /* Compare N bytes of S1 and S2 (same as memcmp). */ extern int bcmp (__const void *__s1, __const void *__s2, size_t __n) __THROW __attribute_pure__ __nonnull ((1, 2)); /* Find the first occurrence of C in S (same as strchr). */ extern char *index (__const char *__s, int __c) __THROW __attribute_pure__ __nonnull ((1)); /* Find the last occurrence of C in S (same as strrchr). */ extern char *rindex (__const char *__s, int __c) __THROW __attribute_pure__ __nonnull ((1)); # else # ifdef __UCLIBC_SUSV3_LEGACY_MACROS__ /* bcopy/bzero/bcmp/index/rindex are marked LEGACY in SuSv3. * They are replaced as proposed by SuSv3. Don't sync this part * with glibc and keep it in sync with string.h. */ # define bcopy(src,dest,n) (memmove((dest), (src), (n)), (void) 0) # define bzero(s,n) (memset((s), '\0', (n)), (void) 0) # define bcmp(s1,s2,n) memcmp((s1), (s2), (size_t)(n)) # define index(s,c) strchr((s), (c)) # define rindex(s,c) strrchr((s), (c)) # endif # endif /* Return the position of the first bit set in I, or 0 if none are set. The least-significant bit is position 1, the most-significant 32. */ extern int ffs (int __i) __THROW __attribute__ ((__const__)); libc_hidden_proto(ffs) /* The following two functions are non-standard but necessary for non-32 bit platforms. */ # ifdef __USE_GNU extern int ffsl (long int __l) __THROW __attribute__ ((__const__)); # ifdef __GNUC__ __extension__ extern int ffsll (long long int __ll) __THROW __attribute__ ((__const__)); # endif # endif /* Compare S1 and S2, ignoring case. */ extern int strcasecmp (__const char *__s1, __const char *__s2) __THROW __attribute_pure__ __nonnull ((1, 2)); libc_hidden_proto(strcasecmp) /* Compare no more than N chars of S1 and S2, ignoring case. */ extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n) __THROW __attribute_pure__ __nonnull ((1, 2)); libc_hidden_proto(strncasecmp) #if defined __USE_XOPEN2K8 && defined __UCLIBC_HAS_XLOCALE__ /* The following functions are equivalent to the both above but they take the locale they use for the collation as an extra argument. This is not standardsized but something like will come. */ # include <xlocale.h> /* Again versions of a few functions which use the given locale instead of the global one. */ extern int strcasecmp_l (__const char *__s1, __const char *__s2, __locale_t __loc) __THROW __attribute_pure__ __nonnull ((1, 2, 3)); libc_hidden_proto(strcasecmp_l) extern int strncasecmp_l (__const char *__s1, __const char *__s2, size_t __n, __locale_t __loc) __THROW __attribute_pure__ __nonnull ((1, 2, 4)); libc_hidden_proto(strncasecmp_l) #endif __END_DECLS #ifdef _LIBC /* comment is wrong and will face this, when HAS_GNU option will be added * header is SuSv standard */ #error "<strings.h> should not be included from libc." #endif #endif /* string.h */ #endif /* strings.h */
czankel/xtensa-uclibc
include/strings.h
C
lgpl-2.1
4,588
[ 30522, 1013, 1008, 9385, 1006, 1039, 1007, 2889, 1010, 6227, 1010, 5986, 1010, 5989, 1010, 5585, 1010, 2456, 1010, 2541, 1010, 2268, 2489, 4007, 3192, 1010, 4297, 1012, 2023, 5371, 2003, 2112, 1997, 1996, 27004, 1039, 3075, 1012, 1996, 27...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/**************************************************************************** Copyright (c) 2013-2015 scutgame.com http://www.scutgame.com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ using System; using System.Data; using ZyGames.Framework.Common; using ZyGames.Framework.Game.Service; using ZyGames.Tianjiexing.Lang; using ZyGames.Tianjiexing.Model; using ZyGames.Tianjiexing.BLL.Combat; using ZyGames.Tianjiexing.BLL.Base; using ZyGames.Tianjiexing.Model.Config; namespace ZyGames.Tianjiexing.BLL.Action { /// <summary> /// 6103_公会Boss战欲火重生接口 /// </summary> public class Action6103 : BaseAction { private const int GoldNum = 5; private const int MaxNum = 5; private int Ops; private double _reliveInspirePercent; private int _activeId; public Action6103(ZyGames.Framework.Game.Contract.HttpGet httpGet) : base(ActionIDDefine.Cst_Action6103, httpGet) { } public override void BuildPacket() { PushIntoStack((_reliveInspirePercent * 100).ToInt()); } public override bool GetUrlElement() { if (httpGet.GetInt("Ops", ref Ops, 1, 2) && httpGet.GetInt("ActiveId", ref _activeId)) { return true; } return false; } public override bool TakeAction() { if (!string.IsNullOrEmpty(ContextUser.MercenariesID)) { if (CombatHelper.GuildBossKill(ContextUser.MercenariesID)) { ErrorCode = LanguageManager.GetLang().ErrorCode; ErrorInfo = LanguageManager.GetLang().St5405_BossKilled; return false; } GuildBossCombat bossCombat = new GuildBossCombat(ContextUser.MercenariesID); UserGuild guild = bossCombat.UserGuild; if (guild != null) { if (!VipHelper.GetVipOpenFun(ContextUser.VipLv, ExpandType.BossChongSheng)) { ErrorCode = LanguageManager.GetLang().ErrorCode; ErrorInfo = LanguageManager.GetLang().St_VipNotEnoughNotFuntion; return false; } CombatStatus combatStatus = guild.CombatStatus; if (combatStatus != CombatStatus.Wait && combatStatus != CombatStatus.Combat) { ErrorCode = LanguageManager.GetLang().ErrorCode; ErrorInfo = LanguageManager.GetLang().St5402_CombatNoStart; return false; } ErrorCode = Ops; BossUser bossUser = bossCombat.GetCombatUser(Uid); if (bossUser != null && !bossUser.IsRelive) { ErrorCode = LanguageManager.GetLang().ErrorCode; ErrorInfo = LanguageManager.GetLang().St5403_IsLive; return false; } if (bossUser != null && bossUser.ReliveNum >= MaxNum) { ErrorCode = LanguageManager.GetLang().ErrorCode; ErrorInfo = LanguageManager.GetLang().St5403_IsReLiveMaxNum; return false; } int goldNum = GoldNum * (bossUser.ReliveNum + 1); if (Ops == 1) { ErrorInfo = string.Format(LanguageManager.GetLang().St5403_CombatGoldTip, goldNum); } else if (Ops == 2) { if (ContextUser.GoldNum < goldNum) { ErrorCode = LanguageManager.GetLang().ErrorCode; ErrorInfo = LanguageManager.GetLang().St_GoldNotEnough; return false; } if (bossUser != null && bossUser.IsRelive) { if (bossUser.IsRelive) { ContextUser.UseGold = MathUtils.Addition(ContextUser.UseGold, goldNum, int.MaxValue); //ContextUser.Update(); bossUser.IsRelive = false; bossUser.ReliveBeginDate = DateTime.MinValue; bossUser.ReliveInspirePercent = MathUtils.Addition(bossUser.ReliveInspirePercent, CountryCombat.InspireIncrease, 1); _reliveInspirePercent = bossUser.ReliveInspirePercent; bossUser.ReliveNum++; } } } } } return true; } } }
wenhulove333/ScutServer
Sample/Koudai/Server/src/ZyGames.Tianjiexing.BLL/Action/Action6103.cs
C#
mit
6,232
[ 30522, 1013, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/** * * app.js * * This is the entry file for the application * */ import FilmLocationSearchComponent from '../MovieSearchApp/Containers/FilmSearchContainer/FilmSearchComponent'; import AppComponent from '../CommonComponent/app.js'; import React from 'react'; import { Router, Route, IndexRoute, browserHistory } from 'react-router'; console.log("current href",window.location.href); const getAppRouter = () => { return ( <Route component={AppComponent}> <Route component={FilmLocationSearchComponent} path='/searchmovies' /> </Route> ); } export { getAppRouter }
anil26/MovieSearchGoogleMaps
js/Routes/AppRouter.js
JavaScript
mit
597
[ 30522, 1013, 1008, 1008, 1008, 1008, 10439, 1012, 1046, 2015, 1008, 1008, 2023, 2003, 1996, 4443, 5371, 2005, 1996, 4646, 1008, 1008, 1013, 12324, 2143, 4135, 10719, 17310, 11140, 9006, 29513, 3372, 2013, 1005, 1012, 1012, 1013, 5691, 14644...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#ifndef __DRV_MAILBOX_IFC_H__ #define __DRV_MAILBOX_IFC_H__ /***************************************************************************** 1 Í·Îļþ°üº¬ *****************************************************************************/ #ifdef __cplusplus #if __cplusplus extern "C" { #endif #endif /***************************************************************************** Ô¶³Ìº¯Êýµ÷ÓùæÔòÓëÔ¼Êø: *****************************************************************************/ /* Ô¶³Ìµ÷ÓýӿÚÐÎʽ²»¹Ì¶¨£¬½Ó¿Ú¶¨Ò忪·Å¸øÓû§£¬±¾Ä£¿éÌṩһÖÖ»úÖÆ: Óû§¿ÉÒÔ°´×Ô¼ºµÄʵ¼ÊÐèÒªÖ±½Ó¶¨Òå²¢Éú³ÉÈÎÒâÒ»¸öÔ¶³Ìº¯Êý£¬ÇÒ´ËÔ¶³Ìº¯ÊýÓÐÒÔÏÂÔ¼Êø£º 1. º¯ÊýµÄ·µ»ØÖµÖ»ÄÜΪlongÐÍ£¬²»ÄÜ·µ»Ø°üº¬ÆäËûÊý¾Ý³¤¶ÈµÄÖ¸Õë¡£ º¯Êýµ÷Óó¬Ê±·µ»Ø´íÎóºÅ: MAILBOX_TIME_OUT 2. º¯ÊýµÄ²ÎÊýĿǰ×î¶àÖ§³Ö6¸ö¡£ 3. º¯ÊýµÄ²ÎÊýʵ¼ÊÉ϶¼±»¿´³ÉÖ¸Õë´¦Àí£¬Ö»ÄÜÓÐÈçÏÂ7ÖÖÀàÐ͵IJÎÊý£º 1> IFC_INFIX: ¶¨³¤Ö¸ÕëÈë²Î£¬Æä´óСÔÚº¯ÊýÉú³ÉµÄʱºò±»¶¨Òå²¢ÉúЧ¡£ 2> IFC_OUTFIX: ¶¨³¤Ö¸Õë³ö²Î£¬Æä´óСÔÚº¯ÊýÉú³ÉµÄʱºò±»¶¨Òå²¢ÉúЧ¡£ 3> IFC_BIFIX: ¶¨³¤Ö¸ÕëË«²Î£¬Æä´óСÔÚº¯ÊýÉú³ÉµÄʱºò±»¶¨Òå²¢ÉúЧ¡£ 4> IFC_INVAR: ±ä³¤Ö¸ÕëÈë²Î£¬Æä´óСÓÉÏÂÒ»¸ö¹Ì¶¨´óСµÄ±äÁ¿²ÎÊý¶¨Ò壬ÔÚº¯Êý±»µ÷ÓÃʱÉúЧ¡£ 5> IFC_OUTVAR: ±ä³¤Ö¸Õë³ö²Î£¬Æä´óСÓÉÏÂÒ»¸ö¹Ì¶¨´óСµÄ±äÁ¿²ÎÊý¶¨Ò壬ÔÚº¯Êý±»µ÷ÓÃʱÉúЧ¡£ 6> IFC_BIVAR: ±ä³¤Ö¸ÕëË«²Î£¬Æä´óСÓÉÏÂÒ»¸ö¹Ì¶¨´óСµÄ±äÁ¿²ÎÊý¶¨Ò壬ÔÚº¯Êý±»µ÷ÓÃʱÉúЧ¡£ 7> IFC_INCNT: 4×Ö½Ú³£Á¿Èë²Î£¬ 4. Èç¹ûij¸ö²ÎÊýΪ¿É±ä´óС²ÎÊý£¬ÄÇôËûµÄÏÂÒ»¸ö²ÎÊý±ØÐèÊǹ̶¨´óСµÄ±äÁ¿²ÎÊý£¬²¢ÇÒºóÕßÔÚº¯Êýµ÷Óùý³ÌÖн«ÃèÊöǰÕߵĴóС¡£ 5. º¯Êýµ÷ÓÿÉÅäÖÃΪµÈ´ýºË¼ä·µ»ØµÄµ÷ÓúͲ»µÈ´ýºË¼ä·µ»ØµÄµ÷Ó㨶ªÆúʽµ÷Óã©¡£ 6. ×¢Òâ(Èë²Î+Ë«²Î)µÄ´óС»òÕß(³ö²Î+Ë«²Î)µÄ´óС²»Äܳ¬¹ýÓÊÏäµ¥¸öÓʼþµÄ×î´ó´óС¡£ */ /***************************************************************************** 1 ºê¶¨Òå *****************************************************************************/ #define IFC_IN 0x1 /*Èë²Î*/ #define IFC_OUT 0x2 /*³ö²Î*/ #define IFC_BI 0x4 /*Ë«²Î*/ #define IFC_CNT (0x1 << 8) /*ËÄ×Ö½Ú³£Á¿*/ #define IFC_FIX (0x2 << 8) /*¹Ì¶¨´óСָÕë*/ #define IFC_VAR (0x4 << 8) /*¿É±ä´óСָÕë*/ #define IFC_INCNT (IFC_IN | IFC_CNT) /*4×Ö½Ú³£Á¿Èë²Î*/ #define IFC_INFIX (IFC_IN | IFC_FIX) /*¶¨³¤Ö¸ÕëÈë²Î£¬Æä´óСÔÚº¯ÊýÉú³ÉµÄʱºò±»¶¨Òå²¢ÉúЧ¡£*/ #define IFC_OUTFIX (IFC_OUT | IFC_FIX) /*¶¨³¤Ö¸Õë³ö²Î£¬Æä´óСÔÚº¯ÊýÉú³ÉµÄʱºò±»¶¨Òå²¢ÉúЧ¡£*/ #define IFC_BIFIX (IFC_BI | IFC_FIX) /*¶¨³¤Ö¸ÕëË«²Î£¬Æä´óСÔÚº¯ÊýÉú³ÉµÄʱºò±»¶¨Òå²¢ÉúЧ¡£*/ #define IFC_INVAR (IFC_IN | IFC_VAR) /*±ä³¤Ö¸ÕëÈë²Î£¬Æä´óСÓÉÏÂÒ»¸ö¹Ì¶¨´óСµÄ±äÁ¿²ÎÊý¶¨Ò壬ÔÚº¯Êý±»µ÷ÓÃʱÉúЧ¡£*/ #define IFC_OUTVAR (IFC_OUT | IFC_VAR) /*±ä³¤Ö¸Õë³ö²Î£¬Æä´óСÓÉÏÂÒ»¸ö¹Ì¶¨´óСµÄ±äÁ¿²ÎÊý¶¨Ò壬ÔÚº¯Êý±»µ÷ÓÃʱÉúЧ¡£*/ #define IFC_BIVAR (IFC_BI | IFC_VAR) /*±ä³¤Ö¸ÕëË«²Î£¬Æä´óСÓÉÏÂÒ»¸ö¹Ì¶¨´óСµÄ±äÁ¿²ÎÊý¶¨Ò壬ÔÚº¯Êý±»µ÷ÓÃʱÉúЧ¡£*/ /*Ô¶³Ìµ÷Óú¯ÊýµÄ×î´ó²ÎÊý¸öÊý*/ #define IFC_MAX_ARG (6) #define IFC_LAUNCH 0 #define IFC_RESPONSE 1 #define IFC_INLINE static __inline #define IFC_WAIT_FOREVER (0xffffffff) #ifdef _DRV_LLT_ #define IFC_DEBUG_PARAM #endif #ifdef IFC_DEBUG_PARAM #define _ifc_chk_arg(ph, db, sb) __ifc_chk_arg(ph, db, sb) #define _ifc_dbg_arg(ph, db, sb, df) __ifc_dbg_arg(ph, db, sb, df) #else #define _ifc_chk_arg(ph, db, sb) #define _ifc_dbg_arg(ph, db, sb, df) #endif #define IFC_ALIGN sizeof(unsigned int) #define ifc_align_size(a,p) (((a)+((p)-1)) & ~((p)-1)) #ifdef _DRV_LLT_ #define C_CALL_ARG_R2L /*CÓïÑÔµ÷ÓòÎÊý´ÓÓÒµ½×ó½âÎö*/ #endif /***************************************************************************** 2 ½á¹¹Ì嶨Òå *****************************************************************************/ /*¶¨ÒåÔ¶³Ìº¯Êýµ÷ÓÃÏûϢͷÊý¾Ý½á¹¹Ìå*/ struct ifc_param { unsigned int type; /*¼Ç¼²ÎÊýÀàÐÍ£¬³ö²Î£¬Èë²ÎµÈ£¬IFC_INVAL*/ unsigned int size; /*¼Ç¼¶¨³¤²ÎÊý´óС*/ }; /*core share mem struct, don't use pointer or long*/ struct ifc_head { unsigned int scode; /* ·¢ÆðÔ¶³Ìµ÷ÓÃÓʼþ±àºÅ¡£*/ unsigned int rcode; /* Ö´Ðз½·µ»ØÊ±µÄÓʼþºÅ¡£*/ unsigned int stamp; /* ʱ¼ä´Á£¬ÓÃÓÚɸѡ³¬Ê±ÖͺóÏìÓ¦¡£*/ unsigned int retval; /* Ö´Ðз½º¯Êýµ÷Ó÷µ»ØÖµ¡£*/ unsigned int needret; /* Ö´Ðз½º¯Êýµ÷Ó÷µ»ØÖµ¡£*/ unsigned int argv[IFC_MAX_ARG];/* Ö´Ðз½º¯Êýµ÷Ó÷µ»ØÖµ,ÔÚout buffÖеı£´æµØÖ·¡£*/ unsigned int data_phy_addr; /* ÏûϢͷºÍÌî³ä¿Õ¼äÖ®ºóµÄÓû§Êý¾ÝÏßÐÔ¿Õ¼äÆðʼµØÖ·,×¢¸Ã±äÁ¿Ö»±£´æÎïÀíµØÖ·*/ #ifdef IFC_DEBUG_PARAM /*¶ÔIFCÖеĺêÖÐ ²ÎÊý½øÐе÷ÊÔ*/ struct ifc_param param_tbl[IFC_MAX_ARG]; signed int param_prob; #endif }; struct ifc_arg { unsigned long addr; /* Êä³ö²ÎÊýµØÖ· */ unsigned long size; /* Êä³ö²ÎÊý³¤¶È */ }; /*¶¨ÒåÔ¶³Ìº¯Êýµ÷ÓÃÏûϢͷÊý¾Ý½á¹¹Ìå*/ struct ifc_mb { void *mbuf; /* ÓÊÏäÓʼþµÄ×ÜÃèÊö·ûºÅ*/ struct ifc_arg argo[IFC_MAX_ARG]; /* ´æ´¢Êä³ö²ÎÊý¿Õ¼äµÄÊý×é*/ struct ifc_head head; /* ´ýдÈëÓʼþÖеÄifcÏûϢͷ*/ void *waitsem; /* µÈ´ýµ÷Ó÷µ»ØµÄÐźÅÁ¿*/ unsigned int total_size; /* ÓʼþÊý¾Ý³¤¶È£¬°üÀ¨:ifcÏûϢͷ+¿Õ°×Ìî³ä+¼ÓÊý¾ÝµÄ×ܳ¤¶È*/ unsigned int data_size; /* ifcÊý¾Ý³¤¶È,²»°üÀ¨ifcÏûϢͷºÍÌî³ä²¿·Ö*/ unsigned long data_vitrual_addr; /*64 Éý¼¶½« ifc_head ½á¹¹ÌåÖÐdata³ÉÔ±ÖÐÉæ¼°µÄµ½µÄÐéÄâµØÖ·±£´æµ½¸Ã±äÁ¿*/ }; #ifdef C_CALL_ARG_R2L /*vs pc¹¤³Ì º¯Êý²ÎÊý´ÓÓÒÍù×ó¼ÆËã*/ /*µ÷ÓúË:°ÑÊä³ö²ÎÊý±£´æÔÚÁÙʱÊý×éµÄºê*/ #define _IFC_ADD_ARG0(ary, p) #define _IFC_ADD_ARG1(ary, d1, t1, a1, s1) __ifc_arg_out(ary, d1, (unsigned long)a1, s1, 0) #define _IFC_ADD_ARG2(ary, d2, t2, a2, s2, d1, t1, a1, s1, ...) _IFC_ADD_ARG1(ary, d1, t1, a1, s1); __ifc_arg_out(ary, d2, (unsigned long)a2 ,s2, (unsigned long)a1) #define _IFC_ADD_ARG3(ary, d3, t3, a3, s3, d2, t2, a2, s2, ...) _IFC_ADD_ARG2(ary, d2, t2, a2, s2, __VA_ARGS__); __ifc_arg_out(ary, d3, (unsigned long)a3 ,s3, (unsigned long)a2) #define _IFC_ADD_ARG4(ary, d4, t4, a4, s4, d3, t3, a3, s3, ...) _IFC_ADD_ARG3(ary, d3, t3, a3, s3, __VA_ARGS__); __ifc_arg_out(ary, d4, (unsigned long)a4 ,s4, (unsigned long)a3) #define _IFC_ADD_ARG5(ary, d5, t5, a5, s5, d4, t4, a4, s4, ...) _IFC_ADD_ARG4(ary, d4, t4, a4, s4, __VA_ARGS__); __ifc_arg_out(ary, d5, (unsigned long)a5 ,s5, (unsigned long)a4) #define _IFC_ADD_ARG6(ary, d6, t6, a6, s6, d5, t5, a5, s5, ...) _IFC_ADD_ARG5(ary, d5, t5, a5, s5, __VA_ARGS__); __ifc_arg_out(ary, d6, (unsigned long)a6 ,s6, (unsigned long)a5) /*µ÷ÓúË: °ÑÊäÈë²ÎÊýѹÈëÓÊÏäÓû§Êý¾Ý»º´æµÄºê*/ /*ÍùÓÊÏäbufÍÆÈëÊý¾Ý,ͬʱ°Ñ·µ»Ø²ÎÊýµØÖ·ÔÝ´æ*/ /*°´x86 cÓïÑÔµ÷Óù淶£¬´ÓÓÒÍù×óѹ²ÎÊý*/ #define _IFC_PUSHDATA0(d, av, p) #define _IFC_PUSHDATA1(d, av, d1, t1, a1, s1) __ifc_push_arg(d, av, d1, (unsigned long)a1, s1, 0) #define _IFC_PUSHDATA2(d, av, d2, t2, a2, s2, d1, t1, a1, s1) _IFC_PUSHDATA1(d, av, d1, t1, a1, s1); __ifc_push_arg(d, av, d2, (unsigned long)a2 ,s2, (unsigned long)a1) #define _IFC_PUSHDATA3(d, av, d3, t3, a3, s3, d2, t2, a2, s2,...) _IFC_PUSHDATA2(d, av, d2, t2, a2, s2, __VA_ARGS__); __ifc_push_arg(d, av, d3, (unsigned long)a3 ,s3, (unsigned long)a2) #define _IFC_PUSHDATA4(d, av, d4, t4, a4, s4, d3, t3, a3, s3,...) _IFC_PUSHDATA3(d, av, d3, t3, a3, s3, __VA_ARGS__); __ifc_push_arg(d, av, d4, (unsigned long)a4 ,s4, (unsigned long)a3) #define _IFC_PUSHDATA5(d, av, d5, t5, a5, s5, d4, t4, a4, s4,...) _IFC_PUSHDATA4(d, av, d4, t4, a4, s4, __VA_ARGS__); __ifc_push_arg(d, av, d5, (unsigned long)a5 ,s5, (unsigned long)a4) #define _IFC_PUSHDATA6(d, av, d6, t6, a6, s6, d5, t5, a5, s5,...) _IFC_PUSHDATA5(d, av, d5, t5, a5, s5, __VA_ARGS__); __ifc_push_arg(d, av, d6, (unsigned long)a6 ,s6, (unsigned long)a5) /*Ö´ÐкË: °ÑË«Ïò²ÎÊý´ÓÊäÈ뻺´æ¿½±´µ½Êä³ö»º´æµÄºê*/ #define _IFC_PCOPY0(in, out, av, ao, p) #define _IFC_PCOPY1(in, out, av, ao, d1, t1, a1, s1) __ifc_copy_arg(in, out, d1, s1, av, ao) #define _IFC_PCOPY2(in, out, av, ao, d2, t2, a2, s2, d1, t1, a1, s1) _IFC_PCOPY1(in, out, av, ao, d1, t1, a1, s1); __ifc_copy_arg(in, out, d2, s2, av, ao) #define _IFC_PCOPY3(in, out, av, ao, d3, t3, a3, s3, d2, t2, a2, s2, ...) _IFC_PCOPY2(in, out, av, ao, d2, t2, a2, s2, __VA_ARGS__); __ifc_copy_arg(in, out, d3, s3, av, ao) #define _IFC_PCOPY4(in, out, av, ao, d4, t4, a4, s4, d3, t3, a3, s3, ...) _IFC_PCOPY3(in, out, av, ao, d3, t3, a3, s3, __VA_ARGS__); __ifc_copy_arg(in, out, d4, s4, av, ao) #define _IFC_PCOPY5(in, out, av, ao, d5, t5, a5, s5, d4, t4, a4, s4, ...) _IFC_PCOPY4(in, out, av, ao, d4, t4, a4, s4, __VA_ARGS__); __ifc_copy_arg(in, out, d5, s5, av, ao) #define _IFC_PCOPY6(in, out, av, ao, d6, t6, a6, s6, d5, t5, a5, s5, ...) _IFC_PCOPY5(in, out, av, ao, d5, t5, a5, s5, __VA_ARGS__); __ifc_copy_arg(in, out, d6, s6, av, ao) /*Ö´ÐкË:¼ÆË㺯ÊýÊä³ö²ÎÊý×Ü´óСµÄºê*/ #define _IFC_OUTSIZE0(av, p) 0 #define _IFC_OUTSIZE1(av, d1, t1, a1, s1) __ifc_out_size(d1, s1, av) #define _IFC_OUTSIZE2(av, d2, t2, a2, s2, d1, t1, a1, s1) _IFC_OUTSIZE1(av, d1, t1, a1, s1) + __ifc_out_size(d2, s2, av) #define _IFC_OUTSIZE3(av, d3, t3, a3, s3, d2, t2, a2, s2,...) _IFC_OUTSIZE2(av, d2, t2, a2, s2, __VA_ARGS__) + __ifc_out_size(d3, s3, av) #define _IFC_OUTSIZE4(av, d4, t4, a4, s4, d3, t3, a3, s3,...) _IFC_OUTSIZE3(av, d3, t3, a3, s3, __VA_ARGS__) + __ifc_out_size(d4, s4, av) #define _IFC_OUTSIZE5(av, d5, t5, a5, s5, d4, t4, a4, s4,...) _IFC_OUTSIZE4(av, d4, t4, a4, s4, __VA_ARGS__) + __ifc_out_size(d5, s5, av) #define _IFC_OUTSIZE6(av, d6, t6, a6, s6, d5, t5, a5, s5,...) _IFC_OUTSIZE5(av, d5, t5, a5, s5, __VA_ARGS__) + __ifc_out_size(d6, s6, av) #else /*µ÷ÓúË:µ¥°ågcc±àÒ뺯Êý²ÎÊý´Ó×óÍùÓÒ¼ÆËã*/ /*°ÑÊä³ö²ÎÊý±£´æÔÚÁÙʱÊý×éµÄºê*/ #define _IFC_ADD_ARG0(ary, p) #define _IFC_ADD_ARG1(ary, d1, t1, a1, s1) __ifc_arg_out(ary, d1, (unsigned long)a1, s1, 0) #define _IFC_ADD_ARG2(ary, d2, t2, a2, s2, d1, t1, a1, s1, ...) __ifc_arg_out(ary, d2, (unsigned long)a2 ,s2, (unsigned long)a1); _IFC_ADD_ARG1(ary, d1, t1, a1, s1) #define _IFC_ADD_ARG3(ary, d3, t3, a3, s3, d2, t2, a2, s2, ...) __ifc_arg_out(ary, d3, (unsigned long)a3 ,s3, (unsigned long)a2); _IFC_ADD_ARG2(ary, d2, t2, a2, s2, __VA_ARGS__) #define _IFC_ADD_ARG4(ary, d4, t4, a4, s4, d3, t3, a3, s3, ...) __ifc_arg_out(ary, d4, (unsigned long)a4 ,s4, (unsigned long)a3); _IFC_ADD_ARG3(ary, d3, t3, a3, s3, __VA_ARGS__) #define _IFC_ADD_ARG5(ary, d5, t5, a5, s5, d4, t4, a4, s4, ...) __ifc_arg_out(ary, d5, (unsigned long)a5 ,s5, (unsigned long)a4); _IFC_ADD_ARG4(ary, d4, t4, a4, s4, __VA_ARGS__) #define _IFC_ADD_ARG6(ary, d6, t6, a6, s6, d5, t5, a5, s5, ...) __ifc_arg_out(ary, d6, (unsigned long)a6 ,s6, (unsigned long)a5); _IFC_ADD_ARG5(ary, d5, t5, a5, s5, __VA_ARGS__) /*µ÷ÓúË:°ÑÊäÈë²ÎÊýѹÈëÓÊÏäÓû§Êý¾Ý»º´æµÄºê*/ /*ÍùÓÊÏäbufÍÆÈëÊý¾Ý,ͬʱ°Ñ·µ»Ø²ÎÊýµØÖ·ÔÝ´æ*/ /*°´arm cÓïÑÔµ÷Óù淶£¬´Ó×óÍùÓÒѹ²ÎÊý*/ #define _IFC_PUSHDATA0(d, av, p) #define _IFC_PUSHDATA1(d, av, d1, t1, a1, s1) __ifc_push_arg(d, av, d1, (unsigned long)a1, s1, 0) #define _IFC_PUSHDATA2(d, av, d2, t2, a2, s2, d1, t1, a1, s1) __ifc_push_arg(d, av, d2, (unsigned long)a2 ,s2, (unsigned long)a1); _IFC_PUSHDATA1(d, av, d1, t1, a1, s1) #define _IFC_PUSHDATA3(d, av, d3, t3, a3, s3, d2, t2, a2, s2,...) __ifc_push_arg(d, av, d3, (unsigned long)a3 ,s3, (unsigned long)a2); _IFC_PUSHDATA2(d, av, d2, t2, a2, s2, __VA_ARGS__) #define _IFC_PUSHDATA4(d, av, d4, t4, a4, s4, d3, t3, a3, s3,...) __ifc_push_arg(d, av, d4, (unsigned long)a4 ,s4, (unsigned long)a3); _IFC_PUSHDATA3(d, av, d3, t3, a3, s3, __VA_ARGS__) #define _IFC_PUSHDATA5(d, av, d5, t5, a5, s5, d4, t4, a4, s4,...) __ifc_push_arg(d, av, d5, (unsigned long)a5 ,s5, (unsigned long)a4); _IFC_PUSHDATA4(d, av, d4, t4, a4, s4, __VA_ARGS__) #define _IFC_PUSHDATA6(d, av, d6, t6, a6, s6, d5, t5, a5, s5,...) __ifc_push_arg(d, av, d6, (unsigned long)a6 ,s6, (unsigned long)a5); _IFC_PUSHDATA5(d, av, d5, t5, a5, s5, __VA_ARGS__) /*Ö´ÐкË:°ÑË«Ïò²ÎÊý´ÓÊäÈ뻺´æ¿½±´µ½Êä³ö»º´æµÄºê*/ #define _IFC_PCOPY0(in, out, av, ao, p) #define _IFC_PCOPY1(in, out, av, ao, d1, t1, a1, s1) __ifc_copy_arg(in, out, d1, s1, av, ao) #define _IFC_PCOPY2(in, out, av, ao, d2, t2, a2, s2, d1, t1, a1, s1) __ifc_copy_arg(in, out, d2, s2, av, ao); _IFC_PCOPY1(in, out, av, ao, d1, t1, a1, s1) #define _IFC_PCOPY3(in, out, av, ao, d3, t3, a3, s3, d2, t2, a2, s2, ...) __ifc_copy_arg(in, out, d3, s3, av, ao); _IFC_PCOPY2(in, out, av, ao, d2, t2, a2, s2, __VA_ARGS__) #define _IFC_PCOPY4(in, out, av, ao, d4, t4, a4, s4, d3, t3, a3, s3, ...) __ifc_copy_arg(in, out, d4, s4, av, ao); _IFC_PCOPY3(in, out, av, ao, d3, t3, a3, s3, __VA_ARGS__) #define _IFC_PCOPY5(in, out, av, ao, d5, t5, a5, s5, d4, t4, a4, s4, ...) __ifc_copy_arg(in, out, d5, s5, av, ao); _IFC_PCOPY4(in, out, av, ao, d4, t4, a4, s4, __VA_ARGS__) #define _IFC_PCOPY6(in, out, av, ao, d6, t6, a6, s6, d5, t5, a5, s5, ...) __ifc_copy_arg(in, out, d6, s6, av, ao); _IFC_PCOPY5(in, out, av, ao, d5, t5, a5, s5, __VA_ARGS__) /*Ö´ÐкË:¼ÆË㺯ÊýÊä³ö²ÎÊý×Ü´óСµÄºê*/ #define _IFC_OUTSIZE0(av, p) 0 #define _IFC_OUTSIZE1(av, d1, t1, a1, s1) __ifc_out_size(d1, s1, av) #define _IFC_OUTSIZE2(av, d2, t2, a2, s2, d1, t1, a1, s1) __ifc_out_size(d2, s2, av) + _IFC_OUTSIZE1(av, d1, t1, a1, s1) #define _IFC_OUTSIZE3(av, d3, t3, a3, s3, d2, t2, a2, s2,...) __ifc_out_size(d3, s3, av) + _IFC_OUTSIZE2(av, d2, t2, a2, s2, __VA_ARGS__) #define _IFC_OUTSIZE4(av, d4, t4, a4, s4, d3, t3, a3, s3,...) __ifc_out_size(d4, s4, av) + _IFC_OUTSIZE3(av, d3, t3, a3, s3, __VA_ARGS__) #define _IFC_OUTSIZE5(av, d5, t5, a5, s5, d4, t4, a4, s4,...) __ifc_out_size(d5, s5, av) + _IFC_OUTSIZE4(av, d4, t4, a4, s4, __VA_ARGS__) #define _IFC_OUTSIZE6(av, d6, t6, a6, s6, d5, t5, a5, s5,...) __ifc_out_size(d6, s6, av) + _IFC_OUTSIZE5(av, d5, t5, a5, s5, __VA_ARGS__) #endif /*Ö´ÐкË:Éú³ÉÔ¶³ÌÖ´Ðк¯Êý²ÎÊýÖ¸ÕëµØÖ·µÄºê*/ #define _IFC_PARAM0(in, out, av, p) #define _IFC_PARAM1(in, out, av, d1, t1, a1, s1) (t1)__ifc_gen_arg(in, out, d1, s1, av) #define _IFC_PARAM2(in, out, av, d2, t2, a2, s2, d1, t1, a1, s1) (t2)__ifc_gen_arg(in, out, d2, s2, av), _IFC_PARAM1(in, out, av, d1, t1, a1, s1) #define _IFC_PARAM3(in, out, av, d3, t3, a3, s3, d2, t2, a2, s2, ...) (t3)__ifc_gen_arg(in, out, d3, s3, av), _IFC_PARAM2(in, out, av, d2, t2, a2, s2, __VA_ARGS__) #define _IFC_PARAM4(in, out, av, d4, t4, a4, s4, d3, t3, a3, s3, ...) (t4)__ifc_gen_arg(in, out, d4, s4, av), _IFC_PARAM3(in, out, av, d3, t3, a3, s3, __VA_ARGS__) #define _IFC_PARAM5(in, out, av, d5, t5, a5, s5, d4, t4, a4, s4, ...) (t5)__ifc_gen_arg(in, out, d5, s5, av), _IFC_PARAM4(in, out, av, d4, t4, a4, s4, __VA_ARGS__) #define _IFC_PARAM6(in, out, av, d6, t6, a6, s6, d5, t5, a5, s5, ...) (t6)__ifc_gen_arg(in, out, d6, s6, av), _IFC_PARAM5(in, out, av, d5, t5, a5, s5, __VA_ARGS__) /*µ÷ÓúË:Éú³Éº¯ÊýÉùÃ÷ÖеIJÎÊýµÄºê*/ #define _IFC_DECL0(p) /*void*/ #define _IFC_DECL1(d1, t1, a1, s1) t1 a1, #define _IFC_DECL2(d2, t2, a2, s2, ...) t2 a2, _IFC_DECL1(__VA_ARGS__) #define _IFC_DECL3(d3, t3, a3, s3, ...) t3 a3, _IFC_DECL2(__VA_ARGS__) #define _IFC_DECL4(d4, t4, a4, s4, ...) t4 a4, _IFC_DECL3(__VA_ARGS__) #define _IFC_DECL5(d5, t5, a5, s5, ...) t5 a5, _IFC_DECL4(__VA_ARGS__) #define _IFC_DECL6(d6, t6, a6, s6, ...) t6 a6, _IFC_DECL5(__VA_ARGS__) /*µ÷ÓúË:¼ÆËãÊäÈë²ÎÊý×Ü´óСµÄºê*/ #define _IFC_INSIZE0(p) 0 #define _IFC_INSIZE1(d1, t1, a1, s1) __ifc_in_size(d1, s1, 0) #define _IFC_INSIZE2(d2, t2, a2, s2, d1, t1, a1, s1) _IFC_INSIZE1(d1, t1, a1, s1) + __ifc_in_size(d2, s2, (unsigned long)a1) #define _IFC_INSIZE3(d3, t3, a3, s3, d2, t2, a2, s2,...) _IFC_INSIZE2(d2, t2, a2, s2, __VA_ARGS__) + __ifc_in_size(d3, s3, (unsigned long)a2) #define _IFC_INSIZE4(d4, t4, a4, s4, d3, t3, a3, s3,...) _IFC_INSIZE3(d3, t3, a3, s3, __VA_ARGS__) + __ifc_in_size(d4, s4, (unsigned long)a3) #define _IFC_INSIZE5(d5, t5, a5, s5, d4, t4, a4, s4,...) _IFC_INSIZE4(d4, t4, a4, s4, __VA_ARGS__) + __ifc_in_size(d5, s5, (unsigned long)a4) #define _IFC_INSIZE6(d6, t6, a6, s6, d5, t5, a5, s5,...) _IFC_INSIZE5(d5, t5, a5, s5, __VA_ARGS__) + __ifc_in_size(d6, s6, (unsigned long)a5) /*µ÷ÓúË:±£´æ²¢¼ì²é²ÎÊý*/ #define _IFC_DBGPARAM0(p, a) #define _IFC_DBGPARAM1(ph, d1, t1, a1, s1) _ifc_dbg_arg(ph, d1, s1, 0) #define _IFC_DBGPARAM2(ph, d2, t2, a2, s2, d1, t1, a1, s1) _IFC_DBGPARAM1(ph, d1, t1, a1, s1) ; _ifc_dbg_arg(ph, d2, s2, d1) #define _IFC_DBGPARAM3(ph, d3, t3, a3, s3, d2, t2, a2, s2,...) _IFC_DBGPARAM2(ph, d2, t2, a2, s2, __VA_ARGS__); _ifc_dbg_arg(ph, d3, s3, d2) #define _IFC_DBGPARAM4(ph, d4, t4, a4, s4, d3, t3, a3, s3,...) _IFC_DBGPARAM3(ph, d3, t3, a3, s3, __VA_ARGS__); _ifc_dbg_arg(ph, d4, s4, d3) #define _IFC_DBGPARAM5(ph, d5, t5, a5, s5, d4, t4, a4, s4,...) _IFC_DBGPARAM4(ph, d4, t4, a4, s4, __VA_ARGS__); _ifc_dbg_arg(ph, d5, s5, d4) #define _IFC_DBGPARAM6(ph, d6, t6, a6, s6, d5, t5, a5, s5,...) _IFC_DBGPARAM5(ph, d5, t5, a5, s5, __VA_ARGS__); _ifc_dbg_arg(ph, d6, s6, d5) /*Ö´ÐкË:¼ì²é²ÎÊý*/ #define _IFC_CHKPARAM0(p, a) #define _IFC_CHKPARAM1(ph, d1, t1, a1, s1) _ifc_chk_arg(ph, d1, s1) #define _IFC_CHKPARAM2(ph, d2, t2, a2, s2, d1, t1, a1, s1) _ifc_chk_arg(ph, d2, s2); _IFC_CHKPARAM1(ph, d1, t1, a1, s1) #define _IFC_CHKPARAM3(ph, d3, t3, a3, s3, d2, t2, a2, s2,...) _ifc_chk_arg(ph, d3, s3); _IFC_CHKPARAM2(ph, d2, t2, a2, s2, __VA_ARGS__) #define _IFC_CHKPARAM4(ph, d4, t4, a4, s4, d3, t3, a3, s3,...) _ifc_chk_arg(ph, d4, s4); _IFC_CHKPARAM3(ph, d3, t3, a3, s3, __VA_ARGS__) #define _IFC_CHKPARAM5(ph, d5, t5, a5, s5, d4, t4, a4, s4,...) _ifc_chk_arg(ph, d5, s5); _IFC_CHKPARAM4(ph, d4, t4, a4, s4, __VA_ARGS__) #define _IFC_CHKPARAM6(ph, d6, t6, a6, s6, d5, t5, a5, s5,...) _ifc_chk_arg(ph, d6, s6); _IFC_CHKPARAM5(ph, d5, t5, a5, s5, __VA_ARGS__) /*Ö´ÐкË:Éú³ÉÔ¶³Ìµ÷ÓÃÖ´Ðк¯ÊýÃû*/ #define IFC_GEN_EXEC_NAME(name) ife_##name #ifdef _DRV_LLT_ #define _IFC_GEN_CALLx(x, id, name, ...) \ int name(_IFC_DECL##x(__VA_ARGS__) unsigned int timeout ){return 0;} #define __IFC_GEN_EXECx(x, name, ...) \ int IFC_GEN_EXEC_NAME(name)(struct ifc_head * ifc_h) {return 0;} #else /*µ÷ÓúË:Éú³ÉÔ¶³Ìº¯Êýµ÷ÓÃÕߵĺê*/ #define _IFC_GEN_CALLx(x, id, name, ...) \ int name(_IFC_DECL##x(__VA_ARGS__) unsigned int timeout ) \ { \ struct ifc_mb ifc_b; \ struct ifc_arg *argo = ifc_b.argo; \ unsigned long in_buf; \ int ret_val; \ unsigned int *argv = ifc_b.head.argv; /*´Ë·½·¨ÐèÒª¿¼ÂDZàÒëÆ÷Ö´ÐÐ˳Ðò²îÒì*/ \ unsigned int in_size = (unsigned int)(_IFC_INSIZE##x(__VA_ARGS__)); \ argo=argo; argv=argv; \ ret_val = mailbox_ifc_init_buf(&ifc_b, id, IFC_LAUNCH, in_size, timeout); \ if (ret_val) return ret_val; \ in_buf = ifc_b.data_vitrual_addr; \ _IFC_DBGPARAM##x(&ifc_b.head, __VA_ARGS__); /*²ÎÊýµ÷ÊÔÈë¿Ú*/ \ _IFC_PUSHDATA##x(&in_buf, &argv, __VA_ARGS__); /*ÍùÓÊÏäbufÍÆÈëÊý¾Ý,ͬʱ°Ñ·µ»Ø²ÎÊýµØÖ·ÔÝ´æ*/ \ if (timeout) { /*ÐèÒªµÈ´ý·µ»Ø*/ \ _IFC_ADD_ARG##x(&argo, __VA_ARGS__); /* °Ñ·µ»ØÖµºÍ³ö²ÎµÄµØÖ·¼ÓÈ뱾ͨµÀµÄ»ØÊÕÓʼþÏûÏ¢Á´±í£¬ÓÃÓÚ»ñÈ¡·µ»ØÏûÏ¢Öеijö²ÎÖµ*/ \ return mailbox_ifc_send_wait(&ifc_b, timeout); /*µÈ´ý»ØÊÕµ÷Ó÷µ»ØÏûÏ¢Íê³É£¬*/ \ } \ else \ return mailbox_ifc_send_no_wait(&ifc_b); /*²»ÐèÒªµÈ´ý·µ»Ø*/ \ } /*Ö´ÐкË:Éú³ÉÔ¶³Ìµ÷ÓÃÖ´Ðк¯ÊýÌå,×¢ÒâÖ´Ðк¯Êýname±ØÐëÊÇÓзµ»ØÖµµÄ(²»ÄÜÊÇvoidÐÍ£¬·ñÔò±àÒë²»¹ý)*/ #define __IFC_GEN_EXECx(x, name, ...) \ int IFC_GEN_EXEC_NAME(name)(struct ifc_head * ifc_h) \ { \ struct ifc_mb ifc_b; \ unsigned long in_b, out_b; \ unsigned int *argv = ifc_h->argv; /*ÐèÒª¿¼ÂDZàÒëÆ÷Ö´ÐÐ˳Ðò²îÒì*/ \ unsigned int *argo; \ unsigned int out_size = (unsigned int)(_IFC_OUTSIZE##x(&argv,__VA_ARGS__)); \ if (mailbox_ifc_init_buf(&ifc_b, ifc_h->rcode, IFC_RESPONSE, out_size , 0)) return (int)MAILBOX_ERRO; \ out_b = ifc_b.data_vitrual_addr; argv = ifc_h->argv; \ in_b = (unsigned long)mailbox_phy_to_virt((unsigned long)(ifc_h->data_phy_addr)); \ _IFC_CHKPARAM##x(ifc_h, __VA_ARGS__); /*¼ì²éµ÷Ó÷½µÄ²ÎÊýÅäÖÃÊÇ·ñºÍÖ´Ðз½Ò»Ö£¬²¢ÇÒ¼ì²é²ÎÊýÊÇ·ñ·ûºÏ¹æ·¶*/ \ ifc_b.head.retval = (unsigned int)name(_IFC_PARAM##x(&in_b, &out_b, &argv, __VA_ARGS__)); \ if (ifc_h->needret) { /*ÐèÒªµÈ´ý·µ»Ø*/ \ out_b = ifc_b.data_vitrual_addr; ifc_b.head.stamp = ifc_h->stamp; /*·µ»ØÊ±¼ä´ÁÓÃÓÚУÑé*/ \ in_b = (unsigned long)mailbox_phy_to_virt((unsigned long)(ifc_h->data_phy_addr)); \ argv = ifc_h->argv; /*ÊäÈë²ÎÊý*/ argo = ifc_b.head.argv; /*Êä³ö²ÎÊý*/ \ _IFC_PCOPY##x(&in_b, &out_b, &argv, &argo, __VA_ARGS__); /*°ÑË«²Î´Óinbuf¿½±´µ½outbuf*/ \ return mailbox_ifc_send_no_wait(&ifc_b); /*ÏûÏ¢×Ü´óСд»ØÓʼþÍ·£¬½âËø²¢ÇÒ·¢ËÍÊý¾Ý*/ \ } \ else \ return mailbox_ifc_discard_buf(&ifc_b); /*È¡ÏûÓÊÏäbuff£¬½âËø²¢¶ªÆú´Ë´Î·¢ËÍ*/ \ } #endif extern int mailbox_ifc_init_buf( struct ifc_mb *ifc_b, unsigned int mailcode, unsigned int direct, unsigned int inlen, unsigned int timeout); extern int mailbox_ifc_send_no_wait(struct ifc_mb *ifc_b); extern int mailbox_ifc_wait_resp(struct ifc_mb *ifc_b); extern int mailbox_ifc_discard_buf(struct ifc_mb *ifc_b); extern int mailbox_ifc_send_wait(struct ifc_mb *ifc_b, unsigned int timeout); extern int mailbox_ifc_register_exec( unsigned int mailcode, int (*ife_cb)(struct ifc_head * ifc_h) ); extern void __ifc_arg_out(struct ifc_arg ** p_ary, unsigned int db, unsigned long ab, unsigned int sb, unsigned int af); extern void __ifc_push_arg(unsigned long * in, unsigned int ** p_av, unsigned int db, unsigned long ab, unsigned int sb, unsigned int af); extern int __ifc_in_size(unsigned int db, unsigned int sb, unsigned int af); extern void __ifc_dbg_arg(struct ifc_head *head, unsigned int db, unsigned int sb, unsigned int df); extern int __ifc_out_size(unsigned int db, unsigned int sb, unsigned int **pp_af); extern long __ifc_gen_arg(unsigned long *in, unsigned long *out, unsigned int db, unsigned int sb, unsigned int **pp_a); extern void __ifc_copy_arg(unsigned long *in, unsigned long *out, unsigned int db, unsigned int sb, unsigned int **p_av , unsigned int **p_ao); extern void __ifc_chk_arg(struct ifc_head *head, unsigned int db, unsigned int sb); extern long mailbox_phy_to_virt(unsigned long phy_addr); #ifdef __cplusplus #if __cplusplus } #endif #endif #endif /*end of __DRV_MAILBOX_IFC_H__*/
gabry3795/android_kernel_huawei_mt7_l09
drivers/hisi/mailbox/hi6xxx_mailbox/drv_mailbox_ifc.h
C
gpl-2.0
25,905
[ 30522, 1001, 2065, 13629, 2546, 1035, 1035, 2852, 2615, 1035, 5653, 8758, 1035, 2065, 2278, 1035, 1044, 1035, 1035, 1001, 9375, 1035, 1035, 2852, 2615, 1035, 5653, 8758, 1035, 2065, 2278, 1035, 1044, 1035, 1035, 1013, 1008, 1008, 1008, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package org.jtrim2.swing.component; import java.util.Collections; import org.jtrim2.image.transform.ZoomToFitOption; import org.junit.Test; public class TransformationAdapterTest { /** * Not much to test but that the methods does not throw exceptions. */ @Test public void testMethods() { TransformationAdapterImpl listener = new TransformationAdapterImpl(); listener.enterZoomToFitMode(Collections.<ZoomToFitOption>emptySet()); listener.flipChanged(); listener.leaveZoomToFitMode(); listener.offsetChanged(); listener.rotateChanged(); listener.zoomChanged(); } public class TransformationAdapterImpl extends TransformationAdapter { } }
kelemen/JTrim
subprojects/jtrim-swing-component/src/test/java/org/jtrim2/swing/component/TransformationAdapterTest.java
Java
apache-2.0
731
[ 30522, 7427, 8917, 1012, 1046, 18886, 2213, 2475, 1012, 7370, 1012, 6922, 1025, 12324, 9262, 1012, 21183, 4014, 1012, 6407, 1025, 12324, 8917, 1012, 1046, 18886, 2213, 2475, 1012, 3746, 1012, 10938, 1012, 24095, 3406, 8873, 14399, 3508, 102...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# SecuML # Copyright (C) 2016-2017 ANSSI # # SecuML is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # SecuML 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 SecuML. If not, see <http://www.gnu.org/licenses/>. import copy import pandas as pd import scipy from SecuML.core.Tools import matrix_tools from .AnnotationQuery import AnnotationQuery class Category(object): def __init__(self, label=None, family=None): self.assignLabelFamily(label, family) self.instances_ids = [] self.probas = [] self.entropy = [] self.likelihood = [] self.df = None self.annotation_queries = {} self.annotated_instances = [] self.num_annotated_instances = 0 # To display the annotation queries in the web GUI self.queries = [] self.queries_confidence = [] def generateAnnotationQuery(self, instance_id, predicted_proba, suggested_label, suggested_family, confidence=None): return AnnotationQuery(instance_id, predicted_proba, suggested_label, suggested_family, confidence=confidence) def assignLabelFamily(self, label, family): self.family = family if label != 'all': self.label = label else: self.label = label def numInstances(self): return len(self.instances_ids) def setWeight(self, weight): self.weight = weight def setNumAnnotations(self, num_annotations): self.num_annotations = num_annotations def addInstance(self, instance_id, probas, annotated): self.instances_ids.append(instance_id) entropy = None proba = None likelihood = None if probas is not None: entropy = scipy.stats.entropy(probas) proba = max(probas) self.entropy.append(entropy) self.probas.append(proba) self.likelihood.append(likelihood) if annotated: self.annotated_instances.append(instance_id) self.num_annotated_instances += 1 def finalComputation(self): self.df = pd.DataFrame({'proba': self.probas, 'entropy': self.entropy, 'likelihood': self.likelihood}, index=list(map(str, self.instances_ids))) def annotateAuto(self, iteration): for k, queries in self.annotation_queries.items(): for q, query in enumerate(queries): query.annotateAuto(iteration, self.label) def getManualAnnotations(self, iteration): for k, queries in self.annotation_queries.items(): for q, query in enumerate(queries): query.getManualAnnotation(iteration) def checkAnnotationQueriesAnswered(self, iteration): for k, queries in self.annotation_queries.items(): for q, query in enumerate(queries): if not query.checkAnswered(iteration): return False return True def setLikelihood(self, likelihood): self.likelihood = likelihood self.df['likelihood'] = likelihood def getLikelihood(self, instances): df = pd.DataFrame({'likelihood': self.likelihood}, index=list(map(str, self.instances_ids))) selected_df = df.loc[list(map(str, instances)), :] return selected_df['likelihood'].tolist() def getCategoryLabel(self): return self.label def getCategoryFamily(self): return self.family def toJson(self): obj = {} obj['label'] = self.label obj['family'] = self.family obj['annotation_queries'] = {} for kind, queries in self.annotation_queries.items(): obj['annotation_queries'][kind] = [] for q, query in enumerate(queries): obj['annotation_queries'][kind].append(query.toJson()) return obj @staticmethod def fromJson(obj): category = Category() category.instances_ids = obj['instances_ids'] category.label = obj['label'] return category def exportAnnotationQueries(self): annotation_queries = {} annotation_queries['instance_ids'] = self.queries annotation_queries['confidence'] = self.queries_confidence annotation_queries['label'] = self.label return annotation_queries def generateAnnotationQueries(self, cluster_strategy): queries_types = cluster_strategy.split('_') num_queries_types = len(queries_types) total_num_queries = 0 annotated_instances = copy.deepcopy(self.annotated_instances) for q, queries_type in enumerate(queries_types): if q == (num_queries_types - 1): num_queries = self.num_annotations - total_num_queries else: num_queries = self.num_annotations // num_queries_types if queries_type == 'center': queries = self.queryHighLikelihoodInstances( annotated_instances, num_queries) elif queries_type == 'anomalous': queries = self.queryLowLikelihoodInstances( annotated_instances, num_queries) elif queries_type == 'uncertain': queries = self.queryUncertainInstances( annotated_instances, num_queries) elif queries_type == 'random': queries = self.queryRandomInstances( annotated_instances, num_queries) else: raise ValueError() annotated_instances += queries total_num_queries += len(queries) assert(total_num_queries == self.num_annotations) def queryUncertainInstances(self, drop_instances, num_instances): if num_instances == 0: return [] queries_df = self.getSelectedInstancesDataframe(drop_instances) matrix_tools.sortDataFrame(queries_df, 'entropy', False, True) queries_df = queries_df.head(num_instances) self.addAnnotationQueries('uncertain', 'low', queries_df) return list(map(int, queries_df.index.values.tolist())) def queryHighLikelihoodInstances(self, drop_instances, num_instances): if num_instances == 0: return [] queries_df = self.getSelectedInstancesDataframe(drop_instances) matrix_tools.sortDataFrame(queries_df, 'likelihood', False, True) queries_df = queries_df.head(num_instances) self.addAnnotationQueries('high_likelihood', 'high', queries_df) return list(map(int, queries_df.index.values.tolist())) def queryLowLikelihoodInstances(self, drop_instances, num_instances): if num_instances == 0: return [] queries_df = self.getSelectedInstancesDataframe(drop_instances) matrix_tools.sortDataFrame(queries_df, 'likelihood', True, True) queries_df = queries_df.head(num_instances) self.addAnnotationQueries('low_likelihood', 'low', queries_df) return list(map(int, queries_df.index.values.tolist())) def queryRandomInstances(self, drop_instances, num_instances): if num_instances == 0: return [] queries_df = self.getSelectedInstancesDataframe(drop_instances) queries_df = queries_df.sample(n=num_instances, axis=0) self.addAnnotationQueries('random', 'low', queries_df) return list(map(int, queries_df.index.values.tolist())) def addAnnotationQueries(self, kind, confidence, queries_df): if kind not in list(self.annotation_queries.keys()): self.annotation_queries[kind] = [] for index, row in queries_df.iterrows(): query = self.generateAnnotationQuery(int(index), row['likelihood'], self.label, self.family, confidence=confidence) self.annotation_queries[kind].append(query) self.queries.append(int(index)) self.queries_confidence.append(confidence) def getSelectedInstancesDataframe(self, drop_instances): if drop_instances is None: selected_instances = self.instances_ids else: selected_instances = [ x for x in self.instances_ids if x not in drop_instances] selected_df = self.df.loc[list(map(str, selected_instances)), :] return selected_df
ah-anssi/SecuML
SecuML/core/ActiveLearning/QueryStrategies/AnnotationQueries/Category.py
Python
gpl-2.0
8,916
[ 30522, 1001, 10819, 2819, 2140, 1001, 9385, 1006, 1039, 1007, 2355, 1011, 2418, 2019, 18719, 1001, 1001, 10819, 2819, 2140, 2003, 2489, 4007, 1025, 2017, 2064, 2417, 2923, 3089, 8569, 2618, 2009, 1998, 1013, 2030, 19933, 1001, 2009, 2104, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE HTML> <script src="../resources/text-based-repaint.js"></script> <style> body { margin: 0; } #container { position: relative; top: 40px; width: 200px; height: 400px; } #test { position: fixed; background-color: green; width: 100px; height: 100px; } </style> <script> function repaintTest() { document.getElementById("test").style['margin-top'] = '20px'; } window.onload = runRepaintAndPixelTest; </script> <div id="container"> <div id="test"></div> </div> Tests the repainting of fixed element when margin-top changes.
scheib/chromium
third_party/blink/web_tests/paint/invalidation/position/fixed-margin-change-repaint.html
HTML
bsd-3-clause
653
[ 30522, 1026, 999, 9986, 13874, 16129, 1028, 1026, 5896, 5034, 2278, 1027, 1000, 1012, 1012, 1013, 4219, 1013, 3793, 1011, 2241, 1011, 16360, 22325, 1012, 1046, 2015, 1000, 1028, 1026, 1013, 5896, 1028, 1026, 2806, 1028, 2303, 1063, 7785, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
namespace InheritanceAndPolymorphism { using System.Collections.Generic; public class Course { public Course(string name) { this.Name = name; this.TeacherName = null; this.Students = new List<string>(); } public Course(string courseName, string teacherName) : this(courseName) { this.TeacherName = teacherName; } public Course(string courseName, string teacherName, IList<string> students) : this(courseName, teacherName) { this.Students = students; } public string Name { get; set; } public string TeacherName { get; set; } public IList<string> Students { get; set; } } }
vassildinev/High-Quality-Code
07. HighQualityClassesHomework/Inheritance-and-Polymorphism/Course.cs
C#
mit
898
[ 30522, 3415, 15327, 12839, 5685, 18155, 24335, 2953, 21850, 6491, 1063, 2478, 2291, 1012, 6407, 1012, 12391, 1025, 2270, 2465, 2607, 1063, 2270, 2607, 1006, 5164, 2171, 1007, 1063, 2023, 1012, 2171, 1027, 2171, 1025, 2023, 1012, 3836, 18442...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<div class="actions"> <span class="glyphicon glyphicon-edit" data-toggle="tooltip" ng-click="fc.updateFund(row.entity)" title="编辑"></span> </div>
lokinell/sunlights_op
client/views/fund/operation.html
HTML
mit
203
[ 30522, 1026, 4487, 2615, 2465, 1027, 1000, 4506, 1000, 1028, 1026, 8487, 2465, 1027, 1000, 1043, 2135, 17926, 2239, 1043, 2135, 17926, 2239, 1011, 10086, 1000, 2951, 1011, 2000, 24679, 1027, 1000, 6994, 25101, 1000, 12835, 1011, 11562, 1027...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copyright (C) 1999 Lars Knoll (knoll@kde.org) * (C) 1999 Antti Koivisto (koivisto@kde.org) * (C) 2000 Dirk Mueller (mueller@kde.org) * Copyright (C) 2004, 2005, 2006, 2007, 2010 Apple Inc. All rights reserved. * Copyright (C) 2012 Samsung Electronics. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #ifndef HTMLInputElement_h #define HTMLInputElement_h #include "FileChooser.h" #include "HTMLTextFormControlElement.h" #include "StepRange.h" #include <memory> #if PLATFORM(IOS) #include "DateComponents.h" #endif namespace WebCore { class CheckedRadioButtons; class DragData; class FileList; class HTMLDataListElement; class HTMLImageLoader; class HTMLOptionElement; class Icon; class InputType; class ListAttributeTargetObserver; class TextControlInnerTextElement; class URL; struct DateTimeChooserParameters; struct InputElementClickState { InputElementClickState() : stateful(false) , checked(false) , indeterminate(false) { } bool stateful; bool checked; bool indeterminate; RefPtr<HTMLInputElement> checkedRadioButton; }; class HTMLInputElement : public HTMLTextFormControlElement { public: static Ref<HTMLInputElement> create(const QualifiedName&, Document&, HTMLFormElement*, bool createdByParser); virtual ~HTMLInputElement(); WEBCORE_EXPORT virtual bool shouldAutocomplete() const override final; // For ValidityState virtual bool hasBadInput() const override final; virtual bool patternMismatch() const override final; virtual bool rangeUnderflow() const override final; virtual bool rangeOverflow() const override final; virtual bool stepMismatch() const override final; virtual bool tooLong() const override final; virtual bool typeMismatch() const override final; virtual bool valueMissing() const override final; virtual String validationMessage() const override final; // Returns the minimum value for type=date, number, or range. Don't call this for other types. double minimum() const; // Returns the maximum value for type=date, number, or range. Don't call this for other types. // This always returns a value which is >= minimum(). double maximum() const; // Sets the "allowed value step" defined in the HTML spec to the specified double pointer. // Returns false if there is no "allowed value step." bool getAllowedValueStep(Decimal*) const; StepRange createStepRange(AnyStepHandling) const; #if ENABLE(DATALIST_ELEMENT) Optional<Decimal> findClosestTickMarkValue(const Decimal&); #endif // Implementations of HTMLInputElement::stepUp() and stepDown(). void stepUp(int, ExceptionCode&); void stepDown(int, ExceptionCode&); void stepUp(ExceptionCode& ec) { stepUp(1, ec); } void stepDown(ExceptionCode& ec) { stepDown(1, ec); } // stepUp()/stepDown() for user-interaction. bool isSteppable() const; bool isTextButton() const; bool isRadioButton() const; WEBCORE_EXPORT bool isTextField() const; WEBCORE_EXPORT bool isSearchField() const; bool isInputTypeHidden() const; WEBCORE_EXPORT bool isPasswordField() const; bool isCheckbox() const; bool isRangeControl() const; #if ENABLE(INPUT_TYPE_COLOR) bool isColorControl() const; #endif // FIXME: It's highly likely that any call site calling this function should instead // be using a different one. Many input elements behave like text fields, and in addition // any unknown input type is treated as text. Consider, for example, isTextField or // isTextField && !isPasswordField. WEBCORE_EXPORT bool isText() const; WEBCORE_EXPORT bool isEmailField() const; bool isFileUpload() const; bool isImageButton() const; WEBCORE_EXPORT bool isNumberField() const; bool isSubmitButton() const; WEBCORE_EXPORT bool isTelephoneField() const; WEBCORE_EXPORT bool isURLField() const; WEBCORE_EXPORT bool isDateField() const; WEBCORE_EXPORT bool isDateTimeField() const; WEBCORE_EXPORT bool isDateTimeLocalField() const; WEBCORE_EXPORT bool isMonthField() const; WEBCORE_EXPORT bool isTimeField() const; WEBCORE_EXPORT bool isWeekField() const; #if PLATFORM(IOS) DateComponents::Type dateType() const; #endif HTMLElement* containerElement() const; virtual TextControlInnerTextElement* innerTextElement() const override final; virtual Ref<RenderStyle> createInnerTextStyle(const RenderStyle&) const override; HTMLElement* innerBlockElement() const; HTMLElement* innerSpinButtonElement() const; HTMLElement* capsLockIndicatorElement() const; HTMLElement* resultsButtonElement() const; HTMLElement* cancelButtonElement() const; HTMLElement* sliderThumbElement() const; HTMLElement* sliderTrackElement() const; virtual HTMLElement* placeholderElement() const override final; WEBCORE_EXPORT HTMLElement* autoFillButtonElement() const; bool checked() const { return m_isChecked; } void setChecked(bool, TextFieldEventBehavior = DispatchNoEvent); // 'indeterminate' is a state independent of the checked state that causes the control to draw in a way that hides the actual state. bool indeterminate() const { return m_isIndeterminate; } void setIndeterminate(bool); // shouldAppearChecked is used by the rendering tree/CSS while checked() is used by JS to determine checked state bool shouldAppearChecked() const; virtual bool shouldAppearIndeterminate() const override final; unsigned size() const; bool sizeShouldIncludeDecoration(int& preferredSize) const; float decorationWidth() const; void setType(const AtomicString&); WEBCORE_EXPORT virtual String value() const override final; void setValue(const String&, ExceptionCode&, TextFieldEventBehavior = DispatchNoEvent); WEBCORE_EXPORT void setValue(const String&, TextFieldEventBehavior = DispatchNoEvent); WEBCORE_EXPORT void setValueForUser(const String&); // Checks if the specified string would be a valid value. // We should not call this for types with no string value such as CHECKBOX and RADIO. bool isValidValue(const String&) const; bool hasDirtyValue() const { return !m_valueIfDirty.isNull(); }; String sanitizeValue(const String&) const; String localizeValue(const String&) const; // The value which is drawn by a renderer. String visibleValue() const; WEBCORE_EXPORT void setEditingValue(const String&); double valueAsDate() const; void setValueAsDate(double, ExceptionCode&); WEBCORE_EXPORT double valueAsNumber() const; WEBCORE_EXPORT void setValueAsNumber(double, ExceptionCode&, TextFieldEventBehavior = DispatchNoEvent); String valueWithDefault() const; void setValueFromRenderer(const String&); bool canHaveSelection() const; virtual bool rendererIsNeeded(const RenderStyle&) override final; virtual RenderPtr<RenderElement> createElementRenderer(Ref<RenderStyle>&&, const RenderTreePosition&) override final; virtual void willAttachRenderers() override final; virtual void didAttachRenderers() override final; virtual void didDetachRenderers() override final; // FIXME: For isActivatedSubmit and setActivatedSubmit, we should use the NVI-idiom here by making // it private virtual in all classes and expose a public method in HTMLFormControlElement to call // the private virtual method. virtual bool isActivatedSubmit() const override final; virtual void setActivatedSubmit(bool flag) override final; String altText() const; void willDispatchEvent(Event&, InputElementClickState&); void didDispatchClickEvent(Event&, const InputElementClickState&); int maxResults() const { return m_maxResults; } String defaultValue() const; void setDefaultValue(const String&); Vector<String> acceptMIMETypes(); Vector<String> acceptFileExtensions(); String accept() const; String alt() const; void setSize(unsigned); void setSize(unsigned, ExceptionCode&); URL src() const; int maxLengthForBindings() const { return m_maxLength; } unsigned effectiveMaxLength() const; bool multiple() const; bool isAutoFilled() const { return m_isAutoFilled; } WEBCORE_EXPORT void setAutoFilled(bool = true); AutoFillButtonType autoFillButtonType() const { return (AutoFillButtonType)m_autoFillButtonType; } WEBCORE_EXPORT void setShowAutoFillButton(AutoFillButtonType); FileList* files(); void setFiles(PassRefPtr<FileList>); #if ENABLE(DRAG_SUPPORT) // Returns true if the given DragData has more than one dropped files. bool receiveDroppedFiles(const DragData&); #endif Icon* icon() const; #if PLATFORM(IOS) String displayString() const; #endif // These functions are used for rendering the input active during a // drag-and-drop operation. bool canReceiveDroppedFiles() const; void setCanReceiveDroppedFiles(bool); void addSearchResult(); void onSearch(); virtual bool willRespondToMouseClickEvents() override; #if ENABLE(DATALIST_ELEMENT) HTMLElement* list() const; HTMLDataListElement* dataList() const; void listAttributeTargetChanged(); #endif HTMLInputElement* checkedRadioButtonForGroup() const; bool isInRequiredRadioButtonGroup(); // Functions for InputType classes. void setValueInternal(const String&, TextFieldEventBehavior); bool isTextFormControlFocusable() const; bool isTextFormControlKeyboardFocusable(KeyboardEvent*) const; bool isTextFormControlMouseFocusable() const; bool valueAttributeWasUpdatedAfterParsing() const { return m_valueAttributeWasUpdatedAfterParsing; } void cacheSelectionInResponseToSetValue(int caretOffset) { cacheSelection(caretOffset, caretOffset, SelectionHasNoDirection); } Color valueAsColor() const; // Returns transparent color if not type=color. WEBCORE_EXPORT void selectColor(const Color&); // Does nothing if not type=color. Simulates user selection of color; intended for testing. String defaultToolTip() const; #if ENABLE(MEDIA_CAPTURE) bool shouldUseMediaCapture() const; #endif static const unsigned maxEffectiveLength; unsigned height() const; unsigned width() const; void setHeight(unsigned); void setWidth(unsigned); virtual void blur() override final; void defaultBlur(); virtual const AtomicString& name() const override final; void endEditing(); static Vector<FileChooserFileInfo> filesFromFileInputFormControlState(const FormControlState&); virtual bool matchesReadWritePseudoClass() const override final; virtual void setRangeText(const String& replacement, ExceptionCode&) override final; virtual void setRangeText(const String& replacement, unsigned start, unsigned end, const String& selectionMode, ExceptionCode&) override final; HTMLImageLoader* imageLoader() { return m_imageLoader.get(); } HTMLImageLoader& ensureImageLoader(); #if ENABLE(DATE_AND_TIME_INPUT_TYPES) bool setupDateTimeChooserParameters(DateTimeChooserParameters&); #endif void capsLockStateMayHaveChanged(); protected: HTMLInputElement(const QualifiedName&, Document&, HTMLFormElement*, bool createdByParser); virtual void defaultEventHandler(Event*) override; private: enum AutoCompleteSetting { Uninitialized, On, Off }; virtual void didAddUserAgentShadowRoot(ShadowRoot*) override final; virtual bool canHaveUserAgentShadowRoot() const override final { return true; } virtual void willChangeForm() override final; virtual void didChangeForm() override final; virtual InsertionNotificationRequest insertedInto(ContainerNode&) override final; void finishedInsertingSubtree() override final; virtual void removedFrom(ContainerNode&) override final; virtual void didMoveToNewDocument(Document* oldDocument) override final; virtual bool hasCustomFocusLogic() const override final; virtual bool isKeyboardFocusable(KeyboardEvent*) const override final; virtual bool isMouseFocusable() const override final; virtual bool isEnumeratable() const override final; virtual bool supportLabels() const override final; virtual void updateFocusAppearance(SelectionRestorationMode, SelectionRevealMode) override final; virtual bool shouldUseInputMethod() override final; virtual bool isTextFormControl() const override final { return isTextField(); } virtual bool canTriggerImplicitSubmission() const override final { return isTextField(); } virtual const AtomicString& formControlType() const override final; virtual bool shouldSaveAndRestoreFormControlState() const override final; virtual FormControlState saveFormControlState() const override final; virtual void restoreFormControlState(const FormControlState&) override final; virtual bool canStartSelection() const override final; virtual void accessKeyAction(bool sendMouseEvents) override final; virtual void parseAttribute(const QualifiedName&, const AtomicString&) override final; virtual bool isPresentationAttribute(const QualifiedName&) const override final; virtual void collectStyleForPresentationAttribute(const QualifiedName&, const AtomicString&, MutableStyleProperties&) override final; virtual void finishParsingChildren() override final; virtual void parserDidSetAttributes() override final; virtual void copyNonAttributePropertiesFromElement(const Element&) override final; virtual bool appendFormData(FormDataList&, bool) override final; virtual bool isSuccessfulSubmitButton() const override final; virtual void reset() override final; virtual bool isURLAttribute(const Attribute&) const override final; virtual bool isInRange() const override final; virtual bool isOutOfRange() const override final; virtual void resumeFromDocumentSuspension() override final; #if ENABLE(INPUT_TYPE_COLOR) virtual void prepareForDocumentSuspension() override final; #endif virtual void addSubresourceAttributeURLs(ListHashSet<URL>&) const override final; bool needsSuspensionCallback(); void registerForSuspensionCallbackIfNeeded(); void unregisterForSuspensionCallbackIfNeeded(); bool supportsMaxLength() const { return isTextType(); } bool isTextType() const; bool tooLong(const String&, NeedsToCheckDirtyFlag) const; virtual bool supportsPlaceholder() const override final; virtual void updatePlaceholderText() override final; virtual bool isEmptyValue() const override final; virtual void handleFocusEvent(Node* oldFocusedNode, FocusDirection) override final; virtual void handleBlurEvent() override final; virtual bool isOptionalFormControl() const override final { return !isRequiredFormControl(); } virtual bool isRequiredFormControl() const override final; virtual bool computeWillValidate() const override final; virtual void requiredAttributeChanged() override final; void initializeInputType(); void updateType(); void runPostTypeUpdateTasks(); virtual void subtreeHasChanged() override final; #if ENABLE(DATALIST_ELEMENT) void resetListAttributeTargetObserver(); #endif void maxLengthAttributeChanged(const AtomicString& newValue); void updateValueIfNeeded(); // Returns null if this isn't associated with any radio button group. CheckedRadioButtons* checkedRadioButtons() const; void addToRadioButtonGroup(); void removeFromRadioButtonGroup(); AtomicString m_name; String m_valueIfDirty; unsigned m_size; int m_maxLength; short m_maxResults; bool m_isChecked : 1; bool m_reflectsCheckedAttribute : 1; bool m_isIndeterminate : 1; bool m_hasType : 1; bool m_isActivatedSubmit : 1; unsigned m_autocomplete : 2; // AutoCompleteSetting bool m_isAutoFilled : 1; unsigned m_autoFillButtonType : 2; // AutoFillButtonType; #if ENABLE(DATALIST_ELEMENT) bool m_hasNonEmptyList : 1; #endif bool m_stateRestored : 1; bool m_parsingInProgress : 1; bool m_valueAttributeWasUpdatedAfterParsing : 1; bool m_wasModifiedByUser : 1; bool m_canReceiveDroppedFiles : 1; #if ENABLE(TOUCH_EVENTS) bool m_hasTouchEventHandler : 1; #endif std::unique_ptr<InputType> m_inputType; // The ImageLoader must be owned by this element because the loader code assumes // that it lives as long as its owning element lives. If we move the loader into // the ImageInput object we may delete the loader while this element lives on. std::unique_ptr<HTMLImageLoader> m_imageLoader; #if ENABLE(DATALIST_ELEMENT) std::unique_ptr<ListAttributeTargetObserver> m_listAttributeTargetObserver; #endif }; } //namespace #endif
teamfx/openjfx-9-dev-rt
modules/javafx.web/src/main/native/Source/WebCore/html/HTMLInputElement.h
C
gpl-2.0
17,585
[ 30522, 1013, 1008, 1008, 9385, 1006, 1039, 1007, 2639, 16357, 14161, 14511, 1006, 14161, 14511, 1030, 1047, 3207, 1012, 8917, 1007, 1008, 1006, 1039, 1007, 2639, 14405, 3775, 12849, 21997, 2080, 1006, 12849, 21997, 2080, 1030, 1047, 3207, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!--- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> Distributed Lock Manager ------------------------ Distributed locks are used to synchronize accesses shared resources. Most applications today use ZooKeeper to model distributed locks. The simplest way to model a lock using ZooKeeper is (See ZooKeeper leader recipe for an exact and more advanced solution) * Each process tries to create an emphemeral node * If the node is successfully created, the process acquires the lock * Otherwise, it will watch the ZNode and try to acquire the lock again if the current lock holder disappears This is good enough if there is only one lock. But in practice, an application will need many such locks. Distributing and managing the locks among difference process becomes challenging. Extending such a solution to many locks will result in: * Uneven distribution of locks among nodes; the node that starts first will acquire all the locks. Nodes that start later will be idle. * When a node fails, how the locks will be distributed among remaining nodes is not predicable. * When new nodes are added the current nodes don\'t relinquish the locks so that new nodes can acquire some locks In other words we want a system to satisfy the following requirements. * Distribute locks evenly among all nodes to get better hardware utilization * If a node fails, the locks that were acquired by that node should be evenly distributed among other nodes * If nodes are added, locks must be evenly re-distributed among nodes. Helix provides a simple and elegant solution to this problem. Simply specify the number of locks and Helix will ensure that above constraints are satisfied. To quickly see this working run the `lock-manager-demo` script where 12 locks are evenly distributed among three nodes, and when a node fails, the locks get re-distributed among remaining two nodes. Note that Helix does not re-shuffle the locks completely, instead it simply distributes the locks relinquished by dead node among 2 remaining nodes evenly. ---------------------------------------------------------------------------------------- ### Short Version This version starts multiple threads within the same process to simulate a multi node deployment. Try the long version to get a better idea of how it works. ``` git clone https://git-wip-us.apache.org/repos/asf/helix.git cd helix git checkout tags/helix-1.0.0 mvn clean install package -DskipTests cd recipes/distributed-lock-manager/target/distributed-lock-manager-pkg/bin chmod +x * ./lock-manager-demo ``` #### Output ``` ./lock-manager-demo STARTING localhost_12000 STARTING localhost_12002 STARTING localhost_12001 STARTED localhost_12000 STARTED localhost_12002 STARTED localhost_12001 localhost_12001 acquired lock:lock-group_3 localhost_12000 acquired lock:lock-group_8 localhost_12001 acquired lock:lock-group_2 localhost_12001 acquired lock:lock-group_4 localhost_12002 acquired lock:lock-group_1 localhost_12002 acquired lock:lock-group_10 localhost_12000 acquired lock:lock-group_7 localhost_12001 acquired lock:lock-group_5 localhost_12002 acquired lock:lock-group_11 localhost_12000 acquired lock:lock-group_6 localhost_12002 acquired lock:lock-group_0 localhost_12000 acquired lock:lock-group_9 lockName acquired By ====================================== lock-group_0 localhost_12002 lock-group_1 localhost_12002 lock-group_10 localhost_12002 lock-group_11 localhost_12002 lock-group_2 localhost_12001 lock-group_3 localhost_12001 lock-group_4 localhost_12001 lock-group_5 localhost_12001 lock-group_6 localhost_12000 lock-group_7 localhost_12000 lock-group_8 localhost_12000 lock-group_9 localhost_12000 Stopping localhost_12000 localhost_12000 Interrupted localhost_12001 acquired lock:lock-group_9 localhost_12001 acquired lock:lock-group_8 localhost_12002 acquired lock:lock-group_6 localhost_12002 acquired lock:lock-group_7 lockName acquired By ====================================== lock-group_0 localhost_12002 lock-group_1 localhost_12002 lock-group_10 localhost_12002 lock-group_11 localhost_12002 lock-group_2 localhost_12001 lock-group_3 localhost_12001 lock-group_4 localhost_12001 lock-group_5 localhost_12001 lock-group_6 localhost_12002 lock-group_7 localhost_12002 lock-group_8 localhost_12001 lock-group_9 localhost_12001 ``` ---------------------------------------------------------------------------------------- ### Long version This provides more details on how to setup the cluster and where to plugin application code. #### Start ZooKeeper ``` ./start-standalone-zookeeper 2199 ``` #### Create a Cluster ``` ./helix-admin --zkSvr localhost:2199 --addCluster lock-manager-demo ``` #### Create a Lock Group Create a lock group and specify the number of locks in the lock group. ``` ./helix-admin --zkSvr localhost:2199 --addResource lock-manager-demo lock-group 6 OnlineOffline --mode AUTO_REBALANCE ``` #### Start the Nodes Create a Lock class that handles the callbacks. ``` public class Lock extends StateModel { private String lockName; public Lock(String lockName) { this.lockName = lockName; } public void lock(Message m, NotificationContext context) { System.out.println(" acquired lock:"+ lockName ); } public void release(Message m, NotificationContext context) { System.out.println(" releasing lock:"+ lockName ); } } ``` and a LockFactory that creates Locks ``` public class LockFactory extends StateModelFactory<Lock> { /* Instantiates the lock handler, one per lockName */ public Lock create(String lockName) { return new Lock(lockName); } } ``` At node start up, simply join the cluster and Helix will invoke the appropriate callbacks on the appropriate Lock instance. One can start any number of nodes and Helix detects that a new node has joined the cluster and re-distributes the locks automatically. ``` public class LockProcess { public static void main(String args) { String zkAddress= "localhost:2199"; String clusterName = "lock-manager-demo"; //Give a unique id to each process, most commonly used format hostname_port String instanceName ="localhost_12000"; ZKHelixAdmin helixAdmin = new ZKHelixAdmin(zkAddress); //configure the instance and provide some metadata InstanceConfig config = new InstanceConfig(instanceName); config.setHostName("localhost"); config.setPort("12000"); admin.addInstance(clusterName, config); //join the cluster HelixManager manager; manager = HelixManagerFactory.getHelixManager(clusterName, instanceName, InstanceType.PARTICIPANT, zkAddress); manager.getStateMachineEngine().registerStateModelFactory("OnlineOffline", modelFactory); manager.connect(); Thread.currentThread.join(); } } ``` #### Start the Controller The controller can be started either as a separate process or can be embedded within each node process ##### Separate Process This is recommended when number of nodes in the cluster \> 100. For fault tolerance, you can run multiple controllers on different boxes. ``` ./run-helix-controller --zkSvr localhost:2199 --cluster lock-manager-demo 2>&1 > /tmp/controller.log & ``` ##### Embedded Within the Node Process This is recommended when the number of nodes in the cluster is less than 100. To start a controller from each process, simply add the following lines to MyClass ``` public class LockProcess { public static void main(String args) { String zkAddress= "localhost:2199"; String clusterName = "lock-manager-demo"; // . // . manager.connect(); HelixManager controller; controller = HelixControllerMain.startHelixController(zkAddress, clusterName, "controller", HelixControllerMain.STANDALONE); Thread.currentThread.join(); } } ```
lei-xia/helix
website/1.0.0/src/site/markdown/recipes/lock_manager.md
Markdown
apache-2.0
8,873
[ 30522, 1026, 999, 1011, 1011, 1011, 7000, 2000, 1996, 15895, 4007, 3192, 1006, 2004, 2546, 1007, 2104, 2028, 2030, 2062, 12130, 6105, 10540, 1012, 2156, 1996, 5060, 5371, 5500, 2007, 2023, 2147, 2005, 3176, 2592, 4953, 9385, 6095, 1012, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php /* dvdetect DVD detection, analysis & DVDETECT lookup library Copyright (C) 2013-2015 Norbert Schlia <nschlia@dvdetect.de> This program is free software: you can redistribute it and/or modify it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU LESSER GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE along with this program. If not, see <http://www.gnu.org/licenses/>. */ /*! \file functions.search.inc.php * * \brief PHP function collection */ function addVideoStream($mysqli, $tagDVDVIDEOSTREAM, $idDVDVMGM, $idDVDVTS) { $attributes = $tagDVDVIDEOSTREAM->attributes(); $Type = value_or_null($attributes["Type"]); $ID = value_or_null($attributes["ID"]); $VideoCodingMode = value_or_null($attributes["VideoCodingMode"]); $VideoStandard = value_or_null($attributes["VideoStandard"]); $VideoAspect = value_or_null($attributes["VideoAspect"]); $AutomaticPanScanDisallowed = value_or_null($attributes["AutomaticPanScanDisallowed"]); $CCForLine21Field1InGOP = value_or_null($attributes["CCForLine21Field1InGOP"]); $CCForLine21Field2InGOP = value_or_null($attributes["CCForLine21Field2InGOP"]); $CBR = value_or_null($attributes["CBR"]); $Resolution = value_or_null($attributes["Resolution"]); $LetterBoxed = value_or_null($attributes["LetterBoxed"]); $SourceFilm = value_or_null($attributes["SourceFilm"]); if ($idDVDVTS == null) { $Type = "VMG"; } $strSQL = "INSERT INTO DVDVIDEOSTREAM (DVDVMGMKey, DVDVTSKey, Type, ID, VideoCodingMode, VideoStandard, VideoAspect, AutomaticPanScanDisallowed, CCForLine21Field1InGOP, CCForLine21Field2InGOP, CBR, Resolution, LetterBoxed, SourceFilm) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);"; $stmt = $mysqli->prepare($strSQL); if (!$stmt) { $ResponseText = "Error preparing insert statement for DVDVIDEOSTREAM table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->bind_param("iisisssiiiisii", $idDVDVMGM, $idDVDVTS, $Type, $ID, $VideoCodingMode, $VideoStandard, $VideoAspect, $AutomaticPanScanDisallowed, $CCForLine21Field1InGOP, $CCForLine21Field2InGOP, $CBR, $Resolution, $LetterBoxed, $SourceFilm)) { $ResponseText = "Error binding parameters for DVDVIDEOSTREAM table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->execute()) { $ResponseText = "Error executing statement on DVDVIDEOSTREAM table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } $stmt->close(); } function updateVideoStream($mysqli, $tagDVDVIDEOSTREAM, $idDVDVMGM, $idDVDVTS) { $attributes = $tagDVDVIDEOSTREAM->attributes(); $Type = value_or_null($attributes["Type"]); $ID = value_or_null($attributes["ID"]); $VideoCodingMode = value_or_null($attributes["VideoCodingMode"]); $VideoStandard = value_or_null($attributes["VideoStandard"]); $VideoAspect = value_or_null($attributes["VideoAspect"]); $AutomaticPanScanDisallowed = value_or_null($attributes["AutomaticPanScanDisallowed"]); $CCForLine21Field1InGOP = value_or_null($attributes["CCForLine21Field1InGOP"]); $CCForLine21Field2InGOP = value_or_null($attributes["CCForLine21Field2InGOP"]); $CBR = value_or_null($attributes["CBR"]); $Resolution = value_or_null($attributes["Resolution"]); $LetterBoxed = value_or_null($attributes["LetterBoxed"]); $SourceFilm = value_or_null($attributes["SourceFilm"]); if ($idDVDVMGM == null) { $Type = "VMG"; } $strSQL = "UPDATE DVDVIDEOSTREAM SET ID = ?, VideoCodingMode = ?, VideoStandard = ?, VideoAspect = ?, AutomaticPanScanDisallowed = ?, CCForLine21Field1InGOP = ?, CCForLine21Field2InGOP = ?, CBR = ?, Resolution = ?, LetterBoxed = ?, SourceFilm = ? "; if ($idDVDVMGM != null) { $strSQL .= "WHERE DVDVMGMKey = ? AND DVDVTSKey IS NULL AND Type = ?;"; } else { $strSQL .= "WHERE DVDVMGMKey IS NULL AND DVDVTSKey = ? AND Type = ?;"; } $stmt = $mysqli->prepare($strSQL); if (!$stmt) { $ResponseText = "Error preparing update statement for DVDVIDEOSTREAM table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if ($idDVDVMGM != null) { if (!$stmt->bind_param("isssiiiisiiis", $ID, $VideoCodingMode, $VideoStandard, $VideoAspect, $AutomaticPanScanDisallowed, $CCForLine21Field1InGOP, $CCForLine21Field2InGOP, $CBR, $Resolution, $LetterBoxed, $SourceFilm, $idDVDVMGM, $Type)) { $ResponseText = "Error binding parameters for DVDVIDEOSTREAM table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } } else { if (!$stmt->bind_param("isssiiiisiiis", $ID, $VideoCodingMode, $VideoStandard, $VideoAspect, $AutomaticPanScanDisallowed, $CCForLine21Field1InGOP, $CCForLine21Field2InGOP, $CBR, $Resolution, $LetterBoxed, $SourceFilm, $idDVDVTS, $Type)) { $ResponseText = "Error binding parameters for DVDVIDEOSTREAM table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } } if (!$stmt->execute()) { $ResponseText = "Error executing statement on DVDVIDEOSTREAM table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } $stmt->close(); } function addAudioStream($mysqli, $tagDVDAUDIOSTREAM, $idDVDVMGM, $idDVDVTS) { $attributes = $tagDVDAUDIOSTREAM->attributes(); $Number = value_or_null($attributes["Number"]); $Type = value_or_null($attributes["Type"]); $ID = value_or_null($attributes["ID"]); $Channels = value_or_null($attributes["Channels"]); $SampleRate = value_or_null($attributes["SampleRate"]); $Quantisation = value_or_null($attributes["Quantisation"]); $MultichannelExtPresent = value_or_null($attributes["MultichannelExtPresent"]); $CodingMode = value_or_null($attributes["CodingMode"]); if ($idDVDVTS == null) { $Type = "VMG"; } $strSQL = "INSERT INTO DVDAUDIOSTREAM (DVDVMGMKey, DVDVTSKey, Number, Type, ID, SampleRate, Channels, Quantisation, CodingMode) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?);"; $stmt = $mysqli->prepare($strSQL); if (!$stmt) { $ResponseText = "Error preparing insert statement for DVDAUDIOSTREAM table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->bind_param("iiisiiiss", $idDVDVMGM, $idDVDVTS, $Number, $Type, $ID, $SampleRate, $Channels, $Quantisation, $CodingMode)) { $ResponseText = "Error binding parameters for DVDAUDIOSTREAM table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->execute()) { $ResponseText = "Error executing statement on DVDAUDIOSTREAM table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } $stmt->close(); } function updateAudioStream($mysqli, $tagDVDAUDIOSTREAM, $idDVDVMGM, $idDVDVTS) { $attributes = $tagDVDAUDIOSTREAM->attributes(); $Number = value_or_null($attributes["Number"]); $Type = value_or_null($attributes["Type"]); $ID = value_or_null($attributes["ID"]); $Channels = value_or_null($attributes["Channels"]); $SampleRate = value_or_null($attributes["SampleRate"]); $Quantisation = value_or_null($attributes["Quantisation"]); $MultichannelExtPresent = value_or_null($attributes["MultichannelExtPresent"]); $CodingMode = value_or_null($attributes["CodingMode"]); if ($idDVDVTS == null) { $Type = "VMG"; } $strSQL = "UPDATE DVDAUDIOSTREAM SET ID = ?, SampleRate = ?, Channels = ?, Quantisation = ?, CodingMode = ? "; if ($idDVDVMGM != null) { $strSQL .= "WHERE DVDVMGMKey = ? AND DVDVTSKey IS NULL AND Number = ? AND Type = ?;"; } else { $strSQL .= "WHERE DVDVMGMKey IS NULL AND DVDVTSKey = ? AND Number = ? AND Type = ?;"; } $stmt = $mysqli->prepare($strSQL); if (!$stmt) { $ResponseText = "Error preparing update statement for DVDAUDIOSTREAM table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if ($idDVDVMGM != null) { if (!$stmt->bind_param("iiissiis", $ID, $SampleRate, $Channels, $Quantisation, $CodingMode, $idDVDVMGM, $Number, $Type)) { $ResponseText = "Error binding parameters for DVDAUDIOSTREAM table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } } else { if (!$stmt->bind_param("iiissiis", $ID, $SampleRate, $Channels, $Quantisation, $CodingMode, $idDVDVTS, $Number, $Type)) { $ResponseText = "Error binding parameters for DVDAUDIOSTREAM table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } } if (!$stmt->execute()) { $ResponseText = "Error executing statement on DVDAUDIOSTREAM table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } $stmt->close(); } function addAudioStreamEx($mysqli, $audiostreamExTag, $idDVDVTS) { $attributes = $audiostreamExTag->attributes(); $Number = value_or_null($attributes["Number"]); $Type = value_or_null($attributes["Type"]); $SuitableForDolbySurroundDecoding = value_or_null($attributes["SuitableForDolbySurroundDecoding"]); $KaraokeVersion = value_or_null($attributes["KaraokeVersion"]); $ApplicationMode = value_or_null($attributes["ApplicationMode"]); $MCIntroPresent = value_or_null($attributes["MCIntroPresent"]); $LanguageCodePresent = value_or_null($attributes["LanguageCodePresent"]); $LanguageCode = value_or_null($attributes["LanguageCode"]); $CodeExtPresent = value_or_null($attributes["CodeExtPresent"]); $CodeExt = value_or_null($attributes["CodeExt"]); if ($idDVDVTS == null) { $Type = "VMG"; } $strSQL = "INSERT INTO DVDAUDIOSTREAMEX (DVDVTSKey, Number, SuitableForDolbySurroundDecoding, KaraokeVersion, ApplicationMode, MCIntroPresent, LanguageCodePresent, LanguageCode, CodeExtPresent, CodeExt) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?);"; $stmt = $mysqli->prepare($strSQL); if (!$stmt) { $ResponseText = "Error preparing insert statement for DVDAUDIOSTREAMEX table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->bind_param("iiiisiisii", $idDVDVTS, $Number, $SuitableForDolbySurroundDecoding, $KaraokeVersion, $ApplicationMode, $MCIntroPresent, $LanguageCodePresent, $LanguageCode, $CodeExtPresent, $CodeExt)) { $ResponseText = "Error binding parameters for DVDAUDIOSTREAMEX table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->execute()) { $ResponseText = "Error executing statement on DVDAUDIOSTREAMEX table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } $stmt->close(); } function updateAudioStreamEx($mysqli, $audiostreamExTag, $idDVDVTS) { $attributes = $audiostreamExTag->attributes(); $Number = value_or_null($attributes["Number"]); $SuitableForDolbySurroundDecoding = value_or_null($attributes["SuitableForDolbySurroundDecoding"]); $KaraokeVersion = value_or_null($attributes["KaraokeVersion"]); $ApplicationMode = value_or_null($attributes["ApplicationMode"]); $MCIntroPresent = value_or_null($attributes["MCIntroPresent"]); $LanguageCodePresent = value_or_null($attributes["LanguageCodePresent"]); $LanguageCode = value_or_null($attributes["LanguageCode"]); $CodeExtPresent = value_or_null($attributes["CodeExtPresent"]); $CodeExt = value_or_null($attributes["CodeExt"]); $strSQL = "UPDATE DVDAUDIOSTREAMEX SET SuitableForDolbySurroundDecoding = ?, KaraokeVersion = ?, ApplicationMode = ?, MCIntroPresent = ?, LanguageCodePresent = ?, LanguageCode = ?, CodeExtPresent = ?, CodeExt = ? WHERE DVDVTSKey = ? AND Number = ?;"; $stmt = $mysqli->prepare($strSQL); if (!$stmt) { $ResponseText = "Error preparing update statement for DVDAUDIOSTREAMEX table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->bind_param("isiisiiiii", $SuitableForDolbySurroundDecoding, $KaraokeVersion, $ApplicationMode, $MCIntroPresent, $LanguageCodePresent, $LanguageCode, $CodeExtPresent, $CodeExt, $idDVDVTS, $Number)) { $ResponseText = "Error binding parameters for DVDAUDIOSTREAMEX table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->execute()) { $ResponseText = "Error executing statement on DVDAUDIOSTREAMEX table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } $stmt->close(); } function addSubPictureStream($mysqli, $tagDVDSUBPICSTREAM, $idDVDVMGM, $idDVDVTS) { $attributes = $tagDVDSUBPICSTREAM->attributes(); $Number = value_or_null($attributes["Number"]); $ID = value_or_null($attributes["ID"]); $Type = value_or_null($attributes["Type"]); $CodingMode = value_or_null($attributes["CodingMode"]); $LanguageCodePresent = value_or_null($attributes["LanguageCodePresent"]); $LanguageCode = value_or_null($attributes["LanguageCode"]); $CodeExtPresent = value_or_null($attributes["CodeExtPresent"]); $CodeExt = value_or_null($attributes["CodeExt"]); if ($idDVDVTS == null) { $Type = "VMG"; } $strSQL = "INSERT INTO DVDSUBPICSTREAM (DVDVMGMKey, DVDVTSKey, Number, ID, Type, CodingMode, LanguageCodePresent, LanguageCode, CodeExtPresent, CodeExt) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?);"; $stmt = $mysqli->prepare($strSQL); if (!$stmt) { $ResponseText = "Error preparing insert statement for DVDSUBPICSTREAM table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->bind_param("iiissiisii", $idDVDVMGM, $idDVDVTS, $Number, $ID, $Type, $CodingMode, $LanguageCodePresent, $LanguageCode, $CodeExtPresent, $CodeExt)) { $ResponseText = "Error binding parameters for DVDSUBPICSTREAM table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->execute()) { $ResponseText = "Error executing statement on DVDSUBPICSTREAM table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } $stmt->close(); } function updateSubPictureStream($mysqli, $tagDVDSUBPICSTREAM, $idDVDVMGM, $idDVDVTS) { $attributes = $tagDVDSUBPICSTREAM->attributes(); $Number = value_or_null($attributes["Number"]); $ID = value_or_null($attributes["ID"]); $Type = value_or_null($attributes["Type"]); $CodingMode = value_or_null($attributes["CodingMode"]); $LanguageCodePresent = value_or_null($attributes["LanguageCodePresent"]); $LanguageCode = value_or_null($attributes["LanguageCode"]); $CodeExtPresent = value_or_null($attributes["CodeExtPresent"]); $CodeExt = value_or_null($attributes["CodeExt"]); if ($idDVDVTS == null) { $Type = "VMG"; } $strSQL = "UPDATE DVDSUBPICSTREAM SET ID = ?, CodingMode = ?, LanguageCodePresent = ?, LanguageCode = ?, CodeExtPresent = ?, CodeExt = ? "; if ($idDVDVMGM != null) { $strSQL .= "WHERE DVDVMGMKey = ? AND DVDVTSKey IS NULL AND Number = ? AND Type = ?;"; } else { $strSQL .= "WHERE DVDVMGMKey IS NULL AND DVDVTSKey = ? AND Number = ? AND Type = ?;"; } $stmt = $mysqli->prepare($strSQL); if (!$stmt) { $ResponseText = "Error preparing update statement for DVDSUBPICSTREAM table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if ($idDVDVMGM != null) { if (!$stmt->bind_param("siisiiiis", $ID, $CodingMode, $LanguageCodePresent, $LanguageCode, $CodeExtPresent, $CodeExt, $idDVDVMGM, $Number, $Type)) { $ResponseText = "Error binding parameters for DVDSUBPICSTREAM table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } } else { if (!$stmt->bind_param("siisiiiis", $ID, $CodingMode, $LanguageCodePresent, $LanguageCode, $CodeExtPresent, $CodeExt, $idDVDVTS, $Number, $Type)) { $ResponseText = "Error binding parameters for DVDSUBPICSTREAM table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } } if (!$stmt->execute()) { $ResponseText = "Error executing statement on DVDSUBPICSTREAM table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } $stmt->close(); } function addFileset($mysqli, $tagDVDFILE, $idDVDVMGM, $idDVDVTS) { $attributes = $tagDVDFILE->attributes(); $FileSetNo = value_or_null($attributes["Number"]); $Type = value_or_null($attributes["Type"]); $VobNo = value_or_null($attributes["VobNo"]); $Size = value_or_null($attributes["Size"]); $Date = value_or_null($attributes["Date"]); $strSQL = "INSERT INTO DVDFILE (DVDVMGMKey, DVDVTSKey, FileSetNo, Type, VobNo, Size, Date) VALUES (?, ?, ?, ?, ?, ?, ?);"; $stmt = $mysqli->prepare($strSQL); if (!$stmt) { $ResponseText = "Error preparing insert statement for DVDFILE table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->bind_param("iiisiis", $idDVDVMGM, $idDVDVTS, $FileSetNo, $Type, $VobNo, $Size, $Date)) { $ResponseText = "Error binding parameters for DVDFILE table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->execute()) { $ResponseText = "Error executing statement on DVDFILE table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } $stmt->close(); } function updateFileset($mysqli, $tagDVDFILE, $idDVDVMGM, $idDVDVTS) { $attributes = $tagDVDFILE->attributes(); $FileSetNo = value_or_null($attributes["Number"]); $Type = value_or_null($attributes["Type"]); $VobNo = value_or_null($attributes["VobNo"]); $Size = value_or_null($attributes["Size"]); $Date = value_or_null($attributes["Date"]); $strSQL = "UPDATE `DVDFILE` SET `Type` = ?, `VobNo` = ?, `Size` = ?, `Date` = ? "; if ($idDVDVMGM != null) { $strSQL .= "WHERE DVDVMGMKey = ? AND DVDVTSKey IS NULL AND FileSetNo = ?;"; } else { $strSQL .= "WHERE DVDVMGMKey IS NULL AND DVDVTSKey = ? AND FileSetNo = ?;"; } $stmt = $mysqli->prepare($strSQL); if (!$stmt) { $ResponseText = "Error preparing insert statement for DVDFILE table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if ($idDVDVMGM != null) { if (!$stmt->bind_param("siisii", $Type, $VobNo, $Size, $Date, $idDVDVMGM, $FileSetNo)) { $ResponseText = "Error binding parameters for DVDFILE table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } } else { if (!$stmt->bind_param("siisii", $Type, $VobNo, $Size, $Date, $idDVDVTS, $FileSetNo)) { $ResponseText = "Error binding parameters for DVDFILE table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } } if (!$stmt->execute()) { $ResponseText = "Error executing statement on DVDFILE table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } $stmt->close(); } function submit($mysqli, $xml, $XmlVersion) { /* query_server($mysqli, "TRUNCATE TABLE `DVDAUDIOSTREAM`;"); query_server($mysqli, "TRUNCATE TABLE `DVDAUDIOSTREAMEX`;"); query_server($mysqli, "TRUNCATE TABLE `DVDSUBPICSTREAM`;"); query_server($mysqli, "TRUNCATE TABLE `DVDVIDEOSTREAM`;"); query_server($mysqli, "TRUNCATE TABLE `DVDFILE`;"); query_server($mysqli, "TRUNCATE TABLE `DVDPTTVMG`;"); query_server($mysqli, "TRUNCATE TABLE `DVDPTTVTS`;"); query_server($mysqli, "TRUNCATE TABLE `DVDUNIT`;"); query_server($mysqli, "TRUNCATE TABLE `DVDCELL`;"); query_server($mysqli, "TRUNCATE TABLE `DVDPROGRAM`;"); query_server($mysqli, "TRUNCATE TABLE `DVDPGC`;"); query_server($mysqli, "TRUNCATE TABLE `DVDVTS`;"); query_server($mysqli, "TRUNCATE TABLE `DVDVMGM`;"); */ // Start a transaction query_server($mysqli, "START TRANSACTION;"); foreach ($xml->DVD as $tagDVDVMGM) { $attributes = $tagDVDVMGM->attributes(); $Hash = value_or_null($attributes["Hash"]); $SubmitterIP = value_or_null($_SERVER['REMOTE_ADDR']); $Album = value_or_null($tagDVDVMGM->Album); $OriginalAlbum = value_or_null($tagDVDVMGM->OriginalAlbum); $AlbumArtist = value_or_null($tagDVDVMGM->AlbumArtist); $Genre = value_or_null($tagDVDVMGM->Genre); $Cast = value_or_null($tagDVDVMGM->Cast); $Crew = value_or_null($tagDVDVMGM->Crew); $Director = value_or_null($tagDVDVMGM->Director); $Screenplay = value_or_null($tagDVDVMGM->Screenplay); $Producer = value_or_null($tagDVDVMGM->Producer); $Editing = value_or_null($tagDVDVMGM->Editing); $Cinematography = value_or_null($tagDVDVMGM->Cinematography); $Country = value_or_null($tagDVDVMGM->Country); $OriginalLanguage = value_or_null($tagDVDVMGM->OriginalLanguage); $ReleaseDate = date_or_null($tagDVDVMGM->ReleaseDate); $SpecialFeatures = value_or_null($tagDVDVMGM->SpecialFeatures); $EAN_UPC = value_or_null($tagDVDVMGM->EAN_UPC); $Storyline = value_or_null($tagDVDVMGM->Storyline); $Submitter = value_or_null($tagDVDVMGM->Submitter); $Client = value_or_null($tagDVDVMGM->Client); $Remarks = value_or_null($tagDVDVMGM->Remarks); $Keywords = value_or_null($tagDVDVMGM->Keywords); $RegionProhibited1 = value_or_null($attributes["RegionProhibited1"]); $RegionProhibited2 = value_or_null($attributes["RegionProhibited2"]); $RegionProhibited3 = value_or_null($attributes["RegionProhibited3"]); $RegionProhibited4 = value_or_null($attributes["RegionProhibited4"]); $RegionProhibited5 = value_or_null($attributes["RegionProhibited5"]); $RegionProhibited6 = value_or_null($attributes["RegionProhibited6"]); $RegionProhibited7 = value_or_null($attributes["RegionProhibited7"]); $RegionProhibited8 = value_or_null($attributes["RegionProhibited8"]); $VersionNumberMajor = value_or_null($attributes["VersionNumberMajor"]); $VersionNumberMinor = value_or_null($attributes["VersionNumberMinor"]); $NumberOfVolumes = value_or_null($attributes["NumberOfVolumes"]); $VolumeNumber = value_or_null($attributes["VolumeNumber"]); $SideID = value_or_null($attributes["SideID"]); if ($Submitter == DEFSUBMITTER) { $Submitter = null; } // Check if dataset exists $found = FALSE; /* Feature #884: deactivated unstable feature for rev 0.40 $strSQL = "SELECT `idDVDVMGM`, `RowLastChanged`, `RowCreationDate`, `Submitter`, `SubmitterIP` FROM `DVDVMGM` ". "WHERE `Hash` = '" . $Hash . "' AND `Active` = 1 " . "ORDER BY `Revision` DESC;"; $rsDVDVMGM = query_server($mysqli, $strSQL); if (is_array($Cols = $rsDVDVMGM->fetch_row())) { $idDVDVMGM = $Cols[0]; $RowLastChanged = $Cols[1]; $RowCreationDate = $Cols[2]; $LastSubmitter = $Cols[3]; $LastSubmitterIP = $Cols[4]; // TODO: maybe check submission time if ($Submitter == $LastSubmitter && $SubmitterIP == $LastSubmitterIP) { $found = TRUE; } } $rsDVDVMGM->close(); */ if (!$found) { // Not found: insert new $strSQL = "INSERT INTO `DVDVMGM` (`Hash`, `Album`, `AlbumArtist`, `Genre`, `Cast`, `Crew`, `Director`, `Country`, `ReleaseDate`, `SpecialFeatures`, `EAN_UPC`, `Storyline`, `Remarks`, `Submitter`, `SubmitterIP`, `Client`, `Keywords`, `RegionProhibited1`, `RegionProhibited2`, `RegionProhibited3`, `RegionProhibited4`, `RegionProhibited5`, `RegionProhibited6`, `RegionProhibited7`, `RegionProhibited8`, `VersionNumberMajor`, `VersionNumberMinor`, `NumberOfVolumes`, `VolumeNumber`, `SideID`, `OriginalAlbum`, `Screenplay`, `Producer`, `Editing`, `Cinematography`, `OriginalLanguage`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);"; $stmt = $mysqli->prepare($strSQL); if (!$stmt) { $ResponseText = "Error preparing insert statement for DVDVMGM table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->bind_param("sssssssssssssssssiiiiiiiiiiiiissssss", $Hash, $Album, $AlbumArtist, $Genre, $Cast, $Crew, $Director, $Country, $ReleaseDate, $SpecialFeatures, $EAN_UPC, $Storyline, $Remarks, $Submitter, $SubmitterIP, $Client, $Keywords, $RegionProhibited1, $RegionProhibited2, $RegionProhibited3, $RegionProhibited4, $RegionProhibited5, $RegionProhibited6, $RegionProhibited7, $RegionProhibited8, $VersionNumberMajor, $VersionNumberMinor, $NumberOfVolumes, $VolumeNumber, $SideID, $OriginalAlbum, $Screenplay, $Producer, $Editing, $Cinematography, $OriginalLanguage)) { $ResponseText = "Error binding parameters for DVDVMGM table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); $stmt = null; throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->execute()) { $ResponseText = "Error executing statement on DVDVMGM table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); $stmt = null; throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } $idDVDVMGM = $mysqli->insert_id; $stmt->close(); $stmt = null; // Physical structure $tagPhysical = $tagDVDVMGM->physical; foreach ($tagPhysical->DVDVTS as $tagDVDVTS) { // Insert DVDVTS (Video Title Set) $attributes = $tagDVDVTS->attributes(); $TitleSetNo = $attributes["TitleSetNo"]; $VersionNumberMajor = value_or_null($attributes["VersionNumberMajor"]); $VersionNumberMinor = value_or_null($attributes["VersionNumberMinor"]); $strSQL = "INSERT INTO `DVDVTS` (`DVDVMGMKey`, `TitleSetNo`, `VersionNumberMajor`, `VersionNumberMinor`) VALUES (?, ?, ?, ?);"; $stmt = $mysqli->prepare($strSQL); if (!$stmt) { $ResponseText = "Error preparing insert statement for DVDVTS table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->bind_param("iiii", $idDVDVMGM, $TitleSetNo, $VersionNumberMajor, $VersionNumberMinor)) { $ResponseText = "Error binding parameters for DVDVTS table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->execute()) { $ResponseText = "Error executing statement on DVDVTS table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } $idDVDVTS = $mysqli->insert_id; $stmt->close(); foreach ($tagDVDVTS->DVDPGC as $tagDVDPGC) { // Insert DVDPGC (Program Chain) $attributes = $tagDVDPGC->attributes(); $ProgramChainNo = value_or_null($attributes["Number"]); $EntryPGC = value_or_null($attributes["EntryPGC"]); $strSQL = "INSERT INTO `DVDPGC` (`DVDVTSKey`, `ProgramChainNo`, `EntryPGC`) VALUES (?, ?, ?);"; $stmt = $mysqli->prepare($strSQL); if (!$stmt) { $ResponseText = "Error preparing insert statement for DVDPGC table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->bind_param("iii", $idDVDVTS, $ProgramChainNo, $EntryPGC)) { $ResponseText = "Error binding parameters for DVDPGC table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->execute()) { $ResponseText = "Error executing statement on DVDPGC table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } $idDVDPGC = $mysqli->insert_id; $stmt->close(); foreach ($tagDVDPGC->DVDPROGRAM as $tagDVDPROGRAM) { // Insert DVDPGC (Program) $attributes = $tagDVDPROGRAM->attributes(); $ProgramNo = value_or_null($attributes["Number"]); $strSQL = "INSERT INTO `DVDPROGRAM` (`DVDPGCKey`, `ProgramNo`) VALUES (?, ?);"; $stmt = $mysqli->prepare($strSQL); if (!$stmt) { $ResponseText = "Error preparing insert statement for chapter table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->bind_param("ii", $idDVDPGC, $ProgramNo)) { $ResponseText = "Error binding parameters for chapter table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->execute()) { $ResponseText = "Error executing statement on chapter table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } $idDVDPROGRAM = $mysqli->insert_id; $stmt->close(); foreach ($tagDVDPROGRAM->DVDCELL as $tagDVDCELL) { // Insert DVDCELL (Cell) $attributes = $tagDVDCELL->attributes(); $CellNo = value_or_null($attributes["Number"]); $CellType = value_or_null($attributes["CellType"]); $BlockType = value_or_null($attributes["BlockType"]); $SeamlessMultiplex = value_or_null($attributes["SeamlessMultiplex"]); $Interleaved = value_or_null($attributes["Interleaved"]); $SCRdiscontinuity = value_or_null($attributes["SCRdiscontinuity"]); $SeamlessAngleLinkedInDSI = value_or_null($attributes["SeamlessAngleLinkedInDSI"]); $VOBStillMode = value_or_null($attributes["VOBStillMode"]); $StopsTrickPlay = value_or_null($attributes["StopsTrickPlay"]); $CellStillTime = value_or_null($attributes["CellStillTime"]); $CellCommand = value_or_null($attributes["CellCommand"]); $PlayTime = value_or_null($attributes["PlayTime"]); $FrameRate = value_or_null($attributes["FrameRate"]); $FirstVOBUStartSector = value_or_null($attributes["FirstVOBUStartSector"]); $FirstILVUEndSector = value_or_null($attributes["FirstILVUEndSector"]); $LastVOBUStartSector = value_or_null($attributes["LastVOBUStartSector"]); $LastVOBUEndSector = value_or_null($attributes["LastVOBUEndSector"]); $VOBidn = value_or_null($attributes["VOBidn"]); $CELLidn = value_or_null($attributes["CELLidn"]); $NumberOfVOBIds = value_or_null($attributes["NumberOfVOBIds"]); $strSQL = "INSERT INTO `DVDCELL` (`DVDPROGRAMKey`, `CellNo`, `CellType`, `BlockType`, `SeamlessMultiplex`, `Interleaved`, `SCRdiscontinuity`, `SeamlessAngleLinkedInDSI`, `VOBStillMode`, `StopsTrickPlay`, `CellStillTime`, `CellCommand`, `PlayTime`, `FrameRate`, `FirstVOBUStartSector`, `FirstILVUEndSector`, `LastVOBUStartSector`, `LastVOBUEndSector`, `VOBidn`, `CELLidn`, `NumberOfVOBIds`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);"; $stmt = $mysqli->prepare($strSQL); if (!$stmt) { $ResponseText = "Error preparing insert statement for DVDCELL table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->bind_param("iissiiiiiiiiiiiiiiiii", $idDVDPROGRAM, $CellNo, $CellType, $BlockType, $SeamlessMultiplex, $Interleaved, $SCRdiscontinuity, $SeamlessAngleLinkedInDSI, $VOBStillMode, $StopsTrickPlay, $CellStillTime, $CellCommand, $PlayTime, $FrameRate, $FirstVOBUStartSector, $FirstILVUEndSector, $LastVOBUStartSector, $LastVOBUEndSector, $VOBidn, $CELLidn, $NumberOfVOBIds)) { $ResponseText = "Error binding parameters for DVDCELL table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->execute()) { $ResponseText = "Error executing statement on DVDCELL table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } $idDVDCELL = $mysqli->insert_id; $stmt->close(); foreach ($tagDVDCELL->DVDUNIT as $tagDVDUNIT) { // Insert DVDUNIT (Unit) $attributes = $tagDVDUNIT->attributes(); $UnitNo = value_or_null($attributes["Number"]); $StartSector = value_or_null($attributes["StartSector"]); $EndSector = value_or_null($attributes["EndSector"]); $strSQL = "INSERT INTO `DVDUNIT` (`DVDCELLKey`, `UnitNo`, `StartSector`, `EndSector`) VALUES (?, ?, ?, ?);"; $stmt = $mysqli->prepare($strSQL); if (!$stmt) { $ResponseText = "Error preparing insert statement for DVDUNIT table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->bind_param("iiii", $idDVDCELL, $UnitNo, $StartSector, $EndSector)) { $ResponseText = "Error binding parameters for DVDUNIT table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->execute()) { $ResponseText = "Error executing statement on DVDUNIT table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } //$idDVDUNIT = $mysqli->insert_id; $stmt->close(); } } } } // DVDVIDEOSTREAM foreach ($tagDVDVTS->DVDVIDEOSTREAM as $tagDVDVIDEOSTREAM) { addVideoStream($mysqli, $tagDVDVIDEOSTREAM, null, $idDVDVTS); } // DVDAUDIOSTREAM foreach ($tagDVDVTS->DVDAUDIOSTREAM as $tagDVDAUDIOSTREAM) { addAudioStream($mysqli, $tagDVDAUDIOSTREAM, null, $idDVDVTS); } // DVDAUDIOSTREAMEX foreach ($tagDVDVTS->DVDAUDIOSTREAMEX as $audiostreamExTag) { addAudioStreamEx($mysqli, $audiostreamExTag, $idDVDVTS); } // DVDSUBPICSTREAM foreach ($tagDVDVTS->DVDSUBPICSTREAM as $tagDVDSUBPICSTREAM) { addSubpictureStream($mysqli, $tagDVDSUBPICSTREAM, null, $idDVDVTS); } // Fileset foreach ($tagDVDVTS->DVDFILE as $tagDVDFILE) { addFileset($mysqli, $tagDVDFILE, null, $idDVDVTS); } } // Virtual structure $tagVirtual = $tagDVDVMGM->virtual; foreach ($tagVirtual->DVDPTTVMG as $tagDVDPTTVMG) { // Insert DVDPTTVMG (Video Title Set) $attributes = $tagDVDPTTVMG->attributes(); $Title = value_or_null($tagDVDPTTVMG->Title); $TitleSetNo = value_or_null($attributes["TitleSetNo"]); $PlaybackType = value_or_null($attributes["PlaybackType"]); $NumberOfVideoAngles = value_or_null($attributes["NumberOfVideoAngles"]); $ParentalMgmMaskVMG = value_or_null($attributes["ParentalMgmMaskVMG"]); $ParentalMgmMaskVTS = value_or_null($attributes["ParentalMgmMaskVTS"]); $NumberOfVideoAngles = value_or_null($attributes["NumberOfVideoAngles"]); $VideoTitleSetNo = value_or_null($attributes["VideoTitleSetNo"]); $TitleNo = value_or_null($attributes["TitleNo"]); $strSQL = "INSERT INTO `DVDPTTVMG` (`DVDVMGMKey`, `TitleSetNo`, `Title`, `PlaybackType`, `NumberOfVideoAngles`, `ParentalMgmMaskVMG`, `ParentalMgmMaskVTS`, `VideoTitleSetNo`, `TitleNo`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?);"; $stmt = $mysqli->prepare($strSQL); if (!$stmt) { $ResponseText = "Error preparing insert statement for DVDPTTVMG table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->bind_param("iisiiiiii", $idDVDVMGM, $TitleSetNo, $Title, $PlaybackType, $NumberOfVideoAngles, $ParentalMgmMaskVMG, $ParentalMgmMaskVTS, $VideoTitleSetNo, $TitleNo)) { $ResponseText = "Error binding parameters for DVDPTTVMG table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->execute()) { $ResponseText = "Error executing statement on DVDPTTVMG table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } $idDVDPTTVMG = $mysqli->insert_id; $stmt->close(); foreach ($tagDVDPTTVMG->DVDPTTVTS as $tagDVDPTTVTS) { // Insert DVDPTTVTS (Chapter) $attributes = $tagDVDPTTVTS->attributes(); $Title = value_or_null($tagDVDPTTVTS->Title); $Artist = value_or_null($tagDVDPTTVTS->Artist); $ProgramChainNo = value_or_null($attributes["ProgramChainNo"]); $ProgramNo = value_or_null($attributes["ProgramNo"]); $PttTitleSetNo = value_or_null($attributes["PttTitleSetNo"]); $PttChapterNo = value_or_null($attributes["Number"]); $TitleSetNo = value_or_null($attributes["TitleSetNo"]); $strSQL = "INSERT INTO `DVDPTTVTS` (`DVDPTTVMGKey`, `Artist`, `Title`, `ProgramChainNo`, `ProgramNo`, `PttTitleSetNo`, `PttChapterNo`, `TitleSetNo`) VALUES (?, ?, ?, ?, ?, ?, ?, ?);"; $stmt = $mysqli->prepare($strSQL); if (!$stmt) { $ResponseText = "Error preparing insert statement for DVDPTTVTS table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->bind_param("issiiiii", $idDVDPTTVMG, $Artist, $Title, $ProgramChainNo, $ProgramNo, $PttTitleSetNo, $PttChapterNo, $TitleSetNo)) { $ResponseText = "Error binding parameters for DVDPTTVTS table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->execute()) { $ResponseText = "Error executing statement on DVDPTTVTS table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } //$idDVDPTTVTS = $mysqli->insert_id; $stmt->close(); } } // DVDVIDEOSTREAM foreach ($tagDVDVMGM->DVDVIDEOSTREAM as $tagDVDVIDEOSTREAM) { addVideoStream($mysqli, $tagDVDVIDEOSTREAM, $idDVDVMGM, null); } // DVDAUDIOSTREAM foreach ($tagDVDVMGM->DVDAUDIOSTREAM as $tagDVDAUDIOSTREAM) { addAudioStream($mysqli, $tagDVDAUDIOSTREAM, $idDVDVMGM, null); } // DVDSUBPICSTREAM foreach ($tagDVDVMGM->DVDSUBPICSTREAM as $tagDVDSUBPICSTREAM) { addSubpictureStream($mysqli, $tagDVDSUBPICSTREAM, $idDVDVMGM, null); } // Fileset foreach ($tagDVDVMGM->DVDFILE as $tagDVDFILE) { addFileset($mysqli, $tagDVDFILE, $idDVDVMGM, null); } } else { // Found: do an update $strSQL = "UPDATE `DVDVMGM` SET `Album` = ?, `AlbumArtist` = ?, `Genre` = ?, `Cast` = ?, `Crew` = ?, `Director` = ?, `Country` = ?, `ReleaseDate` = ?, `SpecialFeatures` = ?, `EAN_UPC` = ?, `Storyline` = ?, `Remarks` = ?, `Submitter` = ?, `SubmitterIP` = ?, `Client` = ?, `Keywords` = ?, `RegionProhibited1` = ?, `RegionProhibited2` = ?, `RegionProhibited3` = ?, `RegionProhibited4` = ?, `RegionProhibited5` = ?, `RegionProhibited6` = ?, `RegionProhibited7` = ?, `RegionProhibited8` = ?, `VersionNumberMajor` = ?, `VersionNumberMinor` = ?, `NumberOfVolumes` = ?, `VolumeNumber` = ?, `OriginalAlbum` = ?, `Screenplay` = ?, `Producer` = ?, `Editing` = ?, `Cinematography` = ?, `OriginalLanguage` = ?, `SideID` = ? WHERE `idDVDVMGM` = ?;"; $stmt = $mysqli->prepare($strSQL); if (!$stmt) { $ResponseText = "Error preparing update statement for DVDVMGM table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->bind_param("ssssssssssssssssiiiiiiiiiiiissssssii", $Album, $AlbumArtist, $Genre, $Cast, $Crew, $Director, $Country, $ReleaseDate, $SpecialFeatures, $EAN_UPC, $Storyline, $Remarks, $Submitter, $SubmitterIP, $Client, $Keywords, $RegionProhibited1, $RegionProhibited2, $RegionProhibited3, $RegionProhibited4, $RegionProhibited5, $RegionProhibited6, $RegionProhibited7, $RegionProhibited8, $VersionNumberMajor, $VersionNumberMinor, $NumberOfVolumes, $VolumeNumber, $OriginalAlbum, $Screenplay, $Producer, $Editing, $Cinematography, $OriginalLanguage, $SideID, $idDVDVMGM)) { $ResponseText = "Error binding parameters for DVDVMGM table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); $stmt = null; throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->execute()) { $ResponseText = "Error executing statement on DVDVMGM table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); $stmt = null; throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } $stmt->close(); $stmt = null; // Physical structure $tagPhysical = $tagDVDVMGM->physical; foreach ($tagPhysical->DVDVTS as $tagDVDVTS) { // Update DVDVTS (Video Title Set) $attributes = $tagDVDVTS->attributes(); $TitleSetNo = $attributes["TitleSetNo"]; $VersionNumberMajor = value_or_null($attributes["VersionNumberMajor"]); $VersionNumberMinor = value_or_null($attributes["VersionNumberMinor"]); $idDVDVTS = getPrimaryKey($mysqli, "DVDVTS", "idDVDVTS", "`DVDVMGMKey` = $idDVDVMGM AND `TitleSetNo` = $TitleSetNo"); $strSQL = "UPDATE `DVDVTS` SET `TitleSetNo` = ?, `VersionNumberMajor` = ?, `VersionNumberMinor` = ? WHERE `idDVDVTS` = ?;"; $stmt = $mysqli->prepare($strSQL); if (!$stmt) { $ResponseText = "Error preparing update statement for DVDVTS table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->bind_param("iiii", $TitleSetNo, $VersionNumberMajor, $VersionNumberMinor, $idDVDVTS)) { $ResponseText = "Error binding parameters for DVDVTS table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->execute()) { $ResponseText = "Error executing statement on DVDVTS table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } $stmt->close(); foreach ($tagDVDVTS->DVDPGC as $tagDVDPGC) { // Update DVDPGC (Program Chain) $attributes = $tagDVDPGC->attributes(); $ProgramChainNo = value_or_null($attributes["Number"]); $EntryPGC = value_or_null($attributes["EntryPGC"]); $idDVDPGC = getPrimaryKey($mysqli, "DVDPGC", "idDVDPGC", "`DVDVTSKey` = $idDVDVTS AND `ProgramChainNo` = $ProgramChainNo"); $strSQL = "UPDATE `DVDPGC` SET `EntryPGC` = ? WHERE `idDVDPGC` = ?;"; $stmt = $mysqli->prepare($strSQL); if (!$stmt) { $ResponseText = "Error preparing insert statement for DVDPGC table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->bind_param("ii", $EntryPGC, $idDVDPGC)) { $ResponseText = "Error binding parameters for DVDPGC table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->execute()) { $ResponseText = "Error executing statement on DVDPGC table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } $stmt->close(); foreach ($tagDVDPGC->DVDPROGRAM as $tagDVDPROGRAM) { // Update DVDPGC (Program) $attributes = $tagDVDPROGRAM->attributes(); $ProgramNo = value_or_null($attributes["Number"]); // Nothing to update... $idDVDPROGRAM = getPrimaryKey($mysqli, "DVDPROGRAM", "idDVDPROGRAM", "`DVDPGCKey` = $idDVDPGC AND `ProgramNo` = $ProgramNo"); foreach ($tagDVDPROGRAM->DVDCELL as $tagDVDCELL) { // Update DVDCELL (Cell) $attributes = $tagDVDCELL->attributes(); $CellNo = value_or_null($attributes["Number"]); $CellType = value_or_null($attributes["CellType"]); $BlockType = value_or_null($attributes["BlockType"]); $SeamlessMultiplex = value_or_null($attributes["SeamlessMultiplex"]); $Interleaved = value_or_null($attributes["Interleaved"]); $SCRdiscontinuity = value_or_null($attributes["SCRdiscontinuity"]); $SeamlessAngleLinkedInDSI = value_or_null($attributes["SeamlessAngleLinkedInDSI"]); $VOBStillMode = value_or_null($attributes["VOBStillMode"]); $StopsTrickPlay = value_or_null($attributes["StopsTrickPlay"]); $CellStillTime = value_or_null($attributes["CellStillTime"]); $CellCommand = value_or_null($attributes["CellCommand"]); $PlayTime = value_or_null($attributes["PlayTime"]); $FrameRate = value_or_null($attributes["FrameRate"]); $FirstVOBUStartSector = value_or_null($attributes["FirstVOBUStartSector"]); $FirstILVUEndSector = value_or_null($attributes["FirstILVUEndSector"]); $LastVOBUStartSector = value_or_null($attributes["LastVOBUStartSector"]); $LastVOBUEndSector = value_or_null($attributes["LastVOBUEndSector"]); $VOBidn = value_or_null($attributes["VOBidn"]); $CELLidn = value_or_null($attributes["CELLidn"]); $NumberOfVOBIds = value_or_null($attributes["NumberOfVOBIds"]); $idDVDCELL = getPrimaryKey($mysqli, "DVDCELL", "idDVDCELL", "`DVDPROGRAMKey` = $idDVDPROGRAM AND `CellNo` = $CellNo"); $strSQL = "UPDATE `DVDCELL` SET `CellType` = ?, `BlockType` = ?, `SeamlessMultiplex` = ?, `Interleaved` = ?, `SCRdiscontinuity` = ?, `SeamlessAngleLinkedInDSI` = ?, `VOBStillMode` = ?, `StopsTrickPlay` = ?, `CellStillTime` = ?, `CellCommand` = ?, `PlayTime` = ?, `FrameRate` = ?, `FirstVOBUStartSector` = ?, `FirstILVUEndSector` = ?, `LastVOBUStartSector` = ?, `LastVOBUEndSector` = ?, `VOBidn` = ?, `CELLidn` = ?, `NumberOfVOBIds` = ? WHERE `idDVDCELL` = ?;"; $stmt = $mysqli->prepare($strSQL); if (!$stmt) { $ResponseText = "Error preparing insert statement for DVDCELL table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->bind_param("ssiiiiiiiiiiiiiiiiii", $CellType, $BlockType, $SeamlessMultiplex, $Interleaved, $SCRdiscontinuity, $SeamlessAngleLinkedInDSI, $VOBStillMode, $StopsTrickPlay, $CellStillTime, $CellCommand, $PlayTime, $FrameRate, $FirstVOBUStartSector, $FirstILVUEndSector, $LastVOBUStartSector, $LastVOBUEndSector, $VOBidn, $CELLidn, $NumberOfVOBIds, $idDVDCELL)) { $ResponseText = "Error binding parameters for DVDCELL table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->execute()) { $ResponseText = "Error executing statement on DVDCELL table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } $stmt->close(); foreach ($tagDVDCELL->DVDUNIT as $tagDVDUNIT) { // Update DVDUNIT (Unit) $attributes = $tagDVDUNIT->attributes(); $UnitNo = value_or_null($attributes["Number"]); $StartSector = value_or_null($attributes["StartSector"]); $EndSector = value_or_null($attributes["EndSector"]); $strSQL = "UPDATE `DVDUNIT` SET `StartSector` = ?, `EndSector` = ? WHERE `DVDCELLKey` = ? AND `UnitNo` = ?;"; $stmt = $mysqli->prepare($strSQL); if (!$stmt) { $ResponseText = "Error preparing insert statement for DVDUNIT table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->bind_param("iiii", $StartSector, $EndSector, $idDVDCELL, $UnitNo)) { $ResponseText = "Error binding parameters for DVDUNIT table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->execute()) { $ResponseText = "Error executing statement on DVDUNIT table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } //$idDVDUNIT = $mysqli->insert_id; $stmt->close(); } } } } // DVDVIDEOSTREAM foreach ($tagDVDVTS->DVDVIDEOSTREAM as $tagDVDVIDEOSTREAM) { updateVideoStream($mysqli, $tagDVDVIDEOSTREAM, null, $idDVDVTS); } // DVDAUDIOSTREAM foreach ($tagDVDVTS->DVDAUDIOSTREAM as $tagDVDAUDIOSTREAM) { updateAudioStream($mysqli, $tagDVDAUDIOSTREAM, null, $idDVDVTS); } // DVDAUDIOSTREAMEX foreach ($tagDVDVTS->DVDAUDIOSTREAMEX as $audiostreamExTag) { updateAudioStreamEx($mysqli, $audiostreamExTag, $idDVDVTS); } // DVDSUBPICSTREAM foreach ($tagDVDVTS->DVDSUBPICSTREAM as $tagDVDSUBPICSTREAM) { updateSubpictureStream($mysqli, $tagDVDSUBPICSTREAM, null, $idDVDVTS); } // Fileset foreach ($tagDVDVTS->DVDFILE as $tagDVDFILE) { updateFileset($mysqli, $tagDVDFILE, null, $idDVDVTS); } } // Virtual structure $tagVirtual = $tagDVDVMGM->virtual; foreach ($tagVirtual->DVDPTTVMG as $tagDVDPTTVMG) { // Update DVDPTTVMG (Video Title Set) $attributes = $tagDVDPTTVMG->attributes(); $Title = value_or_null($tagDVDPTTVMG->Title); $TitleSetNo = value_or_null($attributes["TitleSetNo"]); $PlaybackType = value_or_null($attributes["PlaybackType"]); $NumberOfVideoAngles = value_or_null($attributes["NumberOfVideoAngles"]); $ParentalMgmMaskVMG = value_or_null($attributes["ParentalMgmMaskVMG"]); $ParentalMgmMaskVTS = value_or_null($attributes["ParentalMgmMaskVTS"]); $NumberOfVideoAngles = value_or_null($attributes["NumberOfVideoAngles"]); $VideoTitleSetNo = value_or_null($attributes["VideoTitleSetNo"]); $TitleNo = value_or_null($attributes["TitleNo"]); $idDVDPTTVMG = getPrimaryKey($mysqli, "DVDPTTVMG", "idDVDPTTVMG", "`DVDVMGMKey` = $idDVDVMGM AND `TitleSetNo` = $TitleSetNo"); $strSQL = "UPDATE `DVDPTTVMG` SET `Title` = ?, `PlaybackType` = ?, `NumberOfVideoAngles` = ?, `ParentalMgmMaskVMG` = ?, `ParentalMgmMaskVTS` = ?, `VideoTitleSetNo` = ?, `TitleNo` = ? WHERE `idDVDPTTVMG` = ?;"; $stmt = $mysqli->prepare($strSQL); if (!$stmt) { $ResponseText = "Error preparing insert statement for DVDPTTVMG table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->bind_param("siiiiiii", $Title, $PlaybackType, $NumberOfVideoAngles, $ParentalMgmMaskVMG, $ParentalMgmMaskVTS, $VideoTitleSetNo, $TitleNo, $idDVDPTTVMG)) { $ResponseText = "Error binding parameters for DVDPTTVMG table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->execute()) { $ResponseText = "Error executing statement on DVDPTTVMG table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } $stmt->close(); foreach ($tagDVDPTTVMG->DVDPTTVTS as $tagDVDPTTVTS) { // Update DVDPTTVTS (Chapter) $attributes = $tagDVDPTTVTS->attributes(); $Title = value_or_null($tagDVDPTTVTS->Title); $Artist = value_or_null($tagDVDPTTVTS->Artist); $ProgramChainNo = value_or_null($attributes["ProgramChainNo"]); $ProgramNo = value_or_null($attributes["ProgramNo"]); $PttTitleSetNo = value_or_null($attributes["PttTitleSetNo"]); $PttChapterNo = value_or_null($attributes["Number"]); $TitleSetNo = value_or_null($attributes["TitleSetNo"]); $strSQL = "UPDATE `DVDPTTVTS` SET `Artist` = ?, `Title` = ?, `ProgramChainNo` = ?, `ProgramNo` = ?, `PttTitleSetNo` = ?, TitleSetNo = ? WHERE `DVDPTTVMGKey` = ? AND `PttChapterNo` = ? ;"; $stmt = $mysqli->prepare($strSQL); if (!$stmt) { $ResponseText = "Error preparing insert statement for DVDPTTVTS table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->bind_param("ssiiiiii", $Artist, $Title, $ProgramChainNo, $ProgramNo, $PttTitleSetNo, $TitleSetNo, $idDVDPTTVMG, $PttChapterNo)) { $ResponseText = "Error binding parameters for DVDPTTVTS table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } if (!$stmt->execute()) { $ResponseText = "Error executing statement on DVDPTTVTS table.\nSQL Error: " . $mysqli->error . "\nSQL State: " . $mysqli->sqlstate; $stmt->close(); throw new Exception($ResponseText, XMLRESULT_SQL_ERROR); } //$idDVDPTTVTS = $mysqli->insert_id; $stmt->close(); } } // DVDVIDEOSTREAM foreach ($tagDVDVMGM->DVDVIDEOSTREAM as $tagDVDVIDEOSTREAM) { updateVideoStream($mysqli, $tagDVDVIDEOSTREAM, $idDVDVMGM, null); } // DVDAUDIOSTREAM foreach ($tagDVDVMGM->DVDAUDIOSTREAM as $tagDVDAUDIOSTREAM) { updateAudioStream($mysqli, $tagDVDAUDIOSTREAM, $idDVDVMGM, null); } // DVDSUBPICSTREAM foreach ($tagDVDVMGM->DVDSUBPICSTREAM as $tagDVDSUBPICSTREAM) { updateSubpictureStream($mysqli, $tagDVDSUBPICSTREAM, $idDVDVMGM, null); } // Fileset foreach ($tagDVDVMGM->DVDFILE as $tagDVDFILE) { updateFileset($mysqli, $tagDVDFILE, $idDVDVMGM, null); } } } // Commit the transaction $rs = query_server($mysqli, "COMMIT;"); } ?>
nschlia/libdvdetect
php/inc/functions.submit.inc.php
PHP
lgpl-3.0
70,731
[ 30522, 1026, 1029, 25718, 1013, 1008, 4966, 12870, 6593, 4966, 10788, 1010, 4106, 1004, 4966, 12870, 6593, 2298, 6279, 3075, 9385, 1006, 1039, 1007, 2286, 1011, 2325, 4496, 8296, 8040, 27766, 2050, 1026, 24978, 2818, 6632, 1030, 4966, 12870...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
class ChangeOrderAttributes < ActiveRecord::Migration def up change_column_default :orders, :front_end_change, nil rename_column :orders, :front_end_change, :change remove_column :orders, :refunded remove_column :orders, :total_is_locked remove_column :orders, :tax_is_locked remove_column :orders, :subtotal_is_locked remove_column :orders, :cash_register_daily_id remove_column :orders, :by_card remove_column :orders, :refunded_at remove_column :orders, :refunded_by remove_column :orders, :refunded_by_type remove_column :orders, :discount_amount remove_column :orders, :tax_free change_column_default :orders, :qnr, nil end def down end end
a0ali0taha/pos
vendor/db/migrate/20130701104221_change_order_attributes.rb
Ruby
mit
711
[ 30522, 2465, 2689, 8551, 6906, 4779, 3089, 8569, 4570, 1026, 3161, 2890, 27108, 2094, 1024, 1024, 9230, 13366, 2039, 2689, 1035, 5930, 1035, 12398, 1024, 4449, 1010, 1024, 2392, 1035, 2203, 1035, 2689, 1010, 9152, 2140, 14916, 14074, 1035, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
from settings.common import Common class Dev(Common): DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'ffrpg.sql', # Or path to database file if using sqlite3. # The following settings are not used with sqlite3: 'USER': '', 'PASSWORD': '', 'HOST': '', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP. 'PORT': '', # Set to empty string for default. } }
Critical-Impact/ffrpg-gen
django/settings/dev.py
Python
mit
650
[ 30522, 2013, 10906, 1012, 2691, 12324, 2691, 2465, 16475, 1006, 2691, 1007, 1024, 17881, 1027, 1063, 1005, 12398, 1005, 1024, 1063, 1005, 3194, 1005, 1024, 1005, 6520, 23422, 1012, 16962, 1012, 2067, 10497, 2015, 1012, 29296, 4221, 2509, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package org.udger.parser; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; import java.io.IOException; import java.net.URL; import java.net.UnknownHostException; import java.sql.SQLException; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.CyclicBarrier; import org.junit.After; import org.junit.Before; import org.junit.Test; public class UdgerParserTest { private UdgerParser parser; private UdgerParser inMemoryParser; private UdgerParser.ParserDbData parserDbData; @Before public void initialize() throws SQLException { URL resource = this.getClass().getClassLoader().getResource("udgerdb_test_v3.dat"); parserDbData = new UdgerParser.ParserDbData(resource.getFile()); parser = new UdgerParser(parserDbData); inMemoryParser = new UdgerParser(parserDbData, true, 0); // no cache } @After public void close() throws IOException { parser.close(); } @Test public void testUaString1() throws SQLException { String uaQuery = "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0"; UdgerUaResult qr = parser.parseUa(uaQuery); assertEquals(qr.getUa(), "Firefox 40.0"); assertEquals(qr.getOs(), "Windows 10"); assertEquals(qr.getUaFamily(), "Firefox"); } @Test public void testIp() throws SQLException, UnknownHostException { String ipQuery = "108.61.199.93"; UdgerIpResult qr = parser.parseIp(ipQuery); assertEquals(qr.getIpClassificationCode(), "crawler"); } @Test public void testUaStringInMemoryParser() throws SQLException { String uaQuery = "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0"; UdgerUaResult qr = inMemoryParser.parseUa(uaQuery); assertEquals(qr.getUa(), "Firefox 40.0"); assertEquals(qr.getOs(), "Windows 10"); assertEquals(qr.getUaFamily(), "Firefox"); } @Test public void testIpInMemoryParser() throws SQLException, UnknownHostException { String ipQuery = "108.61.199.93"; UdgerIpResult qr = inMemoryParser.parseIp(ipQuery); assertEquals(qr.getIpClassificationCode(), "crawler"); } @Test public void testParserDbDataThreadSafety() throws Throwable { final int numThreads = 500; final String uaQuery = "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0"; final CyclicBarrier gate = new CyclicBarrier(numThreads); final ConcurrentLinkedQueue<Throwable> failures = new ConcurrentLinkedQueue<>(); Thread[] threads = new Thread[numThreads]; for (int i = 0; i < numThreads; i++) { threads[i] = new Thread(new Runnable() { @Override public void run() { UdgerParser threadParser = new UdgerParser(parserDbData); try { gate.await(); for (int j = 0; j < 100; j++) { UdgerUaResult qr = threadParser.parseUa(uaQuery); assertEquals(qr.getUa(), "Firefox 40.0"); assertEquals(qr.getOs(), "Windows 10"); assertEquals(qr.getUaFamily(), "Firefox"); } } catch (Throwable t) { failures.add(t); } } }); threads[i].start(); } for (int i = 0; i < numThreads; i++) { threads[i].join(); } if (!failures.isEmpty()) { for (Throwable throwable : failures) { throwable.printStackTrace(); } fail("Parsing threads failed, see printed exceptions"); } } }
udger/udger-java
src/test/java/org/udger/parser/UdgerParserTest.java
Java
mit
3,881
[ 30522, 7427, 8917, 1012, 20904, 4590, 1012, 11968, 8043, 1025, 12324, 10763, 8917, 1012, 12022, 4183, 1012, 20865, 1012, 20865, 2063, 26426, 2015, 1025, 12324, 10763, 8917, 1012, 12022, 4183, 1012, 20865, 1012, 8246, 1025, 12324, 9262, 1012, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package net.server; import java.net.Socket; import net.client.SocketClientProtocol; public abstract class SocketServerProtocol extends SocketClientProtocol { /** * Allow a sender to be added to the socket protocol's list of senders. * * This can be useful to send messages to clients which are not the current * senders, though which are affected by the actions of the current sender. * * @param sender * A Socket object which is tied to the sender object. */ public abstract void addSender(Socket sender); /** * Allow a sender to be removed from the socket protocol's list of senders. * * @param sender * A Socket object which is tied to the sender object. */ public abstract void removeSender(Socket sender); /** * Get the maximum number of allowed client connections to this protocol. * * @return an integer representing the maximum number of allowed * connections. */ public abstract int getMaxConnections(); /** * Get the current number of clients connected to this protocol. * * @return an integer representing the current number of connections. */ public abstract int getNumConnections(); }
awylie/carcassonne
src/main/java/net/andrewwylie/carcassonne/net/server/SocketServerProtocol.java
Java
mit
1,236
[ 30522, 7427, 5658, 1012, 8241, 1025, 12324, 9262, 1012, 5658, 1012, 22278, 1025, 12324, 5658, 1012, 7396, 1012, 22278, 20464, 11638, 21572, 3406, 25778, 1025, 2270, 10061, 2465, 27540, 2121, 6299, 21572, 3406, 25778, 8908, 22278, 20464, 11638...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
"use strict"; var EventEmitter = require ('events'); module.exports = new EventEmitter ();
alexandruradovici/messengertrivia
source/bus.js
JavaScript
mit
92
[ 30522, 1000, 2224, 9384, 1000, 1025, 13075, 2724, 23238, 12079, 1027, 5478, 1006, 1005, 2824, 1005, 1007, 1025, 11336, 1012, 14338, 1027, 2047, 2724, 23238, 12079, 1006, 1007, 1025, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
var cats; (function (cats) { 'use strict'; var initModule = function () { }; var getCat = function () { return "tabby"; }; cats.model = { initModule: initModule, getCat: getCat }; })(cats || (cats = {}));
henrjk/ts-js-module-pattern
app/cats.model.js
JavaScript
unlicense
270
[ 30522, 13075, 8870, 1025, 1006, 3853, 1006, 8870, 1007, 1063, 1005, 2224, 9384, 1005, 1025, 13075, 1999, 4183, 5302, 8566, 2571, 1027, 3853, 1006, 1007, 1063, 1065, 1025, 13075, 2131, 11266, 1027, 3853, 1006, 1007, 1063, 2709, 1000, 21628, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copyright (C) 2015 The greyfish authors * * 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/>. */ package org.asoem.greyfish.core.agent; import org.asoem.greyfish.core.environment.DiscreteTimeEnvironment; /** * A SimulationContext is the link between an {@link Agent} and a {@link org.asoem.greyfish.core.environment.DiscreteTimeEnvironment}. * If an agent got activated a newly created context will be set for this agent. */ public interface BasicContext<S extends DiscreteTimeEnvironment<A>, A extends Agent<?>> extends Context<S, A> { /** * The step at which this agent was inserted into the getSimulation. * * @return the activation step */ long getActivationStep(); /** * Get the age of this agent. Same as calling {@code getSimulation().getSteps() - getActivationStep()} * * @return the difference between the activation step and current step */ long getAge(); /** * Get the current getSimulation step. Delegates to {@link org.asoem.greyfish.core.environment.DiscreteTimeEnvironment#getTime()} * * @return the number of executed steps in the getSimulation */ long getSimulationStep(); /** * Get the current simulation time. <p>Same as calling {@code getSimulation().getTime()}</p> * * @return the current time of the simulation */ long getTime(); String simulationName(); }
asoem/greyfish
greyfish-core/src/main/java/org/asoem/greyfish/core/agent/BasicContext.java
Java
gpl-3.0
2,008
[ 30522, 1013, 1008, 1008, 9385, 1006, 1039, 1007, 2325, 1996, 4462, 7529, 6048, 1008, 1008, 2023, 2565, 2003, 2489, 4007, 1024, 2017, 2064, 2417, 2923, 3089, 8569, 2618, 2009, 1998, 1013, 2030, 19933, 1008, 2009, 2104, 1996, 3408, 1997, 19...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php /* * * ____ _ _ __ __ _ __ __ ____ * | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \ * | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) | * | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/ * |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_| * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * @author PocketMine Team * @link http://www.pocketmine.net/ * * */ namespace pocketmine\block; use pocketmine\level\Level; class WallSign extends SignPost{ protected $id = self::WALL_SIGN; public function getName() : string{ return "Wall Sign"; } public function onUpdate($type){ $faces = [ 2 => 3, 3 => 2, 4 => 5, 5 => 4, ]; if($type === Level::BLOCK_UPDATE_NORMAL){ if(isset($faces[$this->meta])) { if ($this->getSide($faces[$this->meta])->getId() === self::AIR) { $this->getLevel()->useBreakOn($this); } return Level::BLOCK_UPDATE_NORMAL; } } return false; } }
xXSirGamesXx/Genisys-2.0-unoffficial-name-
src/pocketmine/blocks/WallSign.php
PHP
gpl-3.0
1,264
[ 30522, 1026, 1029, 25718, 1013, 1008, 1008, 1008, 1035, 1035, 1035, 1035, 1035, 1035, 1035, 1035, 1035, 30524, 1035, 1064, 1064, 1035, 1064, 1032, 1013, 1006, 1035, 1007, 1035, 1035, 1035, 1035, 1035, 1035, 1064, 1032, 1013, 1064, 1035, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
'use strict'; var fs = require('fs'); var demand = require('must'); var sinon = require('sinon'); var WebHDFS = require('../lib/webhdfs'); var WebHDFSProxy = require('webhdfs-proxy'); var WebHDFSProxyMemoryStorage = require('webhdfs-proxy-memory'); describe('WebHDFS', function () { var path = '/files/' + Math.random(); var hdfs = WebHDFS.createClient({ user: process.env.USER, port: 45000 }); this.timeout(10000); before(function (done) { var opts = { path: '/webhdfs/v1', http: { port: 45000 } }; WebHDFSProxy.createServer(opts, WebHDFSProxyMemoryStorage, done); }); it('should make a directory', function (done) { hdfs.mkdir(path, function (err) { demand(err).be.null(); done(); }); }); it('should create and write data to a file', function (done) { hdfs.writeFile(path + '/file-1', 'random data', function (err) { demand(err).be.null(); done(); }); }); it('should append content to an existing file', function (done) { hdfs.appendFile(path + '/file-1', 'more random data', function (err) { demand(err).be.null(); done(); }); }); it('should create and stream data to a file', function (done) { var localFileStream = fs.createReadStream(__filename); var remoteFileStream = hdfs.createWriteStream(path + '/file-2'); var spy = sinon.spy(); localFileStream.pipe(remoteFileStream); remoteFileStream.on('error', spy); remoteFileStream.on('finish', function () { demand(spy.called).be.falsy(); done(); }); }); it('should append stream content to an existing file', function (done) { var localFileStream = fs.createReadStream(__filename); var remoteFileStream = hdfs.createWriteStream(path + '/file-2', true); var spy = sinon.spy(); localFileStream.pipe(remoteFileStream); remoteFileStream.on('error', spy); remoteFileStream.on('finish', function () { demand(spy.called).be.falsy(); done(); }); }); it('should open and read a file stream', function (done) { var remoteFileStream = hdfs.createReadStream(path + '/file-1'); var spy = sinon.spy(); var data = []; remoteFileStream.on('error', spy); remoteFileStream.on('data', function onData (chunk) { data.push(chunk); }); remoteFileStream.on('finish', function () { demand(spy.called).be.falsy(); demand(Buffer.concat(data).toString()).be.equal('random datamore random data'); done(); }); }); it('should open and read a file', function (done) { hdfs.readFile(path + '/file-1', function (err, data) { demand(err).be.null(); demand(data.toString()).be.equal('random datamore random data'); done(); }); }); it('should list directory status', function (done) { hdfs.readdir(path, function (err, files) { demand(err).be.null(); demand(files).have.length(2); demand(files[0].pathSuffix).to.eql('file-1'); demand(files[1].pathSuffix).to.eql('file-2'); demand(files[0].type).to.eql('FILE'); demand(files[1].type).to.eql('FILE'); done(); }); }); it('should change file permissions', function (done) { hdfs.chmod(path, '0777', function (err) { demand(err).be.null(); done(); }); }); it('should change file owner', function (done) { hdfs.chown(path, process.env.USER, 'supergroup', function (err) { demand(err).be.null(); done(); }); }); it('should rename file', function (done) { hdfs.rename(path+ '/file-2', path + '/bigfile', function (err) { demand(err).be.null(); done(); }); }); it('should check file existence', function (done) { hdfs.exists(path + '/bigfile', function (exists) { demand(exists).be.true(); done(); }); }); it('should stat file', function (done) { hdfs.stat(path + '/bigfile', function (err, stats) { demand(err).be.null(); demand(stats).be.object(); demand(stats.type).to.eql('FILE'); demand(stats.owner).to.eql(process.env.USER); done(); }); }); it('should create symbolic link', function (done) { hdfs.symlink(path+ '/bigfile', path + '/biggerfile', function (err) { // Pass if server doesn't support symlinks if (err && err.message.indexOf('Symlinks not supported') !== -1) { done(); } else { demand(err).be.null(); done(); } }); }); it('should delete file', function (done) { hdfs.rmdir(path+ '/file-1', function (err) { demand(err).be.null(); done(); }); }); it('should delete directory recursively', function (done) { hdfs.rmdir(path, true, function (err) { demand(err).be.null(); done(); }); }); it('should support optional opts', function (done) { var myOpts = { "user.name": "testuser" } hdfs.writeFile(path + '/file-1', 'random data', myOpts, function (err) { demand(err).be.null(); done(); }); }); }); describe('WebHDFS with requestParams', function() { var path = '/files/' + Math.random(); var hdfs = WebHDFS.createClient({ user: process.env.USER, port: 45001 }, { headers: { 'X-My-Custom-Header': 'Kerberos' } }); this.timeout(10000); before(function (done) { var opts = { path: '/webhdfs/v1', http: { port: 45001 } }; WebHDFSProxy.createServer(opts, WebHDFSProxyMemoryStorage, done); }); it('should override request() options', function (done) { var localFileStream = fs.createReadStream(__filename); var remoteFileStream = hdfs.createWriteStream(path + '/file-2'); var spy = sinon.spy(); localFileStream.pipe(remoteFileStream); remoteFileStream.on('error', spy); remoteFileStream.on('response', function(response) { var customHeader = response.req.getHeader('X-My-Custom-Header'); demand(customHeader).equal('Kerberos'); demand(spy.called).be.falsy(); done(); }) }); it('should pass requestParams to _sendRequest', function (done) { var req = hdfs.readdir('/'); req.on('response', function(response) { var customHeader = response.req.getHeader('X-My-Custom-Header'); demand(customHeader).equal('Kerberos'); done(); }); }); it('should not override explicit opts with _sendRequest', function (done) { var mostSpecificParams = { headers: { 'X-My-Custom-Header': 'Bear' } } var endpoint = hdfs._getOperationEndpoint('liststatus', '/file-2'); hdfs._sendRequest('GET', endpoint, mostSpecificParams, function(err, response, body) { var customHeader = response.req.getHeader('X-My-Custom-Header'); demand(customHeader).equal('Bear'); done(err) }); }); });
PavelVanecek/webhdfs
test/webhdfs.js
JavaScript
mit
6,845
[ 30522, 1005, 2224, 9384, 1005, 1025, 13075, 1042, 2015, 1027, 5478, 1006, 1005, 1042, 2015, 1005, 1007, 1025, 13075, 5157, 1027, 5478, 1006, 1005, 2442, 1005, 1007, 1025, 13075, 19432, 2078, 1027, 5478, 1006, 1005, 19432, 2078, 1005, 1007, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# vi: ts=4 expandtab syntax=python ############################################################################## # Copyright (c) 2008 IBM Corporation # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html # # Contributors: # Dave Leskovec (IBM) - initial implementation ############################################################################## """ This module contains functions dealing with platform information. """ import OvfLibvirt from locale import getlocale, getdefaultlocale from time import timezone def virtTypeIsAvailable(virtType): """ Check if the given virt type is available on this system @type node: String @param node: Platform type to check @rtype: Boolean @return: Indication if type is available or not """ if virtType: return True return False def getVsSystemType(vs): """ This function gets the list of system types for the virtual system and selects one based on the libvirt capabilities. It will select the first type in the list that is present on the system. @type node: DOM node @param node: Virtual System node @rtype: String @return: Platform type for Virtual System """ virtTypes = OvfLibvirt.getOvfSystemType(vs) for virtType in virtTypes: # check if this virtType is available if virtTypeIsAvailable(virtType): return virtType return None def getPlatformDict(vs, virtPlatform=None): """ Get the platform information @type node: DOM node @param node: Virtual System node @type virtPlatform: String @param node: Virtual Platform type. If None, will be taken from vs @rtype: String @return: Dictionary containing platform information for the virtual system the contents are defined by the ovf specification for the environment. """ retDict = {} if not virtPlatform: virtPlatform = getVsSystemType(vs) retDict['Kind'] = virtPlatform # We could possibly look up the version and vendor here # gather the details of the platform (langCode, encoding) = getlocale() if langCode == None: (langCode, encoding) = getdefaultlocale() retDict['Locale'] = langCode retDict['Timezone'] = timezone return retDict
Awingu/open-ovf
py/ovf/OvfPlatform.py
Python
epl-1.0
2,476
[ 30522, 1001, 6819, 1024, 24529, 1027, 1018, 7818, 2696, 2497, 20231, 1027, 18750, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/*************************************************************************** * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * copyright (C) 2002-2008 * * Umbrello UML Modeller Authors <uml-devel@uml.sf.net> * ***************************************************************************/ #ifndef SETTINGSDLG_H #define SETTINGSDLG_H // app includes #include "optionstate.h" // kde includes #include <kcombobox.h> #include <kfontdialog.h> #include <kpagedialog.h> #include <kcolorbutton.h> #include <knuminput.h> #include <klineedit.h> // qt includes #include <QCheckBox> #include <QGroupBox> #include <QLabel> #include <QPushButton> #include <QRadioButton> class UMLWidgetStylePage; class AutoLayoutOptionPage; class ClassOptionsPage; class CodeImportOptionsPage; class CodeGenOptionsPage; class CodeViewerOptionsPage; class GeneralOptionPage; /** * @author Paul Hensgen * modified by brian thomas Aug-2003 * Bugs and comments to uml-devel@lists.sf.net or http://bugs.kde.org */ class SettingsDlg : public KPageDialog { Q_OBJECT public: SettingsDlg(QWidget * parent, Settings::OptionState *state); ~SettingsDlg(); //public methods bool getChangesApplied() { return m_bChangesApplied; } QString getCodeGenerationLanguage(); protected: private: //private structs struct UIWidgets { QGroupBox * colorGB; QCheckBox * textColorCB; QCheckBox * lineColorCB; QCheckBox * fillColorCB; QCheckBox * lineWidthCB; QCheckBox * gridColorCB; QCheckBox * bgColorCB; KColorButton * textColorB; KColorButton * lineColorB; KColorButton * fillColorB; KColorButton * gridColorB; KColorButton * bgColorB; KIntSpinBox * lineWidthB; QCheckBox * useFillColorCB; } ;//end struct UIWidgets struct FontWidgets { KFontChooser * chooser; }; //private methods void setupFontPage(); void setupUIPage(); void setupGeneralPage(); void setupClassPage(); void setupCodeImportPage(); void setupCodeGenPage(); void setupCodeViewerPage(Settings::CodeViewerState options); void setupAutoLayoutPage(); void applyPage( KPageWidgetItem* ); //private attributes FontWidgets m_FontWidgets; UIWidgets m_UiWidgets; Settings::OptionState *m_pOptionState; UMLWidgetStylePage * m_pUserInterfacePage; AutoLayoutOptionPage * m_pAutoLayoutPage; CodeImportOptionsPage * m_pCodeImportPage; CodeGenOptionsPage * m_pCodeGenPage; CodeViewerOptionsPage * m_pCodeViewerPage; GeneralOptionPage * m_pGeneralPage; ClassOptionsPage * m_pClassPage; bool m_bChangesApplied; KPageWidgetItem *pageCodeViewer, *pageFont, *pageCodeImport, *pageCodeGen, *pageUserInterface, *pageClass, *pageAutoLayout, *pageGeneral; private slots: void slotApply(); void slotOk(); void slotDefault(); void slotTextCBChecked(bool value); void slotLineCBChecked(bool value); void slotFillCBChecked(bool value); void slotGridCBChecked(bool value); void slotBgCBChecked(bool value); }; #endif
Elv13/Umbrello-ng2
umbrello/dialogs/settingsdlg.h
C
gpl-2.0
3,554
[ 30522, 1013, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package gui.main; /* // Author: Benjamin Wilcox // Project GNGH */ import java.awt.Dimension; import javax.swing.JTabbedPane; public class TabHolder extends JTabbedPane { private WorldTab world = new WorldTab(); private JobTab jobs = new JobTab(); private ResourcesTab resources = new ResourcesTab(); private ResearchTab research = new ResearchTab(); private DebugTab debug = new DebugTab(); //holds all the tabs public TabHolder() { new UpdateGUI().passTabHolder(this); setPreferredSize(new Dimension(390, 540)); addTab("World", world); addTab("Jobs", jobs); addTab("Resources", resources); addTab("Research", research); addTab("Debug", debug); } public void setSelected(int i) { setSelectedIndex(i); } }
Ben880/GNGH-2
src/gui/main/TabHolder.java
Java
mit
842
[ 30522, 7427, 26458, 1012, 2364, 1025, 1013, 1008, 1013, 1013, 3166, 1024, 6425, 23926, 1013, 1013, 2622, 1043, 3070, 2232, 1008, 1013, 12324, 9262, 1012, 22091, 2102, 1012, 9812, 1025, 12324, 9262, 2595, 1012, 7370, 1012, 1046, 2696, 15499,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#include<stdio.h> #include<stdlib.h> #include<math.h> #include<string.h> //#include "nuc2num.h" //#include "hashfuc.h" //#include "statfreq.h" int hashfuc(char *string,int mer); int nuc2num(char s); int main(){ //get the reference from the reference file. // while (){ // } //reference example char *ref; const int MER=16; size_t SIZE_ref = (int)*(pow(2,31)) ref = (char *)malloc(SIZE_ref); //frequents container int *fre; int i,len_fre=(int)pow(4,MER); size_t SIZE = len_fre*sizeof(int); fre = (int *)malloc(SIZE); //frequents initantization for (i=0;i<len_fre;i++){ *(fre+i)=0; } //statfreq(ref,MER,fre); for (i=0;i<(strlen(ref)-MER+1);i++){ *(fre+hashfuc((ref+i),MER))+=1; } //print the frequents result for (i=0; i<len_fre; i++){ printf("%d\t",*(fre+i)); } //free the memory free(fre); return 0; } int hashfuc(char *string,int mer){ /* input is a substring of a reference or read, len is the length of the string. output is a integer to be used as an address of the index array following. example: "AAA" --> 0 "ATA" --> 4 "AAT" --> 1 "ATT" --> 5 "AAC" --> 2 "ATC" --> 6 "AAG" --> 3 "ATG" --> 7 The real string has a length of 16. */ int sum=0,loc=mer,i; char tmp; for (i=0; i< mer; i++){ tmp=*(string+i); sum+= (int)pow(4,(double)(loc-1))*nuc2num(tmp); loc-=1; } return sum; } int nuc2num(char s){ /* input is a char type of nucletide such as "A","a","T","t","C","c","G","g" output is a number of the nucletide. example: "A" --> 0 "a" --> 0 "T" --> 1 "t" --> 1 "C" --> 2 "c" --> 2 "G" --> 3 "g" --> 3 */ switch(s){ case 'A': return 0; case 'a': return 0; case 'T': return 1; case 't': return 1; case 'C': return 2; case 'c': return 2; case 'G': return 3; case 'g': return 3; default: printf("Error happens in nuc2num(). Please check your input!\n"); return -1; } }
zhmz90/November_2014
freq/onlyone.c
C
lgpl-3.0
2,113
[ 30522, 1001, 2421, 1026, 2358, 20617, 1012, 1044, 1028, 1001, 2421, 1026, 2358, 19422, 12322, 1012, 1044, 1028, 1001, 2421, 1026, 8785, 1012, 1044, 1028, 1001, 2421, 1026, 5164, 1012, 1044, 1028, 1013, 1013, 1001, 2421, 1000, 16371, 2278, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE html> <html lang="en"> <head> <title>Basic Demo</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=no;"/> <meta name="apple-mobile-web-app-capable" content="yes" /> <meta name="apple-mobile-web-app-status-bar-style" content="red" /> <link href="../../dist/flip.css" rel="stylesheet"> <link href="../../dist/transitions/fade.css" rel="stylesheet"> <link rel="stylesheet" href="assets/css/bootstrap.css"> <link rel="stylesheet" href="assets/css/bootstrap-responsive.css"> <style> @media (min-width: 980px) { body { padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */ } } </style> </head> <body class="flipper" onload="flip()"> <div class="navbar navbar-fixed-top"> <div class="navbar-inner"> <div class="container-fluid"> <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </a> <a class="brand" href="#">Main</a> <div class="nav-collapse"> <ul class="nav"> <li class="active"><a href="home">Home</a></li> <li><a href="about.html">About</a></li> <li><a href="settings.html">Settings</a></li> </ul> </div><!--/.nav-collapse --> </div> </div> </div> <div id="main" class="container-fluid"> <section class="row-fluid" data-route="/"> <div class="span12"> <ul> <li><a href="about.html">About</a></li> <li><a href="settings.html">Settings</a></li> <li><a href="deferred.html">Deferred Example</a></li> <li><a href="multi.html">Multi Flip Example</a></li> </ul> </div> </section> <section class="row-fluid" id="settings" data-route="settings.html" data-title="Settings"> <form class="well"> <label>Label name</label> <input type="text" class="span3" placeholder="Type something…"> <span class="help-inline">Associated help text!</span> <label class="checkbox"> <input type="checkbox"> Check me out </label> <button type="submit" class="btn">Submit</button> </form> </section> <section class="row-fluid" id="about" data-route="about.html"> <h2>About</h2> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc pharetra eros id quam vestibulum faucibus. In a libero ipsum, eu pulvinar nibh. Nulla non congue lacus. Pellentesque ligula risus, mollis vel placerat vel, consectetur ac ante. Vestibulum convallis fringilla est quis accumsan. Aliquam mollis neque eu turpis euismod eget blandit lectus lacinia. Proin purus dolor, scelerisque sed tempor volutpat, aliquet in lectus. Fusce euismod mauris sed enim suscipit id laoreet arcu imperdiet.</p> <p>Vestibulum vel aliquam lectus. Quisque ipsum nibh, auctor mollis dictum eget, sodales ut lectus. Vivamus fermentum dictum odio quis hendrerit. Nam cursus varius metus, a varius lorem mollis sit amet. Nulla imperdiet ultrices lorem non egestas. Praesent faucibus magna vel dui tempus eget commodo sem lacinia. Quisque iaculis magna nec metus suscipit dapibus pellentesque felis convallis. Donec diam nibh, varius sed viverra suscipit, bibendum sed lacus. Aenean eu nunc et ipsum viverra ullamcorper. Quisque lacus eros, suscipit sed sollicitudin eget, lacinia sed metus.</p> </section> <section class="row-fluid" id="not-found"> <h1>Whoops!</h1> <p>The page you're looking for cannot be found. Sorry!</p> </section> </div> <script src="../modernizr.custom.js"></script> <script src="https://raw.github.com/DmitryBaranovskiy/eve/master/eve.min.js"></script> <script src="https://raw.github.com/DamonOehlman/classtweak/master/classtweak.min.js"></script> <script src="https://raw.github.com/cujojs/when/master/when.js"></script> <script src="../../dist/flip.js"></script> <script src="../../dist/plugins/bootstrap.js"></script> <script src="../../dist/plugins/history.js"></script> <script src="assets/js/jquery.js"></script> <script src="assets/js/bootstrap-collapse.js"></script> </body> </html>
CrazyJacky/flip-1
demos/bootstrap/index.html
HTML
mit
4,583
[ 30522, 1026, 999, 9986, 13874, 16129, 1028, 1026, 16129, 11374, 1027, 1000, 4372, 30524, 13462, 1027, 1000, 21183, 2546, 1011, 1022, 1000, 1028, 1026, 18804, 2171, 1027, 1000, 3193, 6442, 1000, 4180, 1027, 1000, 9381, 1027, 5080, 1011, 9381...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
export interface IWithIdentifier { id?: string; }
SlidingApps/typescript-rest-mongodb
src/foundation/with-identifier.ts
TypeScript
mit
55
[ 30522, 9167, 8278, 1045, 24415, 5178, 16778, 8873, 2121, 1063, 8909, 1029, 1024, 5164, 1025, 1065, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class AE_News_Letter extends Burge_CMF_Controller { function __construct() { parent::__construct(); $this->lang->load('ae_news_letter',$this->selected_lang); $this->load->model("news_letter_manager_model"); } public function index() { if($this->input->post("post_type")==="add_template") return $this->add_template(); $this->set_news_letters_info(); $this->data['message']=get_message(); $this->data['raw_page_url']=get_link("admin_news_letter"); $this->data['lang_pages']=get_lang_pages(get_link("admin_news_letter",TRUE)); $this->data['header_title']=$this->lang->line("news_letter"); $this->send_admin_output("news_letter"); return; } private function set_news_letters_info() { $filters=array(); $this->initialize_filters($filters); $total=$this->news_letter_manager_model->get_total_news_letters($filters); if($total) { $per_page=20; $page=1; if($this->input->get("page")) $page=(int)$this->input->get("page"); $start=($page-1)*$per_page; $filters['start']=$start; $filters['count']=$per_page; $this->data['news_letters']=$this->news_letter_manager_model->get_news_letters($filters); $end=$start+sizeof($this->data['news_letters'])-1; unset($filters['start']); unset($filters['count']); unset($filters['group_by']); $this->data['current_page']=$page; $this->data['total_pages']=ceil($total/$per_page); $this->data['total_results']=$total; $this->data['results_start']=$start+1; $this->data['results_end']=$end+1; } else { $this->data['current_page']=0; $this->data['total_pages']=0; $this->data['total_results']=$total; $this->data['results_start']=0; $this->data['results_end']=0; } unset($filters['lang']); $this->data['filter']=$filters; return; } private function initialize_filters(&$filters) { $filters['lang']=$this->language->get(); if($this->input->get("title")) $filters['title']=$this->input->get("title"); persian_normalize($filters); return; } private function add_template() { $nl_id=$this->news_letter_manager_model->add_template(); return redirect(get_admin_news_letter_template_link($nl_id)); } public function template($nl_id) { if($this->input->post("post_type")==="edit_template") return $this->edit_template($nl_id); if($this->input->post("post_type")==="delete_template") return $this->delete_template($nl_id); if($this->input->post("post_type")==="send_news_letter") return $this->send_news_letter($nl_id); $this->data['nl_id']=$nl_id; $this->data['news_letter_id']=$nl_id; $this->data['news_letter_info']=$this->news_letter_manager_model->get_template($nl_id); $this->data['message']=get_message(); $this->data['lang_pages']=get_lang_pages(get_admin_news_letter_template_link($nl_id,TRUE)); $this->data['header_title']=$this->lang->line("news_letter_details")." ".$nl_id; $this->send_admin_output("news_letter_template"); return; } private function delete_template($news_letter_id) { $this->news_letter_manager_model->delete_template($news_letter_id); set_message($this->lang->line('news_letter_deleted_successfully')); return redirect(get_link("admin_news_letter")); } private function edit_template($nl_id) { $props=array( "nlt_subject" => $this->input->post("subject") ,"nlt_content" => $_POST["content"] ); $this->news_letter_manager_model->set_template_props($nl_id, $props); set_message($this->lang->line("changes_saved_successfully")); redirect(get_admin_news_letter_template_link($nl_id)); return; } private function send_news_letter($nl_id) { $this->news_letter_manager_model->send_news_letter($nl_id); set_message($this->lang->line("news_letter_sent_successfully")); redirect(get_admin_news_letter_template_link($nl_id)); return; } }
MohsenKoohi/BurgeATS
CMF/Web/application/controllers/AE_News_Letter.php
PHP
gpl-2.0
3,935
[ 30522, 1026, 1029, 25718, 2065, 1006, 999, 4225, 1006, 1005, 2918, 15069, 1005, 1007, 1007, 6164, 1006, 1005, 2053, 3622, 5896, 3229, 3039, 1005, 1007, 1025, 2465, 29347, 1035, 2739, 1035, 3661, 8908, 20934, 20800, 1035, 4642, 2546, 1035, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copyright (C) 2002 Red Hat, Inc. * * This is free software; you can redistribute it and/or modify it under * the terms of the GNU Library General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <config.h> #include <sys/types.h> #include <string.h> #include <glib-object.h> #include "debug.h" #include "caps.h" #include "matcher.h" #include "table.h" #include "trie.h" struct _vte_matcher { _vte_matcher_match_func match; /* shortcut to the most common op */ struct _vte_matcher_impl *impl; GValueArray *free_params; }; static GStaticMutex _vte_matcher_mutex = G_STATIC_MUTEX_INIT; static GCache *_vte_matcher_cache = NULL; static struct _vte_matcher_impl dummy_vte_matcher_trie = { &_vte_matcher_trie }; static struct _vte_matcher_impl dummy_vte_matcher_table = { &_vte_matcher_table }; /* Add a string to the matcher. */ static void _vte_matcher_add(const struct _vte_matcher *matcher, const char *pattern, gssize length, const char *result, GQuark quark) { matcher->impl->klass->add(matcher->impl, pattern, length, result, quark); } /* Loads all sequences into matcher */ static void _vte_matcher_init(struct _vte_matcher *matcher, const char *emulation) { const char *code, *value; gboolean found_cr = FALSE, found_lf = FALSE; int i; _vte_debug_print(VTE_DEBUG_LIFECYCLE, "_vte_matcher_init()\n"); /* Add emulator-specific sequences. */ if (strstr(emulation, "xterm") || strstr(emulation, "dtterm")) { /* Add all of the xterm-specific stuff. */ for (i = 0; _vte_xterm_capability_strings[i].value != NULL; i++) { code = _vte_xterm_capability_strings[i].code; value = _vte_xterm_capability_strings[i].value; _vte_matcher_add(matcher, code, strlen (code), value, 0); } } /* Always define cr and lf. */ if (!found_cr) { _vte_matcher_add(matcher, "\r", 1, "cr", 0); } if (!found_lf) { _vte_matcher_add(matcher, "\n", 1, "sf", 0); } _VTE_DEBUG_IF(VTE_DEBUG_TRIE) { g_printerr("Trie contents:\n"); _vte_matcher_print(matcher); g_printerr("\n"); } } /* Allocates new matcher structure. */ static gpointer _vte_matcher_create(gpointer key) { char *emulation = key; struct _vte_matcher *ret = NULL; _vte_debug_print(VTE_DEBUG_LIFECYCLE, "_vte_matcher_create()\n"); ret = g_slice_new(struct _vte_matcher); ret->impl = &dummy_vte_matcher_trie; ret->match = NULL; ret->free_params = NULL; if (strcmp(emulation, "xterm") == 0) { ret->impl = &dummy_vte_matcher_table; } else if (strcmp(emulation, "dtterm") == 0) { ret->impl = &dummy_vte_matcher_table; } return ret; } /* Noone uses this matcher, free it. */ static void _vte_matcher_destroy(gpointer value) { struct _vte_matcher *matcher = value; _vte_debug_print(VTE_DEBUG_LIFECYCLE, "_vte_matcher_destroy()\n"); if (matcher->free_params != NULL) { g_value_array_free (matcher->free_params); } if (matcher->match != NULL) /* do not call destroy on dummy values */ matcher->impl->klass->destroy(matcher->impl); g_slice_free(struct _vte_matcher, matcher); } /* Create and init matcher. */ struct _vte_matcher * _vte_matcher_new(const char *emulation) { struct _vte_matcher *ret = NULL; g_static_mutex_lock(&_vte_matcher_mutex); if (emulation == NULL) { emulation = ""; } if (_vte_matcher_cache == NULL) { _vte_matcher_cache = g_cache_new(_vte_matcher_create, _vte_matcher_destroy, (GCacheDupFunc) g_strdup, g_free, g_str_hash, g_direct_hash, g_str_equal); } ret = g_cache_insert(_vte_matcher_cache, (gpointer) emulation); if (ret->match == NULL) { ret->impl = ret->impl->klass->create(); ret->match = ret->impl->klass->match; _vte_matcher_init(ret, emulation); } g_static_mutex_unlock(&_vte_matcher_mutex); return ret; } /* Free a matcher. */ void _vte_matcher_free(struct _vte_matcher *matcher) { g_assert(_vte_matcher_cache != NULL); g_static_mutex_lock(&_vte_matcher_mutex); g_cache_remove(_vte_matcher_cache, matcher); g_static_mutex_unlock(&_vte_matcher_mutex); } /* Check if a string matches a sequence the matcher knows about. */ const char * _vte_matcher_match(struct _vte_matcher *matcher, const gunichar *pattern, gssize length, const char **res, const gunichar **consumed, GQuark *quark, GValueArray **array) { if (G_UNLIKELY (array != NULL && matcher->free_params != NULL)) { *array = matcher->free_params; matcher->free_params = NULL; } return matcher->match(matcher->impl, pattern, length, res, consumed, quark, array); } /* Dump out the contents of a matcher, mainly for debugging. */ void _vte_matcher_print(struct _vte_matcher *matcher) { matcher->impl->klass->print(matcher->impl); } /* Free a parameter array. Most of the GValue elements can clean up after * themselves, but we're using gpointers to hold unicode character strings, and * we need to free those ourselves. */ void _vte_matcher_free_params_array(struct _vte_matcher *matcher, GValueArray *params) { guint i; for (i = 0; i < params->n_values; i++) { GValue *value = &params->values[i]; if (G_UNLIKELY (g_type_is_a (value->g_type, G_TYPE_POINTER))) { g_free (g_value_get_pointer (value)); } } if (G_UNLIKELY (matcher == NULL || matcher->free_params != NULL)) { g_value_array_free (params); } else { matcher->free_params = params; params->n_values = 0; } }
thiagoarrais/console
src/matcher.c
C
lgpl-2.1
5,871
[ 30522, 1013, 1008, 1008, 9385, 1006, 1039, 1007, 2526, 2417, 6045, 1010, 4297, 1012, 1008, 1008, 2023, 2003, 2489, 4007, 1025, 2017, 2064, 2417, 2923, 3089, 8569, 2618, 2009, 1998, 1013, 2030, 19933, 2009, 2104, 1008, 1996, 3408, 1997, 19...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# Changelog ## 2.0.5 (Sep 16 2014) - Fix small bugs ## 2.0.4 (Sep 9 2014) - Prevent window from moving when clicking window buttons ## 2.0.3 (Sep 9 2014) - Add "Media Link" button, click to open current playing video/music link (Can resolve SoundCloud URL now) - Load faster - Fix Auto-Woot doesn't work if loaded too early ## 2.0.2 (Sep 6 2014) - Update license ## 2.0.1 (Sep 6 2014) - [FIXED] When resizing window, plugbot window might disappear ## 2.0.0 (Sep 5 2014) - [NEW] New design. ## 1.0.13.pre (1/22/2014) - [FIXED] when enabling skipping video, previewing a song would cause volume to turn back after closing the preview window ## 1.0.12.pre (12/19/2013) - [FIXED] versioning problem ## 1.0.11.pre (12/19/2013) - [FIXED] userlist bugs ## 1.0.10.pre (12/14/2013) - [FIXED] userlist bugs ## 1.0.9.pre (12/14/2013) - [FIXED] userlist bugs ## 1.0.8.pre (12/14/2013) - [FIXED] Floated window bugs ## 1.0.7.pre (12/14/2013) - [NEW] curated users are shown as violet color in userlist - [IMPROVED] userlist performance, it won't cause video lagging anymore - [FIXED] default settings bugs ## 1.0.6.pre (12/5/2013) - [FIXED] minor bugs ## 1.0.5.pre (12/4/2013) - [IMPROVED] performance - [FIXED] queue spot not showing correctly - [FIXED] skip-video problem ## 1.0.4.pre (11/29/2013) - [NEW] When clicking auto-woot, woot automatically if the vote is undecided - [IMPROVED] When skip-video is enabled, resume the volume when next song starts ## 1.0.3.pre (11/20/2013) - [IMPROVED] Plugbot completely hides when playlist extends - [FIXED] Compatibility issues ## 1.0.2.pre (11/19/2013) - [FIXED] UI doesn't show up because css hasn't loaded - [FIXED] Auto-woot and auto-queue bugs
perjantai/Plugwoot
CHANGELOG.md
Markdown
mit
1,701
[ 30522, 1001, 2689, 21197, 1001, 1001, 1016, 1012, 1014, 1012, 1019, 1006, 19802, 2385, 2297, 1007, 1011, 8081, 2235, 12883, 1001, 1001, 1016, 1012, 1014, 1012, 1018, 1006, 19802, 1023, 2297, 1007, 1011, 4652, 3332, 2013, 3048, 2043, 22042, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#include "db/db.h" Database::Database() { this->records_tree_ = nullptr; } void Database::Read(DatabaseReader &reader) { this->records_tree_ = reader.ReadIndex(); } Record *Database::GetRecordsTree() const { return this->records_tree_; } void Database::SetRecordsTree(Record *records_tree) { this->records_tree_ = records_tree; }
bramberg/cclinf2
src/db/db.cc
C++
gpl-2.0
339
[ 30522, 1001, 2421, 1000, 16962, 1013, 16962, 1012, 1044, 1000, 7809, 1024, 1024, 7809, 1006, 1007, 1063, 2023, 1011, 1028, 2636, 1035, 3392, 1035, 1027, 19701, 13876, 2099, 1025, 1065, 11675, 7809, 1024, 1024, 3191, 1006, 7809, 16416, 4063,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Copyright (c) 2015, Kyriakos Barbounakis k.barbounakis@gmail.com Anthi Oikonomou anthioikonomou@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of MOST Web Framework nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
kbarbounakis/most-data-mongo
modules/mongo/LICENSE.md
Markdown
bsd-3-clause
1,581
[ 30522, 9385, 1006, 1039, 1007, 2325, 1010, 18712, 4360, 15710, 3347, 5092, 9521, 14270, 1047, 1012, 3347, 5092, 9521, 14270, 1030, 20917, 4014, 1012, 4012, 14405, 4048, 1051, 12676, 3630, 5302, 2226, 14405, 4048, 10448, 19648, 19506, 2226, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#include "stdafx.h" #include "model.h" #include "node.h" #include "../manager/resourcemanager.h" #include "mesh.h" #include "bonemgr.h" using namespace graphic; // Bone¸¶´Ù °æ°è¹Ú½º¸¦ »ý¼ºÇÑ´Ù. struct sMinMax { Vector3 Min; Vector3 Max; sMinMax() : Min(Vector3(0,0,0)), Max(Vector3(0,0,0)) {} }; cModel::cModel() : m_bone(NULL) , m_isRenderMesh(true) , m_isRenderBone(false) { } cModel::~cModel() { Clear(); } bool cModel::Create(const string &modelName) { sRawMeshGroup *rawMeshes = cResourceManager::Get()->LoadModel(modelName); RETV(!rawMeshes, false); Clear(); const bool isSkinnedMesh = !rawMeshes->bones.empty(); // ½ºÅ°´× ¾Ö´Ï¸ÞÀ̼ÇÀ̸é BoneÀ» »ý¼ºÇÑ´Ù. if (isSkinnedMesh) { m_bone = new cBoneMgr(0, *rawMeshes); } // ¸Þ½¬ »ý¼º. int id = 0; BOOST_FOREACH (auto &mesh, rawMeshes->meshes) { cMesh *p = NULL; if (isSkinnedMesh) { p = new cSkinnedMesh(id++, m_bone->GetPalette(), mesh); } else { p = new cRigidMesh(id++, mesh); } if (p) m_meshes.push_back(p); } CreateBoneBoundingBox(modelName); return true; } void cModel::SetAnimation( const string &aniFileName) { if (sRawAniGroup *rawAnies = cResourceManager::Get()->LoadAnimation(aniFileName)) { if (m_bone) { m_bone->SetAnimation(*rawAnies, 0); } else { for (u_int i=0; i < m_meshes.size(); ++i) { ((cRigidMesh*)m_meshes[ i])->LoadAnimation(rawAnies->anies[0]); } } } } bool cModel::Move(const float elapseTime) { BOOST_FOREACH (auto node, m_meshes) node->Move(elapseTime); if (m_bone) m_bone->Move(elapseTime); return true; } void cModel::Render() { Matrix44 identity; GetDevice()->SetTransform(D3DTS_WORLD, (D3DXMATRIX*)&identity); if (m_isRenderMesh) { BOOST_FOREACH (auto node, m_meshes) node->Render(m_matTM); } if (m_isRenderBone && m_bone) m_bone->Render(m_matTM); // render bounding Box for (int i=0; i < (int)m_boundingBox.size(); ++i) m_boundingBox[ i].Render( m_bone->GetPalette()[ i] * m_matTM); } // remove all data void cModel::Clear() { BOOST_FOREACH (auto mesh, m_meshes) { SAFE_DELETE(mesh); } m_meshes.clear(); SAFE_DELETE(m_bone); } // ¸Þ½¬¸¦ ã¾Æ¼­ ¸®ÅÏÇÑ´Ù. cMesh* cModel::FindMesh(const string &meshName) { BOOST_FOREACH (auto &mesh, m_meshes) { if (mesh->GetName() == meshName) return (cMesh*)mesh; } return NULL; } // Bone bounding box void cModel::CreateBoneBoundingBox(const string &modelName) { RET(!m_bone); sRawMeshGroup *rawMeshes = cResourceManager::Get()->LoadModel(modelName); RET(!rawMeshes); const int boneCount = rawMeshes->bones.size(); vector<sMinMax> boundingBox(boneCount); vector<Matrix44> boneInvers(boneCount); for (int i=0; i < boneCount; ++i) { boneInvers[ i] = rawMeshes->bones[ i].worldTm.Inverse(); boundingBox[ i] = sMinMax(); } BOOST_FOREACH (const sRawMesh &mesh, rawMeshes->meshes) { BOOST_FOREACH (const sVertexWeight &weight, mesh.weights) { const int vtxIdx = weight.vtxIdx; for( int k=0; k < weight.size; ++k ) { const sWeight *w = &weight.w[ k]; const Vector3 pos = mesh.vertices[ vtxIdx] * boneInvers[ w->bone]; if (boundingBox[ w->bone].Min.x > pos.x) boundingBox[ w->bone].Min.x = pos.x; if (boundingBox[ w->bone].Min.y > pos.y) boundingBox[ w->bone].Min.y = pos.y; if (boundingBox[ w->bone].Min.z > pos.z) boundingBox[ w->bone].Min.z = pos.z; if (boundingBox[ w->bone].Max.x < pos.x) boundingBox[ w->bone].Max.x = pos.x; if (boundingBox[ w->bone].Max.y < pos.y) boundingBox[ w->bone].Max.y = pos.y; if (boundingBox[ w->bone].Max.z < pos.z) boundingBox[ w->bone].Max.z = pos.z; } } } m_boundingBox.resize(boneCount); for (int i=0; i < boneCount; ++i) { // ¿ùµå ÁÂÇ¥°ø°£À¸·Î À̵¿½ÃŲ´Ù. palette ¸¦ Àû¿ëÇϱâ À§Çؼ­´Â ¿ùµå°ø°£¿¡ ÀÖ¾î¾ß ÇÔ. const Vector3 wMin = boundingBox[ i].Min;// * rawMeshes->bones[ i].worldTm; const Vector3 wMax = boundingBox[ i].Max;// * rawMeshes->bones[ i].worldTm; m_boundingBox[ i].SetCube( wMin, wMax ); m_boundingBox[ i].SetTransform(rawMeshes->bones[ i].worldTm); } }
kami36/3Dproject
Graphic/model/model.cpp
C++
mit
4,095
[ 30522, 1001, 2421, 1000, 2358, 2850, 2546, 2595, 1012, 1044, 1000, 1001, 2421, 1000, 2944, 1012, 1044, 1000, 1001, 2421, 1000, 13045, 1012, 1044, 1000, 1001, 2421, 1000, 1012, 1012, 1013, 3208, 1013, 7692, 24805, 4590, 1012, 1044, 1000, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * blueimp Gallery JS * https://github.com/blueimp/Gallery * * Copyright 2013, Sebastian Tschan * https://blueimp.net * * Swipe implementation based on * https://github.com/bradbirdsall/Swipe * * Licensed under the MIT license: * https://opensource.org/licenses/MIT */ /* global define, DocumentTouch */ /* eslint-disable no-param-reassign */ ;(function (factory) { 'use strict' if (typeof define === 'function' && define.amd) { // Register as an anonymous AMD module: define(['./blueimp-helper'], factory) } else { // Browser globals: window.blueimp = window.blueimp || {} window.blueimp.Gallery = factory(window.blueimp.helper || window.jQuery) } })(function ($) { 'use strict' /** * Gallery constructor * * @class * @param {Array|NodeList} list Gallery content * @param {object} [options] Gallery options * @returns {object} Gallery object */ function Gallery(list, options) { if (document.body.style.maxHeight === undefined) { // document.body.style.maxHeight is undefined on IE6 and lower return null } if (!this || this.options !== Gallery.prototype.options) { // Called as function instead of as constructor, // so we simply return a new instance: return new Gallery(list, options) } if (!list || !list.length) { this.console.log( 'blueimp Gallery: No or empty list provided as first argument.', list ) return } this.list = list this.num = list.length this.initOptions(options) this.initialize() } $.extend(Gallery.prototype, { options: { // The Id, element or querySelector of the gallery widget: container: '#blueimp-gallery', // The tag name, Id, element or querySelector of the slides container: slidesContainer: 'div', // The tag name, Id, element or querySelector of the title element: titleElement: 'h3', // The class to add when the gallery is visible: displayClass: 'blueimp-gallery-display', // The class to add when the gallery controls are visible: controlsClass: 'blueimp-gallery-controls', // The class to add when the gallery only displays one element: singleClass: 'blueimp-gallery-single', // The class to add when the left edge has been reached: leftEdgeClass: 'blueimp-gallery-left', // The class to add when the right edge has been reached: rightEdgeClass: 'blueimp-gallery-right', // The class to add when the automatic slideshow is active: playingClass: 'blueimp-gallery-playing', // The class to add when the browser supports SVG as img (or background): svgasimgClass: 'blueimp-gallery-svgasimg', // The class to add when the browser supports SMIL (animated SVGs): smilClass: 'blueimp-gallery-smil', // The class for all slides: slideClass: 'slide', // The slide class for the active (current index) slide: slideActiveClass: 'slide-active', // The slide class for the previous (before current index) slide: slidePrevClass: 'slide-prev', // The slide class for the next (after current index) slide: slideNextClass: 'slide-next', // The slide class for loading elements: slideLoadingClass: 'slide-loading', // The slide class for elements that failed to load: slideErrorClass: 'slide-error', // The class for the content element loaded into each slide: slideContentClass: 'slide-content', // The class for the "toggle" control: toggleClass: 'toggle', // The class for the "prev" control: prevClass: 'prev', // The class for the "next" control: nextClass: 'next', // The class for the "close" control: closeClass: 'close', // The class for the "play-pause" toggle control: playPauseClass: 'play-pause', // The list object property (or data attribute) with the object type: typeProperty: 'type', // The list object property (or data attribute) with the object title: titleProperty: 'title', // The list object property (or data attribute) with the object alt text: altTextProperty: 'alt', // The list object property (or data attribute) with the object URL: urlProperty: 'href', // The list object property (or data attribute) with the object srcset: srcsetProperty: 'srcset', // The list object property (or data attribute) with the object sizes: sizesProperty: 'sizes', // The list object property (or data attribute) with the object sources: sourcesProperty: 'sources', // The gallery listens for transitionend events before triggering the // opened and closed events, unless the following option is set to false: displayTransition: true, // Defines if the gallery slides are cleared from the gallery modal, // or reused for the next gallery initialization: clearSlides: true, // Toggle the controls on pressing the Enter key: toggleControlsOnEnter: true, // Toggle the controls on slide click: toggleControlsOnSlideClick: true, // Toggle the automatic slideshow interval on pressing the Space key: toggleSlideshowOnSpace: true, // Navigate the gallery by pressing the ArrowLeft and ArrowRight keys: enableKeyboardNavigation: true, // Close the gallery on pressing the Escape key: closeOnEscape: true, // Close the gallery when clicking on an empty slide area: closeOnSlideClick: true, // Close the gallery by swiping up or down: closeOnSwipeUpOrDown: true, // Close the gallery when the URL hash changes: closeOnHashChange: true, // Emulate touch events on mouse-pointer devices such as desktop browsers: emulateTouchEvents: true, // Stop touch events from bubbling up to ancestor elements of the Gallery: stopTouchEventsPropagation: false, // Hide the page scrollbars: hidePageScrollbars: true, // Stops any touches on the container from scrolling the page: disableScroll: true, // Carousel mode (shortcut for carousel specific options): carousel: false, // Allow continuous navigation, moving from last to first // and from first to last slide: continuous: true, // Remove elements outside of the preload range from the DOM: unloadElements: true, // Start with the automatic slideshow: startSlideshow: false, // Delay in milliseconds between slides for the automatic slideshow: slideshowInterval: 5000, // The direction the slides are moving: ltr=LeftToRight or rtl=RightToLeft slideshowDirection: 'ltr', // The starting index as integer. // Can also be an object of the given list, // or an equal object with the same url property: index: 0, // The number of elements to load around the current index: preloadRange: 2, // The transition duration between slide changes in milliseconds: transitionDuration: 300, // The transition duration for automatic slide changes, set to an integer // greater 0 to override the default transition duration: slideshowTransitionDuration: 500, // The event object for which the default action will be canceled // on Gallery initialization (e.g. the click event to open the Gallery): event: undefined, // Callback function executed when the Gallery is initialized. // Is called with the gallery instance as "this" object: onopen: undefined, // Callback function executed when the Gallery has been initialized // and the initialization transition has been completed. // Is called with the gallery instance as "this" object: onopened: undefined, // Callback function executed on slide change. // Is called with the gallery instance as "this" object and the // current index and slide as arguments: onslide: undefined, // Callback function executed after the slide change transition. // Is called with the gallery instance as "this" object and the // current index and slide as arguments: onslideend: undefined, // Callback function executed on slide content load. // Is called with the gallery instance as "this" object and the // slide index and slide element as arguments: onslidecomplete: undefined, // Callback function executed when the Gallery is about to be closed. // Is called with the gallery instance as "this" object: onclose: undefined, // Callback function executed when the Gallery has been closed // and the closing transition has been completed. // Is called with the gallery instance as "this" object: onclosed: undefined }, carouselOptions: { hidePageScrollbars: false, toggleControlsOnEnter: false, toggleSlideshowOnSpace: false, enableKeyboardNavigation: false, closeOnEscape: false, closeOnSlideClick: false, closeOnSwipeUpOrDown: false, closeOnHashChange: false, disableScroll: false, startSlideshow: true }, console: window.console && typeof window.console.log === 'function' ? window.console : { log: function () {} }, // Detect touch, transition, transform and background-size support: support: (function (element) { var support = { source: !!window.HTMLSourceElement, picture: !!window.HTMLPictureElement, svgasimg: document.implementation.hasFeature( 'http://www.w3.org/TR/SVG11/feature#Image', '1.1' ), smil: !!document.createElementNS && /SVGAnimate/.test( document .createElementNS('http://www.w3.org/2000/svg', 'animate') .toString() ), touch: window.ontouchstart !== undefined || (window.DocumentTouch && document instanceof DocumentTouch) } var transitions = { webkitTransition: { end: 'webkitTransitionEnd', prefix: '-webkit-' }, MozTransition: { end: 'transitionend', prefix: '-moz-' }, OTransition: { end: 'otransitionend', prefix: '-o-' }, transition: { end: 'transitionend', prefix: '' } } var prop for (prop in transitions) { if ( Object.prototype.hasOwnProperty.call(transitions, prop) && element.style[prop] !== undefined ) { support.transition = transitions[prop] support.transition.name = prop break } } /** * Tests browser support */ function elementTests() { var transition = support.transition var prop var translateZ document.body.appendChild(element) if (transition) { prop = transition.name.slice(0, -9) + 'ransform' if (element.style[prop] !== undefined) { element.style[prop] = 'translateZ(0)' translateZ = window .getComputedStyle(element) .getPropertyValue(transition.prefix + 'transform') support.transform = { prefix: transition.prefix, name: prop, translate: true, translateZ: !!translateZ && translateZ !== 'none' } } } document.body.removeChild(element) } if (document.body) { elementTests() } else { $(document).on('DOMContentLoaded', elementTests) } return support // Test element, has to be standard HTML and must not be hidden // for the CSS3 tests using window.getComputedStyle to be applicable: })(document.createElement('div')), requestAnimationFrame: window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame, cancelAnimationFrame: window.cancelAnimationFrame || window.webkitCancelRequestAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame, initialize: function () { this.initStartIndex() if (this.initWidget() === false) { return false } this.initEventListeners() // Load the slide at the given index: this.onslide(this.index) // Manually trigger the slideend event for the initial slide: this.ontransitionend() // Start the automatic slideshow if applicable: if (this.options.startSlideshow) { this.play() } }, slide: function (to, duration) { window.clearTimeout(this.timeout) var index = this.index var direction var naturalDirection var diff if (index === to || this.num === 1) { return } if (!duration) { duration = this.options.transitionDuration } if (this.support.transform) { if (!this.options.continuous) { to = this.circle(to) } // 1: backward, -1: forward: direction = Math.abs(index - to) / (index - to) // Get the actual position of the slide: if (this.options.continuous) { naturalDirection = direction direction = -this.positions[this.circle(to)] / this.slideWidth // If going forward but to < index, use to = slides.length + to // If going backward but to > index, use to = -slides.length + to if (direction !== naturalDirection) { to = -direction * this.num + to } } diff = Math.abs(index - to) - 1 // Move all the slides between index and to in the right direction: while (diff) { diff -= 1 this.move( this.circle((to > index ? to : index) - diff - 1), this.slideWidth * direction, 0 ) } to = this.circle(to) this.move(index, this.slideWidth * direction, duration) this.move(to, 0, duration) if (this.options.continuous) { this.move( this.circle(to - direction), -(this.slideWidth * direction), 0 ) } } else { to = this.circle(to) this.animate(index * -this.slideWidth, to * -this.slideWidth, duration) } this.onslide(to) }, getIndex: function () { return this.index }, getNumber: function () { return this.num }, prev: function () { if (this.options.continuous || this.index) { this.slide(this.index - 1) } }, next: function () { if (this.options.continuous || this.index < this.num - 1) { this.slide(this.index + 1) } }, play: function (time) { var that = this var nextIndex = this.index + (this.options.slideshowDirection === 'rtl' ? -1 : 1) window.clearTimeout(this.timeout) this.interval = time || this.options.slideshowInterval if (this.elements[this.index] > 1) { this.timeout = this.setTimeout( (!this.requestAnimationFrame && this.slide) || function (to, duration) { that.animationFrameId = that.requestAnimationFrame.call( window, function () { that.slide(to, duration) } ) }, [nextIndex, this.options.slideshowTransitionDuration], this.interval ) } this.container.addClass(this.options.playingClass) this.slidesContainer[0].setAttribute('aria-live', 'off') if (this.playPauseElement.length) { this.playPauseElement[0].setAttribute('aria-pressed', 'true') } }, pause: function () { window.clearTimeout(this.timeout) this.interval = null if (this.cancelAnimationFrame) { this.cancelAnimationFrame.call(window, this.animationFrameId) this.animationFrameId = null } this.container.removeClass(this.options.playingClass) this.slidesContainer[0].setAttribute('aria-live', 'polite') if (this.playPauseElement.length) { this.playPauseElement[0].setAttribute('aria-pressed', 'false') } }, add: function (list) { var i if (!list.concat) { // Make a real array out of the list to add: list = Array.prototype.slice.call(list) } if (!this.list.concat) { // Make a real array out of the Gallery list: this.list = Array.prototype.slice.call(this.list) } this.list = this.list.concat(list) this.num = this.list.length if (this.num > 2 && this.options.continuous === null) { this.options.continuous = true this.container.removeClass(this.options.leftEdgeClass) } this.container .removeClass(this.options.rightEdgeClass) .removeClass(this.options.singleClass) for (i = this.num - list.length; i < this.num; i += 1) { this.addSlide(i) this.positionSlide(i) } this.positions.length = this.num this.initSlides(true) }, resetSlides: function () { this.slidesContainer.empty() this.unloadAllSlides() this.slides = [] }, handleClose: function () { var options = this.options this.destroyEventListeners() // Cancel the slideshow: this.pause() this.container[0].style.display = 'none' this.container .removeClass(options.displayClass) .removeClass(options.singleClass) .removeClass(options.leftEdgeClass) .removeClass(options.rightEdgeClass) if (options.hidePageScrollbars) { document.body.style.overflow = this.bodyOverflowStyle } if (this.options.clearSlides) { this.resetSlides() } if (this.options.onclosed) { this.options.onclosed.call(this) } }, close: function () { var that = this /** * Close handler * * @param {event} event Close event */ function closeHandler(event) { if (event.target === that.container[0]) { that.container.off(that.support.transition.end, closeHandler) that.handleClose() } } if (this.options.onclose) { this.options.onclose.call(this) } if (this.support.transition && this.options.displayTransition) { this.container.on(this.support.transition.end, closeHandler) this.container.removeClass(this.options.displayClass) } else { this.handleClose() } }, circle: function (index) { // Always return a number inside of the slides index range: return (this.num + (index % this.num)) % this.num }, move: function (index, dist, duration) { this.translateX(index, dist, duration) this.positions[index] = dist }, translate: function (index, x, y, duration) { if (!this.slides[index]) return var style = this.slides[index].style var transition = this.support.transition var transform = this.support.transform style[transition.name + 'Duration'] = duration + 'ms' style[transform.name] = 'translate(' + x + 'px, ' + y + 'px)' + (transform.translateZ ? ' translateZ(0)' : '') }, translateX: function (index, x, duration) { this.translate(index, x, 0, duration) }, translateY: function (index, y, duration) { this.translate(index, 0, y, duration) }, animate: function (from, to, duration) { if (!duration) { this.slidesContainer[0].style.left = to + 'px' return } var that = this var start = new Date().getTime() var timer = window.setInterval(function () { var timeElap = new Date().getTime() - start if (timeElap > duration) { that.slidesContainer[0].style.left = to + 'px' that.ontransitionend() window.clearInterval(timer) return } that.slidesContainer[0].style.left = (to - from) * (Math.floor((timeElap / duration) * 100) / 100) + from + 'px' }, 4) }, preventDefault: function (event) { if (event.preventDefault) { event.preventDefault() } else { event.returnValue = false } }, stopPropagation: function (event) { if (event.stopPropagation) { event.stopPropagation() } else { event.cancelBubble = true } }, onresize: function () { this.initSlides(true) }, onhashchange: function () { if (this.options.closeOnHashChange) { this.close() } }, onmousedown: function (event) { // Trigger on clicks of the left mouse button only // and exclude video & audio elements: if ( event.which && event.which === 1 && event.target.nodeName !== 'VIDEO' && event.target.nodeName !== 'AUDIO' ) { // Preventing the default mousedown action is required // to make touch emulation work with Firefox: event.preventDefault() ;(event.originalEvent || event).touches = [ { pageX: event.pageX, pageY: event.pageY } ] this.ontouchstart(event) } }, onmousemove: function (event) { if (this.touchStart) { ;(event.originalEvent || event).touches = [ { pageX: event.pageX, pageY: event.pageY } ] this.ontouchmove(event) } }, onmouseup: function (event) { if (this.touchStart) { this.ontouchend(event) delete this.touchStart } }, onmouseout: function (event) { if (this.touchStart) { var target = event.target var related = event.relatedTarget if (!related || (related !== target && !$.contains(target, related))) { this.onmouseup(event) } } }, ontouchstart: function (event) { if (this.options.stopTouchEventsPropagation) { this.stopPropagation(event) } // jQuery doesn't copy touch event properties by default, // so we have to access the originalEvent object: var touch = (event.originalEvent || event).touches[0] this.touchStart = { // Remember the initial touch coordinates: x: touch.pageX, y: touch.pageY, // Store the time to determine touch duration: time: Date.now() } // Helper variable to detect scroll movement: this.isScrolling = undefined // Reset delta values: this.touchDelta = {} }, ontouchmove: function (event) { if (this.options.stopTouchEventsPropagation) { this.stopPropagation(event) } // jQuery doesn't copy touch event properties by default, // so we have to access the originalEvent object: var touches = (event.originalEvent || event).touches var touch = touches[0] var scale = (event.originalEvent || event).scale var index = this.index var touchDeltaX var indices // Ensure this is a one touch swipe and not, e.g. a pinch: if (touches.length > 1 || (scale && scale !== 1)) { return } if (this.options.disableScroll) { event.preventDefault() } // Measure change in x and y coordinates: this.touchDelta = { x: touch.pageX - this.touchStart.x, y: touch.pageY - this.touchStart.y } touchDeltaX = this.touchDelta.x // Detect if this is a vertical scroll movement (run only once per touch): if (this.isScrolling === undefined) { this.isScrolling = this.isScrolling || Math.abs(touchDeltaX) < Math.abs(this.touchDelta.y) } if (!this.isScrolling) { // Always prevent horizontal scroll: event.preventDefault() // Stop the slideshow: window.clearTimeout(this.timeout) if (this.options.continuous) { indices = [this.circle(index + 1), index, this.circle(index - 1)] } else { // Increase resistance if first slide and sliding left // or last slide and sliding right: this.touchDelta.x = touchDeltaX = touchDeltaX / ((!index && touchDeltaX > 0) || (index === this.num - 1 && touchDeltaX < 0) ? Math.abs(touchDeltaX) / this.slideWidth + 1 : 1) indices = [index] if (index) { indices.push(index - 1) } if (index < this.num - 1) { indices.unshift(index + 1) } } while (indices.length) { index = indices.pop() this.translateX(index, touchDeltaX + this.positions[index], 0) } } else if (!this.options.carousel) { this.translateY(index, this.touchDelta.y + this.positions[index], 0) } }, ontouchend: function (event) { if (this.options.stopTouchEventsPropagation) { this.stopPropagation(event) } var index = this.index var absTouchDeltaX = Math.abs(this.touchDelta.x) var slideWidth = this.slideWidth var duration = Math.ceil( (this.options.transitionDuration * (1 - absTouchDeltaX / slideWidth)) / 2 ) // Determine if slide attempt triggers next/prev slide: var isValidSlide = absTouchDeltaX > 20 // Determine if slide attempt is past start or end: var isPastBounds = (!index && this.touchDelta.x > 0) || (index === this.num - 1 && this.touchDelta.x < 0) var isValidClose = !isValidSlide && this.options.closeOnSwipeUpOrDown && Math.abs(this.touchDelta.y) > 20 var direction var indexForward var indexBackward var distanceForward var distanceBackward if (this.options.continuous) { isPastBounds = false } // Determine direction of swipe (true: right, false: left): direction = this.touchDelta.x < 0 ? -1 : 1 if (!this.isScrolling) { if (isValidSlide && !isPastBounds) { indexForward = index + direction indexBackward = index - direction distanceForward = slideWidth * direction distanceBackward = -slideWidth * direction if (this.options.continuous) { this.move(this.circle(indexForward), distanceForward, 0) this.move(this.circle(index - 2 * direction), distanceBackward, 0) } else if (indexForward >= 0 && indexForward < this.num) { this.move(indexForward, distanceForward, 0) } this.move(index, this.positions[index] + distanceForward, duration) this.move( this.circle(indexBackward), this.positions[this.circle(indexBackward)] + distanceForward, duration ) index = this.circle(indexBackward) this.onslide(index) } else { // Move back into position if (this.options.continuous) { this.move(this.circle(index - 1), -slideWidth, duration) this.move(index, 0, duration) this.move(this.circle(index + 1), slideWidth, duration) } else { if (index) { this.move(index - 1, -slideWidth, duration) } this.move(index, 0, duration) if (index < this.num - 1) { this.move(index + 1, slideWidth, duration) } } } } else { if (isValidClose) { this.close() } else { // Move back into position this.translateY(index, 0, duration) } } }, ontouchcancel: function (event) { if (this.touchStart) { this.ontouchend(event) delete this.touchStart } }, ontransitionend: function (event) { var slide = this.slides[this.index] if (!event || slide === event.target) { if (this.interval) { this.play() } this.setTimeout(this.options.onslideend, [this.index, slide]) } }, oncomplete: function (event) { var target = event.target || event.srcElement var parent = target && target.parentNode var index if (!target || !parent) { return } index = this.getNodeIndex(parent) $(parent).removeClass(this.options.slideLoadingClass) if (event.type === 'error') { $(parent).addClass(this.options.slideErrorClass) this.elements[index] = 3 // Fail } else { this.elements[index] = 2 // Done } // Fix for IE7's lack of support for percentage max-height: if (target.clientHeight > this.container[0].clientHeight) { target.style.maxHeight = this.container[0].clientHeight } if (this.interval && this.slides[this.index] === parent) { this.play() } this.setTimeout(this.options.onslidecomplete, [index, parent]) }, onload: function (event) { this.oncomplete(event) }, onerror: function (event) { this.oncomplete(event) }, onkeydown: function (event) { switch (event.which || event.keyCode) { case 13: // Enter if (this.options.toggleControlsOnEnter) { this.preventDefault(event) this.toggleControls() } break case 27: // Escape if (this.options.closeOnEscape) { this.close() // prevent Escape from closing other things event.stopImmediatePropagation() } break case 32: // Space if (this.options.toggleSlideshowOnSpace) { this.preventDefault(event) this.toggleSlideshow() } break case 37: // ArrowLeft if (this.options.enableKeyboardNavigation) { this.preventDefault(event) this.prev() } break case 39: // ArrowRight if (this.options.enableKeyboardNavigation) { this.preventDefault(event) this.next() } break } }, handleClick: function (event) { var options = this.options var target = event.target || event.srcElement var parent = target.parentNode /** * Checks if the target from the close has the given class * * @param {string} className Class name * @returns {boolean} Returns true if the target has the class name */ function isTarget(className) { return $(target).hasClass(className) || $(parent).hasClass(className) } if (isTarget(options.toggleClass)) { // Click on "toggle" control this.preventDefault(event) this.toggleControls() } else if (isTarget(options.prevClass)) { // Click on "prev" control this.preventDefault(event) this.prev() } else if (isTarget(options.nextClass)) { // Click on "next" control this.preventDefault(event) this.next() } else if (isTarget(options.closeClass)) { // Click on "close" control this.preventDefault(event) this.close() } else if (isTarget(options.playPauseClass)) { // Click on "play-pause" control this.preventDefault(event) this.toggleSlideshow() } else if (parent === this.slidesContainer[0]) { // Click on slide background if (options.closeOnSlideClick) { this.preventDefault(event) this.close() } else if (options.toggleControlsOnSlideClick) { this.preventDefault(event) this.toggleControls() } } else if ( parent.parentNode && parent.parentNode === this.slidesContainer[0] ) { // Click on displayed element if (options.toggleControlsOnSlideClick) { this.preventDefault(event) this.toggleControls() } } }, onclick: function (event) { if ( this.options.emulateTouchEvents && this.touchDelta && (Math.abs(this.touchDelta.x) > 20 || Math.abs(this.touchDelta.y) > 20) ) { delete this.touchDelta return } return this.handleClick(event) }, updateEdgeClasses: function (index) { if (!index) { this.container.addClass(this.options.leftEdgeClass) } else { this.container.removeClass(this.options.leftEdgeClass) } if (index === this.num - 1) { this.container.addClass(this.options.rightEdgeClass) } else { this.container.removeClass(this.options.rightEdgeClass) } }, updateActiveSlide: function (oldIndex, newIndex) { var slides = this.slides var options = this.options var list = [ { index: newIndex, method: 'addClass', hidden: false }, { index: oldIndex, method: 'removeClass', hidden: true } ] var item, index while (list.length) { item = list.pop() $(slides[item.index])[item.method](options.slideActiveClass) index = this.circle(item.index - 1) if (options.continuous || index < item.index) { $(slides[index])[item.method](options.slidePrevClass) } index = this.circle(item.index + 1) if (options.continuous || index > item.index) { $(slides[index])[item.method](options.slideNextClass) } } this.slides[oldIndex].setAttribute('aria-hidden', 'true') this.slides[newIndex].removeAttribute('aria-hidden') }, handleSlide: function (oldIndex, newIndex) { if (!this.options.continuous) { this.updateEdgeClasses(newIndex) } this.updateActiveSlide(oldIndex, newIndex) this.loadElements(newIndex) if (this.options.unloadElements) { this.unloadElements(oldIndex, newIndex) } this.setTitle(newIndex) }, onslide: function (index) { this.handleSlide(this.index, index) this.index = index this.setTimeout(this.options.onslide, [index, this.slides[index]]) }, setTitle: function (index) { var firstChild = this.slides[index].firstChild var text = firstChild.title || firstChild.alt var titleElement = this.titleElement if (titleElement.length) { this.titleElement.empty() if (text) { titleElement[0].appendChild(document.createTextNode(text)) } } }, setTimeout: function (func, args, wait) { var that = this return ( func && window.setTimeout(function () { func.apply(that, args || []) }, wait || 0) ) }, imageFactory: function (obj, callback) { var options = this.options var that = this var url = obj var img = this.imagePrototype.cloneNode(false) var picture var called var sources var srcset var sizes var title var altText var i /** * Wraps the callback function for the load/error event * * @param {event} event load/error event * @returns {number} timeout ID */ function callbackWrapper(event) { if (!called) { event = { type: event.type, target: picture || img } if (!event.target.parentNode) { // Fix for browsers (e.g. IE7) firing the load event for // cached images before the element could // be added to the DOM: return that.setTimeout(callbackWrapper, [event]) } called = true $(img).off('load error', callbackWrapper) callback(event) } } if (typeof url !== 'string') { url = this.getItemProperty(obj, options.urlProperty) sources = this.support.picture && this.support.source && this.getItemProperty(obj, options.sourcesProperty) srcset = this.getItemProperty(obj, options.srcsetProperty) sizes = this.getItemProperty(obj, options.sizesProperty) title = this.getItemProperty(obj, options.titleProperty) altText = this.getItemProperty(obj, options.altTextProperty) || title } img.draggable = false if (title) { img.title = title } if (altText) { img.alt = altText } $(img).on('load error', callbackWrapper) if (sources && sources.length) { picture = this.picturePrototype.cloneNode(false) for (i = 0; i < sources.length; i += 1) { picture.appendChild( $.extend(this.sourcePrototype.cloneNode(false), sources[i]) ) } picture.appendChild(img) $(picture).addClass(options.toggleClass) } if (srcset) { if (sizes) { img.sizes = sizes } img.srcset = srcset } img.src = url if (picture) return picture return img }, createElement: function (obj, callback) { var type = obj && this.getItemProperty(obj, this.options.typeProperty) var factory = (type && this[type.split('/')[0] + 'Factory']) || this.imageFactory var element = obj && factory.call(this, obj, callback) if (!element) { element = this.elementPrototype.cloneNode(false) this.setTimeout(callback, [ { type: 'error', target: element } ]) } $(element).addClass(this.options.slideContentClass) return element }, iteratePreloadRange: function (index, func) { var num = this.num var options = this.options var limit = Math.min(num, options.preloadRange * 2 + 1) var j = index var i for (i = 0; i < limit; i += 1) { // First iterate to the current index (0), // then the next one (+1), // then the previous one (-1), // then the next after next (+2), // then the one before the previous one (-2), etc.: j += i * (i % 2 === 0 ? -1 : 1) if (j < 0 || j >= num) { if (!options.continuous) continue // Connect the ends of the list to load slide elements for // continuous iteration: j = this.circle(j) } func.call(this, j) } }, loadElement: function (index) { if (!this.elements[index]) { if (this.slides[index].firstChild) { this.elements[index] = $(this.slides[index]).hasClass( this.options.slideErrorClass ) ? 3 : 2 } else { this.elements[index] = 1 // Loading $(this.slides[index]).addClass(this.options.slideLoadingClass) this.slides[index].appendChild( this.createElement(this.list[index], this.proxyListener) ) } } }, loadElements: function (index) { this.iteratePreloadRange(index, this.loadElement) }, unloadElements: function (oldIndex, newIndex) { var preloadRange = this.options.preloadRange this.iteratePreloadRange(oldIndex, function (i) { var diff = Math.abs(i - newIndex) if (diff > preloadRange && diff + preloadRange < this.num) { this.unloadSlide(i) delete this.elements[i] } }) }, addSlide: function (index) { var slide = this.slidePrototype.cloneNode(false) slide.setAttribute('data-index', index) slide.setAttribute('aria-hidden', 'true') this.slidesContainer[0].appendChild(slide) this.slides.push(slide) }, positionSlide: function (index) { var slide = this.slides[index] slide.style.width = this.slideWidth + 'px' if (this.support.transform) { slide.style.left = index * -this.slideWidth + 'px' this.move( index, this.index > index ? -this.slideWidth : this.index < index ? this.slideWidth : 0, 0 ) } }, initSlides: function (reload) { var clearSlides, i if (!reload) { this.positions = [] this.positions.length = this.num this.elements = {} this.picturePrototype = this.support.picture && document.createElement('picture') this.sourcePrototype = this.support.source && document.createElement('source') this.imagePrototype = document.createElement('img') this.elementPrototype = document.createElement('div') this.slidePrototype = this.elementPrototype.cloneNode(false) $(this.slidePrototype).addClass(this.options.slideClass) this.slides = this.slidesContainer[0].children clearSlides = this.options.clearSlides || this.slides.length !== this.num } this.slideWidth = this.container[0].clientWidth this.slideHeight = this.container[0].clientHeight this.slidesContainer[0].style.width = this.num * this.slideWidth + 'px' if (clearSlides) { this.resetSlides() } for (i = 0; i < this.num; i += 1) { if (clearSlides) { this.addSlide(i) } this.positionSlide(i) } // Reposition the slides before and after the given index: if (this.options.continuous && this.support.transform) { this.move(this.circle(this.index - 1), -this.slideWidth, 0) this.move(this.circle(this.index + 1), this.slideWidth, 0) } if (!this.support.transform) { this.slidesContainer[0].style.left = this.index * -this.slideWidth + 'px' } }, unloadSlide: function (index) { var slide, firstChild slide = this.slides[index] firstChild = slide.firstChild if (firstChild !== null) { slide.removeChild(firstChild) } }, unloadAllSlides: function () { var i, len for (i = 0, len = this.slides.length; i < len; i++) { this.unloadSlide(i) } }, toggleControls: function () { var controlsClass = this.options.controlsClass if (this.container.hasClass(controlsClass)) { this.container.removeClass(controlsClass) } else { this.container.addClass(controlsClass) } }, toggleSlideshow: function () { if (!this.interval) { this.play() } else { this.pause() } }, getNodeIndex: function (element) { return parseInt(element.getAttribute('data-index'), 10) }, getNestedProperty: function (obj, property) { property.replace( // Matches native JavaScript notation in a String, // e.g. '["doubleQuoteProp"].dotProp[2]' // eslint-disable-next-line no-useless-escape /\[(?:'([^']+)'|"([^"]+)"|(\d+))\]|(?:(?:^|\.)([^\.\[]+))/g, function (str, singleQuoteProp, doubleQuoteProp, arrayIndex, dotProp) { var prop = dotProp || singleQuoteProp || doubleQuoteProp || (arrayIndex && parseInt(arrayIndex, 10)) if (str && obj) { obj = obj[prop] } } ) return obj }, getDataProperty: function (obj, property) { var key var prop if (obj.dataset) { key = property.replace(/-([a-z])/g, function (_, b) { return b.toUpperCase() }) prop = obj.dataset[key] } else if (obj.getAttribute) { prop = obj.getAttribute( 'data-' + property.replace(/([A-Z])/g, '-$1').toLowerCase() ) } if (typeof prop === 'string') { // eslint-disable-next-line no-useless-escape if ( /^(true|false|null|-?\d+(\.\d+)?|\{[\s\S]*\}|\[[\s\S]*\])$/.test(prop) ) { try { return $.parseJSON(prop) } catch (ignore) { // ignore JSON parsing errors } } return prop } }, getItemProperty: function (obj, property) { var prop = this.getDataProperty(obj, property) if (prop === undefined) { prop = obj[property] } if (prop === undefined) { prop = this.getNestedProperty(obj, property) } return prop }, initStartIndex: function () { var index = this.options.index var urlProperty = this.options.urlProperty var i // Check if the index is given as a list object: if (index && typeof index !== 'number') { for (i = 0; i < this.num; i += 1) { if ( this.list[i] === index || this.getItemProperty(this.list[i], urlProperty) === this.getItemProperty(index, urlProperty) ) { index = i break } } } // Make sure the index is in the list range: this.index = this.circle(parseInt(index, 10) || 0) }, initEventListeners: function () { var that = this var slidesContainer = this.slidesContainer /** * Proxy listener * * @param {event} event original event */ function proxyListener(event) { var type = that.support.transition && that.support.transition.end === event.type ? 'transitionend' : event.type that['on' + type](event) } $(window).on('resize', proxyListener) $(window).on('hashchange', proxyListener) $(document.body).on('keydown', proxyListener) this.container.on('click', proxyListener) if (this.support.touch) { slidesContainer.on( 'touchstart touchmove touchend touchcancel', proxyListener ) } else if (this.options.emulateTouchEvents && this.support.transition) { slidesContainer.on( 'mousedown mousemove mouseup mouseout', proxyListener ) } if (this.support.transition) { slidesContainer.on(this.support.transition.end, proxyListener) } this.proxyListener = proxyListener }, destroyEventListeners: function () { var slidesContainer = this.slidesContainer var proxyListener = this.proxyListener $(window).off('resize', proxyListener) $(document.body).off('keydown', proxyListener) this.container.off('click', proxyListener) if (this.support.touch) { slidesContainer.off( 'touchstart touchmove touchend touchcancel', proxyListener ) } else if (this.options.emulateTouchEvents && this.support.transition) { slidesContainer.off( 'mousedown mousemove mouseup mouseout', proxyListener ) } if (this.support.transition) { slidesContainer.off(this.support.transition.end, proxyListener) } }, handleOpen: function () { if (this.options.onopened) { this.options.onopened.call(this) } }, initWidget: function () { var that = this /** * Open handler * * @param {event} event Gallery open event */ function openHandler(event) { if (event.target === that.container[0]) { that.container.off(that.support.transition.end, openHandler) that.handleOpen() } } this.container = $(this.options.container) if (!this.container.length) { this.console.log( 'blueimp Gallery: Widget container not found.', this.options.container ) return false } this.slidesContainer = this.container .find(this.options.slidesContainer) .first() if (!this.slidesContainer.length) { this.console.log( 'blueimp Gallery: Slides container not found.', this.options.slidesContainer ) return false } this.titleElement = this.container.find(this.options.titleElement).first() this.playPauseElement = this.container .find('.' + this.options.playPauseClass) .first() if (this.num === 1) { this.container.addClass(this.options.singleClass) } if (this.support.svgasimg) { this.container.addClass(this.options.svgasimgClass) } if (this.support.smil) { this.container.addClass(this.options.smilClass) } if (this.options.onopen) { this.options.onopen.call(this) } if (this.support.transition && this.options.displayTransition) { this.container.on(this.support.transition.end, openHandler) } else { this.handleOpen() } if (this.options.hidePageScrollbars) { // Hide the page scrollbars: this.bodyOverflowStyle = document.body.style.overflow document.body.style.overflow = 'hidden' } this.container[0].style.display = 'block' this.initSlides() this.container.addClass(this.options.displayClass) }, initOptions: function (options) { // Create a copy of the prototype options: this.options = $.extend({}, this.options) // Check if carousel mode is enabled: if ( (options && options.carousel) || (this.options.carousel && (!options || options.carousel !== false)) ) { $.extend(this.options, this.carouselOptions) } // Override any given options: $.extend(this.options, options) if (this.num < 3) { // 1 or 2 slides cannot be displayed continuous, // remember the original option by setting to null instead of false: this.options.continuous = this.options.continuous ? null : false } if (!this.support.transition) { this.options.emulateTouchEvents = false } if (this.options.event) { this.preventDefault(this.options.event) } } }) return Gallery })
fred4jupiter/fredbet
src/main/resources/static/blueimpgallery-3.3.0/js/blueimp-gallery.js
JavaScript
mit
50,273
[ 30522, 1013, 1008, 1008, 2630, 5714, 2361, 3916, 1046, 2015, 1008, 16770, 1024, 1013, 1013, 21025, 2705, 12083, 1012, 4012, 1013, 2630, 5714, 2361, 1013, 3916, 1008, 1008, 9385, 2286, 1010, 6417, 24529, 14856, 1008, 16770, 1024, 1013, 1013,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
class ApplicationHelper::Button::MiqCapacity < ApplicationHelper::Button::Basic def visible? @view_context.sandbox[:active_tab] == 'report' && @sb[:summary].present? end end
ManageIQ/manageiq-ui-classic
app/helpers/application_helper/button/miq_capacity.rb
Ruby
apache-2.0
182
[ 30522, 2465, 4646, 16001, 4842, 1024, 1024, 6462, 1024, 1024, 2771, 4160, 17695, 6305, 3012, 1026, 4646, 16001, 4842, 1024, 1024, 6462, 1024, 1024, 3937, 13366, 5710, 1029, 1030, 3193, 1035, 6123, 1012, 5472, 8758, 1031, 1024, 3161, 1035, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
////////////////////////////////////////////////////////////////////////// // This file is part of openPSTD. // // // // openPSTD 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. // // // // openPSTD 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 openPSTD. If not, see <http://www.gnu.org/licenses/>. // // // ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// // // Date: 1-11-2015 // // // Authors: M. R. Fortuin // // // Purpose: Test cases for de Edge class // // ////////////////////////////////////////////////////////////////////////// #ifdef STAND_ALONE # define BOOST_TEST_MODULE Main #endif #include <boost/test/unit_test.hpp> #include <GUI/Edges.h> using namespace OpenPSTD::GUI; BOOST_AUTO_TEST_SUITE(GUI) BOOST_AUTO_TEST_SUITE(GUI_Edges) BOOST_AUTO_TEST_CASE(TestHorizontal) { BOOST_CHECK(Edge(QVector2D(0, 10), QVector2D(10, 10), 0, false).IsHorizontal()); BOOST_CHECK(!Edge(QVector2D(10, 0), QVector2D(10, 10), 0, false).IsHorizontal()); } BOOST_AUTO_TEST_CASE(TestVertical) { BOOST_CHECK(Edge(QVector2D(10, 0), QVector2D(10, 10), 0, false).IsVertical()); BOOST_CHECK(!Edge(QVector2D(0, 10), QVector2D(10, 10), 0, false).IsVertical()); } BOOST_AUTO_TEST_CASE(TestGetStart) { BOOST_CHECK(Edge(QVector2D(0, 10), QVector2D(10, 10), 0, false).GetStart() == QVector2D(0, 10)); } BOOST_AUTO_TEST_CASE(TestGetEnd) { BOOST_CHECK(Edge(QVector2D(0, 10), QVector2D(10, 10), 0, false).GetEnd() == QVector2D(10, 10)); } BOOST_AUTO_TEST_CASE(TestOnSameLine) { BOOST_CHECK(Edge::OnSameLine(Edge(QVector2D(0, 10), QVector2D(10, 10), 0, false), Edge(QVector2D(0, 10), QVector2D(10, 10), 0, false))); BOOST_CHECK(!Edge::OnSameLine(Edge(QVector2D(0, 11), QVector2D(10, 11), 0, false), Edge(QVector2D(0, 10), QVector2D(10, 10), 0, false))); BOOST_CHECK(!Edge::OnSameLine(Edge(QVector2D(10, 0), QVector2D(10, 10), 0, false), Edge(QVector2D(0, 10), QVector2D(10, 10), 0, false))); BOOST_CHECK(Edge::OnSameLine(Edge(QVector2D(0, 10), QVector2D(10, 10), 0, false), Edge(QVector2D(10, 10), QVector2D(20, 10), 0, false))); BOOST_CHECK(!Edge::OnSameLine(Edge(QVector2D(0, 0), QVector2D(10, 10), 0, false), Edge(QVector2D(10, 10), QVector2D(20, 10), 0, false))); } BOOST_AUTO_TEST_CASE(TestSubstract) { BOOST_CHECK(Edge(QVector2D(0, 10), QVector2D(10, 10), 0, false).Substract(Edge(QVector2D(0, 10), QVector2D(10, 10), 0, false)).empty()); BOOST_CHECK(Edge(QVector2D(0, 10), QVector2D(10, 10), 0, false).Substract(Edge(QVector2D(0, 10), QVector2D(5, 10), 0, false))[0].GetStart() == QVector2D(5, 10)); BOOST_CHECK(Edge(QVector2D(0, 10), QVector2D(10, 10), 0, false).Substract(Edge(QVector2D(0, 10), QVector2D(5, 10), 0, false))[0].GetEnd() == QVector2D(10, 10)); BOOST_CHECK(Edge(QVector2D(0, 10), QVector2D(10, 10), 0, false).Substract(Edge(QVector2D(5, 10), QVector2D(10, 10), 0, false))[0].GetStart() == QVector2D(0, 10)); BOOST_CHECK(Edge(QVector2D(0, 10), QVector2D(10, 10), 0, false).Substract(Edge(QVector2D(5, 10), QVector2D(10, 10), 0, false))[0].GetEnd() == QVector2D(5, 10)); } BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END()
openPSTD/openPSTD
test/GUI/Edges-test.cpp
C++
gpl-3.0
4,237
[ 30522, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* -*- mode:C++; -*- */ /* MIT License -- MyThOS: The Many-Threads Operating System * * 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. * * Copyright 2016 Robert Kuban, Randolf Rotta, and contributors, BTU Cottbus-Senftenberg */ #include "objects/CapEntry.hh" #include "objects/mlog.hh" #include "util/error-trace.hh" namespace mythos { void CapEntry::initRoot(Cap c) { ASSERT(isKernelAddress(this)); ASSERT(c.isUsable()); ASSERT(cap().isEmpty()); Link loopLink(this); _next.store(loopLink.value()); _prev.store(loopLink.value()); _cap.store(c.value()); } bool CapEntry::tryAcquire() { auto expected = Cap::asEmpty().value(); const auto desired = Cap::asAllocated().value(); return _cap.compare_exchange_strong(expected, desired); } optional<void> CapEntry::acquire() { if (tryAcquire()) RETURN(Error::SUCCESS); else THROW(Error::CAP_NONEMPTY); } void CapEntry::commit(const Cap& cap) { ASSERT(isLinked()); _cap.store(cap.value()); } void CapEntry::reset() { ASSERT(isUnlinked() || cap().isAllocated()); _prev.store(Link().value()); _next.store(Link().value()); // mark as empty _cap.store(Cap().value()); } void CapEntry::setPrevPreserveFlags(CapEntry* ptr) { auto expected = _prev.load(); uintlink_t desired; do { desired = Link(expected).withPtr(ptr).value(); } while (!_prev.compare_exchange_weak(expected, desired)); } optional<void> CapEntry::moveTo(CapEntry& other) { ASSERT(other.cap().isAllocated()); ASSERT(!other.isLinked()); if (!lock_prev()) { other.reset(); THROW(Error::GENERIC_ERROR); } lock(); auto thisCap = cap(); if (isRevoking() || !thisCap.isUsable()) { other.reset(); unlock(); unlock_prev(); THROW(Error::INVALID_CAPABILITY); } auto next= Link(_next).withoutFlags(); auto prev= Link(_prev).withoutFlags(); next->setPrevPreserveFlags(&other); other._next.store(next.value()); // deleted or revoking can not be set in other._prev // as we allocated other for moving other._prev.store(prev.value()); prev->_next.store(Link(&other).value()); other.commit(thisCap); _prev.store(Link().value()); _next.store(Link().value()); _cap.store(Cap().value()); RETURN(Error::SUCCESS); } bool CapEntry::kill() { auto expected = _cap.load(); Cap curCap; do { curCap = Cap(expected); MLOG_DETAIL(mlog::cap, this, ".kill", DVAR(curCap)); if (!curCap.isUsable()) { return curCap.isZombie() ? true : false; } } while (!_cap.compare_exchange_strong(expected, curCap.asZombie().value())); return true; } optional<void> CapEntry::unlink() { auto next = Link(_next).withoutFlags(); auto prev = Link(_prev).withoutFlags(); next->_prev.store(prev.value()); prev->_next.store(next.value()); _prev.store(Link().value()); _next.store(Link().value()); RETURN(Error::SUCCESS); } Error CapEntry::try_lock_prev() { auto prev = Link(_prev).ptr(); if (!prev) { return Error::GENERIC_ERROR; } if (prev->try_lock()) { if (Link(_prev.load()).ptr() == prev) { return Error::SUCCESS; } else { // my _prev has changed in the mean time prev->unlock(); return Error::RETRY; } } else return Error::RETRY; } bool CapEntry::lock_prev() { Error result; for (result = try_lock_prev(); result == Error::RETRY; result = try_lock_prev()) { hwthread_pause(); } return result == Error::SUCCESS; } } // namespace mythos
ManyThreads/mythos
kernel/objects/capability-spinning/objects/CapEntry.cc
C++
mit
4,691
[ 30522, 1013, 1008, 1011, 1008, 1011, 5549, 1024, 1039, 1009, 1009, 1025, 1011, 1008, 1011, 1008, 1013, 1013, 1008, 10210, 6105, 1011, 1011, 10661, 2891, 1024, 1996, 2116, 1011, 16457, 4082, 2291, 1008, 1008, 6656, 2003, 2182, 3762, 4379, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// -*- Mode: Go; indent-tabs-mode: t -*- /* * Copyright (C) 2016-2017 Canonical Ltd * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3 as * published by the Free Software Foundation. * * 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/>. * */ package builtin import ( "strings" "github.com/snapcore/snapd/interfaces" "github.com/snapcore/snapd/interfaces/apparmor" "github.com/snapcore/snapd/interfaces/dbus" "github.com/snapcore/snapd/interfaces/seccomp" "github.com/snapcore/snapd/interfaces/udev" "github.com/snapcore/snapd/snap" ) const udisks2Summary = `allows operating as or interacting with the UDisks2 service` const udisks2BaseDeclarationSlots = ` udisks2: allow-installation: slot-snap-type: - app deny-connection: true deny-auto-connection: true ` const udisks2PermanentSlotAppArmor = ` # Description: Allow operating as the udisks2. This gives privileged access to # the system. # DBus accesses #include <abstractions/dbus-strict> dbus (send) bus=system path=/org/freedesktop/DBus interface=org.freedesktop.DBus member="{Request,Release}Name" peer=(name=org.freedesktop.DBus, label=unconfined), dbus (send) bus=system path=/org/freedesktop/DBus interface=org.freedesktop.DBus member="GetConnectionUnix{ProcessID,User}" peer=(label=unconfined), # Allow binding the service to the requested connection name dbus (bind) bus=system name="org.freedesktop.UDisks2", # Allow unconfined to talk to us. The API for unconfined will be limited # with DBus policy, below. dbus (receive, send) bus=system path=/org/freedesktop/UDisks2{,/**} interface=org.freedesktop.DBus* peer=(label=unconfined), # Needed for mount/unmount operations capability sys_admin, # Allow scanning of devices network netlink raw, /run/udev/data/b[0-9]*:[0-9]* r, /sys/devices/**/block/** r, # Mount points could be in /run/media/<user>/* or /media/<user>/* /run/systemd/seats/* r, /{,run/}media/{,**} rw, mount options=(ro,nosuid,nodev) /dev/{sd*,mmcblk*} -> /{,run/}media/**, mount options=(rw,nosuid,nodev) /dev/{sd*,mmcblk*} -> /{,run/}media/**, umount /{,run/}media/**, # This should probably be patched to use $SNAP_DATA/run/... /run/udisks2/{,**} rw, # udisksd execs mount/umount to do the actual operations /bin/mount ixr, /bin/umount ixr, # mount/umount (via libmount) track some mount info in these files /run/mount/utab* wrl, # Udisks2 needs to read the raw device for partition information. These rules # give raw read access to the system disks and therefore the entire system. /dev/sd* r, /dev/mmcblk* r, /dev/vd* r, # Needed for probing raw devices capability sys_rawio, ` const udisks2ConnectedSlotAppArmor = ` # Allow connected clients to interact with the service. This gives privileged # access to the system. dbus (receive, send) bus=system path=/org/freedesktop/UDisks2/** interface=org.freedesktop.DBus.Properties peer=(label=###PLUG_SECURITY_TAGS###), dbus (receive, send) bus=system path=/org/freedesktop/UDisks2 interface=org.freedesktop.DBus.ObjectManager peer=(label=###PLUG_SECURITY_TAGS###), # Allow access to the Udisks2 API dbus (receive, send) bus=system path=/org/freedesktop/UDisks2/** interface=org.freedesktop.UDisks2.* peer=(label=###PLUG_SECURITY_TAGS###), # Allow clients to introspect the service dbus (receive) bus=system path=/org/freedesktop/UDisks2 interface=org.freedesktop.DBus.Introspectable member=Introspect peer=(label=###PLUG_SECURITY_TAGS###), ` const udisks2ConnectedPlugAppArmor = ` # Description: Allow using udisks service. This gives privileged access to the # service. #include <abstractions/dbus-strict> dbus (receive, send) bus=system path=/org/freedesktop/UDisks2/** interface=org.freedesktop.DBus.Properties peer=(label=###SLOT_SECURITY_TAGS###), dbus (receive, send) bus=system path=/org/freedesktop/UDisks2 interface=org.freedesktop.DBus.ObjectManager peer=(label=###SLOT_SECURITY_TAGS###), # Allow access to the Udisks2 API dbus (receive, send) bus=system path=/org/freedesktop/UDisks2/** interface=org.freedesktop.UDisks2.* peer=(label=###SLOT_SECURITY_TAGS###), # Allow clients to introspect the service dbus (send) bus=system path=/org/freedesktop/UDisks2 interface=org.freedesktop.DBus.Introspectable member=Introspect peer=(label=###SLOT_SECURITY_TAGS###), ` const udisks2PermanentSlotSecComp = ` bind chown32 fchown fchown32 fchownat lchown lchown32 mount shmctl umount umount2 # libudev socket AF_NETLINK - NETLINK_KOBJECT_UEVENT ` const udisks2PermanentSlotDBus = ` <policy user="root"> <allow own="org.freedesktop.UDisks2"/> <allow send_destination="org.freedesktop.UDisks2"/> </policy> <policy context="default"> <allow send_destination="org.freedesktop.UDisks2" send_interface="org.freedesktop.DBus.Introspectable" /> </policy> ` const udisks2ConnectedPlugDBus = ` <policy context="default"> <deny own="org.freedesktop.UDisks2"/> <deny send_destination="org.freedesktop.UDisks2"/> </policy> ` const udisks2PermanentSlotUDev = ` # These udev rules come from the upstream udisks2 package # # This file contains udev rules for udisks 2.x # # Do not edit this file, it will be overwritten on updates # # ------------------------------------------------------------------------ # Probing # ------------------------------------------------------------------------ # Skip probing if not a block device or if requested by other rules # SUBSYSTEM!="block", GOTO="udisks_probe_end" ENV{DM_MULTIPATH_DEVICE_PATH}=="?*", GOTO="udisks_probe_end" ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="?*", GOTO="udisks_probe_end" # MD-RAID (aka Linux Software RAID) members # # TODO: file bug against mdadm(8) to have --export-prefix option that can be used with e.g. UDISKS_MD_MEMBER # SUBSYSTEM=="block", ENV{ID_FS_USAGE}=="raid", ENV{ID_FS_TYPE}=="linux_raid_member", ENV{UDISKS_MD_MEMBER_LEVEL}=="", IMPORT{program}="/bin/sh -c '/sbin/mdadm --examine --export $tempnode | sed s/^MD_/UDISKS_MD_MEMBER_/g'" SUBSYSTEM=="block", KERNEL=="md*", ENV{DEVTYPE}!="partition", IMPORT{program}="/bin/sh -c '/sbin/mdadm --detail --export $tempnode | sed s/^MD_/UDISKS_MD_/g'" LABEL="udisks_probe_end" # ------------------------------------------------------------------------ # Tag floppy drives since they need special care # PC floppy drives # KERNEL=="fd*", ENV{ID_DRIVE_FLOPPY}="1" # USB floppy drives # SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="08", ATTRS{bInterfaceSubClass}=="04", ENV{ID_DRIVE_FLOPPY}="1" # ATA Zip drives # ENV{ID_VENDOR}=="*IOMEGA*", ENV{ID_MODEL}=="*ZIP*", ENV{ID_DRIVE_FLOPPY_ZIP}="1" # TODO: figure out if the drive supports SD and SDHC and what the current # kind of media is - right now we just assume SD KERNEL=="mmcblk[0-9]", SUBSYSTEMS=="mmc", ENV{DEVTYPE}=="disk", ENV{ID_DRIVE_FLASH_SD}="1", ENV{ID_DRIVE_MEDIA_FLASH_SD}="1" # ditto for memstick KERNEL=="mspblk[0-9]", SUBSYSTEMS=="memstick", ENV{DEVTYPE}=="disk", ENV{ID_DRIVE_FLASH_MS}="1", ENV{ID_DRIVE_MEDIA_FLASH_MS}="1" # TODO: maybe automatically convert udisks1 properties to udisks2 ones? # (e.g. UDISKS_PRESENTATION_HIDE -> UDISKS_IGNORE) # ------------------------------------------------------------------------ # ------------------------------------------------------------------------ # ------------------------------------------------------------------------ # Whitelist for tagging drives with the property media type. # TODO: figure out where to store this database SUBSYSTEMS=="usb", ATTRS{idVendor}=="050d", ATTRS{idProduct}=="0248", ENV{ID_INSTANCE}=="0:0", ENV{ID_DRIVE_FLASH_CF}="1" SUBSYSTEMS=="usb", ATTRS{idVendor}=="050d", ATTRS{idProduct}=="0248", ENV{ID_INSTANCE}=="0:1", ENV{ID_DRIVE_FLASH_MS}="1" SUBSYSTEMS=="usb", ATTRS{idVendor}=="050d", ATTRS{idProduct}=="0248", ENV{ID_INSTANCE}=="0:2", ENV{ID_DRIVE_FLASH_SM}="1" SUBSYSTEMS=="usb", ATTRS{idVendor}=="050d", ATTRS{idProduct}=="0248", ENV{ID_INSTANCE}=="0:3", ENV{ID_DRIVE_FLASH_SD}="1" SUBSYSTEMS=="usb", ATTRS{idVendor}=="05e3", ATTRS{idProduct}=="070e", ENV{ID_INSTANCE}=="0:0", ENV{ID_DRIVE_FLASH_CF}="1" SUBSYSTEMS=="usb", ATTRS{idVendor}=="05e3", ATTRS{idProduct}=="070e", ENV{ID_INSTANCE}=="0:1", ENV{ID_DRIVE_FLASH_SM}="1" SUBSYSTEMS=="usb", ATTRS{idVendor}=="05e3", ATTRS{idProduct}=="070e", ENV{ID_INSTANCE}=="0:2", ENV{ID_DRIVE_FLASH_SD}="1" SUBSYSTEMS=="usb", ATTRS{idVendor}=="05e3", ATTRS{idProduct}=="070e", ENV{ID_INSTANCE}=="0:3", ENV{ID_DRIVE_FLASH_MS}="1" # APPLE SD Card Reader (MacbookPro5,4) # SUBSYSTEMS=="usb", ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="8403", ENV{ID_DRIVE_FLASH_SD}="1" # Realtek card readers DRIVERS=="rts_pstor", ENV{ID_DRIVE_FLASH_SD}="1" DRIVERS=="rts5229", ENV{ID_DRIVE_FLASH_SD}="1" # Lexar Dual Slot USB 3.0 Reader Professional SUBSYSTEMS=="usb", ENV{ID_VENDOR_ID}=="05dc",ENV{ID_MODEL_ID}=="b049", ENV{ID_INSTANCE}=="0:0", ENV{ID_DRIVE_FLASH_CF}="1" SUBSYSTEMS=="usb", ENV{ID_VENDOR_ID}=="05dc",ENV{ID_MODEL_ID}=="b049", ENV{ID_INSTANCE}=="0:1", ENV{ID_DRIVE_FLASH_SD}="1" # Transcend USB 3.0 Multi-Card Reader (TS-RDF8K) SUBSYSTEMS=="usb", ENV{ID_VENDOR_ID}=="8564",ENV{ID_MODEL_ID}=="4000", ENV{ID_INSTANCE}=="0:0", ENV{ID_DRIVE_FLASH_CF}="1" SUBSYSTEMS=="usb", ENV{ID_VENDOR_ID}=="8564",ENV{ID_MODEL_ID}=="4000", ENV{ID_INSTANCE}=="0:1", ENV{ID_DRIVE_FLASH_SD}="1" SUBSYSTEMS=="usb", ENV{ID_VENDOR_ID}=="8564",ENV{ID_MODEL_ID}=="4000", ENV{ID_INSTANCE}=="0:2", ENV{ID_DRIVE_FLASH_MS}="1" # Common theme # SUBSYSTEMS=="usb", ENV{ID_MODEL}=="*Reader*SD*", ENV{ID_DRIVE_FLASH_SD}="1" SUBSYSTEMS=="usb", ENV{ID_MODEL}=="*CF_Reader*", ENV{ID_DRIVE_FLASH_CF}="1" SUBSYSTEMS=="usb", ENV{ID_MODEL}=="*SM_Reader*", ENV{ID_DRIVE_FLASH_SM}="1" SUBSYSTEMS=="usb", ENV{ID_MODEL}=="*MS_Reader*", ENV{ID_DRIVE_FLASH_MS}="1" # USB stick / thumb drives # SUBSYSTEMS=="usb", ENV{ID_VENDOR}=="*Kingston*", ENV{ID_MODEL}=="*DataTraveler*", ENV{ID_DRIVE_THUMB}="1" SUBSYSTEMS=="usb", ENV{ID_VENDOR}=="*SanDisk*", ENV{ID_MODEL}=="*Cruzer*", ENV{ID_CDROM}!="1", ENV{ID_DRIVE_THUMB}="1" SUBSYSTEMS=="usb", ENV{ID_VENDOR}=="HP", ENV{ID_MODEL}=="*v125w*", ENV{ID_DRIVE_THUMB}="1" SUBSYSTEMS=="usb", ENV{ID_VENDOR_ID}=="13fe", ENV{ID_MODEL}=="*Patriot*", ENV{ID_DRIVE_THUMB}="1" SUBSYSTEMS=="usb", ENV{ID_VENDOR}=="*JetFlash*", ENV{ID_MODEL}=="*Transcend*", ENV{ID_DRIVE_THUMB}="1" # SD-Card reader in Chromebook Pixel SUBSYSTEMS=="usb", ENV{ID_VENDOR_ID}=="05e3", ENV{ID_MODEL_ID}=="0727", ENV{ID_DRIVE_FLASH_SD}="1" # ------------------------------------------------------------------------ # ------------------------------------------------------------------------ # ------------------------------------------------------------------------ # Devices which should not be display in the user interface # # (note that RAID/LVM members are not normally shown in an user # interface so setting UDISKS_IGNORE at first does not seem to achieve # anything. However it helps for RAID/LVM members that are encrypted # using LUKS. See bug #51439.) # Apple Bootstrap partitions ENV{ID_PART_ENTRY_SCHEME}=="mac", ENV{ID_PART_ENTRY_TYPE}=="Apple_Bootstrap", ENV{UDISKS_IGNORE}="1" # Apple Boot partitions ENV{ID_PART_ENTRY_SCHEME}=="gpt", ENV{ID_PART_ENTRY_TYPE}=="426f6f74-0000-11aa-aa11-00306543ecac", ENV{UDISKS_IGNORE}="1" # special DOS partition types (EFI, hidden, etc.) and RAID/LVM # see http://www.win.tue.nl/~aeb/partitions/partition_types-1.html ENV{ID_PART_ENTRY_SCHEME}=="dos", \ ENV{ID_PART_ENTRY_TYPE}=="0x0|0x11|0x12|0x14|0x16|0x17|0x1b|0x1c|0x1e|0x27|0x3d|0x84|0x8d|0x8e|0x90|0x91|0x92|0x93|0x97|0x98|0x9a|0x9b|0xbb|0xc2|0xc3|0xdd|0xef|0xfd", \ ENV{UDISKS_IGNORE}="1" # special GUID-identified partition types (EFI System Partition, BIOS Boot partition, RAID/LVM) # see http://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_type_GUIDs ENV{ID_PART_ENTRY_SCHEME}=="gpt", \ ENV{ID_PART_ENTRY_TYPE}=="c12a7328-f81f-11d2-ba4b-00a0c93ec93b|21686148-6449-6e6f-744e-656564454649|a19d880f-05fc-4d3b-a006-743f0f84911e|e6d6d379-f507-44c2-a23c-238f2a3df928|e3c9e316-0b5c-4db8-817d-f92df00215ae|de94bba4-06d1-4d40-a16a-bfd50179d6ac", \ ENV{UDISKS_IGNORE}="1" # MAC recovery/tool partitions which are useless on Linux ENV{ID_PART_ENTRY_SCHEME}=="mac", \ ENV{ID_CDROM}=="?*", ENV{ID_FS_TYPE}=="udf", ENV{ID_FS_LABEL}=="WD*SmartWare", \ ENV{UDISKS_IGNORE}="1" # recovery partitions ENV{ID_FS_TYPE}=="ntfs|vfat", \ ENV{ID_FS_LABEL}=="Recovery|RECOVERY|Lenovo_Recovery|HP_RECOVERY|Recovery_Partition|DellUtility|DellRestore|IBM_SERVICE|SERVICEV001|SERVICEV002|SYSTEM_RESERVED|System_Reserved|WINRE_DRV|DIAGS|IntelRST", \ ENV{UDISKS_IGNORE}="1" # read-only non-Linux software installer partitions ENV{ID_VENDOR}=="Sony", ENV{ID_MODEL}=="PRS*Launcher", ENV{UDISKS_IGNORE}="1" # non-Linux software KERNEL=="sr*", ENV{ID_VENDOR}=="SanDisk", ENV{ID_MODEL}=="Cruzer", ENV{ID_FS_LABEL}=="U3_System", ENV{UDISKS_IGNORE}="1" # Content created using isohybrid (typically used on CDs and USB # sticks for bootable media) is a bit special insofar that the # interesting content is on a DOS partition with type 0x00 ... which # is hidden above. So undo this. # # See http://mjg59.dreamwidth.org/11285.html for more details # ENV{ID_PART_TABLE_TYPE}=="dos", ENV{ID_PART_ENTRY_TYPE}=="0x0", ENV{ID_PART_ENTRY_NUMBER}=="1", ENV{ID_FS_TYPE}=="iso9660|udf", ENV{UDISKS_IGNORE}="0" ` type udisks2Interface struct{} func (iface *udisks2Interface) Name() string { return "udisks2" } func (iface *udisks2Interface) StaticInfo() interfaces.StaticInfo { return interfaces.StaticInfo{ Summary: udisks2Summary, BaseDeclarationSlots: udisks2BaseDeclarationSlots, } } func (iface *udisks2Interface) DBusConnectedPlug(spec *dbus.Specification, plug *interfaces.ConnectedPlug, slot *interfaces.ConnectedSlot) error { spec.AddSnippet(udisks2ConnectedPlugDBus) return nil } func (iface *udisks2Interface) DBusPermanentSlot(spec *dbus.Specification, slot *snap.SlotInfo) error { spec.AddSnippet(udisks2PermanentSlotDBus) return nil } func (iface *udisks2Interface) AppArmorConnectedPlug(spec *apparmor.Specification, plug *interfaces.ConnectedPlug, slot *interfaces.ConnectedSlot) error { old := "###SLOT_SECURITY_TAGS###" new := slotAppLabelExpr(slot) snippet := strings.Replace(udisks2ConnectedPlugAppArmor, old, new, -1) spec.AddSnippet(snippet) return nil } func (iface *udisks2Interface) AppArmorPermanentSlot(spec *apparmor.Specification, slot *snap.SlotInfo) error { spec.AddSnippet(udisks2PermanentSlotAppArmor) return nil } func (iface *udisks2Interface) UDevPermanentSlot(spec *udev.Specification, slot *snap.SlotInfo) error { spec.AddSnippet(udisks2PermanentSlotUDev) spec.TagDevice(`SUBSYSTEM=="block"`) // # This tags all USB devices, so we'll use AppArmor to mediate specific access (eg, /dev/sd* and /dev/mmcblk*) spec.TagDevice(`SUBSYSTEM=="usb"`) return nil } func (iface *udisks2Interface) AppArmorConnectedSlot(spec *apparmor.Specification, plug *interfaces.ConnectedPlug, slot *interfaces.ConnectedSlot) error { old := "###PLUG_SECURITY_TAGS###" new := plugAppLabelExpr(plug) snippet := strings.Replace(udisks2ConnectedSlotAppArmor, old, new, -1) spec.AddSnippet(snippet) return nil } func (iface *udisks2Interface) SecCompPermanentSlot(spec *seccomp.Specification, slot *snap.SlotInfo) error { spec.AddSnippet(udisks2PermanentSlotSecComp) return nil } func (iface *udisks2Interface) AutoConnect(*snap.PlugInfo, *snap.SlotInfo) bool { // allow what declarations allowed return true } func init() { registerIface(&udisks2Interface{}) }
Conan-Kudo/snapd
interfaces/builtin/udisks2.go
GO
gpl-3.0
16,059
[ 30522, 1013, 1013, 1011, 1008, 1011, 5549, 1024, 2175, 1025, 27427, 4765, 1011, 21628, 2015, 1011, 5549, 1024, 1056, 1011, 1008, 1011, 1013, 1008, 1008, 9385, 1006, 1039, 1007, 2355, 1011, 2418, 18562, 5183, 1008, 1008, 2023, 2565, 2003, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
var gulp = require('gulp'); var blocksConfig = require('../config').geniblocksRsrc; var gvConfig = require('../config').geniverseRsrc; // Copy files directly simple exports.geniblocksRsrc = function geniblocksRsrc() { return gulp.src(blocksConfig.src) .pipe(gulp.dest(blocksConfig.dest)); }; exports.geniverseRsrc = function geniverseRsrc() { gulp.src(gvConfig.index) .pipe(gulp.dest(gvConfig.destIndex)); return gulp.src(gvConfig.src) .pipe(gulp.dest(gvConfig.dest)); };
concord-consortium/geniblocks
gulp/tasks/geniblocks-rsrc-task.js
JavaScript
mit
522
[ 30522, 13075, 26546, 1027, 5478, 1006, 1005, 26546, 1005, 1007, 1025, 30524, 12322, 7878, 21338, 21338, 2278, 1025, 13075, 1043, 25465, 2239, 8873, 2290, 1027, 5478, 1006, 1005, 1012, 1012, 1013, 9530, 8873, 2290, 1005, 1007, 1012, 8991, 16...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# go-zodiac-signs Golang (go) lib to calculate zodiac signs ## Get `go get -u github.com/vsiv/gozodiac` ## Usage `sign = gozodiac.GetZodiacSign(testTime)` __Note:__ Both matching signs are returned for *cusp* dates (ex. April 20th). ### Author [V](http://www.vishalshah.org)
vsiv/gozodiac
README.md
Markdown
mit
279
[ 30522, 1001, 2175, 1011, 28501, 1011, 5751, 2175, 25023, 1006, 2175, 1007, 5622, 2497, 2000, 18422, 28501, 5751, 1001, 1001, 2131, 1036, 2175, 2131, 1011, 1057, 21025, 2705, 12083, 1012, 4012, 1013, 5443, 12848, 1013, 2175, 6844, 9032, 2278...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package com.gmail.hexragon.gn4rBot.command.ai; import com.gmail.hexragon.gn4rBot.managers.commands.CommandExecutor; import com.gmail.hexragon.gn4rBot.managers.commands.annotations.Command; import com.gmail.hexragon.gn4rBot.util.GnarMessage; import com.google.code.chatterbotapi.ChatterBot; import com.google.code.chatterbotapi.ChatterBotFactory; import com.google.code.chatterbotapi.ChatterBotSession; import com.google.code.chatterbotapi.ChatterBotType; import net.dv8tion.jda.entities.User; import org.apache.commons.lang3.StringUtils; import java.util.Map; import java.util.WeakHashMap; @Command( aliases = {"cbot", "cleverbot"}, usage = "(query)", description = "Talk to Clever-Bot." ) public class PrivateCleverbotCommand extends CommandExecutor { private ChatterBotFactory factory = new ChatterBotFactory(); private ChatterBotSession session = null; private Map<User, ChatterBotSession> sessionMap = new WeakHashMap<>(); @Override public void execute(GnarMessage message, String[] args) { try { if (!sessionMap.containsKey(message.getAuthor())) { ChatterBot bot = factory.create(ChatterBotType.CLEVERBOT); sessionMap.put(message.getAuthor(), bot.createSession()); } message.replyRaw(sessionMap.get(message.getAuthor()).think(StringUtils.join(args, " "))); } catch (Exception e) { message.reply("Chat Bot encountered an exception. Restarting. `:[`"); sessionMap.remove(message.getAuthor()); } } }
DankBots/GN4R
src/main/java/com/gmail/hexragon/gn4rBot/command/ai/PrivateCleverbotCommand.java
Java
mit
1,619
[ 30522, 7427, 4012, 1012, 20917, 4014, 1012, 2002, 30524, 1012, 20917, 4014, 1012, 2002, 2595, 29181, 2239, 1012, 1043, 2078, 2549, 15185, 4140, 1012, 10489, 1012, 10954, 1012, 3094, 10288, 8586, 16161, 2099, 1025, 12324, 4012, 1012, 20917, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
$(document).on("ready" ,function(){ listaBrecha();// LLamar al metodo para listar las brechas //Inicio cargar combo servicio public $("#btn-NuevaBrecha").click(function()//para que cargue el como una vez echo click sino repetira datos { //alert('hola'); listaSerPubAsocCombo();//para llenar el combo de servicio publico asociado }); //fin cargar combo servicio public //AGREGAR UNA NUEVA BRECHA $("#form-addBrecha").submit(function(event) { event.preventDefault(); $.ajax({ url:base_url+"index.php/MantenimientoBrecha/AddBrecha", type:$(this).attr('method'), data:$(this).serialize(), success:function(resp){ var registros = eval(resp); for (var i = 0; i < registros.length; i++) { if(registros[i]["VALOR"]==1){ swal("",registros[i]["MENSAJE"], "success"); $('#form-addBrecha')[0].reset(); $("#VentanaRegistraBrecha").modal("hide"); }else{ swal('',registros[i]["MENSAJE"],'error' ) } /*swal("", registros[i]["MENSAJE"], "success");*/ }; $('#table-brecha').dataTable()._fnAjaxUpdate(); //SIRVE PARA REFRESCAR LA TABLA } }); }); //FIN AGREGAR UNA NUEVA BRECHA }); //-------------------------MANTENIMIENTO DE BRECHAS ---------------------------- //TRAER DATOS EN UN COMBO DE SERVICIOS PUBLICO ASOCIADO var listaSerPubAsocCombo=function(id_serv_pub_asoc) //PARA RECIR PARAMETRO PARA MANTENER VALOR DEL CAMBO { html=""; $("#cbxServPubAsoc").html(html); //nombre del selectpicker RUBRO DE EJECUCION $("#cbxSerPubAsocModificar").html(html); event.preventDefault(); $.ajax({ "url":base_url +"index.php/ServicioPublico/GetServicioAsociado", type:"POST", success:function(respuesta){ // alert(respuesta); var registros = eval(respuesta); for (var i = 0; i <registros.length;i++) { html +="<option value="+registros[i]["id_serv_pub_asoc"]+"> "+ registros[i]["nombre_serv_pub_asoc"]+" </option>"; }; $("#cbxServPubAsoc").html(html);// //MODIFICAR $("#cbxSerPubAsocModificar").html(html); $('select[name=cbxSerPubAsocModificar]').val(id_serv_pub_asoc) // VALOR DEL COMBO SELECCIONADO $('select[name=cbxSerPubAsocModificar]').change(); //FIN MODIFICAR $('.selectpicker').selectpicker('refresh'); } }); } //FIN TRAER DATOS EN UN COMBO DE RUBRO EJECUCION /*listar las brechas en el datatable*/ var listaBrecha=function() { var table=$("#table-brecha").DataTable({ "processing":true, "serverSide":false, destroy:true, "ajax":{ "url":base_url +"index.php/MantenimientoBrecha/GetBrecha", "method":"POST", "dataSrc":"" }, "columns":[ {"data":"id_brecha"}, {"data":"id_serv_pub_asoc"}, {"data":"nombre_serv_pub_asoc"}, //DATO DEL SERVICIO PUB ASOCIADO PARA ENVIAR DATO AL COMBO ACTUALIZAR Y SE MANTENGA EL VALOR {"data":"nombre_brecha"}, {"data":"descripcion_brecha"}, {"defaultContent":"<button type='button' class='editar btn btn-primary btn-xs' data-toggle='modal' data-target='#VentanaModificarBrecha'><i class='ace-icon fa fa-pencil bigger-120'></i></button><button type='button' class='eliminar btn btn-danger btn-xs' data-toggle='modal' data-target='#'><i class='fa fa-trash-o'></i></button>"} ], "language":idioma_espanol }); BrechaData("#table-brecha",table); //TRAER LA DATA DE LAS BRECHAS PARA ACTUALIZAR EliminarBrechaLista("#table-brecha",table);//TRAER LA DATA DE LAS BRECHAS PARA ELIMINAR } /*fin de listar las brechas en el datatable*/ //ACTUALIZAR UNA BRECHA $("#form-ActualizarBrecha").submit(function(event) { event.preventDefault(); $.ajax({ url:base_url+"index.php/MantenimientoBrecha/UpdateBrecha", type:$(this).attr('method'), data:$(this).serialize(), success:function(resp){ swal("ACTUALIZADO!", resp, "success"); $('#table-brecha').dataTable()._fnAjaxUpdate(); } }); }); //FIN ACTUALIZAR UNA BRECHA // CAMPOS QUE SE ACTUALIZARAN DE LAS BRECHAS var BrechaData=function(tbody,table){ $(tbody).on("click","button.editar",function(){ var data=table.row( $(this).parents("tr")).data(); var id_brecha=$('#txt_IdBrechaModif').val(data.id_brecha); var id_serv_pub_asoc=data.id_serv_pub_asoc; var nombre_brecha=$('#txt_NombreBrechaU').val(data.nombre_brecha); var descripcion_brecha=$('#txtArea_DescBrechaU').val(data.descripcion_brecha); listaSerPubAsocCombo(id_serv_pub_asoc);//llamar al evento de combo box para actualizar }); } // FIN DE CAMPOS QUE SE ACTUALIZARAN DE LAS BRECHAS //ELIMINAR UNA BRECHA var EliminarBrechaLista=function(tbody,table){ $(tbody).on("click","button.eliminar",function(){ var data=table.row( $(this).parents("tr")).data(); var id_brecha=data.id_brecha; swal({ title: "Esta seguro que desea eliminar la brecha?", text: "", type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "SI,ELIMINAR", closeOnConfirm: false }, function(){ $.ajax({ url:base_url+"index.php/MantenimientoBrecha/DeleteBrecha", type:"POST", data:{id_brecha:id_brecha}, success:function(respuesta) { swal("ELIMINADO!", "Se elimino correctamente la brecha.", "success"); $('#table-brecha').dataTable()._fnAjaxUpdate(); }//para actualizar mi datatablet datatablet }); }); }); } //FIN ELIMINAR UNA BRECHA /* //Manda datos en consola de la tabla brecha function lista() { event.preventDefault(); $.ajax({ "url":base_url +"index.php/MantenimientoBrecha/GetBrecha", type:"POST", success:function(respuesta) { console.log(respuesta); } }); } *///fin datos en consola de la tabla brecha //-------------------------FIN MANTENIMIENTO DE BRECHAS ----------------------------
smptracing/SMP
assets/js/administrador/MBrecha.js
JavaScript
mit
8,825
[ 30522, 1002, 1006, 6254, 1007, 1012, 2006, 1006, 1000, 3201, 1000, 1010, 3853, 1006, 1007, 1063, 2862, 7875, 2890, 7507, 1006, 1007, 1025, 1013, 1013, 2222, 8067, 2099, 2632, 2777, 7716, 2080, 11498, 2862, 2906, 5869, 7987, 15937, 3022, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package proxy import ( "context" "net" "net/http" "strings" "time" gmux "github.com/gorilla/mux" v3 "github.com/rancher/rancher/pkg/generated/controllers/management.cattle.io/v3" managementv3 "github.com/rancher/rancher/pkg/generated/norman/management.cattle.io/v3" "github.com/rancher/rancher/pkg/settings" "github.com/rancher/remotedialer" "github.com/rancher/steve/pkg/auth" "github.com/rancher/steve/pkg/proxy" authzv1 "k8s.io/api/authorization/v1" "k8s.io/apiserver/pkg/authentication/user" "k8s.io/apiserver/pkg/authorization/authorizer" "k8s.io/apiserver/pkg/authorization/authorizerfactory" "k8s.io/apiserver/pkg/endpoints/request" v1 "k8s.io/client-go/kubernetes/typed/authorization/v1" "k8s.io/client-go/rest" ) type Handler struct { authorizer authorizer.Authorizer dialerFactory ClusterDialerFactory clusters v3.ClusterCache } type ClusterDialerFactory func(clusterID string) remotedialer.Dialer func RewriteLocalCluster(next http.Handler) http.Handler { return http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) { if strings.HasPrefix(req.URL.Path, "/k8s/clusters/local") { req.URL.Path = strings.TrimPrefix(req.URL.Path, "/k8s/clusters/local") if req.URL.Path == "" { req.URL.Path = "/" } } next.ServeHTTP(rw, req) }) } func NewProxyMiddleware(sar v1.SubjectAccessReviewInterface, dialerFactory ClusterDialerFactory, clusters v3.ClusterCache, localSupport bool, localCluster http.Handler) (func(http.Handler) http.Handler, error) { cfg := authorizerfactory.DelegatingAuthorizerConfig{ SubjectAccessReviewClient: sar, AllowCacheTTL: time.Second * time.Duration(settings.AuthorizationCacheTTLSeconds.GetInt()), DenyCacheTTL: time.Second * time.Duration(settings.AuthorizationDenyCacheTTLSeconds.GetInt()), WebhookRetryBackoff: &auth.WebhookBackoff, } authorizer, err := cfg.New() if err != nil { return nil, err } proxyHandler := NewProxyHandler(authorizer, dialerFactory, clusters) mux := gmux.NewRouter() mux.UseEncodedPath() mux.Path("/v1/management.cattle.io.clusters/{clusterID}").Queries("link", "shell").HandlerFunc(routeToShellProxy("link", "shell", localSupport, localCluster, mux, proxyHandler)) mux.Path("/v1/management.cattle.io.clusters/{clusterID}").Queries("action", "apply").HandlerFunc(routeToShellProxy("action", "apply", localSupport, localCluster, mux, proxyHandler)) mux.Path("/v3/clusters/{clusterID}").Queries("shell", "true").HandlerFunc(routeToShellProxy("link", "shell", localSupport, localCluster, mux, proxyHandler)) mux.Path("/{prefix:k8s/clusters/[^/]+}{suffix:/v1.*}").MatcherFunc(proxyHandler.MatchNonLegacy("/k8s/clusters/")).Handler(proxyHandler) return func(handler http.Handler) http.Handler { return http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) { mux.NotFoundHandler = handler mux.ServeHTTP(rw, req) }) }, nil } func routeToShellProxy(key, value string, localSupport bool, localCluster http.Handler, mux *gmux.Router, proxyHandler *Handler) func(rw http.ResponseWriter, r *http.Request) { return func(rw http.ResponseWriter, r *http.Request) { vars := gmux.Vars(r) cluster := vars["clusterID"] if cluster == "local" { if localSupport { q := r.URL.Query() q.Set(key, value) r.URL.RawQuery = q.Encode() r.URL.Path = "/v1/management.cattle.io.clusters/local" localCluster.ServeHTTP(rw, r) } else { mux.NotFoundHandler.ServeHTTP(rw, r) } return } vars["prefix"] = "k8s/clusters/" + cluster vars["suffix"] = "/v1/management.cattle.io.clusters/local" q := r.URL.Query() q.Set(key, value) r.URL.RawQuery = q.Encode() r.URL.Path = "/k8s/clusters/" + cluster + "/v1/management.cattle.io.clusters/local" proxyHandler.ServeHTTP(rw, r) } } func NewProxyHandler(authorizer authorizer.Authorizer, dialerFactory ClusterDialerFactory, clusters v3.ClusterCache) *Handler { return &Handler{ authorizer: authorizer, dialerFactory: dialerFactory, clusters: clusters, } } func (h *Handler) MatchNonLegacy(prefix string) gmux.MatcherFunc { return func(req *http.Request, match *gmux.RouteMatch) bool { clusterID := strings.TrimPrefix(req.URL.Path, prefix) clusterID = strings.SplitN(clusterID, "/", 2)[0] if match.Vars == nil { match.Vars = map[string]string{} } match.Vars["clusterID"] = clusterID return true } } func (h *Handler) ServeHTTP(rw http.ResponseWriter, req *http.Request) { user, ok := request.UserFrom(req.Context()) if !ok { rw.WriteHeader(http.StatusUnauthorized) return } prefix := "/" + gmux.Vars(req)["prefix"] clusterID := gmux.Vars(req)["clusterID"] if !h.canAccess(req.Context(), user, clusterID) { rw.WriteHeader(http.StatusUnauthorized) return } handler, err := h.next(clusterID, prefix) if err != nil { rw.WriteHeader(http.StatusInternalServerError) rw.Write([]byte(err.Error())) return } handler.ServeHTTP(rw, req) } func (h *Handler) dialer(ctx context.Context, network, address string) (net.Conn, error) { host, _, err := net.SplitHostPort(address) if err != nil { return nil, err } dialer := h.dialerFactory("steve-cluster-" + host) return dialer(ctx, network, "127.0.0.1:6080") } func (h *Handler) next(clusterID, prefix string) (http.Handler, error) { cfg := &rest.Config{ // this is bogus, the dialer will change it to 127.0.0.1:6080, but the clusterID is used to lookup the tunnel // connect Host: "http://" + clusterID, UserAgent: rest.DefaultKubernetesUserAgent() + " cluster " + clusterID, Transport: &http.Transport{ DialContext: h.dialer, }, } next := proxy.ImpersonatingHandler(prefix, cfg) return http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) { req.Header.Set("X-API-URL-Prefix", prefix) next.ServeHTTP(rw, req) }), nil } func (h *Handler) canAccess(ctx context.Context, user user.Info, clusterID string) bool { extra := map[string]authzv1.ExtraValue{} for k, v := range user.GetExtra() { extra[k] = v } resp, _, err := h.authorizer.Authorize(ctx, authorizer.AttributesRecord{ ResourceRequest: true, User: user, Verb: "get", APIGroup: managementv3.GroupName, APIVersion: managementv3.Version, Resource: "clusters", Name: clusterID, }) return err == nil && resp == authorizer.DecisionAllow }
rancherio/rancher
pkg/api/steve/proxy/proxy.go
GO
apache-2.0
6,387
[ 30522, 7427, 24540, 12324, 1006, 1000, 6123, 1000, 1000, 5658, 1000, 1000, 5658, 1013, 8299, 1000, 1000, 7817, 1000, 1000, 2051, 1000, 13938, 5602, 1000, 21025, 2705, 12083, 1012, 4012, 1013, 23526, 1013, 14163, 2595, 1000, 1058, 2509, 1000...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# -*- coding: utf-8 -*- # # RedPipe documentation build configuration file, created by # sphinx-quickstart on Wed Apr 19 13:22:45 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # # import os # import sys # sys.path.insert(0, os.path.abspath('.')) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. # # needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. import os import sys from os import path ROOTDIR = path.abspath(os.path.dirname(os.path.dirname(__file__))) sys.path.insert(0, ROOTDIR) import redpipe # noqa extensions = [ 'alabaster', 'sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.viewcode', 'sphinx.ext.napoleon', ] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # # source_suffix = ['.rst', '.md'] source_suffix = '.rst' # The master toctree document. master_doc = 'index' # General information about the project. project = u'RedPipe' copyright = u'2017, John Loehrer' author = u'John Loehrer' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = redpipe.__version__ # The full version, including alpha/beta/rc tags. release = redpipe.__version__ # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. language = None # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This patterns also effect to html_static_path and html_extra_path exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = False # -- Options for HTML output ---------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # html_theme = 'alabaster' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. # html_theme_options = { 'logo': 'redpipe-logo.gif', 'github_banner': True, 'github_user': '72squared', 'github_repo': 'redpipe', 'travis_button': True, 'analytics_id': 'UA-98626018-1', } html_sidebars = { '**': [ 'about.html', 'navigation.html', 'relations.html', 'searchbox.html', ] } # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # -- Options for HTMLHelp output ------------------------------------------ # Output file base name for HTML help builder. htmlhelp_basename = 'RedPipedoc' # -- Options for LaTeX output --------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). # # 'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). # # 'pointsize': '10pt', # Additional stuff for the LaTeX preamble. # # 'preamble': '', # Latex figure (float) alignment # # 'figure_align': 'htbp', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ (master_doc, 'RedPipe.tex', u'%s Documentation' % project, u'John Loehrer', 'manual'), ] # -- Options for manual page output --------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ (master_doc, project, u'%s Documentation' % project, [author], 1) ] # -- Options for Texinfo output ------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ (master_doc, project, u'%s Documentation' % project, author, project, 'making redis pipelines easy in python', 'Miscellaneous'), ] suppress_warnings = ['image.nonlocal_uri']
72squared/redpipe
docs/conf.py
Python
mit
5,400
[ 30522, 1001, 1011, 1008, 1011, 16861, 1024, 21183, 2546, 1011, 1022, 1011, 1008, 1011, 1001, 1001, 2417, 24548, 12653, 3857, 9563, 5371, 1010, 2580, 2011, 1001, 27311, 1011, 4248, 14117, 2102, 2006, 21981, 19804, 2539, 2410, 1024, 2570, 102...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#import <Foundation/Foundation.h> #import "PNUnsubscribeChannelsOrGroupsAPICallBuilder.h" #import "PNSubscribeChannelsOrGroupsAPIBuilder.h" #import "PNUnsubscribeAPICallBuilder.h" #import "PNSubscribeAPIBuilder.h" #import "PubNub+Core.h" #pragma mark Class forward @class PNSubscribeStatus; #pragma mark - Protocols @protocol PNObjectEventListener; NS_ASSUME_NONNULL_BEGIN /** @brief \b PubNub client core class extension to provide access to 'publish' API group. @discussion Set of API which allow to push data to \b PubNub service. Data pusched to remote data objects called 'channels' and then delivered on their live feeds to all subscribers. @author Sergey Mamontov @since 4.0 @copyright © 2009-2016 PubNub, Inc. */ @interface PubNub (Subscribe) ///------------------------------------------------ /// @name Subscription state information ///------------------------------------------------ /** @brief List of channels on which client subscribed now. @return \a NSArray of channel names on which client subscribed at this moment. @since 4.0 */ - (NSArray<NSString *> *)channels; /** @brief List of channels group on which client subscribed now. @return \a NSArray of channel group names on which client subscribed at this moment. @since 4.0 */ - (NSArray<NSString *> *)channelGroups; /** @brief List of channels for which presence events observation has been enabled. @return \a NSArray of presence channel names on which client subscribed at this moment. @since 4.0 */ - (NSArray<NSString *> *)presenceChannels; /** @brief Check whether \b PubNub client currently subscribed on specified data object or not. @param name Reference on name of data object against which check should be performed. @return \c YES in case if client currently subscribed to specified data object. @since 4.0 */ - (BOOL)isSubscribedOn:(NSString *)name; ///------------------------------------------------ /// @name Listeners ///------------------------------------------------ /** @brief Add observer which conform to \b PNObjectEventListener protocol and would like to receive updates based on live feed events and status change. @discussion Listener can implement only required callbacks from \b PNObjectEventListener protocol and called only when desired type of event arrive. @param listener Listener which would like to receive updates. @since 4.0 */ - (void)addListener:(id <PNObjectEventListener>)listener NS_SWIFT_NAME(addListener(_:)); /** @brief Remove listener from list for callback calls. @discussion When listener not interested in live feed updates it can remove itself from updates list using this method. @param listener Listener which doesn't want to receive updates anymore. @since 4.0 */ - (void)removeListener:(id <PNObjectEventListener>)listener NS_SWIFT_NAME(removeListener(_:)); ///------------------------------------------------ /// @name Filtering ///------------------------------------------------ /** @brief Stores reference on string representation of filtering expression which should be applied to decide which updates should reach client. @warning If your filter expression is malformed, \b PNObjectEventListener won't receive any messages and presence events from service (only error status). */ @property (nonatomic, nullable, copy) NSString *filterExpression; ///------------------------------------------------ /// @name API Builder support ///------------------------------------------------ /** @brief Stores reference on subscribe API access \c builder construction block. @discussion On block call return builder which allow to configure parameters for subscribe API access. @since 4.5.4 */ @property (nonatomic, readonly, strong) PNSubscribeAPIBuilder *(^subscribe)(void); /** @brief Stores reference on unsubscribe API access \c builder construction block. @discussion On block call return builder which allow to configure parameters for unsubscribe API access. @since 4.5.4 */ @property (nonatomic, readonly, strong) PNUnsubscribeAPICallBuilder *(^unsubscribe)(void); ///------------------------------------------------ /// @name Subscription ///------------------------------------------------ /** @brief Try subscribe on specified set of channels. @discussion Using subscribe API client is able to subscribe of remote data objects live feed and listen for new events from them. @discussion \b Example: @code PNConfiguration *configuration = [PNConfiguration configurationWithPublishKey:@"demo" subscribeKey:@"demo"]; self.client = [PubNub clientWithConfiguration:configuration]; [self.client subscribeToChannels:@[@"swift"] withPresence:YES]; @endcode @param channels List of channel names on which client should try to subscribe. @param shouldObservePresence Whether presence observation should be enabled for \c channels or not. @since 4.0 */ - (void)subscribeToChannels:(NSArray<NSString *> *)channels withPresence:(BOOL)shouldObservePresence NS_SWIFT_NAME(subscribeToChannels(_:withPresence:)); /** @brief Try subscribe on specified set of channels. @discussion Using subscribe API client is able to subscribe of remote data objects live feed and listen for new events from them. @discussion Extension to \c -subscribeToChannels:withPresence: and allow to specify arbitrarily which should be used during subscription. @discussion \b Example: @code PNConfiguration *configuration = [PNConfiguration configurationWithPublishKey:@"demo" subscribeKey:@"demo"]; self.client = [PubNub clientWithConfiguration:configuration]; NSNumber *timeToken = @([[NSDate dateWithTimeIntervalSinceNow:-2.0] timeIntervalSince1970]); [self.client subscribeToChannels:@[@"swift"] withPresence:YES usingTimeToken:timeToken]; @endcode @param channels List of channel names on which client should try to subscribe. @param shouldObservePresence Whether presence observation should be enabled for \c channels or not. @param timeToken Time from which client should try to catch up on messages. @since 4.2.0 */ - (void)subscribeToChannels:(NSArray<NSString *> *)channels withPresence:(BOOL)shouldObservePresence usingTimeToken:(nullable NSNumber *)timeToken NS_SWIFT_NAME(subscribeToChannels(_:withPresence:usingTimeToken:)); /** @brief Try subscribe on specified set of channels. @discussion Using subscribe API client is able to subscribe of remote data objects live feed and listen for new events from them. @discussion Extension to \c -subscribeToChannels:withPresence: and allow to specify client state information which should be passed to \b PubNub service along with subscription. @discussion \b Example: @code PNConfiguration *configuration = [PNConfiguration configurationWithPublishKey:@"demo" subscribeKey:@"demo"]; self.client = [PubNub clientWithConfiguration:configuration]; [self.client subscribeToChannels:@[@"swift"] withPresence:YES clientState:@{@"swift": @{@"Type": @"Developer"}}]; @endcode @param channels List of channel names on which client should try to subscribe. @param shouldObservePresence Whether presence observation should be enabled for \c channels or not. @param state Reference on dictionary which stores key-value pairs based on channel name and value which should be assigned to it. @since 4.0 */ - (void)subscribeToChannels:(NSArray<NSString *> *)channels withPresence:(BOOL)shouldObservePresence clientState:(nullable NSDictionary<NSString *, id> *)state NS_SWIFT_NAME(subscribeToChannels(_:withPresence:clientState:)); /** @brief Try subscribe on specified set of channels. @discussion Using subscribe API client is able to subscribe of remote data objects live feed and listen for new events from them. @discussion Extension to \c -subscribeToChannels:withPresence:usingTimeToken: and allow to specify client state information which should be passed to \b PubNub service along with subscription. @discussion \b Example: @code PNConfiguration *configuration = [PNConfiguration configurationWithPublishKey:@"demo" subscribeKey:@"demo"]; self.client = [PubNub clientWithConfiguration:configuration]; NSNumber *timeToken = @([[NSDate dateWithTimeIntervalSinceNow:-2.0] timeIntervalSince1970]); [self.client subscribeToChannels:@[@"swift"] withPresence:YES usingTimeToken:timeToken clientState:@{@"swift": @{@"Type": @"Developer"}}]; @endcode @param channels List of channel names on which client should try to subscribe. @param shouldObservePresence Whether presence observation should be enabled for \c channels or not. @param timeToken Time from which client should try to catch up on messages. @param state Reference on dictionary which stores key-value pairs based on channel name and value which should be assigned to it. @since 4.2.0 */ - (void)subscribeToChannels:(NSArray<NSString *> *)channels withPresence:(BOOL)shouldObservePresence usingTimeToken:(nullable NSNumber *)timeToken clientState:(nullable NSDictionary<NSString *, id> *)state NS_SWIFT_NAME(subscribeToChannels(_:withPresence:usingTimeToken:clientState:)); /** @brief Try subscribe on specified set of channel groups. @discussion Using subscribe API client is able to subscribe of remote data objects live feed and listen for new events from them. @discussion \b Example: @code PNConfiguration *configuration = [PNConfiguration configurationWithPublishKey:@"demo" subscribeKey:@"demo"]; self.client = [PubNub clientWithConfiguration:configuration]; [self.client subscribeToChannelGroups:@[@"developers"] withPresence:YES]; @endcode @param groups List of channel group names on which client should try to subscribe. @param shouldObservePresence Whether presence observation should be enabled for \c groups or not. @since 4.0 */ - (void)subscribeToChannelGroups:(NSArray<NSString *> *)groups withPresence:(BOOL)shouldObservePresence NS_SWIFT_NAME(subscribeToChannelGroups(_:withPresence:)); /** @brief Try subscribe on specified set of channel groups. @discussion Using subscribe API client is able to subscribe of remote data objects live feed and listen for new events from them. @discussion Extension to \c -subscribeToChannelGroups:withPresence: and allow to specify arbitrarily which should be used during subscription. @discussion \b Example: @code PNConfiguration *configuration = [PNConfiguration configurationWithPublishKey:@"demo" subscribeKey:@"demo"]; self.client = [PubNub clientWithConfiguration:configuration]; NSNumber *timeToken = @([[NSDate dateWithTimeIntervalSinceNow:-2.0] timeIntervalSince1970]); [self.client subscribeToChannelGroups:@[@"developers"] withPresence:YES usingTimeToken:timeToken]; @endcode @param groups List of channel group names on which client should try to subscribe. @param shouldObservePresence Whether presence observation should be enabled for \c groups or not. @param timeToken Time from which client should try to catch up on messages. @since 4.2.0 */ - (void)subscribeToChannelGroups:(NSArray<NSString *> *)groups withPresence:(BOOL)shouldObservePresence usingTimeToken:(nullable NSNumber *)timeToken NS_SWIFT_NAME(subscribeToChannelGroups(_:withPresence:usingTimeToken:)); /** @brief Try subscribe on specified set of channel groups. @discussion Using subscribe API client is able to subscribe of remote data objects live feed and listen for new events from them. @discussion Extension to \c -subscribeToChannelGroups:withPresence: and allow to specify client state information which should be passed to \b PubNub service along with subscription. @discussion \b Example: @code PNConfiguration *configuration = [PNConfiguration configurationWithPublishKey:@"demo" subscribeKey:@"demo"]; self.client = [PubNub clientWithConfiguration:configuration]; [self.client subscribeToChannelGroups:@[@"developers"] withPresence:YES clientState:@{@"developers": @{@"Name": @"Bob"}}]; @endcode @param groups List of channel group names on which client should try to subscribe. @param shouldObservePresence Whether presence observation should be enabled for \c groups or not. @param state Reference on dictionary which stores key-value pairs based on channel group name and value which should be assigned to it. @since 4.0 */ - (void)subscribeToChannelGroups:(NSArray<NSString *> *)groups withPresence:(BOOL)shouldObservePresence clientState:(nullable NSDictionary<NSString *, id> *)state NS_SWIFT_NAME(subscribeToChannelGroups(_:withPresence:clientState:)); /** @brief Try subscribe on specified set of channel groups. @discussion Using subscribe API client is able to subscribe of remote data objects live feed and listen for new events from them. @discussion Extension to \c -subscribeToChannelGroups:withPresence:usingTimeToken: and allow to specify client state information which should be passed to \b PubNub service along with subscription. @discussion \b Example: @code PNConfiguration *configuration = [PNConfiguration configurationWithPublishKey:@"demo" subscribeKey:@"demo"]; self.client = [PubNub clientWithConfiguration:configuration]; NSNumber *timeToken = @([[NSDate dateWithTimeIntervalSinceNow:-2.0] timeIntervalSince1970]); [self.client subscribeToChannelGroups:@[@"developers"] withPresence:YES usingTimeToken:timeToken clientState:@{@"developers": @{@"Name": @"Bob"}}]; @endcode @param groups List of channel group names on which client should try to subscribe. @param shouldObservePresence Whether presence observation should be enabled for \c groups or not. @param timeToken Time from which client should try to catch up on messages. @param state Reference on dictionary which stores key-value pairs based on channel group name and value which should be assigned to it. @since 4.2.0 */ - (void)subscribeToChannelGroups:(NSArray<NSString *> *)groups withPresence:(BOOL)shouldObservePresence usingTimeToken:(nullable NSNumber *)timeToken clientState:(nullable NSDictionary<NSString *, id> *)state NS_SWIFT_NAME(subscribeToChannelGroups(_:withPresence:usingTimeToken:clientState:)); /** @brief Enable presence observation on specified \c channels. @discussion Using this API client will be able to observe for presence events which is pushed to remote data objects. @discussion \b Example: @code PNConfiguration *configuration = [PNConfiguration configurationWithPublishKey:@"demo" subscribeKey:@"demo"]; self.client = [PubNub clientWithConfiguration:configuration]; [self.client subscribeToPresenceChannels:@[@"swift"]]; @endcode @param channels List of channel names for which client should try to subscribe on presence observing channels. @since 4.0 */ - (void)subscribeToPresenceChannels:(NSArray<NSString *> *)channels NS_SWIFT_NAME(subscribeToPresenceChannels(_:)); ///------------------------------------------------ /// @name Unsubscription ///------------------------------------------------ /** @brief Unsubscribe/leave from specified set of channels. @discussion Using this API client will push leave presence event on specified \c channels and if it will be required it will re-subscribe on rest of the channels. @discussion \b Example: @code PNConfiguration *configuration = [PNConfiguration configurationWithPublishKey:@"demo" subscribeKey:@"demo"]; self.client = [PubNub clientWithConfiguration:configuration]; [self.client unsubscribeFromChannels:@[@"objc"] withPresence:YES]; @endcode @param channels List of channel names from which client should try to unsubscribe. @param shouldObservePresence Whether client should disable presence observation on specified channels or keep listening for presence event on them. @since 4.0 */ - (void)unsubscribeFromChannels:(NSArray<NSString *> *)channels withPresence:(BOOL)shouldObservePresence NS_SWIFT_NAME(unsubscribeFromChannels(_:withPresence:)); /** @brief Unsubscribe/leave from specified set of channel groups. @discussion Using this API client will push leave presence event on specified \c groups. In this case leave event will be pushed to all channels which is part of \c groups. If it will be required it will re-subscribe on rest of the channels. @discussion \b Example: @code PNConfiguration *configuration = [PNConfiguration configurationWithPublishKey:@"demo" subscribeKey:@"demo"]; self.client = [PubNub clientWithConfiguration:configuration]; [self.client unsubscribeFromChannelGroups:@[@"developers"] withPresence:YES]; @endcode @param groups List of channel group names from which client should try to unsubscribe. @param shouldObservePresence Whether client should disable presence observation on specified channel groups or keep listening for presence event on them. @since 4.0 */ - (void)unsubscribeFromChannelGroups:(NSArray<NSString *> *)groups withPresence:(BOOL)shouldObservePresence NS_SWIFT_NAME(unsubscribeFromChannelGroups(_:withPresence:)); /** @brief Disable presence events observation on specified channels. @discussion This API allow to stop presence observation on specified set of channels. @discussion \b Example: @code PNConfiguration *configuration = [PNConfiguration configurationWithPublishKey:@"demo" subscribeKey:@"demo"]; self.client = [PubNub clientWithConfiguration:configuration]; [self.client unsubscribeFromPresenceChannels:@[@"swifty"]]; @endcode @param channels List of channel names for which client should try to unsubscribe from presence observing channels. @since 4.0 */ - (void)unsubscribeFromPresenceChannels:(NSArray<NSString *> *)channels NS_SWIFT_NAME(unsubscribeFromPresenceChannels(_:)); /** @brief Unsubscribe from all channels and groups on which client has been subscrbed so far. @discussion This API will remove all channels, presence channels and channel groups from subscribe cycle and as result will stop it. @discussion \b Example: @code PNConfiguration *configuration = [PNConfiguration configurationWithPublishKey:@"demo" subscribeKey:@"demo"]; self.client = [PubNub clientWithConfiguration:configuration]; [self.client unsubscribeFromAll]; @endcode @since 4.2.0 */ - (void)unsubscribeFromAll; #pragma mark - @end NS_ASSUME_NONNULL_END
dicodeio/tellme-ios
TellMe/Pods/PubNub/PubNub/Core/PubNub+Subscribe.h
C
mit
20,055
[ 30522, 1001, 12324, 1026, 3192, 1013, 3192, 1012, 1044, 1028, 1001, 12324, 1000, 1052, 11231, 3619, 12083, 29234, 26058, 21748, 17058, 3736, 24330, 8095, 8569, 23891, 2099, 1012, 1044, 1000, 1001, 12324, 1000, 1052, 3619, 12083, 29234, 26058,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
--- title: "8차 천일 결사 1차 백일 기도 정진 56일째" date: 2014-05-18 08:01:52 tags: - 8000th - 8-100th - 56th --- #수행일지 남에 마음에 노력하기 위한 저 자신을 봅니다. 어릴때 부모님 특히 엄마를 볼 수 있는 시간이 부족해서 전 사랑고파병이 있습니다. 그래서 누구든지 그 사람의 마음에 들기 위해서 무의식적으로 노력하고 있는 저를 봅니다. 이것을 알아차리니 이제 남의 마음에 들지 않기 위해서 노력하고 있는 저를 봅니다. 저는 양 극단을 헤메이고 있습니다. 부처님이 말씀하신 마음에 들기 위해서 노력할것도 마음에 들지 않기 위해서 노력하지도 않는 중도의 길을 가는것이 바른길임을 알고 바른 방향으로 수행 정진해 나가야 하겠습니다. 오늘도 모든 만물에 평화와 안녕이 깃들기를 기원합니다. 감사합니다.
ygpark2/docpad_test
src/documents/10000/2014/05/18/8_1_56.html.md
Markdown
bsd-3-clause
949
[ 30522, 1011, 1011, 1011, 2516, 1024, 1000, 1022, 30001, 30006, 1465, 30008, 30021, 29999, 30019, 30022, 1455, 30010, 30022, 29997, 30006, 1015, 30001, 30006, 1460, 30007, 30020, 29999, 30019, 30022, 1455, 30019, 29993, 30011, 1464, 30008, 30025...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/******************************************************************************* * Copyright 2011, 2012 Chris Banes. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT 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.senab.photoview; import uk.co.senab.photoview.PhotoViewAttacher.OnMatrixChangedListener; import uk.co.senab.photoview.PhotoViewAttacher.OnPhotoTapListener; import uk.co.senab.photoview.PhotoViewAttacher.OnViewTapListener; import android.content.Context; import android.graphics.Bitmap; import android.graphics.Matrix; import android.graphics.RectF; import android.graphics.drawable.Drawable; import android.net.Uri; import android.util.AttributeSet; import android.widget.ImageView; public class PhotoView extends ImageView implements IPhotoView { private final PhotoViewAttacher mAttacher; private ScaleType mPendingScaleType; public PhotoView(Context context) { this(context, null); } public PhotoView(Context context, AttributeSet attr) { this(context, attr, 0); } public PhotoView(Context context, AttributeSet attr, int defStyle) { super(context, attr, defStyle); super.setScaleType(ScaleType.MATRIX); mAttacher = new PhotoViewAttacher(this); if (null != mPendingScaleType) { setScaleType(mPendingScaleType); mPendingScaleType = null; } } @Override public void setPhotoViewRotation(float rotationDegree) { mAttacher.setPhotoViewRotation(rotationDegree); } @Override public boolean canZoom() { return mAttacher.canZoom(); } @Override public RectF getDisplayRect() { return mAttacher.getDisplayRect(); } @Override public Matrix getDisplayMatrix() { return mAttacher.getDrawMatrix(); } @Override public boolean setDisplayMatrix(Matrix finalRectangle) { return mAttacher.setDisplayMatrix(finalRectangle); } @Override @Deprecated public float getMinScale() { return getMinimumScale(); } @Override public float getMinimumScale() { return mAttacher.getMinimumScale(); } @Override @Deprecated public float getMidScale() { return getMediumScale(); } @Override public float getMediumScale() { return mAttacher.getMediumScale(); } @Override @Deprecated public float getMaxScale() { return getMaximumScale(); } @Override public float getMaximumScale() { return mAttacher.getMaximumScale(); } @Override public float getScale() { return mAttacher.getScale(); } @Override public ScaleType getScaleType() { return mAttacher.getScaleType(); } @Override public void setAllowParentInterceptOnEdge(boolean allow) { mAttacher.setAllowParentInterceptOnEdge(allow); } @Override @Deprecated public void setMinScale(float minScale) { setMinimumScale(minScale); } @Override public void setMinimumScale(float minimumScale) { mAttacher.setMinimumScale(minimumScale); } @Override @Deprecated public void setMidScale(float midScale) { setMediumScale(midScale); } @Override public void setMediumScale(float mediumScale) { mAttacher.setMediumScale(mediumScale); } @Override @Deprecated public void setMaxScale(float maxScale) { setMaximumScale(maxScale); } @Override public void setMaximumScale(float maximumScale) { mAttacher.setMaximumScale(maximumScale); } @Override // setImageBitmap calls through to this method public void setImageDrawable(Drawable drawable) { super.setImageDrawable(drawable); if (null != mAttacher) { mAttacher.update(); } } @Override public void setImageResource(int resId) { super.setImageResource(resId); if (null != mAttacher) { mAttacher.update(); } } @Override public void setImageURI(Uri uri) { super.setImageURI(uri); if (null != mAttacher) { mAttacher.update(); } } @Override public void setOnMatrixChangeListener(OnMatrixChangedListener listener) { mAttacher.setOnMatrixChangeListener(listener); } @Override public void setOnLongClickListener(OnLongClickListener l) { mAttacher.setOnLongClickListener(l); } @Override public void setOnPhotoTapListener(OnPhotoTapListener listener) { mAttacher.setOnPhotoTapListener(listener); } @Override public OnPhotoTapListener getOnPhotoTapListener() { return mAttacher.getOnPhotoTapListener(); } @Override public void setOnViewTapListener(OnViewTapListener listener) { mAttacher.setOnViewTapListener(listener); } @Override public OnViewTapListener getOnViewTapListener() { return mAttacher.getOnViewTapListener(); } @Override public void setScale(float scale) { mAttacher.setScale(scale); } @Override public void setScale(float scale, boolean animate) { mAttacher.setScale(scale, animate); } @Override public void setScale(float scale, float focalX, float focalY, boolean animate) { mAttacher.setScale(scale, focalX, focalY, animate); } @Override public void setScaleType(ScaleType scaleType) { if (null != mAttacher) { mAttacher.setScaleType(scaleType); } else { mPendingScaleType = scaleType; } } @Override public void setZoomable(boolean zoomable) { mAttacher.setZoomable(zoomable); } @Override public Bitmap getVisibleRectangleBitmap() { return mAttacher.getVisibleRectangleBitmap(); } @Override public void setZoomTransitionDuration(int milliseconds) { mAttacher.setZoomTransitionDuration(milliseconds); } @Override protected void onDetachedFromWindow() { mAttacher.cleanup(); super.onDetachedFromWindow(); } }
cocolove2/LISDemo
library-lis/src/main/java/uk/co/senab/photoview/PhotoView.java
Java
artistic-2.0
6,686
[ 30522, 1013, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 30524, 1008, 1008, 1008, 1008, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
using System; namespace NHibernate.Test.NHSpecificTest.NH1289 { [Serializable] public class WorkflowItem { public virtual int Id { get; set; } } }
RogerKratz/nhibernate-core
src/NHibernate.Test/NHSpecificTest/NH1289/WorkflowItem.cs
C#
lgpl-2.1
156
[ 30522, 2478, 2291, 1025, 3415, 15327, 18699, 20755, 12789, 2618, 1012, 3231, 1012, 17237, 5051, 6895, 8873, 6593, 4355, 1012, 18699, 12521, 2620, 2683, 1063, 1031, 7642, 21335, 3468, 1033, 2270, 2465, 2147, 12314, 4221, 2213, 1063, 2270, 74...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package org.spoofax.jsglr2.integrationtest.features; import java.util.Arrays; import java.util.stream.Stream; import org.junit.jupiter.api.DynamicTest; import org.junit.jupiter.api.TestFactory; import org.spoofax.jsglr2.integrationtest.BaseTestWithSdf3ParseTables; import org.spoofax.jsglr2.integrationtest.OriginDescriptor; import org.spoofax.terms.ParseError; public class OriginsTest extends BaseTestWithSdf3ParseTables { public OriginsTest() { super("tokenization.sdf3"); } @TestFactory public Stream<DynamicTest> operator() throws ParseError { return testOrigins("x+x", Arrays.asList( //@formatter:off new OriginDescriptor("AddOperator", 0, 2), new OriginDescriptor("Id", 0, 0), new OriginDescriptor("Id", 2, 2) //@formatter:on )); } }
metaborg/jsglr
org.spoofax.jsglr2.integrationtest/src/test/java/org/spoofax/jsglr2/integrationtest/features/OriginsTest.java
Java
apache-2.0
839
[ 30522, 7427, 8917, 1012, 11867, 21511, 8528, 1012, 1046, 28745, 20974, 2475, 1012, 8346, 22199, 1012, 2838, 1025, 12324, 9262, 1012, 21183, 4014, 1012, 27448, 1025, 12324, 9262, 1012, 21183, 4014, 1012, 5460, 1012, 5460, 1025, 12324, 8917, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php /** * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace Zend\Authentication\Adapter; use Zend\Authentication; use Zend\Http\Request as HTTPRequest; use Zend\Http\Response as HTTPResponse; use Zend\Uri\UriFactory; use Zend\Crypt\Utils as CryptUtils; /** * HTTP Authentication Adapter * * Implements a pretty good chunk of RFC 2617. * * @todo Support auth-int * @todo Track nonces, nonce-count, opaque for replay protection and stale support * @todo Support Authentication-Info header */ class Http implements AdapterInterface { /** * Reference to the HTTP Request object * * @var HTTPRequest */ protected $request; /** * Reference to the HTTP Response object * * @var HTTPResponse */ protected $response; /** * Object that looks up user credentials for the Basic scheme * * @var Http\ResolverInterface */ protected $basicResolver; /** * Object that looks up user credentials for the Digest scheme * * @var Http\ResolverInterface */ protected $digestResolver; /** * List of authentication schemes supported by this class * * @var array */ protected $supportedSchemes = array('basic', 'digest'); /** * List of schemes this class will accept from the client * * @var array */ protected $acceptSchemes; /** * Space-delimited list of protected domains for Digest Auth * * @var string */ protected $domains; /** * The protection realm to use * * @var string */ protected $realm; /** * Nonce timeout period * * @var int */ protected $nonceTimeout; /** * Whether to send the opaque value in the header. True by default * * @var bool */ protected $useOpaque; /** * List of the supported digest algorithms. I want to support both MD5 and * MD5-sess, but MD5-sess won't make it into the first version. * * @var array */ protected $supportedAlgos = array('MD5'); /** * The actual algorithm to use. Defaults to MD5 * * @var string */ protected $algo; /** * List of supported qop options. My intention is to support both 'auth' and * 'auth-int', but 'auth-int' won't make it into the first version. * * @var array */ protected $supportedQops = array('auth'); /** * Whether or not to do Proxy Authentication instead of origin server * authentication (send 407's instead of 401's). Off by default. * * @var bool */ protected $imaProxy; /** * Flag indicating the client is IE and didn't bother to return the opaque string * * @var bool */ protected $ieNoOpaque; /** * Constructor * * @param array $config Configuration settings: * 'accept_schemes' => 'basic'|'digest'|'basic digest' * 'realm' => <string> * 'digest_domains' => <string> Space-delimited list of URIs * 'nonce_timeout' => <int> * 'use_opaque' => <bool> Whether to send the opaque value in the header * 'algorithm' => <string> See $supportedAlgos. Default: MD5 * 'proxy_auth' => <bool> Whether to do authentication as a Proxy * @throws Exception\InvalidArgumentException */ public function __construct(array $config) { $this->request = null; $this->response = null; $this->ieNoOpaque = false; if (empty($config['accept_schemes'])) { throw new Exception\InvalidArgumentException('Config key "accept_schemes" is required'); } $schemes = explode(' ', $config['accept_schemes']); $this->acceptSchemes = array_intersect($schemes, $this->supportedSchemes); if (empty($this->acceptSchemes)) { throw new Exception\InvalidArgumentException(sprintf( 'No supported schemes given in "accept_schemes". Valid values: %s', implode(', ', $this->supportedSchemes) )); } // Double-quotes are used to delimit the realm string in the HTTP header, // and colons are field delimiters in the password file. if (empty($config['realm']) || !ctype_print($config['realm']) || strpos($config['realm'], ':') !== false || strpos($config['realm'], '"') !== false) { throw new Exception\InvalidArgumentException( 'Config key \'realm\' is required, and must contain only printable characters,' . 'excluding quotation marks and colons' ); } else { $this->realm = $config['realm']; } if (in_array('digest', $this->acceptSchemes)) { if (empty($config['digest_domains']) || !ctype_print($config['digest_domains']) || strpos($config['digest_domains'], '"') !== false) { throw new Exception\InvalidArgumentException( 'Config key \'digest_domains\' is required, and must contain ' . 'only printable characters, excluding quotation marks' ); } else { $this->domains = $config['digest_domains']; } if (empty($config['nonce_timeout']) || !is_numeric($config['nonce_timeout'])) { throw new Exception\InvalidArgumentException( 'Config key \'nonce_timeout\' is required, and must be an integer' ); } else { $this->nonceTimeout = (int) $config['nonce_timeout']; } // We use the opaque value unless explicitly told not to if (isset($config['use_opaque']) && false == (bool) $config['use_opaque']) { $this->useOpaque = false; } else { $this->useOpaque = true; } if (isset($config['algorithm']) && in_array($config['algorithm'], $this->supportedAlgos)) { $this->algo = $config['algorithm']; } else { $this->algo = 'MD5'; } } // Don't be a proxy unless explicitly told to do so if (isset($config['proxy_auth']) && true == (bool) $config['proxy_auth']) { $this->imaProxy = true; // I'm a Proxy } else { $this->imaProxy = false; } } /** * Setter for the basicResolver property * * @param Http\ResolverInterface $resolver * @return Http Provides a fluent interface */ public function setBasicResolver(Http\ResolverInterface $resolver) { $this->basicResolver = $resolver; return $this; } /** * Getter for the basicResolver property * * @return Http\ResolverInterface */ public function getBasicResolver() { return $this->basicResolver; } /** * Setter for the digestResolver property * * @param Http\ResolverInterface $resolver * @return Http Provides a fluent interface */ public function setDigestResolver(Http\ResolverInterface $resolver) { $this->digestResolver = $resolver; return $this; } /** * Getter for the digestResolver property * * @return Http\ResolverInterface */ public function getDigestResolver() { return $this->digestResolver; } /** * Setter for the Request object * * @param HTTPRequest $request * @return Http Provides a fluent interface */ public function setRequest(HTTPRequest $request) { $this->request = $request; return $this; } /** * Getter for the Request object * * @return HTTPRequest */ public function getRequest() { return $this->request; } /** * Setter for the Response object * * @param HTTPResponse $response * @return Http Provides a fluent interface */ public function setResponse(HTTPResponse $response) { $this->response = $response; return $this; } /** * Getter for the Response object * * @return HTTPResponse */ public function getResponse() { return $this->response; } /** * Authenticate * * @throws Exception\RuntimeException * @return Authentication\Result */ public function authenticate() { if (empty($this->request) || empty($this->response)) { throw new Exception\RuntimeException( 'Request and Response objects must be set before calling authenticate()' ); } if ($this->imaProxy) { $getHeader = 'Proxy-Authorization'; } else { $getHeader = 'Authorization'; } $headers = $this->request->getHeaders(); if (!$headers->has($getHeader)) { return $this->challengeClient(); } $authHeader = $headers->get($getHeader)->getFieldValue(); if (!$authHeader) { return $this->challengeClient(); } list($clientScheme) = explode(' ', $authHeader); $clientScheme = strtolower($clientScheme); // The server can issue multiple challenges, but the client should // answer with only the selected auth scheme. if (!in_array($clientScheme, $this->supportedSchemes)) { $this->response->setStatusCode(400); return new Authentication\Result( Authentication\Result::FAILURE_UNCATEGORIZED, array(), array('Client requested an incorrect or unsupported authentication scheme') ); } // client sent a scheme that is not the one required if (!in_array($clientScheme, $this->acceptSchemes)) { // challenge again the client return $this->challengeClient(); } switch ($clientScheme) { case 'basic': $result = $this->_basicAuth($authHeader); break; case 'digest': $result = $this->_digestAuth($authHeader); break; default: throw new Exception\RuntimeException('Unsupported authentication scheme: ' . $clientScheme); } return $result; } /** * @deprecated * @see Http::challengeClient() * @return Authentication\Result Always returns a non-identity Auth result */ protected function _challengeClient() { trigger_error(sprintf( 'The method "%s" is deprecated and will be removed in the future; ' . 'please use the public method "%s::challengeClient()" instead', __METHOD__, __CLASS__ ), E_USER_DEPRECATED); return $this->challengeClient(); } /** * Challenge Client * * Sets a 401 or 407 Unauthorized response code, and creates the * appropriate Authenticate header(s) to prompt for credentials. * * @return Authentication\Result Always returns a non-identity Auth result */ public function challengeClient() { if ($this->imaProxy) { $statusCode = 407; $headerName = 'Proxy-Authenticate'; } else { $statusCode = 401; $headerName = 'WWW-Authenticate'; } $this->response->setStatusCode($statusCode); // Send a challenge in each acceptable authentication scheme $headers = $this->response->getHeaders(); if (in_array('basic', $this->acceptSchemes)) { $headers->addHeaderLine($headerName, $this->_basicHeader()); } if (in_array('digest', $this->acceptSchemes)) { $headers->addHeaderLine($headerName, $this->_digestHeader()); } return new Authentication\Result( Authentication\Result::FAILURE_CREDENTIAL_INVALID, array(), array('Invalid or absent credentials; challenging client') ); } /** * Basic Header * * Generates a Proxy- or WWW-Authenticate header value in the Basic * authentication scheme. * * @return string Authenticate header value */ protected function _basicHeader() { return 'Basic realm="' . $this->realm . '"'; } /** * Digest Header * * Generates a Proxy- or WWW-Authenticate header value in the Digest * authentication scheme. * * @return string Authenticate header value */ protected function _digestHeader() { $wwwauth = 'Digest realm="' . $this->realm . '", ' . 'domain="' . $this->domains . '", ' . 'nonce="' . $this->_calcNonce() . '", ' . ($this->useOpaque ? 'opaque="' . $this->_calcOpaque() . '", ' : '') . 'algorithm="' . $this->algo . '", ' . 'qop="' . implode(',', $this->supportedQops) . '"'; return $wwwauth; } /** * Basic Authentication * * @param string $header Client's Authorization header * @throws Exception\ExceptionInterface * @return Authentication\Result */ protected function _basicAuth($header) { if (empty($header)) { throw new Exception\RuntimeException('The value of the client Authorization header is required'); } if (empty($this->basicResolver)) { throw new Exception\RuntimeException( 'A basicResolver object must be set before doing Basic authentication' ); } // Decode the Authorization header $auth = substr($header, strlen('Basic ')); $auth = base64_decode($auth); if (!$auth) { throw new Exception\RuntimeException('Unable to base64_decode Authorization header value'); } // See ZF-1253. Validate the credentials the same way the digest // implementation does. If invalid credentials are detected, // re-challenge the client. if (!ctype_print($auth)) { return $this->challengeClient(); } // Fix for ZF-1515: Now re-challenges on empty username or password $creds = array_filter(explode(':', $auth)); if (count($creds) != 2) { return $this->challengeClient(); } $result = $this->basicResolver->resolve($creds[0], $this->realm, $creds[1]); if ($result instanceof Authentication\Result && $result->isValid()) { return $result; } if (!$result instanceof Authentication\Result && !is_array($result) && CryptUtils::compareStrings($result, $creds[1]) ) { $identity = array('username' => $creds[0], 'realm' => $this->realm); return new Authentication\Result(Authentication\Result::SUCCESS, $identity); } elseif (is_array($result)) { return new Authentication\Result(Authentication\Result::SUCCESS, $result); } return $this->challengeClient(); } /** * Digest Authentication * * @param string $header Client's Authorization header * @throws Exception\ExceptionInterface * @return Authentication\Result Valid auth result only on successful auth */ protected function _digestAuth($header) { if (empty($header)) { throw new Exception\RuntimeException('The value of the client Authorization header is required'); } if (empty($this->digestResolver)) { throw new Exception\RuntimeException('A digestResolver object must be set before doing Digest authentication'); } $data = $this->_parseDigestAuth($header); if ($data === false) { $this->response->setStatusCode(400); return new Authentication\Result( Authentication\Result::FAILURE_UNCATEGORIZED, array(), array('Invalid Authorization header format') ); } // See ZF-1052. This code was a bit too unforgiving of invalid // usernames. Now, if the username is bad, we re-challenge the client. if ('::invalid::' == $data['username']) { return $this->challengeClient(); } // Verify that the client sent back the same nonce if ($this->_calcNonce() != $data['nonce']) { return $this->challengeClient(); } // The opaque value is also required to match, but of course IE doesn't // play ball. if (!$this->ieNoOpaque && $this->_calcOpaque() != $data['opaque']) { return $this->challengeClient(); } // Look up the user's password hash. If not found, deny access. // This makes no assumptions about how the password hash was // constructed beyond that it must have been built in such a way as // to be recreatable with the current settings of this object. $ha1 = $this->digestResolver->resolve($data['username'], $data['realm']); if ($ha1 === false) { return $this->challengeClient(); } // If MD5-sess is used, a1 value is made of the user's password // hash with the server and client nonce appended, separated by // colons. if ($this->algo == 'MD5-sess') { $ha1 = hash('md5', $ha1 . ':' . $data['nonce'] . ':' . $data['cnonce']); } // Calculate h(a2). The value of this hash depends on the qop // option selected by the client and the supported hash functions switch ($data['qop']) { case 'auth': $a2 = $this->request->getMethod() . ':' . $data['uri']; break; case 'auth-int': // Should be REQUEST_METHOD . ':' . uri . ':' . hash(entity-body), // but this isn't supported yet, so fall through to default case default: throw new Exception\RuntimeException('Client requested an unsupported qop option'); } // Using hash() should make parameterizing the hash algorithm // easier $ha2 = hash('md5', $a2); // Calculate the server's version of the request-digest. This must // match $data['response']. See RFC 2617, section 3.2.2.1 $message = $data['nonce'] . ':' . $data['nc'] . ':' . $data['cnonce'] . ':' . $data['qop'] . ':' . $ha2; $digest = hash('md5', $ha1 . ':' . $message); // If our digest matches the client's let them in, otherwise return // a 401 code and exit to prevent access to the protected resource. if (CryptUtils::compareStrings($digest, $data['response'])) { $identity = array('username' => $data['username'], 'realm' => $data['realm']); return new Authentication\Result(Authentication\Result::SUCCESS, $identity); } return $this->challengeClient(); } /** * Calculate Nonce * * @return string The nonce value */ protected function _calcNonce() { // Once subtle consequence of this timeout calculation is that it // actually divides all of time into nonceTimeout-sized sections, such // that the value of timeout is the point in time of the next // approaching "boundary" of a section. This allows the server to // consistently generate the same timeout (and hence the same nonce // value) across requests, but only as long as one of those // "boundaries" is not crossed between requests. If that happens, the // nonce will change on its own, and effectively log the user out. This // would be surprising if the user just logged in. $timeout = ceil(time() / $this->nonceTimeout) * $this->nonceTimeout; $userAgentHeader = $this->request->getHeaders()->get('User-Agent'); if ($userAgentHeader) { $userAgent = $userAgentHeader->getFieldValue(); } elseif (isset($_SERVER['HTTP_USER_AGENT'])) { $userAgent = $_SERVER['HTTP_USER_AGENT']; } else { $userAgent = 'Zend_Authenticaion'; } $nonce = hash('md5', $timeout . ':' . $userAgent . ':' . __CLASS__); return $nonce; } /** * Calculate Opaque * * The opaque string can be anything; the client must return it exactly as * it was sent. It may be useful to store data in this string in some * applications. Ideally, a new value for this would be generated each time * a WWW-Authenticate header is sent (in order to reduce predictability), * but we would have to be able to create the same exact value across at * least two separate requests from the same client. * * @return string The opaque value */ protected function _calcOpaque() { return hash('md5', 'Opaque Data:' . __CLASS__); } /** * Parse Digest Authorization header * * @param string $header Client's Authorization: HTTP header * @return array|bool Data elements from header, or false if any part of * the header is invalid */ protected function _parseDigestAuth($header) { $temp = null; $data = array(); // See ZF-1052. Detect invalid usernames instead of just returning a // 400 code. $ret = preg_match('/username="([^"]+)"/', $header, $temp); if (!$ret || empty($temp[1]) || !ctype_print($temp[1]) || strpos($temp[1], ':') !== false) { $data['username'] = '::invalid::'; } else { $data['username'] = $temp[1]; } $temp = null; $ret = preg_match('/realm="([^"]+)"/', $header, $temp); if (!$ret || empty($temp[1])) { return false; } if (!ctype_print($temp[1]) || strpos($temp[1], ':') !== false) { return false; } else { $data['realm'] = $temp[1]; } $temp = null; $ret = preg_match('/nonce="([^"]+)"/', $header, $temp); if (!$ret || empty($temp[1])) { return false; } if (!ctype_xdigit($temp[1])) { return false; } $data['nonce'] = $temp[1]; $temp = null; $ret = preg_match('/uri="([^"]+)"/', $header, $temp); if (!$ret || empty($temp[1])) { return false; } // Section 3.2.2.5 in RFC 2617 says the authenticating server must // verify that the URI field in the Authorization header is for the // same resource requested in the Request Line. $rUri = $this->request->getUri(); $cUri = UriFactory::factory($temp[1]); // Make sure the path portion of both URIs is the same if ($rUri->getPath() != $cUri->getPath()) { return false; } // Section 3.2.2.5 seems to suggest that the value of the URI // Authorization field should be made into an absolute URI if the // Request URI is absolute, but it's vague, and that's a bunch of // code I don't want to write right now. $data['uri'] = $temp[1]; $temp = null; $ret = preg_match('/response="([^"]+)"/', $header, $temp); if (!$ret || empty($temp[1])) { return false; } if (32 != strlen($temp[1]) || !ctype_xdigit($temp[1])) { return false; } $data['response'] = $temp[1]; $temp = null; // The spec says this should default to MD5 if omitted. OK, so how does // that square with the algo we send out in the WWW-Authenticate header, // if it can easily be overridden by the client? $ret = preg_match('/algorithm="?(' . $this->algo . ')"?/', $header, $temp); if ($ret && !empty($temp[1]) && in_array($temp[1], $this->supportedAlgos)) { $data['algorithm'] = $temp[1]; } else { $data['algorithm'] = 'MD5'; // = $this->algo; ? } $temp = null; // Not optional in this implementation $ret = preg_match('/cnonce="([^"]+)"/', $header, $temp); if (!$ret || empty($temp[1])) { return false; } if (!ctype_print($temp[1])) { return false; } $data['cnonce'] = $temp[1]; $temp = null; // If the server sent an opaque value, the client must send it back if ($this->useOpaque) { $ret = preg_match('/opaque="([^"]+)"/', $header, $temp); if (!$ret || empty($temp[1])) { // Big surprise: IE isn't RFC 2617-compliant. $headers = $this->request->getHeaders(); if (!$headers->has('User-Agent')) { return false; } $userAgent = $headers->get('User-Agent')->getFieldValue(); if (false === strpos($userAgent, 'MSIE')) { return false; } $temp[1] = ''; $this->ieNoOpaque = true; } // This implementation only sends MD5 hex strings in the opaque value if (!$this->ieNoOpaque && (32 != strlen($temp[1]) || !ctype_xdigit($temp[1]))) { return false; } $data['opaque'] = $temp[1]; $temp = null; } // Not optional in this implementation, but must be one of the supported // qop types $ret = preg_match('/qop="?(' . implode('|', $this->supportedQops) . ')"?/', $header, $temp); if (!$ret || empty($temp[1])) { return false; } if (!in_array($temp[1], $this->supportedQops)) { return false; } $data['qop'] = $temp[1]; $temp = null; // Not optional in this implementation. The spec says this value // shouldn't be a quoted string, but apparently some implementations // quote it anyway. See ZF-1544. $ret = preg_match('/nc="?([0-9A-Fa-f]{8})"?/', $header, $temp); if (!$ret || empty($temp[1])) { return false; } if (8 != strlen($temp[1]) || !ctype_xdigit($temp[1])) { return false; } $data['nc'] = $temp[1]; $temp = null; return $data; } }
alucard98/ZendSkeletorApplication
vendor/zendframework2/zendframework2/library/Zend/Authentication/Adapter/Http.php
PHP
bsd-3-clause
26,826
[ 30522, 1026, 1029, 25718, 1013, 1008, 1008, 1008, 16729, 2094, 7705, 1006, 8299, 1024, 1013, 1013, 7705, 1012, 16729, 2094, 1012, 4012, 1013, 1007, 1008, 1008, 1030, 4957, 8299, 1024, 1013, 1013, 21025, 2705, 12083, 1012, 4012, 1013, 16729,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
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("EasyNetQ.DI.Autofac")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("EasyNetQ")] [assembly: AssemblyProduct("EasyNetQ.DI.Autofac")] [assembly: AssemblyCopyright("Copyright © EasyNetQ 2013")] [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("48a6ab6e-90a4-4712-a00b-f12059871681")]
nicklv/EasyNetQ
Source/EasyNetQ.DI.Autofac/Properties/AssemblyInfo.cs
C#
mit
979
[ 30522, 2478, 2291, 1012, 9185, 1025, 2478, 2291, 1012, 2448, 7292, 1012, 6970, 11923, 2121, 7903, 30524, 3378, 2007, 2019, 3320, 1012, 1031, 3320, 1024, 3320, 3775, 9286, 1006, 1000, 3733, 7159, 4160, 1012, 4487, 1012, 8285, 7011, 2278, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# Introduction **Hi everybody and welcome to this first tutorial !** This will be the first chapter of the tutorial covering the development of the "Geo App". > What is the "*Geo App*" about ? > > The "*Geo App*" is a web browser game built as a single page JavaScript application. Two modes will be implemented, relax and challenge. > The relax mode will display the country's information when the user selects it on the map. > The challenge mode will ask the user to find a randomly selected country in the world map. The code is available on <a title="tuto-geo-app" href="https://github.com/chi-mai2b/tuto-geo-app" target="_blank">GitHub (tuto-geo-app)</a> else [download .zip][1] In order to achieve this project, we will use the following libraries / tools: * [Backbone Marionette][2] *v1.7.3* * [Bootstrap 3][3] *v3.1.1* * [Handlebars][4] *2\.0.0-alpha.2* * [Less][5] *v1.7.0* * [Requirejs][6] *v2.1.11* * [Leaflet][7] *v0.7.3* ## Who is this tutorial for ? The targeted audience of this tutorial will be mainly developers, students in programming, geeks... The code will be explained and commented so you can read over and complete your understanding of the logic. It is recommended that you have at least a basic understanding of JavaScript, HTML and CSS. ## What is this tutorial about ? This tutorial will go through the different steps of development of a *single page web application*. Comments will cover the following aspects: * How to *use the different libraries* listed previously * How to *structure the application code* so that it does not turn into a single file of 300000 lines. * How to use *custom JS events* to avoid a maze of function and callback. * How to avoid having a single HTML file with an endless list of scripts tags. ## What is this tutorial NOT about ? This tutorial is not covering the basics of HTML, CSS or JavaScript. You will be expected to be familiar with the basics of web development. <!-- ==================================================================== --> <!--nextpage--> <!-- ==================================================================== --> # Getting started First let's start by setting up the development environment. ## Text editor / IDE Let's start simple with a simple text editor or IDE. You won't need any specific IDE to write the code. However, Windows Notepad may not help you a lot / (at all). If you are not sure on which one you should use, I would recommend the following ones: * [Sublime Text][8]: **(+)** *free, lightweight, customizable, simple* || **(-)** *feature available through plugins* * [IntelliJ][9] / [WebStorm][10] **(+)** *very good auto-complete / intellisense feature for CSS and JS* || **(-)** *heavy, advanced features require license* ## CLI tools The project will require a CLI (Command Line Interface) to run different commands. If you have Windows, I recommend **NOT** using the cmd.exe but rather another alternative. Since you probably have Git, you may have Git Bash installed also, it will be enough to run the commands we need. ## Node and NPM packages In the tutorial, we will use nodejs and npm so you will need to install it. > [Nodejs][11] *(v0.10.26 used)* At the end of the installation you should be able to run: node --version From there, install handlebars and less using the following commands: ### **Linux** sudo npm install -g less sudo npm install -g handlebars ### **MS Windows** npm install -g less npm install -g handlebars <u>Note:</u> Handlebar version will be discussed in the chapter dedicated to its use. If you wish to install a specific version, use the following command: npm install -g <name>@<version> See more in [NPM install docs][12] ## Virtual server The application will be AJAX based content loading, we need a web server. You can use the server of your choice. As indication, the tuto has been realized using both [Lampp][13] and [Xampp][14]. *It is recommended to use Apache aliases to map different URLs to different location in your drive. It allows to keep your work tidy without having to put everything inside the htdocs folder.* Good, you should now be ready to get your hands into some code ! <!-- ==================================================================== --> <!--nextpage--> <!-- ==================================================================== --> # Application base You will find the code for the application *base* on <a title="Github Application base branch" href="https://github.com/chi-mai2b/tuto-geo-app/tree/0-app-base" target="_blank">Github</a>. ## Purpose This version is the foundation of the future code, all configured to run normally. It has none of the feature implemented, it is a basic skeleton where the application will be built from. ## Folder structure The application's folder structure has been planned for further expansion. This is why the application has been structured in the following way: [expand title="Expand folder structure"] tuto-geo-app/ css/ images/ /* CSS related images */ /* less and css files here */ js/ geoapp/ /* Geo App JS code here */ main.js /* require js config */ vendor/ backbone/ bootstrap/ jquery/ marionette/ require/ underscore/ /* more 3PPs will be added as we go along */ [/expand] ### css/ This folder will store the styles for the application container. Important: None of the application specific styling should go in this folder. The aim is to ensure the application modularity and avoid dependencies others than 3PPs outside the application folder. As for the folder structure, the CSS folder is planned for further expansion with application specific style sheets on the application folder. ### js/ This folder contains application specific JavaScript code along with the requirejs configuration. All the application code is grouped in the *geoapp* folder. In the case we want to add a second application, the code would go in *secondApplicationName* folder. ### vendor/ Grouped in this folder will be all the 3PPs used for this project. ## Code at a glance ### main.js [expand title="Expand code"] require.config({ name: 'main', baseUrl: 'js/geoapp/', paths: { // Vendors 'jquery': '../../vendor/jquery/jquery.min', 'underscore': '../../vendor/underscore/underscore.min', 'text': '../../vendor/require/text', 'backbone': '../../vendor/backbone/backbone.min', 'backbone.wreqr': '../../vendor/marionette/backbone.wreqr.min', 'backbone.babysitter': '../../vendor/marionette/backbone.babysitter.min', 'marionette': '../../vendor/marionette/backbone.marionette.min', //App 'GeoApp': './GeoApp', }, shim: { 'jquery': { exports: '$' }, 'underscore': { exports: '_' }, 'backbone': { deps: ['underscore', 'jquery'], exports: 'Backbone' }, 'marionette': { deps: ['jquery', 'underscore', 'backbone'], exports: 'Backbone.Marionette' } } }); [/expand] The <a title="Requirejs config doc" href="http://requirejs.org/docs/api.html#config" target="_blank"><em>require.config</em></a> object configures the following options: * The `baseUrl` will used when we will query the different files. It is set here to *js/geoapp/* which is the application script folder. * The list of paths works as follow `"moduleName" : "path/to/module/js/file/without/extension"` We set here the default name and relative path of the different 3PPs <a title="Requirejs shim doc" href="http://requirejs.org/docs/api.html#config-shim" target="_blank">Shim</a> object configure the dependencies and export for the non AMD modules [expand title="Expand code"] /* global define */ define([ // start of the module definition 'GeoApp' ], function(geoAppInstance) { // load the application object 'use strict'; geoAppInstance.start(); // start the application }); // end of the module [/expand] On the previous code snippet you can see the <a title="Requirejs define doc" href="http://requirejs.org/docs/api.html#define" target="_blank"><em>define</em></a> function. You will provide here the dependencies of your module, they will be available through the function arguments. Here *GeoApp* is defined as dependency and made available by *geoAppInstance.* ### GeoApp.js [expand title="Expand code"] /* global define */ define([ 'marionette' ], function (Marionette) { 'use strict'; var geoApp = new Marionette.Application(), // instantiate new application DummyView = Marionette.ItemView.extend({ // extend view to add customized content template: function () { // template will provide the view with content return 'Congratulation !!! the application has started'; } }); // define the application container, refers here to the #appContainer in index.html geoApp.addRegions({ appContainer: '#appContainer' }); // instantiate and show our custom DummyView geoApp.appContainer.show(new DummyView()); // return the application instance without calling start, start is called in the main.js // this allows later to create a more global application manager and run multiple applications based on the #hash value return geoApp; }); [/expand] <!-- ==================================================================== --> <!--nextpage--> <!-- ==================================================================== --> # Introduction to Handlebars Templates > *Why should I use a template where a simple HTML string build does the job?* > > *Well, the choice is all yours, but a good few points may change your mind:* * It is good practice to keep the markup separated from the logic, so you end up with cleaner code * It is easier to reuse and adapt * Using this method, you will be able to pass variables to your template saving you from having to write supplementary code * From a security aspect, Handlebars escapes string variables; this lowers the risk of injection * more... You will see in this page how to create an HTML template using Handlebars (.hbs file) and use it in your application with Requirejs. Splitting the HTML templates in different files allows for more modularity and reusability of your code. The code for the examples and template configuration is available on <a title="Github Intro to template branch" href="https://github.com/chi-mai2b/tuto-geo-app/tree/1-intro-to-hb-template" target="_blank">Github</a>. We will cover how to display the template in the application on the next chapter. Handlebars will be used in two parts. First we will *compile* the templates using the CLI, then we will use it in the JavaScript code (*runtime*). As we precompile the templates in AMD modules, the Handlebars used in the project is Runtime and AMD, if you wish to download a newer version, make sure to get the Runtime and AMD as well. ## Compile the Templates Compiling template or static HTML could sound strange but the idea behind is to transform the markup in a JS function where a string is returned. It will make much more sense when we will use them later on in the tutorial. <u>Note:</u> You should have Handlebars installed with *npm* before continuing (see Getting Started). The templates should be saved in a dedicated folder, it makes the compilation process easier. In this project, templates are saved under `js/geoapp/templates`. Open the CLI and navigate to the `js/geoapp/` folder. Then run the following command to compile all template in the folder: handlebars -a -m templates/*.hbs -f compiledTemplates.js handlebars <params> <input> -f <outputFile> * params: * **--amd** / **-a** is used to get the templates compiled as AMD * **--min** / **-m** minifies the js output. * input: * **templates/*.hbs** select all .hbs files inside \*templates\* folder * outputFile: * **compiledTemplates.js** will be generated in the current location (e.g. js/geoapp/) You should read <a title="Handlebars" href="http://handlebarsjs.com/" target="_blank">Handlebars</a> and <a title="Handlebars precompile" href="http://handlebarsjs.com/precompilation.html" target="_blank">Handlebars precompilation</a> for more details. ### Examples In the following examples we will compile some templates for the next chapter. [expand title="_geoAppLayout.hbs"] <div class="mr-geoapp"> <section class="mr-geoappMain col-lg-10 col-md-10 col-sm-12 col-xs-12"></section> <section class="mr-geoappSide col-lg-2 col-md-2 col-sm-12 col-xs-12"></section> </div> [/expand] [expand title="_mainView.hbs"] <div class="mr-geoappMain panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">Geo Map</h3> </div> <div class="panel-body mr-geoappMain-map"></div> </div> [/expand] [expand title="_sideBarView.hbs"] <aside class="mr-geoappSide"> <div class="panel"> <div class="mr-geoappSide-countryName panel-body">Country name</div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">Score</h3> </div> <div class="panel-body">Player's score</div> </div> </aside> [/expand] <u>Note:</u> There is apparently a bug in the compiler that cause the template to be invalid if it is compiled alone. The simplest solution is to create a dummy hbs file if you have a single template in a folder. <!-- ==================================================================== --> <!--nextpage--> <!-- ==================================================================== --> # Application UI Design > UI: User Interface ## UI Layout Let's visualize how the application UI will be structured. [<img src="http://marc-ed-raffalli.com/blog/wp-content/uploads/2014/05/AppDesignLayout.png" alt="AppDesignLayout" width="343" height="150" class="alignnone size-full wp-image-37" />][15] * Left side: it will display the country name to select and the map in which the player will make the selection. * Right side: it will contain the scores and additional information about the country to find. Planned also, additional options for multi languages support. ## HTML mock up Before entering into deep JS coding, we will build a mock up of the result page. This will allow us to plan for many aspects of the application that do not require JS to be running like: * The styling of the page * The usability of the design and page structure * The cross device compatibility, here we use bootstrap to help building the layout [<img src="http://marc-ed-raffalli.com/blog/wp-content/uploads/2014/05/desktop.png" alt="desktop" width="455" height="207" class="alignnone size-full wp-image-38" />][16][<img src="http://marc-ed-raffalli.com/blog/wp-content/uploads/2014/05/mobile.png" alt="mobile" width="107" height="175" class="alignnone size-full wp-image-39" />][17] [expand title="HTML mock-up"] <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Tutorial - Geo app</title> <link href="PATH/TO/bootstrap.min.css" rel="stylesheet"> <link href="PATH/TO/style.css" rel="stylesheet"> </head> <body> <div class="mr-pageBody container" id="appContainer"> <div> <div class="mr-geoapp"> <div class="mr-geoappMain col-lg-10 col-md-10 col-sm-12 col-xs-12"> <div class="panel"> <div class="mr-geoappMain-countryName panel-body">Country name</div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">Geo Map</h3> </div> <div class="panel-body mr-geoappMain-map">--MAP--</div> </div> </div> <aside class="mr-geoappSide col-lg-2 col-md-2 col-sm-12 col-xs-12"> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">Score</h3> </div> <div class="mr-geoappSide-playerScore panel-body"> <div class="row"> <span class="mr-geoappSide-playerScore-correct label label-success col-lg-10 col-md-10 col-lg-offset-1 col-md-offset-1 col-sm-4 col-sm-offset-1 col-xs-4 col-xs-offset-1">0</span> <span class="mr-geoappSide-playerScore-error label label-danger col-lg-10 col-md-10 col-lg-offset-1 col-md-offset-1 col-sm-4 col-sm-offset-2 col-xs-4 col-xs-offset-2">0</span> </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">More Info</h3> </div> <div class="mr-geoappSide-countryInfo panel-body"> <div class="lead text-center">Capital City</div> <em>Main language</em> <div class="row"> <span class="col-lg-12 col-md-12 col-sm-6"><small><abbr title="Surface area">A</abbr>:</small> surface</span> <span class="col-lg-12 col-md-12 col-sm-6"><small><abbr title="Currency">Cur</abbr>:</small> currency</span> </div> <div class="row"> <span class="col-lg-12 col-md-12"><small><abbr title="Population">Pop</abbr>:</small> population</span> </div> </div> </div> </aside> </div> </div> </div> </body> </html> [/expand] [expand title="CSS mock-up"] body { background-color: #efefef } .mr-topNavLogo { margin: 0 15px; width: 60px; background: url("images/logo.png") no-repeat center; background-size: contain } .mr-pageBody { position: absolute; top: 0; left: 0; right: 0; bottom: 0; overflow-y: auto; padding-top: 70px; background: url("images/texture-grey.png"); box-shadow: 0 0 15px 5px #808080 } .mr-geoappSide-playerScore .label { font-size: 2.6rem; white-space: normal; overflow-wrap: break-word } @media (min-width: 992px) { .mr-geoappSide-playerScore .label { margin-bottom: 8px; font-size: 1.6rem } .mr-geoappSide-playerScore .label:last-of-type { margin-bottom: 0 } } .mr-geoappSide-countryInfo .lead { margin-bottom: 6px } [/expand] This template does not represent necessarily the end result but it contains most of the future layout. In the next chapter, we will structure the application code using (finally :P) Marionette js. <!-- ==================================================================== --> <!--nextpage--> <!-- ==================================================================== --> # Application core The code for this chapter is available on <a title="Github Application layout building branch" href="https://github.com/chi-mai2b/tuto-geo-app/tree/2-layout-building" target="_blank">Github</a> ## Introduction You will see in this page how to structure the application using Application, Layout and View combined with the compiled templates discussed previously. Application, Layout and View (soon more) are <a title="Marionette.js" href="http://marionettejs.com/" target="_blank">Marionette js</a> classes. ## Marionette.Application The <a title="Marionette.Application" href="https://github.com/marionettejs/backbone.marionette/blob/master/docs/marionette.application.md" target="_blank">Marionette Application</a> is where everything starts. From this class you will instantiate the different parts of your application. In our case, we will call a layout GeoAppLayout. Later on, we will add more functionalities. var geoApp = new Marionette.Application(); // instantiate new Marionette application // define the application container, // refers here to the #appContainer in index.html geoApp.addRegions({ appContainer: '#appContainer' }); // instantiate and show the GeoAppLayout geoApp.appContainer.show(new GeoAppLayout()); <u>Note:</u> Dislike the other elements of Marionette, the Application is not extended. We instantiate it directly before calling the `app.start()` method. ## Marionette.Layout The <a title="Marionette.Layout" href="https://github.com/marionettejs/backbone.marionette/blob/master/docs/marionette.layout.md" target="_blank">Marionette Layouts</a> are used here to structure multiple Views and sub layouts. The GeoAppLayout will instantiate two sub layouts that represent the main parts of the application (see UI and comments in code). return Marionette.Layout.extend({ // set the template to use in this view, file name is used as identifier template: template['_geoAppLayout.hbs'], regions: { // split the application screen in two regions, identifier point to the element in the template mainRegion: '.mr-geoappMainHolder', sideRegion: '.mr-geoappSideHolder' }, onShow: function () { // instantiate and show layout this.mainRegion.show(new MainLayout()); this.sideRegion.show(new SideLayout()); } }); The other two layouts are very similar to this example. ## Marionette.ItemView The <a title="Marionette.ItemView" href="https://github.com/marionettejs/backbone.marionette/blob/master/docs/marionette.itemview.md" target="_blank">Marionette ItemViews</a> will be used as interface between the DOM elements (template markup) and the core logic. On the following example, we see the player's score view. return Marionette.ItemView.extend({ // set the template to use in this view, file name is used as identifier template: template['_playerScoreView.hbs'] }); The views will be associated with Models and Handlebars templates in the chapter covering the game core. The next chapter will show how we integrate the map and the events generated by the user's interactions. <!-- ==================================================================== --> <!--nextpage--> <!-- ==================================================================== --> # Integrating Leaflet Map The code for this chapter is available on <a title="Github Application map integration branch" href="https://github.com/chi-mai2b/tuto-geo-app/tree/3-map-integration" target="_blank">Github</a> ## Introduction We will be using [Leaflet][7] to display our application map. The library has a lot of tutorials to explain different features. One of the feature which will be key for the application is the ability to display clickable areas over the map. This is done using GeoJson. (see [GeoJson Leaflet tuto][18]). ## Display the Map ### Setting up the View for the Map Under the folder `view/main/` we create a new View called `MapView`. It will be used from the logic side of the application to get the element which will contain the map. return Marionette.ItemView.extend({ // Backbone automatically wrap the View into a div tag, we need that tag to be position relative and taking full height of its parent. // It is possible to specify the tag name and class name in the View and remove the root element of the template. // However, I don't like to mix markup and styling with logic side of the code. // This css class name only provides the position and height. className:'mr-geoapp-elt', // set the template to use in this view, file name is used as identifier template: template['_mapView.hbs'], // Set the ui elements that we will use ui: { map: '.mr-geoappMain-map' }, getMapElement: function () { return this.ui.map; } }); ### Adding the logic for the map In order to create, configure and interact with the Map, we create a new file into `region/main/` called MapRegion. [expand title="MapRegion code"] return Marionette.Region.extend({ el: '.mr-geoappMain-mapHolder', onShow: function (view) { // view.getMapElement() will return the map element in the template // we need to use get(0) because of JQuery, as the element returned is the Jquery wrapped element. var mapElt = view.getMapElement().get(0), map = Leaflet.map(mapElt, { center: [50, 0], // center the map over Europe region maxBounds: [ // set the map bounds so that the user cannot navigate outside the map [90, 180], [-90, -180] ], zoom: 3, // set the zoom, minZoom and maxZoom minZoom: 2, maxZoom: 8 }); // see tutorial at // http://leafletjs.com/examples/quick-start.html // // you can create your custom map here: // https://www.mapbox.com/ Leaflet.tileLayer('http://{s}.tiles.mapbox.com/v3/YOUR-MAP-ID/{z}/{x}/{y}.png', { maxZoom: 10 }).addTo(map); // Leaflet tuto: // http://leafletjs.com/examples/choropleth.html function onEachFeature(feature, layer) { layer.on({ mouseover: highlightFeature, mouseout: resetHighlight, click: clickEvt }); } function resetHighlight(e) { geojson.resetStyle(e.target); } var geojson = Leaflet.geoJson(worldGeoJson, { style: style, onEachFeature: onEachFeature }).addTo(map); } }); function style() { // Set the area with a transparent background, bordered with dash colored in #aaa return { fillColor: 'transparent', weight: 1, opacity: 1, color: '#aaa', dashArray: '3' }; } function clickEvt(e) { // We will handle the click event here // This currently displays the name of the clicked area console.log('Click on ' + e.target.feature.properties.name); } function highlightFeature(e) { var layer = e.target; // When the user mouses over a specific area, this one gets the background changed to #ccc and the border weight increased. layer.setStyle({ fillColor: '#ccc', weight: 2, color: '#888', fillOpacity: 0.5 }); if (!Leaflet.Browser.ie && !Leaflet.Browser.opera) { layer.bringToFront(); } } [/expand] The <a title="Marionette.Region" href="https://github.com/marionettejs/backbone.marionette/blob/master/docs/marionette.region.md" target="_blank">Region</a> is a <a title="Marionette.js" href="http://marionettejs.com/" target="_blank">Marionette js</a> classes. It allows to separate the View from the logic part. See comments in the code for more details. The Leaflet GeoJson tutorial covers the functionalities added on this chapter. If you encounter any difficulties, it is a good resource to use. ## Useful links [Leaflet quick start tuto][19] [Leaflet GeoJson tuto][20] [Leaflet API][21] [Create your custom map with Mapbox][22] <!-- ==================================================================== --> <!--nextpage--> <!-- ==================================================================== --> # Game Logic core and data The code for this chapter is available on <a title="Github Application game logic branch" href="https://github.com/chi-mai2b/tuto-geo-app/tree/4-game-logic" target="_blank">Github</a> ## Introduction This chapter covers the way we will combine the map and the game logic. We will see as well how to decouple our modules using the JS custom events and how to combine the model with handlebars template. ## Game data Model ### Game model The <a title="Backbone.Model doc" href="http://backbonejs.org/#Model" target="_blank">Backbone.Model</a> is used to store the game related data: * score (correct / error) * country name * country info See <a title="What is a Model" href="http://backbonetutorials.com/what-is-a-model/" target="_blank">Backbone doc What is a Model ?</a> [expand title="Game Model code"] return Backbone.Model.extend({ // Set the default values for the game score defaults: { score: { correct: 0, error: 0 }, countryName: '', countryInfo: {} }, //--------------------------------------- getScore: function () { return this.get('score'); }, //--------------------------------------- increaseCorrect: function () { scoreUpdate.call(this, 1, 0); }, increaseError: function () { scoreUpdate.call(this, 0, 1); }, //--------------------------------------- setCountryName: function (countryName) { this.set('countryName', countryName); }, resetScore: function () { this.setScore({ correct: 0, error: 0 }); }, setScore: function (score) { this.set('score', score); }, setCountryInfo: function (countryInfo) { this.set('countryInfo', countryInfo); } //--------------------------------------- }); function scoreUpdate(c, e) { var oldScore = this.getScore(), newScore = { correct: oldScore.correct + c, error: oldScore.error + e }; this.setScore(newScore); } [/expand] The game controller will manage the model and update it at the different phases of the game. Every time an attribute of the model is updated, an event is triggered. The Marionette View classes are listening to these events; this allow us to update the value displayed on the UI with a minimum code. ### Model / View update This feature is based on the template that we covered previously. [expand title="GameController code"] <div class="panel"> <div class="mr-geoappMain-countryName panel-body">{{countryName}}</div> </div> [/expand] The `{{countryName}}` represents the name of the model attribute. As we instantiate the View in the Layout, we supply the model instance. [expand title="CountryNameView code"] return Marionette.ItemView.extend({ // set the template to use in this view, file name is used as identifier template: template['_countryNameView.hbs'], initialize: function(){ // Listen to the change event on the coutryName attribute of the Model. // render will be called every time the value of the countryName changes this.model.on('change:countryName', this.render, this); } }); [/expand] As it is explained in the comments, `model.on('evt:attributeName', callback)` allows us to listen to the proper events and avoid re-rendering the template for nothing. ## Supply the Model to the View One of the question you could have is *"How should I set the Model to the different Views?"*. We will use <a title="Backbone Wreqr" href="https://github.com/marionettejs/backbone.wreqr" target="_blank">Backbone Wreqr</a>. More specifically, we will use the Request-Response and Vent functionality. ### Request-Response It allows us to create a getter through JS custom event. We will use it for the Model but also for the GeoJson data. > *Why would we want to put the GeoJson with the Controller?* > The reasons are quite simple: > * The data about countries are related to the GeoJson by the country ID. The logic of the game controller depends on it, the countries displayed must be in the country data and vice versa. > * The GeoJson is a standard, we could replace the map by another 3PP and display the GeoJson data on top of it. The following code snippet shows how to initiate the channel with the Request-Response (reqres) for the instance of Game Model var gameChannel = Wreqr.radio.channel('game'); gameChannel.reqres.setHandler('gameModel', function () { return this.gameModel; }, this); The model is then requested the following way in the Layout: var gameModel = Wreqr.radio.reqres.request('game', 'gameModel'); ### Vent The different parts of the application can communicate simply through events. The Map region needs to communicate the selected country ID to the Controller which checks it: var mapChannel = Wreqr.radio.channel('map'); // on the click event handler mapChannel.vent.trigger('countrySelected', e.target.feature.id); On the Controller side, we need to listen to that event: var mapChannel = Wreqr.radio.channel('map'); mapChannel.vent.on('countrySelected', evaluateSelection, this); `evaluateSelection` is the callback that will evaluate the country ID. ## Game Controller What is the <a title="Marionette.Controller" href="https://github.com/marionettejs/backbone.marionette/blob/master/docs/marionette.controller.md" target="_blank">Marionette.Controller</a> ? > A Controller is a white-label Marionette Object. Its name can be a cause for confusion, as it actually has nothing to do with the popular MVC architectural pattern. Instead, it's better to think of the Controller as a base object from which you can build. > Controllers should be used when you have a task that you would like an object to be responsible for, but none of the other Marionette Classes quite make sense to do it. It's a base object for you to use to create a new Class altogether. *Marionette doc* We will use the Controller class to group all game related logic. This way, we separate it from the Views and it would be easier to reuse it later in another application. [expand title="GameController code"] return Marionette.Controller.extend({ // All the game business is abstracted in this Controller. // The targeted result is to separate the game logic from the Views, // so that it is very easy to reuse in another Application. initialize: function () { this.gameModel = new GameModel(); this.countriesIdArr = Object.keys(countriesData); // Use Backbone.Wreqr for the event mechanism // https://github.com/marionettejs/backbone.wreqr var mapChannel = Wreqr.radio.channel('map'), gameChannel = Wreqr.radio.channel('game'); //----------------------------------------------- mapChannel.vent.on('countrySelected', evaluateSelection, this); //----------------------------------------------- mapChannel.reqres.setHandler('mapGeoJson', function () { return worldGeoJson; }); //----------------------------------------------- gameChannel.reqres.setHandler('gameModel', function () { return this.gameModel; }, this); }, selectNewCountry: function () { this.currentId = getRandomId.call(this); var newCountry = countriesData[this.currentId], countryData = { capital: newCountry.capital, currency: newCountry.currency, language: newCountry.language, area: (newCountry.area !== -1) ? newCountry.area : null }; this.gameModel.setCountryName(newCountry.name); this.gameModel.setCountryInfo(countryData); }, startGame: function () { // When the game starts, set the score to zero, and select a new country to find this.gameModel.resetScore();// The score reset will be part of a next coming feature this.selectNewCountry(); } }); function evaluateSelection(selectedCountryId) { if (this.currentId === selectedCountryId) { this.gameModel.increaseCorrect(); this.selectNewCountry(); } else { this.gameModel.increaseError(); } } function getRandomId() { /*jshint validthis: true */ // The jshint validthis: true is necessary when it will come to code quality testing using JSHint, // This step will come at a later stage. var max = this.countriesIdArr.length, randomIndex = Math.floor(Math.random() * (max - 1)); // Return a randomly selected country from the list. return this.countriesIdArr[randomIndex]; } [/expand] The MapRegion will trigger an event every time the user selects a country providing the country ID. The Controller needs to listen to this event and checks the ID against the ID of the country to find. It updates the score depending on the result. <!-- ==================================================================== --> <!--nextpage--> <!-- ==================================================================== --> # Congratulations !!! You reached the end of this tutorial. You should now have a working application similar to: More features will be added later such as multi language support, relax and challenge mode, etc. Many thanks for reading, I hope you enjoyed it and that it brought you additional knowledge about ways to build JS applications. See you soon for more tutorials ! [1]: https://github.com/chi-mai2b/tuto-geo-app/archive/master.zip [2]: http://marionettejs.com/ [3]: http://getbootstrap.com/ [4]: http://handlebarsjs.com/ [5]: http://lesscss.org/ [6]: http://requirejs.org/ [7]: http://leafletjs.com/ [8]: http://www.sublimetext.com/3 [9]: http://www.jetbrains.com/idea/ [10]: http://www.jetbrains.com/webstorm/ [11]: http://nodejs.org/ [12]: https://www.npmjs.org/doc/install.html [13]: https://www.google.ie/search?q=install+lamp+on+linux "Google search" [14]: https://www.apachefriends.org/ [15]: http://marc-ed-raffalli.com/blog/wp-content/uploads/2014/05/AppDesignLayout.png [16]: http://marc-ed-raffalli.com/blog/wp-content/uploads/2014/05/desktop.png [17]: http://marc-ed-raffalli.com/blog/wp-content/uploads/2014/05/mobile.png [18]: http://leafletjs.com/examples/geojson.html [19]: http://leafletjs.com/examples/quick-start.html [20]: http://leafletjs.com/examples/choropleth.html [21]: http://leafletjs.com/reference.html [22]: https://www.mapbox.com/
chi-mai2b/tuto-geo-app
docs/Tuto.md
Markdown
mit
40,266
[ 30522, 1001, 4955, 1008, 1008, 7632, 7955, 1998, 6160, 2000, 2023, 2034, 14924, 4818, 999, 1008, 1008, 2023, 2097, 2022, 1996, 2034, 3127, 1997, 1996, 14924, 4818, 5266, 1996, 2458, 1997, 1996, 1000, 20248, 10439, 1000, 1012, 1028, 2054, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
using System; namespace WaCore.Sample.Middlewares.Models { public class ErrorViewModel { public string RequestId { get; set; } public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); } }
HerbertBodner/webapp-core
src/WaCore.Sample.Middlewares/Models/ErrorViewModel.cs
C#
gpl-2.0
223
[ 30522, 2478, 2291, 1025, 3415, 15327, 11333, 17345, 1012, 7099, 1012, 2690, 8059, 2015, 1012, 4275, 1063, 2270, 2465, 7561, 8584, 5302, 9247, 1063, 2270, 5164, 5227, 3593, 1063, 2131, 1025, 2275, 1025, 1065, 2270, 22017, 2140, 2265, 2890, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* ========================================================== * bootstrap-formhelpers-countries.en_US.js * https://github.com/vlamanna/BootstrapFormHelpers * ========================================================== * Copyright 2012 Vincent Lamanna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ========================================================== */ var BFHCountriesList = { 'AF': 'Afghanistan', 'AL': 'Albania', 'DZ': 'Algeria', 'AS': 'American Samoa', 'AD': 'Andorra', 'AO': 'Angola', 'AI': 'Anguilla', 'AQ': 'Antarctica', 'AG': 'Antigua and Barbuda', 'AR': 'Argentina', 'AM': 'Armenia', 'AW': 'Aruba', 'AU': 'Australia', 'AT': 'Austria', 'AZ': 'Azerbaijan', 'BH': 'Bahrain', 'BD': 'Bangladesh', 'BB': 'Barbados', 'BY': 'Belarus', 'BE': 'Belgium', 'BZ': 'Belize', 'BJ': 'Benin', 'BM': 'Bermuda', 'BT': 'Bhutan', 'BO': 'Bolivia', 'BA': 'Bosnia and Herzegovina', 'BW': 'Botswana', 'BV': 'Bouvet Island', 'BR': 'Brazil', 'IO': 'British Indian Ocean Territory', 'VG': 'British Virgin Islands', 'BN': 'Brunei', 'BG': 'Bulgaria', 'BF': 'Burkina Faso', 'BI': 'Burundi', 'CI': 'Côte d\'Ivoire', 'KH': 'Cambodia', 'CM': 'Cameroon', 'CA': 'Canada', 'CV': 'Cape Verde', 'KY': 'Cayman Islands', 'CF': 'Central African Republic', 'TD': 'Chad', 'CL': 'Chile', 'CN': 'China', 'CX': 'Christmas Island', 'CC': 'Cocos (Keeling) Islands', 'CO': 'Colombia', 'KM': 'Comoros', 'CG': 'Congo', 'CK': 'Cook Islands', 'CR': 'Costa Rica', 'HR': 'Croatia', 'CU': 'Cuba', 'CY': 'Cyprus', 'CZ': 'Czech Republic', 'CD': 'Democratic Republic of the Congo', 'DK': 'Denmark', 'DJ': 'Djibouti', 'DM': 'Dominica', 'DO': 'Dominican Republic', 'TP': 'East Timor', 'EC': 'Ecuador', 'EG': 'Egypt', 'SV': 'El Salvador', 'GQ': 'Equatorial Guinea', 'ER': 'Eritrea', 'EE': 'Estonia', 'ET': 'Ethiopia', 'FO': 'Faeroe Islands', 'FK': 'Falkland Islands', 'FJ': 'Fiji', 'FI': 'Finland', 'MK': 'Former Yugoslav Republic of Macedonia', 'FR': 'France', 'FX': 'France, Metropolitan', 'GF': 'French Guiana', 'PF': 'French Polynesia', 'TF': 'French Southern Territories', 'GA': 'Gabon', 'GE': 'Georgia', 'DE': 'Germany', 'GH': 'Ghana', 'GI': 'Gibraltar', 'GR': 'Greece', 'GL': 'Greenland', 'GD': 'Grenada', 'GP': 'Guadeloupe', 'GU': 'Guam', 'GT': 'Guatemala', 'GN': 'Guinea', 'GW': 'Guinea-Bissau', 'GY': 'Guyana', 'HT': 'Haiti', 'HM': 'Heard and Mc Donald Islands', 'HN': 'Honduras', 'HK': 'Hong Kong', 'HU': 'Hungary', 'IS': 'Iceland', 'IN': 'India', 'ID': 'Indonesia', 'IR': 'Iran', 'IQ': 'Iraq', 'IE': 'Ireland', 'IL': 'Israel', 'IT': 'Italy', 'JM': 'Jamaica', 'JP': 'Japan', 'JO': 'Jordan', 'KZ': 'Kazakhstan', 'KE': 'Kenya', 'KI': 'Kiribati', 'KW': 'Kuwait', 'KG': 'Kyrgyzstan', 'LA': 'Laos', 'LV': 'Latvia', 'LB': 'Lebanon', 'LS': 'Lesotho', 'LR': 'Liberia', 'LY': 'Libya', 'LI': 'Liechtenstein', 'LT': 'Lithuania', 'LU': 'Luxembourg', 'MO': 'Macau', 'MG': 'Madagascar', 'MW': 'Malawi', 'MY': 'Malaysia', 'MV': 'Maldives', 'ML': 'Mali', 'MT': 'Malta', 'MH': 'Marshall Islands', 'MQ': 'Martinique', 'MR': 'Mauritania', 'MU': 'Mauritius', 'YT': 'Mayotte', 'MX': 'Mexico', 'FM': 'Micronesia', 'MD': 'Moldova', 'MC': 'Monaco', 'MN': 'Mongolia', 'ME': 'Montenegro', 'MS': 'Montserrat', 'MA': 'Morocco', 'MZ': 'Mozambique', 'MM': 'Myanmar', 'NA': 'Namibia', 'NR': 'Nauru', 'NP': 'Nepal', 'NL': 'Netherlands', 'AN': 'Netherlands Antilles', 'NC': 'New Caledonia', 'NZ': 'New Zealand', 'NI': 'Nicaragua', 'NE': 'Niger', 'NG': 'Nigeria', 'NU': 'Niue', 'NF': 'Norfolk Island', 'KP': 'North Korea', 'MP': 'Northern Marianas', 'NO': 'Norway', 'OM': 'Oman', 'PK': 'Pakistan', 'PW': 'Palau', 'PS': 'Palestine', 'PA': 'Panama', 'PG': 'Papua New Guinea', 'PY': 'Paraguay', 'PE': 'Peru', 'PH': 'Philippines', 'PN': 'Pitcairn Islands', 'PL': 'Poland', 'PT': 'Portugal', 'PR': 'Puerto Rico', 'QA': 'Qatar', 'RE': 'Reunion', 'RO': 'Romania', 'RU': 'Russia', 'RW': 'Rwanda', 'ST': 'São Tomé and Príncipe', 'SH': 'Saint Helena', 'PM': 'St. Pierre and Miquelon', 'KN': 'Saint Kitts and Nevis', 'LC': 'Saint Lucia', 'VC': 'Saint Vincent and the Grenadines', 'WS': 'Samoa', 'SM': 'San Marino', 'SA': 'Saudi Arabia', 'SN': 'Senegal', 'RS': 'Serbia', 'SC': 'Seychelles', 'SL': 'Sierra Leone', 'SG': 'Singapore', 'SK': 'Slovakia', 'SI': 'Slovenia', 'SB': 'Solomon Islands', 'SO': 'Somalia', 'ZA': 'South Africa', 'GS': 'South Georgia and the South Sandwich Islands', 'KR': 'South Korea', 'ES': 'Spain', 'LK': 'Sri Lanka', 'SD': 'Sudan', 'SR': 'Suriname', 'SJ': 'Svalbard and Jan Mayen Islands', 'SZ': 'Swaziland', 'SE': 'Sweden', 'CH': 'Switzerland', 'SY': 'Syria', 'TW': 'Taiwan', 'TJ': 'Tajikistan', 'TZ': 'Tanzania', 'TH': 'Thailand', 'BS': 'The Bahamas', 'GM': 'The Gambia', 'TG': 'Togo', 'TK': 'Tokelau', 'TO': 'Tonga', 'TT': 'Trinidad and Tobago', 'TN': 'Tunisia', 'TR': 'Turkey', 'TM': 'Turkmenistan', 'TC': 'Turks and Caicos Islands', 'TV': 'Tuvalu', 'VI': 'US Virgin Islands', 'UG': 'Uganda', 'UA': 'Ukraine', 'AE': 'United Arab Emirates', 'GB': 'United Kingdom', 'US': 'United States', 'UM': 'United States Minor Outlying Islands', 'UY': 'Uruguay', 'UZ': 'Uzbekistan', 'VU': 'Vanuatu', 'VA': 'Vatican City', 'VE': 'Venezuela', 'VN': 'Vietnam', 'WF': 'Wallis and Futuna Islands', 'EH': 'Western Sahara', 'YE': 'Yemen', 'ZM': 'Zambia', 'ZW': 'Zimbabwe' };
Eonic/EonicWeb5
wwwroot/ewcommon/bs3/addons/formHelpers/js/lang/en_US/bootstrap-formhelpers-countries.en_US.js
JavaScript
apache-2.0
6,201
[ 30522, 1013, 1008, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 102...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * (c) Copyright Ascensio System SIA 2010-2019 * * This program is a free software product. You can redistribute it and/or * modify it under the terms of the GNU Affero General Public License (AGPL) * version 3 as published by the Free Software Foundation. In accordance with * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect * that Ascensio System SIA expressly excludes the warranty of non-infringement * of any third-party rights. * * This program is distributed WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html * * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha * street, Riga, Latvia, EU, LV-1050. * * The interactive user interfaces in modified source and object code versions * of the Program must display Appropriate Legal Notices, as required under * Section 5 of the GNU AGPL version 3. * * Pursuant to Section 7(b) of the License you must retain the original Product * logo when distributing the program. Pursuant to Section 7(e) we decline to * grant you any rights under trademark law for use of our trademarks. * * All the Product's GUI elements, including illustrations and icon sets, as * well as technical writing content are licensed under the terms of the * Creative Commons Attribution-ShareAlike 4.0 International. See the License * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * */ #pragma once #include "../PptxShape.h" namespace OOXMLShapes { class CFoldedCorner : public CPPTXShape { public: CFoldedCorner() { LoadFromXML( _T("<ooxml-shape>") _T("<avLst xmlns=\"http://schemas.openxmlformats.org/drawingml/2006/main\">") _T("<gd name=\"adj\" fmla=\"val 16667\" />") _T("</avLst>") _T("<gdLst xmlns=\"http://schemas.openxmlformats.org/drawingml/2006/main\">") _T("<gd name=\"a\" fmla=\"pin 0 adj 50000\" />") _T("<gd name=\"dy2\" fmla=\"*/ ss a 100000\" />") _T("<gd name=\"dy1\" fmla=\"*/ dy2 1 5\" />") _T("<gd name=\"x1\" fmla=\"+- r 0 dy2\" />") _T("<gd name=\"x2\" fmla=\"+- x1 dy1 0\" />") _T("<gd name=\"y2\" fmla=\"+- b 0 dy2\" />") _T("<gd name=\"y1\" fmla=\"+- y2 dy1 0\" />") _T("</gdLst>") _T("<ahLst xmlns=\"http://schemas.openxmlformats.org/drawingml/2006/main\">") _T("<ahXY gdRefX=\"adj\" minX=\"0\" maxX=\"50000\">") _T("<pos x=\"x1\" y=\"b\" />") _T("</ahXY>") _T("</ahLst>") _T("<cxnLst xmlns=\"http://schemas.openxmlformats.org/drawingml/2006/main\">") _T("<cxn ang=\"3cd4\">") _T("<pos x=\"hc\" y=\"t\" />") _T("</cxn>") _T("<cxn ang=\"cd2\">") _T("<pos x=\"l\" y=\"vc\" />") _T("</cxn>") _T("<cxn ang=\"cd4\">") _T("<pos x=\"hc\" y=\"b\" />") _T("</cxn>") _T("<cxn ang=\"0\">") _T("<pos x=\"r\" y=\"vc\" />") _T("</cxn>") _T("</cxnLst>") _T("<rect l=\"l\" t=\"t\" r=\"r\" b=\"y2\" xmlns=\"http://schemas.openxmlformats.org/drawingml/2006/main\" />") _T("<pathLst xmlns=\"http://schemas.openxmlformats.org/drawingml/2006/main\">") _T("<path stroke=\"false\" extrusionOk=\"false\">") _T("<moveTo>") _T("<pt x=\"l\" y=\"t\" />") _T("</moveTo>") _T("<lnTo>") _T("<pt x=\"r\" y=\"t\" />") _T("</lnTo>") _T("<lnTo>") _T("<pt x=\"r\" y=\"y2\" />") _T("</lnTo>") _T("<lnTo>") _T("<pt x=\"x1\" y=\"b\" />") _T("</lnTo>") _T("<lnTo>") _T("<pt x=\"l\" y=\"b\" />") _T("</lnTo>") _T("<close />") _T("</path>") _T("<path stroke=\"false\" fill=\"darkenLess\" extrusionOk=\"false\">") _T("<moveTo>") _T("<pt x=\"x1\" y=\"b\" />") _T("</moveTo>") _T("<lnTo>") _T("<pt x=\"x2\" y=\"y1\" />") _T("</lnTo>") _T("<lnTo>") _T("<pt x=\"r\" y=\"y2\" />") _T("</lnTo>") _T("<close />") _T("</path>") _T("<path fill=\"none\" extrusionOk=\"false\">") _T("<moveTo>") _T("<pt x=\"x1\" y=\"b\" />") _T("</moveTo>") _T("<lnTo>") _T("<pt x=\"x2\" y=\"y1\" />") _T("</lnTo>") _T("<lnTo>") _T("<pt x=\"r\" y=\"y2\" />") _T("</lnTo>") _T("<lnTo>") _T("<pt x=\"x1\" y=\"b\" />") _T("</lnTo>") _T("<lnTo>") _T("<pt x=\"l\" y=\"b\" />") _T("</lnTo>") _T("<lnTo>") _T("<pt x=\"l\" y=\"t\" />") _T("</lnTo>") _T("<lnTo>") _T("<pt x=\"r\" y=\"t\" />") _T("</lnTo>") _T("<lnTo>") _T("<pt x=\"r\" y=\"y2\" />") _T("</lnTo>") _T("</path>") _T("</pathLst>") _T("</ooxml-shape>") ); } }; }
ONLYOFFICE/core
ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTXShape/OOXMLShapes/CFoldedCorner.h
C
agpl-3.0
4,996
[ 30522, 1013, 1008, 1008, 1006, 1039, 1007, 9385, 2004, 19023, 3695, 2291, 9033, 2050, 2230, 1011, 10476, 1008, 1008, 2023, 2565, 2003, 1037, 2489, 4007, 4031, 1012, 2017, 2064, 2417, 2923, 3089, 8569, 2618, 2009, 1998, 1013, 2030, 1008, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="fr"> <head> <!-- Generated by javadoc (1.8.0_121) on Fri Mar 30 17:39:20 CEST 2018 --> <title>F-Index</title> <meta name="date" content="2018-03-30"> <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="F-Index"; } } 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>Package</li> <li>Class</li> <li>Use</li> <li><a href="../overview-tree.html">Tree</a></li> <li><a href="../deprecated-list.html">Deprecated</a></li> <li class="navBarCell1Rev">Index</li> <li><a href="../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="index-5.html">Prev Letter</a></li> <li><a href="index-7.html">Next Letter</a></li> </ul> <ul class="navList"> <li><a href="../index.html?index-files/index-6.html" target="_top">Frames</a></li> <li><a href="index-6.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="contentContainer"><a href="index-1.html">A</a>&nbsp;<a href="index-2.html">B</a>&nbsp;<a href="index-3.html">C</a>&nbsp;<a href="index-4.html">D</a>&nbsp;<a href="index-5.html">E</a>&nbsp;<a href="index-6.html">F</a>&nbsp;<a href="index-7.html">G</a>&nbsp;<a href="index-8.html">I</a>&nbsp;<a href="index-9.html">L</a>&nbsp;<a href="index-10.html">M</a>&nbsp;<a href="index-11.html">P</a>&nbsp;<a href="index-12.html">R</a>&nbsp;<a href="index-13.html">S</a>&nbsp;<a href="index-14.html">T</a>&nbsp;<a href="index-15.html">V</a>&nbsp;<a name="I:F"> <!-- --> </a> <h2 class="title">F</h2> <dl> <dt><a href="../interfaceGraphique/FenetreConfiguration.html" title="class in interfaceGraphique"><span class="typeNameLink">FenetreConfiguration</span></a> - Class in <a href="../interfaceGraphique/package-summary.html">interfaceGraphique</a></dt> <dd> <div class="block">Classe FenetreConfiguration</div> </dd> <dt><span class="memberNameLink"><a href="../interfaceGraphique/FenetreConfiguration.html#fentePiece--">fentePiece()</a></span> - Method in class interfaceGraphique.<a href="../interfaceGraphique/FenetreConfiguration.html" title="class in interfaceGraphique">FenetreConfiguration</a></dt> <dd> <div class="block">Permet de savoir si l'on a choisit d'avoir une fente a piece uniquement</div> </dd> <dt><span class="memberNameLink"><a href="../coeur/Controleur.html#fentePresente--">fentePresente()</a></span> - Method in class coeur.<a href="../coeur/Controleur.html" title="class in coeur">Controleur</a></dt> <dd> <div class="block">Permet de savoir si au moins une fente est presente sur le distributeur</div> </dd> <dt><span class="memberNameLink"><a href="../coeur/GraphiqueACoeur.html#fentePresente--">fentePresente()</a></span> - Method in interface coeur.<a href="../coeur/GraphiqueACoeur.html" title="interface in coeur">GraphiqueACoeur</a></dt> <dd> <div class="block">Communique si il y a au moins une fente presente sur le distributeur</div> </dd> <dt><span class="memberNameLink"><a href="../coeur/GraphiqueACoeurImpl.html#fentePresente--">fentePresente()</a></span> - Method in class coeur.<a href="../coeur/GraphiqueACoeurImpl.html" title="class in coeur">GraphiqueACoeurImpl</a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../stockage/CoeurAStockage.html#fentePresente--">fentePresente()</a></span> - Method in interface stockage.<a href="../stockage/CoeurAStockage.html" title="interface in stockage">CoeurAStockage</a></dt> <dd> <div class="block">Permet de savoir si au moins une fente est presente sur le distributeur</div> </dd> <dt><span class="memberNameLink"><a href="../stockage/CoeurAStockageImpl.html#fentePresente--">fentePresente()</a></span> - Method in class stockage.<a href="../stockage/CoeurAStockageImpl.html" title="class in stockage">CoeurAStockageImpl</a></dt> <dd>&nbsp;</dd> <dt><a href="../interfaceGraphique/FPass10Trajets.html" title="class in interfaceGraphique"><span class="typeNameLink">FPass10Trajets</span></a> - Class in <a href="../interfaceGraphique/package-summary.html">interfaceGraphique</a></dt> <dd> <div class="block">Classe FPass10Trajets</div> </dd> <dt><span class="memberNameLink"><a href="../interfaceGraphique/FPass10Trajets.html#FPass10Trajets-double-double-">FPass10Trajets(double, double)</a></span> - Constructor for class interfaceGraphique.<a href="../interfaceGraphique/FPass10Trajets.html" title="class in interfaceGraphique">FPass10Trajets</a></dt> <dd>&nbsp;</dd> </dl> <a href="index-1.html">A</a>&nbsp;<a href="index-2.html">B</a>&nbsp;<a href="index-3.html">C</a>&nbsp;<a href="index-4.html">D</a>&nbsp;<a href="index-5.html">E</a>&nbsp;<a href="index-6.html">F</a>&nbsp;<a href="index-7.html">G</a>&nbsp;<a href="index-8.html">I</a>&nbsp;<a href="index-9.html">L</a>&nbsp;<a href="index-10.html">M</a>&nbsp;<a href="index-11.html">P</a>&nbsp;<a href="index-12.html">R</a>&nbsp;<a href="index-13.html">S</a>&nbsp;<a href="index-14.html">T</a>&nbsp;<a href="index-15.html">V</a>&nbsp;</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>Package</li> <li>Class</li> <li>Use</li> <li><a href="../overview-tree.html">Tree</a></li> <li><a href="../deprecated-list.html">Deprecated</a></li> <li class="navBarCell1Rev">Index</li> <li><a href="../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="index-5.html">Prev Letter</a></li> <li><a href="index-7.html">Next Letter</a></li> </ul> <ul class="navList"> <li><a href="../index.html?index-files/index-6.html" target="_top">Frames</a></li> <li><a href="index-6.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
AllanDubrulle/distributeur_tickets
Implementation/ML-TheoDaix,AllanDubrulle,VictorVerhoye-implementation/Documentation/Javadoc/index-files/index-6.html
HTML
mit
7,569
[ 30522, 1026, 999, 9986, 13874, 16129, 2270, 1000, 1011, 1013, 1013, 1059, 2509, 2278, 1013, 1013, 26718, 2094, 16129, 1018, 1012, 5890, 17459, 1013, 1013, 4372, 1000, 1000, 8299, 1024, 1013, 1013, 7479, 1012, 1059, 2509, 1012, 8917, 1013, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
############################################################################# ## ## Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ## Contact: Qt Software Information (qt-info@nokia.com) ## ## This file is part of the Graphics Dojo project on Qt Labs. ## ## This file may be used under the terms of the GNU General Public ## License version 2.0 or 3.0 as published by the Free Software Foundation ## and appearing in the file LICENSE.GPL included in the packaging of ## this file. Please review the following information to ensure GNU ## General Public Licensing requirements will be met: ## http:#www.fsf.org/licensing/licenses/info/GPLv2.html and ## http:#www.gnu.org/copyleft/gpl.html. ## ## If you are unsure which license is appropriate for your use, please ## contact the sales department at qt-sales@nokia.com. ## ## This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ## WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ## ############################################################################# import sys from PyQt4.QtCore import * from PyQt4.QtGui import * from PyQt4.QtWebKit import * if QT_VERSION < 0x0040500: sys.stderr.write("You need Qt 4.5 or newer to run this example.\n") sys.exit(1) SNAP_THRESHOLD = 10 class SnapView(QWebView): def __init__(self): QWebView.__init__(self) self.snapEnabled = True self.setWindowTitle(self.tr("Snap-scrolling is ON")) # rects hit by the line, in main frame's view coordinate def hitBoundingRects(self, line): hitRects = [] points = 8 delta = QPoint(line.dx() / points, line.dy() / points) point = line.p1() i = 0 while i < points - 1: point += delta hit = self.page().mainFrame().hitTestContent(point) if not hit.boundingRect().isEmpty(): hitRects.append(hit.boundingRect()) i += 1 return hitRects def keyPressEvent(self, event): # toggle snapping if event.key() == Qt.Key_F3: self.snapEnabled = not self.snapEnabled if self.snapEnabled: self.setWindowTitle(self.tr("Snap-scrolling is ON")) else: self.setWindowTitle(self.tr("Snap-scrolling is OFF")) event.accept() return # no snapping? do not bother... if not self.snapEnabled: QWebView.keyReleaseEvent(self, event) return previousOffset = self.page().mainFrame().scrollPosition() QWebView.keyReleaseEvent(self, event) if not event.isAccepted(): return if event.key() == Qt.Key_Down: ofs = self.page().mainFrame().scrollPosition() jump = ofs.y() - previousOffset.y() if jump == 0: return jump += SNAP_THRESHOLD rects = self.hitBoundingRects(QLine(1, 1, self.width() - 1, 1)) i = 0 while i < len(rects): j = rects[i].top() - previousOffset.y() if j > SNAP_THRESHOLD and j < jump: jump = j i += 1 self.page().mainFrame().setScrollPosition(previousOffset + QPoint(0, jump)) if __name__ == "__main__": app = QApplication(sys.argv) view = SnapView() view.load(QUrl("http://news.bbc.co.uk/text_only.stm")) view.resize(320, 500) view.show() QMessageBox.information(view, "Hint", "Use F3 to toggle snapping on and off") sys.exit(app.exec_())
anak10thn/graphics-dojo-qt5
snapscroll/snapscroll.py
Python
gpl-2.0
3,660
[ 30522, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# Cordova Facebook Account Kit Plugin This plugin integrates the Facebook's Account Kit. For more info see [Account Kit](https://www.accountkit.com/) This is a WIP. Not recommended for production usage. ## Supported platforms * Android ## Plugin Installation * Clone this project * Add the plugin to your cordova project with the following command ``` cordova plugin add <PATH_TO>/cordova-plugin-fb-accountkit --variable FB_APP_NAME=<APP_NAME> --variable FB_APP_ID=<APP_ID> --variable FB_CLIENT_TOKEN=<CLIENT_TOKEN> ``` ## API #### loginWithPhone ``` fbAccountKit.loginWithPhone(success, failure, {"type" : "CODE"}); // currently only 'CODE' is supported ``` Response: ``` { status : "SUCCESS", authorizationCode : "<auth-code-string>", finalAuthorizationState : "", tokenRefreshIntervalInSeconds : 120 } ``` #### logout ``` fbAccountKit.logout(success, failure); ``` Response: * 'success' callback gets called
prakashvadrevu/cordova-plugin-fb-accountkit
README.md
Markdown
mit
939
[ 30522, 1001, 11601, 7103, 9130, 4070, 8934, 13354, 2378, 2023, 13354, 2378, 17409, 2015, 1996, 9130, 1005, 1055, 4070, 8934, 1012, 2005, 2062, 18558, 2156, 1031, 4070, 8934, 1033, 1006, 16770, 1024, 1013, 1013, 7479, 1012, 4070, 23615, 1012...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
\documentclass{article} \begin{filecontents}{mybib.bib} \begin{document} here is some text more text here \end{document} \end{filecontents} \begin{filecontents}{another.bib} \begin{document} some more text more text here \end{document} \end{filecontents} \begin{document} \begin{myotherenvironment} some text goes here some text goes here some text goes here some text goes here \end{myotherenvironment} \end{document}
cmhughes/latexindent.pl
test-cases/filecontents/filecontents1.tex
TeX
gpl-3.0
454
[ 30522, 1032, 6254, 26266, 1063, 3720, 1065, 1032, 4088, 1063, 5371, 8663, 6528, 3215, 1065, 1063, 2026, 28065, 1012, 12170, 2497, 1065, 1032, 4088, 1063, 6254, 1065, 2182, 2003, 2070, 3793, 2062, 3793, 2182, 1032, 2203, 1063, 6254, 1065, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
--- layout: post title: 每天500字:如何取舍 categories: 500字 description: 最近一直在纠结买房子的事情,从二手看到一手房,信息扑朔迷离,着实让人难以取舍。 keywords: 500字 --- APR 10 2017 08:29 广州 从真正下了决心准备开始买房子开始,东奔西跑大概有二十多天的时间,其中真是百味杂陈,苦不堪言。因为老人和妻子都非常看重配套,希望能住的方便一些,离成熟的社区近一些。 加上还要考虑学位户型大小价格,因此开始的时候是从找二手房开始的,安装家人的想法,二手房价格便宜,地段相对成熟,生活配套完善,对应的学区也比较优越,对我们这种刚需住房的购买者来说,确实是第一选择。 但几个星期跑下来,发现了很多问题的确是让人不吐不快。第一、就是价格的问题,三月中下旬,广州和佛山相继对一手房进行了限购,限制了一手房的认购资格,造成很多人炒房者无法进入,但佛山二手房却没有限购,这个带来的后果就是,二手房的价格在短短一个星期左右的时间,普遍涨幅达20%左右。这一上涨,造成本来二手的价格优势荡然无存,这一圈跑下来,我们发现,在某些位置学位比较好的二手楼盘,其售价已经远远超过了一手的楼盘,价格已经不存在优势。 第二是卖方的诚信问题,因为二手房的卖家市场,这些卖家很多都是一些个人,甚至有些人就是炒房者。这种情况下,卖家把房源放出来,其真实的用意其实很难揣摩,根据我们的实际经验来看,很多放房源,其实就是一种价格试探,一旦买家表现出购买欲望,这种卖家不是避而不见就是提高价格,让交易难度很大,买家的购买欲望越强,卖家反而会不断的加码,这种情况我们遇到很多次。 第三是房源的问题,因为是二手房,房源的情况和来源都很不稳定,要不然不是是合适的大小,要不然就不是合适的位置,有时候是买家希望是毛坯,而卖家提供的是一个你完全不喜欢的装修风格,倒霉的是,如果你像交易,这个你不喜欢的装修,你可能还要为之付出不小的代价。 上面的三条是比较主要的三个原因,这三个原因造成在看房的过程中困难重重,不是浪费自己大量的精力在无畏的奔波中,就是你心仪的房子卖家根本就没有打算出售。 如何取舍,这的确是个问题。 APR 10 2017 09:11 广州 ---- 公众号:你想看的World(Youw2s) ![][image-1] [image-1]: http://upload-images.jianshu.io/upload_images/3342594-dca1f89eba3e50ca.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240
Derek-Wang2016/Derek-Wang2016.github.io
_posts/2017-04-09-每天500字:如何取舍.md
Markdown
mit
2,810
[ 30522, 1011, 30524, 100, 7236, 1024, 3156, 100, 6412, 1024, 100, 100, 1740, 100, 100, 100, 100, 100, 100, 1816, 1916, 1751, 100, 1989, 100, 1752, 1858, 100, 100, 1740, 1858, 100, 1989, 1767, 100, 100, 100, 100, 100, 1989, 100, 100, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.6"/> <title>DMA Friends: DMA\Friends\Updates\CreateStepsTable Class Reference</title> <link href="../../tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="../../jquery.js"></script> <script type="text/javascript" src="../../dynsections.js"></script> <link href="../../search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="../../search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> <link href="../../doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">DMA Friends &#160;<span id="projectnumber">2.0</span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.6 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "../../search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="../../index.html"><span>Main&#160;Page</span></a></li> <li><a href="../../pages.html"><span>Related&#160;Pages</span></a></li> <li class="current"><a href="../../annotated.html"><span>Classes</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="../../search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="../../search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="../../annotated.html"><span>Class&#160;List</span></a></li> <li><a href="../../classes.html"><span>Class&#160;Index</span></a></li> <li><a href="../../hierarchy.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="../../functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Pages</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><b>DMA</b></li><li class="navelem"><b>Friends</b></li><li class="navelem"><b>Updates</b></li><li class="navelem"><a class="el" href="../../df/d50/classDMA_1_1Friends_1_1Updates_1_1CreateStepsTable.html">CreateStepsTable</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> &#124; <a href="../../db/d75/classDMA_1_1Friends_1_1Updates_1_1CreateStepsTable-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">DMA\Friends\Updates\CreateStepsTable Class Reference</div> </div> </div><!--header--> <div class="contents"> <div class="dynheader"> Inheritance diagram for DMA\Friends\Updates\CreateStepsTable:</div> <div class="dyncontent"> <div class="center"> <img src="../../df/d50/classDMA_1_1Friends_1_1Updates_1_1CreateStepsTable.png" usemap="#DMA\Friends\Updates\CreateStepsTable_map" alt=""/> <map id="DMA\Friends\Updates\CreateStepsTable_map" name="DMA\Friends\Updates\CreateStepsTable_map"> </map> </div></div> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:acdf2a72d46d5dd755d0c642c31ba834c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="acdf2a72d46d5dd755d0c642c31ba834c"></a> &#160;</td><td class="memItemRight" valign="bottom"><b>up</b> ()</td></tr> <tr class="separator:acdf2a72d46d5dd755d0c642c31ba834c"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a8dbe3cc73698589aa2349c3e5392317f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8dbe3cc73698589aa2349c3e5392317f"></a> &#160;</td><td class="memItemRight" valign="bottom"><b>down</b> ()</td></tr> <tr class="separator:a8dbe3cc73698589aa2349c3e5392317f"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <hr/>The documentation for this class was generated from the following file:<ul> <li>updates/create_steps_table.php</li> </ul> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Fri Sep 26 2014 13:52:03 for DMA Friends by &#160;<a href="http://www.doxygen.org/index.html"> <img class="footer" src="../../doxygen.png" alt="doxygen"/> </a> 1.8.6 </small></address> </body> </html>
DenverArtMuseum/OctoberFriends
docs/html/df/d50/classDMA_1_1Friends_1_1Updates_1_1CreateStepsTable.html
HTML
apache-2.0
6,574
[ 30522, 1026, 999, 9986, 13874, 16129, 2270, 1000, 1011, 1013, 1013, 1059, 2509, 2278, 1013, 1013, 26718, 2094, 1060, 11039, 19968, 1015, 1012, 1014, 17459, 1013, 1013, 4372, 1000, 1000, 8299, 1024, 1013, 1013, 7479, 1012, 1059, 2509, 1012, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.9.1"/> <title>V8 API Reference Guide for node.js v0.6.18 - v0.6.21: Member List</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { init_search(); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">V8 API Reference Guide for node.js v0.6.18 - v0.6.21 </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.9.1 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li><a href="examples.html"><span>Examples</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="namespacev8.html">v8</a></li><li class="navelem"><a class="el" href="classv8_1_1_boolean_object.html">BooleanObject</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="headertitle"> <div class="title">v8::BooleanObject Member List</div> </div> </div><!--header--> <div class="contents"> <p>This is the complete list of members for <a class="el" href="classv8_1_1_boolean_object.html">v8::BooleanObject</a>, including all inherited members.</p> <table class="directory"> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_boolean_object.html#acd3e4192c2206d9f7f61975fc8f08728">BooleanValue</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_boolean_object.html">v8::BooleanObject</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_object.html#a156c6b33082be397626ce106369e4eba">CallAsConstructor</a>(int argc, Handle&lt; Value &gt; argv[])</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#ab6b6c44668d7a0d0b5b1056f8de4fd6b">CallAsFunction</a>(Handle&lt; Object &gt; recv, int argc, Handle&lt; Value &gt; argv[])</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>Cast</b>(v8::Value *obj) (defined in <a class="el" href="classv8_1_1_boolean_object.html">v8::BooleanObject</a>)</td><td class="entry"><a class="el" href="classv8_1_1_boolean_object.html">v8::BooleanObject</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#a45a67c1b0408922403048b59a5bc22b2">Clone</a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_object.html#a509f00335e1e0ddfc4bcf93d9e1cb567">CreationContext</a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Delete</b>(Handle&lt; String &gt; key) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>Delete</b>(uint32_t index) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>DeleteHiddenValue</b>(Handle&lt; String &gt; key) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#a643fcf5c7c6136d819b0b4927f8d1724">Equals</a>(Handle&lt; Value &gt; that) const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#aa3b8aaece354c6af98b98e0ae9abe13d">FindInstanceInPrototypeChain</a>(Handle&lt; FunctionTemplate &gt; tmpl)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>ForceDelete</b>(Handle&lt; Value &gt; key) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ForceSet</b>(Handle&lt; Value &gt; key, Handle&lt; Value &gt; value, PropertyAttribute attribs=None) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>Get</b>(Handle&lt; Value &gt; key) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Get</b>(uint32_t index) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_object.html#a4851a914d3d95b5eb7238c664fb7fd16">GetConstructorName</a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>GetHiddenValue</b>(Handle&lt; String &gt; key) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_object.html#a5309f7a349feb906a05ee45b6feeaab1">GetIdentityHash</a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>GetIndexedPropertiesExternalArrayData</b>() (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>GetIndexedPropertiesExternalArrayDataLength</b>() (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>GetIndexedPropertiesExternalArrayDataType</b>() (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>GetIndexedPropertiesPixelData</b>() (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>GetIndexedPropertiesPixelDataLength</b>() (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_object.html#aa3324fdf652d8ac3b2f27faa0559231d">GetInternalField</a>(int index)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#ab407b4e8dc83c3a75197f809d1465f7e">GetOwnPropertyNames</a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_object.html#a8ef1f3e0d4f4cecc54d5e0248bc45694">GetPointerFromInternalField</a>(int index)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#a1e0346ba95c50258a2b4dbd3dc5a6221">GetPropertyAttributes</a>(Handle&lt; Value &gt; key)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_object.html#a0e28660353b6da64f9e2769260f31001">GetPropertyNames</a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#a171fc92c6e695d9c944f9e5d7670ed11">GetPrototype</a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_object.html#a353c1568c4de35ef3f3065b5a4aecc50">GetRealNamedProperty</a>(Handle&lt; String &gt; key)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#ab955e6c94dc6bf3e65e5355eb3d2d876">GetRealNamedPropertyInPrototypeChain</a>(Handle&lt; String &gt; key)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>Has</b>(Handle&lt; String &gt; key) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Has</b>(uint32_t index) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_object.html#afd36ea440a254335bde065a4ceafffb3">HasIndexedLookupInterceptor</a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>HasIndexedPropertiesInExternalArrayData</b>() (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>HasIndexedPropertiesInPixelData</b>() (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#ad0791109068a7816d65a06bbc9f6f870">HasNamedLookupInterceptor</a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>HasOwnProperty</b>(Handle&lt; String &gt; key) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>HasRealIndexedProperty</b>(uint32_t index) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>HasRealNamedCallbackProperty</b>(Handle&lt; String &gt; key) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>HasRealNamedProperty</b>(Handle&lt; String &gt; key) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>Int32Value</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>IntegerValue</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_object.html#affaee480d3f50d5ac7a640db5aa8e89d">InternalFieldCount</a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#a95c39ad189c09630dd90ee5c1a7e89a1">IsArray</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#a6baff625780eac51413f2392250e81be">IsBoolean</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#aebb6cd7cbb34771df1973aef2e544931">IsBooleanObject</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_object.html#a73e7f8c470da4fa3ccc2ce8d58671bed">IsCallable</a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#abcdd87539238a68f8337bae7d0a9c1ac">IsDate</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_object.html#a76d0c5021dd74a57239ad64d1cb1c83c">IsDirty</a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#a7aed90ede9bf48b10f18cdb97d50fd1e">IsExternal</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#a265c208159ff3163ecda1e9f71b99115">IsFalse</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#a33f329c93a9f417e2d05b438e6e5429c">IsFunction</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#a70d4afaccc7903e6a01f40a46ad04188">IsInt32</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#a11293ed56e068b3bccdae482f2752f58">IsNativeError</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#a0757712320a9bcfe5fc0a099524d986f">IsNull</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#a32003b217768f535a4728bbd16ebd7d5">IsNumber</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#a2b4dd15e4135823a4bb1128a60c063cf">IsNumberObject</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#a360f1fe4a8ee74382f571a12eb14a222">IsObject</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#a36ba10231b5aaf6c63d8589cd53c9a73">IsRegExp</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#ab23a34b7df62806808e01b0908bf5f00">IsString</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#a2ded13f1962fc1fa15eabc525fb433ee">IsStringObject</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#ae93277798682f4be9adc204a16c40591">IsTrue</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#a2674a47b2550eb456a7ecfaf09d2f97e">IsUint32</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#adeeae3576aecadc4176f94a415a70a90">IsUndefined</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>New</b>(bool value) (defined in <a class="el" href="classv8_1_1_boolean_object.html">v8::BooleanObject</a>)</td><td class="entry"><a class="el" href="classv8_1_1_boolean_object.html">v8::BooleanObject</a></td><td class="entry"><span class="mlabel">static</span></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>New</b>() (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"><span class="mlabel">static</span></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>NumberValue</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#a2dc22d2a2acf9eab4ed2965149e48af9">ObjectProtoToString</a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>Set</b>(Handle&lt; Value &gt; key, Handle&lt; Value &gt; value, PropertyAttribute attribs=None) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Set</b>(uint32_t index, Handle&lt; Value &gt; value) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>SetAccessor</b>(Handle&lt; String &gt; name, AccessorGetter getter, AccessorSetter setter=0, Handle&lt; Value &gt; data=Handle&lt; Value &gt;(), AccessControl settings=DEFAULT, PropertyAttribute attribute=None) (defined in <a class="el" href="classv8_1_1_object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#a0040e3012d621b25f580407bacebf95f">SetHiddenValue</a>(Handle&lt; String &gt; key, Handle&lt; Value &gt; value)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_object.html#a53be627cd653a5591038a4d81a908f64">SetIndexedPropertiesToExternalArrayData</a>(void *data, ExternalArrayType array_type, int number_of_elements)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#a3f08aee708af5e2856e65e81b22edc61">SetIndexedPropertiesToPixelData</a>(uint8_t *data, int length)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_object.html#a94e24494687ea499471d41e914eeb90d">SetInternalField</a>(int index, Handle&lt; Value &gt; value)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#a5e79966b79d69ef3a7b3b0d91414ec2c">SetPointerInInternalField</a>(int index, void *value)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_object.html#a2a1ab58bf92984255f767946eeff1199">SetPrototype</a>(Handle&lt; Value &gt; prototype)</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>StrictEquals</b>(Handle&lt; Value &gt; that) const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#ab6b19a1e5aa5df50dfbb5d2ffa60bcdc">ToArrayIndex</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ToBoolean</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>ToDetailString</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ToInt32</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>ToInteger</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ToNumber</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>ToObject</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ToString</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>ToUint32</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_object.html#aa2299eda3240be1e76b7d5c2af7a6bbc">TurnOnAccessCheck</a>()</td><td class="entry"><a class="el" href="classv8_1_1_object.html">v8::Object</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>Uint32Value</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> </table></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Tue Aug 11 2015 23:47:40 for V8 API Reference Guide for node.js v0.6.18 - v0.6.21 by &#160;<a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.9.1 </small></address> </body> </html>
v8-dox/v8-dox.github.io
52f0c37/html/classv8_1_1_boolean_object-members.html
HTML
mit
28,940
[ 30522, 1026, 999, 9986, 13874, 30524, 1013, 7479, 1012, 1059, 2509, 1012, 8917, 1013, 19817, 1013, 1060, 11039, 19968, 2487, 1013, 26718, 2094, 1013, 1060, 11039, 19968, 2487, 1011, 17459, 1012, 26718, 2094, 1000, 1028, 1026, 16129, 20950, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package org.mskcc.shenkers.data.interval; import htsjdk.tribble.Feature; import htsjdk.tribble.annotation.Strand; import htsjdk.tribble.bed.FullBEDFeature; import java.awt.Color; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; /** * * @author sol */ public interface IntervalFeature<T> extends Feature { Strand getStrand(); T getValue(); }
shenkers/CrossBrowse
src/main/java/org/mskcc/shenkers/data/interval/IntervalFeature.java
Java
apache-2.0
585
[ 30522, 1013, 1008, 1008, 2000, 2689, 2023, 6105, 20346, 1010, 5454, 6105, 20346, 2015, 1999, 2622, 5144, 1012, 1008, 2000, 2689, 2023, 23561, 5371, 1010, 5454, 5906, 1064, 23561, 2015, 1008, 1998, 2330, 1996, 23561, 1999, 1996, 3559, 1012, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package me.lachlanap.dropunit.world /** * An action to perform on the world, an area, a block, or an entity. */ trait Transform { def applyTo(world: World): World = world } case class SpawnEntity(entity: (Id) => Entity) extends Transform { override def applyTo(world: World): World = { new World(world.config, world.blueprints, world.leftPlayer, world.rightPlayer, entity(world.entityIdGenerator.next()) :: world.entities) } } case class DestroyEntity(entity: Entity) extends Transform { override def applyTo(world: World): World = { new World(world.config, world.blueprints, world.leftPlayer, world.rightPlayer, world.entities.filterNot(_.id == entity.id)) } } case class DamageBlock(block: Block, amount: Double) extends Transform { override def applyTo(world: World): World = { new World(world.config, world.blueprints, world.leftPlayer.damage(block, amount), world.rightPlayer.damage(block, amount), world.entities) } }
thorinii/dropunit
src/main/scala/me/lachlanap/dropunit/world/Transform.scala
Scala
mit
1,040
[ 30522, 7427, 2033, 1012, 18749, 7317, 5162, 2361, 1012, 4530, 19496, 2102, 1012, 2088, 1013, 1008, 1008, 1008, 2019, 2895, 2000, 4685, 2006, 1996, 2088, 1010, 2019, 2181, 1010, 1037, 30524, 3012, 1006, 9178, 1024, 1006, 8909, 1007, 1027, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* Document : blue Created on : 06.01.2014, 22:49:39 Author : chilliscope Description: Purpose of the stylesheet follows. */ * { color:green; }
chillinhen/chilliscope2014
wp-content/themes/nettuts/green.css
CSS
gpl-2.0
182
[ 30522, 1013, 1008, 6254, 1024, 2630, 2580, 2006, 1024, 5757, 1012, 5890, 1012, 2297, 1010, 2570, 1024, 4749, 1024, 4464, 3166, 1024, 10720, 2483, 16186, 6412, 1024, 3800, 1997, 1996, 6782, 21030, 2102, 4076, 1012, 1008, 1013, 1008, 1063, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. /*XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XX XX BasicBlock XX XX XX XX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */ /*****************************************************************************/ #ifndef _BLOCK_H_ #define _BLOCK_H_ /*****************************************************************************/ #include "vartype.h" // For "var_types.h" #include "_typeinfo.h" /*****************************************************************************/ // Defines VARSET_TP #include "varset.h" #include "blockset.h" #include "jitstd.h" #include "bitvec.h" #include "simplerhash.h" /*****************************************************************************/ typedef BitVec EXPSET_TP; #if LARGE_EXPSET #define EXPSET_SZ 64 #else #define EXPSET_SZ 32 #endif typedef BitVec ASSERT_TP; typedef BitVec_ValArg_T ASSERT_VALARG_TP; typedef BitVec_ValRet_T ASSERT_VALRET_TP; /***************************************************************************** * * Each basic block ends with a jump which is described as a value * of the following enumeration. */ DECLARE_TYPED_ENUM(BBjumpKinds, BYTE) { BBJ_EHFINALLYRET, // block ends with 'endfinally' (for finally or fault) BBJ_EHFILTERRET, // block ends with 'endfilter' BBJ_EHCATCHRET, // block ends with a leave out of a catch (only #if FEATURE_EH_FUNCLETS) BBJ_THROW, // block ends with 'throw' BBJ_RETURN, // block ends with 'ret' BBJ_NONE, // block flows into the next one (no jump) BBJ_ALWAYS, // block always jumps to the target BBJ_LEAVE, // block always jumps to the target, maybe out of guarded // region. Used temporarily until importing BBJ_CALLFINALLY, // block always calls the target finally BBJ_COND, // block conditionally jumps to the target BBJ_SWITCH, // block ends with a switch statement BBJ_COUNT } END_DECLARE_TYPED_ENUM(BBjumpKinds, BYTE) struct GenTree; struct GenTreeStmt; struct BasicBlock; class Compiler; class typeInfo; struct BasicBlockList; struct flowList; struct EHblkDsc; #if FEATURE_STACK_FP_X87 struct FlatFPStateX87; #endif /***************************************************************************** * * The following describes a switch block. * * Things to know: * 1. If bbsHasDefault is true, the default case is the last one in the array of basic block addresses * namely bbsDstTab[bbsCount - 1]. * 2. bbsCount must be at least 1, for the default case. bbsCount cannot be zero. It appears that the ECMA spec * allows for a degenerate switch with zero cases. Normally, the optimizer will optimize degenerate * switches with just a default case to a BBJ_ALWAYS branch, and a switch with just two cases to a BBJ_COND. * However, in debuggable code, we might not do that, so bbsCount might be 1. */ struct BBswtDesc { unsigned bbsCount; // count of cases (includes 'default' if bbsHasDefault) BasicBlock** bbsDstTab; // case label table address bool bbsHasDefault; BBswtDesc() : bbsHasDefault(true) { } void removeDefault() { assert(bbsHasDefault); assert(bbsCount > 0); bbsHasDefault = false; bbsCount--; } BasicBlock* getDefault() { assert(bbsHasDefault); assert(bbsCount > 0); return bbsDstTab[bbsCount - 1]; } }; struct StackEntry { GenTree* val; typeInfo seTypeInfo; }; /*****************************************************************************/ enum ThisInitState { TIS_Bottom, // We don't know anything about the 'this' pointer. TIS_Uninit, // The 'this' pointer for this constructor is known to be uninitialized. TIS_Init, // The 'this' pointer for this constructor is known to be initialized. TIS_Top, // This results from merging the state of two blocks one with TIS_Unint and the other with TIS_Init. // We use this in fault blocks to prevent us from accessing the 'this' pointer, but otherwise // allowing the fault block to generate code. }; struct EntryState { ThisInitState thisInitialized : 8; // used to track whether the this ptr is initialized (we could use // fewer bits here) unsigned esStackDepth : 24; // size of esStack StackEntry* esStack; // ptr to stack }; // Enumeration of the kinds of memory whose state changes the compiler tracks enum MemoryKind { ByrefExposed = 0, // Includes anything byrefs can read/write (everything in GcHeap, address-taken locals, // unmanaged heap, callers' locals, etc.) GcHeap, // Includes actual GC heap, and also static fields MemoryKindCount, // Number of MemoryKinds }; #ifdef DEBUG const char* const memoryKindNames[] = {"ByrefExposed", "GcHeap"}; #endif // DEBUG // Bitmask describing a set of memory kinds (usable in bitfields) typedef unsigned int MemoryKindSet; // Bitmask for a MemoryKindSet containing just the specified MemoryKind inline MemoryKindSet memoryKindSet(MemoryKind memoryKind) { return (1U << memoryKind); } // Bitmask for a MemoryKindSet containing the specified MemoryKinds template <typename... MemoryKinds> inline MemoryKindSet memoryKindSet(MemoryKind memoryKind, MemoryKinds... memoryKinds) { return memoryKindSet(memoryKind) | memoryKindSet(memoryKinds...); } // Bitmask containing all the MemoryKinds const MemoryKindSet fullMemoryKindSet = (1 << MemoryKindCount) - 1; // Bitmask containing no MemoryKinds const MemoryKindSet emptyMemoryKindSet = 0; // Standard iterator class for iterating through MemoryKinds class MemoryKindIterator { int value; public: explicit inline MemoryKindIterator(int val) : value(val) { } inline MemoryKindIterator& operator++() { ++value; return *this; } inline MemoryKindIterator operator++(int) { return MemoryKindIterator(value++); } inline MemoryKind operator*() { return static_cast<MemoryKind>(value); } friend bool operator==(const MemoryKindIterator& left, const MemoryKindIterator& right) { return left.value == right.value; } friend bool operator!=(const MemoryKindIterator& left, const MemoryKindIterator& right) { return left.value != right.value; } }; // Empty struct that allows enumerating memory kinds via `for(MemoryKind kind : allMemoryKinds())` struct allMemoryKinds { inline allMemoryKinds() { } inline MemoryKindIterator begin() { return MemoryKindIterator(0); } inline MemoryKindIterator end() { return MemoryKindIterator(MemoryKindCount); } }; // This encapsulates the "exception handling" successors of a block. That is, // if a basic block BB1 occurs in a try block, we consider the first basic block // BB2 of the corresponding handler to be an "EH successor" of BB1. Because we // make the conservative assumption that control flow can jump from a try block // to its handler at any time, the immediate (regular control flow) // predecessor(s) of the the first block of a try block are also considered to // have the first block of the handler as an EH successor. This makes variables that // are "live-in" to the handler become "live-out" for these try-predecessor block, // so that they become live-in to the try -- which we require. class EHSuccessorIter { // The current compilation. Compiler* m_comp; // The block whose EH successors we are iterating over. BasicBlock* m_block; // The current "regular" successor of "m_block" that we're considering. BasicBlock* m_curRegSucc; // The current try block. If non-null, then the current successor "m_curRegSucc" // is the first block of the handler of this block. While this try block has // enclosing try's that also start with "m_curRegSucc", the corresponding handlers will be // further EH successors. EHblkDsc* m_curTry; // The number of "regular" (i.e., non-exceptional) successors that remain to // be considered. If BB1 has successor BB2, and BB2 is the first block of a // try block, then we consider the catch block of BB2's try to be an EH // successor of BB1. This captures the iteration over the successors of BB1 // for this purpose. (In reverse order; we're done when this field is 0). int m_remainingRegSuccs; // Requires that "m_curTry" is NULL. Determines whether there is, as // discussed just above, a regular successor that's the first block of a // try; if so, sets "m_curTry" to that try block. (As noted above, selecting // the try containing the current regular successor as the "current try" may cause // multiple first-blocks of catches to be yielded as EH successors: trys enclosing // the current try are also included if they also start with the current EH successor.) void FindNextRegSuccTry(); public: // Returns the standard "end" iterator. EHSuccessorIter() : m_comp(nullptr), m_block(nullptr), m_curRegSucc(nullptr), m_curTry(nullptr), m_remainingRegSuccs(0) { } // Initializes the iterator to represent the EH successors of "block". EHSuccessorIter(Compiler* comp, BasicBlock* block); // Go on to the next EH successor. void operator++(void); // Requires that "this" is not equal to the standard "end" iterator. Returns the // current EH successor. BasicBlock* operator*(); // Returns "true" iff "*this" is equal to "ehsi" -- ignoring the "m_comp" // and "m_block" fields. bool operator==(const EHSuccessorIter& ehsi) { // Ignore the compiler; we'll assume that's the same. return m_curTry == ehsi.m_curTry && m_remainingRegSuccs == ehsi.m_remainingRegSuccs; } bool operator!=(const EHSuccessorIter& ehsi) { return !((*this) == ehsi); } }; // Yields both normal and EH successors (in that order) in one iteration. class AllSuccessorIter { // Normal succ state. Compiler* m_comp; BasicBlock* m_blk; unsigned m_normSucc; unsigned m_numNormSuccs; EHSuccessorIter m_ehIter; // True iff m_blk is a BBJ_CALLFINALLY block, and the current try block of m_ehIter, // the first block of whose handler would be next yielded, is the jump target of m_blk. inline bool CurTryIsBlkCallFinallyTarget(); public: inline AllSuccessorIter() { } // Initializes "this" to iterate over all successors of "block." inline AllSuccessorIter(Compiler* comp, BasicBlock* block); // Used for constructing an appropriate "end" iter. Should be called with // the number of normal successors of the block being iterated. AllSuccessorIter(unsigned numSuccs) : m_normSucc(numSuccs), m_numNormSuccs(numSuccs), m_ehIter() { } // Go on to the next successor. inline void operator++(void); // Requires that "this" is not equal to the standard "end" iterator. Returns the // current successor. inline BasicBlock* operator*(); // Returns "true" iff "*this" is equal to "asi" -- ignoring the "m_comp" // and "m_block" fields. bool operator==(const AllSuccessorIter& asi) { return m_normSucc == asi.m_normSucc && m_ehIter == asi.m_ehIter; } bool operator!=(const AllSuccessorIter& asi) { return !((*this) == asi); } }; //------------------------------------------------------------------------ // BasicBlock: describes a basic block in the flowgraph. // // Note that this type derives from LIR::Range in order to make the LIR // utilities that are polymorphic over basic block and scratch ranges // faster and simpler. // struct BasicBlock : private LIR::Range { friend class LIR; BasicBlock* bbNext; // next BB in ascending PC offset order BasicBlock* bbPrev; void setNext(BasicBlock* next) { bbNext = next; if (next) { next->bbPrev = this; } } unsigned __int64 bbFlags; // see BBF_xxxx below unsigned bbNum; // the block's number unsigned bbPostOrderNum; // the block's post order number in the graph. unsigned bbRefs; // number of blocks that can reach here, either by fall-through or a branch. If this falls to zero, // the block is unreachable. #define BBF_VISITED 0x00000001 // BB visited during optimizations #define BBF_MARKED 0x00000002 // BB marked during optimizations #define BBF_CHANGED 0x00000004 // input/output of this block has changed #define BBF_REMOVED 0x00000008 // BB has been removed from bb-list #define BBF_DONT_REMOVE 0x00000010 // BB should not be removed during flow graph optimizations #define BBF_IMPORTED 0x00000020 // BB byte-code has been imported #define BBF_INTERNAL 0x00000040 // BB has been added by the compiler #define BBF_FAILED_VERIFICATION 0x00000080 // BB has verification exception #define BBF_TRY_BEG 0x00000100 // BB starts a 'try' block #define BBF_FUNCLET_BEG 0x00000200 // BB is the beginning of a funclet #define BBF_HAS_NULLCHECK 0x00000400 // BB contains a null check #define BBF_NEEDS_GCPOLL 0x00000800 // This BB is the source of a back edge and needs a GC Poll #define BBF_RUN_RARELY 0x00001000 // BB is rarely run (catch clauses, blocks with throws etc) #define BBF_LOOP_HEAD 0x00002000 // BB is the head of a loop #define BBF_LOOP_CALL0 0x00004000 // BB starts a loop that sometimes won't call #define BBF_LOOP_CALL1 0x00008000 // BB starts a loop that will always call #define BBF_HAS_LABEL 0x00010000 // BB needs a label #define BBF_JMP_TARGET 0x00020000 // BB is a target of an implicit/explicit jump #define BBF_HAS_JMP 0x00040000 // BB executes a JMP instruction (instead of return) #define BBF_GC_SAFE_POINT 0x00080000 // BB has a GC safe point (a call). More abstractly, BB does not // require a (further) poll -- this may be because this BB has a // call, or, in some cases, because the BB occurs in a loop, and // we've determined that all paths in the loop body leading to BB // include a call. #define BBF_HAS_VTABREF 0x00100000 // BB contains reference of vtable #define BBF_HAS_IDX_LEN 0x00200000 // BB contains simple index or length expressions on an array local var. #define BBF_HAS_NEWARRAY 0x00400000 // BB contains 'new' of an array #define BBF_HAS_NEWOBJ 0x00800000 // BB contains 'new' of an object type. #if FEATURE_EH_FUNCLETS && defined(_TARGET_ARM_) #define BBF_FINALLY_TARGET 0x01000000 // BB is the target of a finally return: where a finally will return during // non-exceptional flow. Because the ARM calling sequence for calling a // finally explicitly sets the return address to the finally target and jumps // to the finally, instead of using a call instruction, ARM needs this to // generate correct code at the finally target, to allow for proper stack // unwind from within a non-exceptional call to a finally. #endif // FEATURE_EH_FUNCLETS && defined(_TARGET_ARM_) #define BBF_BACKWARD_JUMP 0x02000000 // BB is surrounded by a backward jump/switch arc #define BBF_RETLESS_CALL 0x04000000 // BBJ_CALLFINALLY that will never return (and therefore, won't need a paired // BBJ_ALWAYS); see isBBCallAlwaysPair(). #define BBF_LOOP_PREHEADER 0x08000000 // BB is a loop preheader block #define BBF_COLD 0x10000000 // BB is cold #define BBF_PROF_WEIGHT 0x20000000 // BB weight is computed from profile data #ifdef LEGACY_BACKEND #define BBF_FORWARD_SWITCH 0x40000000 // Aux flag used in FP codegen to know if a jmptable entry has been forwarded #else // !LEGACY_BACKEND #define BBF_IS_LIR 0x40000000 // Set if the basic block contains LIR (as opposed to HIR) #endif // LEGACY_BACKEND #define BBF_KEEP_BBJ_ALWAYS 0x80000000 // A special BBJ_ALWAYS block, used by EH code generation. Keep the jump kind // as BBJ_ALWAYS. Used for the paired BBJ_ALWAYS block following the // BBJ_CALLFINALLY block, as well as, on x86, the final step block out of a // finally. #define BBF_CLONED_FINALLY_BEGIN 0x100000000 // First block of a cloned finally region #define BBF_CLONED_FINALLY_END 0x200000000 // Last block of a cloned finally region // Flags that relate blocks to loop structure. #define BBF_LOOP_FLAGS (BBF_LOOP_PREHEADER | BBF_LOOP_HEAD | BBF_LOOP_CALL0 | BBF_LOOP_CALL1) bool isRunRarely() const { return ((bbFlags & BBF_RUN_RARELY) != 0); } bool isLoopHead() const { return ((bbFlags & BBF_LOOP_HEAD) != 0); } // Flags to update when two blocks are compacted #define BBF_COMPACT_UPD \ (BBF_CHANGED | BBF_GC_SAFE_POINT | BBF_HAS_JMP | BBF_NEEDS_GCPOLL | BBF_HAS_IDX_LEN | BBF_BACKWARD_JUMP | \ BBF_HAS_NEWARRAY | BBF_HAS_NEWOBJ) // Flags a block should not have had before it is split. #ifdef LEGACY_BACKEND #define BBF_SPLIT_NONEXIST \ (BBF_CHANGED | BBF_LOOP_HEAD | BBF_LOOP_CALL0 | BBF_LOOP_CALL1 | BBF_RETLESS_CALL | BBF_LOOP_PREHEADER | \ BBF_COLD | BBF_FORWARD_SWITCH) #else // !LEGACY_BACKEND #define BBF_SPLIT_NONEXIST \ (BBF_CHANGED | BBF_LOOP_HEAD | BBF_LOOP_CALL0 | BBF_LOOP_CALL1 | BBF_RETLESS_CALL | BBF_LOOP_PREHEADER | BBF_COLD) #endif // LEGACY_BACKEND // Flags lost by the top block when a block is split. // Note, this is a conservative guess. // For example, the top block might or might not have BBF_GC_SAFE_POINT, // but we assume it does not have BBF_GC_SAFE_POINT any more. #define BBF_SPLIT_LOST (BBF_GC_SAFE_POINT | BBF_HAS_JMP | BBF_KEEP_BBJ_ALWAYS | BBF_CLONED_FINALLY_END) // Flags gained by the bottom block when a block is split. // Note, this is a conservative guess. // For example, the bottom block might or might not have BBF_HAS_NEWARRAY, // but we assume it has BBF_HAS_NEWARRAY. // TODO: Should BBF_RUN_RARELY be added to BBF_SPLIT_GAINED ? #define BBF_SPLIT_GAINED \ (BBF_DONT_REMOVE | BBF_HAS_LABEL | BBF_HAS_JMP | BBF_BACKWARD_JUMP | BBF_HAS_IDX_LEN | BBF_HAS_NEWARRAY | \ BBF_PROF_WEIGHT | BBF_HAS_NEWOBJ | BBF_KEEP_BBJ_ALWAYS | BBF_CLONED_FINALLY_END) #ifndef __GNUC__ // GCC doesn't like C_ASSERT at global scope static_assert_no_msg((BBF_SPLIT_NONEXIST & BBF_SPLIT_LOST) == 0); static_assert_no_msg((BBF_SPLIT_NONEXIST & BBF_SPLIT_GAINED) == 0); #endif #ifdef DEBUG void dspFlags(); // Print the flags unsigned dspCheapPreds(); // Print the predecessors (bbCheapPreds) unsigned dspPreds(); // Print the predecessors (bbPreds) unsigned dspSuccs(Compiler* compiler); // Print the successors. The 'compiler' argument determines whether EH // regions are printed: see NumSucc() for details. void dspJumpKind(); // Print the block jump kind (e.g., BBJ_NONE, BBJ_COND, etc.). void dspBlockHeader(Compiler* compiler, bool showKind = true, bool showFlags = false, bool showPreds = true); // Print a simple basic block header for various output, including a // list of predecessors and successors. #endif // DEBUG typedef unsigned weight_t; // Type used to hold block and edge weights // Note that for CLR v2.0 and earlier our // block weights were stored using unsigned shorts #define BB_UNITY_WEIGHT 100 // how much a normal execute once block weights #define BB_LOOP_WEIGHT 8 // how much more loops are weighted #define BB_ZERO_WEIGHT 0 #define BB_MAX_WEIGHT ULONG_MAX // we're using an 'unsigned' for the weight #define BB_VERY_HOT_WEIGHT 256 // how many average hits a BB has (per BBT scenario run) for this block // to be considered as very hot weight_t bbWeight; // The dynamic execution weight of this block // getBBWeight -- get the normalized weight of this block unsigned getBBWeight(Compiler* comp); // setBBWeight -- if the block weight is not derived from a profile, then set the weight to the input // weight, but make sure to not overflow BB_MAX_WEIGHT void setBBWeight(unsigned weight) { if (!(this->bbFlags & BBF_PROF_WEIGHT)) { this->bbWeight = min(weight, BB_MAX_WEIGHT); } } // modifyBBWeight -- same as setBBWeight, but also make sure that if the block is rarely run, it stays that // way, and if it's not rarely run then its weight never drops below 1. void modifyBBWeight(unsigned weight) { if (this->bbWeight != BB_ZERO_WEIGHT) { setBBWeight(max(weight, 1)); } } // setBBProfileWeight -- Set the profile-derived weight for a basic block void setBBProfileWeight(unsigned weight) { this->bbFlags |= BBF_PROF_WEIGHT; // Check if the multiplication by BB_UNITY_WEIGHT will overflow. this->bbWeight = (weight <= BB_MAX_WEIGHT / BB_UNITY_WEIGHT) ? weight * BB_UNITY_WEIGHT : BB_MAX_WEIGHT; } // this block will inherit the same weight and relevant bbFlags as bSrc void inheritWeight(BasicBlock* bSrc) { this->bbWeight = bSrc->bbWeight; if (bSrc->bbFlags & BBF_PROF_WEIGHT) { this->bbFlags |= BBF_PROF_WEIGHT; } else { this->bbFlags &= ~BBF_PROF_WEIGHT; } if (this->bbWeight == 0) { this->bbFlags |= BBF_RUN_RARELY; } else { this->bbFlags &= ~BBF_RUN_RARELY; } } // Similar to inheritWeight(), but we're splitting a block (such as creating blocks for qmark removal). // So, specify a percentage (0 to 99; if it's 100, just use inheritWeight()) of the weight that we're // going to inherit. Since the number isn't exact, clear the BBF_PROF_WEIGHT flag. void inheritWeightPercentage(BasicBlock* bSrc, unsigned percentage) { assert(0 <= percentage && percentage < 100); // Check for overflow if (bSrc->bbWeight * 100 <= bSrc->bbWeight) { this->bbWeight = bSrc->bbWeight; } else { this->bbWeight = bSrc->bbWeight * percentage / 100; } this->bbFlags &= ~BBF_PROF_WEIGHT; if (this->bbWeight == 0) { this->bbFlags |= BBF_RUN_RARELY; } else { this->bbFlags &= ~BBF_RUN_RARELY; } } // makeBlockHot() // This is used to override any profiling data // and force a block to be in the hot region. // We only call this method for handler entry point // and only when HANDLER_ENTRY_MUST_BE_IN_HOT_SECTION is 1. // Doing this helps fgReorderBlocks() by telling // it to try to move these blocks into the hot region. // Note that we do this strictly as an optimization, // not for correctness. fgDetermineFirstColdBlock() // will find all handler entry points and ensure that // for now we don't place them in the cold section. // void makeBlockHot() { if (this->bbWeight == BB_ZERO_WEIGHT) { this->bbFlags &= ~BBF_RUN_RARELY; // Clear any RarelyRun flag this->bbFlags &= ~BBF_PROF_WEIGHT; // Clear any profile-derived flag this->bbWeight = 1; } } bool isMaxBBWeight() { return (bbWeight == BB_MAX_WEIGHT); } // Returns "true" if the block is empty. Empty here means there are no statement // trees *except* PHI definitions. bool isEmpty(); // Returns "true" iff "this" is the first block of a BBJ_CALLFINALLY/BBJ_ALWAYS pair -- // a block corresponding to an exit from the try of a try/finally. In the flow graph, // this becomes a block that calls the finally, and a second, immediately // following empty block (in the bbNext chain) to which the finally will return, and which // branches unconditionally to the next block to be executed outside the try/finally. // Note that code is often generated differently than this description. For example, on ARM, // the target of the BBJ_ALWAYS is loaded in LR (the return register), and a direct jump is // made to the 'finally'. The effect is that the 'finally' returns directly to the target of // the BBJ_ALWAYS. A "retless" BBJ_CALLFINALLY is one that has no corresponding BBJ_ALWAYS. // This can happen if the finally is known to not return (e.g., it contains a 'throw'). In // that case, the BBJ_CALLFINALLY flags has BBF_RETLESS_CALL set. Note that ARM never has // "retless" BBJ_CALLFINALLY blocks due to a requirement to use the BBJ_ALWAYS for // generating code. bool isBBCallAlwaysPair() { #if FEATURE_EH_FUNCLETS && defined(_TARGET_ARM_) if (this->bbJumpKind == BBJ_CALLFINALLY) #else if ((this->bbJumpKind == BBJ_CALLFINALLY) && !(this->bbFlags & BBF_RETLESS_CALL)) #endif { #if FEATURE_EH_FUNCLETS && defined(_TARGET_ARM_) // On ARM, there are no retless BBJ_CALLFINALLY. assert(!(this->bbFlags & BBF_RETLESS_CALL)); #endif // Some asserts that the next block is a BBJ_ALWAYS of the proper form. assert(this->bbNext != nullptr); assert(this->bbNext->bbJumpKind == BBJ_ALWAYS); assert(this->bbNext->bbFlags & BBF_KEEP_BBJ_ALWAYS); assert(this->bbNext->isEmpty()); return true; } else { return false; } } BBjumpKinds bbJumpKind; // jump (if any) at the end of this block /* The following union describes the jump target(s) of this block */ union { unsigned bbJumpOffs; // PC offset (temporary only) BasicBlock* bbJumpDest; // basic block BBswtDesc* bbJumpSwt; // switch descriptor }; // NumSucc() gives the number of successors, and GetSucc() allows one to iterate over them. // // The behavior of both for blocks that end in BBJ_EHFINALLYRET (a return from a finally or fault block) // depends on whether "comp" is non-null. If it is null, then the block is considered to have no // successor. If it is non-null, we figure out the actual successors. Some cases will want one behavior, // other cases the other. For example, IL verification requires that these blocks end in an empty operand // stack, and since the dataflow analysis of IL verification is concerned only with the contents of the // operand stack, we can consider the finally block to have no successors. But a more general dataflow // analysis that is tracking the contents of local variables might want to consider *all* successors, // and would pass the current Compiler object. // // Similarly, BBJ_EHFILTERRET blocks are assumed to have no successors if "comp" is null; if non-null, // NumSucc/GetSucc yields the first block of the try blocks handler. // // Also, the behavior for switches changes depending on the value of "comp". If it is null, then all // switch successors are returned. If it is non-null, then only unique switch successors are returned; // the duplicate successors are omitted. // // Note that for BBJ_COND, which has two successors (fall through and condition true branch target), // only the unique targets are returned. Thus, if both targets are the same, NumSucc() will only return 1 // instead of 2. // // Returns the number of successors of "this". unsigned NumSucc(Compiler* comp = nullptr); // Returns the "i"th successor. Requires (0 <= i < NumSucc()). BasicBlock* GetSucc(unsigned i, Compiler* comp = nullptr); BasicBlock* GetUniquePred(Compiler* comp); BasicBlock* GetUniqueSucc(); unsigned countOfInEdges() const { return bbRefs; } __declspec(property(get = getBBTreeList, put = setBBTreeList)) GenTree* bbTreeList; // the body of the block. GenTree* getBBTreeList() const { return m_firstNode; } void setBBTreeList(GenTree* tree) { m_firstNode = tree; } EntryState* bbEntryState; // verifier tracked state of all entries in stack. #define NO_BASE_TMP UINT_MAX // base# to use when we have none unsigned bbStkTempsIn; // base# for input stack temps unsigned bbStkTempsOut; // base# for output stack temps #define MAX_XCPTN_INDEX (USHRT_MAX - 1) // It would be nice to make bbTryIndex and bbHndIndex private, but there is still code that uses them directly, // especially Compiler::fgNewBBinRegion() and friends. // index, into the compHndBBtab table, of innermost 'try' clause containing the BB (used for raising exceptions). // Stored as index + 1; 0 means "no try index". unsigned short bbTryIndex; // index, into the compHndBBtab table, of innermost handler (filter, catch, fault/finally) containing the BB. // Stored as index + 1; 0 means "no handler index". unsigned short bbHndIndex; // Given two EH indices that are either bbTryIndex or bbHndIndex (or related), determine if index1 might be more // deeply nested than index2. Both index1 and index2 are in the range [0..compHndBBtabCount], where 0 means // "main function" and otherwise the value is an index into compHndBBtab[]. Note that "sibling" EH regions will // have a numeric index relationship that doesn't indicate nesting, whereas a more deeply nested region must have // a lower index than the region it is nested within. Note that if you compare a single block's bbTryIndex and // bbHndIndex, there is guaranteed to be a nesting relationship, since that block can't be simultaneously in two // sibling EH regions. In that case, "maybe" is actually "definitely". static bool ehIndexMaybeMoreNested(unsigned index1, unsigned index2) { if (index1 == 0) { // index1 is in the main method. It can't be more deeply nested than index2. return false; } else if (index2 == 0) { // index1 represents an EH region, whereas index2 is the main method. Thus, index1 is more deeply nested. assert(index1 > 0); return true; } else { // If index1 has a smaller index, it might be more deeply nested than index2. assert(index1 > 0); assert(index2 > 0); return index1 < index2; } } // catch type: class token of handler, or one of BBCT_*. Only set on first block of catch handler. unsigned bbCatchTyp; bool hasTryIndex() const { return bbTryIndex != 0; } bool hasHndIndex() const { return bbHndIndex != 0; } unsigned getTryIndex() const { assert(bbTryIndex != 0); return bbTryIndex - 1; } unsigned getHndIndex() const { assert(bbHndIndex != 0); return bbHndIndex - 1; } void setTryIndex(unsigned val) { bbTryIndex = (unsigned short)(val + 1); assert(bbTryIndex != 0); } void setHndIndex(unsigned val) { bbHndIndex = (unsigned short)(val + 1); assert(bbHndIndex != 0); } void clearTryIndex() { bbTryIndex = 0; } void clearHndIndex() { bbHndIndex = 0; } void copyEHRegion(const BasicBlock* from) { bbTryIndex = from->bbTryIndex; bbHndIndex = from->bbHndIndex; } static bool sameTryRegion(const BasicBlock* blk1, const BasicBlock* blk2) { return blk1->bbTryIndex == blk2->bbTryIndex; } static bool sameHndRegion(const BasicBlock* blk1, const BasicBlock* blk2) { return blk1->bbHndIndex == blk2->bbHndIndex; } static bool sameEHRegion(const BasicBlock* blk1, const BasicBlock* blk2) { return sameTryRegion(blk1, blk2) && sameHndRegion(blk1, blk2); } // Some non-zero value that will not collide with real tokens for bbCatchTyp #define BBCT_NONE 0x00000000 #define BBCT_FAULT 0xFFFFFFFC #define BBCT_FINALLY 0xFFFFFFFD #define BBCT_FILTER 0xFFFFFFFE #define BBCT_FILTER_HANDLER 0xFFFFFFFF #define handlerGetsXcptnObj(hndTyp) ((hndTyp) != BBCT_NONE && (hndTyp) != BBCT_FAULT && (hndTyp) != BBCT_FINALLY) // TODO-Cleanup: Get rid of bbStkDepth and use bbStackDepthOnEntry() instead union { unsigned short bbStkDepth; // stack depth on entry unsigned short bbFPinVars; // number of inner enregistered FP vars }; // Basic block predecessor lists. Early in compilation, some phases might need to compute "cheap" predecessor // lists. These are stored in bbCheapPreds, computed by fgComputeCheapPreds(). If bbCheapPreds is valid, // 'fgCheapPredsValid' will be 'true'. Later, the "full" predecessor lists are created by fgComputePreds(), stored // in 'bbPreds', and then maintained throughout compilation. 'fgComputePredsDone' will be 'true' after the // full predecessor lists are created. See the comment at fgComputeCheapPreds() to see how those differ from // the "full" variant. union { BasicBlockList* bbCheapPreds; // ptr to list of cheap predecessors (used before normal preds are computed) flowList* bbPreds; // ptr to list of predecessors }; BlockSet bbReach; // Set of all blocks that can reach this one BasicBlock* bbIDom; // Represent the closest dominator to this block (called the Immediate // Dominator) used to compute the dominance tree. unsigned bbDfsNum; // The index of this block in DFS reverse post order // relative to the flow graph. #if ASSERTION_PROP // A set of blocks which dominate this one *except* the normal entry block. This is lazily initialized // and used only by Assertion Prop, intersected with fgEnterBlks! BlockSet bbDoms; #endif IL_OFFSET bbCodeOffs; // IL offset of the beginning of the block IL_OFFSET bbCodeOffsEnd; // IL offset past the end of the block. Thus, the [bbCodeOffs..bbCodeOffsEnd) // range is not inclusive of the end offset. The count of IL bytes in the block // is bbCodeOffsEnd - bbCodeOffs, assuming neither are BAD_IL_OFFSET. #ifdef DEBUG void dspBlockILRange(); // Display the block's IL range as [XXX...YYY), where XXX and YYY might be "???" for // BAD_IL_OFFSET. #endif // DEBUG VARSET_TP bbVarUse; // variables used by block (before an assignment) VARSET_TP bbVarDef; // variables assigned by block (before a use) VARSET_TP bbLiveIn; // variables live on entry VARSET_TP bbLiveOut; // variables live on exit // Use, def, live in/out information for the implicit memory variable. MemoryKindSet bbMemoryUse : MemoryKindCount; // must be set for any MemoryKinds this block references MemoryKindSet bbMemoryDef : MemoryKindCount; // must be set for any MemoryKinds this block mutates MemoryKindSet bbMemoryLiveIn : MemoryKindCount; MemoryKindSet bbMemoryLiveOut : MemoryKindCount; MemoryKindSet bbMemoryHavoc : MemoryKindCount; // If true, at some point the block does an operation // that leaves memory in an unknown state. (E.g., // unanalyzed call, store through unknown pointer...) // We want to make phi functions for the special implicit var memory. But since this is not a real // lclVar, and thus has no local #, we can't use a GenTreePhiArg. Instead, we use this struct. struct MemoryPhiArg { unsigned m_ssaNum; // SSA# for incoming value. MemoryPhiArg* m_nextArg; // Next arg in the list, else NULL. unsigned GetSsaNum() { return m_ssaNum; } MemoryPhiArg(unsigned ssaNum, MemoryPhiArg* nextArg = nullptr) : m_ssaNum(ssaNum), m_nextArg(nextArg) { } void* operator new(size_t sz, class Compiler* comp); }; static MemoryPhiArg* EmptyMemoryPhiDef; // Special value (0x1, FWIW) to represent a to-be-filled in Phi arg list // for Heap. MemoryPhiArg* bbMemorySsaPhiFunc[MemoryKindCount]; // If the "in" Heap SSA var is not a phi definition, this value // is NULL. // Otherwise, it is either the special value EmptyMemoryPhiDefn, to indicate // that Heap needs a phi definition on entry, or else it is the linked list // of the phi arguments. unsigned bbMemorySsaNumIn[MemoryKindCount]; // The SSA # of memory on entry to the block. unsigned bbMemorySsaNumOut[MemoryKindCount]; // The SSA # of memory on exit from the block. VARSET_TP bbScope; // variables in scope over the block void InitVarSets(class Compiler* comp); /* The following are the standard bit sets for dataflow analysis. * We perform CSE and range-checks at the same time * and assertion propagation separately, * thus we can union them since the two operations are completely disjunct. */ union { EXPSET_TP bbCseGen; // CSEs computed by block #if ASSERTION_PROP ASSERT_TP bbAssertionGen; // value assignments computed by block #endif }; union { #if ASSERTION_PROP ASSERT_TP bbAssertionKill; // value assignments killed by block #endif }; union { EXPSET_TP bbCseIn; // CSEs available on entry #if ASSERTION_PROP ASSERT_TP bbAssertionIn; // value assignments available on entry #endif }; union { EXPSET_TP bbCseOut; // CSEs available on exit #if ASSERTION_PROP ASSERT_TP bbAssertionOut; // value assignments available on exit #endif }; void* bbEmitCookie; #if FEATURE_EH_FUNCLETS && defined(_TARGET_ARM_) void* bbUnwindNopEmitCookie; #endif // FEATURE_EH_FUNCLETS && defined(_TARGET_ARM_) #ifdef VERIFIER stackDesc bbStackIn; // stack descriptor for input stackDesc bbStackOut; // stack descriptor for output verTypeVal* bbTypesIn; // list of variable types on input verTypeVal* bbTypesOut; // list of variable types on output #endif // VERIFIER #if FEATURE_STACK_FP_X87 FlatFPStateX87* bbFPStateX87; // State of FP stack on entry to the basic block #endif // FEATURE_STACK_FP_X87 /* The following fields used for loop detection */ typedef unsigned char loopNumber; static const unsigned NOT_IN_LOOP = UCHAR_MAX; #ifdef DEBUG // This is the label a loop gets as part of the second, reachability-based // loop discovery mechanism. This is apparently only used for debugging. // We hope we'll eventually just have one loop-discovery mechanism, and this will go away. loopNumber bbLoopNum; // set to 'n' for a loop #n header #endif // DEBUG loopNumber bbNatLoopNum; // Index, in optLoopTable, of most-nested loop that contains this block, // or else NOT_IN_LOOP if this block is not in a loop. #define MAX_LOOP_NUM 16 // we're using a 'short' for the mask #define LOOP_MASK_TP unsigned // must be big enough for a mask //------------------------------------------------------------------------- #if MEASURE_BLOCK_SIZE static size_t s_Size; static size_t s_Count; #endif // MEASURE_BLOCK_SIZE bool bbFallsThrough(); // Our slop fraction is 1/128 of the block weight rounded off static weight_t GetSlopFraction(weight_t weightBlk) { return ((weightBlk + 64) / 128); } // Given an the edge b1 -> b2, calculate the slop fraction by // using the higher of the two block weights static weight_t GetSlopFraction(BasicBlock* b1, BasicBlock* b2) { return GetSlopFraction(max(b1->bbWeight, b2->bbWeight)); } #ifdef DEBUG unsigned bbTgtStkDepth; // Native stack depth on entry (for throw-blocks) static unsigned s_nMaxTrees; // The max # of tree nodes in any BB unsigned bbStmtNum; // The statement number of the first stmt in this block // This is used in integrity checks. We semi-randomly pick a traversal stamp, label all blocks // in the BB list with that stamp (in this field); then we can tell if (e.g.) predecessors are // still in the BB list by whether they have the same stamp (with high probability). unsigned bbTraversalStamp; #endif // DEBUG ThisInitState bbThisOnEntry(); unsigned bbStackDepthOnEntry(); void bbSetStack(void* stackBuffer); StackEntry* bbStackOnEntry(); void bbSetRunRarely(); // "bbNum" is one-based (for unknown reasons); it is sometimes useful to have the corresponding // zero-based number for use as an array index. unsigned bbInd() { assert(bbNum > 0); return bbNum - 1; } GenTreeStmt* firstStmt() const; GenTreeStmt* lastStmt() const; GenTreeStmt* lastTopLevelStmt(); GenTree* firstNode(); GenTree* lastNode(); bool containsStatement(GenTree* statement); bool endsWithJmpMethod(Compiler* comp); bool endsWithTailCall(Compiler* comp, bool fastTailCallsOnly, bool tailCallsConvertibleToLoopOnly, GenTree** tailCall); bool endsWithTailCallOrJmp(Compiler* comp, bool fastTailCallsOnly = false); bool endsWithTailCallConvertibleToLoop(Compiler* comp, GenTree** tailCall); // Returns the first statement in the statement list of "this" that is // not an SSA definition (a lcl = phi(...) assignment). GenTreeStmt* FirstNonPhiDef(); GenTree* FirstNonPhiDefOrCatchArgAsg(); BasicBlock() : #if ASSERTION_PROP BLOCKSET_INIT_NOCOPY(bbDoms, BlockSetOps::UninitVal()) , #endif // ASSERTION_PROP VARSET_INIT_NOCOPY(bbLiveIn, VarSetOps::UninitVal()) , VARSET_INIT_NOCOPY(bbLiveOut, VarSetOps::UninitVal()) { } private: EHSuccessorIter StartEHSuccs(Compiler* comp) { return EHSuccessorIter(comp, this); } EHSuccessorIter EndEHSuccs() { return EHSuccessorIter(); } friend struct EHSuccs; AllSuccessorIter StartAllSuccs(Compiler* comp) { return AllSuccessorIter(comp, this); } AllSuccessorIter EndAllSuccs(Compiler* comp) { return AllSuccessorIter(NumSucc(comp)); } friend struct AllSuccs; public: // Iteratable collection of the EH successors of a block. class EHSuccs { Compiler* m_comp; BasicBlock* m_block; public: EHSuccs(Compiler* comp, BasicBlock* block) : m_comp(comp), m_block(block) { } EHSuccessorIter begin() { return m_block->StartEHSuccs(m_comp); } EHSuccessorIter end() { return EHSuccessorIter(); } }; EHSuccs GetEHSuccs(Compiler* comp) { return EHSuccs(comp, this); } class AllSuccs { Compiler* m_comp; BasicBlock* m_block; public: AllSuccs(Compiler* comp, BasicBlock* block) : m_comp(comp), m_block(block) { } AllSuccessorIter begin() { return m_block->StartAllSuccs(m_comp); } AllSuccessorIter end() { return AllSuccessorIter(m_block->NumSucc(m_comp)); } }; AllSuccs GetAllSuccs(Compiler* comp) { return AllSuccs(comp, this); } // Try to clone block state and statements from `from` block to `to` block (which must be new/empty), // optionally replacing uses of local `varNum` with IntCns `varVal`. Return true if all statements // in the block are cloned successfully, false (with partially-populated `to` block) if one fails. static bool CloneBlockState( Compiler* compiler, BasicBlock* to, const BasicBlock* from, unsigned varNum = (unsigned)-1, int varVal = 0); void MakeLIR(GenTree* firstNode, GenTree* lastNode); bool IsLIR(); }; template <> struct PtrKeyFuncs<BasicBlock> : public KeyFuncsDefEquals<const BasicBlock*> { public: // Make sure hashing is deterministic and not on "ptr." static unsigned GetHashCode(const BasicBlock* ptr); }; // A set of blocks. typedef SimplerHashTable<BasicBlock*, PtrKeyFuncs<BasicBlock>, bool, JitSimplerHashBehavior> BlkSet; // A map of block -> set of blocks, can be used as sparse block trees. typedef SimplerHashTable<BasicBlock*, PtrKeyFuncs<BasicBlock>, BlkSet*, JitSimplerHashBehavior> BlkToBlkSetMap; // Map from Block to Block. Used for a variety of purposes. typedef SimplerHashTable<BasicBlock*, PtrKeyFuncs<BasicBlock>, BasicBlock*, JitSimplerHashBehavior> BlockToBlockMap; // In compiler terminology the control flow between two BasicBlocks // is typically referred to as an "edge". Most well known are the // backward branches for loops, which are often called "back-edges". // // "struct flowList" is the type that represents our control flow edges. // This type is a linked list of zero or more "edges". // (The list of zero edges is represented by NULL.) // Every BasicBlock has a field called bbPreds of this type. This field // represents the list of "edges" that flow into this BasicBlock. // The flowList type only stores the BasicBlock* of the source for the // control flow edge. The destination block for the control flow edge // is implied to be the block which contained the bbPreds field. // // For a switch branch target there may be multiple "edges" that have // the same source block (and destination block). We need to count the // number of these edges so that during optimization we will know when // we have zero of them. Rather than have extra flowList entries we // increment the flDupCount field. // // When we have Profile weight for the BasicBlocks we can usually compute // the number of times each edge was executed by examining the adjacent // BasicBlock weights. As we are doing for BasicBlocks, we call the number // of times that a control flow edge was executed the "edge weight". // In order to compute the edge weights we need to use a bounded range // for every edge weight. These two fields, 'flEdgeWeightMin' and 'flEdgeWeightMax' // are used to hold a bounded range. Most often these will converge such // that both values are the same and that value is the exact edge weight. // Sometimes we are left with a rage of possible values between [Min..Max] // which represents an inexact edge weight. // // The bbPreds list is initially created by Compiler::fgComputePreds() // and is incrementally kept up to date. // // The edge weight are computed by Compiler::fgComputeEdgeWeights() // the edge weights are used to straighten conditional branches // by Compiler::fgReorderBlocks() // // We have a simpler struct, BasicBlockList, which is simply a singly-linked // list of blocks. This is used for various purposes, but one is as a "cheap" // predecessor list, computed by fgComputeCheapPreds(), and stored as a list // on BasicBlock pointed to by bbCheapPreds. struct BasicBlockList { BasicBlockList* next; // The next BasicBlock in the list, nullptr for end of list. BasicBlock* block; // The BasicBlock of interest. BasicBlockList() : next(nullptr), block(nullptr) { } BasicBlockList(BasicBlock* blk, BasicBlockList* rest) : next(rest), block(blk) { } }; struct flowList { flowList* flNext; // The next BasicBlock in the list, nullptr for end of list. BasicBlock* flBlock; // The BasicBlock of interest. BasicBlock::weight_t flEdgeWeightMin; BasicBlock::weight_t flEdgeWeightMax; unsigned flDupCount; // The count of duplicate "edges" (use only for switch stmts) // These two methods are used to set new values for flEdgeWeightMin and flEdgeWeightMax // they are used only during the computation of the edge weights // They return false if the newWeight is not between the current [min..max] // when slop is non-zero we allow for the case where our weights might be off by 'slop' // bool setEdgeWeightMinChecked(BasicBlock::weight_t newWeight, BasicBlock::weight_t slop, bool* wbUsedSlop); bool setEdgeWeightMaxChecked(BasicBlock::weight_t newWeight, BasicBlock::weight_t slop, bool* wbUsedSlop); flowList() : flNext(nullptr), flBlock(nullptr), flEdgeWeightMin(0), flEdgeWeightMax(0), flDupCount(0) { } flowList(BasicBlock* blk, flowList* rest) : flNext(rest), flBlock(blk), flEdgeWeightMin(0), flEdgeWeightMax(0), flDupCount(0) { } }; // This enum represents a pre/post-visit action state to emulate a depth-first // spanning tree traversal of a tree or graph. enum DfsStackState { DSS_Invalid, // The initialized, invalid error state DSS_Pre, // The DFS pre-order (first visit) traversal state DSS_Post // The DFS post-order (last visit) traversal state }; // These structs represents an entry in a stack used to emulate a non-recursive // depth-first spanning tree traversal of a graph. The entry contains either a // block pointer or a block number depending on which is more useful. struct DfsBlockEntry { DfsStackState dfsStackState; // The pre/post traversal action for this entry BasicBlock* dfsBlock; // The corresponding block for the action DfsBlockEntry() : dfsStackState(DSS_Invalid), dfsBlock(nullptr) { } DfsBlockEntry(DfsStackState state, BasicBlock* basicBlock) : dfsStackState(state), dfsBlock(basicBlock) { } }; struct DfsNumEntry { DfsStackState dfsStackState; // The pre/post traversal action for this entry unsigned dfsNum; // The corresponding block number for the action DfsNumEntry() : dfsStackState(DSS_Invalid), dfsNum(0) { } DfsNumEntry(DfsStackState state, unsigned bbNum) : dfsStackState(state), dfsNum(bbNum) { } }; /*****************************************************************************/ extern BasicBlock* __cdecl verAllocBasicBlock(); #ifdef DEBUG extern void __cdecl verDispBasicBlocks(); #endif /***************************************************************************** * * The following call-backs supplied by the client; it's used by the code * emitter to convert a basic block to its corresponding emitter cookie. */ void* emitCodeGetCookie(BasicBlock* block); AllSuccessorIter::AllSuccessorIter(Compiler* comp, BasicBlock* block) : m_comp(comp), m_blk(block), m_normSucc(0), m_numNormSuccs(block->NumSucc(comp)), m_ehIter(comp, block) { if (CurTryIsBlkCallFinallyTarget()) { ++m_ehIter; } } bool AllSuccessorIter::CurTryIsBlkCallFinallyTarget() { return (m_blk->bbJumpKind == BBJ_CALLFINALLY) && (m_ehIter != EHSuccessorIter()) && (m_blk->bbJumpDest == (*m_ehIter)); } void AllSuccessorIter::operator++(void) { if (m_normSucc < m_numNormSuccs) { m_normSucc++; } else { ++m_ehIter; // If the original block whose successors we're iterating over // is a BBJ_CALLFINALLY, that finally clause's first block // will be yielded as a normal successor. Don't also yield as // an exceptional successor. if (CurTryIsBlkCallFinallyTarget()) { ++m_ehIter; } } } // Requires that "this" is not equal to the standard "end" iterator. Returns the // current successor. BasicBlock* AllSuccessorIter::operator*() { if (m_normSucc < m_numNormSuccs) { return m_blk->GetSucc(m_normSucc, m_comp); } else { return *m_ehIter; } } /*****************************************************************************/ #endif // _BLOCK_H_ /*****************************************************************************/
sjsinju/coreclr
src/jit/block.h
C
mit
53,937
[ 30522, 1013, 1013, 7000, 2000, 1996, 1012, 5658, 3192, 2104, 2028, 2030, 2062, 10540, 1012, 1013, 1013, 1996, 1012, 5658, 3192, 15943, 2023, 5371, 2000, 2017, 2104, 1996, 10210, 6105, 1012, 1013, 1013, 2156, 1996, 6105, 5371, 1999, 1996, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
--- layout: post section-type: post title: Let's Blaze! (trails) category: Category tags: [ 'tag1', 'tag2' ] --- For our next event we will be partnering with Harlem Tech Fund (HTF) to spend time discussing 'What does it mean to be a trailblazer?'. Jessica O. Matthews, CEO of Uncharted Play (UP) and Chairman of the Board at Harlem Tech Fund, will kick off this discussion by sharing her own journey as a trailblazer. At the age of 19, Jessica invented the SOCCKET ball, an energy generating soccer ball that provides off-grid power for the developing world. At the age of 22, she founded Uncharted Play, a renewable energy company specializing in motion-based, miniaturized power systems. Jessica’s research and career centers around the intersection of disruptive technology, human behavior, and the psychology of self-actualization. A dual citizen of Nigeria & the U.S., Jessica has a degree in Psychology and Economics from Harvard University, and an MBA from Harvard Business School. Members of Harlem Tech Fund and TechYes! will then share their own experiences with trailblazing. To continue the conversation, we ultimately want to hear from you! What are some ways that you have blazed a trail in the past? What are some experiences that you are going through now? We hope that through this discussion, we'll expand our definition and understanding of what it means to be a trailblazer. Please join us in Harlem at HTF's offices for this exciting event! Refreshments and quality conversation will be provided.
rachelleffel/techyes
_posts/2017-04-26-hello-world.md
Markdown
mit
1,525
[ 30522, 1011, 1011, 1011, 9621, 1024, 2695, 2930, 1011, 2828, 1024, 2695, 2516, 1024, 2292, 1005, 1055, 15347, 999, 1006, 9612, 1007, 4696, 1024, 4696, 22073, 1024, 1031, 1005, 6415, 2487, 1005, 1010, 1005, 6415, 2475, 1005, 1033, 1011, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE html> <html lang="en"> <head> <title>ProcessIDLogFormatter Struct Reference</title> <link rel="stylesheet" type="text/css" href="../css/jazzy.css" /> <link rel="stylesheet" type="text/css" href="../css/highlight.css" /> <meta charset='utf-8'> <script src="../js/jquery.min.js" defer></script> <script src="../js/jazzy.js" defer></script> </head> <body> <a name="//apple_ref/swift/Struct/ProcessIDLogFormatter" class="dashAnchor"></a> <a title="ProcessIDLogFormatter Struct Reference"></a> <header> <div class="content-wrapper"> <p><a href="../index.html">CleanroomLogger Docs</a> (100% documented)</p> <p class="header-right"><a href="https://github.com/emaloney/CleanroomLogger"><img src="../img/gh.png"/>View on GitHub</a></p> </div> </header> <div class="content-wrapper"> <p id="breadcrumbs"> <a href="../index.html">CleanroomLogger Reference</a> <img id="carat" src="../img/carat.png" /> ProcessIDLogFormatter Struct Reference </p> </div> <div class="content-wrapper"> <nav class="sidebar"> <ul class="nav-groups"> <li class="nav-group-name"> <a href="../Classes.html">Classes</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a href="../Classes/BasicLogConfiguration.html">BasicLogConfiguration</a> </li> <li class="nav-group-task"> <a href="../Classes/ConcatenatingLogFormatter.html">ConcatenatingLogFormatter</a> </li> <li class="nav-group-task"> <a href="../Classes/ConsoleLogConfiguration.html">ConsoleLogConfiguration</a> </li> <li class="nav-group-task"> <a href="../Classes/ConsoleLogConfiguration/StandardStreamsMode.html">– StandardStreamsMode</a> </li> <li class="nav-group-task"> <a href="../Classes/FieldBasedLogFormatter.html">FieldBasedLogFormatter</a> </li> <li class="nav-group-task"> <a href="../Classes/FieldBasedLogFormatter/Field.html">– Field</a> </li> <li class="nav-group-task"> <a href="../Classes/FileLogRecorder.html">FileLogRecorder</a> </li> <li class="nav-group-task"> <a href="../Classes/LogReceptacle.html">LogReceptacle</a> </li> <li class="nav-group-task"> <a href="../Classes/LogRecorderBase.html">LogRecorderBase</a> </li> <li class="nav-group-task"> <a href="../Classes/OutputStreamLogRecorder.html">OutputStreamLogRecorder</a> </li> <li class="nav-group-task"> <a href="../Classes/ParsableLogFormatter.html">ParsableLogFormatter</a> </li> <li class="nav-group-task"> <a href="../Classes/ReadableLogFormatter.html">ReadableLogFormatter</a> </li> <li class="nav-group-task"> <a href="../Classes/RotatingLogFileConfiguration.html">RotatingLogFileConfiguration</a> </li> <li class="nav-group-task"> <a href="../Classes/RotatingLogFileRecorder.html">RotatingLogFileRecorder</a> </li> <li class="nav-group-task"> <a href="../Classes/StandardErrorLogRecorder.html">StandardErrorLogRecorder</a> </li> <li class="nav-group-task"> <a href="../Classes/StandardLogFormatter.html">StandardLogFormatter</a> </li> <li class="nav-group-task"> <a href="../Classes/StandardOutputLogRecorder.html">StandardOutputLogRecorder</a> </li> <li class="nav-group-task"> <a href="../Classes/StandardStreamsLogRecorder.html">StandardStreamsLogRecorder</a> </li> <li class="nav-group-task"> <a href="../Classes/XcodeLogConfiguration.html">XcodeLogConfiguration</a> </li> <li class="nav-group-task"> <a href="../Classes/XcodeLogFormatter.html">XcodeLogFormatter</a> </li> <li class="nav-group-task"> <a href="../Classes/XcodeTraceLogFormatter.html">XcodeTraceLogFormatter</a> </li> </ul> </li> <li class="nav-group-name"> <a href="../Enums.html">Enums</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a href="../Enums/CallingThreadStyle.html">CallingThreadStyle</a> </li> <li class="nav-group-task"> <a href="../Enums/DelimiterStyle.html">DelimiterStyle</a> </li> <li class="nav-group-task"> <a href="../Enums/LogSeverity.html">LogSeverity</a> </li> <li class="nav-group-task"> <a href="../Enums/OSLogTypeTranslator.html">OSLogTypeTranslator</a> </li> <li class="nav-group-task"> <a href="../Enums/SeverityStyle.html">SeverityStyle</a> </li> <li class="nav-group-task"> <a href="../Enums/SeverityStyle/TextRepresentation.html">– TextRepresentation</a> </li> <li class="nav-group-task"> <a href="../Enums/TimestampStyle.html">TimestampStyle</a> </li> </ul> </li> <li class="nav-group-name"> <a href="../Protocols.html">Protocols</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a href="../Protocols/LogConfiguration.html">LogConfiguration</a> </li> <li class="nav-group-task"> <a href="../Protocols/LogFilter.html">LogFilter</a> </li> <li class="nav-group-task"> <a href="../Protocols/LogFormatter.html">LogFormatter</a> </li> <li class="nav-group-task"> <a href="../Protocols/LogRecorder.html">LogRecorder</a> </li> </ul> </li> <li class="nav-group-name"> <a href="../Structs.html">Structs</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a href="../Structs/CallSiteLogFormatter.html">CallSiteLogFormatter</a> </li> <li class="nav-group-task"> <a href="../Structs/CallingThreadLogFormatter.html">CallingThreadLogFormatter</a> </li> <li class="nav-group-task"> <a href="../Structs/DelimiterLogFormatter.html">DelimiterLogFormatter</a> </li> <li class="nav-group-task"> <a href="../Structs/LiteralLogFormatter.html">LiteralLogFormatter</a> </li> <li class="nav-group-task"> <a href="../Structs/Log.html">Log</a> </li> <li class="nav-group-task"> <a href="../Structs/LogChannel.html">LogChannel</a> </li> <li class="nav-group-task"> <a href="../Structs/LogEntry.html">LogEntry</a> </li> <li class="nav-group-task"> <a href="../Structs/LogEntry/Payload.html">– Payload</a> </li> <li class="nav-group-task"> <a href="../Structs/LogSeverityFilter.html">LogSeverityFilter</a> </li> <li class="nav-group-task"> <a href="../Structs/OSLogRecorder.html">OSLogRecorder</a> </li> <li class="nav-group-task"> <a href="../Structs/PayloadLogFormatter.html">PayloadLogFormatter</a> </li> <li class="nav-group-task"> <a href="../Structs/PayloadMessageLogFormatter.html">PayloadMessageLogFormatter</a> </li> <li class="nav-group-task"> <a href="../Structs/PayloadTraceLogFormatter.html">PayloadTraceLogFormatter</a> </li> <li class="nav-group-task"> <a href="../Structs/PayloadValueLogFormatter.html">PayloadValueLogFormatter</a> </li> <li class="nav-group-task"> <a href="../Structs/ProcessIDLogFormatter.html">ProcessIDLogFormatter</a> </li> <li class="nav-group-task"> <a href="../Structs/ProcessNameLogFormatter.html">ProcessNameLogFormatter</a> </li> <li class="nav-group-task"> <a href="../Structs/SeverityLogFormatter.html">SeverityLogFormatter</a> </li> <li class="nav-group-task"> <a href="../Structs/StackFrameLogFormatter.html">StackFrameLogFormatter</a> </li> <li class="nav-group-task"> <a href="../Structs/TimestampLogFormatter.html">TimestampLogFormatter</a> </li> </ul> </li> </ul> </nav> <article class="main-content"> <section> <section class="section"> <h1>ProcessIDLogFormatter</h1> <div class="declaration"> <div class="language"> <pre class="highlight"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">ProcessIDLogFormatter</span><span class="p">:</span> <span class="kt"><a href="../Protocols/LogFormatter.html">LogFormatter</a></span></code></pre> </div> </div> <p>A <code><a href="../Protocols/LogFormatter.html">LogFormatter</a></code> that returns the string representation of a <code><a href="../Structs/LogEntry.html">LogEntry</a></code>&rsquo;s <code>processID</code> property.</p> <p>This is typically combined with other <code><a href="../Protocols/LogFormatter.html">LogFormatter</a></code>s within a <code><a href="../Classes/ConcatenatingLogFormatter.html">ConcatenatingLogFormatter</a></code>.</p> </section> <section class="section task-group-section"> <div class="task-group"> <ul> <li class="item"> <div> <code> <a name="/s:FV15CleanroomLogger21ProcessIDLogFormattercFT_S0_"></a> <a name="//apple_ref/swift/Method/init()" class="dashAnchor"></a> <a class="token" href="#/s:FV15CleanroomLogger21ProcessIDLogFormattercFT_S0_">init()</a> </code> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>The initializer.</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">()</span></code></pre> </div> </div> </section> </div> </li> <li class="item"> <div> <code> <a name="/s:FV15CleanroomLogger21ProcessIDLogFormatter6formatFVS_8LogEntryGSqSS_"></a> <a name="//apple_ref/swift/Method/format(_:)" class="dashAnchor"></a> <a class="token" href="#/s:FV15CleanroomLogger21ProcessIDLogFormatter6formatFVS_8LogEntryGSqSS_">format(_:)</a> </code> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Formats the passed-in <code><a href="../Structs/LogEntry.html">LogEntry</a></code> by returning a string representation of its <code>processID</code> property.</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">format</span><span class="p">(</span><span class="n">_</span> <span class="nv">entry</span><span class="p">:</span> <span class="kt"><a href="../Structs/LogEntry.html">LogEntry</a></span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">String</span><span class="p">?</span></code></pre> </div> </div> <div> <h4>Parameters</h4> <table class="graybox"> <tbody> <tr> <td> <code> <em>entry</em> </code> </td> <td> <div> <p>The <code>LogEntry</code> to be formatted.</p> </div> </td> </tr> </tbody> </table> </div> <div> <h4>Return Value</h4> <p>The formatted result; never <code>nil</code>.</p> </div> </section> </div> </li> </ul> </div> </section> </section> <section id="footer"> <p>© 2015-2017 <a class="link" href="http://tech.gilt.com/" target="_blank" rel="external">Gilt Groupe</a></p> <p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.2</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p> </section> </article> </div> </body> </div> </html>
chizcake/ReplayKitExample
ReplayKitExampleStarter/Carthage/Checkouts/CleanroomLogger/Documentation/API/docsets/CleanroomLogger.docset/Contents/Resources/Documents/Structs/ProcessIDLogFormatter.html
HTML
mit
14,941
[ 30522, 1026, 999, 9986, 13874, 16129, 1028, 1026, 16129, 11374, 1027, 1000, 4372, 1000, 1028, 1026, 2132, 1028, 1026, 2516, 1028, 2832, 3593, 21197, 14192, 20097, 2358, 6820, 6593, 4431, 1026, 1013, 2516, 1028, 1026, 4957, 2128, 2140, 1027,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * ***** BEGIN LICENSE BLOCK ***** * Zimbra Collaboration Suite Web Client * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Zimbra, Inc. * * The contents of this file are subject to the Zimbra Public License * Version 1.3 ("License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.zimbra.com/license. * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. * ***** END LICENSE BLOCK ***** */ /** * @overview */ /** * Creates a folder properties dialog. * @class * This class represents a folder properties dialog. * * @param {DwtControl} parent the parent * @param {String} className the class name * * @extends DwtDialog */ ZmFolderPropsDialog = function(parent, className) { className = className || "ZmFolderPropsDialog"; var extraButtons; if (appCtxt.get(ZmSetting.SHARING_ENABLED)) { extraButtons = [ new DwtDialog_ButtonDescriptor(ZmFolderPropsDialog.ADD_SHARE_BUTTON, ZmMsg.addShare, DwtDialog.ALIGN_LEFT) ]; } DwtDialog.call(this, {parent:parent, className:className, title:ZmMsg.folderProperties, extraButtons:extraButtons, id:"FolderProperties"}); this._tabViews = []; this._tabKeys = []; this._tabInUse = []; this._tabKeyMap = {}; if (appCtxt.get(ZmSetting.SHARING_ENABLED)) { this.registerCallback(ZmFolderPropsDialog.ADD_SHARE_BUTTON, this._handleAddShareButton, this); } this.setButtonListener(DwtDialog.OK_BUTTON, new AjxListener(this, this._handleOkButton)); this.setButtonListener(DwtDialog.CANCEL_BUTTON, new AjxListener(this, this._handleCancelButton)); this._folderChangeListener = new AjxListener(this, this._handleFolderChange); this._createView(); }; ZmFolderPropsDialog.prototype = new DwtDialog; ZmFolderPropsDialog.prototype.constructor = ZmFolderPropsDialog; // Constants ZmFolderPropsDialog.ADD_SHARE_BUTTON = ++DwtDialog.LAST_BUTTON; ZmFolderPropsDialog.SHARES_HEIGHT = "9em"; // Tab identifiers ZmFolderPropsDialog.TABKEY_PROPERTIES = "PROPERTIES_TAB"; ZmFolderPropsDialog.TABKEY_RETENTION = "RETENTION_TAB"; // Public methods ZmFolderPropsDialog.prototype.toString = function() { return "ZmFolderPropsDialog"; }; ZmFolderPropsDialog.prototype.getTabKey = function(id) { var index = this._tabKeyMap[id]; return this._tabKeys[index]; }; /** * Pops-up the properties dialog. * * @param {ZmOrganizer} organizer the organizer */ ZmFolderPropsDialog.prototype.popup = function(organizer) { this._organizer = organizer; for (var i = 0; i < this._tabViews.length; i++) { this._tabViews[i].setOrganizer(organizer); } // On popup, make the property view visible var tabKey = this.getTabKey(ZmFolderPropsDialog.TABKEY_PROPERTIES); this._tabContainer.switchToTab(tabKey, true); organizer.addChangeListener(this._folderChangeListener); this._handleFolderChange(); if (appCtxt.get(ZmSetting.SHARING_ENABLED)) { var isShareable = ZmOrganizer.SHAREABLE[organizer.type]; var isVisible = (!organizer.link || organizer.isAdmin()); this.setButtonVisible(ZmFolderPropsDialog.ADD_SHARE_BUTTON, isVisible && isShareable); } DwtDialog.prototype.popup.call(this); }; ZmFolderPropsDialog.prototype.popdown = function() { if (this._organizer) { this._organizer.removeChangeListener(this._folderChangeListener); this._organizer = null; } DwtDialog.prototype.popdown.call(this); }; // Protected methods ZmFolderPropsDialog.prototype._getSeparatorTemplate = function() { return ""; }; ZmFolderPropsDialog.prototype._handleEditShare = function(event, share) { share = share || Dwt.getObjectFromElement(DwtUiEvent.getTarget(event)); var sharePropsDialog = appCtxt.getSharePropsDialog(); sharePropsDialog.popup(ZmSharePropsDialog.EDIT, share.object, share); return false; }; ZmFolderPropsDialog.prototype._handleRevokeShare = function(event, share) { share = share || Dwt.getObjectFromElement(DwtUiEvent.getTarget(event)); var revokeShareDialog = appCtxt.getRevokeShareDialog(); revokeShareDialog.popup(share); return false; }; ZmFolderPropsDialog.prototype._handleResendShare = function(event, share) { AjxDispatcher.require("Share"); share = share || Dwt.getObjectFromElement(DwtUiEvent.getTarget(event)); // create share info var tmpShare = new ZmShare({object:share.object}); tmpShare.grantee.id = share.grantee.id; tmpShare.grantee.email = (share.grantee.type == "guest") ? share.grantee.id : share.grantee.name; tmpShare.grantee.name = share.grantee.name; if (tmpShare.object.isRemote()) { tmpShare.grantor.id = tmpShare.object.zid; tmpShare.grantor.email = tmpShare.object.owner; tmpShare.grantor.name = tmpShare.grantor.email; tmpShare.link.id = tmpShare.object.rid; } else { tmpShare.grantor.id = appCtxt.get(ZmSetting.USERID); tmpShare.grantor.email = appCtxt.get(ZmSetting.USERNAME); tmpShare.grantor.name = appCtxt.get(ZmSetting.DISPLAY_NAME) || tmpShare.grantor.email; tmpShare.link.id = tmpShare.object.id; } tmpShare.link.name = share.object.name; tmpShare.link.view = ZmOrganizer.getViewName(share.object.type); tmpShare.link.perm = share.link.perm; if (share.grantee.type == "guest") { // Pass action as ZmShare.NEW even for resend for external user tmpShare._sendShareNotification(tmpShare.grantee.email, tmpShare.link.id, "", ZmShare.NEW); } else { tmpShare.sendMessage(ZmShare.NEW); } appCtxt.setStatusMsg(ZmMsg.resentShareMessage); return false; }; ZmFolderPropsDialog.prototype._handleAddShareButton = function(event) { var sharePropsDialog = appCtxt.getSharePropsDialog(); sharePropsDialog.popup(ZmSharePropsDialog.NEW, this._organizer, null); }; ZmFolderPropsDialog.prototype._handleOkButton = function(event) { // New batch command, stop on error var batchCommand = new ZmBatchCommand(null, null, true); var saveState = { commandCount: 0, errorMessage: [] }; for (var i = 0; i < this._tabViews.length; i++) { if (this._tabInUse[i]) { // Save all in use tabs this._tabViews[i].doSave(batchCommand, saveState); } } if (saveState.errorMessage.length > 0) { var msg = saveState.errorMessage.join("<br>"); var dialog = appCtxt.getMsgDialog(); dialog.reset(); dialog.setMessage(msg, DwtMessageDialog.WARNING_STYLE); dialog.popup(); } else if (saveState.commandCount > 0) { var callback = new AjxCallback(this, this.popdown); batchCommand.run(callback); } else { this.popdown(); } }; ZmFolderPropsDialog.prototype._handleError = function(response) { // Returned 'not handled' so that the batch command will preform the default // ZmController._handleException return false; }; ZmFolderPropsDialog.prototype._handleCancelButton = function(event) { this.popdown(); }; ZmFolderPropsDialog.prototype._handleFolderChange = function(event) { var organizer = this._organizer; // Get the components that will be hidden or displayed var tabBar = this._tabContainer.getTabBar(); var tabKey = this.getTabKey(ZmFolderPropsDialog.TABKEY_RETENTION); var retentionTabButton = this._tabContainer.getTabButton(tabKey); var retentionIndex = this._tabKeyMap[ZmFolderPropsDialog.TABKEY_RETENTION]; if ((organizer.type != ZmOrganizer.FOLDER) || organizer.link) { // Not a folder, or shared - hide the retention view (and possibly the toolbar) this._tabInUse[retentionIndex] = false; if (this._tabViews.length > 2) { // More than two tabs, hide the retention tab, leave the toolbar intact tabBar.setVisible(true); retentionTabButton.setVisible(false); } else { // Two or fewer tabs. Hide the toolbar, just let the properties view display standalone // (On popup, the display defaults to the property view) tabBar.setVisible(false); } } else { // Using the retention tab view - show the toolbar and all tabs this._tabInUse[retentionIndex] = true; retentionTabButton.setVisible(true); tabBar.setVisible(true); } for (var i = 0; i < this._tabViews.length; i++) { if (this._tabInUse[i]) { // Update all in use tabs to use the specified folder this._tabViews[i]._handleFolderChange(event); } } if (appCtxt.get(ZmSetting.SHARING_ENABLED)) { this._populateShares(organizer); } }; ZmFolderPropsDialog.prototype._populateShares = function(organizer) { this._sharesGroup.setContent(""); var displayShares = this._getDisplayShares(organizer); var getFolder = false; if (displayShares.length) { for (var i = 0; i < displayShares.length; i++) { var share = displayShares[i]; if (!(share.grantee && share.grantee.name)) { getFolder = true; } } } if (getFolder) { var respCallback = new AjxCallback(this, this._handleResponseGetFolder, [displayShares]); organizer.getFolder(respCallback); } else { this._handleResponseGetFolder(displayShares); } this._sharesGroup.setVisible(displayShares.length > 0); }; ZmFolderPropsDialog.prototype._getDisplayShares = function(organizer) { var shares = organizer.shares; var displayShares = []; if ((!organizer.link || organizer.isAdmin()) && shares && shares.length > 0) { AjxDispatcher.require("Share"); var userZid = appCtxt.accountList.mainAccount.id; // if a folder was shared with us with admin rights, a share is created since we could share it; // don't show any share that's for us in the list for (var i = 0; i < shares.length; i++) { var share = shares[i]; if (share.grantee) { var granteeId = share.grantee.id; if ((share.grantee.type != ZmShare.TYPE_USER) || (share.grantee.id != userZid)) { displayShares.push(share); } } } } return displayShares; }; ZmFolderPropsDialog.prototype._handleResponseGetFolder = function(displayShares, organizer) { if (organizer) { displayShares = this._getDisplayShares(organizer); } if (displayShares.length) { var table = document.createElement("TABLE"); table.className = "ZPropertySheet"; table.cellSpacing = "6"; for (var i = 0; i < displayShares.length; i++) { var share = displayShares[i]; var row = table.insertRow(-1); var nameEl = row.insertCell(-1); nameEl.style.paddingRight = "15px"; var nameText = share.grantee && share.grantee.name; if (share.isAll()) { nameText = ZmMsg.shareWithAll; } else if (share.isPublic()) { nameText = ZmMsg.shareWithPublic; } else if (share.isGuest()){ nameText = nameText || (share.grantee && share.grantee.id); } nameEl.innerHTML = AjxStringUtil.htmlEncode(nameText); var roleEl = row.insertCell(-1); roleEl.style.paddingRight = "15px"; roleEl.innerHTML = ZmShare.getRoleName(share.link.role); this.__createCmdCells(row, share); } this._sharesGroup.setElement(table); var width = Dwt.DEFAULT; var height = displayShares.length > 5 ? ZmFolderPropsDialog.SHARES_HEIGHT : Dwt.CLEAR; var insetElement = this._sharesGroup.getInsetHtmlElement(); Dwt.setScrollStyle(insetElement, Dwt.SCROLL); Dwt.setSize(insetElement, width, height); } this._sharesGroup.setVisible(displayShares.length > 0); }; ZmFolderPropsDialog.prototype.__createCmdCells = function(row, share) { var type = share.grantee.type; if (type == ZmShare.TYPE_DOMAIN || !share.link.role) { var cell = row.insertCell(-1); cell.colSpan = 3; cell.innerHTML = ZmMsg.configureWithAdmin; return; } var actions = [ZmShare.EDIT, ZmShare.REVOKE, ZmShare.RESEND]; var handlers = [this._handleEditShare, this._handleRevokeShare, this._handleResendShare]; for (var i = 0; i < actions.length; i++) { var action = actions[i]; var cell = row.insertCell(-1); // public shares have no editable fields, and sent no mail var isAllShare = share.grantee && (share.grantee.type == ZmShare.TYPE_ALL); if (((isAllShare || share.isPublic() || share.isGuest()) && (action == ZmShare.EDIT)) || ((isAllShare || share.isPublic()) && action == ZmShare.RESEND)) { continue; } var link = document.createElement("A"); link.href = "#"; link.innerHTML = ZmShare.ACTION_LABEL[action]; Dwt.setHandler(link, DwtEvent.ONCLICK, handlers[i]); Dwt.associateElementWithObject(link, share); cell.appendChild(link); } }; ZmFolderPropsDialog.prototype.addTab = function(index, id, tabViewPage) { if (!this._tabContainer || !tabViewPage) { return null; } this._tabViews[index] = tabViewPage; this._tabKeys[index] = this._tabContainer.addTab(tabViewPage.getTitle(), tabViewPage); this._tabInUse[index] = true; this._tabKeyMap[id] = index; return this._tabKeys[index]; }; ZmFolderPropsDialog.prototype._initializeTabView = function(view) { this._tabContainer = new DwtTabView(view, null, Dwt.STATIC_STYLE); //ZmFolderPropertyView handle things such as color and type. (in case you're searching for "color" and can't find in this file. I know I did) this.addTab(0, ZmFolderPropsDialog.TABKEY_PROPERTIES, new ZmFolderPropertyView(this, this._tabContainer)); this.addTab(1, ZmFolderPropsDialog.TABKEY_RETENTION, new ZmFolderRetentionView(this, this._tabContainer)); // setup shares group if (appCtxt.get(ZmSetting.SHARING_ENABLED)) { this._sharesGroup = new DwtGrouper(view, "DwtGrouper ZmFolderPropSharing"); this._sharesGroup.setLabel(ZmMsg.folderSharing); this._sharesGroup.setVisible(false); this._sharesGroup.setScrollStyle(Dwt.SCROLL); view.getHtmlElement().appendChild(this._sharesGroup.getHtmlElement()); } }; // This creates the tab views managed by this dialog, the tabToolbar, and // the share buttons and view components ZmFolderPropsDialog.prototype._createView = function() { this._baseContainerView = new DwtComposite({parent:this, className:"ZmFolderPropertiesDialog-container "}); this._initializeTabView(this._baseContainerView); this.setView(this._baseContainerView); };
nico01f/z-pec
ZimbraWebClient/WebRoot/js/zimbraMail/share/view/dialog/ZmFolderPropsDialog.js
JavaScript
mit
14,081
[ 30522, 1013, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 4088, 6105, 3796, 1008, 1008, 1008, 1008, 1008, 1008, 1062, 5714, 10024, 5792, 7621, 4773, 7396, 1008, 9385, 1006, 1039, 1007, 2384, 1010, 2294, 1010, 2289, 1010, 2263, 1010, 2268, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# Lycopodium selago L. SPECIES #### Status SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in Sp. pl. 2:1102. 1753 #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Lycopodiophyta/Lycopodiopsida/Lycopodiales/Lycopodiaceae/Huperzia/Huperzia selago/ Syn. Lycopodium selago/README.md
Markdown
apache-2.0
193
[ 30522, 1001, 1048, 2100, 3597, 27633, 5007, 7367, 17802, 2080, 1048, 1012, 2427, 1001, 1001, 1001, 1001, 3570, 10675, 1001, 1001, 1001, 1001, 2429, 2000, 1996, 10161, 1997, 2166, 1010, 3822, 2254, 2249, 1001, 1001, 1001, 1001, 2405, 1999, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...