hexsha
stringlengths
40
40
size
int64
5
1.05M
ext
stringclasses
98 values
lang
stringclasses
21 values
max_stars_repo_path
stringlengths
3
945
max_stars_repo_name
stringlengths
4
118
max_stars_repo_head_hexsha
stringlengths
40
78
max_stars_repo_licenses
listlengths
1
10
max_stars_count
int64
1
368k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
3
945
max_issues_repo_name
stringlengths
4
118
max_issues_repo_head_hexsha
stringlengths
40
78
max_issues_repo_licenses
listlengths
1
10
max_issues_count
int64
1
134k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
3
945
max_forks_repo_name
stringlengths
4
135
max_forks_repo_head_hexsha
stringlengths
40
78
max_forks_repo_licenses
listlengths
1
10
max_forks_count
int64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
5
1.05M
avg_line_length
float64
1
1.03M
max_line_length
int64
2
1.03M
alphanum_fraction
float64
0
1
9c1a81fbd43cf0a6e2736c41b1519105b23bf48c
59
sql
SQL
migrations/structures/2014-11-23-stars.sql
dobesvac/nette-addons
cd1351422a881f47b7224f53f308e4c35204c83a
[ "BSD-3-Clause" ]
4
2015-04-14T06:29:14.000Z
2016-03-06T06:43:53.000Z
migrations/structures/2014-11-23-stars.sql
dobesvac/nette-addons
cd1351422a881f47b7224f53f308e4c35204c83a
[ "BSD-3-Clause" ]
42
2015-02-09T00:51:03.000Z
2018-11-17T17:15:21.000Z
migrations/structures/2014-11-23-stars.sql
dobesvac/nette-addons
cd1351422a881f47b7224f53f308e4c35204c83a
[ "BSD-3-Clause" ]
12
2015-01-17T03:22:29.000Z
2018-02-08T04:12:20.000Z
ALTER TABLE `addons` ADD `stars` int NOT NULL DEFAULT '0';
19.666667
37
0.711864
7bb3c4548ef5e7b55789aba5807335a8fb618858
2,390
rb
Ruby
lib/sneakers_honeypot.rb
honeypotio/sneakers_honeypot
0ea0b94a65865e19717b38ef3f40416537b468fd
[ "MIT" ]
2
2021-11-18T14:28:59.000Z
2022-03-06T21:27:55.000Z
lib/sneakers_honeypot.rb
honeypotio/sneakers_honeypot
0ea0b94a65865e19717b38ef3f40416537b468fd
[ "MIT" ]
null
null
null
lib/sneakers_honeypot.rb
honeypotio/sneakers_honeypot
0ea0b94a65865e19717b38ef3f40416537b468fd
[ "MIT" ]
null
null
null
# frozen_string_literal: true require 'uri' require 'sneakers' # rubocop:disable Style/Documentation module Sneakers module Worker def work(msg) klass_name = self.class.name start_time = Time.zone.now return_code = 200 ActiveRecord::Base.connection_pool.with_connection do perform(JSON.parse(msg, symbolize_names: true)) end ack! rescue StandardError return_code = 500 raise ensure duration = ((Time.zone.now - start_time) * 1000).round(0) return_txt = ::Rack::Utils::HTTP_STATUS_CODES[return_code] Rails.logger.info("Sneakers: Processing #{klass_name}#perform with payload \"#{msg}\" returned #{return_code} #{return_txt} and took #{duration}ms") end module ClassMethods def perform_async(payload) opts = payload.delete(:opts) || {} enqueue(payload.to_json, opts) true end end end end module Sneakers attr_reader :publisher def publish_message(key, payload, opts = {}) default_exchange = Sneakers::CONFIG[:exchange] exchange = opts[:exchange] || default_exchange Rails.logger.info("Sneakers: Sending AMQP message with key \"#{key}\" and payload \"#{payload.to_json}\" to \"#{exchange}\" exchange") if exchange == default_exchange Sneakers.publish(payload.to_json, routing_key: key) else config = Sneakers::CONFIG.to_hash.merge(opts) Sneakers.publisher.ensure_connection! exchange_instance = Sneakers.publisher.channel.exchange(config[:exchange], config[:exchange_options]) exchange_instance.publish(payload.to_json, options) end Rails.logger.info('Sneakers: Message sent!') true rescue Rails.logger.info("Sneakers: Message \"#{key}\" could not be delivered.") raise end end module Sneakers class Publisher attr_reader :bunny, :channel end end Sneakers.configure( amqp: ENV['CLOUDAMQP_URL'] || ENV['RABBITMQ_URL'] || ENV['AMQP_URL'] || 'amqp://guest:guest@localhost:5672', workers: (ENV['SNEAKERS_WORKERS'] || Sneakers::CONFIG[:workers]).to_i, threads: (ENV['SNEAKERS_THREADS'] || Sneakers::CONFIG[:threads]).to_i, prefetch: (ENV['SNEAKERS_PREFETCH'] || ENV['SNEAKERS_THREADS'] || Sneakers::CONFIG[:prefetch]).to_i, exchange_options: Sneakers::Configuration::EXCHANGE_OPTION_DEFAULTS.merge(type: :topic) ) # rubocop:enable Style/Documentation
30.641026
154
0.693724
90a76bec42a700814c3fa800dc409261172f2a9a
1,985
py
Python
packages/gtmcore/gtmcore/activity/monitors/rserver_exchange.py
gigabackup/gigantum-client
70fe6b39b87b1c56351f2b4c551b6f1693813e4f
[ "MIT" ]
60
2018-09-26T15:46:00.000Z
2021-10-10T02:37:14.000Z
packages/gtmcore/gtmcore/activity/monitors/rserver_exchange.py
gigabackup/gigantum-client
70fe6b39b87b1c56351f2b4c551b6f1693813e4f
[ "MIT" ]
1,706
2018-09-26T16:11:22.000Z
2021-08-20T13:37:59.000Z
packages/gtmcore/gtmcore/activity/monitors/rserver_exchange.py
griffinmilsap/gigantum-client
70fe6b39b87b1c56351f2b4c551b6f1693813e4f
[ "MIT" ]
11
2019-03-14T13:23:51.000Z
2022-01-25T01:29:16.000Z
import base64 import gzip import json from typing import Dict class RserverExchange: """Data-oriented class to simplify dealing with RStudio messages decoded from the MITM log Attributes are stored in a way that is ready for activity records. bytes get decoded, and images get base64-encoded. """ def __init__(self, raw_message: Dict): """Note, parsing may throw a json.JSONDecodeError (though it shouldn't!)""" self.path = raw_message['request']['path'].decode() self.request_headers = {k.decode(): v.decode() for k, v in raw_message['request']['headers']} request_text = raw_message['request']['content'] if request_text: self.request = json.loads(request_text.decode()) else: self.request = None self.response_headers = {k.decode(): v.decode() for k, v in raw_message['response']['headers']} self.response_type = self.response_headers.get('Content-Type') # This could get fairly resource intensive if our records get large, # but for now we keep things simple - all parsing happens in this class, and we can optimize later response_bytes = raw_message['response']['content'] if self.response_headers.get('Content-Encoding') == 'gzip': response_bytes = gzip.decompress(response_bytes) # Default response is empty string if self.response_type == 'application/json': # strict=False allows control codes, as used in tidyverse output self.response = json.loads(response_bytes.decode(), strict=False) elif self.response_type == 'image/png': self.response = base64.b64encode(response_bytes).decode('ascii') # if we actually wanted to work with the image, could do so like this: # img = Image.open(io.BytesIO(response_bytes)) elif response_bytes: self.response = '**unsupported**' else: self.response = ''
43.152174
106
0.655416
4776de64f3015940330d796a382c64e797998cae
8,556
kt
Kotlin
core/src/main/java/com/weexbox/core/controller/WBBaseActivity.kt
aygtech/weexbox-android-library
8f0961930d08bde2cea76dbe58bdc415bc989b9f
[ "MIT" ]
51
2018-11-01T10:09:35.000Z
2020-01-26T08:41:01.000Z
core/src/main/java/com/weexbox/core/controller/WBBaseActivity.kt
aygtech/weexbox-android-library
8f0961930d08bde2cea76dbe58bdc415bc989b9f
[ "MIT" ]
null
null
null
core/src/main/java/com/weexbox/core/controller/WBBaseActivity.kt
aygtech/weexbox-android-library
8f0961930d08bde2cea76dbe58bdc415bc989b9f
[ "MIT" ]
5
2019-03-20T01:13:21.000Z
2019-08-07T01:27:25.000Z
package com.weexbox.core.controller import android.content.Intent import android.os.Bundle import android.support.v4.app.Fragment import android.support.v7.app.AlertDialog import android.support.v7.app.AppCompatActivity import android.view.View import android.widget.EditText import android.widget.RelativeLayout import com.google.zxing.integration.android.IntentIntegrator import com.taobao.weex.WXEnvironment import com.taobao.weex.WXSDKEngine import com.taobao.weex.utils.LogLevel import com.weexbox.core.R import com.weexbox.core.WeexBoxEngine import com.weexbox.core.event.Event import com.weexbox.core.event.EventCallback import com.weexbox.core.extension.getParameters import com.weexbox.core.router.Router import com.weexbox.core.util.* import com.weexbox.core.widget.FloatingDraftButton import com.weexbox.core.widget.SimpleToolbar import kotlinx.android.synthetic.main.layout_floating_button.* import org.greenrobot.eventbus.EventBus import org.greenrobot.eventbus.Subscribe import org.greenrobot.eventbus.ThreadMode import java.util.* /** * Author: Mario * Time: 2018/8/14 下午6:39 * Description: This is WBBaseActivity */ open class WBBaseActivity : AppCompatActivity() { // 路由 var router = Router() // 通用事件 var events: MutableMap<String, EventCallback> = TreeMap() //导航栏 lateinit var toolbar: SimpleToolbar //没有导航栏时候的状态栏阴影 var statusbar_layout: View? = null //hud var loadDialogHelper: LoadDialogHelper = LoadDialogHelper(this) lateinit var floatingDraftButton: FloatingDraftButton // 通用事件 @Subscribe(threadMode = ThreadMode.MAIN) fun onEvent(event: Event) { val callback = events[event.name] callback?.invoke(event.info) } override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) EventBus.getDefault().register(this) ActivityManager.getInstance().addActivity(this) val intentRouter = intent.getSerializableExtra(Router.EXTRA_NAME) as Router? if (intentRouter != null) { router = intentRouter } } override fun onDestroy() { super.onDestroy() EventBus.getDefault().unregister(this) loadDialogHelper.clear() ActivityManager.getInstance().removeActivity(this) } override fun onBackPressed() { val fragment = getFragment() if (fragment != null && fragment.isListenBack) { fragment.onBackPressed() } else { super.onBackPressed() } } fun getFragment(): WBBaseFragment? { val fragments = supportFragmentManager.fragments return getRecursionFragment(fragments) } private fun getRecursionFragment(fragments: List<Fragment>): WBBaseFragment? { for (recursionFragment in fragments) { if (recursionFragment is WBBaseFragment && recursionFragment.isVisibleToUser) { return recursionFragment } else if (recursionFragment.childFragmentManager.fragments.size > 0) { getRecursionFragment(recursionFragment.childFragmentManager.fragments) } } return null } override fun setContentView(layoutResID: Int) { val container = layoutInflater.inflate(R.layout.activity_base, null) as RelativeLayout val view = layoutInflater.inflate(layoutResID, container, false) toolbar = layoutInflater.inflate(R.layout.activity_weex_title_layout, container, false) as SimpleToolbar val params = view.layoutParams as RelativeLayout.LayoutParams params.addRule(RelativeLayout.BELOW, R.id.toolbar) view.layoutParams = params container.addView(toolbar, 0) container.addView(view, 1) toolbar.setBackButton { finish() } if (!(router.navBarHidden)) { toolbar.setAcitionbarAndStatusbarVisibility(View.VISIBLE) } else { toolbar.setAcitionbarAndStatusbarVisibility(View.GONE) } toolbar.setTitleText(router.title) statusbar_layout = layoutInflater.inflate(R.layout.activity_statusbar_layout, container, false) if (statusbar_layout != null) { val layoutParams = statusbar_layout!!.layoutParams layoutParams.height = DeviceUtil.getStatusBarHeight(this) statusbar_layout!!.layoutParams = layoutParams container.addView(statusbar_layout, 2) } if (WeexBoxEngine.isDebug) { val btnView = layoutInflater.inflate(R.layout.layout_floating_button, container, false) container.addView(btnView, 3) } if (ActivityManager.getInstance().allActivities.size == 1) { toolbar.setBackButton({}, "") } if (router.type.equals(Router.Companion.TYPE_MODALMASK)){ StatusBarUtil.fullScreen(this) container.setBackgroundResource(R.color.transparent) } else{ container.setBackgroundResource(R.color.white) } setContentView(container) initFloating() } open fun showStatusbarLayoutBackground() { statusbar_layout?.setVisibility(View.VISIBLE) } open fun hideStatusbarLayoutBackground() { statusbar_layout?.setVisibility(View.GONE) } open fun getActionbar(): SimpleToolbar { return toolbar } override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) SelectImageUtil.onActivityResult(requestCode, resultCode, data, this) if (requestCode == IntentIntegrator.REQUEST_CODE) { val result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data) if (result != null) { if (result.contents != null) { openWeex(result.contents) } } } } /** * 处理devtool返回的DebugProxyUrl,WX启动devtool模式 * @param code */ private fun openWeex(url: String) { val parameters = url.getParameters() val devtoolUrl = parameters["_wx_devtool"] if (devtoolUrl != null) { // 连服务 WXEnvironment.sDebugServerConnectable = true WXEnvironment.sRemoteDebugProxyUrl = devtoolUrl WXSDKEngine.reload() } else if (url.startsWith("ws:")) { // 连热重载 HotReload.open(url) } else { // 连页面 openDebugWeex(url) } } private fun openDebugWeex(url: String) { val router = Router() router.name = Router.NAME_WEEX router.url = url router.open(this) } fun initFloating() { if (!WeexBoxEngine.isDebug) { return } floatingDraftButton = floatingButton floatingDraftButton.registerButton(camara_btn) floatingDraftButton.registerButton(refesh_btn) floatingDraftButton.registerButton(open_edit_btn) floatingDraftButton.setOnClickListener { //弹出动态Button AnimationUtil.slideButtons(this, floatingDraftButton) } camara_btn.setOnClickListener { //二维码扫描 AnimationUtil.slideButtons(this, floatingDraftButton) val integrator = IntentIntegrator(ActivityManager.getInstance().currentActivity()) integrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE) integrator.setPrompt("Scan a barcode") //integrator.setCameraId(0); // Use a specific camera of the device integrator.setBeepEnabled(true) integrator.setOrientationLocked(false) integrator.setBarcodeImageEnabled(true) integrator.initiateScan() } refesh_btn.setOnClickListener { //刷新 AnimationUtil.slideButtons(this, floatingDraftButton) val fragment = getFragment() if (fragment is WBWeexFragment) { fragment.refreshWeex() } } open_edit_btn.setOnClickListener { AnimationUtil.slideButtons(this, floatingDraftButton) openDialog() } } private fun openDialog() { val editText = EditText(this) val inputDialog = AlertDialog.Builder(this) editText.hint = "page/home.js" inputDialog.setTitle("请输入weex路径").setView(editText) inputDialog.setPositiveButton("确定") { _, _ -> val url = editText.text.toString() openDebugWeex(url) }.show() } }
34.639676
112
0.660238
76d2aa924fc641dddf4e5071f146fc7ed9fae45b
530
h
C
src/page_spec.h
maxim2266/OCR
7d9a0d625d113a9def5843f525cc1d2d4aba7849
[ "BSD-3-Clause" ]
14
2020-03-29T21:59:07.000Z
2022-03-25T01:48:04.000Z
src/page_spec.h
maxim2266/OCR
7d9a0d625d113a9def5843f525cc1d2d4aba7849
[ "BSD-3-Clause" ]
null
null
null
src/page_spec.h
maxim2266/OCR
7d9a0d625d113a9def5843f525cc1d2d4aba7849
[ "BSD-3-Clause" ]
null
null
null
#pragma once #include "utils.h" // range of pages typedef struct { unsigned first, last; } page_range; // max. page number #define MAX_PAGE_NO 9999 // page specification typedef struct { size_t len, cap; page_range ranges[]; } page_spec; // page spec functions page_spec* parse_page_spec(const char* s); #define free_page_spec(spec) mem_free((void*)(spec)) char* page_spec_to_string(const page_spec* const spec, size_t* const plen); const page_range* find_page_range(const page_spec* const spec, const unsigned page_no);
19.62963
87
0.756604
858be1b852be7eb23636113720294a8b878dca27
1,019
js
JavaScript
resources/js/components/confirm-dialog.js
na3shkw/BookStack
3a8a476906d68725407ba730ac0724d5c1522bdf
[ "MIT" ]
1
2022-01-10T12:29:18.000Z
2022-01-10T12:29:18.000Z
resources/js/components/confirm-dialog.js
na3shkw/BookStack
3a8a476906d68725407ba730ac0724d5c1522bdf
[ "MIT" ]
null
null
null
resources/js/components/confirm-dialog.js
na3shkw/BookStack
3a8a476906d68725407ba730ac0724d5c1522bdf
[ "MIT" ]
3
2022-01-20T20:58:13.000Z
2022-03-10T17:36:22.000Z
import {onSelect} from "../services/dom"; /** * Custom equivalent of window.confirm() using our popup component. * Is promise based so can be used like so: * `const result = await dialog.show()` * @extends {Component} */ class ConfirmDialog { setup() { this.container = this.$el; this.confirmButton = this.$refs.confirm; this.res = null; onSelect(this.confirmButton, () => { this.sendResult(true); this.getPopup().hide(); }); } show() { this.getPopup().show(null, () => { this.sendResult(false); }); return new Promise((res, rej) => { this.res = res; }); } /** * @returns {Popup} */ getPopup() { return this.container.components.popup; } /** * @param {Boolean} result */ sendResult(result) { if (this.res) { this.res(result) this.res = null; } } } export default ConfirmDialog;
19.596154
67
0.511286
f02d76a5fd8b5ecfd2e0de43f20b301ddaf039ba
2,294
py
Python
automate_insurance_pricing/preprocessing/descriptive_functions.py
nassmim/automate-insurance-pricing-nezz
7a1cc48be9fb78bdadbbf7616fb01d4d6429e06c
[ "MIT" ]
2
2021-11-09T15:47:22.000Z
2021-11-14T13:54:56.000Z
automate_insurance_pricing/preprocessing/descriptive_functions.py
nassmim/automate-insurance-pricing-nezz
7a1cc48be9fb78bdadbbf7616fb01d4d6429e06c
[ "MIT" ]
null
null
null
automate_insurance_pricing/preprocessing/descriptive_functions.py
nassmim/automate-insurance-pricing-nezz
7a1cc48be9fb78bdadbbf7616fb01d4d6429e06c
[ "MIT" ]
1
2021-07-09T04:12:57.000Z
2021-07-09T04:12:57.000Z
import pandas as pd def derive_termination_rate_year(df, start_business_year, extraction_year, main_column_contract_date, policy_id_column_name, column_to_sum_name): """Derives the contracts termination rates per year Arguments --> the dataframe, the business starting year, the extraction year the contracts start date and policy ids and the cancellation columns names Returns --> a dictionnary with the termination rates per year and the overall one """ df_previous_year = df[df[main_column_contract_date].dt.year == start_business_year].drop_duplicates(subset=policy_id_column_name, keep='first') policies_previous_year = df_previous_year[policy_id_column_name] termination_rates = {} gwp_year = df_previous_year[column_to_sum_name].sum() total_gwp = gwp_year weighted_rates = 0 for year in range(start_business_year+1, extraction_year+1): df_next_year = df[df[main_column_contract_date].dt.year == year].drop_duplicates(subset=policy_id_column_name, keep='first') policies_next_year = df_next_year[policy_id_column_name] policies_from_previous_year = df_next_year[df_next_year[policy_id_column_name].isin(policies_previous_year)] termination_rate = (len(policies_previous_year) - len(policies_from_previous_year)) / len(policies_previous_year) termination_rates[year-1] = termination_rate weighted_rates += termination_rate * gwp_year gwp_year = df_next_year[column_to_sum_name].sum() total_gwp += gwp_year policies_previous_year = policies_next_year termination_rates['weighted_average'] = weighted_rates / total_gwp return termination_rates def create_df_unique_values(df, features): """ Gets the unique values of features and the number of these unique values (mainly useful for categorical feature) Arguments --> the dataframe and the list of features (either a list or a string) Returns --> A new df with features and number of unique values for each """ df_feature_unique_values = pd.DataFrame.from_dict({'feature': features, 'number_of_uniques': df[features].nunique().values}) return df_feature_unique_values.reset_index()
46.816327
148
0.735397
b2fcf5fc344b109dbc4a9623cb76fea9e977c60b
3,417
py
Python
tests/test_domain.py
shyams2/pychebfun
0c1efee54829457b9e1b0d6c34259af6c002e105
[ "BSD-3-Clause" ]
72
2015-02-23T17:08:38.000Z
2022-02-09T18:17:08.000Z
tests/test_domain.py
shyams2/pychebfun
0c1efee54829457b9e1b0d6c34259af6c002e105
[ "BSD-3-Clause" ]
6
2015-01-19T14:12:23.000Z
2021-11-05T08:16:27.000Z
tests/test_domain.py
shyams2/pychebfun
0c1efee54829457b9e1b0d6c34259af6c002e105
[ "BSD-3-Clause" ]
14
2015-07-31T00:08:36.000Z
2021-02-01T22:20:41.000Z
#!/usr/bin/env python # coding: UTF-8 from __future__ import division from pychebfun import Chebfun import operator import unittest import pytest from . import tools import numpy as np import numpy.testing as npt #------------------------------------------------------------------------------ # Unit test for arbitrary interval Chebfuns #------------------------------------------------------------------------------ class TestDomain(unittest.TestCase): def test_mismatch(self): c1 = Chebfun.identity() c2 = Chebfun.from_function(lambda x:x, domain=[2,3]) for op in [operator.add, operator.sub, operator.mul, operator.truediv]: with self.assertRaises(Chebfun.DomainMismatch): op(c1, c2) def test_restrict(self): x = Chebfun.identity() with self.assertRaises(ValueError): x.restrict([-2,0]) with self.assertRaises(ValueError): x.restrict([0,2]) @pytest.mark.parametrize("ufunc", tools.ufunc_list, ids=tools.name_func) def test_init(ufunc): xx = Chebfun.from_function(lambda x: x,[0.25,0.75]) ff = ufunc(xx) assert isinstance(ff, Chebfun) result = ff.values() expected = ufunc(ff._ui_to_ab(ff.p.xi)) npt.assert_allclose(result, expected) #------------------------------------------------------------------------------ # Test the restrict operator #------------------------------------------------------------------------------ from . import data @pytest.mark.parametrize('ff', [Chebfun.from_function(tools.f,[-3,4])]) @pytest.mark.parametrize('domain', data.IntervalTestData.domains) def test_restrict(ff, domain): ff_ = ff.restrict(domain) xx = tools.map_ui_ab(tools.xs, domain[0],domain[1]) tools.assert_close(tools.f, ff_, xx) #------------------------------------------------------------------------------ # Add the arbitrary interval tests #------------------------------------------------------------------------------ @pytest.fixture(params=list(range(5))) def tdata(request): index = request.param class TData(): pass tdata = TData() tdata.function = data.IntervalTestData.functions[0] tdata.function_d = data.IntervalTestData.first_derivs[0] tdata.domain = data.IntervalTestData.domains[index] tdata.roots = data.IntervalTestData.roots[0][index] tdata.integral = data.IntervalTestData.integrals[0][index] tdata.chebfun = Chebfun.from_function(tdata.function, tdata.domain) return tdata class TestArbitraryIntervals(object): """Test the various operations for Chebfun on arbitrary intervals""" def test_evaluation(self, tdata): xx = tools.map_ui_ab(tools.xs, tdata.domain[0], tdata.domain[1]) tools.assert_close(tdata.chebfun, tdata.function, xx) def test_domain(self, tdata): assert tdata.chebfun._domain[0] == tdata.domain[0] assert tdata.chebfun._domain[1] == tdata.domain[1] def test_first_deriv(self, tdata): xx = tools.map_ui_ab(tools.xs, tdata.domain[0], tdata.domain[1]) tools.assert_close(tdata.chebfun.differentiate(), tdata.function_d, xx) def test_definite_integral(self, tdata): actual = tdata.integral npt.assert_allclose(tdata.chebfun.sum(), actual, rtol=1e-12) def test_roots(self, tdata): actual = tdata.roots npt.assert_allclose(np.sort(tdata.chebfun.roots()), actual, rtol=1e-12)
33.831683
79
0.59643
fba235810b5444b3f989374a7306dcf4c7c41794
1,074
c
C
MS/Projects/Project4/4.1.8/main.c
matheuscr30/UFU
e947e5a4ccd5c025cb8ef6e00b42ea1160742712
[ "MIT" ]
null
null
null
MS/Projects/Project4/4.1.8/main.c
matheuscr30/UFU
e947e5a4ccd5c025cb8ef6e00b42ea1160742712
[ "MIT" ]
11
2020-01-28T22:59:24.000Z
2022-03-11T23:59:04.000Z
MS/Projects/Project4/4.1.8/main.c
matheuscr30/UFU
e947e5a4ccd5c025cb8ef6e00b42ea1160742712
[ "MIT" ]
null
null
null
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <locale.h> #include "rngs.h" #include "rngs.c" double Exponential(double m) { return (-m * log(1.0 - Random())); } double sampleMean(double *sample, int j) { int i; double mean = 0; for(i=0; i<j; i++) { mean+= sample[i]; } return (mean/j); } double sampleStandartDeviation(double *sample, double mean, int j) { int i; double variance = 0; for(i=0; i<j; i++) { variance+= pow(sample[i] - mean, 2); } variance = variance/j; return sqrt(variance); } int main() { FILE *f; f = fopen("file.txt", "w"); int n = 0; double mean = 0, v = 0.0, s, x, d; PlantSeeds(11111); while(n <= 100) { x = Exponential(17); n++; d = x - mean; v = v + d * d * (n-1)/n; mean += d/n; fprintf(f, "%d %.2lf %.2lf %.2lf\n", n, x, mean, sqrt(v/n)); } s = sqrt(v / n); fclose(f); return 0; }
16.029851
69
0.459963
c3ac9733717b943e174fc62a8d15781d97a70aa0
1,534
go
Go
utils/comparator.go
monitor1379/yagods
788991617987c926c5a5efdfd01039cd0eac6511
[ "BSD-2-Clause" ]
3
2022-03-30T12:48:18.000Z
2022-03-31T02:55:27.000Z
utils/comparator.go
monitor1379/yagods
788991617987c926c5a5efdfd01039cd0eac6511
[ "BSD-2-Clause" ]
null
null
null
utils/comparator.go
monitor1379/yagods
788991617987c926c5a5efdfd01039cd0eac6511
[ "BSD-2-Clause" ]
2
2022-03-30T12:48:23.000Z
2022-03-30T13:56:32.000Z
// Copyright (c) 2022, Zhenpeng Deng & Emir Pasic. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package utils import "time" // Comparator will make type assertion (see NumberComparator for example), // which will panic if a or b are not of the asserted type. // // Should return a number: // negative , if a < b // zero , if a == b // positive , if a > b type Comparator[T any] func(a, b T) int var _ Comparator[int32] = NumberComparator[int32] var _ Comparator[string] = StringComparator var _ Comparator[time.Time] = TimeComparator type Number interface { ~int | ~int8 | ~int16 | ~int32 | ~int64 | ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~float32 | ~float64 } func NumberComparator[T Number](a, b T) int { switch { case a > b: return 1 case a < b: return -1 } return 0 } // StringComparator provides a fast comparison on strings func StringComparator(a, b string) int { s1 := a s2 := b min := len(s2) if len(s1) < len(s2) { min = len(s1) } diff := 0 for i := 0; i < min && diff == 0; i++ { diff = int(s1[i]) - int(s2[i]) } if diff == 0 { diff = len(s1) - len(s2) } if diff < 0 { return -1 } if diff > 0 { return 1 } return 0 } // TimeComparator provides a basic comparison on time.Time func TimeComparator(a, b time.Time) int { aAsserted := a bAsserted := b switch { case aAsserted.After(bAsserted): return 1 case aAsserted.Before(bAsserted): return -1 default: return 0 } }
20.72973
109
0.646675
7b891351a9e1af76b25585b69c8f0f0b369a02e7
3,082
css
CSS
public/css/arcadiaStyle.css
BlasTails/test
065ac953946800cd10471a4d942908c41bc24434
[ "MIT" ]
null
null
null
public/css/arcadiaStyle.css
BlasTails/test
065ac953946800cd10471a4d942908c41bc24434
[ "MIT" ]
null
null
null
public/css/arcadiaStyle.css
BlasTails/test
065ac953946800cd10471a4d942908c41bc24434
[ "MIT" ]
null
null
null
@import url(https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css); @import url(https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.4.3/css/mdb.min.css); /* Makes text all the same, but there is a problem when you click into the text fields for the sign in or register. I think it conflicts with the existing colour changes in this CSS file */ /****************************************************************************************************/ /* Navigation Bar */ /****************************************************************************************************/ #body { background-color: white; } #mainNav { min-height: 56px; background-color: white; /*background-color: #F4DD08;*/ /*background-image: linear-gradient(to bottom, #FFF50F, #FFFEF1);*/ } #mainNav .navbar-toggler { font-size: 80%; padding: 0.75rem; color: #64a19d; border: 1px solid #64a19d; } .home-container { padding-top: 2.5%; padding-left: 25%; padding-right: 25%; /*background-image: url("../img/light.jpeg");*/ background-image: url("f"); } .sss { padding-top: 2.5%; padding-left: 25%; padding-right: 25%; /*background-image: url("../img/light.jpeg");*/ } .masthead { position: relative; width: 100%; height: 1000px; padding: 15rem 0; /*background-color: #FFFEF1;*/ /*background-image: url("../img/blur-crowd-indoors-950902.jpeg");*/ background-image: url("https://i.imgur.com/QVdxjeQ.png"); background-position: center; background-repeat: no-repeat; background-attachment: scroll; background-size: cover; } footer { padding: 2rem 0; } /****************************************************************************************************************************/ /* Form / /****************************************************************************************************************************/ * {box-sizing: border-box} /* Add padding to containers */ .containerform{ padding: 16px; width: 650px; } /* Full-width input fields */ input[type=text], input[type=password] { width: 100%; padding: 15px; margin: 5px 0 22px 0; display: inline-block; border: none; background: #f1f1f1; } input[type=text]:focus, input[type=password]:focus { background-color: #ddd; outline: none; } /* Overwrite default styles of hr */ hr { border: 1px solid #f1f1f1; margin-bottom: 25px; } /* Set a style for the submit/register button */ .registerbtn { /*background-color: #4CAF50;*/ background-color: #F4DD08; color: black; padding: 16px 20px; margin: 8px 0; border: none; cursor: pointer; width: 100%; opacity: 0.9; } .registerbtn:hover { opacity:1; } /* Add a blue text color to links */ a { color: dodgerblue; } /* Set a grey background color and center the text of the "sign in" section */ .signin { background-color: #f1f1f1; text-align: center; }
24.460317
126
0.524984
40d14f1a984c39415881386132e7966247fc2722
4,431
py
Python
utils/imutils.py
Youwang-Kim/sds-dataset
2adfe38d27fcd6cf9c32984a12bc48aa66e69636
[ "MIT" ]
null
null
null
utils/imutils.py
Youwang-Kim/sds-dataset
2adfe38d27fcd6cf9c32984a12bc48aa66e69636
[ "MIT" ]
null
null
null
utils/imutils.py
Youwang-Kim/sds-dataset
2adfe38d27fcd6cf9c32984a12bc48aa66e69636
[ "MIT" ]
null
null
null
import numpy as np from skimage.transform import resize import cv2 import math import torch import torchvision import torchvision.transforms as transforms def read_cv2_img(path): """ Read color images :param path: Path to image :return: Only returns color images """ img = cv2.imread(path, 1) img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) return img def random_crop_range(crop_min=0.5, crop_max=0.7): while True: rand_nums = torch.rand(2) crop_range = torch.abs(rand_nums[0]-rand_nums[1]) if crop_min <= crop_range <= crop_max: break return crop_range def random_crop(img): h,w,_ = np.shape(img) h_crop_range = random_crop_range() h_size = math.ceil(h*h_crop_range) w_crop_range = random_crop_range() w_size = math.ceil(w * w_crop_range) i,j,h,w = transforms.RandomCrop.get_params(transforms.ToPILImage()(img), output_size=(h_size, w_size)) cropped_img = torchvision.transforms.functional.crop(transforms.ToPILImage()(img),i,j,h,w) #crop_oper = transforms.RandomCrop((h_size, w_size)) #cropped_img = crop_oper(transforms.ToPILImage()(img)) cropped_img = transforms.ToTensor()(cropped_img) return cropped_img, [i,j,h,w] def flip_img(img): """Flip rgb images or masks. channels come last, e.g. (256,256,3). """ img = np.fliplr(img) return img def get_transform(center, scale, res, rot=0): """Generate transformation matrix.""" h = 200 * scale t = np.zeros((3, 3)) t[0, 0] = float(res[1]) / h t[1, 1] = float(res[0]) / h t[0, 2] = res[1] * (-float(center[0]) / h + .5) t[1, 2] = res[0] * (-float(center[1]) / h + .5) t[2, 2] = 1 if not rot == 0: rot = -rot # To match direction of rotation from cropping rot_mat = np.zeros((3, 3)) rot_rad = rot * np.pi / 180 sn, cs = np.sin(rot_rad), np.cos(rot_rad) rot_mat[0, :2] = [cs, -sn] rot_mat[1, :2] = [sn, cs] rot_mat[2, 2] = 1 # Need to rotate around center t_mat = np.eye(3) t_mat[0, 2] = -res[1] / 2 t_mat[1, 2] = -res[0] / 2 t_inv = t_mat.copy() t_inv[:2, 2] *= -1 t = np.dot(t_inv, np.dot(rot_mat, np.dot(t_mat, t))) return t def transform(pt, center, scale, res, invert=0, rot=0): """Transform pixel location to different reference.""" t = get_transform(center, scale, res, rot=rot) if invert: t = np.linalg.inv(t) new_pt = np.array([pt[0] - 1, pt[1] - 1, 1.]).T new_pt = np.dot(t, new_pt) return new_pt[:2].astype(int) + 1 def crop(img, center, scale, res, rot=0): """Crop image according to the supplied bounding box.""" # Upper left point ul = np.array(transform([1, 1], center, scale, res, invert=1)) - 1 # Bottom right point br = np.array(transform([res[0] + 1, res[1] + 1], center, scale, res, invert=1)) - 1 # Padding so that when rotated proper amount of context is included pad = int(np.linalg.norm(br - ul) / 2 - float(br[1] - ul[1]) / 2) if not rot == 0: ul -= pad br += pad new_shape = [br[1] - ul[1], br[0] - ul[0]] if len(img.shape) > 2: new_shape += [img.shape[2]] new_img = np.zeros(new_shape) # Range to fill new array new_x = max(0, -ul[0]), min(br[0], len(img[0])) - ul[0] new_y = max(0, -ul[1]), min(br[1], len(img)) - ul[1] # Range to sample from original image old_x = max(0, ul[0]), min(len(img[0]), br[0]) old_y = max(0, ul[1]), min(len(img), br[1]) new_img[new_y[0]:new_y[1], new_x[0]:new_x[1]] = img[old_y[0]:old_y[1], old_x[0]:old_x[1]] # if not rot == 0: # # Remove padding # #new_img = scipy.misc.imrotate(new_img, rot) # new_img = rotate(new_img, rot) # new_img = new_img[pad:-pad, pad:-pad] # new_img = scipy.misc.imresize(new_img, res) new_img = resize(new_img, res) return new_img def rgb_processing(rgb_img, center, scale, flip, rot=0): """"Process rgb image and do augmentation.""" img_res = [224, 224] rgb_img = crop(rgb_img, center, scale, img_res, rot=rot) # flip the image if flip: rgb_img = flip_img(rgb_img) # in the rgb image we add pixel noise in a channel-wise manner # (3,224,224),float,[0,1] rgb_img = np.transpose(rgb_img.astype('float32'), (2, 0, 1)) / 255.0 return rgb_img
32.580882
106
0.59332
8ac2ea3122ed1758ad80d64fc2f81772bced052c
1,407
sql
SQL
src/main/java/db/migration/V8__.sql
kwery/kwery
a4a9586b2a065706ce80fc40019bd6bef8869f92
[ "MIT" ]
11
2018-07-09T17:37:59.000Z
2021-01-25T13:59:26.000Z
src/main/java/db/migration/V8__.sql
kwery/kwery
a4a9586b2a065706ce80fc40019bd6bef8869f92
[ "MIT" ]
4
2018-07-26T06:37:56.000Z
2018-09-20T11:42:05.000Z
src/main/java/db/migration/V8__.sql
kwery/kwery
a4a9586b2a065706ce80fc40019bd6bef8869f92
[ "MIT" ]
4
2018-06-11T09:22:06.000Z
2021-04-09T12:33:57.000Z
alter table smtp_configuration add column use_local_setting boolean; update smtp_configuration set use_local_setting=false; create table url_configuration ( id integer generated by default as identity (START WITH 100, INCREMENT BY 1), scheme varchar(5) not null, domain varchar(253) not null, port integer not null check (port>=1), primary key (id) ); create table job_failure_alert_email ( id integer generated by default as identity (START WITH 100, INCREMENT BY 1), job_id_fk integer, email varchar(256), unique (job_id_fk, email) ); alter table job_failure_alert_email add constraint fk_job_failure_alert_email_job_id_fk foreign key (job_id_fk) references job; create table sql_query_email_setting ( id integer generated by default as identity (START WITH 100, INCREMENT BY 1), email_body_include boolean not null, email_attachment_include boolean not null, primary key (id) ); create table sql_query_sql_query_email_setting ( id integer generated by default as identity (START WITH 100, INCREMENT BY 1), sql_query_id_fk integer not null constraint fk_sql_query_sql_query_email_setting_sql_query_id_fk references sql_query, sql_query_email_setting_id_fk integer not null CONSTRAINT fk_sql_query_sql_query_email_setting_sql_query_email_setting_id_fk references sql_query_email_setting, primary key (id), unique(sql_query_id_fk, sql_query_email_setting_id_fk) );
39.083333
162
0.816631
5fa9ca2ec454684e8820685a95491446dbe3ab4a
11,563
h
C
sgf/3.0/headers/Gamecore/mugen/Ast/Section.h
rasputtim/SGPacMan
b0fd33f0951a42625a391383b4d1bd378391493c
[ "BSD-2-Clause" ]
null
null
null
sgf/3.0/headers/Gamecore/mugen/Ast/Section.h
rasputtim/SGPacMan
b0fd33f0951a42625a391383b4d1bd378391493c
[ "BSD-2-Clause" ]
null
null
null
sgf/3.0/headers/Gamecore/mugen/Ast/Section.h
rasputtim/SGPacMan
b0fd33f0951a42625a391383b4d1bd378391493c
[ "BSD-2-Clause" ]
null
null
null
/* SGF - Salvat Game Fabric (https://sourceforge.net/projects/sgfabric/) Copyright (C) 2010-2011 Salvatore Giannotta Filho <a_materasu@hotmail.com> 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef _S_G_E_section_h_ #define _S_G_E_section_h_ #include <stdio.h> #include <map> #include <list> #include <string> #include <iostream> #include <string> #include <stdlib.h> #include "attribute.h" #include "attribute-simple.h" #include "Value.h" #include "exception.h" #include "ast.h" using namespace std; namespace SGF{ namespace Ast{ class CWalker; class SGE_API CSection: public CElement { public: static string SERIAL_SECTION_ATTRIBUTE; static string SERIAL_SECTION_VALUE; CSection(const string * name): name(name){ if (name == 0){ cerr << "[" << __FILE__ << ": " << __LINE__ << "] Cannot create a section with an empty name" << endl; exit(-1); } } enum WalkList{ WalkAttribute, WalkValue, }; virtual void walk(CWalker & walker){ Debug::debug(Debug::parsers,__FUNCTION__) << "Starting Walking on Section: " << this->getName() << endl; walker.onSection(*this); list<CAttribute*>::iterator attribute_it = attributes.begin(); list<CValue*>::iterator value_it = values.begin(); /* walk values in the order they came in. hopefully the number of values in the * walkList are the same number of items in the attributes+values lists. * I mean this should be the case since the only operations done to those lists * is adding elements. No one ever removes them. */ for (list<WalkList>::iterator it = walkList.begin(); it != walkList.end(); it++){ WalkList what = *it; switch (what){ case WalkAttribute : { CAttribute * attribute = *attribute_it; Debug::debug(Debug::parsers,__FUNCTION__) << " Walking on Section Attribute: " << attribute->toString() << endl; attribute->walk(walker); attribute_it++; break; } case WalkValue : { CValue * value = *value_it; Debug::debug(Debug::parsers,__FUNCTION__) << "Walking on Section value: "<< value->toString()<< " // of Type: " << value->getType() << endl; value->walk(walker); value_it++; break; } } } /* for (list<CAttribute*>::iterator it = attributes.begin(); it != attributes.end(); it++){ CAttribute * attribute = *it; attribute->walk(walker); } for (list<CValue*>::iterator it = values.begin(); it != values.end(); it++){ CValue * value = *it; value->walk(walker); } */ walker.onSectionFinished(*this); } string getName() const { return *name; } virtual CValue * getFirstValue() { list<CValue*>::iterator value_it = values.begin(); return *value_it; } virtual list<CValue*> * getValues() { return &values; } void addAttribute(CAttribute * attribute){ attributes.push_back(attribute); walkList.push_back(WalkAttribute); } template <class Thing> static bool checkEquality(const list<Thing*> & my_list, const list<Thing*> & him_list){ typename list<Thing*>::const_iterator my_it = my_list.begin(); typename list<Thing*>::const_iterator him_it = him_list.begin(); while (true){ if (my_it == my_list.end() || him_it == him_list.end()){ break; } Thing * mine = *my_it; Thing * him = *him_it; if (*mine != *him){ return false; } my_it++; him_it++; } return my_it == my_list.end() && him_it == him_list.end(); } using CElement::operator==; virtual bool operator==(const CSection & him) const { if (this == &him){ return true; } return checkEquality(attributes, him.attributes) && checkEquality(values, him.values); } virtual CElement * copy() const { CSection * out = new CSection(new string(getName())); out->walkList = walkList; for (list<CAttribute*>::const_iterator attribute_it = attributes.begin(); attribute_it != attributes.end(); attribute_it++){ out->attributes.push_back((CAttribute*) (*attribute_it)->copy()); } for (list<CValue*>::const_iterator value_it = values.begin(); value_it != values.end(); value_it++){ out->values.push_back((CValue*) (*value_it)->copy()); } return out; } const list<CAttribute *> & getAttributes() const { return attributes; } void addValue(CValue * value){ values.push_back(value); walkList.push_back(WalkValue); } virtual Token * serialize() const { Token * token = new Token(); *token << SERIAL_SECTION_LIST << getName(); list<CAttribute*>::const_iterator attribute_it = attributes.begin(); list<CValue*>::const_iterator value_it = values.begin(); for (list<WalkList>::const_iterator it = walkList.begin(); it != walkList.end(); it++){ WalkList what = *it; switch (what){ case WalkAttribute : { CAttribute * attribute = *attribute_it; Token * next = token->newToken(); *next << SERIAL_SECTION_ATTRIBUTE << attribute->serialize(); attribute_it++; break; } case WalkValue : { CValue * value = *value_it; Token * next = token->newToken(); *next << SERIAL_SECTION_VALUE << value->serialize(); value_it++; break; } } } return token; } static CSection * deserialize(const Token * token){ const Token * next; string name; TokenView view = token->view(); view >> name; CSection * section = new CSection(new string(name)); while (view.hasMore()){ view >> next; if (*next == SERIAL_SECTION_ATTRIBUTE){ const Token * attribute; next->view() >> attribute; section->addAttribute(CAttribute::deserialize(attribute)); } else if (*next == SERIAL_SECTION_VALUE){ const Token * value; next->view() >> value; section->addValue(CValue::deserialize(value)); } else { throw CException("Can't deserialize " + next->getName()); } } return section; } string toString(){ ::std::ostringstream out; out << "[" << *name << "]" << endl; list<CAttribute*>::iterator attribute_it = attributes.begin(); list<CValue*>::iterator value_it = values.begin(); for (list<WalkList>::iterator it = walkList.begin(); it != walkList.end(); it++){ WalkList what = *it; switch (what){ case WalkAttribute : { CAttribute * attribute = *attribute_it; out << attribute->toString() << endl; attribute_it++; break; } case WalkValue : { CValue * value = *value_it; out << value->toString() << endl; value_it++; break; } } } return out.str(); } void debugExplain() { // printf("[%s]\n", stringData.c_str()); //cout << "[" << *name << "]" << endl; Debug::debug(Debug::parsers,__FUNCTION__) << "Section Name :" <<*name <<endl; if(!values.empty()) { Debug::debug(Debug::parsers,__FUNCTION__) << " values for section: " <<*name <<endl; for (list<CValue*>::iterator it = values.begin(); it != values.end(); it++){ CValue * value = *it; value->debugExplain(); } } if(!attributes.empty()) { Debug::debug(Debug::parsers,__FUNCTION__) << " attributes for Section: " <<*name <<endl; for (list<CAttribute*>::iterator it = attributes.begin(); it != attributes.end(); it++){ CAttribute * attribute = *it; attribute->debugExplain(); } } } virtual CAttributeSimple * findAttribute(const string & find) const { for (list<CAttribute*>::const_iterator attribute_it = getAttributes().begin(); attribute_it != getAttributes().end(); attribute_it++){ CAttribute * attribute = *attribute_it; if (attribute->getKind() == CAttribute::Simple){ CAttributeSimple * simple = (CAttributeSimple*) attribute; if (*simple == find){ return simple; } } } throw CException("Could not find attribute " + find + " in section " + getName()); } /* mark phase of garbage collection. all live pointers are marked 'true' */ virtual void mark(map<const void*, bool> & marks) const { marks[this] = true; marks[name] = true; for (list<CAttribute*>::const_iterator it = attributes.begin(); it != attributes.end(); it++){ CAttribute * attribute = *it; attribute->mark(marks); } for (list<CValue*>::const_iterator it = values.begin(); it != values.end(); it++){ CValue * value = *it; value->mark(marks); } } /* virtual bool referenced(const void * value) const { if (value == this){ return true; } if (value == name){ return true; } for (list<CAttribute*>::const_iterator it = attributes.begin(); it != attributes.end(); it++){ CAttribute * attribute = *it; if (attribute->referenced(value)){ return true; } } for (list<CValue*>::const_iterator it = values.begin(); it != values.end(); it++){ CValue * v = *it; if (v->referenced(value)){ return true; } } return false; } */ virtual ~CSection(){ delete name; for (list<CAttribute*>::iterator it = attributes.begin(); it != attributes.end(); it++){ delete *it; } for (list<CValue*>::iterator it = values.begin(); it != values.end(); it++){ delete *it; } } private: const string * name; list<CAttribute *> attributes; list<CValue *> values; list<WalkList> walkList; }; } //end AST } //end SGF #endif
32.849432
145
0.543544
a18c3cad5bf5417994545682fe64ec3c3642babb
1,219
h
C
src/include/picon/i2c.h
efzedvi/picon
a36749f5ab70245a148097bf39bc834763de9d3b
[ "BSD-3-Clause" ]
null
null
null
src/include/picon/i2c.h
efzedvi/picon
a36749f5ab70245a148097bf39bc834763de9d3b
[ "BSD-3-Clause" ]
null
null
null
src/include/picon/i2c.h
efzedvi/picon
a36749f5ab70245a148097bf39bc834763de9d3b
[ "BSD-3-Clause" ]
null
null
null
/** * @author : faraz * @file : i2c.h * @created : Wed 05 Jan 2022 06:16:46 PM EST */ /* * Copyright (c) 2022 Faraz V faraz@fzv.ca. * * SPDX-License-Identifier: BSD-3-Clause */ #ifndef I2C_H #define I2C_H #include "picon/dev.h" #define PICON_I2C_STANDARD_100K (100000) #define PICON_I2C_FAST_400K (400000) typedef struct _i2c_cfg_t { uint32_t speed; int8_t scl; int8_t sda; } i2c_cfg_t; // Addresses of the form 000 0xxx or 111 1xxx are reserved. No slave should // have these addresses. #define I2C_RESERVED_ADDR(addr) (((addr) & 0x78) == 0 || ((addr) & 0x78) == 0x78) int picon_i2c_init(uint8_t ux, void *params); const void *picon_i2c_open(const DEVICE_FILE *devf, int flags); int picon_i2c_ioctl(const DEVICE_FILE *devf, unsigned int request, void *data); int picon_i2c_close(const DEVICE_FILE *devf); #define I2C_DEV \ &(DEVICE)\ { .init = picon_i2c_init,\ .open = picon_i2c_open,\ .close = picon_i2c_close,\ .read = NULL,\ .write = NULL,\ .pread = NULL,\ .pwrite= NULL,\ .ioctl = picon_i2c_ioctl,\ .lseek = NULL,\ .sendto = NULL,\ .recvfrom = NULL,\ .fsync = NULL,\ .flags = DEV_FLAG_SERIALIZE \ } #endif /* end of include guard I2C_H */
21.767857
82
0.665299
47b268b667bdc90ce24a697416b17a449fb3a285
437
swift
Swift
Example/ClassicClient-Example/Achievements/AchievementHeaderCell.swift
JustinLycklama/ClassicClientiOS
c663fe85dcffe647b8d7baf393c520e95a524af9
[ "MIT" ]
null
null
null
Example/ClassicClient-Example/Achievements/AchievementHeaderCell.swift
JustinLycklama/ClassicClientiOS
c663fe85dcffe647b8d7baf393c520e95a524af9
[ "MIT" ]
null
null
null
Example/ClassicClient-Example/Achievements/AchievementHeaderCell.swift
JustinLycklama/ClassicClientiOS
c663fe85dcffe647b8d7baf393c520e95a524af9
[ "MIT" ]
null
null
null
// // AchievementHeaderCell.swift // ClassicClient-Example // // Created by Justin Lycklama on 2020-08-26. // Copyright © 2020 CocoaPods. All rights reserved. // import UIKit class AchievementHeaderCell: UICollectionViewCell { @IBOutlet private var titleLabel: UILabel! override func awakeFromNib() { super.awakeFromNib() } func setTitle(title: String) { titleLabel.text = title } }
18.208333
52
0.670481
7a171db348ef5cb35465fbd71f4a9ac7b783f5e9
5,729
rs
Rust
src/hrtim_master/misr/mod.rs
roysmeding/stm32f334
27f05313728f62955cb81547cf6196b17dedbc2a
[ "Apache-2.0", "MIT" ]
1
2018-07-05T13:14:33.000Z
2018-07-05T13:14:33.000Z
src/hrtim_master/misr/mod.rs
roysmeding/stm32f334
27f05313728f62955cb81547cf6196b17dedbc2a
[ "Apache-2.0", "MIT" ]
null
null
null
src/hrtim_master/misr/mod.rs
roysmeding/stm32f334
27f05313728f62955cb81547cf6196b17dedbc2a
[ "Apache-2.0", "MIT" ]
null
null
null
#[doc = r" Value read from the register"] pub struct R { bits: u32, } impl super::MISR { #[doc = r" Reads the contents of the register"] #[inline] pub fn read(&self) -> R { R { bits: self.register.get(), } } } #[doc = r" Value of the field"] pub struct MUPDR { bits: bool, } impl MUPDR { #[doc = r" Value of the field as raw bits"] #[inline] pub fn bit(&self) -> bool { self.bits } #[doc = r" Returns `true` if the bit is clear (0)"] #[inline] pub fn bit_is_clear(&self) -> bool { !self.bit() } #[doc = r" Returns `true` if the bit is set (1)"] #[inline] pub fn bit_is_set(&self) -> bool { self.bit() } } #[doc = r" Value of the field"] pub struct SYNCR { bits: bool, } impl SYNCR { #[doc = r" Value of the field as raw bits"] #[inline] pub fn bit(&self) -> bool { self.bits } #[doc = r" Returns `true` if the bit is clear (0)"] #[inline] pub fn bit_is_clear(&self) -> bool { !self.bit() } #[doc = r" Returns `true` if the bit is set (1)"] #[inline] pub fn bit_is_set(&self) -> bool { self.bit() } } #[doc = r" Value of the field"] pub struct MREPR { bits: bool, } impl MREPR { #[doc = r" Value of the field as raw bits"] #[inline] pub fn bit(&self) -> bool { self.bits } #[doc = r" Returns `true` if the bit is clear (0)"] #[inline] pub fn bit_is_clear(&self) -> bool { !self.bit() } #[doc = r" Returns `true` if the bit is set (1)"] #[inline] pub fn bit_is_set(&self) -> bool { self.bit() } } #[doc = r" Value of the field"] pub struct MCMP4R { bits: bool, } impl MCMP4R { #[doc = r" Value of the field as raw bits"] #[inline] pub fn bit(&self) -> bool { self.bits } #[doc = r" Returns `true` if the bit is clear (0)"] #[inline] pub fn bit_is_clear(&self) -> bool { !self.bit() } #[doc = r" Returns `true` if the bit is set (1)"] #[inline] pub fn bit_is_set(&self) -> bool { self.bit() } } #[doc = r" Value of the field"] pub struct MCMP3R { bits: bool, } impl MCMP3R { #[doc = r" Value of the field as raw bits"] #[inline] pub fn bit(&self) -> bool { self.bits } #[doc = r" Returns `true` if the bit is clear (0)"] #[inline] pub fn bit_is_clear(&self) -> bool { !self.bit() } #[doc = r" Returns `true` if the bit is set (1)"] #[inline] pub fn bit_is_set(&self) -> bool { self.bit() } } #[doc = r" Value of the field"] pub struct MCMP2R { bits: bool, } impl MCMP2R { #[doc = r" Value of the field as raw bits"] #[inline] pub fn bit(&self) -> bool { self.bits } #[doc = r" Returns `true` if the bit is clear (0)"] #[inline] pub fn bit_is_clear(&self) -> bool { !self.bit() } #[doc = r" Returns `true` if the bit is set (1)"] #[inline] pub fn bit_is_set(&self) -> bool { self.bit() } } #[doc = r" Value of the field"] pub struct MCMP1R { bits: bool, } impl MCMP1R { #[doc = r" Value of the field as raw bits"] #[inline] pub fn bit(&self) -> bool { self.bits } #[doc = r" Returns `true` if the bit is clear (0)"] #[inline] pub fn bit_is_clear(&self) -> bool { !self.bit() } #[doc = r" Returns `true` if the bit is set (1)"] #[inline] pub fn bit_is_set(&self) -> bool { self.bit() } } impl R { #[doc = r" Value of the register as raw bits"] #[inline] pub fn bits(&self) -> u32 { self.bits } #[doc = "Bit 6 - Master Update Interrupt Flag"] #[inline] pub fn mupd(&self) -> MUPDR { let bits = { const MASK: bool = true; const OFFSET: u8 = 6; ((self.bits >> OFFSET) & MASK as u32) != 0 }; MUPDR { bits } } #[doc = "Bit 5 - Sync Input Interrupt Flag"] #[inline] pub fn sync(&self) -> SYNCR { let bits = { const MASK: bool = true; const OFFSET: u8 = 5; ((self.bits >> OFFSET) & MASK as u32) != 0 }; SYNCR { bits } } #[doc = "Bit 4 - Master Repetition Interrupt Flag"] #[inline] pub fn mrep(&self) -> MREPR { let bits = { const MASK: bool = true; const OFFSET: u8 = 4; ((self.bits >> OFFSET) & MASK as u32) != 0 }; MREPR { bits } } #[doc = "Bit 3 - Master Compare 4 Interrupt Flag"] #[inline] pub fn mcmp4(&self) -> MCMP4R { let bits = { const MASK: bool = true; const OFFSET: u8 = 3; ((self.bits >> OFFSET) & MASK as u32) != 0 }; MCMP4R { bits } } #[doc = "Bit 2 - Master Compare 3 Interrupt Flag"] #[inline] pub fn mcmp3(&self) -> MCMP3R { let bits = { const MASK: bool = true; const OFFSET: u8 = 2; ((self.bits >> OFFSET) & MASK as u32) != 0 }; MCMP3R { bits } } #[doc = "Bit 1 - Master Compare 2 Interrupt Flag"] #[inline] pub fn mcmp2(&self) -> MCMP2R { let bits = { const MASK: bool = true; const OFFSET: u8 = 1; ((self.bits >> OFFSET) & MASK as u32) != 0 }; MCMP2R { bits } } #[doc = "Bit 0 - Master Compare 1 Interrupt Flag"] #[inline] pub fn mcmp1(&self) -> MCMP1R { let bits = { const MASK: bool = true; const OFFSET: u8 = 0; ((self.bits >> OFFSET) & MASK as u32) != 0 }; MCMP1R { bits } } }
24.071429
55
0.490312
b155f44147f9def03aa2580ef69f999fd327ba6b
83
css
CSS
HomeForMe/client/src/app/components/property/property-new/property-new.component.css
emilia98/AngularProject-SoftUni
acd99133b29072ef5d3e1235575929f86da67327
[ "MIT" ]
null
null
null
HomeForMe/client/src/app/components/property/property-new/property-new.component.css
emilia98/AngularProject-SoftUni
acd99133b29072ef5d3e1235575929f86da67327
[ "MIT" ]
null
null
null
HomeForMe/client/src/app/components/property/property-new/property-new.component.css
emilia98/AngularProject-SoftUni
acd99133b29072ef5d3e1235575929f86da67327
[ "MIT" ]
null
null
null
.new-property { display: inline-block; width: 80%; margin: 30px auto; }
16.6
26
0.60241
56e5632601e4b21aea291ceca29871989591bfa6
455
go
Go
ami/mailbox.go
luiz-simples/goami
2d5c4aeee70d7baad40aaa8960e27065bc1adc37
[ "MIT" ]
null
null
null
ami/mailbox.go
luiz-simples/goami
2d5c4aeee70d7baad40aaa8960e27065bc1adc37
[ "MIT" ]
null
null
null
ami/mailbox.go
luiz-simples/goami
2d5c4aeee70d7baad40aaa8960e27065bc1adc37
[ "MIT" ]
null
null
null
package ami // MailboxCount checks Mailbox Message Count. func MailboxCount(client Client, actionID, mailbox string) (Response, error) { return send(client, "MailboxCount", actionID, map[string]string{ "Mailbox": mailbox, }) } // MailboxStatus checks Mailbox Message Count. func MailboxStatus(client Client, actionID, mailbox string) (Response, error) { return send(client, "MailboxStatus", actionID, map[string]string{ "Mailbox": mailbox, }) }
28.4375
79
0.749451
8569f3fba10c8c43d880a378c9ab9e92aa48c780
222
js
JavaScript
docs/doxygen/html/search/variables_6.js
GenosW/ViennaLS
f58b42940ce1d48a6e338ae4eac710b2e9b317a1
[ "MIT" ]
null
null
null
docs/doxygen/html/search/variables_6.js
GenosW/ViennaLS
f58b42940ce1d48a6e338ae4eac710b2e9b317a1
[ "MIT" ]
null
null
null
docs/doxygen/html/search/variables_6.js
GenosW/ViennaLS
f58b42940ce1d48a6e338ae4eac710b2e9b317a1
[ "MIT" ]
null
null
null
var searchData= [ ['height_618',['height',['../classlsCylinder.html#a8c1e8a7a6da15031bbd1b3b5ec0bf1db',1,'lsCylinder']]], ['hexas_619',['hexas',['../classlsMesh.html#a1f209d1bb2a77a64c2e57246e06b00a0',1,'lsMesh']]] ];
37
105
0.725225
3bc41d908926d3595f3ec5aa9303e5fc5dabf0ea
1,038
lua
Lua
project/ProjectFiles/bin/example/table/create_global.lua
wjx0912/PowerSniff
ebeb5949e5cbd3261443990f35c999a4804ecbfd
[ "MIT" ]
17
2020-12-14T08:21:30.000Z
2022-03-11T09:49:51.000Z
project/ProjectFiles/bin/example/table/create_global.lua
wjx0912/PowerSniff
ebeb5949e5cbd3261443990f35c999a4804ecbfd
[ "MIT" ]
null
null
null
project/ProjectFiles/bin/example/table/create_global.lua
wjx0912/PowerSniff
ebeb5949e5cbd3261443990f35c999a4804ecbfd
[ "MIT" ]
10
2020-12-15T09:46:37.000Z
2022-03-11T09:49:53.000Z
setmetatable(_G, { __newindex = function (_, n) error("attempt to write to undeclared variable "..n, 2) end, __index = function (_, n) error("attempt to read undeclared variable "..n, 2) end, }) --> a = 1 --stdin:1: attempt to write to undeclared variable a --绕过metamethod function declare (name, initval) rawset(_G, name, initval or false) end if rawget(_G, var) == nil then -- 'var' is undeclared -- ... end --> a = 1 --stdin:1: attempt to write to undeclared variable a --> declare "a" --> a = 1 -- OK --允许全局变量为nil的方案 local declaredNames = {} function declare (name, initval) rawset(_G, name, initval) declaredNames[name] = true end setmetatable(_G, { __newindex = function (t, n, v) if not declaredNames[n] then error("attempt to write to undeclared var. "..n, 2) else rawset(t, n, v) -- do the actual set end end, __index = function (_, n) if not declaredNames[n] then error("attempt to read undeclared var. "..n, 2) else return nil end end, })
20.76
59
0.633911
a8758e972ce81c0c64fef76d2b4d1121028f2720
7,189
sql
SQL
data/migrations/V0046__alter_aggregate_tables_index_name.sql
18F/openFEC
ee7b7368e0934f50c391789fb55444f811c1a2f7
[ "CC0-1.0" ]
246
2015-01-07T16:59:42.000Z
2020-01-18T20:35:05.000Z
data/migrations/V0046__alter_aggregate_tables_index_name.sql
18F/openFEC
ee7b7368e0934f50c391789fb55444f811c1a2f7
[ "CC0-1.0" ]
2,532
2015-01-02T16:22:46.000Z
2018-03-08T17:30:53.000Z
data/migrations/V0046__alter_aggregate_tables_index_name.sql
18F/openFEC
ee7b7368e0934f50c391789fb55444f811c1a2f7
[ "CC0-1.0" ]
75
2015-02-01T00:46:56.000Z
2021-02-14T10:51:34.000Z
-- The dsc_sched_x_aggregate_xxx tables in the disclosure schema were originally named ofec_sched_x_aggregate_xxx. The tables were renamed but the index name does not renamed accordingly. -- this script is used to rename the index so the tablename and index name will be consistent. alter index IF EXISTS disclosure.ofec_sched_a_aggregate_employer_cmte_id rename to dsc_sched_a_aggregate_employer_cmte_id; alter index IF EXISTS disclosure.ofec_sched_a_aggregate_employer_count rename to dsc_sched_a_aggregate_employer_count; alter index IF EXISTS disclosure.ofec_sched_a_aggregate_employer_cycle rename to dsc_sched_a_aggregate_employer_cycle; alter index IF EXISTS disclosure.ofec_sched_a_aggregate_employer_cycle_cmte_id rename to dsc_sched_a_aggregate_employer_cycle_cmte_id; alter index IF EXISTS disclosure.ofec_sched_a_aggregate_employer_employer rename to dsc_sched_a_aggregate_employer_employer; alter index IF EXISTS disclosure.ofec_sched_a_aggregate_employer_total rename to dsc_sched_a_aggregate_employer_total; alter index IF EXISTS disclosure.ofec_sched_a_aggregate_occupation_cmte_id rename to dsc_sched_a_aggregate_occupation_cmte_id; alter index IF EXISTS disclosure.ofec_sched_a_aggregate_occupation_count rename to dsc_sched_a_aggregate_occupation_count; alter index IF EXISTS disclosure.ofec_sched_a_aggregate_occupation_cycle rename to dsc_sched_a_aggregate_occupation_cycle; alter index IF EXISTS disclosure.ofec_sched_a_aggregate_occupation_cycle_cmte_id rename to dsc_sched_a_aggregate_occupation_cycle_cmte_id; alter index IF EXISTS disclosure.ofec_sched_a_aggregate_occupation_occupation rename to dsc_sched_a_aggregate_occupation_occupation; alter index IF EXISTS disclosure.ofec_sched_a_aggregate_occupation_total rename to dsc_sched_a_aggregate_occupation_total; alter index IF EXISTS disclosure.ofec_sched_a_aggregate_size_cmte_id rename to dsc_sched_a_aggregate_size_cmte_id; alter index IF EXISTS disclosure.ofec_sched_a_aggregate_size_cmte_id_cycle rename to dsc_sched_a_aggregate_size_cmte_id_cycle; alter index IF EXISTS disclosure.ofec_sched_a_aggregate_size_count rename to dsc_sched_a_aggregate_size_count; alter index IF EXISTS disclosure.ofec_sched_a_aggregate_size_cycle rename to dsc_sched_a_aggregate_size_cycle; alter index IF EXISTS disclosure.ofec_sched_a_aggregate_size_size rename to dsc_sched_a_aggregate_size_size; alter index IF EXISTS disclosure.ofec_sched_a_aggregate_size_total rename to dsc_sched_a_aggregate_size_total; alter index IF EXISTS disclosure.uq_ofec_sched_a_aggregate_size_cmte_id_cycle_size rename to uq_dsc_sched_a_aggregate_size_cmte_id_cycle_size; alter index IF EXISTS disclosure.ofec_sched_a_aggregate_state_cmte_id rename to dsc_sched_a_aggregate_state_cmte_id; alter index IF EXISTS disclosure.ofec_sched_a_aggregate_state_count rename to dsc_sched_a_aggregate_state_count; alter index IF EXISTS disclosure.ofec_sched_a_aggregate_state_cycle rename to dsc_sched_a_aggregate_state_cycle; alter index IF EXISTS disclosure.ofec_sched_a_aggregate_state_cycle_cmte_id rename to dsc_sched_a_aggregate_state_cycle_cmte_id; alter index IF EXISTS disclosure.ofec_sched_a_aggregate_state_state rename to dsc_sched_a_aggregate_state_state; alter index IF EXISTS disclosure.ofec_sched_a_aggregate_state_state_full rename to dsc_sched_a_aggregate_state_state_full; alter index IF EXISTS disclosure.ofec_sched_a_aggregate_state_total rename to dsc_sched_a_aggregate_state_total; alter index IF EXISTS disclosure.uq_ofec_sched_a_aggregate_state_cmte_id_cycle_state rename to uq_dsc_sched_a_aggregate_state_cmte_id_cycle_state; alter index IF EXISTS disclosure.ofec_sched_a_aggregate_zip_cmte_id rename to dsc_sched_a_aggregate_zip_cmte_id; alter index IF EXISTS disclosure.ofec_sched_a_aggregate_zip_count rename to dsc_sched_a_aggregate_zip_count; alter index IF EXISTS disclosure.ofec_sched_a_aggregate_zip_cycle rename to dsc_sched_a_aggregate_zip_cycle; alter index IF EXISTS disclosure.ofec_sched_a_aggregate_zip_state rename to dsc_sched_a_aggregate_zip_state; alter index IF EXISTS disclosure.ofec_sched_a_aggregate_zip_state_full rename to dsc_sched_a_aggregate_zip_state_full; alter index IF EXISTS disclosure.ofec_sched_a_aggregate_zip_total rename to dsc_sched_a_aggregate_zip_total; alter index IF EXISTS disclosure.ofec_sched_a_aggregate_zip_zip rename to dsc_sched_a_aggregate_zip_zip; alter index IF EXISTS disclosure.uq_ofec_sched_a_aggregate_zip_cmte_id_cycle_zip rename to uq_dsc_sched_a_aggregate_zip_cmte_id_cycle_zip; alter index IF EXISTS disclosure.ofec_sched_b_aggregate_purpose_cmte_id rename to dsc_sched_b_aggregate_purpose_cmte_id; alter index IF EXISTS disclosure.ofec_sched_b_aggregate_purpose_count rename to dsc_sched_b_aggregate_purpose_count; alter index IF EXISTS disclosure.ofec_sched_b_aggregate_purpose_cycle rename to dsc_sched_b_aggregate_purpose_cycle; alter index IF EXISTS disclosure.ofec_sched_b_aggregate_purpose_cycle_cmte_id rename to dsc_sched_b_aggregate_purpose_cycle_cmte_id; alter index IF EXISTS disclosure.ofec_sched_b_aggregate_purpose_purpose rename to dsc_sched_b_aggregate_purpose_purpose; alter index IF EXISTS disclosure.ofec_sched_b_aggregate_purpose_total rename to dsc_sched_b_aggregate_purpose_total; alter index IF EXISTS disclosure.uq_ofec_sched_b_aggregate_purpose_cmte_id_cycle_purpose rename to uq_dsc_sched_b_aggregate_purpose_cmte_id_cycle_purpose; alter index IF EXISTS disclosure.ofec_sched_b_aggregate_recipient_cmte_id rename to dsc_sched_b_aggregate_recipient_cmte_id; alter index IF EXISTS disclosure.ofec_sched_b_aggregate_recipient_count rename to dsc_sched_b_aggregate_recipient_count; alter index IF EXISTS disclosure.ofec_sched_b_aggregate_recipient_cycle rename to dsc_sched_b_aggregate_recipient_cycle; alter index IF EXISTS disclosure.ofec_sched_b_aggregate_recipient_cycle_cmte_id rename to dsc_sched_b_aggregate_recipient_cycle_cmte_id; alter index IF EXISTS disclosure.ofec_sched_b_aggregate_recipient_recipient_nm rename to dsc_sched_b_aggregate_recipient_recipient_nm; alter index IF EXISTS disclosure.ofec_sched_b_aggregate_recipient_total rename to dsc_sched_b_aggregate_recipient_total; alter index IF EXISTS disclosure.uq_ofec_sched_b_aggregate_recipient_cmte_id_cycle_recipient rename to uq_dsc_sched_b_aggregate_recipient_cmte_id_cycle_recipient; alter index IF EXISTS disclosure.ofec_sched_b_aggregate_recipient_id_cmte_id rename to dsc_sched_b_aggregate_recipient_id_cmte_id; alter index IF EXISTS disclosure.ofec_sched_b_aggregate_recipient_id_cmte_id_cycle rename to dsc_sched_b_aggregate_recipient_id_cmte_id_cycle; alter index IF EXISTS disclosure.ofec_sched_b_aggregate_recipient_id_count rename to dsc_sched_b_aggregate_recipient_id_count; alter index IF EXISTS disclosure.ofec_sched_b_aggregate_recipient_id_cycle rename to dsc_sched_b_aggregate_recipient_id_cycle; alter index IF EXISTS disclosure.ofec_sched_b_aggregate_recipient_id_recipient_cmte_id rename to dsc_sched_b_aggregate_recipient_id_recipient_cmte_id; alter index IF EXISTS disclosure.ofec_sched_b_aggregate_recipient_id_total rename to dsc_sched_b_aggregate_recipient_id_total;
104.188406
189
0.905411
914c93a2ef8ac12a98689fb45ebda3337232c629
11,542
html
HTML
out/javaDoc/allclasses-index.html
F3FFO/NexCell
f75c586075999307a6aa98cd8232e6cc055025f9
[ "Apache-2.0" ]
1
2022-01-14T16:00:26.000Z
2022-01-14T16:00:26.000Z
out/javaDoc/allclasses-index.html
F3FFO/NexCell
f75c586075999307a6aa98cd8232e6cc055025f9
[ "Apache-2.0" ]
null
null
null
out/javaDoc/allclasses-index.html
F3FFO/NexCell
f75c586075999307a6aa98cd8232e6cc055025f9
[ "Apache-2.0" ]
null
null
null
<!DOCTYPE HTML> <!-- NewPage --> <html lang="it"> <head> <!-- Generated by javadoc (11.0.13) on Tue Jan 18 10:45:54 CET 2022 --> <title>All Classes</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="dc.created" content="2022-01-18"> <link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style"> <link rel="stylesheet" type="text/css" href="jquery/jquery-ui.css" title="Style"> <script type="text/javascript" src="script.js"></script> <script type="text/javascript" src="jquery/jszip/dist/jszip.min.js"></script> <script type="text/javascript" src="jquery/jszip-utils/dist/jszip-utils.min.js"></script> <!--[if IE]> <script type="text/javascript" src="jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> <![endif]--> <script type="text/javascript" src="jquery/jquery-3.5.1.js"></script> <script type="text/javascript" src="jquery/jquery-ui.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="All Classes"; } } catch(err) { } //--> var pathtoroot = "./"; var useModuleDirectories = true; loadScripts(document, 'script');</script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <header role="banner"> <nav role="navigation"> <div class="fixedNav"> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a id="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a id="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="index.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><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" id="allclasses_navbar_top"> <li><a href="allclasses.html">All&nbsp;Classes</a></li> </ul> <ul class="navListSearch"> <li><label for="search">SEARCH:</label> <input type="text" id="search" value="search" disabled="disabled"> <input type="reset" id="reset" value="reset" disabled="disabled"> </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> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> </div> <a id="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> </div> <div class="navPadding">&nbsp;</div> <script type="text/javascript"><!-- $('.navPadding').css('padding-top', $('.fixedNav').css("height")); //--> </script> </nav> </header> <main role="main"> <div class="header"> <h1 title="All&amp;nbsp;Classes" class="title">All&nbsp;Classes</h1> </div> <div class="allClassesContainer"> <ul class="blockList"> <li class="blockList"> <table class="typeSummary"> <caption><span>Class Summary</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Class</th> <th class="colLast" scope="col">Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><a href="nexCell/controller/io/AutoSave.html" title="class in nexCell.controller.io">AutoSave</a></td> <th class="colLast" scope="row"> <div class="block">This class manage the auto-save.</div> </th> </tr> <tr id="i1" class="rowColor"> <td class="colFirst"><a href="nexCell/cell/Cell.html" title="class in nexCell.cell">Cell</a></td> <th class="colLast" scope="row"> <div class="block">This class is a model class for the project.</div> </th> </tr> <tr id="i2" class="altColor"> <td class="colFirst"><a href="nexCell/cell/CellFormula.html" title="class in nexCell.cell">CellFormula</a></td> <th class="colLast" scope="row"> <div class="block">This class is a model class for the project.</div> </th> </tr> <tr id="i3" class="rowColor"> <td class="colFirst"><a href="nexCell/cell/CellNumber.html" title="class in nexCell.cell">CellNumber</a></td> <th class="colLast" scope="row"> <div class="block">This class is a model class for the project.</div> </th> </tr> <tr id="i4" class="altColor"> <td class="colFirst"><a href="nexCell/cell/CellString.html" title="class in nexCell.cell">CellString</a></td> <th class="colLast" scope="row"> <div class="block">This class is a model class for the project.</div> </th> </tr> <tr id="i5" class="rowColor"> <td class="colFirst"><a href="nexCell/controller/DataModel.html" title="class in nexCell.controller">DataModel</a></td> <th class="colLast" scope="row"> <div class="block">This class is the data model of the JTable.</div> </th> </tr> <tr id="i6" class="altColor"> <td class="colFirst"><a href="nexCell/view/DialogStartUp.html" title="class in nexCell.view">DialogStartUp</a></td> <th class="colLast" scope="row"> <div class="block">This class is the dialog showed at startup.</div> </th> </tr> <tr id="i7" class="rowColor"> <td class="colFirst"><a href="nexCell/view/Gui.html" title="class in nexCell.view">Gui</a></td> <th class="colLast" scope="row"> <div class="block">This class contain the main frame.</div> </th> </tr> <tr id="i8" class="altColor"> <td class="colFirst"><a href="nexCell/view/panel/InfoPanel.html" title="class in nexCell.view.panel">InfoPanel</a></td> <th class="colLast" scope="row"> <div class="block">This class is the top panel.</div> </th> </tr> <tr id="i9" class="rowColor"> <td class="colFirst"><a href="nexCell/Main.html" title="class in nexCell">Main</a></td> <th class="colLast" scope="row"> <div class="block">This class is the main class.</div> </th> </tr> <tr id="i10" class="altColor"> <td class="colFirst"><a href="nexCell/view/menu/MenuBar.html" title="class in nexCell.view.menu">MenuBar</a></td> <th class="colLast" scope="row"> <div class="block">This class contains objects for each menu item.</div> </th> </tr> <tr id="i11" class="rowColor"> <td class="colFirst"><a href="nexCell/view/menu/MenuFile.html" title="class in nexCell.view.menu">MenuFile</a></td> <th class="colLast" scope="row"> <div class="block">This class contains file menu item.</div> </th> </tr> <tr id="i12" class="altColor"> <td class="colFirst"><a href="nexCell/view/menu/MenuFile.ExitActionPerformed.html" title="class in nexCell.view.menu">MenuFile.ExitActionPerformed</a></td> <th class="colLast" scope="row"> <div class="block">Action listener for 'Esci' menu item.</div> </th> </tr> <tr id="i13" class="rowColor"> <td class="colFirst"><a href="nexCell/view/menu/MenuFile.NewActionPerformed.html" title="class in nexCell.view.menu">MenuFile.NewActionPerformed</a></td> <th class="colLast" scope="row"> <div class="block">Action listener for 'Nuovo' menu item.</div> </th> </tr> <tr id="i14" class="altColor"> <td class="colFirst"><a href="nexCell/view/menu/MenuFile.OpenActionPerformed.html" title="class in nexCell.view.menu">MenuFile.OpenActionPerformed</a></td> <th class="colLast" scope="row"> <div class="block">Action listener for 'Apri' menu item.</div> </th> </tr> <tr id="i15" class="rowColor"> <td class="colFirst"><a href="nexCell/view/menu/MenuFile.SaveAsActionPerformed.html" title="class in nexCell.view.menu">MenuFile.SaveAsActionPerformed</a></td> <th class="colLast" scope="row"> <div class="block">Action listener for 'Salva con nome' menu item.</div> </th> </tr> <tr id="i16" class="altColor"> <td class="colFirst"><a href="nexCell/view/menu/MenuHelp.html" title="class in nexCell.view.menu">MenuHelp</a></td> <th class="colLast" scope="row"> <div class="block">This class contains 'help' menu item.</div> </th> </tr> <tr id="i17" class="rowColor"> <td class="colFirst"><a href="nexCell/view/MyCellEditor.html" title="class in nexCell.view">MyCellEditor</a></td> <th class="colLast" scope="row"> <div class="block">This class is the default editor for table and tree cells.</div> </th> </tr> <tr id="i18" class="altColor"> <td class="colFirst"><a href="nexCell/view/MyJTable.html" title="class in nexCell.view">MyJTable</a></td> <th class="colLast" scope="row"> <div class="block">This class is redefine the JTable.</div> </th> </tr> <tr id="i19" class="rowColor"> <td class="colFirst"><a href="nexCell/controller/io/OpenFile.html" title="class in nexCell.controller.io">OpenFile</a></td> <th class="colLast" scope="row"> <div class="block">This class contains the logic for opening files.</div> </th> </tr> <tr id="i20" class="altColor"> <td class="colFirst"><a href="nexCell/view/rowHeader/RowHeader.html" title="class in nexCell.view.rowHeader">RowHeader</a></td> <th class="colLast" scope="row"> <div class="block">This class the define the row header of the JTable.</div> </th> </tr> <tr id="i21" class="rowColor"> <td class="colFirst"><a href="nexCell/view/rowHeader/RowRenderer.html" title="class in nexCell.view.rowHeader">RowRenderer</a></td> <th class="colLast" scope="row"> <div class="block">This class define the row renderer of the JTable.</div> </th> </tr> <tr id="i22" class="altColor"> <td class="colFirst"><a href="nexCell/controller/io/SaveFile.html" title="class in nexCell.controller.io">SaveFile</a></td> <th class="colLast" scope="row"> <div class="block">This class contains the logic for saving files</div> </th> </tr> <tr id="i23" class="rowColor"> <td class="colFirst"><a href="nexCell/controller/SheetStructure.html" title="class in nexCell.controller">SheetStructure</a></td> <th class="colLast" scope="row"> <div class="block">This class is contains the logic necessary for the program to work.</div> </th> </tr> <tr id="i24" class="altColor"> <td class="colFirst"><a href="nexCell/view/panel/SheetsView.html" title="class in nexCell.view.panel">SheetsView</a></td> <th class="colLast" scope="row"> <div class="block">This class is the panel that contain the JTable.</div> </th> </tr> <tr id="i25" class="rowColor"> <td class="colFirst"><a href="nexCell/view/TextFieldCell.html" title="class in nexCell.view">TextFieldCell</a></td> <th class="colLast" scope="row"> <div class="block">This class is a redefinition of generic JTextField.</div> </th> </tr> </table> </li> </ul> </div> </main> <footer role="contentinfo"> <nav role="navigation"> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a id="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a id="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="index.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><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" id="allclasses_navbar_bottom"> <li><a href="allclasses.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> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> </div> <a id="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </nav> </footer> </body> </html>
36.410095
159
0.680471
4042e086fac1ecbb67b7495dabfbe854be94f730
1,123
py
Python
coinbase/tests/http_mocking.py
EU-institution/coinbase_python
1e0d5d162cb40c1094775ceb5c267a5bdedf0949
[ "Unlicense", "MIT" ]
53
2015-01-05T08:42:17.000Z
2022-03-01T20:52:41.000Z
coinbase/tests/http_mocking.py
EU-institution/coinbase_python
1e0d5d162cb40c1094775ceb5c267a5bdedf0949
[ "Unlicense", "MIT" ]
10
2015-01-08T04:09:25.000Z
2021-10-08T21:43:17.000Z
coinbase/tests/http_mocking.py
mhluongo/coinbase_python
2e29d4fa1c501495b41005bbcc770cb29fba6ad1
[ "MIT", "Unlicense" ]
34
2016-09-18T23:18:44.000Z
2022-02-19T17:31:05.000Z
import httpretty import json import unittest def setUp_method_with_http_mocking(test_class): original_setUp = test_class.setUp if hasattr(test_class, 'setUp') else None def new_setUp(self): httpretty.enable() self.addCleanup(httpretty.disable) if original_setUp: original_setUp(self) test_class.setUp = new_setUp return test_class def is_TstCase(x): try: return issubclass(x, unittest.TestCase) except TypeError: return False def with_http_mocking(x): if is_TstCase(x): return setUp_method_with_http_mocking(x) return httpretty.httprettified(x) def last_request_body(): return httpretty.last_request().body def last_request_json(): return json.loads(last_request_body().decode('UTF-8')) def last_request_params(): return httpretty.last_request().querystring def mock_http(header, response_body, content_type='text/json'): method, uri = header.split(' ', 1) httpretty.register_uri( method=method, uri=uri, body=response_body, content_type=content_type, )
19.701754
79
0.693678
5293ca69b7fccd329d26caa17f98e4cce20c7f02
8,506
swift
Swift
Playgrounds/String.playground/Contents.swift
pavangandhi/Code_Examples
b7abbe7c3bf2e2bde6d0031749de971bb5cb4b99
[ "BSD-3-Clause" ]
null
null
null
Playgrounds/String.playground/Contents.swift
pavangandhi/Code_Examples
b7abbe7c3bf2e2bde6d0031749de971bb5cb4b99
[ "BSD-3-Clause" ]
null
null
null
Playgrounds/String.playground/Contents.swift
pavangandhi/Code_Examples
b7abbe7c3bf2e2bde6d0031749de971bb5cb4b99
[ "BSD-3-Clause" ]
null
null
null
// Swift Standard Librray - String // Keith Harrison http://useyourloaf.com // Import Foundation if you want to bridge to NSString import Foundation // ==== // Initializing a String // ==== var emptyString = "" // Empty String var stillEmpty = String() // Another empty String let helloWorld = "Hello World!" // String inferred let a = String(true) // from boolean: "true" let b: Character = "A" // Explicit type required to create a Character let c = String(b) // from character "A" let d = String(3.14) // from Double "3.14" let e = String(1000) // from Int "1000" let f = "Result = \(d)" // Interpolation "Result = 3.14" let g = "\u{2126}" // Unicode Ohm sign Ω let h = String(count:3, repeatedValue:b) // Repeated character "AAA" // === // Strings are Value Types // === // Strings are value types that are copied when assigned // or passed to a function. The copy is performed lazily // on mutation. var aString = "Hello" var bString = aString bString += " World!" print("\(aString)") // "Hello\n" // === // Testing for empty String // === emptyString.isEmpty // true // === // Testing for equality // === // Swift is Unicode correct so the equality operator // (“==”) checks for Unicode canonical equivalence. // This means that two Strings that are composed from // different Unicode scalars will be considered equal // if they have the same linguistic meaning and appearance: let spain = "España" let tilde = "\u{303}" let country = "Espan" + "\(tilde)" + "a" if country == spain { print("Matched!") // "Matched!\n" } // Order if "aaa" < "bbb" { print("aaa is less than bbb") } // === // Testing for suffix/prefix // === let line = "0001 Some test data here %%%%" line.hasPrefix("0001") // true line.hasSuffix("%%%%") // true // === // Converting to upper/lower case // === let mixedCase = "AbcDef" let upper = mixedCase.uppercaseString // "ABCDEF" let lower = mixedCase.lowercaseString // "abcdef" // === // Views // === // Strings are not collections of anything but do provide // collection views for different representations accessed // through the appropriate property: country.characters // characters country.unicodeScalars // Unicode scalar 21-bit codes country.utf16 // UTF-16 encoding country.utf8 // UTF-8 encoding // === // Counting // == // String does not directly have a property to return a count // as it only has meaning for a particular representation. // So count is implemented on each of the collection views: // spain = "España" print("\(spain.characters.count)") // 6 print("\(spain.unicodeScalars.count)") // 6 print("\(spain.utf16.count)") // 6 print("\(spain.utf8.count)") // 7 // === // Using Index to traverse a collection // === // Each of the collection views has an Index // that you use to traverse the collection. // This is maybe one of the big causes of pain // when getting to grips with String. You cannot // randomly access an element in a string using // a subscript (e.g. string[5]). // To iterate over all items in a collection // with a for..in loop: var sentence = "Never odd or even" for character in sentence.characters { print(character) } // Each collection has two instance properties you // can use as subscripts to index into the collection: // startIndex: the position of the first element if // non-empty, else identical to endIndex. // endIndex: the position just “past the end” of the string. // // Note the choice for endIndex means you cannot use it // directly as a subscript as it is out of range. let cafe = "café" cafe.startIndex // 0 cafe.endIndex // 4 - after last char // The startIndex and endIndex properties become more // useful when modified with the following methods: // successor() to get the next element // predecessor() to get the previous element // advancedBy(n) to jump forward/backward by n elements // // Some examples, note that you can chain operations if required: cafe[cafe.startIndex] // "c" cafe[cafe.startIndex.successor()] // "a" cafe[cafe.startIndex.successor().successor()] // "f" // Note that cafe[endIndex] is a run time error cafe[cafe.endIndex.predecessor()] // "é" cafe[cafe.startIndex.advancedBy(2)] // "f" // The indices property returns a range for all elements // in a String that can be useful for iterating through // the collection: for index in cafe.characters.indices { print(cafe[index]) } // You cannot use an index from one String to access a // different string. You can convert an index to an integer // value with the distanceTo method: let word1 = "ABCDEF" let word2 = "012345" let indexC = word1.startIndex.advancedBy(2) let distance = word1.startIndex.distanceTo(indexC) // 2 let digit = word2[word2.startIndex.advancedBy(distance)] // "2" // === // Using a range // === // To identify a range of elements in a String collection // use a range. A range is just a start and end index: let fqdn = "useyourloaf.com" let rangeOfTLD = Range(start: fqdn.endIndex.advancedBy(-3), end: fqdn.endIndex) let tld = fqdn[rangeOfTLD] // "com" // Alternate creation of range (... or ..< syntax) let rangeOfDomain = fqdn.startIndex..<fqdn.endIndex.advancedBy(-4) let domain = fqdn[rangeOfDomain] // "useyourloaf" // === // Getting a substring using index or range // === // Various methods to get a substring identified by an // index or range: var template = "<<<Hello>>>" let indexStartOfText = template.startIndex.advancedBy(3) let indexEndOfText = template.endIndex.advancedBy(-3) let subString1 = template.substringFromIndex(indexStartOfText) let subString2 = template.substringToIndex(indexEndOfText) let rangeOfHello = indexStartOfText..<indexEndOfText let subString3 = template.substringWithRange(rangeOfHello) let subString4 = template.substringWithRange(indexStartOfText..<indexEndOfText) // === // Getting a Prefix or Suffix // === // If you just need to drop/retrieve elements at the beginning // or end of a String: let digits = "0123456789" let tail = String(digits.characters.dropFirst()) // "123456789" let less = String(digits.characters.dropFirst(3)) // "3456789" let head = String(digits.characters.dropLast(3)) // "0123456" let prefix = String(digits.characters.prefix(2)) // "01" let suffix = String(digits.characters.suffix(2)) // "89" let index4 = digits.startIndex.advancedBy(4) let thru4 = String(digits.characters.prefixThrough(index4)) // "01234" let upTo4 = String(digits.characters.prefixUpTo(index4)) // "0123" let from4 = String(digits.characters.suffixFrom(index4)) // "456789" // === // Inserting/removing // === // Insert a character at index var stars = "******" stars.insert("X", atIndex: stars.startIndex.advancedBy(3)) // "***X***" // Insert a string at index (converting to characters) stars.insertContentsOf("YZ".characters, at: stars.endIndex.advancedBy(-3)) // "***XYZ***" // === // Replace with Range // === let xyzRange = stars.startIndex.advancedBy(3)..<stars.endIndex.advancedBy(-3) stars.replaceRange(xyzRange, with: "ABC") // "***ABC***" // === // Append // === var message = "Welcome" message += " Tim" // "Welcome Tim" message.appendContentsOf("!!!") // "Welcome Tim!!! // === // Remove and return element at index // === // This invalidates any indices you may have on the string var grades = "ABCDEF" let ch = grades.removeAtIndex(grades.startIndex) // "A" print(grades) // "BCDEF" // === // Remove Range // === // Invalidates all indices var sequences = "ABA BBA ABC" let midRange = sequences.startIndex.advancedBy(4)...sequences.endIndex.advancedBy(-4) sequences.removeRange(midRange) // "ABA ABC" // // Bridging to NSString (import Foundation) // // String is bridged to Objective-C as NSString. // If the Swift Standard Library does not have what // you need import the Foundation framework to get // access to methods defined by NSString. // Be aware that this is not a toll-free bridge so // stick to the Swift Standard Library where possible. // Don't forget to import Foundation let welcome = "hello world!" welcome.capitalizedString // "Hello World!" // === // Searching for a substring // === // An example of using NSString methods to perform a // search for a substring: let text = "123045780984" if let rangeOfZero = text.rangeOfString("0",options: NSStringCompareOptions.BackwardsSearch) { // Found a zero let suffix = String(text.characters.suffixFrom(rangeOfZero.endIndex)) // "984" }
28.639731
94
0.689984
1bec0e468d60d3895c2e4861059333c712c3e641
1,983
py
Python
python/card-games/lists.py
sci-c0/exercism-learning
dd9fb1d2a407085992c3371c1d56456b7ebf9180
[ "BSD-3-Clause" ]
null
null
null
python/card-games/lists.py
sci-c0/exercism-learning
dd9fb1d2a407085992c3371c1d56456b7ebf9180
[ "BSD-3-Clause" ]
null
null
null
python/card-games/lists.py
sci-c0/exercism-learning
dd9fb1d2a407085992c3371c1d56456b7ebf9180
[ "BSD-3-Clause" ]
null
null
null
""" Elyse is really looking forward to playing some poker (and other card games) during her upcoming trip to Vegas. Being a big fan of "self-tracking" she wants to put together some small functions that will help her with tracking tasks and has asked for your help thinking them through. """ from typing import List, NoReturn def get_rounds(number: int) -> List[int]: """ :param number: int - current round number. :return: list - current round and the two that follow. """ return list(range(number, number + 3)) def concatenate_rounds(rounds_1: List[int], rounds_2: List[int]) -> List[int]: """ :param rounds_1: list - first rounds played. :param rounds_2: list - second set of rounds played. :return: list - all rounds played. """ return rounds_1 + rounds_2 def list_contains_round(rounds: List[int], number: int) -> bool: """ :param rounds: list - rounds played. :param number: int - round number. :return: bool - was the round played? """ return number in rounds def card_average(hand: List[int]) -> float: """ :param hand: list - cards in hand. :return: float - average value of the cards in the hand. """ return sum(hand) / len(hand) def approx_average_is_average(hand: List[int]) -> bool: """ :param hand: list - cards in hand. :return: bool - is approximate average the same as true average? """ return card_average(hand) in { hand[len(hand) // 2], (hand[0] + hand[-1]) // 2 } def average_even_is_average_odd(hand: List[int]) -> bool: """ :param hand: list - cards in hand. :return: bool - are even and odd averages equal? """ return card_average(hand[::2]) == card_average(hand[1::2]) def maybe_double_last(hand: List[int]) -> NoReturn: """ :param hand: list - cards in hand. :return: list - hand with Jacks (if present) value doubled. """ if hand[-1] == 11: hand[-1] = 22
26.092105
111
0.636409
713f4e6e436534c047501c9349d403b89f603194
22,156
ts
TypeScript
lib/server/_graphql/types.ts
ranafathi/idiomatically
e264ddfac847c5f84290b77c364d1039c20b8cbe
[ "Apache-2.0" ]
19
2020-06-14T02:21:06.000Z
2021-11-02T15:38:25.000Z
lib/server/_graphql/types.ts
ranafathi/idiomatically
e264ddfac847c5f84290b77c364d1039c20b8cbe
[ "Apache-2.0" ]
5
2020-06-15T18:42:56.000Z
2022-02-26T20:59:16.000Z
lib/server/_graphql/types.ts
ranafathi/idiomatically
e264ddfac847c5f84290b77c364d1039c20b8cbe
[ "Apache-2.0" ]
4
2020-06-15T18:18:38.000Z
2021-05-29T15:16:05.000Z
import { GraphQLResolveInfo } from 'graphql'; export type Maybe<T> = T | null; export type RequireFields<T, K extends keyof T> = { [X in Exclude<keyof T, K>]?: T[X] } & { [P in K]-?: NonNullable<T[P]> }; /** All built-in and custom scalars, mapped to their actual values */ export type Scalars = { ID: string; String: string; Boolean: boolean; Int: number; Float: number; }; export enum CacheControlScope { Public = 'PUBLIC', Private = 'PRIVATE' } export type Country = { __typename?: 'Country'; countryKey: Scalars['String']; countryName: Scalars['String']; countryNativeName: Scalars['String']; emojiFlag: Scalars['String']; latitude: Scalars['Float']; longitude: Scalars['Float']; }; export type Idiom = { __typename?: 'Idiom'; id: Scalars['ID']; slug: Scalars['String']; title: Scalars['String']; description?: Maybe<Scalars['String']>; tags: Array<Scalars['String']>; transliteration?: Maybe<Scalars['String']>; literalTranslation?: Maybe<Scalars['String']>; equivalents: Array<Idiom>; language: Language; createdAt: Scalars['String']; createdBy?: Maybe<User>; updatedAt?: Maybe<Scalars['String']>; updatedBy?: Maybe<User>; }; export type IdiomChangeProposal = { __typename?: 'IdiomChangeProposal'; id: Scalars['ID']; readOnlyType: Scalars['String']; readOnlyCreatedBy: Scalars['String']; readOnlyTitle?: Maybe<Scalars['String']>; readOnlySlug?: Maybe<Scalars['String']>; body: Scalars['String']; }; export type IdiomChangeProposalConnection = { __typename?: 'IdiomChangeProposalConnection'; edges: Array<IdiomChangeProposalEdge>; pageInfo: PageInfo; totalCount: Scalars['Int']; }; export type IdiomChangeProposalEdge = { __typename?: 'IdiomChangeProposalEdge'; cursor: Scalars['String']; node: IdiomChangeProposal; }; export type IdiomConnection = { __typename?: 'IdiomConnection'; edges: Array<IdiomEdge>; pageInfo: PageInfo; totalCount: Scalars['Int']; }; export type IdiomCreateInput = { title: Scalars['String']; description?: Maybe<Scalars['String']>; languageKey: Scalars['String']; countryKeys?: Maybe<Array<Scalars['String']>>; tags?: Maybe<Array<Scalars['String']>>; transliteration?: Maybe<Scalars['String']>; literalTranslation?: Maybe<Scalars['String']>; relatedIdiomId?: Maybe<Scalars['ID']>; }; export type IdiomEdge = { __typename?: 'IdiomEdge'; cursor: Scalars['String']; node: Idiom; }; export type IdiomOperationResult = { __typename?: 'IdiomOperationResult'; status: OperationStatus; message?: Maybe<Scalars['String']>; idiom?: Maybe<Idiom>; }; export type IdiomUpdateInput = { id: Scalars['ID']; title?: Maybe<Scalars['String']>; description?: Maybe<Scalars['String']>; transliteration?: Maybe<Scalars['String']>; literalTranslation?: Maybe<Scalars['String']>; tags?: Maybe<Array<Scalars['String']>>; countryKeys?: Maybe<Array<Scalars['String']>>; }; export type Language = { __typename?: 'Language'; languageName: Scalars['String']; languageNativeName: Scalars['String']; languageKey: Scalars['String']; countries: Array<Country>; }; export type Login = { __typename?: 'Login'; externalId: Scalars['ID']; name: Scalars['String']; email?: Maybe<Scalars['String']>; avatar?: Maybe<Scalars['String']>; type: ProviderType; }; export type Mutation = { __typename?: 'Mutation'; updateIdiom: IdiomOperationResult; createIdiom: IdiomOperationResult; deleteIdiom: IdiomOperationResult; addEquivalent: IdiomOperationResult; removeEquivalent: IdiomOperationResult; computeEquivalentClosure: IdiomOperationResult; acceptIdiomChangeProposal: IdiomOperationResult; rejectIdiomChangeProposal: IdiomOperationResult; }; export type MutationUpdateIdiomArgs = { idiom: IdiomUpdateInput; }; export type MutationCreateIdiomArgs = { idiom: IdiomCreateInput; }; export type MutationDeleteIdiomArgs = { idiomId: Scalars['ID']; }; export type MutationAddEquivalentArgs = { idiomId: Scalars['ID']; equivalentId: Scalars['ID']; }; export type MutationRemoveEquivalentArgs = { idiomId: Scalars['ID']; equivalentId: Scalars['ID']; }; export type MutationComputeEquivalentClosureArgs = { forceRun?: Maybe<Scalars['Boolean']>; }; export type MutationAcceptIdiomChangeProposalArgs = { proposalId: Scalars['ID']; body?: Maybe<Scalars['String']>; }; export type MutationRejectIdiomChangeProposalArgs = { proposalId: Scalars['ID']; }; export enum OperationStatus { Success = 'SUCCESS', Failure = 'FAILURE', Pending = 'PENDING', Pendingfailure = 'PENDINGFAILURE' } export type PageInfo = { __typename?: 'PageInfo'; hasNextPage: Scalars['Boolean']; endCursor: Scalars['String']; }; export enum ProviderType { Google = 'GOOGLE', Facebook = 'FACEBOOK' } export type Query = { __typename?: 'Query'; me?: Maybe<User>; user?: Maybe<User>; users: Array<Maybe<User>>; idiom?: Maybe<Idiom>; idioms: IdiomConnection; languages: Array<Language>; languagesWithIdioms: Array<Language>; countries: Array<Country>; idiomChangeProposal: IdiomChangeProposal; idiomChangeProposals: IdiomChangeProposalConnection; }; export type QueryUserArgs = { id: Scalars['ID']; }; export type QueryUsersArgs = { filter?: Maybe<Scalars['String']>; limit?: Maybe<Scalars['Int']>; }; export type QueryIdiomArgs = { id?: Maybe<Scalars['ID']>; slug?: Maybe<Scalars['String']>; }; export type QueryIdiomsArgs = { cursor?: Maybe<Scalars['String']>; filter?: Maybe<Scalars['String']>; locale?: Maybe<Scalars['String']>; limit?: Maybe<Scalars['Int']>; }; export type QueryCountriesArgs = { languageKey?: Maybe<Scalars['String']>; }; export type QueryIdiomChangeProposalArgs = { id?: Maybe<Scalars['ID']>; }; export type QueryIdiomChangeProposalsArgs = { cursor?: Maybe<Scalars['String']>; filter?: Maybe<Scalars['String']>; limit?: Maybe<Scalars['Int']>; }; export type User = { __typename?: 'User'; id: Scalars['ID']; name: Scalars['String']; avatar?: Maybe<Scalars['String']>; role?: Maybe<UserRole>; providers: Array<Maybe<Login>>; }; export enum UserRole { Admin = 'ADMIN', Contributor = 'CONTRIBUTOR', General = 'GENERAL' } export type ResolverTypeWrapper<T> = Promise<T> | T; export type StitchingResolver<TResult, TParent, TContext, TArgs> = { fragment: string; resolve: ResolverFn<TResult, TParent, TContext, TArgs>; }; export type Resolver<TResult, TParent = {}, TContext = {}, TArgs = {}> = | ResolverFn<TResult, TParent, TContext, TArgs> | StitchingResolver<TResult, TParent, TContext, TArgs>; export type ResolverFn<TResult, TParent, TContext, TArgs> = ( parent: TParent, args: TArgs, context: TContext, info: GraphQLResolveInfo ) => Promise<TResult> | TResult; export type SubscriptionSubscribeFn<TResult, TParent, TContext, TArgs> = ( parent: TParent, args: TArgs, context: TContext, info: GraphQLResolveInfo ) => AsyncIterator<TResult> | Promise<AsyncIterator<TResult>>; export type SubscriptionResolveFn<TResult, TParent, TContext, TArgs> = ( parent: TParent, args: TArgs, context: TContext, info: GraphQLResolveInfo ) => TResult | Promise<TResult>; export interface SubscriptionSubscriberObject<TResult, TKey extends string, TParent, TContext, TArgs> { subscribe: SubscriptionSubscribeFn<{ [key in TKey]: TResult }, TParent, TContext, TArgs>; resolve?: SubscriptionResolveFn<TResult, { [key in TKey]: TResult }, TContext, TArgs>; } export interface SubscriptionResolverObject<TResult, TParent, TContext, TArgs> { subscribe: SubscriptionSubscribeFn<any, TParent, TContext, TArgs>; resolve: SubscriptionResolveFn<TResult, any, TContext, TArgs>; } export type SubscriptionObject<TResult, TKey extends string, TParent, TContext, TArgs> = | SubscriptionSubscriberObject<TResult, TKey, TParent, TContext, TArgs> | SubscriptionResolverObject<TResult, TParent, TContext, TArgs>; export type SubscriptionResolver<TResult, TKey extends string, TParent = {}, TContext = {}, TArgs = {}> = | ((...args: any[]) => SubscriptionObject<TResult, TKey, TParent, TContext, TArgs>) | SubscriptionObject<TResult, TKey, TParent, TContext, TArgs>; export type TypeResolveFn<TTypes, TParent = {}, TContext = {}> = ( parent: TParent, context: TContext, info: GraphQLResolveInfo ) => Maybe<TTypes> | Promise<Maybe<TTypes>>; export type isTypeOfResolverFn<T = {}> = (obj: T, info: GraphQLResolveInfo) => boolean | Promise<boolean>; export type NextResolverFn<T> = () => Promise<T>; export type DirectiveResolverFn<TResult = {}, TParent = {}, TContext = {}, TArgs = {}> = ( next: NextResolverFn<TResult>, parent: TParent, args: TArgs, context: TContext, info: GraphQLResolveInfo ) => TResult | Promise<TResult>; /** Mapping between all available schema types and the resolvers types */ export type ResolversTypes = { Query: ResolverTypeWrapper<{}>, User: ResolverTypeWrapper<User>, ID: ResolverTypeWrapper<Scalars['ID']>, String: ResolverTypeWrapper<Scalars['String']>, UserRole: UserRole, Login: ResolverTypeWrapper<Login>, ProviderType: ProviderType, Int: ResolverTypeWrapper<Scalars['Int']>, Idiom: ResolverTypeWrapper<Idiom>, Language: ResolverTypeWrapper<Language>, Country: ResolverTypeWrapper<Country>, Float: ResolverTypeWrapper<Scalars['Float']>, IdiomConnection: ResolverTypeWrapper<IdiomConnection>, IdiomEdge: ResolverTypeWrapper<IdiomEdge>, PageInfo: ResolverTypeWrapper<PageInfo>, Boolean: ResolverTypeWrapper<Scalars['Boolean']>, IdiomChangeProposal: ResolverTypeWrapper<IdiomChangeProposal>, IdiomChangeProposalConnection: ResolverTypeWrapper<IdiomChangeProposalConnection>, IdiomChangeProposalEdge: ResolverTypeWrapper<IdiomChangeProposalEdge>, Mutation: ResolverTypeWrapper<{}>, IdiomUpdateInput: IdiomUpdateInput, IdiomOperationResult: ResolverTypeWrapper<IdiomOperationResult>, OperationStatus: OperationStatus, IdiomCreateInput: IdiomCreateInput, CacheControlScope: CacheControlScope, }; /** Mapping between all available schema types and the resolvers parents */ export type ResolversParentTypes = { Query: {}, User: User, ID: Scalars['ID'], String: Scalars['String'], UserRole: UserRole, Login: Login, ProviderType: ProviderType, Int: Scalars['Int'], Idiom: Idiom, Language: Language, Country: Country, Float: Scalars['Float'], IdiomConnection: IdiomConnection, IdiomEdge: IdiomEdge, PageInfo: PageInfo, Boolean: Scalars['Boolean'], IdiomChangeProposal: IdiomChangeProposal, IdiomChangeProposalConnection: IdiomChangeProposalConnection, IdiomChangeProposalEdge: IdiomChangeProposalEdge, Mutation: {}, IdiomUpdateInput: IdiomUpdateInput, IdiomOperationResult: IdiomOperationResult, OperationStatus: OperationStatus, IdiomCreateInput: IdiomCreateInput, CacheControlScope: CacheControlScope, }; export type CacheControlDirectiveArgs = { maxAge?: Maybe<Scalars['Int']>; scope?: Maybe<CacheControlScope>; }; export type CacheControlDirectiveResolver<Result, Parent, ContextType = any, Args = CacheControlDirectiveArgs> = DirectiveResolverFn<Result, Parent, ContextType, Args>; export type AuthDirectiveArgs = { requires?: Maybe<UserRole>; }; export type AuthDirectiveResolver<Result, Parent, ContextType = any, Args = AuthDirectiveArgs> = DirectiveResolverFn<Result, Parent, ContextType, Args>; export type CountryResolvers<ContextType = any, ParentType extends ResolversParentTypes['Country'] = ResolversParentTypes['Country']> = { countryKey?: Resolver<ResolversTypes['String'], ParentType, ContextType>, countryName?: Resolver<ResolversTypes['String'], ParentType, ContextType>, countryNativeName?: Resolver<ResolversTypes['String'], ParentType, ContextType>, emojiFlag?: Resolver<ResolversTypes['String'], ParentType, ContextType>, latitude?: Resolver<ResolversTypes['Float'], ParentType, ContextType>, longitude?: Resolver<ResolversTypes['Float'], ParentType, ContextType>, __isTypeOf?: isTypeOfResolverFn<ParentType>, }; export type IdiomResolvers<ContextType = any, ParentType extends ResolversParentTypes['Idiom'] = ResolversParentTypes['Idiom']> = { id?: Resolver<ResolversTypes['ID'], ParentType, ContextType>, slug?: Resolver<ResolversTypes['String'], ParentType, ContextType>, title?: Resolver<ResolversTypes['String'], ParentType, ContextType>, description?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>, tags?: Resolver<Array<ResolversTypes['String']>, ParentType, ContextType>, transliteration?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>, literalTranslation?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>, equivalents?: Resolver<Array<ResolversTypes['Idiom']>, ParentType, ContextType>, language?: Resolver<ResolversTypes['Language'], ParentType, ContextType>, createdAt?: Resolver<ResolversTypes['String'], ParentType, ContextType>, createdBy?: Resolver<Maybe<ResolversTypes['User']>, ParentType, ContextType>, updatedAt?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>, updatedBy?: Resolver<Maybe<ResolversTypes['User']>, ParentType, ContextType>, __isTypeOf?: isTypeOfResolverFn<ParentType>, }; export type IdiomChangeProposalResolvers<ContextType = any, ParentType extends ResolversParentTypes['IdiomChangeProposal'] = ResolversParentTypes['IdiomChangeProposal']> = { id?: Resolver<ResolversTypes['ID'], ParentType, ContextType>, readOnlyType?: Resolver<ResolversTypes['String'], ParentType, ContextType>, readOnlyCreatedBy?: Resolver<ResolversTypes['String'], ParentType, ContextType>, readOnlyTitle?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>, readOnlySlug?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>, body?: Resolver<ResolversTypes['String'], ParentType, ContextType>, __isTypeOf?: isTypeOfResolverFn<ParentType>, }; export type IdiomChangeProposalConnectionResolvers<ContextType = any, ParentType extends ResolversParentTypes['IdiomChangeProposalConnection'] = ResolversParentTypes['IdiomChangeProposalConnection']> = { edges?: Resolver<Array<ResolversTypes['IdiomChangeProposalEdge']>, ParentType, ContextType>, pageInfo?: Resolver<ResolversTypes['PageInfo'], ParentType, ContextType>, totalCount?: Resolver<ResolversTypes['Int'], ParentType, ContextType>, __isTypeOf?: isTypeOfResolverFn<ParentType>, }; export type IdiomChangeProposalEdgeResolvers<ContextType = any, ParentType extends ResolversParentTypes['IdiomChangeProposalEdge'] = ResolversParentTypes['IdiomChangeProposalEdge']> = { cursor?: Resolver<ResolversTypes['String'], ParentType, ContextType>, node?: Resolver<ResolversTypes['IdiomChangeProposal'], ParentType, ContextType>, __isTypeOf?: isTypeOfResolverFn<ParentType>, }; export type IdiomConnectionResolvers<ContextType = any, ParentType extends ResolversParentTypes['IdiomConnection'] = ResolversParentTypes['IdiomConnection']> = { edges?: Resolver<Array<ResolversTypes['IdiomEdge']>, ParentType, ContextType>, pageInfo?: Resolver<ResolversTypes['PageInfo'], ParentType, ContextType>, totalCount?: Resolver<ResolversTypes['Int'], ParentType, ContextType>, __isTypeOf?: isTypeOfResolverFn<ParentType>, }; export type IdiomEdgeResolvers<ContextType = any, ParentType extends ResolversParentTypes['IdiomEdge'] = ResolversParentTypes['IdiomEdge']> = { cursor?: Resolver<ResolversTypes['String'], ParentType, ContextType>, node?: Resolver<ResolversTypes['Idiom'], ParentType, ContextType>, __isTypeOf?: isTypeOfResolverFn<ParentType>, }; export type IdiomOperationResultResolvers<ContextType = any, ParentType extends ResolversParentTypes['IdiomOperationResult'] = ResolversParentTypes['IdiomOperationResult']> = { status?: Resolver<ResolversTypes['OperationStatus'], ParentType, ContextType>, message?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>, idiom?: Resolver<Maybe<ResolversTypes['Idiom']>, ParentType, ContextType>, __isTypeOf?: isTypeOfResolverFn<ParentType>, }; export type LanguageResolvers<ContextType = any, ParentType extends ResolversParentTypes['Language'] = ResolversParentTypes['Language']> = { languageName?: Resolver<ResolversTypes['String'], ParentType, ContextType>, languageNativeName?: Resolver<ResolversTypes['String'], ParentType, ContextType>, languageKey?: Resolver<ResolversTypes['String'], ParentType, ContextType>, countries?: Resolver<Array<ResolversTypes['Country']>, ParentType, ContextType>, __isTypeOf?: isTypeOfResolverFn<ParentType>, }; export type LoginResolvers<ContextType = any, ParentType extends ResolversParentTypes['Login'] = ResolversParentTypes['Login']> = { externalId?: Resolver<ResolversTypes['ID'], ParentType, ContextType>, name?: Resolver<ResolversTypes['String'], ParentType, ContextType>, email?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>, avatar?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>, type?: Resolver<ResolversTypes['ProviderType'], ParentType, ContextType>, __isTypeOf?: isTypeOfResolverFn<ParentType>, }; export type MutationResolvers<ContextType = any, ParentType extends ResolversParentTypes['Mutation'] = ResolversParentTypes['Mutation']> = { updateIdiom?: Resolver<ResolversTypes['IdiomOperationResult'], ParentType, ContextType, RequireFields<MutationUpdateIdiomArgs, 'idiom'>>, createIdiom?: Resolver<ResolversTypes['IdiomOperationResult'], ParentType, ContextType, RequireFields<MutationCreateIdiomArgs, 'idiom'>>, deleteIdiom?: Resolver<ResolversTypes['IdiomOperationResult'], ParentType, ContextType, RequireFields<MutationDeleteIdiomArgs, 'idiomId'>>, addEquivalent?: Resolver<ResolversTypes['IdiomOperationResult'], ParentType, ContextType, RequireFields<MutationAddEquivalentArgs, 'idiomId' | 'equivalentId'>>, removeEquivalent?: Resolver<ResolversTypes['IdiomOperationResult'], ParentType, ContextType, RequireFields<MutationRemoveEquivalentArgs, 'idiomId' | 'equivalentId'>>, computeEquivalentClosure?: Resolver<ResolversTypes['IdiomOperationResult'], ParentType, ContextType, RequireFields<MutationComputeEquivalentClosureArgs, never>>, acceptIdiomChangeProposal?: Resolver<ResolversTypes['IdiomOperationResult'], ParentType, ContextType, RequireFields<MutationAcceptIdiomChangeProposalArgs, 'proposalId'>>, rejectIdiomChangeProposal?: Resolver<ResolversTypes['IdiomOperationResult'], ParentType, ContextType, RequireFields<MutationRejectIdiomChangeProposalArgs, 'proposalId'>>, }; export type PageInfoResolvers<ContextType = any, ParentType extends ResolversParentTypes['PageInfo'] = ResolversParentTypes['PageInfo']> = { hasNextPage?: Resolver<ResolversTypes['Boolean'], ParentType, ContextType>, endCursor?: Resolver<ResolversTypes['String'], ParentType, ContextType>, __isTypeOf?: isTypeOfResolverFn<ParentType>, }; export type QueryResolvers<ContextType = any, ParentType extends ResolversParentTypes['Query'] = ResolversParentTypes['Query']> = { me?: Resolver<Maybe<ResolversTypes['User']>, ParentType, ContextType>, user?: Resolver<Maybe<ResolversTypes['User']>, ParentType, ContextType, RequireFields<QueryUserArgs, 'id'>>, users?: Resolver<Array<Maybe<ResolversTypes['User']>>, ParentType, ContextType, RequireFields<QueryUsersArgs, never>>, idiom?: Resolver<Maybe<ResolversTypes['Idiom']>, ParentType, ContextType, RequireFields<QueryIdiomArgs, never>>, idioms?: Resolver<ResolversTypes['IdiomConnection'], ParentType, ContextType, RequireFields<QueryIdiomsArgs, never>>, languages?: Resolver<Array<ResolversTypes['Language']>, ParentType, ContextType>, languagesWithIdioms?: Resolver<Array<ResolversTypes['Language']>, ParentType, ContextType>, countries?: Resolver<Array<ResolversTypes['Country']>, ParentType, ContextType, RequireFields<QueryCountriesArgs, never>>, idiomChangeProposal?: Resolver<ResolversTypes['IdiomChangeProposal'], ParentType, ContextType, RequireFields<QueryIdiomChangeProposalArgs, never>>, idiomChangeProposals?: Resolver<ResolversTypes['IdiomChangeProposalConnection'], ParentType, ContextType, RequireFields<QueryIdiomChangeProposalsArgs, never>>, }; export type UserResolvers<ContextType = any, ParentType extends ResolversParentTypes['User'] = ResolversParentTypes['User']> = { id?: Resolver<ResolversTypes['ID'], ParentType, ContextType>, name?: Resolver<ResolversTypes['String'], ParentType, ContextType>, avatar?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>, role?: Resolver<Maybe<ResolversTypes['UserRole']>, ParentType, ContextType>, providers?: Resolver<Array<Maybe<ResolversTypes['Login']>>, ParentType, ContextType>, __isTypeOf?: isTypeOfResolverFn<ParentType>, }; export type Resolvers<ContextType = any> = { Country?: CountryResolvers<ContextType>, Idiom?: IdiomResolvers<ContextType>, IdiomChangeProposal?: IdiomChangeProposalResolvers<ContextType>, IdiomChangeProposalConnection?: IdiomChangeProposalConnectionResolvers<ContextType>, IdiomChangeProposalEdge?: IdiomChangeProposalEdgeResolvers<ContextType>, IdiomConnection?: IdiomConnectionResolvers<ContextType>, IdiomEdge?: IdiomEdgeResolvers<ContextType>, IdiomOperationResult?: IdiomOperationResultResolvers<ContextType>, Language?: LanguageResolvers<ContextType>, Login?: LoginResolvers<ContextType>, Mutation?: MutationResolvers<ContextType>, PageInfo?: PageInfoResolvers<ContextType>, Query?: QueryResolvers<ContextType>, User?: UserResolvers<ContextType>, }; /** * @deprecated * Use "Resolvers" root object instead. If you wish to get "IResolvers", add "typesPrefix: I" to your config. */ export type IResolvers<ContextType = any> = Resolvers<ContextType>; export type DirectiveResolvers<ContextType = any> = { cacheControl?: CacheControlDirectiveResolver<any, any, ContextType>, auth?: AuthDirectiveResolver<any, any, ContextType>, }; /** * @deprecated * Use "DirectiveResolvers" root object instead. If you wish to get "IDirectiveResolvers", add "typesPrefix: I" to your config. */ export type IDirectiveResolvers<ContextType = any> = DirectiveResolvers<ContextType>;
38.870175
203
0.756951
dbc7f0e3952e431e2d252b16f1fbd3ea017a5a54
384
dart
Dart
lib/weather/models/location.dart
hnabbasi/flutter_weather_bloc
638b780076272ffadc2a2128581867217b9f8fdc
[ "Apache-2.0" ]
null
null
null
lib/weather/models/location.dart
hnabbasi/flutter_weather_bloc
638b780076272ffadc2a2128581867217b9f8fdc
[ "Apache-2.0" ]
null
null
null
lib/weather/models/location.dart
hnabbasi/flutter_weather_bloc
638b780076272ffadc2a2128581867217b9f8fdc
[ "Apache-2.0" ]
null
null
null
import 'package:json_annotation/json_annotation.dart'; part 'location.g.dart'; @JsonSerializable() class Location { final String cityName; final String stateName; Location({required this.cityName, required this.stateName}); factory Location.fromJson(Map<String, dynamic> json) => _$LocationFromJson(json); Map<String, dynamic> toJson() => _$LocationToJson(this); }
22.588235
62
0.744792
5dcb843f0f55bbe0019891c5b46a6dbb9dc2fcd8
1,281
go
Go
mod.go
ofunc/lmodoffice
e090a92c1182a12d94f59dd13dc8214416a03af7
[ "Zlib" ]
1
2021-09-18T14:48:45.000Z
2021-09-18T14:48:45.000Z
mod.go
ofunc/lmodoffice
e090a92c1182a12d94f59dd13dc8214416a03af7
[ "Zlib" ]
null
null
null
mod.go
ofunc/lmodoffice
e090a92c1182a12d94f59dd13dc8214416a03af7
[ "Zlib" ]
1
2020-11-29T19:25:18.000Z
2020-11-29T19:25:18.000Z
/* Copyright 2019 by ofunc This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ // A simple Lua module for converting various office documents into OOXML format files. package lmodoffice import ( "ofunc/lua" ) // Open opens the module. func Open(l *lua.State) int { l.NewTable(0, 4) l.Push("version") l.Push("1.0.0") l.SetTableRaw(-3) l.Push("toxlsx") l.Push(lToXLSX) l.SetTableRaw(-3) l.Push("todocx") l.Push(lToDOCX) l.SetTableRaw(-3) l.Push("topptx") l.Push(lToPPTX) l.SetTableRaw(-3) return 1 }
24.634615
87
0.758002
207f4de5d3b1f70f394e439ffcd3ad1ebbe5816d
25,377
css
CSS
public/assets/web/frontend_old/practice/asus/css/web/overview.css
hahaha0417/laravel_migrate
c1ef4e75a0e0dadeef5f2ba2816acf31073e2d57
[ "MIT" ]
null
null
null
public/assets/web/frontend_old/practice/asus/css/web/overview.css
hahaha0417/laravel_migrate
c1ef4e75a0e0dadeef5f2ba2816acf31073e2d57
[ "MIT" ]
26
2020-10-17T04:29:12.000Z
2021-05-15T06:25:58.000Z
public/assets/web/frontend_old/practice/asus/css/web/overview.css
hahaha0417/laravel_migrate
c1ef4e75a0e0dadeef5f2ba2816acf31073e2d57
[ "MIT" ]
null
null
null
.product-intro ul { list-style-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAAHe9q7oAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADlJREFUeNpiYFj03xMggBiAxDOAAGIEEQwMDJIAAQRjJIMY/4GMFwABBpdigIDnTEAiBSQDxE9BbABCMROmV/rSAQAAAABJRU5ErkJggg==) } #overview-top-nav { margin-bottom: 20px; background: #e2e2e2; background: -moz-linear-gradient(top, #fff 1%, #e2e2e2 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(1%, #fff), color-stop(100%, #e2e2e2)); background: -webkit-linear-gradient(top, #fff 1%, #e2e2e2 100%); background: -o-linear-gradient(top, #fff 1%, #e2e2e2 100%); background: -ms-linear-gradient(top, #fff 1%, #e2e2e2 100%); background: linear-gradient(to bottom, #ffffff 1%, #e2e2e2 100%); filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e2e2e2', GradientType=0) } #overview-top-nav .inner { width: 960px; margin: 0 auto } #overview-top-nav .page-title { margin: 0; padding-top: 10px } #overview-top-nav.fixed { position: fixed; top: 0; z-index: 17; width: 100%; height: 56px; background-color: #fff; background-color: rgba(255, 255, 255, 0.8) } #rog_black_style .product-intro ul { list-style-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAAHe9q7oAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADpJREFUeNpiWMjM5AkQQAxA4hlAAIEJIP4PEEAwhicTAwODJBDPAwgwRrA8hAMCz0EyKUD8AoifgtgAPDwOBRShMx8AAAAASUVORK5CYII=) } #rog_black_style .product-intro ul li { color: #ffffff } #rog_black_style #overview-top-nav { margin-bottom: 20px; background: #900100; background: -moz-linear-gradient(top, #c40100 1%, #900100 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(1%, #c40100), color-stop(100%, #900100)); background: -webkit-linear-gradient(top, #c40100 1%, #900100 100%); background: -o-linear-gradient(top, #c40100 1%, #900100 100%); background: -ms-linear-gradient(top, #c40100 1%, #900100 100%); background: linear-gradient(to bottom, #c40100 1%, #900100 100%); filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#c40100', endColorstr='#900100', GradientType=0) } #rog_black_style #breadcrumbs, #rog_black_style .page-title { color: #ffffff } #rog_black_style #breadcrumbs a { color: #ffffff } #rog_black_style #breadcrumbs a:hover { color: #000 } #rog_black_style .nav-tabs>li>a { color: #ffffff } #rog_black_style .nav-tabs>.active:after { border-color: #000 transparent } #rog_black_style .product-slogan { color: #c8c8c8 } #rog_black_style .add-to-list { color: #a10302 } #rog_black_style .add-to-list:hover { color: #920201 } #rog_black_style #overview #product_similar_area a:hover h3, #rog_black_style #overview #product_accessory_area a:hover h3 { color: #a10302 } #rog_black_style #overview #product_similar_area h3, #rog_black_style #overview #product_accessory_area h3, #rog_black_style #overview #product_similar_area p, #rog_black_style #overview #product_accessory_area p, #rog_black_style .all-product-line-footer li { color: #8a8a8a } #rog_black_style #product_similar_area .similar-zone li { border-bottom: 1px solid #505050 } #rog_black_style .span8-line { border-left: 1px solid #505050 } #rog_black_style hr.gray { background: #505050; color: #505050; display: none } #rog_black_style #product-footer-zone { background-image: none; border-top: 0px solid #505050; margin-top: 20px !important } #rog_black_style #MDA { color: #fff } #rog_black_style .width-line-gray { background-image: none; border-bottom: 1px solid #505050 } #rog_black_style .product-aside { padding-bottom: 10px } #rog_black_style #Product_BottomSection { margin: 0 0 0 36px; border-top: 1px solid #505050; border-bottom: 1px solid #505050; padding: 30px 0 } #rog_black_style #product_content_area h2 { color: #C8C8C8 } #rog_black_style #product_content_area .accessories-area { width: 576px; width: 568px \9 } #rog_black_style #product_content_area .similar-area { width: 296px; width: 288px \9; margin: 0 } #rog_black_style .sb-cut-nav a.active { background-color: #a10302 } #rog_black_style .sb-cut-nav a:hover { background-color: #a10302 } #rog_black_style #overview-aside-nav ul li b { color: #a10302 } #rog_black_style #overview-aside-nav ul li:hover b { display: block !important; -webkit-animation: fadein 0.3s ease-out; -moz-animation: fadein 0.3s ease-out; -ms-animation: fadein 0.3s ease-out; -o-animation: fadein 0.3s ease-out; animation: fadein 0.3s ease-out } #rog_black_style #overview-aside-nav ul li:hover div { background: #a10302 } #rog_black_style #overview-aside-nav ul li.on { height: 30px !important } #rog_black_style #overview-aside-nav ul li.on div { background: #a10302 } .column { float: left } .column .columns_ab .column, .columns_ab .column { width: 49% } .columns_abb div.last, .columns_aaab div.last, .columns_abcd div.last, .columns_abc div.last, .columns_abbb div.last, .columns_aab div.last, .columns_ab div.last { float: right; margin-right: 0 } .column .columns_aab .column, .columns_aab .column { width: 66% } .column .columns_aab div.last, .columns_aab div.last { width: 32% } .column .columns_abb .column, .columns_abb .column { width: 32% } .column .columns_abb div.last, .columns_abb div.last { width: 64% } .column .columns_aaab .column, .columns_aaab .column { width: 74.5% } .column .columns_aaab div.last, .columns_aaab div.last { width: 23.5% } .column .columns_abbb .column, .columns_abbb .column { width: 23.5% } .column .columns_abbb div.last, .columns_abbb div.last { width: 74.5% } .columns_abc .column { width: 32%; margin-right: 2% } .columns_abcd .column { width: 23.5%; margin-right: 2% } .columns_ab, .columns_aab, .columns_abb, .columns_aaab, .columns_abbb, .columns_abc, .columns_abcd { *zoom: 1; width: 100% } .columns_ab:before, .columns_ab:after, .columns_aab:before, .columns_aab:after, .columns_abb:before, .columns_abb:after, .columns_aaab:before, .columns_aaab:after, .columns_abbb:before, .columns_abbb:after, .columns_abc:before, .columns_abc:after, .columns_abcd:before, .columns_abcd:after { display: table; content: "" } .columns_ab:after, .columns_aab:after, .columns_abb:after, .columns_aaab:after, .columns_abbb:after, .columns_abc:after, .columns_abcd:after { clear: both } .columns_ab>.column { width: 48.7179%; display: block; float: left } .columns_ab>.column:first-child { margin-left: 0 } .columns_ab>.column.last { margin-left: 2.5641% } .columns_abb>.column { width: 31.6239%; display: block; float: left } .columns_abb>.column:first-child { margin-left: 0 } .columns_abb>.column.last { width: 65.812%; margin-left: 2.5641% } .columns_aab>.column { width: 65.812%; display: block; float: left } .columns_aab>.column:first-child { margin-left: 0 } .columns_aab>.column.last { width: 31.6239%; margin-left: 2.5641% } .columns_abbb>.column { width: 23.0769%; display: block; float: left } .columns_abbb>.column:first-child { margin-left: 0 } .columns_abbb>.column.last { width: 74.359%; margin-left: 2.5641% } .columns_aaab>.column { width: 74.359%; display: block; float: left } .columns_aaab>.column:first-child { margin-left: 0 } .columns_aaab>.column.last { width: 23.0769%; margin-left: 2.5641% } .columns_abc>.column { width: 31.62393%; display: block; float: left; margin-left: 2.5641% } .columns_abc>.column:first-child { margin-left: 0 } .columns_abcd>.column { width: 23.0769%; display: block; float: left; margin-left: 2.5641% } .columns_abcd>.column:first-child { margin-left: 0 } .coverover { position: relative } .columns_abbb:after, .columns_abb:after, .columns_aaab:after, .columns_abcd:after, .columns_abc:after, .columns_aab:after, .columns_ab:after { content: "."; display: block; height: 0; clear: both; visibility: hidden } #product_content_area h2 { background-image: none; font-size: 24px; color: #353535; margin-bottom: 0.1em; height: auto; padding: 0; font-weight: normal } #product_content_area.component_style #old-sectionOverview h2, #product_content_area.component_style #sectionOverview h2 { background-image: none; font-size: 24px; color: #353535; margin-bottom: 0; height: auto; padding: 0; font-weight: normal } #product_content_area h3 { background-image: none; font-size: 21px; color: #33b9ff; margin-bottom: 0.4em; height: auto; padding: 0; font-weight: normal } #product_content_area.component_style #old-sectionOverview h3, #product_content_area.component_style #sectionOverview h3 { background-image: none; font-size: 21px; color: #33b9ff; margin-bottom: 0.4em; height: auto; padding: 0; font-weight: normal } #product_content_area h4 { background-image: none; font-size: 146.5%; color: #353535; margin-bottom: 0.4em; height: auto; padding: 0; font-weight: normal } #product_content_area.component_style #old-sectionOverview h4, #product_content_area.component_style #sectionOverview h4, #product_content_area h4.component_style { display: block; font-size: 131%; background: url(/images/h4_bg.gif) scroll repeat-x left top; padding: 6px 5px 7px 20px; font-weight: bolder; margin-bottom: 0.8em; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px } #product_content_area h4.consumer_style { background-image: none; font-size: 146.5%; color: #353535; margin-bottom: 0.4em; height: auto; padding: 0; font-weight: normal } #product_content_area #epc_style h4, #product_content_area #mobile_style h4 { background-image: none; font-size: 24px; color: #353535; margin-bottom: 0.1em; height: auto; padding: 0; font-weight: normal } #product_content_area h5, #product_content_area.component_style #sectionOverview h5, #product_content_area.component_style #old-sectionOverview h5 { font-size: 116%; color: #33b9ff; line-height: 100%; margin-bottom: 0.8em; margin-top: 0px } #product_content_area p { margin-bottom: 4em } #product_content_area .leftimage { margin-left: -38px; float: none; position: relative } #product_content_area .leftimagefloat { margin-left: -38px; float: left } #product_content_area .rightimage { margin-right: -38px; float: right; position: relative } #product_content_area .rightimagefloat { margin-right: -38px; float: right; padding-right: 0 } img.standalone { margin-bottom: 3.5em } .function_icon { float: left; position: relative; padding-right: 1.5em; padding-bottom: 3.5em } #oldoverview { width: 520px; margin-right: auto; margin-left: auto; line-height: normal; display: block } #oldoverview td, #oldoverview tr, #oldoverview th { margin: 0; padding: 0; text-align: left; color: #787878; font-size: 11px } #oldoverview td p { padding: 5px 0 5px 0; margin: 0; text-align: left; color: #787878; font-size: 11px } #oldoverview td .title-01 { font-size: 18px; font-weight: normal; color: #4F5E8F } #oldoverview td .title-02-02 { font-size: 12px; font-weight: bolder; color: #4F5E8F; line-height: 20px } #oldoverview td .title-02-02_s { font-size: 14px; color: #3848A8; line-height: 20px } #oldoverview td .title-02 { color: #4F5E8F; font-size: 16px; font-weight: bolder; line-height: 20px } #oldoverview td .title-05 { font-size: 14px; font-weight: normal; color: #7D9ECA } #oldoverview td .title-06 { color: #545CFF; font-size: 11px; font-weight: bold } #oldoverview td .title-07 { font-size: 11px; color: #545CFF } #oldoverview td input, select, textarea { color: #7F7F7F } #oldoverview td .text { color: #787878 } #oldoverview td .title-06-underline { font-weight: bold; color: #545cff; text-decoration: underline } #oldoverview td .white { color: #FFFFFF; text-decoration: none } #oldoverview h4 { background: url(//www.asus.com/999/images/products/share/h04.gif) no-repeat; color: #4F5E8F; font-size: 16px; font-weight: bolder; line-height: 22px; margin: 0; padding: 0 0 0 12px } #oldoverview h5 { background: url(//www.asus.com/999/images/products/share/h05.gif) no-repeat; color: #545CFF; font-size: 11px; font-weight: bold; height: 14px; margin: 0; padding: 0 0 0 13px } #oldoverview h6 { color: #333333; font-size: 11px; font-weight: bold; margin: 0; padding: 0 } #oldoverview .imgR { border: 0 none; float: right; margin: 5px 0 5px 5px } #oldoverview .imgL { border: 0 none; float: left; margin: 5px 5px 5px 0 } #oldoverview .imgC { border: 0 none; display: block; margin-left: auto; margin-right: auto; padding: 5px; text-align: center } #oldoverview .note_text { color: #666666; font-size: 9px } #oldoverview .Ltype1 { list-style-image: url(//www.asus.com/999/images/public/d.gif); margin: 0; padding: 15px } ul.bluecircle { list-style-image: none; list-style-type: none; list-style-position: outside; margin: 0 } ul.bluecircle li { padding: 3px 0 3px 13px; background: url(/images/bluecircle.gif) scroll no-repeat 0 5px } ul.blackcircle { list-style-image: none; list-style-type: none; list-style-position: outside; margin: 0 } ul.blackcircle li { padding: 3px 0 3px 13px; background: url(/images/blackcircle.gif) scroll no-repeat 0 5px } .newstable { border-width: 1px; border-spacing: 0px; border-style: solid; border-color: #ccc; border-collapse: collapse } .newstable td { border-width: 1px; padding: 3px; border-style: solid; border-color: #ccc } #footer_content { float: left; font-size: 10px; color: #666666; padding: 20px 40px 20px 40px; width: 870px; background: transparent url(/images/overview_bg.gif) repeat-y scroll center top } #footer_content ul { list-style-image: none; list-style-type: none; list-style-position: outside; margin: 0 } #footer_content ul li { padding: 0 0 0 13px; background: url(/images/blackcircle.gif) scroll no-repeat 0 0 } .bluetable { border-width: 1px; border-spacing: 0px; border-style: solid; border-color: #BBBBBB; border-collapse: collapse } .bluetable td { border-width: 1px; padding: 5px; border-style: solid; border-color: #bbb } .bluetable td:first-child { background-color: #e3e3e3; color: #666666 } .bluetable tr:first-child td { background-color: #0089f9; color: #FFF } .graytable { border-width: 1px; border-spacing: 0px; border-style: solid; border-color: #BBBBBB; border-collapse: collapse } .graytable td { border-width: 1px; padding: 5px; border-style: solid; border-color: #bbb } .graytable td:first-child { background-color: #e3e3e3; color: #666666 } .graytable tr:first-child td { background-color: #555555; color: #FFF } #product_content_area .top_full_background { margin-left: -38px; margin-top: -46px; margin-right: -38px; background-repeat: no-repeat; background-position: center; position: relative; z-index: -1 } .up_1 { margin-top: -20px } .up_2 { margin-top: -40px } .up_3 { margin-top: -60px } .up_4 { margin-top: -80px } .up_5 { margin-top: -100px } .up_6 { margin-top: -120px } .up_7 { margin-top: -140px } .up_8 { margin-top: -160px } .up_9 { margin-top: -180px } .up_10 { margin-top: -200px } .up_11 { margin-top: -220px } .up_12 { margin-top: -240px } .up_13 { margin-top: -260px } .up_14 { margin-top: -280px } .up_15 { margin-top: -300px } .up_16 { margin-top: -320px } .up_17 { margin-top: -340px } .up_18 { margin-top: -360px } .up_19 { margin-top: -380px } .up_20 { margin-top: -400px } .down_1 { margin-top: 20px } .down_2 { margin-top: 40px } .down_3 { margin-top: 60px } .down_4 { margin-top: 80px } .down_5 { margin-top: 100px } .down_6 { margin-top: 120px } .down_7 { margin-top: 140px } .down_8 { margin-top: 160px } .down_9 { margin-top: 180px } .down_10 { margin-top: 200px } .down_11 { margin-top: 220px } .down_12 { margin-top: 240px } .down_13 { margin-top: 260px } .down_14 { margin-top: 280px } .down_15 { margin-top: 300px } .down_16 { margin-top: 320px } .down_17 { margin-top: 340px } .down_18 { margin-top: 360px } .down_19 { margin-top: 380px } .down_20 { margin-top: 400px } .coverover { position: relative } .base_map { position: relative } .blue { color: #00B7FF } .orange { color: #FF6C00 } .white { color: #FFFFFF } #product_content_area #features .feature_img_area { float: left; overflow: hidden; text-align: center; width: 170px; margin-right: 10px } #product_content_area #features .feature_intro_area { float: left; width: 690px } #product_content_area #features .feature_intro_area h2 { -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; background: url("/images/h4_bg.gif") repeat-x scroll left top transparent; padding-left: 10px; width: 680px; margin-bottom: 20px } #product_content_area #features .feature_intro_area p { margin-bottom: 2em } #product_content_area #features .feature_more_content { padding-left: 180px } #product_content_area #features .feature_div { margin-top: 4em } #slogo { float: left; margin: 10px 0; width: 420px } #slogo img { padding-right: 10px } #thumbnail_area #moregallery img { border: none } #overview #sectionOverview div.column { margin-left: 0; padding: 0 } #overview #sectionOverview { line-height: 18px; font-size: 12px } #overview #sectionOverview table { border-collapse: separate; border-spacing: 0 } #product_content_area h3 { line-height: 1 } #product-info-zone>#product-quick-logo>.unstyled li { float: right } .product-head>#product-info-zone { margin-bottom: 20px } #main-zone>.container h1.page-title { margin-bottom: 0px !important; padding-bottom: 0px !important } #overview .product-head #product-main-image .product-intro ul li { font-size: 12px; padding: 5px 0; line-height: 14px } #overview .product-head #product-main-image .product-intro ul { margin: 0 0 10px 19px } #review #product-review-area #product_news_area .new-article a h1 { color: #000000 } #review #product-review-area #product_news_area .new-article a p { color: #000000 } #review #product-review-area #product_news_area .new-article a img { float: left; margin-right: 10px } #review #product-review-area #product_news_area .new-article a:hover h1 { color: #33b9ff } #review #product-review-area #product_news_area .new-article a:hover p { color: #000000 } #overview>#ctl00_ContentPlaceHolder1_ctl00_overview1_span_overview>.column { float: none !important } #Product_BottomSection { padding: 0px } #sectionOverview [class*="span"] { float: left; min-height: 1px; margin-left: 20px } #sectionOverview .row-fluid { width: 100%; *zoom: 1 } #sectionOverview .row-fluid:before, #sectionOverview .row-fluid:after { display: table; content: ""; line-height: 0 } #sectionOverview .row-fluid:after { clear: both } #sectionOverview .row-fluid [class*="span"] { display: block; width: 100%; min-height: 30px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; float: left; margin-left: 2.127659574468085%; *margin-left: 2% } #sectionOverview .row-fluid [class*="span"]:first-child { margin-left: 0 } #sectionOverview .row-fluid .controls-row [class*="span"]+[class*="span"] { margin-left: 2.127659574468085% } #sectionOverview .row-fluid .span12 { width: 100%; *width: 99.64680851063829% } #sectionOverview .row-fluid .span11 { width: 91.48936170212765%; *width: 91.13617021276594% } #sectionOverview .row-fluid .span10 { width: 82.97872340425532%; *width: 82.62553191489361% } #sectionOverview .row-fluid .span9 { width: 74.46808510638297%; *width: 74.11489361702126% } #sectionOverview .row-fluid .span8 { width: 65.95744680851064%; *width: 65.60425531914893% } #sectionOverview .row-fluid .span7 { width: 57.44680851063829%; *width: 57.09361702127659% } #sectionOverview .row-fluid .span6 { width: 48.93617021276595%; *width: 48.58297872340425% } #sectionOverview .row-fluid .span5 { width: 40.42553191489362%; *width: 40.07234042553192% } #sectionOverview .row-fluid .span4 { width: 31.914893617021278%; *width: 31.561702127659576% } #sectionOverview .row-fluid .span3 { width: 23.404255319148934%; *width: 23.051063829787233% } #sectionOverview .row-fluid .span2 { width: 14.893617021276595%; *width: 14.640425531914894% } #sectionOverview .row-fluid .span1 { width: 6.382978723404255%; *width: 6.139787234042553% } #sectionOverview .row-fluid .offset12 { margin-left: 104.25531914893617%; *margin-left: 104.14893617021275% } #sectionOverview .row-fluid .offset12:first-child { margin-left: 102.12765957446808%; *margin-left: 102.02127659574467% } #sectionOverview .row-fluid .offset11 { margin-left: 95.74468085106382%; *margin-left: 95.6382978723404% } #sectionOverview .row-fluid .offset11:first-child { margin-left: 93.61702127659574%; *margin-left: 93.51063829787232% } #sectionOverview .row-fluid .offset10 { margin-left: 87.23404255319149%; *margin-left: 87.12765957446807% } #sectionOverview .row-fluid .offset10:first-child { margin-left: 85.1063829787234%; *margin-left: 84.99999999999999% } #sectionOverview .row-fluid .offset9 { margin-left: 78.72340425531914%; *margin-left: 78.61702127659572% } #sectionOverview .row-fluid .offset9:first-child { margin-left: 76.59574468085106%; *margin-left: 76.48936170212764% } #sectionOverview .row-fluid .offset8 { margin-left: 70.2127659574468%; *margin-left: 70.10638297872339% } #sectionOverview .row-fluid .offset8:first-child { margin-left: 68.08510638297872%; *margin-left: 67.9787234042553% } #sectionOverview .row-fluid .offset7 { margin-left: 61.70212765957446%; *margin-left: 61.59574468085106% } #sectionOverview .row-fluid .offset7:first-child { margin-left: 59.574468085106375%; *margin-left: 59.46808510638297% } #sectionOverview .row-fluid .offset6 { margin-left: 53.191489361702125%; *margin-left: 53.085106382978715% } #sectionOverview .row-fluid .offset6:first-child { margin-left: 51.063829787234035%; *margin-left: 50.95744680851063% } #sectionOverview .row-fluid .offset5 { margin-left: 44.68085106382979%; *margin-left: 44.57446808510638% } #sectionOverview .row-fluid .offset5:first-child { margin-left: 42.5531914893617%; *margin-left: 42.4468085106383% } #sectionOverview .row-fluid .offset4 { margin-left: 36.170212765957444%; *margin-left: 36.06382978723405% } #sectionOverview .row-fluid .offset4:first-child { margin-left: 34.04255319148936%; *margin-left: 33.93617021276596% } #sectionOverview .row-fluid .offset3 { margin-left: 27.659574468085104%; *margin-left: 27.5531914893617% } #sectionOverview .row-fluid .offset3:first-child { margin-left: 25.53191489361702%; *margin-left: 25.425531914893618% } #sectionOverview .row-fluid .offset2 { margin-left: 19.148936170212764%; *margin-left: 19.04255319148936% } #sectionOverview .row-fluid .offset2:first-child { margin-left: 17.02127659574468%; *margin-left: 16.914893617021278% } #sectionOverview .row-fluid .offset1 { margin-left: 10.638297872340425%; *margin-left: 10.53191489361702% } #sectionOverview .row-fluid .offset1:first-child { margin-left: 8.51063829787234%; *margin-left: 8.404255319148938% } #sectionOverview [class*="span"].hide, #sectionOverview .row-fluid [class*="span"].hide { display: none } #sectionOverview [class*="span"].pull-right, #sectionOverview .row-fluid [class*="span"].pull-right { float: right } @media (max-width: 767px) { #sectionOverview .row-fluid [class*="span"] { float: none; width: 100%; margin: 10px 0 } #sectionOverview .row-fluid [class*="offset"], #sectionOverview .row-fluid [class*="offset"]:first-child { margin-left: 0 } } .column.first> table { table-layout: fixed; }
18.591209
253
0.671789
47109f6f786940a3aa234a7753e4b3983f819f8d
5,589
swift
Swift
Sources/TMDb/Services/TVShows/TMDbTVShowService.swift
adamayoung/TMDb
35dc1330825cd79ac616d1c5b17ba157232864db
[ "Apache-2.0" ]
14
2020-05-08T00:21:10.000Z
2022-03-26T07:33:35.000Z
Sources/TMDb/Services/TVShows/TMDbTVShowService.swift
adamayoung/TMDb
35dc1330825cd79ac616d1c5b17ba157232864db
[ "Apache-2.0" ]
24
2020-09-14T17:34:54.000Z
2022-03-03T21:59:59.000Z
Sources/TMDb/Services/TVShows/TMDbTVShowService.swift
adamayoung/TMDb
35dc1330825cd79ac616d1c5b17ba157232864db
[ "Apache-2.0" ]
10
2020-05-08T00:21:11.000Z
2022-01-25T04:06:08.000Z
import Foundation #if canImport(Combine) import Combine #endif final class TMDbTVShowService: TVShowService { private let apiClient: APIClient init(apiClient: APIClient = TMDbAPIClient.shared) { self.apiClient = apiClient } func fetchDetails(forTVShow id: TVShow.ID, completion: @escaping (Result<TVShow, TMDbError>) -> Void) { apiClient.get(endpoint: TVShowsEndpoint.details(tvShowID: id), completion: completion) } func fetchCredits(forTVShow tvShowID: TVShow.ID, completion: @escaping (Result<ShowCredits, TMDbError>) -> Void) { apiClient.get(endpoint: TVShowsEndpoint.credits(tvShowID: tvShowID), completion: completion) } func fetchReviews(forTVShow tvShowID: TVShow.ID, page: Int?, completion: @escaping (Result<ReviewPageableList, TMDbError>) -> Void) { apiClient.get(endpoint: TVShowsEndpoint.reviews(tvShowID: tvShowID, page: page), completion: completion) } func fetchImages(forTVShow tvShowID: TVShow.ID, completion: @escaping (Result<ImageCollection, TMDbError>) -> Void) { apiClient.get(endpoint: TVShowsEndpoint.images(tvShowID: tvShowID), completion: completion) } func fetchVideos(forTVShow tvShowID: TVShow.ID, completion: @escaping (Result<VideoCollection, TMDbError>) -> Void) { apiClient.get(endpoint: TVShowsEndpoint.videos(tvShowID: tvShowID), completion: completion) } func fetchRecommendations(forTVShow tvShowID: TVShow.ID, page: Int?, completion: @escaping (Result<TVShowPageableList, TMDbError>) -> Void) { apiClient.get(endpoint: TVShowsEndpoint.recommendations(tvShowID: tvShowID, page: page), completion: completion) } func fetchSimilar(toTVShow tvShowID: TVShow.ID, page: Int?, completion: @escaping (Result<TVShowPageableList, TMDbError>) -> Void) { apiClient.get(endpoint: TVShowsEndpoint.similar(tvShowID: tvShowID, page: page), completion: completion) } func fetchPopular(page: Int?, completion: @escaping (Result<TVShowPageableList, TMDbError>) -> Void) { apiClient.get(endpoint: TVShowsEndpoint.popular(page: page), completion: completion) } } #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) extension TMDbTVShowService { func detailsPublisher(forTVShow id: TVShow.ID) -> AnyPublisher<TVShow, TMDbError> { apiClient.get(endpoint: TVShowsEndpoint.details(tvShowID: id)) } func creditsPublisher(forTVShow tvShowID: TVShow.ID) -> AnyPublisher<ShowCredits, TMDbError> { apiClient.get(endpoint: TVShowsEndpoint.credits(tvShowID: tvShowID)) } func reviewsPublisher(forTVShow tvShowID: TVShow.ID, page: Int?) -> AnyPublisher<ReviewPageableList, TMDbError> { apiClient.get(endpoint: TVShowsEndpoint.reviews(tvShowID: tvShowID, page: page)) } func imagesPublisher(forTVShow tvShowID: TVShow.ID) -> AnyPublisher<ImageCollection, TMDbError> { apiClient.get(endpoint: TVShowsEndpoint.images(tvShowID: tvShowID)) } func videosPublisher(forTVShow tvShowID: TVShow.ID) -> AnyPublisher<VideoCollection, TMDbError> { apiClient.get(endpoint: TVShowsEndpoint.videos(tvShowID: tvShowID)) } func recommendationsPublisher(forTVShow tvShowID: TVShow.ID, page: Int?) -> AnyPublisher<TVShowPageableList, TMDbError> { apiClient.get(endpoint: TVShowsEndpoint.recommendations(tvShowID: tvShowID, page: page)) } func similarPublisher(toTVShow tvShowID: TVShow.ID, page: Int?) -> AnyPublisher<TVShowPageableList, TMDbError> { apiClient.get(endpoint: TVShowsEndpoint.similar(tvShowID: tvShowID, page: page)) } func popularPublisher(page: Int?) -> AnyPublisher<TVShowPageableList, TMDbError> { apiClient.get(endpoint: TVShowsEndpoint.popular(page: page)) } } #endif #if swift(>=5.5) && !os(Linux) @available(macOS 12, iOS 15.0, tvOS 15.0, watchOS 8.0, *) extension TMDbTVShowService { func details(forTVShow id: TVShow.ID) async throws -> TVShow { try await apiClient.get(endpoint: TVShowsEndpoint.details(tvShowID: id)) } func credits(forTVShow tvShowID: TVShow.ID) async throws -> ShowCredits { try await apiClient.get(endpoint: TVShowsEndpoint.credits(tvShowID: tvShowID)) } func reviews(forTVShow tvShowID: TVShow.ID, page: Int?) async throws -> ReviewPageableList { try await apiClient.get(endpoint: TVShowsEndpoint.reviews(tvShowID: tvShowID, page: page)) } func images(forTVShow tvShowID: TVShow.ID) async throws -> ImageCollection { try await apiClient.get(endpoint: TVShowsEndpoint.images(tvShowID: tvShowID)) } func videos(forTVShow tvShowID: TVShow.ID) async throws -> VideoCollection { try await apiClient.get(endpoint: TVShowsEndpoint.videos(tvShowID: tvShowID)) } func recommendations(forTVShow tvShowID: TVShow.ID, page: Int?) async throws -> TVShowPageableList { try await apiClient.get(endpoint: TVShowsEndpoint.recommendations(tvShowID: tvShowID, page: page)) } func similar(toTVShow tvShowID: TVShow.ID, page: Int?) async throws -> TVShowPageableList { try await apiClient.get(endpoint: TVShowsEndpoint.similar(tvShowID: tvShowID, page: page)) } func popular(page: Int?) async throws -> TVShowPageableList { try await apiClient.get(endpoint: TVShowsEndpoint.popular(page: page)) } } #endif
41.708955
120
0.699946
e8938922fb393d67c19fbad5be3a3da6246e6441
396
swift
Swift
TheRoadWest/Views/StatViewController.swift
gradyVickery/TheRoadWest
77aa0afb1fac5d3204a850d135a375877749f7ff
[ "MIT" ]
1
2019-12-17T16:05:58.000Z
2019-12-17T16:05:58.000Z
TheRoadWest/Views/StatViewController.swift
gradyVickery/TheRoadWest
77aa0afb1fac5d3204a850d135a375877749f7ff
[ "MIT" ]
null
null
null
TheRoadWest/Views/StatViewController.swift
gradyVickery/TheRoadWest
77aa0afb1fac5d3204a850d135a375877749f7ff
[ "MIT" ]
null
null
null
// // StatViewController.swift // TheRoadWest // // Created by Grady Vickery on 12/16/19. // Copyright © 2019 Grady Vickery. All rights reserved. // import UIKit class StatViewController: UIViewController { var food = 0 @IBOutlet weak var testLabel: UILabel! override func viewDidLoad() { testLabel.text = String(food) super.viewDidLoad() } }
18
56
0.646465
40e0779758366e86c9bae1550e991f1681e73218
5,207
py
Python
crs/crs/urls.py
git-MARx/Complaint-Redressal-master
cc2d7d842f82371bb3bfa2f12ab9371725c0fafd
[ "MIT" ]
null
null
null
crs/crs/urls.py
git-MARx/Complaint-Redressal-master
cc2d7d842f82371bb3bfa2f12ab9371725c0fafd
[ "MIT" ]
null
null
null
crs/crs/urls.py
git-MARx/Complaint-Redressal-master
cc2d7d842f82371bb3bfa2f12ab9371725c0fafd
[ "MIT" ]
null
null
null
from django.conf.urls import patterns, include, url from django.contrib import admin from django.conf import settings from django.conf.urls.static import static admin.autodiscover() urlpatterns = patterns('', url(r'^admin/', include(admin.site.urls)), url(r'^crs/$', 'login.views.login'), # url(r'^captcha/', include('captcha.urls')), url(r'^crs/login/$', 'login.views.afterLogin'), # url(r'^test/', 'user_module.views.ankt'), url(r'crs/ApproveComplain/','login.views.ApproveComplain'), url(r'logout/','login.views.logout'), url(r'^crs/complainView/$', 'student.views.studentComplainView'), url(r'^comment/$', 'student.views.comment'), url(r'^crs/viewComplain/$', 'student.views.studentViewComplain'), url(r'^crs/lodgeComplain/$', 'student.views.studentLodgeComplain'), url(r'^crs/studentHome/$', 'student.views.studentHome'), url(r'^crs/studentProfile/$', 'student.views.studentProfile'), url(r'^crs/rateSecretary/$', 'student.views.rateSecretary'), url(r'^crs/messrebate/$', 'student.views.studentMessRebate'), url(r'^crs/studPoll/$', 'student.views.studentPoll'), url(r'^crs/studProfile/$', 'student.views.studentProfile'), url(r'^crs/studRelodge/$', 'student.views.relodgeComplain'), url(r'^crs/studHostelLeave/$', 'student.views.studentHostelLeave'), url(r'^studEditProfile/$', 'student.views.studEditProfile'), url(r'^studAfterEditProfile/$', 'student.views.afterEditProfile'), url(r'^crs/lodgedComplainDetail/$', 'student.views.lodgeComplainDetail'), url(r'^crs/listComp/$', 'secretary.views.secComplainView'), url(r'^crs/listCompWardenOffice/$', 'wardenOffice.views.wardenOfficeComplainView'), url(r'^crs/secComp/$', 'secretary.views.secLodgeComplain'), url(r'^crs/wardenHome/$', 'warden.views.wardenHome'), url(r'^crs/wardenViewComplain/$', 'warden.views.wardenComplainView'), url(r'^crs/wardenViewSecretary/$', 'warden.views.viewSecretary'), url(r'^crs/wardenEditProfile/$', 'warden.views.wardenEditProfile'), url(r'^crs/forwardToWardenOff/$', 'secretary.views.forwardToWardenOffice'), url(r'^crs/rejectComplain/$', 'secretary.views.rejectComplain'), url(r'^crs/wardenComplain/$', 'wardenOffice.views.wardenOfficeComplainView'), url(r'^crs/forwardToWard/$', 'wardenOffice.views.forwardToWarden'), url(r'^changePassword/$', 'login.views.changePasswd'), url(r'^crs/resetPassword/$', 'login.views.resetPasswd'), url(r'^mailTo/$', 'login.views.sendEmailForPassword'), url(r'^confirmationLink/([0-9a-z]{64})/$', 'login.views.forgetPassword'), url(r'^ForgetPasswordButton/$', 'login.views.onClickForgetPassword'), url(r'^newPassword/([0-9a-z]{64})/$', 'login.views.resettingPassword'), url(r'^OpenHostelPage/$', 'student.views.OpenHostelPage'), url(r'^submitHostelPage/$', 'student.views.HostelLeavingSubmit'), url(r'^viewPastForm/$', 'student.views.viewPastHostelLeaveForms'), url(r'^viewFormID/([0-9]+)/$', 'student.views.viewForm'), url(r'^rejectID/([0-9]+)/$', 'student.views.rejectForm'), url(r'^approveID/([0-9]+)/$', 'student.views.approveForm'), url(r'^studHostelLeave/$', 'student.views.HostelLeavingSubmit'), url(r'^crs/poll/$', 'secretary.views.poll'), url(r'^crs/pollAddItem/$', 'secretary.views.pollAddItem'), url(r'^crs/pollViewItem/$', 'secretary.views.pollViewItem'), url(r'^crs/addingFoodItem/$', 'secretary.views.addingFoodItem'), url(r'^crs/pollMakeMeal/$', 'secretary.views.pollMakeMeal'), url(r'^crs/makingMeal/$', 'secretary.views.makingMeal'), url(r'^crs/loadRateSecPage/$','student.views.loadRateSecPage'), url(r'^studViewProfile/$','student.views.studentProfile'), url(r'^rateSecretary/$','student.views.rateSecretary'), url(r'^crs/viewMeal/$', 'secretary.views.viewMeal'), url(r'^crs/addItemToPoll/$', 'secretary.views.addItemToPoll'), # url(r'^crs/viewPollOptions/$', 'secretary.views.viewPollOptions'), url(r'^crs/pdf/([0-9]+)/$', 'student.views.downloadPDF'), url(r'^crs/list/$','student.views.list'), # url(r'^crs/viewrating/$','student.views.viewrating'), url(r'^Page/$','student.views.loadPage'), url(r'^crs/search/$', 'secretary.views.searchDatabase'), url(r'^crs/searchResult/$', 'secretary.views.searchItem'), url(r'^crs/showComplain/([A-Za-z1-2]+)/([A-Za-z]+)/$','wardenOffice.views.showHostelWiseComplain'), # url(r'^crs/showComplain/([A-Za-z]+)/([A-Za-z]+)/$', 'warden.views.showHostelTypeWiseComplain'), url(r'^crs/showComplain/([A-Za-z1-2]+)/([A-Za-z]+)/([A-Za-z]+)/$','wardenOffice.views.showHostelAdUnadWiseComplain'), # url(r'^crs/getInfo([A-Za-z].)/$', 'warden.views.showHostelWiseInfo'), url(r'^crs/getSecInfo/([A-Za-z1-2]+)/$','wardenOffice.views.showHostelSecWiseInfo'), url(r'^crs/getStudInfo/([A-Za-z1-2]+)/$','wardenOffice.views.showHostelStudWiseInfo'), url(r'^crs/pollOptions/$', 'student.views.pollPage'), url(r'^crs/pollChoice/$', 'student.views.studentPolling'), url(r'^crs/pollResult/$', 'student.views.pollResult'), )+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) # url(r'^complainDetail/$', 'secretary.views.lodgeComplainDetail'),
59.850575
121
0.686576
b2fdab74611ca607c1a5e2e63e4ac639ef552870
12,029
py
Python
tests/test_simple.py
ImportTaste/WebRequest
0cc385622624de16ec980e0c12d9080d593cab74
[ "WTFPL" ]
8
2018-06-04T09:34:28.000Z
2021-09-16T15:21:24.000Z
tests/test_simple.py
ImportTaste/WebRequest
0cc385622624de16ec980e0c12d9080d593cab74
[ "WTFPL" ]
4
2018-03-03T07:45:27.000Z
2019-12-26T20:38:18.000Z
tests/test_simple.py
ImportTaste/WebRequest
0cc385622624de16ec980e0c12d9080d593cab74
[ "WTFPL" ]
1
2019-12-26T20:36:32.000Z
2019-12-26T20:36:32.000Z
import unittest import socket import json import base64 import zlib import gzip import bs4 from http.server import BaseHTTPRequestHandler, HTTPServer from threading import Thread import WebRequest from . import testing_server class TestPlainCreation(unittest.TestCase): def test_plain_instantiation_1(self): wg = WebRequest.WebGetRobust() self.assertTrue(wg is not None) def test_plain_instantiation_2(self): wg = WebRequest.WebGetRobust(cloudflare=True) self.assertTrue(wg is not None) def test_plain_instantiation_3(self): wg = WebRequest.WebGetRobust(use_socks=True) self.assertTrue(wg is not None) class TestSimpleFetch(unittest.TestCase): def setUp(self): self.wg = WebRequest.WebGetRobust() # Configure mock server. self.mock_server_port, self.mock_server, self.mock_server_thread = testing_server.start_server(self, self.wg) def tearDown(self): self.mock_server.shutdown() self.mock_server_thread.join() self.wg = None def test_fetch_1(self): page = self.wg.getpage("http://localhost:{}".format(self.mock_server_port)) self.assertEqual(page, 'Root OK?') def test_fetch_decode_1(self): # text/html content should be decoded automatically. page = self.wg.getpage("http://localhost:{}/html-decode".format(self.mock_server_port)) self.assertEqual(page, 'Root OK?') def test_fetch_soup_1(self): # text/html content should be decoded automatically. page = self.wg.getSoup("http://localhost:{}/html/real".format(self.mock_server_port)) self.assertEqual(page, bs4.BeautifulSoup('<html><body>Root OK?</body></html>', 'lxml')) def test_fetch_soup_2(self): page = self.wg.getSoup("http://localhost:{}/html-decode".format(self.mock_server_port)) self.assertEqual(page, bs4.BeautifulSoup('<html><body><p>Root OK?</p></body></html>', 'lxml')) def test_fetch_soup_3(self): # getSoup fails to fetch content that's not of content-type text/html with self.assertRaises(WebRequest.ContentTypeError): self.wg.getSoup("http://localhost:{}/binary_ctnt".format(self.mock_server_port)) def test_fetch_decode_json(self): # text/html content should be decoded automatically. page = self.wg.getJson("http://localhost:{}/json/valid".format(self.mock_server_port)) self.assertEqual(page, {'oh': 'hai'}) page = self.wg.getJson("http://localhost:{}/json/no-coding".format(self.mock_server_port)) self.assertEqual(page, {'oh': 'hai'}) with self.assertRaises(json.decoder.JSONDecodeError): page = self.wg.getJson("http://localhost:{}/json/invalid".format(self.mock_server_port)) def test_fetch_compressed(self): page = self.wg.getpage("http://localhost:{}/compressed/gzip".format(self.mock_server_port)) self.assertEqual(page, 'Root OK?') page = self.wg.getpage("http://localhost:{}/compressed/deflate".format(self.mock_server_port)) self.assertEqual(page, 'Root OK?') def test_file_and_name_1(self): page, fn = self.wg.getFileAndName("http://localhost:{}/filename/path-only.txt".format(self.mock_server_port)) self.assertEqual(page, b'LOLWAT?') self.assertEqual(fn, 'path-only.txt') def test_file_and_name_2(self): page, fn = self.wg.getFileAndName("http://localhost:{}/filename/content-disposition".format(self.mock_server_port)) self.assertEqual(page, b'LOLWAT?') self.assertEqual(fn, 'lolercoaster.txt') def test_file_and_name_3(self): page, fn = self.wg.getFileAndName("http://localhost:{}/filename_mime/content-disposition-quotes-1".format(self.mock_server_port)) self.assertEqual(page, b'LOLWAT?') self.assertEqual(fn, 'lolercoaster.html') def test_file_and_name_4(self): page, fn = self.wg.getFileAndName("http://localhost:{}/filename_mime/content-disposition-quotes-2".format(self.mock_server_port)) self.assertEqual(page, b'LOLWAT?') self.assertEqual(fn, 'lolercoaster.html') def test_file_and_name_5(self): page, fn = self.wg.getFileAndName("http://localhost:{}/filename_mime/content-disposition-quotes-spaces-1".format(self.mock_server_port)) self.assertEqual(page, b'LOLWAT?') self.assertEqual(fn, 'loler coaster.html') def test_file_and_name_6(self): page, fn = self.wg.getFileAndName("http://localhost:{}/filename_mime/content-disposition-quotes-spaces-2".format(self.mock_server_port)) self.assertEqual(page, b'LOLWAT?') self.assertEqual(fn, 'loler coaster.html') def test_file_and_name_7(self): page, fn = self.wg.getFileAndName(requestedUrl="http://localhost:{}/filename_mime/content-disposition-quotes-spaces-2".format(self.mock_server_port)) self.assertEqual(page, b'LOLWAT?') self.assertEqual(fn, 'loler coaster.html') def test_file_and_name_8(self): page, fn = self.wg.getFileAndName(requestedUrl="http://localhost:{}/filename_mime/content-disposition-quotes-spaces-2".format(self.mock_server_port), addlHeaders={"Referer" : 'http://www.example.org'}) self.assertEqual(page, b'LOLWAT?') self.assertEqual(fn, 'loler coaster.html') def test_file_and_name_9(self): page, fn = self.wg.getFileAndName("http://localhost:{}/filename_mime/content-disposition-quotes-spaces-2".format(self.mock_server_port), addlHeaders={"Referer" : 'http://www.example.org'}) self.assertEqual(page, b'LOLWAT?') self.assertEqual(fn, 'loler coaster.html') def test_file_and_name_10(self): page, fn = self.wg.getFileAndName("http://localhost:{}/filename/path-only-trailing-slash/".format(self.mock_server_port)) self.assertEqual(page, b'LOLWAT?') self.assertEqual(fn, '') def test_file_name_mime_1(self): page, fn, mimet = self.wg.getFileNameMime( "http://localhost:{}/filename_mime/path-only.txt".format(self.mock_server_port)) self.assertEqual(page, b'LOLWAT?') self.assertEqual(fn, 'path-only.txt') self.assertEqual(mimet, 'text/plain') def test_file_name_mime_2(self): page, fn, mimet = self.wg.getFileNameMime( "http://localhost:{}/filename_mime/content-disposition".format(self.mock_server_port)) self.assertEqual(page, b'LOLWAT?') self.assertEqual(fn, 'lolercoaster.txt') self.assertEqual(mimet, 'text/plain') def test_file_name_mime_3(self): page, fn, mimet = self.wg.getFileNameMime( "http://localhost:{}/filename_mime/content-disposition-html-suffix".format(self.mock_server_port)) self.assertEqual(page, b'LOLWAT?') self.assertEqual(fn, 'lolercoaster.html') self.assertEqual(mimet, 'text/plain') def test_file_name_mime_5(self): page, fn, mimet = self.wg.getFileNameMime( "http://localhost:{}/filename/path-only-trailing-slash/".format(self.mock_server_port)) self.assertEqual(page, b'LOLWAT?') self.assertEqual(fn, '') self.assertEqual(mimet, 'text/plain') def test_file_name_mime_4(self): page, fn, mimet = self.wg.getFileNameMime( "http://localhost:{}/filename_mime/explicit-html-mime".format(self.mock_server_port)) self.assertEqual(page, 'LOLWAT?') self.assertEqual(fn, 'lolercoaster.html') self.assertEqual(mimet, 'text/html') def test_get_head_1(self): inurl_1 = "http://localhost:{}".format(self.mock_server_port) nurl_1 = self.wg.getHead(inurl_1) self.assertEqual(inurl_1, nurl_1) def test_get_head_2(self): inurl_2 = "http://localhost:{}/filename_mime/content-disposition".format(self.mock_server_port) nurl_2 = self.wg.getHead(inurl_2) self.assertEqual(inurl_2, nurl_2) def test_redirect_handling_1(self): inurl_1 = "http://localhost:{}/redirect/from-1".format(self.mock_server_port) ctnt_1 = self.wg.getpage(inurl_1) self.assertEqual(ctnt_1, b"Redirect-To-1") def test_redirect_handling_2(self): inurl_2 = "http://localhost:{}/redirect/from-2".format(self.mock_server_port) ctnt_2 = self.wg.getpage(inurl_2) self.assertEqual(ctnt_2, b"Redirect-To-2") def test_redirect_handling_3(self): inurl_3 = "http://localhost:{}/redirect/from-1".format(self.mock_server_port) outurl_3 = "http://localhost:{}/redirect/to-1".format(self.mock_server_port) nurl_3 = self.wg.getHead(inurl_3) self.assertEqual(outurl_3, nurl_3) def test_redirect_handling_4(self): inurl_4 = "http://localhost:{}/redirect/from-2".format(self.mock_server_port) outurl_4 = "http://localhost:{}/redirect/to-2".format(self.mock_server_port) nurl_4 = self.wg.getHead(inurl_4) self.assertEqual(outurl_4, nurl_4) def test_redirect_handling_5(self): # This is a redirect without the actual redirect with self.assertRaises(WebRequest.FetchFailureError): inurl_5 = "http://localhost:{}/redirect/bad-1".format(self.mock_server_port) self.wg.getHead(inurl_5) def test_redirect_handling_6(self): # This is a infinitely recursive redirect. with self.assertRaises(WebRequest.FetchFailureError): inurl_6 = "http://localhost:{}/redirect/bad-2".format(self.mock_server_port) self.wg.getHead(inurl_6) def test_redirect_handling_7(self): # This is a infinitely recursive redirect. with self.assertRaises(WebRequest.FetchFailureError): inurl_6 = "http://localhost:{}/redirect/bad-3".format(self.mock_server_port) self.wg.getHead(inurl_6) def test_redirect_handling_8(self): inurl_7 = "http://localhost:{}/redirect/from-3".format(self.mock_server_port) # Assumes localhost seems to resolve to the listening address (here it's 0.0.0.0). Is this ever not true? IPv6? outurl_7 = "http://0.0.0.0:{}/".format(self.mock_server_port) nurl_7 = self.wg.getHead(inurl_7) self.assertEqual(outurl_7, nurl_7) # For the auth tests, we have to restart the test-server with the wg that's configured for password management def test_http_auth_1(self): self.mock_server.shutdown() self.mock_server_thread.join() self.wg = None new_port_1 = testing_server.get_free_port() wg_1 = WebRequest.WebGetRobust(creds=[("localhost:{}".format(new_port_1), "lol", "wat")]) # Configure mock server. new_port_1, self.mock_server, self.mock_server_thread = testing_server.start_server(self, wg_1, port_override=new_port_1) page = wg_1.getpage("http://localhost:{}/password/expect".format(new_port_1)) self.assertEqual(page, b'Password Ok?') def test_http_auth_2(self): self.mock_server.shutdown() self.mock_server_thread.join() self.wg = None new_port_2 = testing_server.get_free_port() wg_2 = WebRequest.WebGetRobust(creds=[("localhost:{}".format(new_port_2), "lol", "nope")]) # Configure mock server. new_port_2, self.mock_server, self.mock_server_thread = testing_server.start_server(self, wg_2, port_override=new_port_2) page = wg_2.getpage("http://localhost:{}/password/expect".format(new_port_2)) self.assertEqual(page, b'Password Bad!') def test_get_item_1(self): inurl_1 = "http://localhost:{}".format(self.mock_server_port) content_1, fileN_1, mType_1 = self.wg.getItem(inurl_1) self.assertEqual(content_1, 'Root OK?') self.assertEqual(fileN_1, '') self.assertEqual(mType_1, "text/html") def test_get_item_2(self): inurl_2 = "http://localhost:{}/filename_mime/content-disposition".format(self.mock_server_port) content_2, fileN_2, mType_2 = self.wg.getItem(inurl_2) # Lack of an explicit mimetype makes this not get decoded self.assertEqual(content_2, b'LOLWAT?') self.assertEqual(fileN_2, 'lolercoaster.txt') self.assertEqual(mType_2, None) def test_get_item_3(self): inurl_3 = "http://localhost:{}/filename/path-only.txt".format(self.mock_server_port) content_3, fileN_3, mType_3 = self.wg.getItem(inurl_3) self.assertEqual(content_3, b'LOLWAT?') self.assertEqual(fileN_3, 'path-only.txt') self.assertEqual(mType_3, None) def test_get_cookies_1(self): inurl_1 = "http://localhost:{}/cookie_test".format(self.mock_server_port) inurl_2 = "http://localhost:{}/cookie_require".format(self.mock_server_port) self.wg.clearCookies() cookies = self.wg.getCookies() self.assertEqual(list(cookies), []) page_resp_nocook = self.wg.getpage(inurl_2) self.assertEqual(page_resp_nocook, '<html><body>Cookie is missing</body></html>') _ = self.wg.getpage(inurl_1) cookies = self.wg.getCookies() print(cookies) page_resp_cook = self.wg.getpage(inurl_2) self.assertEqual(page_resp_cook, '<html><body>Cookie forwarded properly!</body></html>')
39.569079
203
0.750104
88a5af412a6115bdd17750b6e39564456c77830e
1,264
kt
Kotlin
src/dorkbox/executor/stop/ProcessStopper.kt
dorkbox/ProcessExecutor
1d27da4e254d9b6027b42912951c8f9e45a400b2
[ "Apache-2.0", "CC0-1.0", "MIT" ]
7
2020-12-16T12:03:04.000Z
2022-01-09T15:19:30.000Z
src/dorkbox/executor/stop/ProcessStopper.kt
dorkbox/ProcessExecutor
1d27da4e254d9b6027b42912951c8f9e45a400b2
[ "Apache-2.0", "CC0-1.0", "MIT" ]
null
null
null
src/dorkbox/executor/stop/ProcessStopper.kt
dorkbox/ProcessExecutor
1d27da4e254d9b6027b42912951c8f9e45a400b2
[ "Apache-2.0", "CC0-1.0", "MIT" ]
null
null
null
/* * Copyright 2020 dorkbox, llc * Copyright (C) 2014 ZeroTurnaround <support@zeroturnaround.com> * Contains fragments of code from Apache Commons Exec, rights owned * by Apache Software Foundation (ASF). * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT 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 dorkbox.executor.stop /** * Abstraction for stopping sub processes. * * * This is used in case a process runs too long (timeout is reached) or it's cancelled via [Future.cancel]. */ interface ProcessStopper { /** * Stops a given sub process. * * It does not wait for the process to actually stop and it has no guarantee that the process terminates. * * @param process sub process being stopped (not `null`). */ fun stop(process: Process) }
33.263158
109
0.71519
e7f7aa1ed993e5ba94893e2ddce56e42c0e3c43a
586
py
Python
java/test/src/main/resources/test_cross_language_invocation.py
hershg/ray
a1744f67fe954d8408c5b84e28ecccc130157f8e
[ "Apache-2.0" ]
2
2017-12-15T19:36:55.000Z
2019-02-24T16:56:06.000Z
java/test/src/main/resources/test_cross_language_invocation.py
hershg/ray
a1744f67fe954d8408c5b84e28ecccc130157f8e
[ "Apache-2.0" ]
4
2019-03-04T13:03:24.000Z
2019-06-06T11:25:07.000Z
java/test/src/main/resources/test_cross_language_invocation.py
hershg/ray
a1744f67fe954d8408c5b84e28ecccc130157f8e
[ "Apache-2.0" ]
2
2017-10-31T23:20:07.000Z
2019-11-13T20:16:03.000Z
# This file is used by CrossLanguageInvocationTest.java to test cross-language # invocation. from __future__ import absolute_import from __future__ import division from __future__ import print_function import six import ray @ray.remote def py_func(value): assert isinstance(value, bytes) return b"Response from Python: " + value @ray.remote class Counter(object): def __init__(self, value): self.value = int(value) def increase(self, delta): self.value += int(delta) return str(self.value).encode("utf-8") if six.PY3 else str(self.value)
21.703704
78
0.723549
90fe2167960547d7037e93b3ec9bbdbacd1d43ce
713
py
Python
ex09.py
ScottDig/Practice-Python-Exercises
3d89a61888c780b6df30e4f294a4468937612954
[ "MIT" ]
null
null
null
ex09.py
ScottDig/Practice-Python-Exercises
3d89a61888c780b6df30e4f294a4468937612954
[ "MIT" ]
null
null
null
ex09.py
ScottDig/Practice-Python-Exercises
3d89a61888c780b6df30e4f294a4468937612954
[ "MIT" ]
null
null
null
def GuessingGame(): ''' Guess a random number between 1 and 9 ''' import random NumGen = random.randint(1,9) NumGuess = int(input('Guess a number between 1 and 9: ')) correct = 0 wrong = 0 ExitGame = 'no' while ExitGame.upper() != 'EXIT': if NumGuess == NumGen: print('You are correct!') correct += 1 elif NumGuess < NumGen: print('You guessed too low') wrong += 1 else: print('You guessed too high') wrong += 1 ExitGame = input("Type EXIT to end the game: ") print('You guessed {} correctly out of {} total tries.'.format(correct, wrong)) GuessingGame()
22.28125
83
0.539972
dc465351391942713644a1a5168701adc8d41e9e
2,075
swift
Swift
GithubzToGo/RepoSearchTableViewController.swift
lazersly/GithubzToGo
a4947d7545e4ff024ba51f958ba9e510f223f070
[ "MIT" ]
null
null
null
GithubzToGo/RepoSearchTableViewController.swift
lazersly/GithubzToGo
a4947d7545e4ff024ba51f958ba9e510f223f070
[ "MIT" ]
null
null
null
GithubzToGo/RepoSearchTableViewController.swift
lazersly/GithubzToGo
a4947d7545e4ff024ba51f958ba9e510f223f070
[ "MIT" ]
null
null
null
// // RepoSearchTableViewController.swift // GithubzToGo // // Created by Brandon Roberts on 4/14/15. // Copyright (c) 2015 BR World. All rights reserved. // import UIKit class RepoSearchTableViewController: UITableViewController, UISearchBarDelegate { //MARK: //MARK: Instance Variables var repoResults = [Repository]() { didSet { self.tableView.reloadData() } } let githubService = GithubService() @IBOutlet var searchBar: UISearchBar! //MARK: //MARK: UIViewController Methods override func viewDidLoad() { super.viewDidLoad() self.searchBar.delegate = self } //MARK: //MARK: UITableViewDataSource override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return self.repoResults.count } override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell = self.tableView.dequeueReusableCellWithIdentifier("SearchRepoCell") as! UITableViewCell let rowRepo = self.repoResults[indexPath.row] cell.textLabel?.text = rowRepo.name return cell } //MARK: //MARK: UISearchBarDelegate func searchBarSearchButtonClicked(searchBar: UISearchBar) { let searchText = searchBar.text self.githubService.fetchReposWithSearchTerm(searchText, completionHandler: { (repos, error) -> (Void) in if repos != nil { self.repoResults = repos! } else if error != nil { // Handle the error } }) } func searchBar(searchBar: UISearchBar, shouldChangeTextInRange range: NSRange, replacementText text: String) -> Bool { return text.validForGithubSearch() } //MARK: //MARK: Segue override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if segue.identifier == "ShowRepoWebpage" { let nextVC = segue.destinationViewController as! RepoWebViewController let selectedRepo = repoResults[self.tableView.indexPathForSelectedRow()!.row] nextVC.selectedRepo = selectedRepo } } }
26.602564
120
0.702169
dd8be1cec25d0ba0d72cc7d929ac6a774333e79f
509
php
PHP
server/mod/assessment/classes/factory/assessment_version_factory.php
mohitjangra6017/tx_data
8adcb777a0b5e18d2ac66ec6dffda11572a91fc8
[ "PostgreSQL" ]
null
null
null
server/mod/assessment/classes/factory/assessment_version_factory.php
mohitjangra6017/tx_data
8adcb777a0b5e18d2ac66ec6dffda11572a91fc8
[ "PostgreSQL" ]
null
null
null
server/mod/assessment/classes/factory/assessment_version_factory.php
mohitjangra6017/tx_data
8adcb777a0b5e18d2ac66ec6dffda11572a91fc8
[ "PostgreSQL" ]
null
null
null
<?php /** * @author Michael J. Trio <michael.trio@kineo.com> * @copyright 2020 Kineo */ namespace mod_assessment\factory; use mod_assessment\model\version; class assessment_version_factory extends entity_factory { public static function get_entity(): string { return version::class; } public static function create_from_data($data): ?version { if (is_array($data)) { $data = (object)$data; } return version::make((array)$data); } }
18.178571
60
0.636542
53c59438aa70f01486bbc20598103736072f91eb
7,299
java
Java
modules/swagger-models/src/main/java/com/wordnik/swagger/models/Swagger.java
coveo/swagger-core
35a839ac53e6ef00653e7234a35fc7b88db5168c
[ "Apache-2.0" ]
null
null
null
modules/swagger-models/src/main/java/com/wordnik/swagger/models/Swagger.java
coveo/swagger-core
35a839ac53e6ef00653e7234a35fc7b88db5168c
[ "Apache-2.0" ]
null
null
null
modules/swagger-models/src/main/java/com/wordnik/swagger/models/Swagger.java
coveo/swagger-core
35a839ac53e6ef00653e7234a35fc7b88db5168c
[ "Apache-2.0" ]
null
null
null
package com.wordnik.swagger.models; import com.wordnik.swagger.models.auth.SecuritySchemeDefinition; import com.fasterxml.jackson.annotation.*; import com.wordnik.swagger.models.parameters.Parameter; import java.util.*; public class Swagger { protected String swagger = "2.0"; protected Info info; protected String host; protected String basePath; protected List<Tag> tags; protected List<Scheme> schemes; protected List<String> consumes; protected List<String> produces; protected List<SecurityRequirement> securityRequirements; protected Map<String, Path> paths; protected Map<String, SecuritySchemeDefinition> securityDefinitions; protected Map<String, Model> definitions; protected Map<String, Parameter> parameters; protected ExternalDocs externalDocs; // builders public Swagger info(Info info) { this.setInfo(info); return this; } public Swagger host(String host) { this.setHost(host); return this; } public Swagger basePath(String basePath) { this.setBasePath(basePath); return this; } public Swagger externalDocs(ExternalDocs value) { this.setExternalDocs(value); return this; } public Swagger tags(List<Tag> tags) { this.setTags(tags); return this; } public Swagger tag(Tag tag) { this.addTag(tag); return this; } public Swagger schemes(List<Scheme> schemes) { this.setSchemes(schemes); return this; } public Swagger scheme(Scheme scheme) { this.addScheme(scheme); return this; } public Swagger consumes(List<String> consumes) { this.setConsumes(consumes); return this; } public Swagger consumes(String consumes) { this.addConsumes(consumes); return this; } public Swagger produces(List<String> produces) { this.setProduces(produces); return this; } public Swagger produces(String produces) { this.addProduces(produces); return this; } public Swagger paths(Map<String, Path> paths) { this.setPaths(paths); return this; } public Swagger path(String key, Path path) { if(this.paths == null) this.paths = new LinkedHashMap<String, Path>(); this.paths.put(key, path); return this; } public Swagger parameter(String key, Parameter parameter) { this.addParameter(key, parameter); return this; } public Swagger securityDefinition(String name, SecuritySchemeDefinition securityDefinition) { this.addSecurityDefinition(name, securityDefinition); return this; } public Swagger model(String name, Model model) { this.addDefinition(name, model); return this; } // getter & setters public String getSwagger() { return swagger; } public void setSwagger(String swagger) { this.swagger = swagger; } public Info getInfo() { return info; } public void setInfo(Info info) { this.info = info; } public String getHost() { return host; } public void setHost(String host) { this.host = host; } public String getBasePath() { return basePath; } public void setBasePath(String basePath) { this.basePath = basePath; } public List<Scheme> getSchemes() { return schemes; } public void setSchemes(List<Scheme> schemes) { this.schemes = schemes; } public void addScheme(Scheme scheme) { if(this.schemes == null) this.schemes = new ArrayList<Scheme>(); boolean found = false; for(Scheme existing : this.schemes) { if(existing.equals(scheme)) found = true; } if(!found) this.schemes.add(scheme); } public List<Tag> getTags() { return tags; } public void setTags(List<Tag> tags) { this.tags = tags; } public void addTag(Tag tag) { if(this.tags == null) this.tags = new ArrayList<Tag>(); if(tag != null && tag.getName() != null) { boolean found = false; for(Tag existing : this.tags) { if(existing.getName().equals(tag.getName())) found = true; } if(!found) this.tags.add(tag); } } public List<String> getConsumes() { return consumes; } public void setConsumes(List<String> consumes) { this.consumes = consumes; } public void addConsumes(String consumes) { if(this.consumes == null) this.consumes = new ArrayList<String>(); this.consumes.add(consumes); } public List<String> getProduces() { return produces; } public void setProduces(List<String> produces) { this.produces = produces; } public void addProduces(String produces) { if(this.produces == null) this.produces = new ArrayList<String>(); this.produces.add(produces); } public Map<String, Path> getPaths() { if(paths == null) return null; Map<String, Path> sorted = new LinkedHashMap<String, Path>(); List<String> keys = new ArrayList<String>(); keys.addAll(paths.keySet()); Collections.sort(keys); for(String key: keys) { sorted.put(key, paths.get(key)); } return sorted; } public void setPaths(Map<String, Path> paths) { this.paths = paths; } public Path getPath(String path) { if(this.paths == null) return null; return this.paths.get(path); } public Map<String, SecuritySchemeDefinition> getSecurityDefinitions() { return securityDefinitions; } public void setSecurityDefinitions(Map<String, SecuritySchemeDefinition> securityDefinitions) { this.securityDefinitions = securityDefinitions; } public void addSecurityDefinition(String name, SecuritySchemeDefinition securityDefinition) { if(this.securityDefinitions == null) this.securityDefinitions = new HashMap<String, SecuritySchemeDefinition>(); this.securityDefinitions.put(name, securityDefinition); } public List<SecurityRequirement> getSecurityRequirement() { return securityRequirements; } public void setSecurityRequirement(List<SecurityRequirement> securityRequirements) { this.securityRequirements = securityRequirements; } public void addSecurityDefinition(SecurityRequirement securityRequirement) { if(this.securityRequirements == null) this.securityRequirements = new ArrayList<SecurityRequirement>(); this.securityRequirements.add(securityRequirement); } public void setDefinitions(Map<String, Model> definitions) { this.definitions = definitions; } public Map<String, Model> getDefinitions() { return definitions; } public void addDefinition(String key, Model model) { if(this.definitions == null) this.definitions = new HashMap<String, Model>(); this.definitions.put(key, model); } public Map<String, Parameter> getParameters() { return parameters; } public void setParameters(Map<String, Parameter> parameters) { this.parameters = parameters; } public Parameter getParameter(String parameter) { if(this.parameters == null) return null; return this.parameters.get(parameter); } public void addParameter(String key, Parameter parameter) { if(this.parameters == null) this.parameters = new HashMap<String, Parameter>(); this.parameters.put(key, parameter); } public ExternalDocs getExternalDocs() { return externalDocs; } public void setExternalDocs(ExternalDocs value) { externalDocs = value; } }
26.541818
97
0.689135
e4ea908ad3a0dd8d6a091425c8df4fbab0256783
728
swift
Swift
Shared/Extensions/String+Extension.swift
coldiary/AndroTrack
9ff1e9a41b04ce23e1f25fd2160c77a3105c59c0
[ "MIT" ]
3
2021-09-17T20:51:58.000Z
2021-12-12T10:33:04.000Z
Shared/Extensions/String+Extension.swift
coldiary/AndroTrack
9ff1e9a41b04ce23e1f25fd2160c77a3105c59c0
[ "MIT" ]
3
2021-09-20T14:58:17.000Z
2022-01-05T19:15:21.000Z
Shared/Extensions/String+Extension.swift
coldiary/AndroTrack
9ff1e9a41b04ce23e1f25fd2160c77a3105c59c0
[ "MIT" ]
null
null
null
// // String+Extension.swift // AndroTrack (iOS) // // Created by Benoit Sida on 2021-09-19. // import Foundation extension String { var localized: String { return NSLocalizedString(self, comment: "") } func localizedWith(comment: String? = nil) -> String { return NSLocalizedString(self, comment: comment ?? "") } func hexToUInt64() -> UInt64? { let hexTrimmed: String = self.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines) let hexSanitized: String = hexTrimmed.replacingOccurrences(of: "#", with: "") var rgb: UInt64 = 0 guard Scanner(string: hexSanitized).scanHexInt64(&rgb) else { return nil } return rgb } }
23.483871
97
0.631868
34163e09fb155c1488e93219d20ec9f4e8713a87
2,709
kt
Kotlin
src/main/kotlin/com/kryszak/gwatlin/api/miscellaneous/GWMiscellaneousClient.kt
Kryszak/gwatlin
03b79fda6b25bc0478144f03cd4df50eca7e21e6
[ "MIT" ]
2
2020-02-23T20:25:02.000Z
2020-05-26T20:06:15.000Z
src/main/kotlin/com/kryszak/gwatlin/api/miscellaneous/GWMiscellaneousClient.kt
Kryszak/gwatlin
03b79fda6b25bc0478144f03cd4df50eca7e21e6
[ "MIT" ]
2
2020-01-04T13:11:09.000Z
2021-02-11T19:02:35.000Z
src/main/kotlin/com/kryszak/gwatlin/api/miscellaneous/GWMiscellaneousClient.kt
Kryszak/gwatlin
03b79fda6b25bc0478144f03cd4df50eca7e21e6
[ "MIT" ]
null
null
null
package com.kryszak.gwatlin.api.miscellaneous import com.kryszak.gwatlin.api.miscellaneous.model.* import com.kryszak.gwatlin.api.miscellaneous.model.color.DyeColor import com.kryszak.gwatlin.api.miscellaneous.model.dungeon.Dungeon import com.kryszak.gwatlin.api.miscellaneous.model.raid.Raid import com.kryszak.gwatlin.clients.miscellaneous.MiscellaneousClient /** * Client for miscellaneous endpoints * @see com.kryszak.gwatlin.api.exception.ApiRequestException for errors */ class GWMiscellaneousClient { private val miscellaneousClient: MiscellaneousClient = MiscellaneousClient() /** * Returns the current build id of the game. */ fun getBuildId(): Int { return miscellaneousClient.getBuildId().id } /** * Returns commonly requested in-game assets */ fun getIcons(): List<Icon> { return miscellaneousClient.getIcons() } /** * Returns quaggan images */ fun getQuaggans(): List<Icon> { return miscellaneousClient.getQuaggans() } /** * Returns all dye colors in the game, including localized names and their color component information */ fun getDyeColors(language: String = "en"): List<DyeColor> { return miscellaneousClient.getColors(language) } /** * Returns a list of the currencies contained in the account wallet */ fun getCurrencies(language: String = "en"): List<Currency> { return miscellaneousClient.getCurrencies(language) } /** * Returns details about each dungeon and it's associated paths */ fun getDungeons(language: String = "en"): List<Dungeon> { return miscellaneousClient.getDungeons(language) } /** * Returns all minis in the game */ fun getMinis(language: String = "en"): List<Mini> { return miscellaneousClient.getMinis(language) } /** * Returns information about novelties that are available in-game */ fun getNovelties(language: String = "en"): List<Novelty> { return miscellaneousClient.getNovelties(language) } /** * Resource returns details about each raid and it's associated wings */ fun getRaids(language: String = "en"): List<Raid> { return miscellaneousClient.getRaids(language) } /** * Returns information about the titles that are in the game */ fun getTitles(language: String = "en"): List<Title> { return miscellaneousClient.getTitles(language) } /** * Returns information about the available worlds, or servers */ fun getWorlds(language: String = "en"): List<World> { return miscellaneousClient.getWorlds(language) } }
28.819149
106
0.674419
d2d7f4c26fc8c14122ba0e156ccaecc7f734cf06
3,357
php
PHP
resources/views/admin/coupons/insert_coupons.blade.php
nguyenthai24/shopbanhangdt
0239778f6d5688cca2e10fdc1f1eb98e9ad6b4ae
[ "MIT" ]
null
null
null
resources/views/admin/coupons/insert_coupons.blade.php
nguyenthai24/shopbanhangdt
0239778f6d5688cca2e10fdc1f1eb98e9ad6b4ae
[ "MIT" ]
null
null
null
resources/views/admin/coupons/insert_coupons.blade.php
nguyenthai24/shopbanhangdt
0239778f6d5688cca2e10fdc1f1eb98e9ad6b4ae
[ "MIT" ]
null
null
null
@extends('admin_layout') @section('admin_content') <div class="row"> <div class="col-lg-12"> <section class="panel"> <header class="panel-heading"> Thêm Mã giảm giá </header> <div class="panel-body"> <div class="position-center"> <?php $message = Session::get('message'); if($message) { echo '<div class="alert alert-success" style="text-align: center; font-size: 18px">' .$message.'</div>'; Session::put('message', null); } ?> <form role="form" action="{{URL::to('/insert-coupons-code')}}" method="post"> {{csrf_field()}} <div class="form-group"> <label for="exampleInputEmail1">Tên mã giảm giá</label> <input type="text" class="form-control" name="coupons_name" id="exampleInputEmail1"> </div> <div class="form-group"> <label for="exampleInputEmail1">Mã giảm giá</label> <input type="text" class="form-control" name="coupons_code" id="exampleInputEmail1"> </div> <div class="form-group"> <label for="exampleInputEmail1">Số lượng Mã</label> <input type="text" class="form-control" name="coupons_time" id="exampleInputEmail1"> </div> <div class="form-group"> <label for="exampleInputPassword1">Tính năng mã</label> <select name="coupons_condition" class="form-control input-sm m-bot15"> <option value="0">----Chọn----</option> <option value="1">Giảm giá theo phầm trăm sản phẩm</option> <option value="2">Giảm giáo theo tiền</option> </select> </div> <div class="form-group"> <label for="exampleInputPassword1">Nhập số phầm trăm hoặc số tiền được giảm giá</label> <input type="text" class="form-control" name="coupons_number" id="exampleInputEmail1"> </div> <button type="submit" name="add_coupons" class="btn btn-info ">Thêm mã giảm giá</button> </form> </div> </div> </section> </div> @endsection
57.87931
124
0.359249
95c2f682bb623320f710645381816ddd1e29b6d9
1,238
html
HTML
demo/index.html
tdorie/simple-watermark
f17c9d0af92bc638196e39b0bccc7a94e67b9fe0
[ "MIT" ]
1
2018-02-09T02:16:04.000Z
2018-02-09T02:16:04.000Z
demo/index.html
tdorie/simple-watermark
f17c9d0af92bc638196e39b0bccc7a94e67b9fe0
[ "MIT" ]
null
null
null
demo/index.html
tdorie/simple-watermark
f17c9d0af92bc638196e39b0bccc7a94e67b9fe0
[ "MIT" ]
null
null
null
<!DOCTYPE html> <html> <head> <title>Simple Watermark [VERSION]</title> <script type='text/javascript' src='../jquery/jquery-1.4.2.js'></script> <script type='text/javascript' src='../src/jquery.simple-watermark.js'></script> <style type='text/css'> .watermark { color: gray; } </style> </head> <body> <!-- Simple Watermark [VERSION] [DATE] Corey Hart @ http://www.codenothing.com --> <h1>Simple Watermark [VERSION]</h1> <p style='font-size:9pt;'> Simple water mark gives users an unobtrusive information about the textbox/textarea.<br> It's only a couple of lines, and uses CSS instead of images for messages. </p> <pre style='margin: 40px 0;'> $(document).ready(function(){ $('input[type=text], textarea').simpleWaterMark('watermark'); }); </pre> <script type='text/javascript'> jQuery(function( $ ){ $('input[type=text], textarea').simpleWaterMark('watermark'); }); </script> Input Box:<br> <input type='text' size='25' placeholder='Input Message Here' /><br> <br><br> Text Box:<br> <textarea cols='30' rows='10' placeholder='Textarea Message Here'></textarea> <div style='margin-top:50px;'> <a href='http://www.codenothing.com/archives/jquery/simple-watermark/'>Back to Original Article</a> </div> </body> </html>
21.719298
100
0.689015
858feb84665ee60794ac3d056f231b5f28588f92
2,808
js
JavaScript
docs/assets/js/main.js
rosannablanco/search-movies-JS
37252179985c6856eb0726d05d482e5a95c7a8bd
[ "MIT" ]
null
null
null
docs/assets/js/main.js
rosannablanco/search-movies-JS
37252179985c6856eb0726d05d482e5a95c7a8bd
[ "MIT" ]
null
null
null
docs/assets/js/main.js
rosannablanco/search-movies-JS
37252179985c6856eb0726d05d482e5a95c7a8bd
[ "MIT" ]
null
null
null
"use strict";const inputElement=document.querySelector(".js-input"),btnElement=document.querySelector(".js-btn"),ulSerie=document.querySelector(".js-ul-serie"),ulFav=document.querySelector(".js-ul-fav");let resultSeries=new Array,seriesFav=new Array;const classSerie="ul__li js-li-serie",classFav="ul__li js-li-ul-fav";function getDataApi(){const e=inputElement.value;fetch("https://cors-anywhere.herokuapp.com/http://api.tvmaze.com/search/shows?q="+e).then(e=>e.json()).then(e=>{saveDataShow(e)})}function saveDataShow(e){ulSerie.innerHTML="",resultSeries=[];for(let t=0;t<e.length;t++){let s=e[t].show;resultSeries.push(s)}paintHtmlResults(resultSeries,ulSerie,classSerie)}function paintHtmlResults(e,t,s){t.innerHTML="";for(const a of e){const e=document.createElement("li");e.setAttribute("class",s),e.setAttribute("data-id",a.id);const n=document.createElement("h4");n.setAttribute("class","ul__li__title");const i=document.createTextNode(a.name),r=document.createElement("img");r.setAttribute("class","ul__li__img"),null===a.image?r.setAttribute("src","https://via.placeholder.com/210x295/ffffff/666666/?text=TV"):r.setAttribute("src",a.image.medium);const l=document.createElement("button");l.setAttribute("class","ul__li__btn btn delete");const o=document.createTextNode("Borrar fav"),c=document.createElement("button");c.setAttribute("class","ul__li__btn btn add");const u=document.createTextNode("Añadir fav");c.appendChild(u),l.appendChild(o),n.appendChild(i),e.appendChild(n),e.appendChild(r),e.appendChild(c),e.appendChild(l),t.appendChild(e),s===classFav&&e.removeChild(c),c.addEventListener("click",saveSerieFav),l.addEventListener("click",removeFav)}compareLists()}function saveSerieFav(e){const t=e.currentTarget.parentElement;t.classList.add("class-fav");const s=parseInt(t.dataset.id);let a;for(const e of resultSeries)s===e.id&&(a=e);seriesFav.push(a),paintHtmlResults(seriesFav,ulFav,classFav),setInSessionStorage()}function removeFav(e){const t=e.currentTarget.parentElement;let s=parseInt(t.dataset.id);for(let e=0;e<seriesFav.length;e++)s===seriesFav[e].id&&seriesFav.splice(e,1);let a=ulSerie.children;for(let e of a){s===parseInt(e.dataset.id)&&e.classList.remove("class-fav")}paintHtmlResults(seriesFav,ulFav,classFav),setInSessionStorage()}function setInSessionStorage(){const e=JSON.stringify(seriesFav);sessionStorage.setItem("seriesFav",e)}const getFromSessionStorage=()=>{const e=sessionStorage.getItem("seriesFav");null!==e&&(seriesFav=JSON.parse(e))};function compareLists(){if(null!==seriesFav){let e=ulSerie.querySelectorAll(".js-li-serie");for(let t of e){const e=parseInt(t.dataset.id);for(const s of seriesFav){e===s.id&&t.classList.add("class-fav")}}}}btnElement.addEventListener("click",getDataApi),getFromSessionStorage(),paintHtmlResults(seriesFav,ulFav,classFav);
1,404
2,807
0.777422
4d0c21c46ce98b99e3dd881affb935ce268871b0
7,514
swift
Swift
Sources/BeaconSDK/Matrix/Store/Store.swift
Jay-Tezsure/beacon-ios-sdk
504ba95c25867ac5b5e3c970bcadd9c47cd38af9
[ "MIT" ]
null
null
null
Sources/BeaconSDK/Matrix/Store/Store.swift
Jay-Tezsure/beacon-ios-sdk
504ba95c25867ac5b5e3c970bcadd9c47cd38af9
[ "MIT" ]
null
null
null
Sources/BeaconSDK/Matrix/Store/Store.swift
Jay-Tezsure/beacon-ios-sdk
504ba95c25867ac5b5e3c970bcadd9c47cd38af9
[ "MIT" ]
null
null
null
// // Store.swift // BeaconSDK // // Created by Julia Samol on 17.11.20. // Copyright © 2020 Papers AG. All rights reserved. // import Foundation extension Matrix { class Store { private var isInitialized: Bool = false private var state: State = State() private let queue: DispatchQueue = .init(label: "it.airgap.beacon-sdk.Matrix.Store", attributes: [], target: .global(qos: .default)) private var eventsListeners: Set<EventsListener> = Set() private let storageManager: StorageManager init(storageManager: StorageManager) { self.storageManager = storageManager } // MARK: Initialization private func whenReady(onReady callback: @escaping (Result<(), Swift.Error>) -> ()) { storageManager.getMatrixSyncToken { result in guard let token = result.get(ifFailure: callback) else { return } self.storageManager.getMatrixRooms { result in guard let rooms = result.get(ifFailure: callback) else { return } self.state = State( from: self.state, syncToken: token, rooms: self.state.rooms.merged(with: rooms) ) self.isInitialized = true callback(.success(())) } } } // MARK: State func state(completion: @escaping (Result<State, Swift.Error>) -> ()) { whenReady { result in guard result.isSuccess(else: completion) else { return } self.queue.async { completion(.success(self.state)) } } } func intent(action: Action, completion: @escaping (Result<(), Swift.Error>) -> ()) { whenReady { result in guard result.isSuccess(else: completion) else { return } switch action { case let .initialize(userID, deviceID, accessToken): self.initialize(userID: userID, deviceID: deviceID, accessToken: accessToken, completion: completion) case let .onSyncSuccess(syncToken, pollingTimeout, rooms, events): self.onSyncSuccess( syncToken: syncToken, pollingTimeout: pollingTimeout, rooms: rooms, events: events, completion: completion ) case .onSyncFailure: self.onSyncFailure(completion: completion) case .onTxnIDCreated: self.onTxnIDCreated(completion: completion) } } } // MARK: Event Subscription func add(eventsListener listener: EventsListener) { eventsListeners.insert(listener) } func remove(eventsListener listener: EventsListener) { eventsListeners.remove(listener) } func remove(listenerWithID listenerID: String) { guard let listener = eventsListeners.first(where: { $0.id == listenerID }) else { return } eventsListeners.remove(listener) } private func notify(with events: [Matrix.Event]) { guard !events.isEmpty else { return } eventsListeners.forEach { $0.notify(with: events) } } // MARK: Action Handlers private func initialize(userID: String?, deviceID: String?, accessToken: String?, completion: @escaping (Result<(), Swift.Error>) -> ()) { queue.async { self.state = State(from: self.state, userID: userID, deviceID: deviceID, accessToken: accessToken) completion(.success(())) } } private func onSyncSuccess( syncToken: String?, pollingTimeout: Int64, rooms: [Matrix.Room]?, events: [Matrix.Event]?, completion: @escaping (Result<(), Swift.Error>) -> () ) { let mergedRooms = rooms.map { state.rooms.merged(with: $0) } if let events = events { notify(with: events) } updateStorage(syncToken: syncToken, rooms: mergedRooms) { result in guard result.isSuccess(else: completion) else { return } self.queue.async { self.state = State( from: self.state, isPolling: true, syncToken: .some(syncToken), pollingTimeout: pollingTimeout, pollingRetries: 0, rooms: mergedRooms ?? self.state.rooms ) completion(.success(())) } } } private func onSyncFailure(completion: @escaping (Result<(), Swift.Error>) -> ()) { queue.async { self.state = State(from: self.state, isPolling: false, pollingRetries: self.state.pollingRetries + 1) completion(.success(())) } } private func onTxnIDCreated(completion: @escaping (Result<(), Swift.Error>) -> ()) { queue.async { self.state = State(from: self.state, transactionCounter: self.state.transactionCounter + 1) completion(.success(())) } } private func updateStorage(syncToken: String?, rooms: [String: Matrix.Room]?, completion: @escaping (Result<(), Swift.Error>) -> ()) { updateStorage(with: syncToken) { result in guard result.isSuccess(else: completion) else { return } self.updateStorage(with: rooms, completion: completion) } } private func updateStorage(with syncToken: String?, completion: @escaping (Result<(), Swift.Error>) -> ()) { if let syncToken = syncToken { storageManager.setMatrixSyncToken(syncToken, completion: completion) } else { completion(.success(())) } } private func updateStorage(with rooms: [String: Matrix.Room]?, completion: @escaping (Result<(), Swift.Error>) -> ()) { if let rooms = rooms?.values { storageManager.set(Array(rooms), completion: completion) } else { completion(.success(())) } } // MARK: Types typealias EventsListener = DistinguishableListener<[Matrix.Event]> } } // MARK: Extensions private extension Dictionary where Key == String, Value == Matrix.Room { func merged(with newRooms: [Matrix.Room]) -> [Key: Value] { guard !newRooms.isEmpty else { return self } let newValues = newRooms.map { room in self[room.id]?.update(withMembers: room.members) ?? room } let updatedEntries = (values + newValues).map { ($0.id, $0) } return Dictionary(updatedEntries, uniquingKeysWith: { _, last in last }) } }
37.19802
146
0.510514
8e99cba8bb0a4792316d27046e3c6da95262c6bd
827
rb
Ruby
lib/camt_parser/general/record.rb
Factris/camt_parser
5f777a5e1e1ffa54abc8e9c25466129936d5efce
[ "MIT" ]
14
2015-09-03T08:28:42.000Z
2020-12-12T10:38:36.000Z
lib/camt_parser/general/record.rb
Factris/camt_parser
5f777a5e1e1ffa54abc8e9c25466129936d5efce
[ "MIT" ]
21
2016-04-11T16:15:56.000Z
2020-03-06T16:47:36.000Z
lib/camt_parser/general/record.rb
Factris/camt_parser
5f777a5e1e1ffa54abc8e9c25466129936d5efce
[ "MIT" ]
20
2016-04-08T13:12:22.000Z
2020-02-25T22:23:55.000Z
module CamtParser class Record def initialize(xml_data) @xml_data = xml_data @amount = @xml_data.xpath('Amt/text()').text end def amount CamtParser::Misc.to_amount(@amount) end def amount_in_cents CamtParser::Misc.to_amount_in_cents(@amount) end def currency @currency ||= @xml_data.xpath('Amt/@Ccy').text end def type @type ||= CamtParser::Type::Builder.build_type(@xml_data.xpath('Tp')) end def charges_included? @charges_included ||= @xml_data.xpath('ChrgInclInd/text()').text.downcase == 'true' end def debit @debit ||= @xml_data.xpath('CdtDbtInd/text()').text.upcase == 'DBIT' end def credit? !debit end def debit? debit end def sign credit? ? 1 : -1 end end end
18.377778
89
0.600967
18829523fc36be42f06b5648091a20854a667334
1,059
css
CSS
static/style.css
Informatic/pijemy
b56351565a9bcf6512d6f9cacfc4d4df8475a47a
[ "MIT" ]
null
null
null
static/style.css
Informatic/pijemy
b56351565a9bcf6512d6f9cacfc4d4df8475a47a
[ "MIT" ]
null
null
null
static/style.css
Informatic/pijemy
b56351565a9bcf6512d6f9cacfc4d4df8475a47a
[ "MIT" ]
null
null
null
@import url(https://fonts.googleapis.com/css?family=Wellfleet&subset=latin,latin-ext); @import url(https://fonts.googleapis.com/css?family=Ubuntu:300&subset=latin,latin-ext); body { font-family: Wellfleet, serif; font-size: 13px; text-shadow: 0px 3px 2px rgba(0,0,0,0.4); text-align: center; } h1 { margin-top: 100px; font-size: 105px; line-height: 20px; } h2 { opacity: 0.5; } .l1 { margin-top: 30px; color: #666; border-top: 1px dashed #aaa; padding-top: 20px; } .l1 span { color: #111; font-size: 45px; } .l2 { margin-top: 20px; font-size: 15px; font-family: Ubuntu, sans-serif; } .wrapper { width: 500px; margin: 0 auto; } .ft { border-top: 1px dashed #aaa; font-family: Ubuntu, sans-serif; /*font-family: sans-serif;*/ /*letter-spacing: -1px;*/ /*opacity: 0.4;*/ color: #888; margin-top: 80px; padding-top: 20px; font-size: 14px; text-shadow: none; } a { color: #777; text-decoration: none; border-bottom: 1px solid #aaa; } a:hover { color: #555; border-bottom-color: #777; } .ft:hover { /*opacity: 0.8;*/ }
14.915493
87
0.653447
91547447216cb97e5bc94a4ef0d810a202f181d6
6,415
html
HTML
_posts/2019-07-17-nyeri-dada-usai-minum-soda-tanda-bahaya.html
mrcookieslime/mrcookieslime.github.io
cf6fbe2736107f98f270a304fdddd72b531e83a4
[ "MIT" ]
null
null
null
_posts/2019-07-17-nyeri-dada-usai-minum-soda-tanda-bahaya.html
mrcookieslime/mrcookieslime.github.io
cf6fbe2736107f98f270a304fdddd72b531e83a4
[ "MIT" ]
null
null
null
_posts/2019-07-17-nyeri-dada-usai-minum-soda-tanda-bahaya.html
mrcookieslime/mrcookieslime.github.io
cf6fbe2736107f98f270a304fdddd72b531e83a4
[ "MIT" ]
2
2015-04-17T13:10:14.000Z
2016-01-14T12:57:16.000Z
--- layout: post title: Nyeri Dada Usai Minum Soda, Tanda Bahaya? date: '2019-07-17T03:03:00.000-07:00' author: Kazuma tags: - Informasi Kesehatan modified_time: '2021-03-11T10:51:50.162-08:00' blogger_id: tag:blogger.com,1999:blog-4092737290511910377.post-2566278457805153104 blogger_orig_url: https://database-blogger.blogspot.com/2019/07/nyeri-dada-usai-minum-soda-tanda-bahaya.html --- Jangan lupa membaca artikel tentang bisnis di > <a href="https://oneteknisia.eu.org/" rel="dofollow"><b>Informasi bisnis terbaik 2020</b></a>.<br/><br/><div class="td-post-featured-image"><figure><a href="https://doktersehat.com/wp-content/uploads/2018/12/soda-kola-doktersehat.jpg" data-caption="Photo Source: Flickr/trentenkelleyphotography"><img width="696" height="464" class="entry-thumb td-modal-image" src="https://doktersehat.com/wp-content/uploads/2018/12/soda-kola-doktersehat-696x464.jpg" srcset="https://doktersehat.com/wp-content/uploads/2018/12/soda-kola-doktersehat-696x464.jpg 696w, https://doktersehat.com/wp-content/uploads/2018/12/soda-kola-doktersehat-300x200.jpg 300w, https://doktersehat.com/wp-content/uploads/2018/12/soda-kola-doktersehat-768x512.jpg 768w, https://doktersehat.com/wp-content/uploads/2018/12/soda-kola-doktersehat.jpg 1024w, https://doktersehat.com/wp-content/uploads/2018/12/soda-kola-doktersehat-630x420.jpg 630w" sizes="(max-width: 696px) 100vw, 696px" alt="soda-kola-doktersehat" title="soda-kola-doktersehat"></a><figcaption class="wp-caption-text">Photo Source: Flickr/trentenkelleyphotography</figcaption></figure></div><p><a href="https://DokterSehat.Com" target="_blank" rel="noopener">DokterSehat.Com</a>&#8211; Minuman bersoda memang sangat menyegarkan untuk dikonsumsi kapan saja, apalagi jika suhu udara cenderung cukup panas. Masalahnya adalah kita terkadang merasakan sensasi kurang nyaman dan nyeri dada setelah mengonsumsinya. Apakah hal ini menandakan bahaya kesehatan?</p><h2>Penyebab sensasi nyeri dada setelah minum soda</h2><p>Pakar kesehatan menyebut minuman bersoda sebagai minuman yang diberi tambahan karbondioksida. Sayangnya, keberadaan karbondioksida ini bisa menyebabkan sensasi nyeri pada dada, apalagi jika dikonsumsi dengan berlebihan.</p><p>Sensasi nyeri dada ini berasal dari penumpukan gas karbondioksida dalam jumlah yang banyak. Hal ini akan memicu tekanan berlebihan pada saluran pencernaan, termasuk yang berada di bagian dada. Tekanan inilah yang kemudian memicu munculnya sensasi nyeri. Jika hal ini juga merangsang produksi <a href="https://doktersehat.com/asam-lambung-tinggi-penyebab-gejala-bahaya-dan-pengobatannya/" target="_blank" rel="noopener">asam lambung</a> lebih banyak, maka akan memicu sensasi terbakar yang bisa saja menjalar hingga ke kerongkongan.</p><p>Selain itu, sebagian orang juga akan mengalami gejala tidak nyaman pada perut seperti kembung, penuh, hingga sensasi mual-mual. Hal ini juga dipicu oleh penumpukan gas karbondioksida didalamnya.</p><h2>Apakah sensasi nyeri dada setelah minum soda berbahaya bagi kesehatan?</h2><p>Pakar kesehatan Aly Rahimtoola, MD, dari <em>Providence Heart Clinic</em>, Amerika Serikat menyebut kebiasaan mengonsumsi minuman bersoda dalam jangka panjang bisa membahayakan kesehatan. Hal ini disebabkan oleh tingginya kandungan gula di dalamnya.</p><p>Selain itu, jika kita kerap mengalami asam lambung tinggi yang memicu nyeri dada, dikhawatirkan akan memicu munculnya luka pada lambung atau kerongkongan. Kondisi ini juga tidak bisa disepelekan.</p><p>Berdasarkan sebuah penelitian yang dilakukan di <em>Harvard School of Public Health</em> dan dipublikasikan hasilnya dalam <em>American Heart Association Circulation Journal</em> selama 22 tahun ini, dihasilkan fakta bahwa kebiasaan mengonsumsi minuman bersoda sebanyak 60 ml setiap hari sudah cukup untuk meningkatkan risiko terkena penyakit jantung koroner hingga 20 persen.</p><p>Dalam penelitian yang melibatkan lebih dari 43 ribu pria ini, ditemukan fakta bahwa minuman bersoda juga bertanggung jawab pada masalah kegemukan dan risiko tekanan darah tinggi. Hal ini disebabkan oleh kemampuan minuman bersoda dalam meningkatkan jumlah hormon ghrelin pada kaum pria. Sebagai informasi, hormon ini adalah yang membuat kita merasa lapar.</p><p>Jika kita mudah lapar, maka keinginan untuk makan bisa berlebihan dan akhirnya meningkatkan berat badan. Selain itu, minuman bersoda juga biasanya memiliki kandungan natrium yang tinggi. Faktor-faktor inilah yang kemudian meningkatkan risiko hipertensi dan penyakit jantung koroner.</p><h2>Berbagai bahaya minuman bersoda lainnya</h2><p>Selain bisa menyebabkan nyeri dada, peningkatan berat badan, dan risiko terkena penyakit kardiovaskular, pakar kesehatan menyebut ada banyak sekali bahaya lain yang bisa didapatkan jika kita rutin mengonsumsi minuman bersoda.</p><p>Berikut adalah bahaya-bahaya tersebut.</p><ol><li><h3>Tidak baik bagi kesehatan ginjal</h3></li></ol><p>Penelitian membuktikan bahwa rutin minum minuman bersoda dua kali sehari sudah mampu meningkatkan risiko terkena kerusakan ginjal. Hal ini disebabkan oleh adanya kandungan pemanis buatan, pewarna, dan asam fosfat.</p><ol start="2"><li><h3>Meningkatkan risiko diabetes</h3></li></ol><p>Kandungan gula di dalam minuman bersoda yang tinggi bisa memicu gangguan sensitivitas insulin yang akhirnya berimbas pada peningkatan risiko terkena diabetes.</p><ol start="3"><li><h3>Bisa menurunkan kekuatan tulang</h3></li></ol><p>Kandungan asam fosfat dan kafein disebut-sebut mampu meningkatkan risiko terkena osteoporosis. Hal ini disebabkan oleh menurunnya proses penyerapan kalsium di dalam saluran pencernaan.</p><ol start="4"><li><h3>Bisa memicu kerusakan gigi</h3></li></ol><p>Sebagaimana makanan dan minuman manis pada umumnya, hobi mengonsumsi minuman bersoda bisa membuat risiko terkena masalah gigi berlubang meningkat.</p><ol start="5"><li><h3>Bisa merusak hati</h3></li></ol><p>Kandungan bahan kimia di dalam minuman bersoda bisa meningkatkan risiko penyakit atau kerusakan hati dengan drastis.</p><iframe frameborder="1" height="1px" id="iframe0" sandbox="allow-forms allow-scripts allow-pointer-lock allow-same-origin" src="https://www.mediabisnis.co.id" width="1px"></iframe><br/><br/>Selain sebagai media informasi kesehatan, kami juga berbagi artikel terkait bisnis.<br/><br/> <div style="text-align: center;"> <a href="https://oneteknisia.eu.org/" rel="dofollow"><b>Artikel bisnis dan investasi</b></a> </div>
493.461538
6,024
0.802806
c157a17773427a73cf3a5d4cbcb40b476194c596
1,530
rs
Rust
src/rules/explicit_function_return_type.rs
rottencandy/deno_lint
b666cfb75cc33ea5c7920be66ba060b546d9c435
[ "MIT" ]
null
null
null
src/rules/explicit_function_return_type.rs
rottencandy/deno_lint
b666cfb75cc33ea5c7920be66ba060b546d9c435
[ "MIT" ]
null
null
null
src/rules/explicit_function_return_type.rs
rottencandy/deno_lint
b666cfb75cc33ea5c7920be66ba060b546d9c435
[ "MIT" ]
null
null
null
// Copyright 2020 the Deno authors. All rights reserved. MIT license. use super::Context; use super::LintRule; use swc_ecma_visit::Node; use swc_ecma_visit::Visit; pub struct ExplicitFunctionReturnType; impl LintRule for ExplicitFunctionReturnType { fn new() -> Box<Self> { Box::new(ExplicitFunctionReturnType) } fn code(&self) -> &'static str { "explicitFunctionReturnType" } fn lint_module(&self, context: Context, module: swc_ecma_ast::Module) { let mut visitor = ExplicitFunctionReturnTypeVisitor::new(context); visitor.visit_module(&module, &module); } } struct ExplicitFunctionReturnTypeVisitor { context: Context, } impl ExplicitFunctionReturnTypeVisitor { pub fn new(context: Context) -> Self { Self { context } } } impl Visit for ExplicitFunctionReturnTypeVisitor { fn visit_function( &mut self, function: &swc_ecma_ast::Function, _parent: &dyn Node, ) { if function.return_type.is_none() { self.context.add_diagnostic( function.span, "explicitFunctionReturnType", "Missing return type on function", ); } } } #[cfg(test)] mod tests { use super::*; use crate::test_util::*; #[test] fn explicit_function_return_type() { assert_lint_ok_n::<ExplicitFunctionReturnType>(vec![ "function fooTyped(): void { }", "const bar = (a: string) => { }", "const barTyped = (a: string): Promise<void> => { }", ]); assert_lint_err::<ExplicitFunctionReturnType>("function foo() { }", 0); } }
23.538462
75
0.672549
3d8872ac3be8814da77583c840a021411087d587
3,063
swift
Swift
RealFlags/Sources/RealFlags/Classes/Flag/FlagProtocol/EncodedFlagValue.swift
immobiliare/RealFlags
0f3562ca20d6e91939751fc7118db5d84718c3de
[ "MIT" ]
78
2021-10-08T09:59:36.000Z
2022-03-30T12:43:41.000Z
RealFlags/Sources/RealFlags/Classes/Flag/FlagProtocol/EncodedFlagValue.swift
immobiliare/RealFlags
0f3562ca20d6e91939751fc7118db5d84718c3de
[ "MIT" ]
11
2021-11-28T11:05:34.000Z
2022-01-29T10:07:29.000Z
RealFlags/Sources/RealFlags/Classes/Flag/FlagProtocol/EncodedFlagValue.swift
immobiliare/RealFlags
0f3562ca20d6e91939751fc7118db5d84718c3de
[ "MIT" ]
null
null
null
// // RealFlags // Easily manage Feature Flags in Swift // // Created by the Mobile Team @ ImmobiliareLabs // Email: mobile@immobiliare.it // Web: http://labs.immobiliare.it // // Copyright ©2021 Immobiliare.it SpA. All rights reserved. // Licensed under MIT License. // import Foundation // MARK: - EncodedFlagValue /// Defines all the types you can encode/decode as flag value. /// Custom type you conform to `FlagProtocol` must be able to be represented with one of the following types. public enum EncodedFlagValue: Equatable { case array([EncodedFlagValue]) case bool(Bool) case dictionary([String: EncodedFlagValue]) case data(Data) case double(Double) case float(Float) case integer(Int) case none case string(String) case json(NSDictionary) // MARK: - Initialization /// Create a new encoded data type from a generic object received as init. /// /// - Parameters: /// - object: object to decode. /// - typeHint: type of data. internal init?<Value>(object: Any, classType: Value.Type) where Value: FlagProtocol { switch object { case let value as Bool where classType.EncodedValue == Bool.self || classType.EncodedValue == Optional<Bool>.self: self = .bool(value) case let value as Data: self = .data(value) case let value as Int: self = .integer(value) case let value as Float: self = .float(value) case let value as Double: self = .double(value) case let value as String: self = .string(value) case is NSNull: self = .none case let value as [Any]: self = .array(value.compactMap({ EncodedFlagValue(object: $0, classType: classType) })) case let value as [String: Any]: self = .dictionary(value.compactMapValues({ EncodedFlagValue(object: $0, classType: classType) })) case let value as NSDictionary: self = .json(value) default: return nil } } /// Trnsform boxed data in a valid `NSObject` you can store. /// /// - Returns: NSObject internal func nsObject() -> NSObject { switch self { case let .array(value): return value.map({ $0.nsObject() }) as NSArray case let .bool(value): return value as NSNumber case let .data(value): return value as NSData case let .dictionary(value): return value.mapValues({ $0.nsObject() }) as NSDictionary case let .double(value): return value as NSNumber case let .float(value): return value as NSNumber case let .integer(value): return value as NSNumber case .none: return NSNull() case let .string(value): return value as NSString case let .json(value): return value as NSDictionary } } }
31.255102
122
0.586353
260714b673eb2b60a7e10a20f9f9221af4cdc981
1,102
java
Java
src/main/java/jnr/unixsocket/Ucred.java
MarkAtwood/jnr-unixsocket
e195351c98ac2247f9ae67991b25e1354dfcb2a6
[ "Apache-2.0" ]
235
2015-01-05T19:28:16.000Z
2022-03-18T13:16:55.000Z
src/main/java/jnr/unixsocket/Ucred.java
MarkAtwood/jnr-unixsocket
e195351c98ac2247f9ae67991b25e1354dfcb2a6
[ "Apache-2.0" ]
88
2015-03-18T02:25:16.000Z
2022-01-17T01:04:47.000Z
src/main/java/jnr/unixsocket/Ucred.java
MarkAtwood/jnr-unixsocket
e195351c98ac2247f9ae67991b25e1354dfcb2a6
[ "Apache-2.0" ]
81
2015-01-03T00:55:47.000Z
2021-12-21T02:59:27.000Z
/* * This file is part of the JNR 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 jnr.unixsocket; import jnr.ffi.Struct; /** * Native structure for SCM_CREDENTIALS. See 'man 7 unix'. */ final class Ucred extends Struct { final pid_t pid = new pid_t(); final uid_t uid = new uid_t(); final gid_t gid = new gid_t(); public Ucred() { super(jnr.ffi.Runtime.getSystemRuntime()); } pid_t getPidField() { return pid; } uid_t getUidField() { return uid; } gid_t getGidField() { return gid; } }
24.488889
75
0.669691
20169a4681a4ae41c267428d517262c1f204cf71
5,950
sql
SQL
roaster_ratings.sql
stormihoebe/roaster-rater-java
482cb4202938b3ec60474202705baaa181350f15
[ "MIT" ]
null
null
null
roaster_ratings.sql
stormihoebe/roaster-rater-java
482cb4202938b3ec60474202705baaa181350f15
[ "MIT" ]
null
null
null
roaster_ratings.sql
stormihoebe/roaster-rater-java
482cb4202938b3ec60474202705baaa181350f15
[ "MIT" ]
null
null
null
-- -- PostgreSQL database dump -- -- Dumped from database version 9.5.4 -- Dumped by pg_dump version 9.5.4 SET statement_timeout = 0; SET lock_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SET check_function_bodies = false; SET client_min_messages = warning; SET row_security = off; -- -- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: -- CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog; -- -- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: -- COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language'; SET search_path = public, pg_catalog; SET default_tablespace = ''; SET default_with_oids = false; -- -- Name: certs; Type: TABLE; Schema: public; Owner: Guest -- CREATE TABLE certs ( id integer NOT NULL, name character varying ); ALTER TABLE certs OWNER TO "Guest"; -- -- Name: certs_id_seq; Type: SEQUENCE; Schema: public; Owner: Guest -- CREATE SEQUENCE certs_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE certs_id_seq OWNER TO "Guest"; -- -- Name: certs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: Guest -- ALTER SEQUENCE certs_id_seq OWNED BY certs.id; -- -- Name: hoods; Type: TABLE; Schema: public; Owner: Guest -- CREATE TABLE hoods ( id integer NOT NULL, name character varying ); ALTER TABLE hoods OWNER TO "Guest"; -- -- Name: hoods_id_seq; Type: SEQUENCE; Schema: public; Owner: Guest -- CREATE SEQUENCE hoods_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE hoods_id_seq OWNER TO "Guest"; -- -- Name: hoods_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: Guest -- ALTER SEQUENCE hoods_id_seq OWNED BY hoods.id; -- -- Name: ratings; Type: TABLE; Schema: public; Owner: Guest -- CREATE TABLE ratings ( id integer NOT NULL, roaster_id integer, rater character varying, rating integer, comment character varying ); ALTER TABLE ratings OWNER TO "Guest"; -- -- Name: ratings_id_seq; Type: SEQUENCE; Schema: public; Owner: Guest -- CREATE SEQUENCE ratings_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE ratings_id_seq OWNER TO "Guest"; -- -- Name: ratings_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: Guest -- ALTER SEQUENCE ratings_id_seq OWNED BY ratings.id; -- -- Name: roasters; Type: TABLE; Schema: public; Owner: Guest -- CREATE TABLE roasters ( id integer NOT NULL, name character varying, location character varying, cert_id integer, hood_id integer, website character varying, description character varying, average integer ); ALTER TABLE roasters OWNER TO "Guest"; -- -- Name: roasters_id_seq; Type: SEQUENCE; Schema: public; Owner: Guest -- CREATE SEQUENCE roasters_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE roasters_id_seq OWNER TO "Guest"; -- -- Name: roasters_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: Guest -- ALTER SEQUENCE roasters_id_seq OWNED BY roasters.id; -- -- Name: id; Type: DEFAULT; Schema: public; Owner: Guest -- ALTER TABLE ONLY certs ALTER COLUMN id SET DEFAULT nextval('certs_id_seq'::regclass); -- -- Name: id; Type: DEFAULT; Schema: public; Owner: Guest -- ALTER TABLE ONLY hoods ALTER COLUMN id SET DEFAULT nextval('hoods_id_seq'::regclass); -- -- Name: id; Type: DEFAULT; Schema: public; Owner: Guest -- ALTER TABLE ONLY ratings ALTER COLUMN id SET DEFAULT nextval('ratings_id_seq'::regclass); -- -- Name: id; Type: DEFAULT; Schema: public; Owner: Guest -- ALTER TABLE ONLY roasters ALTER COLUMN id SET DEFAULT nextval('roasters_id_seq'::regclass); -- -- Data for Name: certs; Type: TABLE DATA; Schema: public; Owner: Guest -- COPY certs (id, name) FROM stdin; 1 organic 2 fair-trade 3 shade grown 4 rainforest alliance 5 smithsonian bird friendly 6 utz 7 none 8 unknown \. -- -- Name: certs_id_seq; Type: SEQUENCE SET; Schema: public; Owner: Guest -- SELECT pg_catalog.setval('certs_id_seq', 1, false); -- -- Data for Name: hoods; Type: TABLE DATA; Schema: public; Owner: Guest -- COPY hoods (id, name) FROM stdin; 1 North Portland 2 Northeast 3 East Portland 4 Southeast 5 Southwest 6 Downtown 7 Northwest \. -- -- Name: hoods_id_seq; Type: SEQUENCE SET; Schema: public; Owner: Guest -- SELECT pg_catalog.setval('hoods_id_seq', 1, false); -- -- Data for Name: ratings; Type: TABLE DATA; Schema: public; Owner: Guest -- COPY ratings (id, roaster_id, rater, rating, comment) FROM stdin; \. -- -- Name: ratings_id_seq; Type: SEQUENCE SET; Schema: public; Owner: Guest -- SELECT pg_catalog.setval('ratings_id_seq', 20, true); -- -- Data for Name: roasters; Type: TABLE DATA; Schema: public; Owner: Guest -- COPY roasters (id, name, location, cert_id, hood_id, website, description, average) FROM stdin; \. -- -- Name: roasters_id_seq; Type: SEQUENCE SET; Schema: public; Owner: Guest -- SELECT pg_catalog.setval('roasters_id_seq', 8, true); -- -- Name: certs_pkey; Type: CONSTRAINT; Schema: public; Owner: Guest -- ALTER TABLE ONLY certs ADD CONSTRAINT certs_pkey PRIMARY KEY (id); -- -- Name: hoods_pkey; Type: CONSTRAINT; Schema: public; Owner: Guest -- ALTER TABLE ONLY hoods ADD CONSTRAINT hoods_pkey PRIMARY KEY (id); -- -- Name: ratings_pkey; Type: CONSTRAINT; Schema: public; Owner: Guest -- ALTER TABLE ONLY ratings ADD CONSTRAINT ratings_pkey PRIMARY KEY (id); -- -- Name: roasters_pkey; Type: CONSTRAINT; Schema: public; Owner: Guest -- ALTER TABLE ONLY roasters ADD CONSTRAINT roasters_pkey PRIMARY KEY (id); -- -- Name: public; Type: ACL; Schema: -; Owner: epicodus -- REVOKE ALL ON SCHEMA public FROM PUBLIC; REVOKE ALL ON SCHEMA public FROM epicodus; GRANT ALL ON SCHEMA public TO epicodus; GRANT ALL ON SCHEMA public TO PUBLIC; -- -- PostgreSQL database dump complete --
18.251534
95
0.706387
b6ee9355914fee56aa105ef63b9f4efef22e3f32
206
rb
Ruby
features/step_definitions/rails_setup_steps.rb
benlangfeld/ahn-rails
b4ce0d7dcee24804951c166a52cb640d042a8118
[ "MIT" ]
2
2015-08-06T15:40:22.000Z
2015-11-05T05:22:07.000Z
features/step_definitions/rails_setup_steps.rb
benlangfeld/ahn-rails
b4ce0d7dcee24804951c166a52cb640d042a8118
[ "MIT" ]
null
null
null
features/step_definitions/rails_setup_steps.rb
benlangfeld/ahn-rails
b4ce0d7dcee24804951c166a52cb640d042a8118
[ "MIT" ]
null
null
null
Given /^a new Rails app$/ do Given "I run `rails new rails_app`" And "I run `ln -s ../../lib/generators rails_app/lib/generators`" end When /^I have capistrano setup$/ do When "I run `capify .`" end
22.888889
67
0.660194
f1ff15dbebb28031874ec2d07363685e5c786186
32,368
lua
Lua
game/dota_addons/dota_imba_reborn/scripts/vscripts/components/abilities/heroes/hero_naga_siren.lua
candle31415/dota_imba
cfe658ac0175f9014a791659f565bc8fa16330ee
[ "Apache-2.0" ]
42
2017-09-17T12:35:29.000Z
2018-06-03T19:33:55.000Z
game/dota_addons/dota_imba_reborn/scripts/vscripts/components/abilities/heroes/hero_naga_siren.lua
Nibuja05/dota_imba
83c90c70e48d4476c9f1df4e25111e2f91de1004
[ "Apache-2.0" ]
35
2017-08-31T11:03:52.000Z
2018-05-21T16:06:00.000Z
game/dota_addons/dota_imba_reborn/scripts/vscripts/components/abilities/heroes/hero_naga_siren.lua
Nibuja05/dota_imba
83c90c70e48d4476c9f1df4e25111e2f91de1004
[ "Apache-2.0" ]
25
2017-09-03T06:22:39.000Z
2018-06-22T14:36:12.000Z
-- Editors: -- EarthSalamander, 28.09.2019 --================================================================================================================= -- Naga Siren: Mirror Image --================================================================================================================= LinkLuaModifier("modifier_imba_naga_siren_mirror_image_invulnerable", "components/abilities/heroes/hero_naga_siren.lua", LUA_MODIFIER_MOTION_NONE) LinkLuaModifier("modifier_imba_naga_siren_mirror_image_perfect_image", "components/abilities/heroes/hero_naga_siren.lua", LUA_MODIFIER_MOTION_NONE) imba_naga_siren_mirror_image = imba_naga_siren_mirror_image or class({}) function imba_naga_siren_mirror_image:IsHiddenWhenStolen() return false end function imba_naga_siren_mirror_image:IsRefreshable() return true end function imba_naga_siren_mirror_image:IsStealable() return true end function imba_naga_siren_mirror_image:IsNetherWardStealable() return false end function imba_naga_siren_mirror_image:OnSpellStart() if not IsServer() then return end local image_count = self:GetSpecialValueFor("images_count") + self:GetCaster():FindTalentValue("special_bonus_unique_naga_siren") local image_out_dmg = self:GetSpecialValueFor("outgoing_damage") + self:GetCaster():FindTalentValue("special_bonus_unique_naga_siren_4") local vRandomSpawnPos = { Vector(108, 0, 0), Vector(108, 108, 0), Vector(108, 0, 0), Vector(0, 108, 0), Vector(-108, 0, 0), Vector(-108, 108, 0), Vector(-108, -108, 0), Vector(0, -108, 0), } local pfx = ParticleManager:CreateParticle("particles/units/heroes/hero_siren/naga_siren_mirror_image.vpcf", PATTACH_ABSORIGIN, self:GetCaster()) self:GetCaster():AddNewModifier(self:GetCaster(), self, "modifier_imba_naga_siren_mirror_image_invulnerable", {duration = self:GetSpecialValueFor("invuln_duration")}) if self.illusions then for _, illusion in pairs(self.illusions) do if IsValidEntity(illusion) and illusion:IsAlive() then illusion:ForceKill(false) end end end self:GetCaster():SetContextThink(DoUniqueString("naga_siren_mirror_image"), function() -- "API Additions - Global (Server): * CreateIllusions( hOwner, hHeroToCopy, hModifierKeys, nNumIllusions, nPadding, bScramblePosition, bFindClearSpace ) Note: See script_help2 for supported modifier keys" self.illusions = CreateIllusions(self:GetCaster(), self:GetCaster(), { outgoing_damage = image_out_dmg, incoming_damage = self:GetSpecialValueFor("incoming_damage") - self:GetCaster():FindTalentValue("special_bonus_imba_naga_siren_mirror_image_damage_taken"), bounty_base = self:GetCaster():GetIllusionBounty(), bounty_growth = nil, outgoing_damage_structure = nil, outgoing_damage_roshan = nil, -- duration = self:GetSpecialValueFor("illusion_duration") duration = nil -- IMBAfication: Everlasting Reflection }, image_count, self:GetCaster():GetHullRadius(), true, true) for i = 1, #self.illusions do local illusion = self.illusions[i] local pos = self:GetCaster():GetAbsOrigin() + vRandomSpawnPos[i] FindClearSpaceForUnit(illusion, pos, true) local part2 = ParticleManager:CreateParticle("particles/units/heroes/hero_siren/naga_siren_riptide_foam.vpcf", PATTACH_ABSORIGIN, illusion) ParticleManager:ReleaseParticleIndex(part2) illusion:AddNewModifier(self:GetCaster(), self, "modifier_imba_naga_siren_mirror_image_perfect_image", {}) end ParticleManager:DestroyParticle(pfx, false) ParticleManager:ReleaseParticleIndex(pfx) self:GetCaster():Stop() return nil end, self:GetSpecialValueFor("invuln_duration")) self:GetCaster():EmitSound("Hero_NagaSiren.MirrorImage") end modifier_imba_naga_siren_mirror_image_invulnerable = modifier_imba_naga_siren_mirror_image_invulnerable or class({}) function modifier_imba_naga_siren_mirror_image_invulnerable:IsHidden() return true end function modifier_imba_naga_siren_mirror_image_invulnerable:CheckState() return { [MODIFIER_STATE_INVULNERABLE] = true, [MODIFIER_STATE_NO_HEALTH_BAR] = true, [MODIFIER_STATE_STUNNED] = true, -- [MODIFIER_STATE_OUT_OF_GAME] = true, } end modifier_imba_naga_siren_mirror_image_perfect_image = modifier_imba_naga_siren_mirror_image_perfect_image or class({}) function modifier_imba_naga_siren_mirror_image_perfect_image:IsPurgable() return false end function modifier_imba_naga_siren_mirror_image_perfect_image:IsPurgeException() return false end function modifier_imba_naga_siren_mirror_image_perfect_image:OnCreated() self.perfect_image_bonus_damage_incoming_pct = self:GetAbility():GetSpecialValueFor("perfect_image_bonus_damage_incoming_pct") self.perfect_image_bonus_damage_outgoing_pct = self:GetAbility():GetTalentSpecialValueFor("perfect_image_bonus_damage_outgoing_pct") self.perfect_image_max_stacks = self:GetAbility():GetSpecialValueFor("perfect_image_max_stacks") end function modifier_imba_naga_siren_mirror_image_perfect_image:DeclareFunctions() return { MODIFIER_PROPERTY_INCOMING_DAMAGE_PERCENTAGE, MODIFIER_PROPERTY_DAMAGEOUTGOING_PERCENTAGE, MODIFIER_EVENT_ON_DEATH, } end function modifier_imba_naga_siren_mirror_image_perfect_image:GetModifierIncomingDamage_Percentage() return self:GetStackCount() * self.perfect_image_bonus_damage_incoming_pct end function modifier_imba_naga_siren_mirror_image_perfect_image:GetModifierDamageOutgoing_Percentage() return self:GetStackCount() * self.perfect_image_bonus_damage_outgoing_pct end function modifier_imba_naga_siren_mirror_image_perfect_image:OnDeath(params) if not IsServer() then return end if params.attacker == self:GetParent() then if params.unit:IsRealHero() then self:SetIllusionsStackCount(self.perfect_image_max_stacks) else self:SetIllusionsStackCount(math.min(self:GetStackCount() + 1, self.perfect_image_max_stacks)) end end end function modifier_imba_naga_siren_mirror_image_perfect_image:SetIllusionsStackCount(iStackCount) if self:GetAbility().illusions == nil then return end for _, illusion in pairs(self:GetAbility().illusions) do if illusion and not illusion:IsNull() then local modifier = illusion:FindModifierByName(self:GetName()) if modifier then modifier:SetStackCount(iStackCount) end end end end --================================================================================================================= -- Naga Siren: Ensnare --================================================================================================================= LinkLuaModifier("modifier_imba_naga_siren_ensnare", "components/abilities/heroes/hero_naga_siren.lua", LUA_MODIFIER_MOTION_NONE) imba_naga_siren_ensnare = imba_naga_siren_ensnare or class({}) function imba_naga_siren_ensnare:GetCooldown(iLevel) return self.BaseClass.GetCooldown(self, iLevel) - self:GetCaster():FindTalentValue("special_bonus_unique_naga_siren_2") end function imba_naga_siren_ensnare:OnAbilityPhaseInterrupted() if not IsServer() then return end local mirror_image = self:GetCaster():FindAbilityByName("imba_naga_siren_mirror_image") if mirror_image and mirror_image.illusions then for _, illusion in pairs(mirror_image.illusions) do if IsValidEntity(illusion) and illusion:IsAlive() then illusion:FadeGesture(ACT_DOTA_CAST_ABILITY_2) end end end return true end function imba_naga_siren_ensnare:OnAbilityPhaseStart() if not IsServer() then return end local mirror_image = self:GetCaster():FindAbilityByName("imba_naga_siren_mirror_image") self.naga_sirens = {} if mirror_image and mirror_image.illusions then for _, illusion in pairs(mirror_image.illusions) do if IsValidEntity(illusion) and illusion:IsAlive() then table.insert(self.naga_sirens, illusion) illusion:StartGesture(ACT_DOTA_CAST_ABILITY_2) end end end return true end function imba_naga_siren_ensnare:OnSpellStart() if self:GetCursorTarget():TriggerSpellAbsorb(self) then return end if not IsServer() then return end local net_speed = self:GetSpecialValueFor("net_speed") local distance = (self:GetCursorTarget():GetAbsOrigin() - self:GetCaster():GetAbsOrigin()):Length2D() local projectile_duration = distance / net_speed self:LaunchProjectile(self:GetCaster(), self:GetCursorTarget(), projectile_duration) if #self.naga_sirens > 0 then self.naga_sirens[RandomInt(1, #self.naga_sirens)]:EmitSound("Hero_NagaSiren.Ensnare.Cast") else self:GetCaster():EmitSound("Hero_NagaSiren.Ensnare.Cast") end for _, naga in pairs(self.naga_sirens) do if IsValidEntity(naga) and naga:IsAlive() then -- local target = self:GetCursorTarget() local enemies = FindUnitsInRadius( naga:GetTeamNumber(), naga:GetAbsOrigin(), nil, self:GetSpecialValueFor("fake_ensnare_distance"), self:GetAbilityTargetTeam(), self:GetAbilityTargetType(), self:GetAbilityTargetFlags(), FIND_CLOSEST, false ) if #enemies > 0 then self:LaunchProjectile(naga, enemies[1], projectile_duration) end end end end function imba_naga_siren_ensnare:LaunchProjectile(source, target, projectile_duration) local net_speed = self:GetSpecialValueFor("net_speed") if source:IsIllusion() then net_speed = (target:GetAbsOrigin() - source:GetAbsOrigin()):Length2D() / projectile_duration end local info = { Target = target, Source = source, Ability = self, bDodgeable = true, EffectName = "particles/units/heroes/hero_siren/siren_net_projectile.vpcf", iMoveSpeed = net_speed, ExtraData = {illusion = source:IsIllusion()} } ProjectileManager:CreateTrackingProjectile(info) end function imba_naga_siren_ensnare:OnProjectileHit_ExtraData(hTarget, vLocation, hExtraData) -- if hExtraData.illusion == 0 and hTarget and not hTarget:TriggerSpellAbsorb(self) then if hTarget then if not hTarget:HasModifier("modifier_imba_naga_siren_ensnare") then hTarget:EmitSound("Hero_NagaSiren.Ensnare.Target") end hTarget:AddNewModifier(self:GetCaster(), self, "modifier_imba_naga_siren_ensnare", {duration = self:GetSpecialValueFor("duration") * (1 - hTarget:GetStatusResistance())}) end end modifier_imba_naga_siren_ensnare = modifier_imba_naga_siren_ensnare or class({}) function modifier_imba_naga_siren_ensnare:IsDebuff() return true end function modifier_imba_naga_siren_ensnare:GetEffectName() return "particles/units/heroes/hero_siren/siren_net.vpcf" end function modifier_imba_naga_siren_ensnare:GetEffectAttachType() return PATTACH_ABSORIGIN end function modifier_imba_naga_siren_ensnare:CheckState() return { [MODIFIER_STATE_ROOTED] = true, } end function modifier_imba_naga_siren_ensnare:DeclareFunctions() return { MODIFIER_PROPERTY_PROVIDES_FOW_POSITION, } end function modifier_imba_naga_siren_ensnare:GetModifierProvidesFOWVision() return 1 end --================================================================================================================= -- Naga Siren: Rip Tide --================================================================================================================= LinkLuaModifier("modifier_imba_naga_siren_rip_tide", "components/abilities/heroes/hero_naga_siren.lua", LUA_MODIFIER_MOTION_NONE) LinkLuaModifier("modifier_imba_naga_siren_rip_tide_debuff", "components/abilities/heroes/hero_naga_siren.lua", LUA_MODIFIER_MOTION_NONE) imba_naga_siren_rip_tide = imba_naga_siren_rip_tide or class({}) function imba_naga_siren_rip_tide:IsHiddenWhenStolen() return false end function imba_naga_siren_rip_tide:IsRefreshable() return true end function imba_naga_siren_rip_tide:IsStealable() return true end function imba_naga_siren_rip_tide:IsNetherWardStealable() return true end function imba_naga_siren_rip_tide:GetCastRange() return self:GetSpecialValueFor("radius") end function imba_naga_siren_rip_tide:GetIntrinsicModifierName() return "modifier_imba_naga_siren_rip_tide" end modifier_imba_naga_siren_rip_tide = modifier_imba_naga_siren_rip_tide or class({}) function modifier_imba_naga_siren_rip_tide:IsHidden() return true end function modifier_imba_naga_siren_rip_tide:DeclareFunctions() return { MODIFIER_EVENT_ON_ATTACK_LANDED, } end function modifier_imba_naga_siren_rip_tide:OnAttackLanded(params) if not IsServer() then return end if params.attacker == self:GetParent() and RollPseudoRandom(self:GetAbility():GetSpecialValueFor("chance") + self:GetCaster():FindTalentValue("special_bonus_imba_naga_siren_rip_tide_proc_chance"), self) then local caster_table = {} local victim_table = {} table.insert(caster_table, self:GetCaster()) for _, unit in pairs(self:GetCaster():GetAdditionalOwnedUnits()) do -- print(unit:GetUnitName(), unit:entindex()) if unit:GetUnitName() == self:GetCaster():GetUnitName() and unit:IsIllusion() then table.insert(caster_table, unit) end end for _, tide_caster in pairs(caster_table) do tide_caster:EmitSound("Hero_NagaSiren.Riptide.Cast") tide_caster:StartGesture(ACT_DOTA_CAST_ABILITY_3) local pfx = ParticleManager:CreateParticle("particles/units/heroes/hero_siren/naga_siren_riptide.vpcf", PATTACH_ABSORIGIN, tide_caster) ParticleManager:SetParticleControl(pfx, 1, Vector(self:GetAbility():GetSpecialValueFor("radius"), self:GetAbility():GetSpecialValueFor("radius"), self:GetAbility():GetSpecialValueFor("radius"))) ParticleManager:SetParticleControl(pfx, 3, Vector(self:GetAbility():GetSpecialValueFor("radius"), self:GetAbility():GetSpecialValueFor("radius"), self:GetAbility():GetSpecialValueFor("radius"))) ParticleManager:ReleaseParticleIndex(pfx) local victims = FindUnitsInRadius( tide_caster:GetTeamNumber(), tide_caster:GetAbsOrigin(), nil, self:GetAbility():GetSpecialValueFor("radius"), self:GetAbility():GetAbilityTargetTeam(), self:GetAbility():GetAbilityTargetType(), self:GetAbility():GetAbilityTargetFlags(), FIND_ANY_ORDER, false ) for _, victim in pairs(victims) do if not victim_table[victim:entindex()] then local damage = self:GetAbility():GetSpecialValueFor("damage") local mod = victim:FindModifierByName("modifier_imba_naga_siren_rip_tide_debuff") if mod then local mod = victim:FindModifierByName("modifier_imba_naga_siren_rip_tide_debuff") mod:SetDuration(self:GetAbility():GetSpecialValueFor("duration") * (1 - victim:GetStatusResistance()), true) mod:SetStackCount(mod:GetStackCount() + 1) damage = damage + (self:GetAbility():GetSpecialValueFor("wet_bonus_damage") * mod:GetStackCount()) else -- self:GetCaster():GetPlayerOwner():GetAssignedHero() is to allow the armor reduction talent from the real unit to apply mod = victim:AddNewModifier(self:GetCaster():GetPlayerOwner():GetAssignedHero(), self:GetAbility(), "modifier_imba_naga_siren_rip_tide_debuff", {duration = self:GetAbility():GetSpecialValueFor("duration") * (1 - victim:GetStatusResistance())}):SetStackCount(1) damage = damage + self:GetAbility():GetSpecialValueFor("wet_bonus_damage") end local damageTable = { victim = victim, attacker = tide_caster, damage = damage, damage_type = self:GetAbility():GetAbilityDamageType(), ability = self, } ApplyDamage(damageTable) victim_table[victim:entindex()] = victim:entindex() end end end end end modifier_imba_naga_siren_rip_tide_debuff = modifier_imba_naga_siren_rip_tide_debuff or class({}) function modifier_imba_naga_siren_rip_tide_debuff:IsDebuff() return true end function modifier_imba_naga_siren_rip_tide_debuff:GetEffectName() return "particles/units/heroes/hero_siren/naga_siren_riptide_debuff.vpcf" end function modifier_imba_naga_siren_rip_tide_debuff:GetTexture() return "naga_siren_rip_tide" end function modifier_imba_naga_siren_rip_tide_debuff:OnCreated() self.armor_reduction = self:GetAbility():GetSpecialValueFor("armor_reduction") + self:GetCaster():FindTalentValue("special_bonus_imba_naga_siren_rip_tide_armor") self.wet_bonus_armor = self:GetAbility():GetSpecialValueFor("wet_bonus_armor") end function modifier_imba_naga_siren_rip_tide_debuff:OnRefresh() self:OnCreated() end function modifier_imba_naga_siren_rip_tide_debuff:DeclareFunctions() return { MODIFIER_PROPERTY_PHYSICAL_ARMOR_BONUS, } end function modifier_imba_naga_siren_rip_tide_debuff:GetModifierPhysicalArmorBonus() return (self.wet_bonus_armor * self:GetStackCount()) + self.armor_reduction end --================================================================================================================= -- Naga Siren: Song of the Siren --================================================================================================================= LinkLuaModifier("modifier_imba_naga_siren_song_of_the_siren_aura", "components/abilities/heroes/hero_naga_siren.lua", LUA_MODIFIER_MOTION_NONE) LinkLuaModifier("modifier_imba_naga_siren_song_of_the_siren", "components/abilities/heroes/hero_naga_siren.lua", LUA_MODIFIER_MOTION_NONE) imba_naga_siren_song_of_the_siren = imba_naga_siren_song_of_the_siren or class({}) function imba_naga_siren_song_of_the_siren:OnSpellStart() if not IsServer() then return end local pfx = ParticleManager:CreateParticle("particles/units/heroes/hero_siren/naga_siren_siren_song_cast.vpcf", PATTACH_ABSORIGIN_FOLLOW, self:GetCaster()) if self:GetAutoCastState() then self:GetCaster():AddNewModifier(self:GetCaster(), self, "modifier_imba_naga_siren_siren_temptation_aura", {duration = self:GetSpecialValueFor("duration")}) ParticleManager:SetParticleControl(pfx, 61, Vector(1, 0, 0)) else self:GetCaster():AddNewModifier(self:GetCaster(), self, "modifier_imba_naga_siren_song_of_the_siren_aura", {duration = self:GetSpecialValueFor("duration")}) end if self:GetCaster():HasScepter() then self:GetCaster():AddNewModifier(self:GetCaster(), self, "modifier_imba_naga_siren_song_of_the_siren_heal_aura", {duration = self:GetSpecialValueFor("duration")}) end self:GetCaster():EmitSound("Hero_NagaSiren.SongOfTheSiren") ParticleManager:ReleaseParticleIndex(pfx) end modifier_imba_naga_siren_song_of_the_siren_aura = modifier_imba_naga_siren_song_of_the_siren_aura or class({}) function modifier_imba_naga_siren_song_of_the_siren_aura:IsPurgable() return false end function modifier_imba_naga_siren_song_of_the_siren_aura:IsPurgeException() return false end function modifier_imba_naga_siren_song_of_the_siren_aura:IsAura() return true end function modifier_imba_naga_siren_song_of_the_siren_aura:GetAuraDuration() return self:GetAbility():GetSpecialValueFor("aura_linger") end function modifier_imba_naga_siren_song_of_the_siren_aura:GetAuraRadius() return self:GetAbility():GetSpecialValueFor("radius") end function modifier_imba_naga_siren_song_of_the_siren_aura:GetAuraSearchFlags() return DOTA_UNIT_TARGET_FLAG_INVULNERABLE end function modifier_imba_naga_siren_song_of_the_siren_aura:GetAuraSearchTeam() return DOTA_UNIT_TARGET_TEAM_ENEMY end function modifier_imba_naga_siren_song_of_the_siren_aura:GetAuraSearchType() return DOTA_UNIT_TARGET_ALL end function modifier_imba_naga_siren_song_of_the_siren_aura:GetModifierAura() return "modifier_imba_naga_siren_song_of_the_siren" end function modifier_imba_naga_siren_song_of_the_siren_aura:OnCreated() if not IsServer() then return end self.pfx = ParticleManager:CreateParticle("particles/units/heroes/hero_siren/naga_siren_song_aura.vpcf", PATTACH_ABSORIGIN_FOLLOW, self:GetCaster()) self:GetCaster():SwapAbilities(self:GetAbility():GetAbilityName(), "imba_naga_siren_song_of_the_siren_cancel", false, true) end function modifier_imba_naga_siren_song_of_the_siren_aura:OnDestroy() if not IsServer() then return end if self.pfx then ParticleManager:DestroyParticle(self.pfx, false) ParticleManager:ReleaseParticleIndex(self.pfx) end self:GetCaster():EmitSound("Hero_NagaSiren.SongOfTheSiren.Cancel") self:GetCaster():StopSound("Hero_NagaSiren.SongOfTheSiren") self:GetCaster():SwapAbilities(self:GetAbility():GetAbilityName(), "imba_naga_siren_song_of_the_siren_cancel", true, false) end modifier_imba_naga_siren_song_of_the_siren = modifier_imba_naga_siren_song_of_the_siren or class({}) function modifier_imba_naga_siren_song_of_the_siren:IsDebuff() return true end function modifier_imba_naga_siren_song_of_the_siren:IsPurgable() return false end function modifier_imba_naga_siren_song_of_the_siren:IsPurgeException() return false end function modifier_imba_naga_siren_song_of_the_siren:OnCreated() if not IsServer() then return end self.pfx = ParticleManager:CreateParticle("particles/units/heroes/hero_siren/naga_siren_song_debuff.vpcf", PATTACH_ABSORIGIN_FOLLOW, self:GetParent()) end function modifier_imba_naga_siren_song_of_the_siren:OnDestroy() if not IsServer() then return end if self.pfx then ParticleManager:DestroyParticle(self.pfx, false) ParticleManager:ReleaseParticleIndex(self.pfx) end end function modifier_imba_naga_siren_song_of_the_siren:CheckState() return { [MODIFIER_STATE_INVULNERABLE] = true, [MODIFIER_STATE_NIGHTMARED] = true, [MODIFIER_STATE_STUNNED] = true, } end function modifier_imba_naga_siren_song_of_the_siren:DeclareFunctions() return {MODIFIER_PROPERTY_OVERRIDE_ANIMATION} end function modifier_imba_naga_siren_song_of_the_siren:GetOverrideAnimation() return ACT_DOTA_DISABLED end --================================================================================================================= -- Naga Siren: Song of the Siren (Cancel) --================================================================================================================= imba_naga_siren_song_of_the_siren_cancel = imba_naga_siren_song_of_the_siren_cancel or class({}) function imba_naga_siren_song_of_the_siren_cancel:IsInnateAbility() return true end function imba_naga_siren_song_of_the_siren_cancel:ProcsMagicStick() return false end function imba_naga_siren_song_of_the_siren_cancel:OnSpellStart() if not IsServer() then return end self:GetCaster():RemoveModifierByName("modifier_imba_naga_siren_song_of_the_siren_aura") self:GetCaster():RemoveModifierByName("modifier_imba_naga_siren_song_of_the_siren_heal_aura") self:GetCaster():RemoveModifierByName("modifier_imba_naga_siren_siren_temptation_aura") end --================================================================================================================= -- Naga Siren: Song of the Siren (Aghanim Scepter aura) --================================================================================================================= LinkLuaModifier("modifier_imba_naga_siren_song_of_the_siren_heal_aura", "components/abilities/heroes/hero_naga_siren.lua", LUA_MODIFIER_MOTION_NONE) LinkLuaModifier("modifier_imba_naga_siren_song_of_the_siren_healing", "components/abilities/heroes/hero_naga_siren.lua", LUA_MODIFIER_MOTION_NONE) modifier_imba_naga_siren_song_of_the_siren_heal_aura = modifier_imba_naga_siren_song_of_the_siren_heal_aura or class({}) function modifier_imba_naga_siren_song_of_the_siren_heal_aura:IsHidden() return true end function modifier_imba_naga_siren_song_of_the_siren_heal_aura:IsPurgable() return false end function modifier_imba_naga_siren_song_of_the_siren_heal_aura:IsPurgeException() return false end function modifier_imba_naga_siren_song_of_the_siren_heal_aura:IsAura() return true end function modifier_imba_naga_siren_song_of_the_siren_heal_aura:GetAuraDuration() return self:GetAbility():GetSpecialValueFor("aura_linger") end function modifier_imba_naga_siren_song_of_the_siren_heal_aura:GetAuraRadius() return self:GetAbility():GetSpecialValueFor("radius") end function modifier_imba_naga_siren_song_of_the_siren_heal_aura:GetAuraSearchFlags() return DOTA_UNIT_TARGET_FLAG_INVULNERABLE end function modifier_imba_naga_siren_song_of_the_siren_heal_aura:GetAuraSearchTeam() return DOTA_UNIT_TARGET_TEAM_FRIENDLY end function modifier_imba_naga_siren_song_of_the_siren_heal_aura:GetAuraSearchType() return DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC end function modifier_imba_naga_siren_song_of_the_siren_heal_aura:GetModifierAura() return "modifier_imba_naga_siren_song_of_the_siren_healing" end modifier_imba_naga_siren_song_of_the_siren_healing = modifier_imba_naga_siren_song_of_the_siren_healing or class({}) function modifier_imba_naga_siren_song_of_the_siren_healing:IsPurgable() return false end function modifier_imba_naga_siren_song_of_the_siren_healing:IsPurgeException() return false end function modifier_imba_naga_siren_song_of_the_siren_healing:DeclareFunctions() return { MODIFIER_PROPERTY_HEALTH_REGEN_PERCENTAGE, } end function modifier_imba_naga_siren_song_of_the_siren_healing:GetModifierHealthRegenPercentage() return self:GetAbility():GetSpecialValueFor("scepter_regen_rate") end --================================================================================================================= -- Naga Siren: Siren's Temptation --================================================================================================================= LinkLuaModifier("modifier_imba_naga_siren_siren_temptation_aura", "components/abilities/heroes/hero_naga_siren.lua", LUA_MODIFIER_MOTION_NONE) LinkLuaModifier("modifier_imba_naga_siren_siren_temptation_debuff", "components/abilities/heroes/hero_naga_siren.lua", LUA_MODIFIER_MOTION_NONE) modifier_imba_naga_siren_siren_temptation_aura = modifier_imba_naga_siren_siren_temptation_aura or class({}) function modifier_imba_naga_siren_siren_temptation_aura:IsHidden() return true end function modifier_imba_naga_siren_siren_temptation_aura:IsPurgable() return false end function modifier_imba_naga_siren_siren_temptation_aura:IsPurgeException() return false end function modifier_imba_naga_siren_siren_temptation_aura:IsAura() return true end function modifier_imba_naga_siren_siren_temptation_aura:GetAuraDuration() return self:GetAbility():GetSpecialValueFor("aura_linger") end function modifier_imba_naga_siren_siren_temptation_aura:GetAuraRadius() return self:GetAbility():GetSpecialValueFor("radius") end function modifier_imba_naga_siren_siren_temptation_aura:GetAuraSearchFlags() return DOTA_UNIT_TARGET_FLAG_INVULNERABLE end function modifier_imba_naga_siren_siren_temptation_aura:GetAuraSearchTeam() return DOTA_UNIT_TARGET_TEAM_ENEMY end function modifier_imba_naga_siren_siren_temptation_aura:GetAuraSearchType() return DOTA_UNIT_TARGET_ALL end function modifier_imba_naga_siren_siren_temptation_aura:GetModifierAura() return "modifier_imba_naga_siren_siren_temptation_debuff" end function modifier_imba_naga_siren_siren_temptation_aura:OnCreated() if not IsServer() then return end self.pfx = ParticleManager:CreateParticle("particles/units/heroes/hero_siren/naga_siren_song_aura.vpcf", PATTACH_ABSORIGIN_FOLLOW, self:GetCaster()) ParticleManager:SetParticleControl(self.pfx, 61, Vector(1, 0, 0)) self:GetCaster():SwapAbilities(self:GetAbility():GetAbilityName(), "imba_naga_siren_song_of_the_siren_cancel", false, true) end function modifier_imba_naga_siren_siren_temptation_aura:OnDestroy() if not IsServer() then return end if self.pfx then ParticleManager:DestroyParticle(self.pfx, false) ParticleManager:ReleaseParticleIndex(self.pfx) end self:GetCaster():EmitSound("Hero_NagaSiren.SongOfTheSiren.Cancel") self:GetCaster():StopSound("Hero_NagaSiren.SongOfTheSiren") self:GetCaster():SwapAbilities(self:GetAbility():GetAbilityName(), "imba_naga_siren_song_of_the_siren_cancel", true, false) end modifier_imba_naga_siren_siren_temptation_debuff = modifier_imba_naga_siren_siren_temptation_debuff or class({}) function modifier_imba_naga_siren_siren_temptation_debuff:IsDebuff() return true end function modifier_imba_naga_siren_siren_temptation_debuff:IsPurgable() return false end function modifier_imba_naga_siren_siren_temptation_debuff:IsPurgeException() return false end function modifier_imba_naga_siren_siren_temptation_debuff:DeclareFunctions() return { MODIFIER_PROPERTY_INCOMING_DAMAGE_PERCENTAGE, -- MODIFIER_PROPERTY_MAGICAL_RESISTANCE_BONUS, } end function modifier_imba_naga_siren_siren_temptation_debuff:OnCreated() if not IsServer() then return end self.pfx = ParticleManager:CreateParticle("particles/units/heroes/hero_siren/naga_siren_song_debuff.vpcf", PATTACH_ABSORIGIN_FOLLOW, self:GetParent()) ParticleManager:SetParticleControl(self.pfx, 61, Vector(1, 0, 0)) end function modifier_imba_naga_siren_siren_temptation_debuff:GetModifierIncomingDamage_Percentage() return self:GetAbility():GetSpecialValueFor("siren_temptation_incoming_damage_pct") end -- function modifier_imba_naga_siren_siren_temptation_debuff:GetModifierMagicalResistanceBonus() -- return self:GetAbility():GetSpecialValueFor("siren_temptation_magical_resistance_reduction_pct") * (-1) -- end function modifier_imba_naga_siren_siren_temptation_debuff:OnDestroy() if not IsServer() then return end if self.pfx then ParticleManager:DestroyParticle(self.pfx, false) ParticleManager:ReleaseParticleIndex(self.pfx) end end --------------------- -- TALENT HANDLERS -- --------------------- LinkLuaModifier("modifier_special_bonus_imba_naga_siren_rip_tide_proc_chance", "components/abilities/heroes/hero_naga_siren", LUA_MODIFIER_MOTION_NONE) LinkLuaModifier("modifier_special_bonus_imba_naga_siren_mirror_image_damage_taken", "components/abilities/heroes/hero_naga_siren", LUA_MODIFIER_MOTION_NONE) modifier_special_bonus_imba_naga_siren_rip_tide_proc_chance = modifier_special_bonus_imba_naga_siren_rip_tide_proc_chance or class({}) modifier_special_bonus_imba_naga_siren_mirror_image_damage_taken = modifier_special_bonus_imba_naga_siren_mirror_image_damage_taken or class({}) function modifier_special_bonus_imba_naga_siren_rip_tide_proc_chance:IsHidden() return true end function modifier_special_bonus_imba_naga_siren_rip_tide_proc_chance:IsPurgable() return false end function modifier_special_bonus_imba_naga_siren_rip_tide_proc_chance:RemoveOnDeath() return false end function modifier_special_bonus_imba_naga_siren_mirror_image_damage_taken:IsHidden() return true end function modifier_special_bonus_imba_naga_siren_mirror_image_damage_taken:IsPurgable() return false end function modifier_special_bonus_imba_naga_siren_mirror_image_damage_taken:RemoveOnDeath() return false end LinkLuaModifier("modifier_special_bonus_imba_naga_siren_mirror_image_perfect_image", "components/abilities/heroes/hero_naga_siren", LUA_MODIFIER_MOTION_NONE) LinkLuaModifier("modifier_special_bonus_imba_naga_siren_rip_tide_armor", "components/abilities/heroes/hero_naga_siren", LUA_MODIFIER_MOTION_NONE) modifier_special_bonus_imba_naga_siren_mirror_image_perfect_image = modifier_special_bonus_imba_naga_siren_mirror_image_perfect_image or class({}) modifier_special_bonus_imba_naga_siren_rip_tide_armor = modifier_special_bonus_imba_naga_siren_rip_tide_armor or class({}) function modifier_special_bonus_imba_naga_siren_mirror_image_perfect_image:IsHidden() return true end function modifier_special_bonus_imba_naga_siren_mirror_image_perfect_image:IsPurgable() return false end function modifier_special_bonus_imba_naga_siren_mirror_image_perfect_image:RemoveOnDeath() return false end function modifier_special_bonus_imba_naga_siren_rip_tide_armor:IsHidden() return true end function modifier_special_bonus_imba_naga_siren_rip_tide_armor:IsPurgable() return false end function modifier_special_bonus_imba_naga_siren_rip_tide_armor:RemoveOnDeath() return false end function imba_naga_siren_rip_tide:OnOwnerSpawned() if not IsServer() then return end if self:GetCaster():HasTalent("special_bonus_imba_naga_siren_rip_tide_armor") and not self:GetCaster():HasModifier("modifier_special_bonus_imba_naga_siren_mirror_image_perfect_image") then self:GetCaster():AddNewModifier(self:GetCaster(), self:GetCaster():FindAbilityByName("special_bonus_imba_naga_siren_mirror_image_perfect_image"), "modifier_special_bonus_imba_naga_siren_mirror_image_perfect_image", {}) end end function imba_naga_siren_rip_tide:OnOwnerSpawned() if not IsServer() then return end if self:GetCaster():HasTalent("special_bonus_imba_naga_siren_rip_tide_armor") and not self:GetCaster():HasModifier("modifier_special_bonus_imba_naga_siren_rip_tide_armor") then self:GetCaster():AddNewModifier(self:GetCaster(), self:GetCaster():FindAbilityByName("special_bonus_imba_naga_siren_rip_tide_armor"), "modifier_special_bonus_imba_naga_siren_rip_tide_armor", {}) end end
47.952593
266
0.795446
b66ddc4a4106f246faf0b36bebd36d498222ba47
939
rb
Ruby
lib/trade_queen/rest/client.rb
nbrookie/trade_queen
1ed64e3457fd32d83cd5a0be47ce10e265c44b3b
[ "MIT" ]
null
null
null
lib/trade_queen/rest/client.rb
nbrookie/trade_queen
1ed64e3457fd32d83cd5a0be47ce10e265c44b3b
[ "MIT" ]
null
null
null
lib/trade_queen/rest/client.rb
nbrookie/trade_queen
1ed64e3457fd32d83cd5a0be47ce10e265c44b3b
[ "MIT" ]
null
null
null
require 'oauth' module TradeQueen module Rest class Client include TradeQueen::Client BASE_URL = 'https://api.tradeking.com'.freeze def quotes(*args) response = post TradeQueen::Rest::Quote::URL, symbols: args.flatten TradeQueen::Collection.new(response, TradeQueen::Rest::Quote) end def quote(symbol) quotes(symbol).first end private def post(url, params) response = oauth_access_token.post(url, params, 'Accept' => 'application/json') error = TradeQueen::Errors.fetch_by_code(response.code) raise error.new(response) if error response end def consumer @consumer ||= OAuth::Consumer.new consumer_key, consumer_secret, site: BASE_URL end def oauth_access_token @oauth_access_token ||= OAuth::AccessToken.new(consumer, access_token, access_token_secret) end end end end
24.710526
99
0.651757
5c658de1f5c363c46561a6298952a160654c627b
1,977
h
C
lib/AHRS/src/Madgwick.h
shanggl/esp-fc
59d8f8664ab73f33562a54982cdeab0eaf85fe36
[ "MIT" ]
39
2018-02-25T09:50:13.000Z
2022-03-21T08:42:06.000Z
lib/AHRS/src/Madgwick.h
shanggl/esp-fc
59d8f8664ab73f33562a54982cdeab0eaf85fe36
[ "MIT" ]
9
2018-04-25T16:14:37.000Z
2021-07-13T08:12:14.000Z
lib/AHRS/src/Madgwick.h
shanggl/esp-fc
59d8f8664ab73f33562a54982cdeab0eaf85fe36
[ "MIT" ]
17
2018-05-14T03:32:13.000Z
2022-02-17T15:53:07.000Z
//============================================================================================= // Madgwick.h //============================================================================================= // // Implementation of Madgwick's IMU and AHRS algorithms. // See: http://www.x-io.co.uk/open-source-imu-and-ahrs-algorithms/ // // From the x-io website "Open-source resources available on this website are // provided under the GNU General Public Licence unless an alternative licence // is provided in source." // // Date Author Notes // 29/09/2011 SOH Madgwick Initial release // 02/10/2011 SOH Madgwick Optimised for reduced CPU load // //============================================================================================= #ifndef Madgwick_h #define Madgwick_h #include "helper_3dmath.h" //-------------------------------------------------------------------------------------------- // Variable declaration class Madgwick { private: float q0, q1, q2, q3; // quaternion of sensor frame relative to auxiliary frame float beta; // algorithm gain float invSampleFreq; float roll, pitch, yaw; bool anglesComputed; void computeAngles(); //------------------------------------------------------------------------------------------- // Function declarations public: Madgwick(); void begin(float sampleFrequency) { invSampleFreq = 1.0f / sampleFrequency; } void update(float gx, float gy, float gz, float ax, float ay, float az, float mx, float my, float mz); void update(float gx, float gy, float gz, float ax, float ay, float az); void setKp(float p) { beta = p; } void setKi(float i) { (void)i; } const Quaternion getQuaternion() const { return Quaternion(q0, q1, q2, q3); } const VectorFloat getEuler() { if (!anglesComputed) computeAngles(); return VectorFloat(roll, pitch, yaw); } }; #endif
34.086207
107
0.49823
18b818648a6aa9677e87ca8e2440b2f39acdc30f
1,648
swift
Swift
Tests/CombineNetworkTests/Utilities/MockURLProtocol.swift
dushantSW/CombineNetwork
87115394f7af5cfc6bc15baaeff641615e25c3e9
[ "MIT" ]
4
2021-10-05T14:38:21.000Z
2022-01-03T20:54:46.000Z
Tests/CombineNetworkTests/Utilities/MockURLProtocol.swift
dushantSW/CombineNetwork
87115394f7af5cfc6bc15baaeff641615e25c3e9
[ "MIT" ]
1
2022-01-03T21:55:30.000Z
2022-01-19T08:22:15.000Z
Tests/CombineNetworkTests/Utilities/MockURLProtocol.swift
dushantSW/CombineNetwork
87115394f7af5cfc6bc15baaeff641615e25c3e9
[ "MIT" ]
null
null
null
// // File.swift // // // Created by Dushant Singh on 2021-10-04. // import Foundation import CombineNetwork typealias RequestHandlingBlock = (data: Data?, response: HTTPURLResponse?) /// Mocking the URLProtocol by returning the required information /// via requestHandler. /// /// Note that protocol ignores the endpoint instead will return whatever data exists /// in the requestHandler. class MockURLProtocol: URLProtocol { /// Static property for defining the information that should be sent when mocking an endpoint. static var requestHandler: RequestHandlingBlock? // MARK: - Overriden functions override class func canInit(with request: URLRequest) -> Bool { return true } override class func canonicalRequest(for request: URLRequest) -> URLRequest { return request } override func startLoading() { guard let requestHandler = MockURLProtocol.requestHandler else { return assertionFailure("No request handling block was provided") } guard let client = self.client else { return assertionFailure("No client was found") } if let response = requestHandler.response { client.urlProtocol(self, didReceive: response, cacheStoragePolicy: .notAllowed) } else { client.urlProtocol(self, didFailWithError: NetworkError.invalidRequest) } if let data = requestHandler.data { client.urlProtocol(self, didLoad: data) } client.urlProtocolDidFinishLoading(self) } override func stopLoading() {} }
29.428571
98
0.661408
dd7d36a8bb995ffae0bb85a6ce4a0bc66153e52f
1,090
php
PHP
application/views/dash.php
Gagendra-Ghalley/alumni_management_system
e8d02c6b7acb124e011b18992e74d79c2beb1e27
[ "MIT" ]
null
null
null
application/views/dash.php
Gagendra-Ghalley/alumni_management_system
e8d02c6b7acb124e011b18992e74d79c2beb1e27
[ "MIT" ]
null
null
null
application/views/dash.php
Gagendra-Ghalley/alumni_management_system
e8d02c6b7acb124e011b18992e74d79c2beb1e27
[ "MIT" ]
null
null
null
<?php include(" inc/header.php"); ?> <div class="main-container ace-save-state" id="main-container"> <?php include("../inc/sidebar.php"); ?> <div class="main-content"> <div class="main-content-inner"> <?php include("../inc/breadcrumb.php"); ?> <div class="page-content"> <?php include("../inc/app_setting.php"); ?> <div class="page-header"> <h1>ODS<small><i class="ace-icon fa fa-angle-double-right"></i> Dispatch and Recieve Official Letters</small></h1> </div><!-- /.page-header --> <div class="row"> <div class="col-xs-12"> <div class="row"> <div class="col-xs-12"> <?php include("ods_dashboard.php"); ?> </div><!-- /.row --> </div><!-- /.row --> <!-- PAGE CONTENT ENDS --> </div><!-- /.col --> </div><!-- /.row --> </div><!-- /.page-content --> </div> </div><!-- /.main-content --> <!-- /.ends in footer--> <?php include("../inc/inc_footer.php"); ?> <?php include("../inc/footer.php"); ?>
28.684211
121
0.487156
e344d758979670f67116a275d2e1ff64ba4130b4
1,713
kt
Kotlin
src/main/kotlin/no/nav/syfo/sykmelding/syforestmodel/SyforestSykmelding.kt
navikt/sykmeldinger-backend
527d0bfe9f7c61bab2b94fee9002feabfe92b9ff
[ "MIT" ]
null
null
null
src/main/kotlin/no/nav/syfo/sykmelding/syforestmodel/SyforestSykmelding.kt
navikt/sykmeldinger-backend
527d0bfe9f7c61bab2b94fee9002feabfe92b9ff
[ "MIT" ]
6
2020-02-19T10:34:25.000Z
2021-05-04T12:08:26.000Z
src/main/kotlin/no/nav/syfo/sykmelding/syforestmodel/SyforestSykmelding.kt
navikt/sykmeldinger-backend
527d0bfe9f7c61bab2b94fee9002feabfe92b9ff
[ "MIT" ]
1
2022-02-11T08:55:39.000Z
2022-02-11T08:55:39.000Z
package no.nav.syfo.sykmelding.syforestmodel import java.time.LocalDate import java.time.LocalDateTime data class SyforestSykmelding( val id: String? = null, val startLegemeldtFravaer: LocalDate? = null, val skalViseSkravertFelt: Boolean = false, val identdato: LocalDate? = null, val status: String? = null, val naermesteLederStatus: String? = null, val erEgenmeldt: Boolean = false, val erPapirsykmelding: Boolean = false, val innsendtArbeidsgivernavn: String? = null, val valgtArbeidssituasjon: String? = null, val mottakendeArbeidsgiver: MottakendeArbeidsgiver? = null, val orgnummer: String? = null, val sendtdato: LocalDateTime? = null, val sporsmal: Skjemasporsmal? = null, // 1 PASIENTOPPLYSNINGER val pasient: Pasient = Pasient(), // 2 ARBEIDSGIVER val arbeidsgiver: String? = null, val stillingsprosent: Int? = null, // 3 DIAGNOSE val diagnose: Diagnoseinfo = Diagnoseinfo(), // 4 MULIGHET FOR ARBEID val mulighetForArbeid: MulighetForArbeid = MulighetForArbeid(), // 5 FRISKMELDING val friskmelding: Friskmelding = Friskmelding(), // 6 UTDYPENDE OPPLYSNINGER val utdypendeOpplysninger: UtdypendeOpplysninger = UtdypendeOpplysninger(), // 7 HVA SKAL TIL FOR Å BEDRE ARBEIDSEVNEN val arbeidsevne: Arbeidsevne = Arbeidsevne(), // 8 MELDING TIL NAV val meldingTilNav: MeldingTilNav = MeldingTilNav(), // 9 MELDING TIL ARBEIDSGIVER val innspillTilArbeidsgiver: String? = null, // 11 TILBAKEDATERING val tilbakedatering: Tilbakedatering = Tilbakedatering(), // 12 BEKREFTELSE val bekreftelse: Bekreftelse = Bekreftelse(), val merknader: List<Merknad>? )
37.23913
79
0.714536
fb507825e874b4001cf54d4e3d3886b636625c3d
15,395
c
C
bin/rt/rrp2orb/rrp2orb.c
jreyes1108/antelope_contrib
be2354605d8463d6067029eb16464a0bf432a41b
[ "BSD-2-Clause", "MIT" ]
30
2015-02-20T21:44:29.000Z
2021-09-27T02:53:14.000Z
bin/rt/rrp2orb/rrp2orb.c
jreyes1108/antelope_contrib
be2354605d8463d6067029eb16464a0bf432a41b
[ "BSD-2-Clause", "MIT" ]
14
2015-07-07T19:17:24.000Z
2020-12-19T19:18:53.000Z
bin/rt/rrp2orb/rrp2orb.c
jreyes1108/antelope_contrib
be2354605d8463d6067029eb16464a0bf432a41b
[ "BSD-2-Clause", "MIT" ]
46
2015-02-06T16:22:41.000Z
2022-03-30T11:46:37.000Z
/*************************************************************************** * rrp2orb.c: * * A small client to collect data from an NEIC RRP ring file and * inject the records as SEED-type packets into an ORB. The received * records must contain blockette 1000s. * * Written by Chad Trabant, IRIS Data Management Center ***************************************************************************/ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <errno.h> #include <unistd.h> #include <stdarg.h> #include <time.h> #include <signal.h> #include <regex.h> #include <orb.h> #include <Pkt.h> #include "ring_reader.h" #include "seedutils.h" #include "mseed2orbpkt.h" #define PACKAGE "rrp2orb" #define VERSION "2010.292" static void process_record (char *record, int reclen); static int parameter_proc (int argcount, char **argvec); static char *getoptval (int argcount, char **argvec, int argopt); int lprintf (int level, const char *fmt, ...); static void term_handler (int sig); static void usage (); static int verbose = 0; /* Verbosity level */ static int modulus = 100; /* Status file update modulus */ static int shutdownsig = 0; /* Shutdown signal flag */ static regex_t *match = 0; /* Filename match regex */ static char *netcode = 0; /* Forced network code, all records restamped */ static char *ringfile = 0; /* Name of RRP ring file */ static char *extstr = 0; /* Extention for ring reading state file */ static int orb = -1; /* the ORB descriptor */ static char remap = 0; /* remap sta and chan from SEED tables */ static char *orbaddr = 0; /* the host:port of the destination ORB */ static char *mappingdb = 0; /* the database for SEED name mapping */ static char *calibdb = 0; /* the database for calibration info */ static char buf[4096]; /* The data buffer */ int main (int argc,char **argv) { Dbptr dbase; int reclen; int expected; int nout; /* Signal handling, use POSIX calls with standardized semantics */ struct sigaction sa; sa.sa_flags = SA_RESTART; sigemptyset (&sa.sa_mask); sa.sa_handler = term_handler; sigaction (SIGINT, &sa, NULL); sigaction (SIGQUIT, &sa, NULL); sigaction (SIGTERM, &sa, NULL); sa.sa_handler = SIG_IGN; sigaction (SIGHUP, &sa, NULL); sigaction (SIGPIPE, &sa, NULL); /* Process given parameters (command line and parameter file) */ if (parameter_proc (argc, argv) < 0) return -1; /* Initialize RRP ring */ if ( rrp_init(ringfile, modulus, extstr) ) return -1; /* ORB setup */ orb = orbopen (orbaddr, "w&"); if ( orb < 0 ) { lprintf (0, "%s: orbopen() error for %s\n", Program_Name, orbaddr); exit (1); } /* Database setup */ if ( mappingdb ) { if ( dbopen(mappingdb, "r+", &dbase) == dbINVALID ) { lprintf (0, "dbopen() failed for %s\n", mappingdb); exit (1); } finit_db(dbase); } expected = rrp_get_nextout(); /* Main loop, collect and archive records */ while ( ! shutdownsig ) { nout = rrp_get_nextout(); /* Sanity check: expected should be the nextout */ if ( expected != nout ) { lprintf (0, "Not getting expected block. expected=%d nextout=%d last=%d\n", expected, nout, rrp_get_lastseq()); expected = nout; } /* Get next packet */ reclen = rrp_get_next(buf, &shutdownsig); if ( ! reclen ) /* Unknown record length, could assume 512 but let's not */ { lprintf (0, "rrp_get_next() returned a zero length record, skipping\n"); } else if ( reclen < 0 ) /* Error or shutdown */ { shutdownsig = 1; } else /* Received record, process it */ { if ( reclen != 512 && reclen != 4096 ) { lprintf (0, "Unexpected record length: %d (seqno: %d)\n", reclen, nout); } /* Process record */ process_record ((char *) buf, reclen); } /* Increment and roll expected sequence number if needed */ expected++; if ( expected > MAXSEQNUM ) expected=0; } /* Shutdown ORB connection */ if ( verbose > 1 ) lprintf (0, "Shutting down ORB connection\n"); if (orb != -1) orbclose(orb); /* Shutdown procedures for the ring reading */ if ( verbose > 1 ) lprintf (0, "Shutting down ring reading\n"); rrp_shutdown(); exit(0); } /*************************************************************************** * process_record: * * Process received records by parsing the record header, creating a * "source name", performing any needed matching, and sending to the * archving routine (ds_streamproc). * ***************************************************************************/ static void process_record (char *record, int reclen) { /* Define some structures to pass to parse_record() */ static struct s_fsdh *fsdh = NULL; static struct s_blk_1000 *blk_1000 = NULL; static char *packet = NULL; static int bufsize = 0; char prtnet[4], prtsta[7]; char prtloc[4], prtchan[5]; char *spcptr, *encoding; char order[4], sourcename[50]; int parsed = 0; int seedreclen; int i,p; int sendflag = 1; double time; char srcname[ORBSRCNAME_SIZE]; int retval = 0; int nbytes = 0; /* Simple verification of a data record */ if ( record[6] != 'D' && record[6] != 'R' && record[6] != 'Q' && record[6] != 'M' ) { lprintf (1, "Record header/quality indicator unrecognized!\n"); return; } /* Make sure there is room for these structs */ fsdh = (t_fsdh *) realloc(fsdh, sizeof(t_fsdh)); blk_1000 = (t_blk_1000 *) realloc(blk_1000, sizeof(t_blk_1000)); parsed = parse_record( (char *) record, reclen, (t_fsdh *) fsdh, (t_blk_1000 *) blk_1000); if ( ! parsed ) { lprintf (1, "1000 blockette was NOT found!\n"); return; } /* Most of this monkey business is so the data stream naming convention will be consistent even with oddly filled fields */ strncpy(prtnet, fsdh->network_code, 2); prtnet[2] = '\0'; strncpy(prtsta, fsdh->station_code, 5); prtsta[5] = '\0'; strncpy(prtloc, fsdh->location_id, 2); prtloc[2] = '\0'; strncpy(prtchan, fsdh->channel_id, 3); prtchan[3] = '\0'; /* Cut trailing spaces. Assumes left justified fields */ if ( (spcptr = strstr(prtnet, " ")) != NULL ) *spcptr = '\0'; if ( (spcptr = strstr(prtsta, " ")) != NULL ) *spcptr = '\0'; if ( (spcptr = strstr(prtloc, " ")) != NULL ) *spcptr = '\0'; if ( (spcptr = strstr(prtchan, " ")) != NULL ) *spcptr = '\0'; if (prtnet[0] != '\0') strcat(prtnet, "_"); if (prtsta[0] != '\0') strcat(prtsta, "_"); if (prtloc[0] != '\0') strcat(prtloc, "_"); /* Build the source name string */ sprintf( sourcename, "%.3s%.6s%.3s%.3s", prtnet, prtsta, prtloc, prtchan ); /* Calculate record size in bytes as 2^(blk_1000->rec_len) */ for (p=1, i=1; i <= blk_1000->rec_len; i++) p *= 2; seedreclen = p; if (seedreclen != reclen) { lprintf (1, "Record was not expected size: %d, dropping\n", reclen); sendflag = 0; } /* Big or little endian reported by the 1000 blockette? */ if (blk_1000->word_swap == 0) strcpy(order, "LE"); else if (blk_1000->word_swap == 1) strcpy(order, "BE"); else strcpy(order, "??"); /* Get a description of the encoding format */ encoding = get_encoding (blk_1000->encoding); /* Force network code if supplied */ if ( netcode ) { /* Update binary record */ strncpy ( record+18, netcode, 2); /* Update parsed FSDH */ strncpy ( fsdh->network_code, netcode, 2); } /* Do regex matching if an expression was specified */ if ( match != 0 ) if ( regexec (match, sourcename, (size_t) 0, NULL, 0) != 0 ) sendflag = 0; if ( sendflag ) { if ( netcode ) lprintf (2, "%s (Forced net: '%s'): %s, %d bytes, %s\n", sourcename, netcode, order, seedreclen, encoding); else lprintf (2, "%s: %s, %d bytes, %s\n", sourcename, order, seedreclen, encoding); /* Create SEED-type ORB packet */ retval = mseed2orbpkt(record, reclen, calibdb, mappingdb, remap, &srcname[0], &time, &packet, &nbytes, &bufsize); if ( retval == 0 ) { /* Send data record to the ORB */ if ( orbput(orb, srcname, time, packet, nbytes) ) { lprintf (0, "orbput() failed: %s(%d)\n", srcname, nbytes); return; } } } else { lprintf (2, "DROPPED %s: %s, %d bytes, %s\n", sourcename, order, seedreclen, encoding); } return; } /*************************************************************************** * parameter_proc: * Process the command line parameters. * * Returns 0 on success, and -1 on failure ***************************************************************************/ static int parameter_proc (int argcount, char **argvec) { char *matchstr = 0; int optind; /* Process all command line arguments */ for (optind = 1; optind < argcount; optind++) { if (strcmp (argvec[optind], "-V") == 0) { lprintf (0, "%s version: %s\n", PACKAGE, VERSION); exit (0); } else if (strcmp (argvec[optind], "-h") == 0) { usage (); exit (0); } else if (strncmp (argvec[optind], "-v", 2) == 0) { verbose += strspn (&argvec[optind][1], "v"); } else if (strcmp (argvec[optind], "-m") == 0) { matchstr = getoptval(argcount, argvec, optind++); } else if (strcmp (argvec[optind], "-n") == 0) { char *opt = getoptval(argcount, argvec, optind++); if ( strlen (opt) > 2 ) { lprintf (0,"Network code can only be 1 or 2 characters\n"); exit (1); } netcode = (char *) malloc (3); sprintf (netcode, "%-2.2s", opt); netcode[2] = '\0'; break; } else if (strcmp (argvec[optind], "-ring") == 0) { ringfile = getoptval(argcount, argvec, optind++); } else if (strcmp (argvec[optind], "-mod") == 0) { modulus = strtol (getoptval(argcount, argvec, optind++), NULL, 10); } else if (strcmp (argvec[optind], "-ext") == 0) { extstr = getoptval(argcount, argvec, optind++); } else if (strcmp (argvec[optind], "-MD") == 0) { mappingdb = getoptval(argcount, argvec, optind++); } else if (strcmp (argvec[optind], "-CD") == 0) { calibdb = getoptval(argcount, argvec, optind++); } else if (strcmp (argvec[optind], "-r") == 0) { remap = 1; } else if (strncmp (argvec[optind], "-", 1) == 0) { lprintf (0, "Unknown option: %s\n", argvec[optind]); exit (1); } else { if ( ! orbaddr ) orbaddr = argvec[optind]; else lprintf (0, "Unknown option: %s\n", argvec[optind]); } } /* Initialize the Antelope elog printing system */ Program_Name = argvec[0]; elog_init (argcount, argvec); /* Report the program version */ lprintf (0, "%s version: %s\n", PACKAGE, VERSION); /* Check that an ORB was specified */ if ( ! orbaddr ) { lprintf (0, "Error: no ORB specified\n"); lprintf (0, "Try the -h option for help\n"); exit (1); } /* Check that an input ring was specified */ if ( ! ringfile ) { lprintf (0, "No ring file specified\n"); lprintf (0, "Try the -h option for help\n"); exit (1); } /* Compile the match regex if specified */ if ( matchstr ) { match = (regex_t *) malloc (sizeof (regex_t)); if ( regcomp(match, matchstr, REG_EXTENDED|REG_NOSUB ) != 0 ) { lprintf (0, "Cannot compile regular expression '%s'", matchstr); exit (1); } } return 0; } /* End of parameter_proc() */ /*************************************************************************** * getoptval: * Return the value to a command line option; checking that the value is * itself not an option (starting with '-') and is not past the end of * the argument list. * * argcount: total arguments in argvec * argvec: argument list * argopt: index of option to process, value is expected to be at argopt+1 * * Returns value on success and exits with error message on failure ***************************************************************************/ static char * getoptval (int argcount, char **argvec, int argopt) { if ( argvec == NULL || argvec[argopt] == NULL ) { lprintf (0, "getoptval(): NULL option requested\n"); exit (1); } if ( (argopt+1) < argcount && *argvec[argopt+1] != '-' ) return argvec[argopt+1]; lprintf (0, "Option %s requires a value\n", argvec[argopt]); exit (1); } /* End of getoptval() */ /* A generic log message print handler */ int lprintf (int level, const char *fmt, ...) { int r = 0; char message[200]; char timestr[100]; va_list argptr; time_t loc_time; if ( level <= verbose ) { va_start(argptr, fmt); /* Build local time string and cut off the newline */ time (&loc_time); strcpy (timestr, asctime(localtime(&loc_time))); timestr[strlen(timestr) - 1] = '\0'; r = vsnprintf (message, sizeof(message), fmt, argptr); fprintf(stderr, "%s - %s", timestr, message); fflush(stdout); } return r; } /*************************************************************************** * term_handler: * Signal handler routine. ***************************************************************************/ static void term_handler (int sig) { lprintf (0, "Shutting down\n"); shutdownsig = 1; } /*************************************************************************** * usage: * Print the usage message and exit. ***************************************************************************/ static void usage () { fprintf (stderr, "%s version: %s\n\n", PACKAGE, VERSION); fprintf (stderr, "Collect Mini-SEED data from a NEIC RRP ring send to an ORB\n\n"); fprintf (stderr, "Usage: %s [options] -ring <ringfile> ORB\n\n", PACKAGE); fprintf (stderr, " ## Options ##\n" " -V Report program version\n" " -h Show this usage message\n" " -v Be more verbose, multiple flags can be used (-vv or -v -v)\n" " -m regex Regular expression to match source name using\n" " a 'NET_STA_LOC_CHAN' convention, for example:\n" " 'IU_KONO_00_BH?' or 'GE_WLF_.*'\n" " -n net Change network code (after matching), 1 or 2 chars\n" "\n" " # RRP options #\n" " -ring ringfile Ring file name, required\n" " -mod nnn Write status file interval in packets (default 100)\n" " -ext string Client reader ID, must be unique, default: .ringstat\n" "\n" " # ORB options #\n" " -MD mappingdb Specify database which contains mapping of SEED to CSS names\n" " -CD calibdb Specify database containing calib information\n" " -r Remap SEED names to sta and chan codes using mapping db\n" "\n" " ORB Address of destination ORB in host:port format\n" "\n"); } /* End of usage() */
29.548944
90
0.548295
dd91a76022e91874d22138d59656eeecb5a93e41
1,216
php
PHP
routes/web.php
onesyah05/DashboardVoc
e72dfe6f74ddc3c6c8c178f4348ff7eedfc71dbe
[ "MIT" ]
null
null
null
routes/web.php
onesyah05/DashboardVoc
e72dfe6f74ddc3c6c8c178f4348ff7eedfc71dbe
[ "MIT" ]
null
null
null
routes/web.php
onesyah05/DashboardVoc
e72dfe6f74ddc3c6c8c178f4348ff7eedfc71dbe
[ "MIT" ]
null
null
null
<?php use Illuminate\Support\Facades\Route; /* |-------------------------------------------------------------------------- | Web Routes |-------------------------------------------------------------------------- | | Here is where you can register web routes for your application. These | routes are loaded by the RouteServiceProvider within a group which | contains the "web" middleware group. Now create something great! | */ Route::get('/', 'DashboardController@index'); Route::get('/reseller', 'DashboardController@Reseller'); Route::get('/report', 'DashboardController@Report'); Route::get('/stok', 'DashboardController@Stok'); Route::get('/product', 'DashboardController@Product'); Route::get('/user', 'DashboardController@User'); Route::get('/login', 'DashboardController@login'); Route::get('/logout', 'DashboardController@logout'); Route::post('/postReseller', 'DashboardController@postReseller'); Route::post('/postProduct', 'DashboardController@postProduct'); Route::post('/postStok', 'DashboardController@postStok'); Route::post('/postReport', 'DashboardController@postReport'); Route::post('/postUser', 'DashboardController@postUser'); Route::post('/postLogin', 'DashboardController@postLogin');
34.742857
75
0.653783
53d88b4842c7b7669bacfb444ad7726784c67154
12,499
java
Java
ComponentCompiler/src/main/java/com/xiaojinzi/component/FragmentProcessor.java
Diamond0071/Component
de1dde2c4a4452247b3df3b1c0765600624856b8
[ "Apache-2.0" ]
1
2020-08-26T00:52:01.000Z
2020-08-26T00:52:01.000Z
ComponentCompiler/src/main/java/com/xiaojinzi/component/FragmentProcessor.java
Diamond0071/Component
de1dde2c4a4452247b3df3b1c0765600624856b8
[ "Apache-2.0" ]
null
null
null
ComponentCompiler/src/main/java/com/xiaojinzi/component/FragmentProcessor.java
Diamond0071/Component
de1dde2c4a4452247b3df3b1c0765600624856b8
[ "Apache-2.0" ]
null
null
null
package com.xiaojinzi.component; import com.google.auto.service.AutoService; import com.squareup.javapoet.ClassName; import com.squareup.javapoet.JavaFile; import com.squareup.javapoet.MethodSpec; import com.squareup.javapoet.ParameterSpec; import com.squareup.javapoet.ParameterizedTypeName; import com.squareup.javapoet.TypeName; import com.squareup.javapoet.TypeSpec; import com.xiaojinzi.component.anno.FragmentAnno; import org.apache.commons.collections4.CollectionUtils; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Set; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Consumer; import javax.annotation.processing.ProcessingEnvironment; import javax.annotation.processing.Processor; import javax.annotation.processing.RoundEnvironment; import javax.annotation.processing.SupportedAnnotationTypes; import javax.annotation.processing.SupportedOptions; import javax.annotation.processing.SupportedSourceVersion; import javax.lang.model.SourceVersion; import javax.lang.model.element.Element; import javax.lang.model.element.ExecutableElement; import javax.lang.model.element.Modifier; import javax.lang.model.element.TypeElement; /** * 支持 Fragment 的路由的注解驱动器 */ @AutoService(Processor.class) @SupportedOptions("HOST") @SupportedSourceVersion(SourceVersion.RELEASE_7) @SupportedAnnotationTypes(ComponentUtil.FRAGMENTANNO_CLASS_NAME) public class FragmentProcessor extends BaseHostProcessor { private static final String NAME_OF_APPLICATION = "application"; private ClassName classNameFragmentContainer; private ClassName function1ClassName; private ClassName singletonFunction1ClassName; private TypeElement bundleTypeElement; private TypeName bundleTypeName; @Override public synchronized void init(ProcessingEnvironment processingEnvironment) { super.init(processingEnvironment); final TypeElement typeElementFragmentContainer = mElements.getTypeElement(ComponentConstants.FRAGMENT_MANAGER_CALL_CLASS_NAME); classNameFragmentContainer = ClassName.get(typeElementFragmentContainer); final TypeElement function1TypeElement = mElements.getTypeElement(ComponentConstants.FUNCTION1_CLASS_NAME); final TypeElement singletonFunctionTypeElement = mElements.getTypeElement(ComponentConstants.SINGLETON_FUNCTION1_CLASS_NAME); function1ClassName = ClassName.get(function1TypeElement); singletonFunction1ClassName = ClassName.get(singletonFunctionTypeElement); bundleTypeElement = mElements.getTypeElement(ComponentConstants.ANDROID_BUNDLE); bundleTypeName = TypeName.get(bundleTypeElement.asType()); } @Override public boolean process(Set<? extends TypeElement> set, RoundEnvironment roundEnvironment) { if (componentHost == null || componentHost.isEmpty()) { return false; } if (CollectionUtils.isNotEmpty(set)) { Set<? extends Element> annoElements = roundEnvironment.getElementsAnnotatedWith(FragmentAnno.class); parseAnnotation(annoElements); createImpl(); return true; } return false; } private final List<Element> annoElementList = new ArrayList<>(); private void parseAnnotation(Set<? extends Element> annoElements) { annoElementList.clear(); for (Element element : annoElements) { // 如果是一个 Service final FragmentAnno anno = element.getAnnotation(FragmentAnno.class); if (anno == null) { continue; } annoElementList.add(element); } } private void createImpl() { String claName = ComponentUtil.genHostFragmentClassName(componentHost); //pkg String pkg = claName.substring(0, claName.lastIndexOf('.')); //simpleName String cn = claName.substring(claName.lastIndexOf('.') + 1); // superClassName ClassName superClass = ClassName.get(mElements.getTypeElement(ComponentUtil.FRAGMENT_IMPL_CLASS_NAME)); MethodSpec initHostMethod = generateInitHostMethod(); MethodSpec onCreateMethod = generateOnCreateMethod(); MethodSpec onDestroyMethod = generateOnDestroyMethod(); TypeSpec typeSpec = TypeSpec.classBuilder(cn) //.addModifiers(Modifier.PUBLIC) .addModifiers(Modifier.FINAL) .superclass(superClass) .addMethod(initHostMethod) .addMethod(onCreateMethod) .addMethod(onDestroyMethod) .build(); try { JavaFile.builder(pkg, typeSpec ).indent(" ").build().writeTo(mFiler); } catch (IOException ignore) { // ignore } } private MethodSpec generateOnCreateMethod() { final ParameterSpec bundleParameter = ParameterSpec.builder(bundleTypeName, "bundle").build(); TypeName returnType = TypeName.VOID; ClassName applicationName = ClassName.get(mElements.getTypeElement(ComponentConstants.ANDROID_APPLICATION)); ParameterSpec parameterSpec = ParameterSpec.builder(applicationName, NAME_OF_APPLICATION) .addModifiers(Modifier.FINAL) .build(); final MethodSpec.Builder methodSpecBuilder = MethodSpec.methodBuilder("onCreate") .returns(returnType) .addAnnotation(Override.class) .addParameter(parameterSpec) .addModifiers(Modifier.PUBLIC); methodSpecBuilder.addStatement("super.onCreate(application)"); final AtomicInteger atomicInteger = new AtomicInteger(); annoElementList.forEach(new Consumer<Element>() { @Override public void accept(Element element) { String serviceImplCallPath = null; TypeName serviceImplTypeName = null; if (element instanceof ExecutableElement) { // 注解在方法上了 ExecutableElement methodElement = (ExecutableElement) element; serviceImplTypeName = TypeName.get(methodElement.getReturnType()); // 获取声明这个方法的类的 TypeElement TypeElement declareClassType = (TypeElement) methodElement.getEnclosingElement(); // 调用这个静态方法的全路径 serviceImplCallPath = declareClassType.toString() + "." + methodElement.getSimpleName(); } else { String serviceImplClassName = element.toString(); serviceImplTypeName = TypeName.get(mElements.getTypeElement(serviceImplClassName).asType()); } FragmentAnno anno = element.getAnnotation(FragmentAnno.class); String implName = "implName" + atomicInteger.incrementAndGet(); if (anno.singleTon()) { MethodSpec.Builder getRawMethodBuilder = MethodSpec.methodBuilder("applyRaw") .addAnnotation(Override.class) .addParameter(bundleParameter) .addModifiers(Modifier.PROTECTED); if (serviceImplCallPath == null) { boolean haveDefaultConstructor = isHaveDefaultConstructor(element.toString()); getRawMethodBuilder .addStatement("return new $T($N)", serviceImplTypeName, (haveDefaultConstructor ? "" : NAME_OF_APPLICATION)) .returns(TypeName.get(element.asType())); } else { getRawMethodBuilder .beginControlFlow("if(bundle == null)") .addStatement("bundle = new Bundle()") .endControlFlow() .addStatement("return $N(bundle)", serviceImplCallPath) .returns(serviceImplTypeName); } TypeSpec innerTypeSpec = TypeSpec.anonymousClassBuilder("") .addSuperinterface(ParameterizedTypeName.get(singletonFunction1ClassName, bundleTypeName, serviceImplTypeName)) .addMethod(getRawMethodBuilder.build()) .build(); methodSpecBuilder.addStatement("$T $N = $L", function1ClassName, implName, innerTypeSpec); } else { MethodSpec.Builder getMethodBuilder = MethodSpec.methodBuilder("apply") .addAnnotation(Override.class) .addParameter(bundleParameter) .addModifiers(Modifier.PUBLIC); if (serviceImplCallPath == null) { boolean haveDefaultConstructor = isHaveDefaultConstructor(element.toString()); getMethodBuilder .addStatement("return new $T($N)", serviceImplTypeName, (haveDefaultConstructor ? "" : NAME_OF_APPLICATION)) .returns(TypeName.get(element.asType())); } else { getMethodBuilder .beginControlFlow("if(bundle == null)") .addStatement("bundle = new Bundle()") .endControlFlow() .addStatement("return $N(bundle)", serviceImplCallPath) .returns(serviceImplTypeName); } TypeSpec innerTypeSpec = TypeSpec.anonymousClassBuilder("") .addSuperinterface(ParameterizedTypeName.get(function1ClassName, bundleTypeName, serviceImplTypeName)) .addMethod(getMethodBuilder.build()) .build(); methodSpecBuilder.addStatement("$T $N = $L", function1ClassName, implName, innerTypeSpec); } List<String> fragmentFlags = Arrays.asList(anno.value()); for (String fragmentFlag : fragmentFlags) { methodSpecBuilder.addStatement("$T.register($S,$N)", classNameFragmentContainer, fragmentFlag, implName); } } }); return methodSpecBuilder.build(); } private MethodSpec generateOnDestroyMethod() { TypeName returnType = TypeName.VOID; final MethodSpec.Builder methodSpecBuilder = MethodSpec.methodBuilder("onDestroy") .returns(returnType) .addAnnotation(Override.class) .addModifiers(Modifier.PUBLIC); methodSpecBuilder.addStatement("super.onDestroy()"); annoElementList.forEach(new Consumer<Element>() { @Override public void accept(Element element) { FragmentAnno anno = element.getAnnotation(FragmentAnno.class); List<String> fragmentFlags = Arrays.asList(anno.value()); for (String fragmentFlag : fragmentFlags) { methodSpecBuilder.addStatement("$T.unregister($S)", classNameFragmentContainer, fragmentFlag); } } }); return methodSpecBuilder.build(); } private MethodSpec generateInitHostMethod() { TypeName returnType = TypeName.get(mTypeElementString.asType()); MethodSpec.Builder openUriMethodSpecBuilder = MethodSpec.methodBuilder("getHost") .returns(returnType) .addAnnotation(Override.class) .addModifiers(Modifier.PUBLIC); openUriMethodSpecBuilder.addStatement("return $S", componentHost); return openUriMethodSpecBuilder.build(); } /** * 是否有默认的构造器 * * @param className * @return */ private boolean isHaveDefaultConstructor(String className) { // 实现类的类型 TypeElement typeElementClassImpl = mElements.getTypeElement(className); String constructorName = typeElementClassImpl.getSimpleName().toString() + ("()"); List<? extends Element> enclosedElements = typeElementClassImpl.getEnclosedElements(); for (Element enclosedElement : enclosedElements) { if (enclosedElement.toString().equals(constructorName)) { return true; } } return false; } }
46.812734
140
0.631811
2a5b77cbb2258542140eb9dd7e70870c8bbdab58
287
swift
Swift
TraktSwift/Models/Base/BaseTrendingEntity.swift
arctouch/CouchTracker
01e21f689b17f9a7ef17e1d2d1f35c3c5e3ca583
[ "Unlicense" ]
48
2017-11-23T18:04:59.000Z
2022-03-10T17:33:56.000Z
TraktSwift/Models/Base/BaseTrendingEntity.swift
arctouch/CouchTracker
01e21f689b17f9a7ef17e1d2d1f35c3c5e3ca583
[ "Unlicense" ]
90
2017-10-20T21:42:14.000Z
2020-05-21T14:41:12.000Z
TraktSwift/Models/Base/BaseTrendingEntity.swift
arctouch/CouchTracker
01e21f689b17f9a7ef17e1d2d1f35c3c5e3ca583
[ "Unlicense" ]
10
2019-01-06T23:04:08.000Z
2022-02-10T12:21:30.000Z
public class BaseTrendingEntity: Codable, Hashable { public let watchers: Int public func hash(into hasher: inout Hasher) { hasher.combine(watchers) } public static func == (lhs: BaseTrendingEntity, rhs: BaseTrendingEntity) -> Bool { lhs.watchers == rhs.watchers } }
23.916667
84
0.710801
18fef8b038bbf56d3612bd21af0652309620c584
5,481
dart
Dart
lib/screens/dashboard/dashboard_charts.dart
mariamabdelati/teddy_the_tracker
108968890a55d548fc2abf8f1fba8c2597ac145b
[ "MIT" ]
1
2022-01-14T15:16:45.000Z
2022-01-14T15:16:45.000Z
lib/screens/dashboard/dashboard_charts.dart
mariamabdelati/teddy_the_tracker
108968890a55d548fc2abf8f1fba8c2597ac145b
[ "MIT" ]
null
null
null
lib/screens/dashboard/dashboard_charts.dart
mariamabdelati/teddy_the_tracker
108968890a55d548fc2abf8f1fba8c2597ac145b
[ "MIT" ]
1
2022-02-15T14:38:26.000Z
2022-02-15T14:38:26.000Z
import 'package:flutter/material.dart'; import 'package:smooth_page_indicator/smooth_page_indicator.dart'; import '../../constants.dart'; import '../../screens/dashboard/expense_pie_chart.dart'; import 'income_pie_chart.dart'; import 'line_chart.dart'; class ChartsPageView extends StatefulWidget { const ChartsPageView({Key? key}) : super(key: key); @override _ChartsPageViewState createState() => _ChartsPageViewState(); } class _ChartsPageViewState extends State<ChartsPageView> { String bal = '0'; int currentPage = 0; PageController controller = PageController(); @override Widget build(BuildContext context) { const charts = <Widget>[ ExpensesPiechartPanel(), IncomesPiechartPanel(), Linechart(), ]; final pages = PageView.builder( onPageChanged: (int page) { setState(() { currentPage = page % charts.length; }); }, itemBuilder: (context, index){ return charts[index % charts.length]; }, controller: controller, ); return Stack(children: <Widget>[ pages, Stack( children: <Widget>[ Align( alignment: Alignment.topCenter, child: Container( margin: const EdgeInsets.only(top: 375, bottom: 15), child: Row( mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ AnimatedSmoothIndicator( onDotClicked: animateToPage, activeIndex: currentPage, count: charts.length, effect: WormEffect( spacing: 40, activeDotColor: mainColorList[4], dotColor: Colors.white.withOpacity(0.6), dotHeight: 13, dotWidth: 13, type: WormType.thin, ), ), ], ), ), ), ], ), ]); } void animateToPage(int index) => controller.animateToPage(index, duration: const Duration(milliseconds: 400), curve: Curves.easeInOut); } class ExpensesPiechartPanel extends StatefulWidget { const ExpensesPiechartPanel({Key? key}) : super(key: key); @override _ExpensesPiechartPanelState createState() => _ExpensesPiechartPanelState(); } class _ExpensesPiechartPanelState extends State<ExpensesPiechartPanel> { @override Widget build(BuildContext context) { return Align( alignment: Alignment.topCenter, child: Container( height: 400, margin: const EdgeInsets.all(6), decoration: BoxDecoration( gradient: const RadialGradient( colors: [ Color(0xFF0054DA), Color(0xFF049BD6), ], center: Alignment(1.0, 2.0), focal: Alignment(1.0,1.0), focalRadius: 1.1, ), boxShadow: const <BoxShadow>[ BoxShadow( color: Colors.grey, offset: Offset(1.1, 1.1), blurRadius: 5.0, ), ], borderRadius: BorderRadius.circular(40), ), child: const ExpensePieChart(), ), ); } } class IncomesPiechartPanel extends StatefulWidget { const IncomesPiechartPanel({Key? key}) : super(key: key); @override _IncomesPiechartPanelState createState() => _IncomesPiechartPanelState(); } class _IncomesPiechartPanelState extends State<IncomesPiechartPanel> { @override Widget build(BuildContext context) { return Align( alignment: Alignment.topCenter, child: Container( height: 400, margin: const EdgeInsets.all(6), decoration: BoxDecoration( gradient: const RadialGradient( colors: [ Color(0xFF0054DA), Color(0xFF049BD6), ], center: Alignment(1.0, 2.0), focal: Alignment(1.0,1.0), focalRadius: 1.1, ), boxShadow: const <BoxShadow>[ BoxShadow( color: Colors.grey, offset: Offset(1.1, 1.1), blurRadius: 5.0, ), ], borderRadius: BorderRadius.circular(40), ), child: const IncomePieChart(), ), ); } } class Linechart extends StatefulWidget { const Linechart({Key? key}) : super(key: key); @override _LinechartState createState() => _LinechartState(); } class _LinechartState extends State<Linechart> { @override Widget build(BuildContext context) { return Align( alignment: Alignment.topCenter, child: Container( height: 400, margin: const EdgeInsets.all(6), decoration: BoxDecoration( gradient: const RadialGradient( colors: [ Color(0xFF0054DA), Color(0xFF049BD6), ], center: Alignment(1.0, 2.0), focal: Alignment(1.0,1.0), focalRadius: 1.1, ), boxShadow: const <BoxShadow>[ BoxShadow( color: Colors.grey, offset: Offset(1.1, 1.1), blurRadius: 5.0, ), ], borderRadius: BorderRadius.circular(40), ), child: const Center( child: TestDashboard(), ), ), ); } }
27.822335
137
0.555008
963668a9c2be98da235f5261529aa927901c979d
384
php
PHP
resources/views/intranet/home.blade.php
mvelasquezp/tablero
1c609f86c04397040d48ae4ebc71c73fdc4ecd6f
[ "MIT" ]
null
null
null
resources/views/intranet/home.blade.php
mvelasquezp/tablero
1c609f86c04397040d48ae4ebc71c73fdc4ecd6f
[ "MIT" ]
null
null
null
resources/views/intranet/home.blade.php
mvelasquezp/tablero
1c609f86c04397040d48ae4ebc71c73fdc4ecd6f
[ "MIT" ]
null
null
null
<!DOCTYPE html> <html> <head> <title>{{ env('APP_TITLE') }}</title> @include('common.head') </head> <body> <div class="wrapper"> @include('common.sidebar') @include('common.navbar') <div id="content"></div> </div> <div class="overlay"></div> @include('common.scripts') </body> </html>
24
45
0.479167
db658d825df1b91f3e409be571e56cbc5fa52253
1,813
swift
Swift
tests/TestStrictCellPresenters.swift
CirrusMD/StrictDataSource
ff1aafe74e4394b59ca0c6197db0c6dfbe619635
[ "MIT" ]
null
null
null
tests/TestStrictCellPresenters.swift
CirrusMD/StrictDataSource
ff1aafe74e4394b59ca0c6197db0c6dfbe619635
[ "MIT" ]
null
null
null
tests/TestStrictCellPresenters.swift
CirrusMD/StrictDataSource
ff1aafe74e4394b59ca0c6197db0c6dfbe619635
[ "MIT" ]
null
null
null
// // CirrusMD // // Created by David Nix on 1/11/16. // Copyright © 2016 CirrusMD. All rights reserved. // import Foundation import CirrusMD import UIKit class TestPresentableTableCell: UITableViewCell, StrictPresentableTableCell { typealias ViewData = String var tableView: UITableView? static var reuseID: String { return "TestTablePresentableCell" } func updateWithViewData(_ viewData: ViewData, tableView: UITableView) { self.tableView = tableView textLabel?.text = viewData } } struct StubbedTableCellPresenter: StrictTableCellPresenterType { var reuseID: String { return "I'm just a stub" } func configureCell(_ cell: UITableViewCell, tableView: UITableView) -> UITableViewCell { return cell } } class TestPresentableCollectionCell: UICollectionViewCell, StrictPresentableCollectionCell { typealias ViewData = String let label = UILabel() var collectionView: UICollectionView? static var reuseID: String { return "TestCollectionPresentableCell" } func updateWithViewData(_ viewData: ViewData, collectionView: UICollectionView) { self.collectionView = collectionView label.text = viewData } } class TestSupplementaryPresenter: StrictSupplementaryPresenter { var reuseIdentifier: String = "TestSupplementaryPresentable" let kind = UICollectionElementKindSectionHeader let indexPath = IndexPath(row: 0, section: 0) var lastView: UIView? var lastCollectionView: UICollectionView? func configure(_ view: UICollectionReusableView, collectionView: UICollectionView) -> UICollectionReusableView { lastView = view lastCollectionView = collectionView return view } }
25.535211
116
0.704357
86149d4e9fb2a0391d171040c775d58bed4a584e
4,402
go
Go
xyw.com/dborm/zndx/deviceAlert.go
W250883168/wshua.go
676323a48827bf889d5337dc6eedde305cad9cfe
[ "Apache-2.0" ]
2
2018-07-04T02:09:02.000Z
2019-07-11T02:38:23.000Z
xyw.com/dborm/zndx/deviceAlert.go
W250883168/go.repo
676323a48827bf889d5337dc6eedde305cad9cfe
[ "Apache-2.0" ]
null
null
null
xyw.com/dborm/zndx/deviceAlert.go
W250883168/go.repo
676323a48827bf889d5337dc6eedde305cad9cfe
[ "Apache-2.0" ]
null
null
null
package zndx import ( "gopkg.in/gorp.v1" "xutils/xdebug" "xutils/xtime" ) /* CREATE TABLE `devicealert` ( `Id` bigint(50) NOT NULL AUTO_INCREMENT, `DeviceId` varchar(50) DEFAULT NULL, `AlertType` varchar(50) DEFAULT NULL COMMENT '1-超时使用预警 2-状态值条件预警 3-具体状态值预警', `StatusCode` varchar(50) DEFAULT NULL, `StatusValueCode` varchar(50) DEFAULT NULL, `AlertDescription` varchar(1000) DEFAULT NULL COMMENT '为预警信息生成一句话的描述', `LastAlertTime` varchar(50) DEFAULT NULL COMMENT '记录最后一次的警告时间', PRIMARY KEY (`Id`) ) ENGINE=MyISAM AUTO_INCREMENT=753 DEFAULT CHARSET=gbk COMMENT='对于状态值条件预警和具体状态值预警:一个设备的相同状态编码和状态值编码,只存在一条;\r\n对于超时使用警告:一个'; 对于状态值条件预警和具体状态值预警:一个设备的相同状态编码和状态值编码,只存在一条; 对于超时使用警告:一个设备的超时使用警告只存在一条; 节点每10秒上传一次数据,就在上传数据时进行设备的预警处理 */ type DeviceAlert struct { Id int DeviceId string // 设备ID AlertType string // 预警分类 StatusCode string // 状态代码 StatusValueCode string // 状态值编码 AlertDescription string // 预警描述 LastAlertTime string // 上次预警时间 } // 插入 func (p *DeviceAlert) Insert(pDBMap *gorp.DbMap) (err error) { pDBMap.AddTableWithName(DeviceAlert{}, "devicealert").SetKeys(true, "Id") err = pDBMap.Insert(p) return err } // 删除 func (p *DeviceAlert) Delete(pDBMap *gorp.DbMap) (affects int, err error) { pDBMap.AddTableWithName(DeviceAlert{}, "devicealert").SetKeys(true, "Id") rows, err := pDBMap.Delete(p) return int(rows), err } func (p *DeviceAlert) Update(pDBMap *gorp.DbMap) (affects int, err error) { pDBMap.AddTableWithName(DeviceAlert{}, "devicealert").SetKeys(true, "Id") rows, err := pDBMap.Update(p) return int(rows), err } // 删除设备对应的预警记录(按状态码, AlertType=2) func (p *DeviceAlert) Delete_ByStatusCodeAndDevice(pDev *Device, pDBMap *gorp.DbMap) (err error) { sql := ` DELETE FROM DeviceAlert WHERE AlertType = '2' AND StatusCode =? AND DeviceId IN (SELECT Id FROM Device WHERE JoinNodeId =? AND JoinSocketId =?) ` _, err = pDBMap.Exec(sql, p.StatusCode, pDev.JoinNodeId, pDev.JoinSocketId) return err } // 删除设备对应的预警记录(按具体状态值, AlertType=3) func (p *DeviceAlert) Delete_ByStatusValueAndDevice(pDev *Device, pDBMap *gorp.DbMap) (err error) { sql := ` DELETE FROM DeviceAlert WHERE AlertType = '3' AND StatusCode =? AND StatusValueCode =? AND DeviceId IN (SELECT Id FROM Device WHERE JoinNodeId =? AND JoinSocketId =?) ` args := []interface{}{p.StatusCode, p.StatusValueCode, pDev.JoinNodeId, pDev.JoinSocketId} _, err = pDBMap.Exec(sql, args...) return err } // 创建预警消息(通过设备连接节点ID和插口ID获得设备ID,根据这两个ID查询设备,看起来好象会找到多个设备,但实际上只有一个设备,因为一个插口只能接一个设备) // 状态值条件预警(AlertType=2) func (p *DeviceAlert) Insert_ByStatusCodeAndDevice(pDev *Device, pDBMap *gorp.DbMap) (err error) { sql := ` INSERT INTO DeviceAlert (DeviceId, AlertType, AlertDescription, LastAlertTime, StatusCode ) SELECT id,?,?,?,? FROM Device WHERE JoinNodeId =? AND JoinSocketId =? ` args := []interface{}{"2", p.AlertDescription, xtime.NowString(), p.StatusCode, pDev.JoinNodeId, pDev.JoinSocketId} _, err = pDBMap.Exec(sql, args...) return err } //创建新的预警消息(通过连接节点ID和插口ID获得设备ID,根据这两个ID查询设备,看起来好象会找到多个设备,但实际上只有一个设备,因为一个插口只能接一个设备) // 具体状态值预警(AlertType=3) func (p *DeviceAlert) Insert_ByStatusValueAndDevice(pDev *Device, pDBMap *gorp.DbMap) (err error) { sql := ` INSERT INTO DeviceAlert (DeviceId, AlertType, AlertDescription, LastAlertTime, StatusCode, StatusValueCode) SELECT id,?,?,?,?,? FROM Device WHERE JoinNodeId =? AND JoinSocketId =? ` args := []interface{}{"3", p.AlertDescription, p.LastAlertTime, p.StatusCode, p.StatusValueCode, pDev.JoinNodeId, pDev.JoinSocketId} _, err = pDBMap.Exec(sql, args...) return err } // 删除设备超时预警(AlertType = '1') func (p *DeviceAlert) Delete_DeviceOvertime(device_id string, pDBMap *gorp.DbMap) (err error) { sql := `DELETE FROM DeviceAlert WHERE DeviceId =? AND AlertType = '1'` _, err = pDBMap.Exec(sql, device_id) return err } func DeviceAlert_Get(id int, pDBMap *gorp.DbMap) (pAlert *DeviceAlert, err error) { pDBMap.AddTableWithName(DeviceAlert{}, "devicealert").SetKeys(true, "Id") pObj, err := pDBMap.Get(DeviceAlert{}, id) pAlert, _ = pObj.(*DeviceAlert) return pAlert, err } // 告警存在? func DeviceAlert_Exists_ByDeviceID(devID string, pDBMap *gorp.DbMap) (exist bool) { exist = true query := "SELECT COUNT(1) FROM devicealert WHERE DeviceId = ?" count, err := pDBMap.SelectInt(query, devID) xdebug.LogError(err) if err == nil { exist = count > 0 } return exist }
32.367647
133
0.727851
3e224607991619f8f9ffdd64ccd5155865a2042e
361
h
C
FMDBDemo/FMDBDemo/Model/HomeRecommendInfo.h
lilongcnc/LLFMDBEasy
58dd7b0d79076507520e75665a2500ac3c4251fe
[ "MIT" ]
null
null
null
FMDBDemo/FMDBDemo/Model/HomeRecommendInfo.h
lilongcnc/LLFMDBEasy
58dd7b0d79076507520e75665a2500ac3c4251fe
[ "MIT" ]
null
null
null
FMDBDemo/FMDBDemo/Model/HomeRecommendInfo.h
lilongcnc/LLFMDBEasy
58dd7b0d79076507520e75665a2500ac3c4251fe
[ "MIT" ]
null
null
null
// // Person.h // FMDBDemo // // Created by 李龙 on 16/12/14. // Copyright © 2016年 李龙. All rights reserved. // #import <Foundation/Foundation.h> @interface HomeRecommendInfo : NSObject @property (nonatomic,copy) NSString *name; @property (nonatomic,copy) NSString *age; + (instancetype)homeRecommendInfoWithName:(NSString *)name age:(NSString *)age; @end
20.055556
79
0.717452
40e07a2aada0fb641e95c6583187e9c716c950c1
1,551
py
Python
twitter_bot.py
lunava/twitter-bot-test
b22570e25a2d2cf224eec088b6f9854e0d7802a5
[ "MIT" ]
null
null
null
twitter_bot.py
lunava/twitter-bot-test
b22570e25a2d2cf224eec088b6f9854e0d7802a5
[ "MIT" ]
null
null
null
twitter_bot.py
lunava/twitter-bot-test
b22570e25a2d2cf224eec088b6f9854e0d7802a5
[ "MIT" ]
null
null
null
import tweepy , tkinter, datetime, os, sys, random, time, pytz from keys import * from tweepy import TweepError #Create oauth handler for tokens setting auth = tweepy.OAuthHandler(consumer_token, consumer_secret) auth.set_access_token(key,secret) api = tweepy.API(auth) random_lyrics = 'Lyrics.txt' time_stamp = pytz.timezone('US/Central') #Creating a function that scans and stores the last statusID def test_bot(): try: api.verify_credentials() print('Authentication was successful') except: print('Error') user = api.me() print(user.name + ' ' + 'Succesfully Signing In....') mentions = api.mentions_timeline(count = 1) mentions_id = api.get_status print(mentions_id) for tweet in mentions: filesong = open(random_lyrics, 'r') lyrics = filesong.readlines() song_lines = len(lyrics) #Setting Counter random_lyric = random.randrange(0, song_lines) tid = tweet.user.id username_of_person = tweet.user.screen_name try: api.update_status("@" + username_of_person + ' ' + lyrics[random_lyric], in_reply_to_status_id = tid).append(time_stamp) print('Replied to' + ' ' + username_of_person + ' ' + 'with:'+ ' '+lyrics[random_lyric]) except tweepy.TweepError as e: print(e.reason) #LOOPS Infinately, for every 10 seconds while True: test_bot() time.sleep(15)
23.861538
134
0.615087
0bf2ffa3da9ab9549382958a3b0be4e44d53b920
156,928
js
JavaScript
frontend/web/js/jquery/jquery.min.js
jaybril/www.juice.com
6d97441883c7cc3badf0a33f56bc74883879df56
[ "BSD-3-Clause" ]
null
null
null
frontend/web/js/jquery/jquery.min.js
jaybril/www.juice.com
6d97441883c7cc3badf0a33f56bc74883879df56
[ "BSD-3-Clause" ]
null
null
null
frontend/web/js/jquery/jquery.min.js
jaybril/www.juice.com
6d97441883c7cc3badf0a33f56bc74883879df56
[ "BSD-3-Clause" ]
null
null
null
/*! jQuery v1.8.3 jquery.com | jquery.org/license */ (function(e,t){function _(e){var t=M[e]={};return v.each(e.split(y),function(e,n){t[n]=!0}),t}function H(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(P,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:D.test(r)?v.parseJSON(r):r}catch(s){}v.data(e,n,r)}else r=t}return r}function B(e){var t;for(t in e){if(t==="data"&&v.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function et(){return!1}function tt(){return!0}function ut(e){return!e||!e.parentNode||e.parentNode.nodeType===11}function at(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function ft(e,t,n){t=t||0;if(v.isFunction(t))return v.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return v.grep(e,function(e,r){return e===t===n});if(typeof t=="string"){var r=v.grep(e,function(e){return e.nodeType===1});if(it.test(t))return v.filter(t,r,!n);t=v.filter(t,r)}return v.grep(e,function(e,r){return v.inArray(e,t)>=0===n})}function lt(e){var t=ct.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function At(e,t){if(t.nodeType!==1||!v.hasData(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r<i;r++)v.event.add(t,n,u[n][r])}o.data&&(o.data=v.extend({},o.data))}function Ot(e,t){var n;if(t.nodeType!==1)return;t.clearAttributes&&t.clearAttributes(),t.mergeAttributes&&t.mergeAttributes(e),n=t.nodeName.toLowerCase(),n==="object"?(t.parentNode&&(t.outerHTML=e.outerHTML),v.support.html5Clone&&e.innerHTML&&!v.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):n==="input"&&Et.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):n==="option"?t.selected=e.defaultSelected:n==="input"||n==="textarea"?t.defaultValue=e.defaultValue:n==="script"&&t.text!==e.text&&(t.text=e.text),t.removeAttribute(v.expando)}function Mt(e){return typeof e.getElementsByTagName!="undefined"?e.getElementsByTagName("*"):typeof e.querySelectorAll!="undefined"?e.querySelectorAll("*"):[]}function _t(e){Et.test(e.type)&&(e.defaultChecked=e.checked)}function Qt(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=Jt.length;while(i--){t=Jt[i]+n;if(t in e)return t}return r}function Gt(e,t){return e=t||e,v.css(e,"display")==="none"||!v.contains(e.ownerDocument,e)}function Yt(e,t){var n,r,i=[],s=0,o=e.length;for(;s<o;s++){n=e[s];if(!n.style)continue;i[s]=v._data(n,"olddisplay"),t?(!i[s]&&n.style.display==="none"&&(n.style.display=""),n.style.display===""&&Gt(n)&&(i[s]=v._data(n,"olddisplay",nn(n.nodeName)))):(r=Dt(n,"display"),!i[s]&&r!=="none"&&v._data(n,"olddisplay",r))}for(s=0;s<o;s++){n=e[s];if(!n.style)continue;if(!t||n.style.display==="none"||n.style.display==="")n.style.display=t?i[s]||"":"none"}return e}function Zt(e,t,n){var r=Rt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function en(e,t,n,r){var i=n===(r?"border":"content")?4:t==="width"?1:0,s=0;for(;i<4;i+=2)n==="margin"&&(s+=v.css(e,n+$t[i],!0)),r?(n==="content"&&(s-=parseFloat(Dt(e,"padding"+$t[i]))||0),n!=="margin"&&(s-=parseFloat(Dt(e,"border"+$t[i]+"Width"))||0)):(s+=parseFloat(Dt(e,"padding"+$t[i]))||0,n!=="padding"&&(s+=parseFloat(Dt(e,"border"+$t[i]+"Width"))||0));return s}function tn(e,t,n){var r=t==="width"?e.offsetWidth:e.offsetHeight,i=!0,s=v.support.boxSizing&&v.css(e,"boxSizing")==="border-box";if(r<=0||r==null){r=Dt(e,t);if(r<0||r==null)r=e.style[t];if(Ut.test(r))return r;i=s&&(v.support.boxSizingReliable||r===e.style[t]),r=parseFloat(r)||0}return r+en(e,t,n||(s?"border":"content"),i)+"px"}function nn(e){if(Wt[e])return Wt[e];var t=v("<"+e+">").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write("<!doctype html><html><body>"),Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u<a;u++)r=o[u],s=/^\+/.test(r),s&&(r=r.substr(1)||"*"),i=e[r]=e[r]||[],i[s?"unshift":"push"](n)}}function kn(e,n,r,i,s,o){s=s||n.dataTypes[0],o=o||{},o[s]=!0;var u,a=e[s],f=0,l=a?a.length:0,c=e===Sn;for(;f<l&&(c||!u);f++)u=a[f](n,r,i),typeof u=="string"&&(!c||o[u]?u=t:(n.dataTypes.unshift(u),u=kn(e,n,r,i,u,o)));return(c||!u)&&!o["*"]&&(u=kn(e,n,r,i,"*",o)),u}function Ln(e,n){var r,i,s=v.ajaxSettings.flatOptions||{};for(r in n)n[r]!==t&&((s[r]?e:i||(i={}))[r]=n[r]);i&&v.extend(!0,e,i)}function An(e,n,r){var i,s,o,u,a=e.contents,f=e.dataTypes,l=e.responseFields;for(s in l)s in r&&(n[l[s]]=r[s]);while(f[0]==="*")f.shift(),i===t&&(i=e.mimeType||n.getResponseHeader("content-type"));if(i)for(s in a)if(a[s]&&a[s].test(i)){f.unshift(s);break}if(f[0]in r)o=f[0];else{for(s in r){if(!f[0]||e.converters[s+" "+f[0]]){o=s;break}u||(u=s)}o=o||u}if(o)return o!==f[0]&&f.unshift(o),r[o]}function On(e,t){var n,r,i,s,o=e.dataTypes.slice(),u=o[0],a={},f=0;e.dataFilter&&(t=e.dataFilter(t,e.dataType));if(o[1])for(n in e.converters)a[n.toLowerCase()]=e.converters[n];for(;i=o[++f];)if(i!=="*"){if(u!=="*"&&u!==i){n=a[u+" "+i]||a["* "+i];if(!n)for(r in a){s=r.split(" ");if(s[1]===i){n=a[u+" "+s[0]]||a["* "+s[0]];if(n){n===!0?n=a[r]:a[r]!==!0&&(i=s[0],o.splice(f--,0,i));break}}}if(n!==!0)if(n&&e["throws"])t=n(t);else try{t=n(t)}catch(l){return{state:"parsererror",error:n?l:"No conversion from "+u+" to "+i}}}u=i}return{state:"success",data:t}}function Fn(){try{return new e.XMLHttpRequest}catch(t){}}function In(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function $n(){return setTimeout(function(){qn=t},0),qn=v.now()}function Jn(e,t){v.each(t,function(t,n){var r=(Vn[t]||[]).concat(Vn["*"]),i=0,s=r.length;for(;i<s;i++)if(r[i].call(e,t,n))return})}function Kn(e,t,n){var r,i=0,s=0,o=Xn.length,u=v.Deferred().always(function(){delete a.elem}),a=function(){var t=qn||$n(),n=Math.max(0,f.startTime+f.duration-t),r=n/f.duration||0,i=1-r,s=0,o=f.tweens.length;for(;s<o;s++)f.tweens[s].run(i);return u.notifyWith(e,[f,i,n]),i<1&&o?n:(u.resolveWith(e,[f]),!1)},f=u.promise({elem:e,props:v.extend({},t),opts:v.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:qn||$n(),duration:n.duration,tweens:[],createTween:function(t,n,r){var i=v.Tween(e,f.opts,t,n,f.opts.specialEasing[t]||f.opts.easing);return f.tweens.push(i),i},stop:function(t){var n=0,r=t?f.tweens.length:0;for(;n<r;n++)f.tweens[n].run(1);return t?u.resolveWith(e,[f,t]):u.rejectWith(e,[f,t]),this}}),l=f.props;Qn(l,f.opts.specialEasing);for(;i<o;i++){r=Xn[i].call(f,e,l,f.opts);if(r)return r}return Jn(f,l),v.isFunction(f.opts.start)&&f.opts.start.call(e,f),v.fx.timer(v.extend(a,{anim:f,queue:f.opts.queue,elem:e})),f.progress(f.opts.progress).done(f.opts.done,f.opts.complete).fail(f.opts.fail).always(f.opts.always)}function Qn(e,t){var n,r,i,s,o;for(n in e){r=v.camelCase(n),i=t[r],s=e[n],v.isArray(s)&&(i=s[1],s=e[n]=s[0]),n!==r&&(e[r]=s,delete e[n]),o=v.cssHooks[r];if(o&&"expand"in o){s=o.expand(s),delete e[r];for(n in s)n in e||(e[n]=s[n],t[n]=i)}else t[r]=i}}function Gn(e,t,n){var r,i,s,o,u,a,f,l,c,h=this,p=e.style,d={},m=[],g=e.nodeType&&Gt(e);n.queue||(l=v._queueHooks(e,"fx"),l.unqueued==null&&(l.unqueued=0,c=l.empty.fire,l.empty.fire=function(){l.unqueued||c()}),l.unqueued++,h.always(function(){h.always(function(){l.unqueued--,v.queue(e,"fx").length||l.empty.fire()})})),e.nodeType===1&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],v.css(e,"display")==="inline"&&v.css(e,"float")==="none"&&(!v.support.inlineBlockNeedsLayout||nn(e.nodeName)==="inline"?p.display="inline-block":p.zoom=1)),n.overflow&&(p.overflow="hidden",v.support.shrinkWrapBlocks||h.done(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in t){s=t[r];if(Un.exec(s)){delete t[r],a=a||s==="toggle";if(s===(g?"hide":"show"))continue;m.push(r)}}o=m.length;if(o){u=v._data(e,"fxshow")||v._data(e,"fxshow",{}),"hidden"in u&&(g=u.hidden),a&&(u.hidden=!g),g?v(e).show():h.done(function(){v(e).hide()}),h.done(function(){var t;v.removeData(e,"fxshow",!0);for(t in d)v.style(e,t,d[t])});for(r=0;r<o;r++)i=m[r],f=h.createTween(i,g?u[i]:0),d[i]=u[i]||v.style(e,i),i in u||(u[i]=f.start,g&&(f.end=f.start,f.start=i==="width"||i==="height"?1:0))}}function Yn(e,t,n,r,i){return new Yn.prototype.init(e,t,n,r,i)}function Zn(e,t){var n,r={height:e},i=0;t=t?1:0;for(;i<4;i+=2-t)n=$t[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function tr(e){return v.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:!1}var n,r,i=e.document,s=e.location,o=e.navigator,u=e.jQuery,a=e.$,f=Array.prototype.push,l=Array.prototype.slice,c=Array.prototype.indexOf,h=Object.prototype.toString,p=Object.prototype.hasOwnProperty,d=String.prototype.trim,v=function(e,t){return new v.fn.init(e,t,n)},m=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,g=/\S/,y=/\s+/,b=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,w=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,E=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,N=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,C=/^-ms-/,k=/-([\da-z])/gi,L=function(e,t){return(t+"").toUpperCase()},A=function(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",A,!1),v.ready()):i.readyState==="complete"&&(i.detachEvent("onreadystatechange",A),v.ready())},O={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:i,e=v.parseHTML(s[1],a,!0),E.test(s[1])&&v.isPlainObject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getElementById(s[2]);if(o&&o.parentNode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return l.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushStack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a<f;a++)if((e=arguments[a])!=null)for(n in e){r=u[n],i=e[n];if(u===i)continue;l&&i&&(v.isPlainObject(i)||(s=v.isArray(i)))?(s?(s=!1,o=r&&v.isArray(r)?r:[]):o=r&&v.isPlainObject(r)?r:{},u[n]=v.extend(l,o,i)):i!==t&&(u[n]=i)}return u},v.extend({noConflict:function(t){return e.$===v&&(e.$=a),t&&e.jQuery===v&&(e.jQuery=u),v},isReady:!1,readyWait:1,holdReady:function(e){e?v.readyWait++:v.ready(!0)},ready:function(e){if(e===!0?--v.readyWait:v.isReady)return;if(!i.body)return setTimeout(v.ready,1);v.isReady=!0;if(e!==!0&&--v.readyWait>0)return;r.resolveWith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isFunction:function(e){return v.type(e)==="function"},isArray:Array.isArray||function(e){return v.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):O[h.call(e)]||"object"},isPlainObject:function(e){if(!e||v.type(e)!=="object"||e.nodeType||v.isWindow(e))return!1;try{if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||p.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||i,(r=E.exec(e))?[t.createElement(r[1])]:(r=v.buildFragment([e],t,n?null:[]),v.merge([],(r.cacheable?v.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=v.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(S.test(t.replace(T,"@").replace(N,"]").replace(x,"")))return(new Function("return "+t))();v.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&v.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&g.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(k,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||v.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s<o;)if(n.apply(e[s++],r)===!1)break}else if(u){for(i in e)if(n.call(e[i],i,e[i])===!1)break}else for(;s<o;)if(n.call(e[s],s,e[s++])===!1)break;return e},trim:d&&!d.call("\ufeff\u00a0")?function(e){return e==null?"":d.call(e)}:function(e){return e==null?"":(e+"").replace(b,"")},makeArray:function(e,t){var n,r=t||[];return e!=null&&(n=v.type(e),e.length==null||n==="string"||n==="function"||n==="regexp"||v.isWindow(e)?f.call(r,e):v.merge(r,e)),r},inArray:function(e,t,n){var r;if(t){if(c)return c.call(t,e,n);r=t.length,n=n?n<0?Math.max(0,r+n):n:0;for(;n<r;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,s=0;if(typeof r=="number")for(;s<r;s++)e[i++]=n[s];else while(n[s]!==t)e[i++]=n[s++];return e.length=i,e},grep:function(e,t,n){var r,i=[],s=0,o=e.length;n=!!n;for(;s<o;s++)r=!!t(e[s],s),n!==r&&i.push(e[s]);return i},map:function(e,n,r){var i,s,o=[],u=0,a=e.length,f=e instanceof v||a!==t&&typeof a=="number"&&(a>0&&e[0]&&e[a-1]||a===0||v.isArray(e));if(f)for(;u<a;u++)i=n(e[u],u,r),i!=null&&(o[o.length]=i);else for(s in e)i=n(e[s],s,r),i!=null&&(o[o.length]=i);return o.concat.apply([],o)},guid:1,proxy:function(e,n){var r,i,s;return typeof n=="string"&&(r=e[n],n=e,e=r),v.isFunction(e)?(i=l.call(arguments,2),s=function(){return e.apply(n,i.concat(l.call(arguments)))},s.guid=e.guid=e.guid||v.guid++,s):t},access:function(e,n,r,i,s,o,u){var a,f=r==null,l=0,c=e.length;if(r&&typeof r=="object"){for(l in r)v.access(e,n,l,r[l],1,o,i);s=1}else if(i!==t){a=u===t&&v.isFunction(i),f&&(a?(a=n,n=function(e,t,n){return a.call(v(e),n)}):(n.call(e,i),n=null));if(n)for(;l<c;l++)n(e[l],r,a?i.call(e[l],l,n(e[l],r)):i,u);s=1}return s?e:f?n.call(e):c?n(e[0],r):o},now:function(){return(new Date).getTime()}}),v.ready.promise=function(t){if(!r){r=v.Deferred();if(i.readyState==="complete")setTimeout(v.ready,1);else if(i.addEventListener)i.addEventListener("DOMContentLoaded",A,!1),e.addEventListener("load",v.ready,!1);else{i.attachEvent("onreadystatechange",A),e.attachEvent("onload",v.ready);var n=!1;try{n=e.frameElement==null&&i.documentElement}catch(s){}n&&n.doScroll&&function o(){if(!v.isReady){try{n.doScroll("left")}catch(e){return setTimeout(o,50)}v.ready()}}()}}return r.promise(t)},v.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(e,t){O["[object "+t+"]"]=t.toLowerCase()}),n=v(i);var M={};v.Callbacks=function(e){e=typeof e=="string"?M[e]||_(e):v.extend({},e);var n,r,i,s,o,u,a=[],f=!e.once&&[],l=function(t){n=e.memory&&t,r=!0,u=s||0,s=0,o=a.length,i=!0;for(;a&&u<o;u++)if(a[u].apply(t[0],t[1])===!1&&e.stopOnFalse){n=!1;break}i=!1,a&&(f?f.length&&l(f.shift()):n?a=[]:c.disable())},c={add:function(){if(a){var t=a.length;(function r(t){v.each(t,function(t,n){var i=v.type(n);i==="function"?(!e.unique||!c.has(n))&&a.push(n):n&&n.length&&i!=="string"&&r(n)})})(arguments),i?o=a.length:n&&(s=t,l(n))}return this},remove:function(){return a&&v.each(arguments,function(e,t){var n;while((n=v.inArray(t,a,n))>-1)a.splice(n,1),i&&(n<=o&&o--,n<=u&&u--)}),this},has:function(e){return v.inArray(e,a)>-1},empty:function(){return a=[],this},disable:function(){return a=f=n=t,this},disabled:function(){return!a},lock:function(){return f=t,n||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!r||f)&&(i?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},v.extend({Deferred:function(e){var t=[["resolve","done",v.Callbacks("once memory"),"resolved"],["reject","fail",v.Callbacks("once memory"),"rejected"],["notify","progress",v.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return v.Deferred(function(n){v.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](v.isFunction(o)?function(){var e=o.apply(this,arguments);e&&v.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return e!=null?v.extend(e,r):r}},i={};return r.pipe=r.then,v.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=l.call(arguments),r=n.length,i=r!==1||e&&v.isFunction(e.promise)?r:0,s=i===1?e:v.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?l.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t<r;t++)n[t]&&v.isFunction(n[t].promise)?n[t].promise().done(o(t,f,n)).fail(s.reject).progress(o(t,a,u)):--i}return i||s.resolveWith(f,n),s.promise()}}),v.support=function(){var t,n,r,s,o,u,a,f,l,c,h,p=i.createElement("div");p.setAttribute("className","t"),p.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="<table><tr><td></td><td>t</td></tr></table>",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="<div></div>",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i<s;i++)delete r[t[i]];if(!(n?B:v.isEmptyObject)(r))return}}if(!n){delete u[a].data;if(!B(u[a]))return}o?v.cleanData([e],!0):v.support.deleteExpando||u!=u.window?delete u[a]:u[a]=null},_data:function(e,t,n){return v.data(e,t,n,!0)},acceptData:function(e){var t=e.nodeName&&v.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),v.fn.extend({data:function(e,n){var r,i,s,o,u,a=this[0],f=0,l=null;if(e===t){if(this.length){l=v.data(a);if(a.nodeType===1&&!v._data(a,"parsedAttrs")){s=a.attributes;for(u=s.length;f<u;f++)o=s[f].name,o.indexOf("data-")||(o=v.camelCase(o.substring(5)),H(a,o,l[o]));v._data(a,"parsedAttrs",!0)}}return l}return typeof e=="object"?this.each(function(){v.data(this,e)}):(r=e.split(".",2),r[1]=r[1]?"."+r[1]:"",i=r[1]+"!",v.access(this,function(n){if(n===t)return l=this.triggerHandler("getData"+i,[r[0]]),l===t&&a&&(l=v.data(a,e),l=H(a,e,l)),l===t&&r[1]?this.data(r[0]):l;r[1]=n,this.each(function(){var t=v(this);t.triggerHandler("setData"+i,r),v.data(this,e,n),t.triggerHandler("changeData"+i,r)})},null,n,arguments.length>1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length<r?v.queue(this[0],e):n===t?this:this.each(function(){var t=v.queue(this,e,n);v._queueHooks(this,e),e==="fx"&&t[0]!=="inprogress"&&v.dequeue(this,e)})},dequeue:function(e){return this.each(function(){v.dequeue(this,e)})},delay:function(e,t){return e=v.fx?v.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,s=v.Deferred(),o=this,u=this.length,a=function(){--i||s.resolveWith(o,[o])};typeof e!="string"&&(n=e,e=t),e=e||"fx";while(u--)r=v._data(o[u],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(a));return a(),s.promise(n)}});var j,F,I,q=/[\t\r\n]/g,R=/\r/g,U=/^(?:button|input)$/i,z=/^(?:button|input|object|select|textarea)$/i,W=/^a(?:rea|)$/i,X=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,V=v.support.getSetAttribute;v.fn.extend({attr:function(e,t){return v.access(this,v.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n<r;n++){i=this[n];if(i.nodeType===1)if(!i.className&&t.length===1)i.className=e;else{s=" "+i.className+" ";for(o=0,u=t.length;o<u;o++)s.indexOf(" "+t[o]+" ")<0&&(s+=t[o]+" ");i.className=v.trim(s)}}}return this},removeClass:function(e){var n,r,i,s,o,u,a;if(v.isFunction(e))return this.each(function(t){v(this).removeClass(e.call(this,t,this.className))});if(e&&typeof e=="string"||e===t){n=(e||"").split(y);for(u=0,a=this.length;u<a;u++){i=this[u];if(i.nodeType===1&&i.className){r=(" "+i.className+" ").replace(q," ");for(s=0,o=n.length;s<o;s++)while(r.indexOf(" "+n[s]+" ")>=0)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n<r;n++)if(this[n].nodeType===1&&(" "+this[n].className+" ").replace(q," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a<u;a++){n=r[a];if((n.selected||a===i)&&(v.support.optDisabled?!n.disabled:n.getAttribute("disabled")===null)&&(!n.parentNode.disabled||!v.nodeName(n.parentNode,"optgroup"))){t=v(n).val();if(s)return t;o.push(t)}}return o},set:function(e,t){var n=v.makeArray(t);return v(e).find("option").each(function(){this.selected=v.inArray(v(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o<r.length;o++)i=r[o],i&&(n=v.propFix[i]||i,s=X.test(i),s||v.attr(e,i,""),e.removeAttribute(V?i:n),s&&n in e&&(e[n]=!1))}},attrHooks:{type:{set:function(e,t){if(U.test(e.nodeName)&&e.parentNode)v.error("type property can't be changed");else if(!v.support.radioValue&&t==="radio"&&v.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}},value:{get:function(e,t){return j&&v.nodeName(e,"button")?j.get(e,t):t in e?e.value:null},set:function(e,t,n){if(j&&v.nodeName(e,"button"))return j.set(e,t,n);e.value=t}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,s,o,u=e.nodeType;if(!e||u===3||u===8||u===2)return;return o=u!==1||!v.isXMLDoc(e),o&&(n=v.propFix[n]||n,s=v.propHooks[n]),r!==t?s&&"set"in s&&(i=s.set(e,r,n))!==t?i:e[n]=r:s&&"get"in s&&(i=s.get(e,n))!==null?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):z.test(e.nodeName)||W.test(e.nodeName)&&e.href?0:t}}}}),F={get:function(e,n){var r,i=v.prop(e,n);return i===!0||typeof i!="boolean"&&(r=e.getAttributeNode(n))&&r.nodeValue!==!1?n.toLowerCase():t},set:function(e,t,n){var r;return t===!1?v.removeAttr(e,n):(r=v.propFix[n]||n,r in e&&(e[r]=!0),e.setAttribute(n,n.toLowerCase())),n}},V||(I={name:!0,id:!0,coords:!0},j=v.valHooks.button={get:function(e,n){var r;return r=e.getAttributeNode(n),r&&(I[n]?r.value!=="":r.specified)?r.value:t},set:function(e,t,n){var r=e.getAttributeNode(n);return r||(r=i.createAttribute(n),e.setAttributeNode(r)),r.value=t+""}},v.each(["width","height"],function(e,t){v.attrHooks[t]=v.extend(v.attrHooks[t],{set:function(e,n){if(n==="")return e.setAttribute(t,"auto"),n}})}),v.attrHooks.contenteditable={get:j.get,set:function(e,t,n){t===""&&(t="false"),j.set(e,t,n)}}),v.support.hrefNormalized||v.each(["href","src","width","height"],function(e,n){v.attrHooks[n]=v.extend(v.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return r===null?t:r}})}),v.support.style||(v.attrHooks.style={get:function(e){return e.style.cssText.toLowerCase()||t},set:function(e,t){return e.style.cssText=t+""}}),v.support.optSelected||(v.propHooks.selected=v.extend(v.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),v.support.enctype||(v.propFix.enctype="encoding"),v.support.checkOn||v.each(["radio","checkbox"],function(){v.valHooks[this]={get:function(e){return e.getAttribute("value")===null?"on":e.value}}}),v.each(["radio","checkbox"],function(){v.valHooks[this]=v.extend(v.valHooks[this],{set:function(e,t){if(v.isArray(t))return e.checked=v.inArray(v(e).val(),t)>=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f<n.length;f++){l=J.exec(n[f])||[],c=l[1],h=(l[2]||"").split(".").sort(),g=v.event.special[c]||{},c=(s?g.delegateType:g.bindType)||c,g=v.event.special[c]||{},p=v.extend({type:c,origType:l[1],data:i,handler:r,guid:r.guid,selector:s,needsContext:s&&v.expr.match.needsContext.test(s),namespace:h.join(".")},d),m=a[c];if(!m){m=a[c]=[],m.delegateCount=0;if(!g.setup||g.setup.call(e,i,h,u)===!1)e.addEventListener?e.addEventListener(c,u,!1):e.attachEvent&&e.attachEvent("on"+c,u)}g.add&&(g.add.call(e,p),p.handler.guid||(p.handler.guid=r.guid)),s?m.splice(m.delegateCount++,0,p):m.push(p),v.event.global[c]=!0}e=null},global:{},remove:function(e,t,n,r,i){var s,o,u,a,f,l,c,h,p,d,m,g=v.hasData(e)&&v._data(e);if(!g||!(h=g.events))return;t=v.trim(Z(t||"")).split(" ");for(s=0;s<t.length;s++){o=J.exec(t[s])||[],u=a=o[1],f=o[2];if(!u){for(u in h)v.event.remove(e,u+t[s],n,r,!0);continue}p=v.event.special[u]||{},u=(r?p.delegateType:p.bindType)||u,d=h[u]||[],l=d.length,f=f?new RegExp("(^|\\.)"+f.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null;for(c=0;c<d.length;c++)m=d[c],(i||a===m.origType)&&(!n||n.guid===m.guid)&&(!f||f.test(m.namespace))&&(!r||r===m.selector||r==="**"&&m.selector)&&(d.splice(c--,1),m.selector&&d.delegateCount--,p.remove&&p.remove.call(e,m));d.length===0&&l!==d.length&&((!p.teardown||p.teardown.call(e,f,g.handle)===!1)&&v.removeEvent(e,u,g.handle),delete h[u])}v.isEmptyObject(h)&&(delete g.handle,v.removeData(e,"events",!0))},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(n,r,s,o){if(!s||s.nodeType!==3&&s.nodeType!==8){var u,a,f,l,c,h,p,d,m,g,y=n.type||n,b=[];if(Y.test(y+v.event.triggered))return;y.indexOf("!")>=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f<m.length&&!n.isPropagationStopped();f++)l=m[f][0],n.type=m[f][1],d=(v._data(l,"events")||{})[n.type]&&v._data(l,"handle"),d&&d.apply(l,r),d=h&&l[h],d&&v.acceptData(l)&&d.apply&&d.apply(l,r)===!1&&n.preventDefault();return n.type=y,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(s.ownerDocument,r)===!1)&&(y!=="click"||!v.nodeName(s,"a"))&&v.acceptData(s)&&h&&s[y]&&(y!=="focus"&&y!=="blur"||n.target.offsetWidth!==0)&&!v.isWindow(s)&&(c=s[h],c&&(s[h]=null),v.event.triggered=y,s[y](),v.event.triggered=t,c&&(s[h]=c)),n.result}return},dispatch:function(n){n=v.event.fix(n||e.event);var r,i,s,o,u,a,f,c,h,p,d=(v._data(this,"events")||{})[n.type]||[],m=d.delegateCount,g=l.call(arguments),y=!n.exclusive&&!n.namespace,b=v.event.special[n.type]||{},w=[];g[0]=n,n.delegateTarget=this;if(b.preDispatch&&b.preDispatch.call(this,n)===!1)return;if(m&&(!n.button||n.type!=="click"))for(s=n.target;s!=this;s=s.parentNode||this)if(s.disabled!==!0||n.type!=="click"){u={},f=[];for(r=0;r<m;r++)c=d[r],h=c.selector,u[h]===t&&(u[h]=c.needsContext?v(h,this).index(s)>=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r<w.length&&!n.isPropagationStopped();r++){a=w[r],n.currentTarget=a.elem;for(i=0;i<a.matches.length&&!n.isImmediatePropagationStopped();i++){c=a.matches[i];if(y||!n.namespace&&!c.namespace||n.namespace_re&&n.namespace_re.test(c.namespace))n.data=c.data,n.handleObj=c,o=((v.event.special[c.origType]||{}).handle||c.handler).apply(a.elem,g),o!==t&&(n.result=o,o===!1&&(n.preventDefault(),n.stopPropagation()))}}return b.postDispatch&&b.postDispatch.call(this,n),n.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return e.which==null&&(e.which=t.charCode!=null?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,s,o,u=n.button,a=n.fromElement;return e.pageX==null&&n.clientX!=null&&(r=e.target.ownerDocument||i,s=r.documentElement,o=r.body,e.pageX=n.clientX+(s&&s.scrollLeft||o&&o.scrollLeft||0)-(s&&s.clientLeft||o&&o.clientLeft||0),e.pageY=n.clientY+(s&&s.scrollTop||o&&o.scrollTop||0)-(s&&s.clientTop||o&&o.clientTop||0)),!e.relatedTarget&&a&&(e.relatedTarget=a===e.target?n.toElement:a),!e.which&&u!==t&&(e.which=u&1?1:u&2?3:u&4?2:0),e}},fix:function(e){if(e[v.expando])return e;var t,n,r=e,s=v.event.fixHooks[e.type]||{},o=s.props?this.props.concat(s.props):this.props;e=v.Event(r);for(t=o.length;t;)n=o[--t],e[n]=r[n];return e.target||(e.target=r.srcElement||i),e.target.nodeType===3&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,r):e},special:{load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(e,t,n){v.isWindow(this)&&(this.onbeforeunload=n)},teardown:function(e,t){this.onbeforeunload===t&&(this.onbeforeunload=null)}}},simulate:function(e,t,n,r){var i=v.extend(new v.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?v.event.trigger(i,null,t):v.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},v.event.handle=v.event.dispatch,v.removeEvent=i.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]=="undefined"&&(e[r]=null),e.detachEvent(r,n))},v.Event=function(e,t){if(!(this instanceof v.Event))return new v.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?tt:et):this.type=e,t&&v.extend(this,t),this.timeStamp=e&&e.timeStamp||v.now(),this[v.expando]=!0},v.Event.prototype={preventDefault:function(){this.isDefaultPrevented=tt;var e=this.originalEvent;if(!e)return;e.preventDefault?e.preventDefault():e.returnValue=!1},stopPropagation:function(){this.isPropagationStopped=tt;var e=this.originalEvent;if(!e)return;e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=tt,this.stopPropagation()},isDefaultPrevented:et,isPropagationStopped:et,isImmediatePropagationStopped:et},v.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){v.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,s=e.handleObj,o=s.selector;if(!i||i!==r&&!v.contains(r,i))e.type=s.origType,n=s.handler.apply(this,arguments),e.type=t;return n}}}),v.support.submitBubbles||(v.event.special.submit={setup:function(){if(v.nodeName(this,"form"))return!1;v.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=v.nodeName(n,"input")||v.nodeName(n,"button")?n.form:t;r&&!v._data(r,"_submit_attached")&&(v.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),v._data(r,"_submit_attached",!0))})},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&v.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){if(v.nodeName(this,"form"))return!1;v.event.remove(this,"._submit")}}),v.support.changeBubbles||(v.event.special.change={setup:function(){if($.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")v.event.add(this,"propertychange._change",function(e){e.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),v.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),v.event.simulate("change",this,e,!0)});return!1}v.event.add(this,"beforeactivate._change",function(e){var t=e.target;$.test(t.nodeName)&&!v._data(t,"_change_attached")&&(v.event.add(t,"change._change",function(e){this.parentNode&&!e.isSimulated&&!e.isTrigger&&v.event.simulate("change",this.parentNode,e,!0)}),v._data(t,"_change_attached",!0))})},handle:function(e){var t=e.target;if(this!==t||e.isSimulated||e.isTrigger||t.type!=="radio"&&t.type!=="checkbox")return e.handleObj.handler.apply(this,arguments)},teardown:function(){return v.event.remove(this,"._change"),!$.test(this.nodeName)}}),v.support.focusinBubbles||v.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){v.event.simulate(t,e.target,v.event.fix(e),!0)};v.event.special[t]={setup:function(){n++===0&&i.addEventListener(e,r,!0)},teardown:function(){--n===0&&i.removeEventListener(e,r,!0)}}}),v.fn.extend({on:function(e,n,r,i,s){var o,u;if(typeof e=="object"){typeof n!="string"&&(r=r||n,n=t);for(u in e)this.on(u,n,r,e[u],s);return this}r==null&&i==null?(i=n,r=n=t):i==null&&(typeof n=="string"?(i=r,r=t):(i=r,r=n,n=t));if(i===!1)i=et;else if(!i)return this;return s===1&&(o=i,i=function(e){return v().off(e),o.apply(this,arguments)},i.guid=o.guid||(o.guid=v.guid++)),this.each(function(){v.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,s;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,v(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if(typeof e=="object"){for(s in e)this.off(s,n,e[s]);return this}if(n===!1||typeof n=="function")r=n,n=t;return r===!1&&(r=et),this.each(function(){v.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},live:function(e,t,n){return v(this.context).on(e,this.selector,t,n),this},die:function(e,t){return v(this.context).off(e,this.selector||"**",t),this},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return arguments.length===1?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){v.event.trigger(e,t,this)})},triggerHandler:function(e,t){if(this[0])return v.event.trigger(e,t,this[0],!0)},toggle:function(e){var t=arguments,n=e.guid||v.guid++,r=0,i=function(n){var i=(v._data(this,"lastToggle"+e.guid)||0)%r;return v._data(this,"lastToggle"+e.guid,i+1),n.preventDefault(),t[i].apply(this,arguments)||!1};i.guid=n;while(r<t.length)t[r++].guid=n;return this.click(i)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),v.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){v.fn[t]=function(e,n){return n==null&&(n=e,e=null),arguments.length>0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodeType;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=R.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return S.apply(n,x.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&Z&&t.getElementsByClassName)return S.apply(n,x.call(t.getElementsByClassName(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return N(function(t){return t=+t,N(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=L[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=F.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=I.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=J[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):L(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentNode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodeType===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodeType===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexOf(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodeType===1)if(e(t,r,u))return t}}function ft(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u<a;u++)if(s=e[u])if(!n||n(s,r,i))o.push(s),f&&t.push(u);return o}function ct(e,t,n,r,i,s){return r&&!r[d]&&(r=ct(r)),i&&!i[d]&&(i=ct(i,s)),N(function(s,o,u,a){var f,l,c,h=[],p=[],d=o.length,v=s||dt(t||"*",u.nodeType?[u]:u,[]),m=e&&(s||!t)?lt(v,h,e,u,a):v,g=n?i||(s?e:d||r)?[]:o:m;n&&n(m,g,u,a);if(r){f=lt(g,p),r(f,[],u,a),l=f.length;while(l--)if(c=f[l])g[p[l]]=!(m[p[l]]=c)}if(s){if(i||e){if(i){f=[],l=g.length;while(l--)(c=g[l])&&f.push(m[l]=c);i(null,g=[],f,a)}l=g.length;while(l--)(c=g[l])&&(f=i?T.call(s,c):h[l])>-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):S.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return T.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r))}];for(;a<s;a++)if(n=i.relative[e[a].type])h=[at(ft(h),n)];else{n=i.filter[e[a].type].apply(null,e[a].matches);if(n[d]){r=++a;for(;r<s;r++)if(i.relative[e[r].type])break;return ct(a>1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a<r&&ht(e.slice(a,r)),r<s&&ht(e=e.slice(r)),r<s&&e.join(""))}h.push(n)}return ft(h)}function pt(e,t){var r=t.length>0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",x=u&&[],T=h!=null,N=c,C=u||s&&i.find.TAG("*",h&&a.parentNode||a),k=b+=N==null?1:Math.E;T&&(c=a!==g&&a,n=o.el);for(;(p=C[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}T&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=E.call(l));m=lt(m)}S.apply(l,m),T&&!u&&m.length>0&&y+t.length>1&&nt.uniqueSort(l)}return T&&(b=k,c=N),x};return o.el=0,r?N(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r<i;r++)nt(e,t[r],n);return n}function vt(e,t,n,r,s){var o,u,f,l,c,h=ut(e),p=h.length;if(!r&&h.length===1){u=h[0]=h[0].slice(0);if(u.length>2&&(f=u[0]).type==="ID"&&t.nodeType===9&&!s&&i.relative[u[1].type]){t=i.find.ID(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=J.POS.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentNode||t,s)){u.splice(o,1),e=r.length&&u.join("");if(!e)return S.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=String,g=e.document,y=g.documentElement,b=0,w=0,E=[].pop,S=[].push,x=[].slice,T=[].indexOf||function(e){var t=0,n=this.length;for(;t<n;t++)if(this[t]===e)return t;return-1},N=function(e,t){return e[d]=t==null||t,e},C=function(){var e={},t=[];return N(function(n,r){return t.push(n)>i.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},k=C(),L=C(),A=C(),O="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=M.replace("w","w#"),D="([*^$|!~]?=)",P="\\["+O+"*("+M+")"+O+"*(?:"+D+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+O+"*\\]",H=":("+M+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+P+")|[^:]|\\\\.)*|.*))\\)|)",B=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)",j=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+O+"*"),I=new RegExp("^"+O+"*([\\x20\\t\\r\\n\\f>+~])"+O+"*"),q=new RegExp(H),R=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,U=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,W=/:not\($/,X=/h\d/i,V=/input|select|textarea|button/i,$=/\\(?!\\)/g,J={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),NAME:new RegExp("^\\[name=['\"]?("+M+")['\"]?\\]"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+H),POS:new RegExp(B,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),needsContext:new RegExp("^"+O+"*[>+~]|"+B,"i")},K=function(e){var t=g.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},Q=K(function(e){return e.appendChild(g.createComment("")),!e.getElementsByTagName("*").length}),G=K(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),Y=K(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),Z=K(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),et=K(function(e){e.id=d+0,e.innerHTML="<a name='"+d+"'></a><div name='"+d+"'></div>",y.insertBefore(e,y.firstChild);var t=g.getElementsByName&&g.getElementsByName(d).length===2+g.getElementsByName(d+0).length;return r=!g.getElementById(d),y.removeChild(e),t});try{x.call(y.childNodes,0)[0].nodeType}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesSelector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=s(t);return n},o=nt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:y.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):r||Y?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cacheLength:50,createPseudo:N,match:J,attrHandle:G?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:r?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:Q?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:et&&function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:Z&&function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},PSEUDO:function(e){var t,n;if(J.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:r?function(e){return e=e.replace($,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[d][e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexOf(n)===0:t==="*="?n&&s.indexOf(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexOf(n)>-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=T.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:N(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?N(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:N(function(e){return function(t){return nt(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return X.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return V.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:st(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:st(function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}},f=y.compareDocumentPosition?function(e,t){return e===t?(l=!0,0):(!e.compareDocumentPosition||!t.compareDocumentPosition?e.compareDocumentPosition:e.compareDocumentPosition(t)&4)?-1:1}:function(e,t){if(e===t)return l=!0,0;if(e.sourceIndex&&t.sourceIndex)return e.sourceIndex-t.sourceIndex;var n,r,i=[],s=[],o=e.parentNode,u=t.parentNode,a=o;if(o===u)return ot(e,t);if(!o)return-1;if(!u)return 1;while(a)i.unshift(a),a=a.parentNode;a=u;while(a)s.unshift(a),a=a.parentNode;n=i.length,r=s.length;for(var f=0;f<n&&f<r;f++)if(i[f]!==s[f])return ot(i[f],s[f]);return f===n?ot(e,s[f],-1):ot(i[f],t,1)},[0,0].sort(f),h=!l,nt.uniqueSort=function(e){var t,n=[],r=1,i=0;l=h,e.sort(f);if(l){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));while(i--)e.splice(n[i],1)}return e},nt.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},a=nt.compile=function(e,t){var n,r=[],i=[],s=A[d][e+" "];if(!s){t||(t=ut(e)),n=t.length;while(n--)s=ht(t[n]),s[d]?r.push(s):i.push(s);s=A(e,pt(i,r))}return s},g.querySelectorAll&&function(){var e,t=vt,n=/'|\\/g,r=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,i=[":focus"],s=[":active"],u=y.matchesSelector||y.mozMatchesSelector||y.webkitMatchesSelector||y.oMatchesSelector||y.msMatchesSelector;K(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||i.push("\\["+O+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),K(function(e){e.innerHTML="<p test=''></p>",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+O+"*(?:\"\"|'')"),e.innerHTML="<input type='hidden'/>",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=new RegExp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodeType===9&&e;if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){a=ut(e),(l=r.getAttribute("id"))?c=l.replace(n,"\\$&"):r.setAttribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentNode||r,p=a.join(",")}if(p)try{return S.apply(s,x.call(h.querySelectorAll(p),0)),s}catch(v){}finally{l||r.removeAttribute("id")}}return t(e,r,s,o,u)},u&&(K(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",H)}catch(n){}}),s=new RegExp(s.join("|")),nt.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setFilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t<n;t++)if(v.contains(u[t],this))return!0});o=this.pushStack("","find",e);for(t=0,n=this.length;t<n;t++){r=o.length,v.find(e,this[t],o);if(t>0)for(i=r;i<o.length;i++)for(s=0;s<r;s++)if(o[s]===o[i]){o.splice(i--,1);break}}return o},has:function(e){var t,n=v(e,this),r=n.length;return this.filter(function(){for(t=0;t<r;t++)if(v.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e,!1),"not",e)},filter:function(e){return this.pushStack(ft(this,e,!0),"filter",e)},is:function(e){return!!e&&(typeof e=="string"?st.test(e)?v(e,this.context).index(this[0])>=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=st.test(e)||typeof e!="string"?v(e,t||this.context):0;for(;r<i;r++){n=this[r];while(n&&n.ownerDocument&&n!==t&&n.nodeType!==11){if(o?o.index(n)>-1:v.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return s=s.length>1?v.unique(s):s,this.pushStack(s,"closest",e)},index:function(e){return e?typeof e=="string"?v.inArray(this[0],v(e)):v.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?v(e,t):v.makeArray(e&&e.nodeType?[e]:e),r=v.merge(this.get(),n);return this.pushStack(ut(n[0])||ut(r[0])?r:v.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),v.fn.andSelf=v.fn.addBack,v.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return v.dir(e,"parentNode")},parentsUntil:function(e,t,n){return v.dir(e,"parentNode",n)},next:function(e){return at(e,"nextSibling")},prev:function(e){return at(e,"previousSibling")},nextAll:function(e){return v.dir(e,"nextSibling")},prevAll:function(e){return v.dir(e,"previousSibling")},nextUntil:function(e,t,n){return v.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return v.dir(e,"previousSibling",n)},siblings:function(e){return v.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return v.sibling(e.firstChild)},contents:function(e){return v.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:v.merge([],e.childNodes)}},function(e,t){v.fn[e]=function(n,r){var i=v.map(this,t,n);return nt.test(e)||(r=n),r&&typeof r=="string"&&(i=v.filter(r,i)),i=this.length>1&&!ot[e]?v.unique(i):i,this.length>1&&rt.test(e)&&(i=i.reverse()),this.pushStack(i,e,l.call(arguments).join(","))}}),v.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?v.find.matchesSelector(t[0],e)?[t[0]]:[]:v.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!v(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var ct="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ht=/ jQuery\d+="(?:null|\d+)"/g,pt=/^\s+/,dt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,vt=/<([\w:]+)/,mt=/<tbody/i,gt=/<|&#?\w+;/,yt=/<(?:script|style|link)/i,bt=/<(?:script|object|embed|option|style)/i,wt=new RegExp("<(?:"+ct+")[\\s/>]","i"),Et=/^(?:checkbox|radio)$/,St=/checked\s*(?:[^=]|=\s*.checked.)/i,xt=/\/(java|ecma)script/i,Tt=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,Nt={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},Ct=lt(i),kt=Ct.appendChild(i.createElement("div"));Nt.optgroup=Nt.option,Nt.tbody=Nt.tfoot=Nt.colgroup=Nt.caption=Nt.thead,Nt.th=Nt.td,v.support.htmlSerialize||(Nt._default=[1,"X<div>","</div>"]),v.fn.extend({text:function(e){return v.access(this,function(e){return e===t?v.text(this):this.empty().append((this[0]&&this[0].ownerDocument||i).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(v.isFunction(e))return this.each(function(t){v(this).wrapAll(e.call(this,t))});if(this[0]){var t=v(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return v.isFunction(e)?this.each(function(t){v(this).wrapInner(e.call(this,t))}):this.each(function(){var t=v(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=v.isFunction(e);return this.each(function(n){v(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){v.nodeName(this,"body")||v(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(e,this),"before",this.selector)}},after:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(this,e),"after",this.selector)}},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||v.filter(e,[n]).length)!t&&n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),v.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n);return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&v.cleanData(e.getElementsByTagName("*"));while(e.firstChild)e.removeChild(e.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return v.clone(this,e,t)})},html:function(e){return v.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(ht,""):t;if(typeof e=="string"&&!yt.test(e)&&(v.support.htmlSerialize||!wt.test(e))&&(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(dt,"<$1></$2>");try{for(;r<i;r++)n=this[r]||{},n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),n.innerHTML=e);n=0}catch(s){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){return ut(this[0])?this.length?this.pushStack(v(v.isFunction(e)?e():e),"replaceWith",e):this:v.isFunction(e)?this.each(function(t){var n=v(this),r=n.html();n.replaceWith(e.call(this,t,r))}):(typeof e!="string"&&(e=v(e).detach()),this.each(function(){var t=this.nextSibling,n=this.parentNode;v(this).remove(),t?v(t).before(e):v(n).append(e)}))},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=[].concat.apply([],e);var i,s,o,u,a=0,f=e[0],l=[],c=this.length;if(!v.support.checkClone&&c>1&&typeof f=="string"&&St.test(f))return this.each(function(){v(this).domManip(e,n,r)});if(v.isFunction(f))return this.each(function(i){var s=v(this);e[0]=f.call(this,i,n?s.html():t),s.domManip(e,n,r)});if(this[0]){i=v.buildFragment(e,this,l),o=i.fragment,s=o.firstChild,o.childNodes.length===1&&(o=s);if(s){n=n&&v.nodeName(s,"tr");for(u=i.cacheable||c-1;a<c;a++)r.call(n&&v.nodeName(this[a],"table")?Lt(this[a],"tbody"):this[a],a===u?o:v.clone(o,!0,!0))}o=s=null,l.length&&v.each(l,function(e,t){t.src?v.ajax?v.ajax({url:t.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):v.error("no ajax"):v.globalEval((t.text||t.textContent||t.innerHTML||"").replace(Tt,"")),t.parentNode&&t.parentNode.removeChild(t)})}return this}}),v.buildFragment=function(e,n,r){var s,o,u,a=e[0];return n=n||i,n=!n.nodeType&&n[0]||n,n=n.ownerDocument||n,e.length===1&&typeof a=="string"&&a.length<512&&n===i&&a.charAt(0)==="<"&&!bt.test(a)&&(v.support.checkClone||!St.test(a))&&(v.support.html5Clone||!wt.test(a))&&(o=!0,s=v.fragments[a],u=s!==t),s||(s=n.createDocumentFragment(),v.clean(e,n,s,r),o&&(v.fragments[a]=u&&s)),{fragment:s,cacheable:o}},v.fragments={},v.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){v.fn[e]=function(n){var r,i=0,s=[],o=v(n),u=o.length,a=this.length===1&&this[0].parentNode;if((a==null||a&&a.nodeType===11&&a.childNodes.length===1)&&u===1)return o[t](this[0]),this;for(;i<u;i++)r=(i>0?this.clone(!0):this).get(),v(o[i])[t](r),s=s.concat(r);return this.pushStack(s,e,o.selector)}}),v.extend({clone:function(e,t,n){var r,i,s,o;v.support.html5Clone||v.isXMLDoc(e)||!wt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(kt.innerHTML=e.outerHTML,kt.removeChild(o=kt.firstChild));if((!v.support.noCloneEvent||!v.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!v.isXMLDoc(e)){Ot(e,o),r=Mt(e),i=Mt(o);for(s=0;r[s];++s)i[s]&&Ot(r[s],i[s])}if(t){At(e,o);if(n){r=Mt(e),i=Mt(o);for(s=0;r[s];++s)At(r[s],i[s])}}return r=i=null,o},clean:function(e,t,n,r){var s,o,u,a,f,l,c,h,p,d,m,g,y=t===i&&Ct,b=[];if(!t||typeof t.createDocumentFragment=="undefined")t=i;for(s=0;(u=e[s])!=null;s++){typeof u=="number"&&(u+="");if(!u)continue;if(typeof u=="string")if(!gt.test(u))u=t.createTextNode(u);else{y=y||lt(t),c=t.createElement("div"),y.appendChild(c),u=u.replace(dt,"<$1></$2>"),a=(vt.exec(u)||["",""])[1].toLowerCase(),f=Nt[a]||Nt._default,l=f[0],c.innerHTML=f[1]+u+f[2];while(l--)c=c.lastChild;if(!v.support.tbody){h=mt.test(u),p=a==="table"&&!h?c.firstChild&&c.firstChild.childNodes:f[1]==="<table>"&&!h?c.childNodes:[];for(o=p.length-1;o>=0;--o)v.nodeName(p[o],"tbody")&&!p[o].childNodes.length&&p[o].parentNode.removeChild(p[o])}!v.support.leadingWhitespace&&pt.test(u)&&c.insertBefore(t.createTextNode(pt.exec(u)[0]),c.firstChild),u=c.childNodes,c.parentNode.removeChild(c)}u.nodeType?b.push(u):v.merge(b,u)}c&&(u=c=y=null);if(!v.support.appendChecked)for(s=0;(u=b[s])!=null;s++)v.nodeName(u,"input")?_t(u):typeof u.getElementsByTagName!="undefined"&&v.grep(u.getElementsByTagName("input"),_t);if(n){m=function(e){if(!e.type||xt.test(e.type))return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e)};for(s=0;(u=b[s])!=null;s++)if(!v.nodeName(u,"script")||!m(u))n.appendChild(u),typeof u.getElementsByTagName!="undefined"&&(g=v.grep(v.merge([],u.getElementsByTagName("script")),m),b.splice.apply(b,[s+1,0].concat(g)),s+=g.length)}return b},cleanData:function(e,t){var n,r,i,s,o=0,u=v.expando,a=v.cache,f=v.support.deleteExpando,l=v.event.special;for(;(i=e[o])!=null;o++)if(t||v.acceptData(i)){r=i[u],n=r&&a[r];if(n){if(n.events)for(s in n.events)l[s]?v.event.remove(i,s):v.removeEvent(i,s,n.handle);a[r]&&(delete a[r],f?delete i[u]:i.removeAttribute?i.removeAttribute(u):i[u]=null,v.deletedIds.push(r))}}}}),function(){var e,t;v.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=v.uaMatch(o.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),v.browser=t,v.sub=function(){function e(t,n){return new e.fn.init(t,n)}v.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(r,i){return i&&i instanceof v&&!(i instanceof e)&&(i=e(i)),v.fn.init.call(this,r,i,t)},e.fn.init.prototype=e.fn;var t=e(i);return e}}();var Dt,Pt,Ht,Bt=/alpha\([^)]*\)/i,jt=/opacity=([^)]*)/,Ft=/^(top|right|bottom|left)$/,It=/^(none|table(?!-c[ea]).+)/,qt=/^margin/,Rt=new RegExp("^("+m+")(.*)$","i"),Ut=new RegExp("^("+m+")(?!px)[a-z%]+$","i"),zt=new RegExp("^([-+])=("+m+")","i"),Wt={BODY:"block"},Xt={position:"absolute",visibility:"hidden",display:"block"},Vt={letterSpacing:0,fontWeight:400},$t=["Top","Right","Bottom","Left"],Jt=["Webkit","O","Moz","ms"],Kt=v.fn.toggle;v.fn.extend({css:function(e,n){return v.access(this,function(e,n,r){return r!==t?v.style(e,n,r):v.css(e,n)},e,n,arguments.length>1)},show:function(){return Yt(this,!0)},hide:function(){return Yt(this)},toggle:function(e,t){var n=typeof e=="boolean";return v.isFunction(e)&&v.isFunction(t)?Kt.apply(this,arguments):this.each(function(){(n?e:Gt(this))?v(this).show():v(this).hide()})}}),v.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Dt(e,"opacity");return n===""?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":v.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=v.camelCase(n),f=e.style;n=v.cssProps[a]||(v.cssProps[a]=Qt(f,a)),u=v.cssHooks[n]||v.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=zt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(v.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!v.cssNumber[a]&&(r+="px");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=v.camelCase(n);return n=v.cssProps[a]||(v.cssProps[a]=Qt(e.style,a)),u=v.cssHooks[n]||v.cssHooks[a],u&&"get"in u&&(s=u.get(e,!0,i)),s===t&&(s=Dt(e,n)),s==="normal"&&n in Vt&&(s=Vt[n]),r||i!==t?(o=parseFloat(s),r||v.isNumeric(o)?o||0:s):s},swap:function(e,t,n){var r,i,s={};for(i in t)s[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=s[i];return r}}),e.getComputedStyle?Dt=function(t,n){var r,i,s,o,u=e.getComputedStyle(t,null),a=t.style;return u&&(r=u.getPropertyValue(n)||u[n],r===""&&!v.contains(t.ownerDocument,t)&&(r=v.style(t,n)),Ut.test(r)&&qt.test(n)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=u.width,a.width=i,a.minWidth=s,a.maxWidth=o)),r}:i.documentElement.currentStyle&&(Dt=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],s=e.style;return i==null&&s&&s[t]&&(i=s[t]),Ut.test(i)&&!Ft.test(t)&&(n=s.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":i,i=s.pixelLeft+"px",s.left=n,r&&(e.runtimeStyle.left=r)),i===""?"auto":i}),v.each(["height","width"],function(e,t){v.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&It.test(Dt(e,"display"))?v.swap(e,Xt,function(){return tn(e,t,r)}):tn(e,t,r)},set:function(e,n,r){return Zt(e,n,r?en(e,t,r,v.support.boxSizing&&v.css(e,"boxSizing")==="border-box"):0)}}}),v.support.opacity||(v.cssHooks.opacity={get:function(e,t){return jt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=v.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&v.trim(s.replace(Bt,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=Bt.test(s)?s.replace(Bt,i):s+" "+i}}),v(function(){v.support.reliableMarginRight||(v.cssHooks.marginRight={get:function(e,t){return v.swap(e,{display:"inline-block"},function(){if(t)return Dt(e,"marginRight")})}}),!v.support.pixelPosition&&v.fn.position&&v.each(["top","left"],function(e,t){v.cssHooks[t]={get:function(e,n){if(n){var r=Dt(e,t);return Ut.test(r)?v(e).position()[t]+"px":r}}}})}),v.expr&&v.expr.filters&&(v.expr.filters.hidden=function(e){return e.offsetWidth===0&&e.offsetHeight===0||!v.support.reliableHiddenOffsets&&(e.style&&e.style.display||Dt(e,"display"))==="none"},v.expr.filters.visible=function(e){return!v.expr.filters.hidden(e)}),v.each({margin:"",padding:"",border:"Width"},function(e,t){v.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+$t[r]+t]=i[r]||i[r-2]||i[0];return s}},qt.test(e)||(v.cssHooks[e+t].set=Zt)});var rn=/%20/g,sn=/\[\]$/,on=/\r?\n/g,un=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,an=/^(?:select|textarea)/i;v.fn.extend({serialize:function(){return v.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?v.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||an.test(this.nodeName)||un.test(this.type))}).map(function(e,t){var n=v(this).val();return n==null?null:v.isArray(n)?v.map(n,function(e,n){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),v.param=function(e,n){var r,i=[],s=function(e,t){t=v.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=v.ajaxSettings&&v.ajaxSettings.traditional);if(v.isArray(e)||e.jquery&&!v.isPlainObject(e))v.each(e,function(){s(this.name,this.value)});else for(r in e)fn(r,e[r],n,s);return i.join("&").replace(rn,"+")};var ln,cn,hn=/#.*$/,pn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,dn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,vn=/^(?:GET|HEAD)$/,mn=/^\/\//,gn=/\?/,yn=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bn=/([?&])_=[^&]*/,wn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,En=v.fn.load,Sn={},xn={},Tn=["*/"]+["*"];try{cn=s.href}catch(Nn){cn=i.createElement("a"),cn.href="",cn=cn.href}ln=wn.exec(cn.toLowerCase())||[],v.fn.load=function(e,n,r){if(typeof e!="string"&&En)return En.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),v.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(s="POST"),v.ajax({url:e,type:s,dataType:"html",data:n,complete:function(e,t){r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u.html(i?v("<div>").append(e.replace(yn,"")).find(i):e)}),this},v.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){v.fn[t]=function(e){return this.on(t,e)}}),v.each(["get","post"],function(e,n){v[n]=function(e,r,i,s){return v.isFunction(r)&&(s=s||i,i=r,r=t),v.ajax({type:n,url:e,data:r,success:i,dataType:s})}}),v.extend({getScript:function(e,n){return v.get(e,t,n,"script")},getJSON:function(e,t,n){return v.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?Ln(e,v.ajaxSettings):(t=e,e=v.ajaxSettings),Ln(e,t),e},ajaxSettings:{url:cn,isLocal:dn.test(ln[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Tn},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":v.parseJSON,"text xml":v.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Cn(Sn),ajaxTransport:Cn(xn),ajax:function(e,n){function T(e,n,s,a){var l,y,b,w,S,T=n;if(E===2)return;E=2,u&&clearTimeout(u),o=t,i=a||"",x.readyState=e>0?4:0,s&&(w=An(c,x,s));if(e>=200&&e<300||e===304)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(v.lastModified[r]=S),S=x.getResponseHeader("Etag"),S&&(v.etag[r]=S)),e===304?(T="notmodified",l=!0):(l=On(c,w),T=l.state,y=l.data,b=l.error,l=!b);else{b=T;if(!T||e)T="error",e<0&&(e=0)}x.status=e,x.statusText=(n||T)+"",l?d.resolveWith(h,[y,T,x]):d.rejectWith(h,[x,T,b]),x.statusCode(g),g=t,f&&p.trigger("ajax"+(l?"Success":"Error"),[x,c,l?y:b]),m.fireWith(h,[x,T]),f&&(p.trigger("ajaxComplete",[x,c]),--v.active||v.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=v.ajaxSetup({},n),h=c.context||c,p=h!==c&&(h.nodeType||h instanceof v)?v(h):v.event,d=v.Deferred(),m=v.Callbacks("once memory"),g=c.statusCode||{},b={},w={},E=0,S="canceled",x={readyState:0,setRequestHeader:function(e,t){if(!E){var n=e.toLowerCase();e=w[n]=w[n]||e,b[e]=t}return this},getAllResponseHeaders:function(){return E===2?i:null},getResponseHeader:function(e){var n;if(E===2){if(!s){s={};while(n=pn.exec(i))s[n[1].toLowerCase()]=n[2]}n=s[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return E||(c.mimeType=e),this},abort:function(e){return e=e||S,o&&o.abort(e),T(0,e),this}};d.promise(x),x.success=x.done,x.error=x.fail,x.complete=m.add,x.statusCode=function(e){if(e){var t;if(E<2)for(t in e)g[t]=[g[t],e[t]];else t=e[x.status],x.always(t)}return this},c.url=((e||c.url)+"").replace(hn,"").replace(mn,ln[1]+"//"),c.dataTypes=v.trim(c.dataType||"*").toLowerCase().split(y),c.crossDomain==null&&(a=wn.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===ln[1]&&a[2]===ln[2]&&(a[3]||(a[1]==="http:"?80:443))==(ln[3]||(ln[1]==="http:"?80:443)))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=v.param(c.data,c.traditional)),kn(Sn,c,n,x);if(E===2)return x;f=c.global,c.type=c.type.toUpperCase(),c.hasContent=!vn.test(c.type),f&&v.active++===0&&v.event.trigger("ajaxStart");if(!c.hasContent){c.data&&(c.url+=(gn.test(c.url)?"&":"?")+c.data,delete c.data),r=c.url;if(c.cache===!1){var N=v.now(),C=c.url.replace(bn,"$1_="+N);c.url=C+(C===c.url?(gn.test(c.url)?"&":"?")+"_="+N:"")}}(c.data&&c.hasContent&&c.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",c.contentType),c.ifModified&&(r=r||c.url,v.lastModified[r]&&x.setRequestHeader("If-Modified-Since",v.lastModified[r]),v.etag[r]&&x.setRequestHeader("If-None-Match",v.etag[r])),x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+Tn+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)x.setRequestHeader(l,c.headers[l]);if(!c.beforeSend||c.beforeSend.call(h,x,c)!==!1&&E!==2){S="abort";for(l in{success:1,error:1,complete:1})x[l](c[l]);o=kn(xn,c,n,x);if(!o)T(-1,"No Transport");else{x.readyState=1,f&&p.trigger("ajaxSend",[x,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){x.abort("timeout")},c.timeout));try{E=1,o.send(b,T)}catch(k){if(!(E<2))throw k;T(-1,k)}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var Mn=[],_n=/\?/,Dn=/(=)\?(?=&|$)|\?\?/,Pn=v.now();v.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Mn.pop()||v.expando+"_"+Pn++;return this[e]=!0,e}}),v.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.data,f=n.url,l=n.jsonp!==!1,c=l&&Dn.test(f),h=l&&!c&&typeof a=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Dn.test(a);if(n.dataTypes[0]==="jsonp"||c||h)return s=n.jsonpCallback=v.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,o=e[s],c?n.url=f.replace(Dn,"$1"+s):h?n.data=a.replace(Dn,"$1"+s):l&&(n.url+=(_n.test(f)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||v.error(s+" was not called"),u[0]},n.dataTypes[0]="json",e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,Mn.push(s)),u&&v.isFunction(o)&&o(u[0]),u=o=t}),"script"}),v.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return v.globalEval(e),e}}}),v.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),v.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=i.head||i.getElementsByTagName("head")[0]||i.documentElement;return{send:function(s,o){n=i.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){if(i||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,i||o(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Hn,Bn=e.ActiveXObject?function(){for(var e in Hn)Hn[e](0,1)}:!1,jn=0;v.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&Fn()||In()}:Fn,function(e){v.extend(v.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(v.ajaxSettings.xhr()),v.support.ajax&&v.ajaxTransport(function(n){if(!n.crossDomain||v.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c,h;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=v.noop,Bn&&delete Hn[o]);if(i)a.readyState!==4&&a.abort();else{u=a.status,l=a.getAllResponseHeaders(),c={},h=a.responseXML,h&&h.documentElement&&(c.xml=h);try{c.text=a.responseText}catch(p){}try{f=a.statusText}catch(p){f=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(d){i||s(-1,d)}c&&s(u,f,c,l)},n.async?a.readyState===4?setTimeout(r,0):(o=++jn,Bn&&(Hn||(Hn={},v(e).unload(Bn)),Hn[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var qn,Rn,Un=/^(?:toggle|show|hide)$/,zn=new RegExp("^(?:([-+])=|)("+m+")([a-z%]*)$","i"),Wn=/queueHooks$/,Xn=[Gn],Vn={"*":[function(e,t){var n,r,i=this.createTween(e,t),s=zn.exec(t),o=i.cur(),u=+o||0,a=1,f=20;if(s){n=+s[2],r=s[3]||(v.cssNumber[e]?"":"px");if(r!=="px"&&u){u=v.css(i.elem,e,!0)||n||1;do a=a||".5",u/=a,v.style(i.elem,e,u+r);while(a!==(a=i.cur()/o)&&a!==1&&--f)}i.unit=r,i.start=u,i.end=s[1]?u+(s[1]+1)*n:n}return i}]};v.Animation=v.extend(Kn,{tweener:function(e,t){v.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r<i;r++)n=e[r],Vn[n]=Vn[n]||[],Vn[n].unshift(t)},prefilter:function(e,t){t?Xn.unshift(e):Xn.push(e)}}),v.Tween=Yn,Yn.prototype={constructor:Yn,init:function(e,t,n,r,i,s){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=s||(v.cssNumber[n]?"":"px")},cur:function(){var e=Yn.propHooks[this.prop];return e&&e.get?e.get(this):Yn.propHooks._default.get(this)},run:function(e){var t,n=Yn.propHooks[this.prop];return this.options.duration?this.pos=t=v.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Yn.propHooks._default.set(this),this}},Yn.prototype.init.prototype=Yn.prototype,Yn.propHooks={_default:{get:function(e){var t;return e.elem[e.prop]==null||!!e.elem.style&&e.elem.style[e.prop]!=null?(t=v.css(e.elem,e.prop,!1,""),!t||t==="auto"?0:t):e.elem[e.prop]},set:function(e){v.fx.step[e.prop]?v.fx.step[e.prop](e):e.elem.style&&(e.elem.style[v.cssProps[e.prop]]!=null||v.cssHooks[e.prop])?v.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},Yn.propHooks.scrollTop=Yn.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},v.each(["toggle","show","hide"],function(e,t){var n=v.fn[t];v.fn[t]=function(r,i,s){return r==null||typeof r=="boolean"||!e&&v.isFunction(r)&&v.isFunction(i)?n.apply(this,arguments):this.animate(Zn(t,!0),r,i,s)}}),v.fn.extend({fadeTo:function(e,t,n,r){return this.filter(Gt).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=v.isEmptyObject(e),s=v.speed(t,n,r),o=function(){var t=Kn(this,v.extend({},e),s);i&&t.stop(!0)};return i||s.queue===!1?this.each(o):this.queue(s.queue,o)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return typeof e!="string"&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=e!=null&&e+"queueHooks",s=v.timers,o=v._data(this);if(n)o[n]&&o[n].stop&&i(o[n]);else for(n in o)o[n]&&o[n].stop&&Wn.test(n)&&i(o[n]);for(n=s.length;n--;)s[n].elem===this&&(e==null||s[n].queue===e)&&(s[n].anim.stop(r),t=!1,s.splice(n,1));(t||!r)&&v.dequeue(this,e)})}}),v.each({slideDown:Zn("show"),slideUp:Zn("hide"),slideToggle:Zn("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){v.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),v.speed=function(e,t,n){var r=e&&typeof e=="object"?v.extend({},e):{complete:n||!n&&t||v.isFunction(e)&&e,duration:e,easing:n&&t||t&&!v.isFunction(t)&&t};r.duration=v.fx.off?0:typeof r.duration=="number"?r.duration:r.duration in v.fx.speeds?v.fx.speeds[r.duration]:v.fx.speeds._default;if(r.queue==null||r.queue===!0)r.queue="fx";return r.old=r.complete,r.complete=function(){v.isFunction(r.old)&&r.old.call(this),r.queue&&v.dequeue(this,r.queue)},r},v.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},v.timers=[],v.fx=Yn.prototype.init,v.fx.tick=function(){var e,n=v.timers,r=0;qn=v.now();for(;r<n.length;r++)e=n[r],!e()&&n[r]===e&&n.splice(r--,1);n.length||v.fx.stop(),qn=t},v.fx.timer=function(e){e()&&v.timers.push(e)&&!Rn&&(Rn=setInterval(v.fx.tick,v.fx.interval))},v.fx.interval=13,v.fx.stop=function(){clearInterval(Rn),Rn=null},v.fx.speeds={slow:600,fast:200,_default:400},v.fx.step={},v.expr&&v.expr.filters&&(v.expr.filters.animated=function(e){return v.grep(v.timers,function(t){return e===t.elem}).length});var er=/^(?:body|html)$/i;v.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){v.offset.setOffset(this,e,t)});var n,r,i,s,o,u,a,f={top:0,left:0},l=this[0],c=l&&l.ownerDocument;if(!c)return;return(r=c.body)===l?v.offset.bodyOffset(l):(n=c.documentElement,v.contains(n,l)?(typeof l.getBoundingClientRect!="undefined"&&(f=l.getBoundingClientRect()),i=tr(c),s=n.clientTop||r.clientTop||0,o=n.clientLeft||r.clientLeft||0,u=i.pageYOffset||n.scrollTop,a=i.pageXOffset||n.scrollLeft,{top:f.top+u-s,left:f.left+a-o}):f)},v.offset={bodyOffset:function(e){var t=e.offsetTop,n=e.offsetLeft;return v.support.doesNotIncludeMarginInBodyOffset&&(t+=parseFloat(v.css(e,"marginTop"))||0,n+=parseFloat(v.css(e,"marginLeft"))||0),{top:t,left:n}},setOffset:function(e,t,n){var r=v.css(e,"position");r==="static"&&(e.style.position="relative");var i=v(e),s=i.offset(),o=v.css(e,"top"),u=v.css(e,"left"),a=(r==="absolute"||r==="fixed")&&v.inArray("auto",[o,u])>-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),v.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},v.fn.extend({position:function(){if(!this[0])return;var e=this[0],t=this.offsetParent(),n=this.offset(),r=er.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(v.css(e,"marginTop"))||0,n.left-=parseFloat(v.css(e,"marginLeft"))||0,r.top+=parseFloat(v.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(v.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||i.body;while(e&&!er.test(e.nodeName)&&v.css(e,"position")==="static")e=e.offsetParent;return e||i.body})}}),v.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);v.fn[e]=function(i){return v.access(this,function(e,i,s){var o=tr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?v(o).scrollLeft():s,r?s:v(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),v.each({Height:"height",Width:"width"},function(e,n){v.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){v.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return v.access(this,function(n,r,i){var s;return v.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?v.css(n,r,i,u):v.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jQuery=e.$=v,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return v})})(window); !function(){function a(a){return a.replace(t,"").replace(u,",").replace(v,"").replace(w,"").replace(x,"").split(y)}function b(a){return"'"+a.replace(/('|\\)/g,"\\$1").replace(/\r/g,"\\r").replace(/\n/g,"\\n")+"'"}function c(c,d){function e(a){return m+=a.split(/\n/).length-1,k&&(a=a.replace(/\s+/g," ").replace(/<!--[\w\W]*?-->/g,"")),a&&(a=s[1]+b(a)+s[2]+"\n"),a}function f(b){var c=m;if(j?b=j(b,d):g&&(b=b.replace(/\n/g,function(){return m++,"$line="+m+";"})),0===b.indexOf("=")){var e=l&&!/^=[=#]/.test(b);if(b=b.replace(/^=[=#]?|[\s;]*$/g,""),e){var f=b.replace(/\s*\([^\)]+\)/,"");n[f]||/^(include|print)$/.test(f)||(b="$escape("+b+")")}else b="$string("+b+")";b=s[1]+b+s[2]}return g&&(b="$line="+c+";"+b),r(a(b),function(a){if(a&&!p[a]){var b;b="print"===a?u:"include"===a?v:n[a]?"$utils."+a:o[a]?"$helpers."+a:"$data."+a,w+=a+"="+b+",",p[a]=!0}}),b+"\n"}var g=d.debug,h=d.openTag,i=d.closeTag,j=d.parser,k=d.compress,l=d.escape,m=1,p={$data:1,$filename:1,$utils:1,$helpers:1,$out:1,$line:1},q="".trim,s=q?["$out='';","$out+=",";","$out"]:["$out=[];","$out.push(",");","$out.join('')"],t=q?"$out+=text;return $out;":"$out.push(text);",u="function(){var text=''.concat.apply('',arguments);"+t+"}",v="function(filename,data){data=data||$data;var text=$utils.$include(filename,data,$filename);"+t+"}",w="'use strict';var $utils=this,$helpers=$utils.$helpers,"+(g?"$line=0,":""),x=s[0],y="return new String("+s[3]+");";r(c.split(h),function(a){a=a.split(i);var b=a[0],c=a[1];1===a.length?x+=e(b):(x+=f(b),c&&(x+=e(c)))});var z=w+x+y;g&&(z="try{"+z+"}catch(e){throw {filename:$filename,name:'Render Error',message:e.message,line:$line,source:"+b(c)+".split(/\\n/)[$line-1].replace(/^\\s+/,'')};}");try{var A=new Function("$data","$filename",z);return A.prototype=n,A}catch(B){throw B.temp="function anonymous($data,$filename) {"+z+"}",B}}var d=function(a,b){return"string"==typeof b?q(b,{filename:a}):g(a,b)};d.version="3.0.0",d.config=function(a,b){e[a]=b};var e=d.defaults={openTag:"<%",closeTag:"%>",escape:!0,cache:!0,compress:!1,parser:null},f=d.cache={};d.render=function(a,b){return q(a,b)};var g=d.renderFile=function(a,b){var c=d.get(a)||p({filename:a,name:"Render Error",message:"Template not found"});return b?c(b):c};d.get=function(a){var b;if(f[a])b=f[a];else if("object"==typeof document){var c=document.getElementById(a);if(c){var d=(c.value||c.innerHTML).replace(/^\s*|\s*$/g,"");b=q(d,{filename:a})}}return b};var h=function(a,b){return"string"!=typeof a&&(b=typeof a,"number"===b?a+="":a="function"===b?h(a.call(a)):""),a},i={"<":"&#60;",">":"&#62;",'"':"&#34;","'":"&#39;","&":"&#38;"},j=function(a){return i[a]},k=function(a){return h(a).replace(/&(?![\w#]+;)|[<>"']/g,j)},l=Array.isArray||function(a){return"[object Array]"==={}.toString.call(a)},m=function(a,b){var c,d;if(l(a))for(c=0,d=a.length;d>c;c++)b.call(a,a[c],c,a);else for(c in a)b.call(a,a[c],c)},n=d.utils={$helpers:{},$include:g,$string:h,$escape:k,$each:m};d.helper=function(a,b){o[a]=b};var o=d.helpers=n.$helpers;d.onerror=function(a){var b="Template Error\n\n";for(var c in a)b+="<"+c+">\n"+a[c]+"\n\n";"object"==typeof console&&console.error(b)};var p=function(a){return d.onerror(a),function(){return"{Template Error}"}},q=d.compile=function(a,b){function d(c){try{return new i(c,h)+""}catch(d){return b.debug?p(d)():(b.debug=!0,q(a,b)(c))}}b=b||{};for(var g in e)void 0===b[g]&&(b[g]=e[g]);var h=b.filename;try{var i=c(a,b)}catch(j){return j.filename=h||"anonymous",j.name="Syntax Error",p(j)}return d.prototype=i.prototype,d.toString=function(){return i.toString()},h&&b.cache&&(f[h]=d),d},r=n.$each,s="break,case,catch,continue,debugger,default,delete,do,else,false,finally,for,function,if,in,instanceof,new,null,return,switch,this,throw,true,try,typeof,var,void,while,with,abstract,boolean,byte,char,class,const,double,enum,export,extends,final,float,goto,implements,import,int,interface,long,native,package,private,protected,public,short,static,super,synchronized,throws,transient,volatile,arguments,let,yield,undefined",t=/\/\*[\w\W]*?\*\/|\/\/[^\n]*\n|\/\/[^\n]*$|"(?:[^"\\]|\\[\w\W])*"|'(?:[^'\\]|\\[\w\W])*'|\s*\.\s*[$\w\.]+/g,u=/[^\w$]+/g,v=new RegExp(["\\b"+s.replace(/,/g,"\\b|\\b")+"\\b"].join("|"),"g"),w=/^\d[^,]*|,\d[^,]*/g,x=/^,+|,+$/g,y=/^$|,+/;"function"==typeof define?define(function(){return d}):"undefined"!=typeof exports?module.exports=d:this.template=d}(); !function(){"use strict";function e(e){e.fn.swiper=function(a){var s;return e(this).each(function(){var e=new t(this,a);s||(s=e)}),s}}var a,t=function(e,s){function r(){return"horizontal"===v.params.direction}function i(e){return Math.floor(e)}function n(){v.autoplayTimeoutId=setTimeout(function(){v.params.loop?(v.fixLoop(),v._slideNext()):v.isEnd?s.autoplayStopOnLast?v.stopAutoplay():v._slideTo(0):v._slideNext()},v.params.autoplay)}function o(e,t){var s=a(e.target);if(!s.is(t))if("string"==typeof t)s=s.parents(t);else if(t.nodeType){var r;return s.parents().each(function(e,a){a===t&&(r=t)}),r?t:void 0}return 0===s.length?void 0:s[0]}function l(e,a){a=a||{};var t=window.MutationObserver||window.WebkitMutationObserver,s=new t(function(e){e.forEach(function(e){v.onResize(!0),v.emit("onObserverUpdate",v,e)})});s.observe(e,{attributes:"undefined"==typeof a.attributes?!0:a.attributes,childList:"undefined"==typeof a.childList?!0:a.childList,characterData:"undefined"==typeof a.characterData?!0:a.characterData}),v.observers.push(s)}function p(e){e.originalEvent&&(e=e.originalEvent);var a=e.keyCode||e.charCode;if(!v.params.allowSwipeToNext&&(r()&&39===a||!r()&&40===a))return!1;if(!v.params.allowSwipeToPrev&&(r()&&37===a||!r()&&38===a))return!1;if(!(e.shiftKey||e.altKey||e.ctrlKey||e.metaKey||document.activeElement&&document.activeElement.nodeName&&("input"===document.activeElement.nodeName.toLowerCase()||"textarea"===document.activeElement.nodeName.toLowerCase()))){if(37===a||39===a||38===a||40===a){var t=!1;if(v.container.parents(".swiper-slide").length>0&&0===v.container.parents(".swiper-slide-active").length)return;var s={left:window.pageXOffset,top:window.pageYOffset},i=window.innerWidth,n=window.innerHeight,o=v.container.offset();v.rtl&&(o.left=o.left-v.container[0].scrollLeft);for(var l=[[o.left,o.top],[o.left+v.width,o.top],[o.left,o.top+v.height],[o.left+v.width,o.top+v.height]],p=0;p<l.length;p++){var d=l[p];d[0]>=s.left&&d[0]<=s.left+i&&d[1]>=s.top&&d[1]<=s.top+n&&(t=!0)}if(!t)return}r()?((37===a||39===a)&&(e.preventDefault?e.preventDefault():e.returnValue=!1),(39===a&&!v.rtl||37===a&&v.rtl)&&v.slideNext(),(37===a&&!v.rtl||39===a&&v.rtl)&&v.slidePrev()):((38===a||40===a)&&(e.preventDefault?e.preventDefault():e.returnValue=!1),40===a&&v.slideNext(),38===a&&v.slidePrev())}}function d(e){e.originalEvent&&(e=e.originalEvent);var a=v.mousewheel.event,t=0;if(e.detail)t=-e.detail;else if("mousewheel"===a)if(v.params.mousewheelForceToAxis)if(r()){if(!(Math.abs(e.wheelDeltaX)>Math.abs(e.wheelDeltaY)))return;t=e.wheelDeltaX}else{if(!(Math.abs(e.wheelDeltaY)>Math.abs(e.wheelDeltaX)))return;t=e.wheelDeltaY}else t=e.wheelDelta;else if("DOMMouseScroll"===a)t=-e.detail;else if("wheel"===a)if(v.params.mousewheelForceToAxis)if(r()){if(!(Math.abs(e.deltaX)>Math.abs(e.deltaY)))return;t=-e.deltaX}else{if(!(Math.abs(e.deltaY)>Math.abs(e.deltaX)))return;t=-e.deltaY}else t=Math.abs(e.deltaX)>Math.abs(e.deltaY)?-e.deltaX:-e.deltaY;if(v.params.mousewheelInvert&&(t=-t),v.params.freeMode){var s=v.getWrapperTranslate()+t*v.params.mousewheelSensitivity;if(s>0&&(s=0),s<v.maxTranslate()&&(s=v.maxTranslate()),v.setWrapperTransition(0),v.setWrapperTranslate(s),v.updateProgress(),v.updateActiveIndex(),v.params.freeModeSticky&&(clearTimeout(v.mousewheel.timeout),v.mousewheel.timeout=setTimeout(function(){v.slideReset()},300)),0===s||s===v.maxTranslate())return}else{if((new window.Date).getTime()-v.mousewheel.lastScrollTime>60)if(0>t)if(v.isEnd&&!v.params.loop||v.animating){if(v.params.mousewheelReleaseOnEdges)return!0}else v.slideNext();else if(v.isBeginning&&!v.params.loop||v.animating){if(v.params.mousewheelReleaseOnEdges)return!0}else v.slidePrev();v.mousewheel.lastScrollTime=(new window.Date).getTime()}return v.params.autoplay&&v.stopAutoplay(),e.preventDefault?e.preventDefault():e.returnValue=!1,!1}function u(e,t){e=a(e);var s,i,n;s=e.attr("data-swiper-parallax")||"0",i=e.attr("data-swiper-parallax-x"),n=e.attr("data-swiper-parallax-y"),i||n?(i=i||"0",n=n||"0"):r()?(i=s,n="0"):(n=s,i="0"),i=i.indexOf("%")>=0?parseInt(i,10)*t+"%":i*t+"px",n=n.indexOf("%")>=0?parseInt(n,10)*t+"%":n*t+"px",e.transform("translate3d("+i+", "+n+",0px)")}function c(e){return 0!==e.indexOf("on")&&(e=e[0]!==e[0].toUpperCase()?"on"+e[0].toUpperCase()+e.substring(1):"on"+e),e}if(!(this instanceof t))return new t(e,s);var m={direction:"horizontal",touchEventsTarget:"container",initialSlide:0,speed:300,autoplay:!1,autoplayDisableOnInteraction:!0,iOSEdgeSwipeDetection:!1,iOSEdgeSwipeThreshold:20,freeMode:!1,freeModeMomentum:!0,freeModeMomentumRatio:1,freeModeMomentumBounce:!0,freeModeMomentumBounceRatio:1,freeModeSticky:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",coverflow:{rotate:50,stretch:0,depth:100,modifier:1,slideShadows:!0},cube:{slideShadows:!0,shadow:!0,shadowOffset:20,shadowScale:.94},fade:{crossFade:!1},parallax:!1,scrollbar:null,scrollbarHide:!0,keyboardControl:!1,mousewheelControl:!1,mousewheelReleaseOnEdges:!1,mousewheelInvert:!1,mousewheelForceToAxis:!1,mousewheelSensitivity:1,hashnav:!1,spaceBetween:0,slidesPerView:1,slidesPerColumn:1,slidesPerColumnFill:"column",slidesPerGroup:1,centeredSlides:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,onlyExternal:!1,threshold:0,touchMoveStopPropagation:!0,pagination:null,paginationElement:"span",paginationClickable:!1,paginationHide:!1,paginationBulletRender:null,resistance:!0,resistanceRatio:.85,nextButton:null,prevButton:null,watchSlidesProgress:!1,watchSlidesVisibility:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,lazyLoading:!1,lazyLoadingInPrevNext:!1,lazyLoadingOnTransitionStart:!1,preloadImages:!0,updateOnImagesReady:!0,loop:!1,loopAdditionalSlides:0,loopedSlides:null,control:void 0,controlInverse:!1,controlBy:"slide",allowSwipeToPrev:!0,allowSwipeToNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",slideClass:"swiper-slide",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",slideDuplicateClass:"swiper-slide-duplicate",slideNextClass:"swiper-slide-next",slidePrevClass:"swiper-slide-prev",wrapperClass:"swiper-wrapper",bulletClass:"swiper-pagination-bullet",bulletActiveClass:"swiper-pagination-bullet-active",buttonDisabledClass:"swiper-button-disabled",paginationHiddenClass:"swiper-pagination-hidden",observer:!1,observeParents:!1,a11y:!1,prevSlideMessage:"Previous slide",nextSlideMessage:"Next slide",firstSlideMessage:"This is the first slide",lastSlideMessage:"This is the last slide",paginationBulletMessage:"Go to slide {{index}}",runCallbacksOnInit:!0},f=s&&s.virtualTranslate;s=s||{};for(var h in m)if("undefined"==typeof s[h])s[h]=m[h];else if("object"==typeof s[h])for(var g in m[h])"undefined"==typeof s[h][g]&&(s[h][g]=m[h][g]);var v=this;if(v.version="3.1.0",v.params=s,v.classNames=[],"undefined"!=typeof a&&"undefined"!=typeof Dom7&&(a=Dom7),("undefined"!=typeof a||(a="undefined"==typeof Dom7?window.Dom7||window.Zepto||window.jQuery:Dom7))&&(v.$=a,v.container=a(e),0!==v.container.length)){if(v.container.length>1)return void v.container.each(function(){new t(this,s)});v.container[0].swiper=v,v.container.data("swiper",v),v.classNames.push("swiper-container-"+v.params.direction),v.params.freeMode&&v.classNames.push("swiper-container-free-mode"),v.support.flexbox||(v.classNames.push("swiper-container-no-flexbox"),v.params.slidesPerColumn=1),(v.params.parallax||v.params.watchSlidesVisibility)&&(v.params.watchSlidesProgress=!0),["cube","coverflow"].indexOf(v.params.effect)>=0&&(v.support.transforms3d?(v.params.watchSlidesProgress=!0,v.classNames.push("swiper-container-3d")):v.params.effect="slide"),"slide"!==v.params.effect&&v.classNames.push("swiper-container-"+v.params.effect),"cube"===v.params.effect&&(v.params.resistanceRatio=0,v.params.slidesPerView=1,v.params.slidesPerColumn=1,v.params.slidesPerGroup=1,v.params.centeredSlides=!1,v.params.spaceBetween=0,v.params.virtualTranslate=!0,v.params.setWrapperSize=!1),"fade"===v.params.effect&&(v.params.slidesPerView=1,v.params.slidesPerColumn=1,v.params.slidesPerGroup=1,v.params.watchSlidesProgress=!0,v.params.spaceBetween=0,"undefined"==typeof f&&(v.params.virtualTranslate=!0)),v.params.grabCursor&&v.support.touch&&(v.params.grabCursor=!1),v.wrapper=v.container.children("."+v.params.wrapperClass),v.params.pagination&&(v.paginationContainer=a(v.params.pagination),v.params.paginationClickable&&v.paginationContainer.addClass("swiper-pagination-clickable")),v.rtl=r()&&("rtl"===v.container[0].dir.toLowerCase()||"rtl"===v.container.css("direction")),v.rtl&&v.classNames.push("swiper-container-rtl"),v.rtl&&(v.wrongRTL="-webkit-box"===v.wrapper.css("display")),v.params.slidesPerColumn>1&&v.classNames.push("swiper-container-multirow"),v.device.android&&v.classNames.push("swiper-container-android"),v.container.addClass(v.classNames.join(" ")),v.translate=0,v.progress=0,v.velocity=0,v.lockSwipeToNext=function(){v.params.allowSwipeToNext=!1},v.lockSwipeToPrev=function(){v.params.allowSwipeToPrev=!1},v.lockSwipes=function(){v.params.allowSwipeToNext=v.params.allowSwipeToPrev=!1},v.unlockSwipeToNext=function(){v.params.allowSwipeToNext=!0},v.unlockSwipeToPrev=function(){v.params.allowSwipeToPrev=!0},v.unlockSwipes=function(){v.params.allowSwipeToNext=v.params.allowSwipeToPrev=!0},v.params.grabCursor&&(v.container[0].style.cursor="move",v.container[0].style.cursor="-webkit-grab",v.container[0].style.cursor="-moz-grab",v.container[0].style.cursor="grab"),v.imagesToLoad=[],v.imagesLoaded=0,v.loadImage=function(e,a,t,s){function r(){s&&s()}var i;e.complete&&t?r():a?(i=new window.Image,i.onload=r,i.onerror=r,i.src=a):r()},v.preloadImages=function(){function e(){"undefined"!=typeof v&&null!==v&&(void 0!==v.imagesLoaded&&v.imagesLoaded++,v.imagesLoaded===v.imagesToLoad.length&&(v.params.updateOnImagesReady&&v.update(),v.emit("onImagesReady",v)))}v.imagesToLoad=v.container.find("img");for(var a=0;a<v.imagesToLoad.length;a++)v.loadImage(v.imagesToLoad[a],v.imagesToLoad[a].currentSrc||v.imagesToLoad[a].getAttribute("src"),!0,e)},v.autoplayTimeoutId=void 0,v.autoplaying=!1,v.autoplayPaused=!1,v.startAutoplay=function(){return"undefined"!=typeof v.autoplayTimeoutId?!1:v.params.autoplay?v.autoplaying?!1:(v.autoplaying=!0,v.emit("onAutoplayStart",v),void n()):!1},v.stopAutoplay=function(e){v.autoplayTimeoutId&&(v.autoplayTimeoutId&&clearTimeout(v.autoplayTimeoutId),v.autoplaying=!1,v.autoplayTimeoutId=void 0,v.emit("onAutoplayStop",v))},v.pauseAutoplay=function(e){v.autoplayPaused||(v.autoplayTimeoutId&&clearTimeout(v.autoplayTimeoutId),v.autoplayPaused=!0,0===e?(v.autoplayPaused=!1,n()):v.wrapper.transitionEnd(function(){v&&(v.autoplayPaused=!1,v.autoplaying?n():v.stopAutoplay())}))},v.minTranslate=function(){return-v.snapGrid[0]},v.maxTranslate=function(){return-v.snapGrid[v.snapGrid.length-1]},v.updateContainerSize=function(){var e,a;e="undefined"!=typeof v.params.width?v.params.width:v.container[0].clientWidth,a="undefined"!=typeof v.params.height?v.params.height:v.container[0].clientHeight,0===e&&r()||0===a&&!r()||(e=e-parseInt(v.container.css("padding-left"),10)-parseInt(v.container.css("padding-right"),10),a=a-parseInt(v.container.css("padding-top"),10)-parseInt(v.container.css("padding-bottom"),10),v.width=e,v.height=a,v.size=r()?v.width:v.height)},v.updateSlidesSize=function(){v.slides=v.wrapper.children("."+v.params.slideClass),v.snapGrid=[],v.slidesGrid=[],v.slidesSizesGrid=[];var e,a=v.params.spaceBetween,t=-v.params.slidesOffsetBefore,s=0,n=0;"string"==typeof a&&a.indexOf("%")>=0&&(a=parseFloat(a.replace("%",""))/100*v.size),v.virtualSize=-a,v.slides.css(v.rtl?{marginLeft:"",marginTop:""}:{marginRight:"",marginBottom:""});var o;v.params.slidesPerColumn>1&&(o=Math.floor(v.slides.length/v.params.slidesPerColumn)===v.slides.length/v.params.slidesPerColumn?v.slides.length:Math.ceil(v.slides.length/v.params.slidesPerColumn)*v.params.slidesPerColumn);var l,p=v.params.slidesPerColumn,d=o/p,u=d-(v.params.slidesPerColumn*d-v.slides.length);for(e=0;e<v.slides.length;e++){l=0;var c=v.slides.eq(e);if(v.params.slidesPerColumn>1){var m,f,h;"column"===v.params.slidesPerColumnFill?(f=Math.floor(e/p),h=e-f*p,(f>u||f===u&&h===p-1)&&++h>=p&&(h=0,f++),m=f+h*o/p,c.css({"-webkit-box-ordinal-group":m,"-moz-box-ordinal-group":m,"-ms-flex-order":m,"-webkit-order":m,order:m})):(h=Math.floor(e/d),f=e-h*d),c.css({"margin-top":0!==h&&v.params.spaceBetween&&v.params.spaceBetween+"px"}).attr("data-swiper-column",f).attr("data-swiper-row",h)}"none"!==c.css("display")&&("auto"===v.params.slidesPerView?(l=r()?c.outerWidth(!0):c.outerHeight(!0),v.params.roundLengths&&(l=i(l))):(l=(v.size-(v.params.slidesPerView-1)*a)/v.params.slidesPerView,v.params.roundLengths&&(l=i(l)),r()?v.slides[e].style.width=l+"px":v.slides[e].style.height=l+"px"),v.slides[e].swiperSlideSize=l,v.slidesSizesGrid.push(l),v.params.centeredSlides?(t=t+l/2+s/2+a,0===e&&(t=t-v.size/2-a),Math.abs(t)<.001&&(t=0),n%v.params.slidesPerGroup===0&&v.snapGrid.push(t),v.slidesGrid.push(t)):(n%v.params.slidesPerGroup===0&&v.snapGrid.push(t),v.slidesGrid.push(t),t=t+l+a),v.virtualSize+=l+a,s=l,n++)}v.virtualSize=Math.max(v.virtualSize,v.size)+v.params.slidesOffsetAfter;var g;if(v.rtl&&v.wrongRTL&&("slide"===v.params.effect||"coverflow"===v.params.effect)&&v.wrapper.css({width:v.virtualSize+v.params.spaceBetween+"px"}),(!v.support.flexbox||v.params.setWrapperSize)&&v.wrapper.css(r()?{width:v.virtualSize+v.params.spaceBetween+"px"}:{height:v.virtualSize+v.params.spaceBetween+"px"}),v.params.slidesPerColumn>1&&(v.virtualSize=(l+v.params.spaceBetween)*o,v.virtualSize=Math.ceil(v.virtualSize/v.params.slidesPerColumn)-v.params.spaceBetween,v.wrapper.css({width:v.virtualSize+v.params.spaceBetween+"px"}),v.params.centeredSlides)){for(g=[],e=0;e<v.snapGrid.length;e++)v.snapGrid[e]<v.virtualSize+v.snapGrid[0]&&g.push(v.snapGrid[e]);v.snapGrid=g}if(!v.params.centeredSlides){for(g=[],e=0;e<v.snapGrid.length;e++)v.snapGrid[e]<=v.virtualSize-v.size&&g.push(v.snapGrid[e]);v.snapGrid=g,Math.floor(v.virtualSize-v.size)>Math.floor(v.snapGrid[v.snapGrid.length-1])&&v.snapGrid.push(v.virtualSize-v.size)}0===v.snapGrid.length&&(v.snapGrid=[0]),0!==v.params.spaceBetween&&v.slides.css(r()?v.rtl?{marginLeft:a+"px"}:{marginRight:a+"px"}:{marginBottom:a+"px"}),v.params.watchSlidesProgress&&v.updateSlidesOffset()},v.updateSlidesOffset=function(){for(var e=0;e<v.slides.length;e++)v.slides[e].swiperSlideOffset=r()?v.slides[e].offsetLeft:v.slides[e].offsetTop},v.updateSlidesProgress=function(e){if("undefined"==typeof e&&(e=v.translate||0),0!==v.slides.length){"undefined"==typeof v.slides[0].swiperSlideOffset&&v.updateSlidesOffset();var a=-e;v.rtl&&(a=e);{v.container[0].getBoundingClientRect(),r()?"left":"top",r()?"right":"bottom"}v.slides.removeClass(v.params.slideVisibleClass);for(var t=0;t<v.slides.length;t++){var s=v.slides[t],i=(a-s.swiperSlideOffset)/(s.swiperSlideSize+v.params.spaceBetween);if(v.params.watchSlidesVisibility){var n=-(a-s.swiperSlideOffset),o=n+v.slidesSizesGrid[t],l=n>=0&&n<v.size||o>0&&o<=v.size||0>=n&&o>=v.size;l&&v.slides.eq(t).addClass(v.params.slideVisibleClass)}s.progress=v.rtl?-i:i}}},v.updateProgress=function(e){"undefined"==typeof e&&(e=v.translate||0);var a=v.maxTranslate()-v.minTranslate();0===a?(v.progress=0,v.isBeginning=v.isEnd=!0):(v.progress=(e-v.minTranslate())/a,v.isBeginning=v.progress<=0,v.isEnd=v.progress>=1),v.isBeginning&&v.emit("onReachBeginning",v),v.isEnd&&v.emit("onReachEnd",v),v.params.watchSlidesProgress&&v.updateSlidesProgress(e),v.emit("onProgress",v,v.progress)},v.updateActiveIndex=function(){var e,a,t,s=v.rtl?v.translate:-v.translate;for(a=0;a<v.slidesGrid.length;a++)"undefined"!=typeof v.slidesGrid[a+1]?s>=v.slidesGrid[a]&&s<v.slidesGrid[a+1]-(v.slidesGrid[a+1]-v.slidesGrid[a])/2?e=a:s>=v.slidesGrid[a]&&s<v.slidesGrid[a+1]&&(e=a+1):s>=v.slidesGrid[a]&&(e=a);(0>e||"undefined"==typeof e)&&(e=0),t=Math.floor(e/v.params.slidesPerGroup),t>=v.snapGrid.length&&(t=v.snapGrid.length-1),e!==v.activeIndex&&(v.snapIndex=t,v.previousIndex=v.activeIndex,v.activeIndex=e,v.updateClasses())},v.updateClasses=function(){v.slides.removeClass(v.params.slideActiveClass+" "+v.params.slideNextClass+" "+v.params.slidePrevClass);var e=v.slides.eq(v.activeIndex);if(e.addClass(v.params.slideActiveClass),e.next("."+v.params.slideClass).addClass(v.params.slideNextClass),e.prev("."+v.params.slideClass).addClass(v.params.slidePrevClass),v.bullets&&v.bullets.length>0){v.bullets.removeClass(v.params.bulletActiveClass);var t;v.params.loop?(t=Math.ceil(v.activeIndex-v.loopedSlides)/v.params.slidesPerGroup,t>v.slides.length-1-2*v.loopedSlides&&(t-=v.slides.length-2*v.loopedSlides),t>v.bullets.length-1&&(t-=v.bullets.length)):t="undefined"!=typeof v.snapIndex?v.snapIndex:v.activeIndex||0,v.paginationContainer.length>1?v.bullets.each(function(){a(this).index()===t&&a(this).addClass(v.params.bulletActiveClass)}):v.bullets.eq(t).addClass(v.params.bulletActiveClass)}v.params.loop||(v.params.prevButton&&(v.isBeginning?(a(v.params.prevButton).addClass(v.params.buttonDisabledClass),v.params.a11y&&v.a11y&&v.a11y.disable(a(v.params.prevButton))):(a(v.params.prevButton).removeClass(v.params.buttonDisabledClass),v.params.a11y&&v.a11y&&v.a11y.enable(a(v.params.prevButton)))),v.params.nextButton&&(v.isEnd?(a(v.params.nextButton).addClass(v.params.buttonDisabledClass),v.params.a11y&&v.a11y&&v.a11y.disable(a(v.params.nextButton))):(a(v.params.nextButton).removeClass(v.params.buttonDisabledClass),v.params.a11y&&v.a11y&&v.a11y.enable(a(v.params.nextButton)))))},v.updatePagination=function(){if(v.params.pagination&&v.paginationContainer&&v.paginationContainer.length>0){for(var e="",a=v.params.loop?Math.ceil((v.slides.length-2*v.loopedSlides)/v.params.slidesPerGroup):v.snapGrid.length,t=0;a>t;t++)e+=v.params.paginationBulletRender?v.params.paginationBulletRender(t,v.params.bulletClass):"<"+v.params.paginationElement+' class="'+v.params.bulletClass+'"></'+v.params.paginationElement+">";v.paginationContainer.html(e),v.bullets=v.paginationContainer.find("."+v.params.bulletClass),v.params.paginationClickable&&v.params.a11y&&v.a11y&&v.a11y.initPagination()}},v.update=function(e){function a(){s=Math.min(Math.max(v.translate,v.maxTranslate()),v.minTranslate()),v.setWrapperTranslate(s),v.updateActiveIndex(),v.updateClasses()}if(v.updateContainerSize(),v.updateSlidesSize(),v.updateProgress(),v.updatePagination(),v.updateClasses(),v.params.scrollbar&&v.scrollbar&&v.scrollbar.set(),e){var t,s;v.controller&&v.controller.spline&&(v.controller.spline=void 0),v.params.freeMode?a():(t=("auto"===v.params.slidesPerView||v.params.slidesPerView>1)&&v.isEnd&&!v.params.centeredSlides?v.slideTo(v.slides.length-1,0,!1,!0):v.slideTo(v.activeIndex,0,!1,!0),t||a())}},v.onResize=function(e){var a=v.params.allowSwipeToPrev,t=v.params.allowSwipeToNext;if(v.params.allowSwipeToPrev=v.params.allowSwipeToNext=!0,v.updateContainerSize(),v.updateSlidesSize(),("auto"===v.params.slidesPerView||v.params.freeMode||e)&&v.updatePagination(),v.params.scrollbar&&v.scrollbar&&v.scrollbar.set(),v.controller&&v.controller.spline&&(v.controller.spline=void 0),v.params.freeMode){var s=Math.min(Math.max(v.translate,v.maxTranslate()),v.minTranslate());v.setWrapperTranslate(s),v.updateActiveIndex(),v.updateClasses()}else v.updateClasses(),("auto"===v.params.slidesPerView||v.params.slidesPerView>1)&&v.isEnd&&!v.params.centeredSlides?v.slideTo(v.slides.length-1,0,!1,!0):v.slideTo(v.activeIndex,0,!1,!0);v.params.allowSwipeToPrev=a,v.params.allowSwipeToNext=t};var w=["mousedown","mousemove","mouseup"];window.navigator.pointerEnabled?w=["pointerdown","pointermove","pointerup"]:window.navigator.msPointerEnabled&&(w=["MSPointerDown","MSPointerMove","MSPointerUp"]),v.touchEvents={start:v.support.touch||!v.params.simulateTouch?"touchstart":w[0],move:v.support.touch||!v.params.simulateTouch?"touchmove":w[1],end:v.support.touch||!v.params.simulateTouch?"touchend":w[2]},(window.navigator.pointerEnabled||window.navigator.msPointerEnabled)&&("container"===v.params.touchEventsTarget?v.container:v.wrapper).addClass("swiper-wp8-"+v.params.direction),v.initEvents=function(e){var t=e?"off":"on",r=e?"removeEventListener":"addEventListener",i="container"===v.params.touchEventsTarget?v.container[0]:v.wrapper[0],n=v.support.touch?i:document,o=v.params.nested?!0:!1;v.browser.ie?(i[r](v.touchEvents.start,v.onTouchStart,!1),n[r](v.touchEvents.move,v.onTouchMove,o),n[r](v.touchEvents.end,v.onTouchEnd,!1)):(v.support.touch&&(i[r](v.touchEvents.start,v.onTouchStart,!1),i[r](v.touchEvents.move,v.onTouchMove,o),i[r](v.touchEvents.end,v.onTouchEnd,!1)),!s.simulateTouch||v.device.ios||v.device.android||(i[r]("mousedown",v.onTouchStart,!1),document[r]("mousemove",v.onTouchMove,o),document[r]("mouseup",v.onTouchEnd,!1))),window[r]("resize",v.onResize),v.params.nextButton&&(a(v.params.nextButton)[t]("click",v.onClickNext),v.params.a11y&&v.a11y&&a(v.params.nextButton)[t]("keydown",v.a11y.onEnterKey)),v.params.prevButton&&(a(v.params.prevButton)[t]("click",v.onClickPrev),v.params.a11y&&v.a11y&&a(v.params.prevButton)[t]("keydown",v.a11y.onEnterKey)),v.params.pagination&&v.params.paginationClickable&&(a(v.paginationContainer)[t]("click","."+v.params.bulletClass,v.onClickIndex),v.params.a11y&&v.a11y&&a(v.paginationContainer)[t]("keydown","."+v.params.bulletClass,v.a11y.onEnterKey)),(v.params.preventClicks||v.params.preventClicksPropagation)&&i[r]("click",v.preventClicks,!0)},v.attachEvents=function(e){v.initEvents()},v.detachEvents=function(){v.initEvents(!0)},v.allowClick=!0,v.preventClicks=function(e){v.allowClick||(v.params.preventClicks&&e.preventDefault(),v.params.preventClicksPropagation&&v.animating&&(e.stopPropagation(),e.stopImmediatePropagation()))},v.onClickNext=function(e){e.preventDefault(),(!v.isEnd||v.params.loop)&&v.slideNext()},v.onClickPrev=function(e){e.preventDefault(),(!v.isBeginning||v.params.loop)&&v.slidePrev()},v.onClickIndex=function(e){e.preventDefault();var t=a(this).index()*v.params.slidesPerGroup;v.params.loop&&(t+=v.loopedSlides),v.slideTo(t)},v.updateClickedSlide=function(e){var t=o(e,"."+v.params.slideClass),s=!1;if(t)for(var r=0;r<v.slides.length;r++)v.slides[r]===t&&(s=!0);if(!t||!s)return v.clickedSlide=void 0,void(v.clickedIndex=void 0);if(v.clickedSlide=t,v.clickedIndex=a(t).index(),v.params.slideToClickedSlide&&void 0!==v.clickedIndex&&v.clickedIndex!==v.activeIndex){var i,n=v.clickedIndex;if(v.params.loop)if(i=a(v.clickedSlide).attr("data-swiper-slide-index"),n>v.slides.length-v.params.slidesPerView)v.fixLoop(),n=v.wrapper.children("."+v.params.slideClass+'[data-swiper-slide-index="'+i+'"]').eq(0).index(),setTimeout(function(){v.slideTo(n)},0);else if(n<v.params.slidesPerView-1){v.fixLoop();var l=v.wrapper.children("."+v.params.slideClass+'[data-swiper-slide-index="'+i+'"]');n=l.eq(l.length-1).index(),setTimeout(function(){v.slideTo(n)},0)}else v.slideTo(n);else v.slideTo(n)}};var y,x,b,T,S,C,M,P,z,I="input, select, textarea, button",E=Date.now(),k=[];v.animating=!1,v.touches={startX:0,startY:0,currentX:0,currentY:0,diff:0};var D,G;if(v.onTouchStart=function(e){if(e.originalEvent&&(e=e.originalEvent),D="touchstart"===e.type,D||!("which"in e)||3!==e.which){if(v.params.noSwiping&&o(e,"."+v.params.noSwipingClass))return void(v.allowClick=!0);if(!v.params.swipeHandler||o(e,v.params.swipeHandler)){var t=v.touches.currentX="touchstart"===e.type?e.targetTouches[0].pageX:e.pageX,s=v.touches.currentY="touchstart"===e.type?e.targetTouches[0].pageY:e.pageY;if(!(v.device.ios&&v.params.iOSEdgeSwipeDetection&&t<=v.params.iOSEdgeSwipeThreshold)){if(y=!0,x=!1,T=void 0,G=void 0,v.touches.startX=t,v.touches.startY=s,b=Date.now(),v.allowClick=!0,v.updateContainerSize(),v.swipeDirection=void 0,v.params.threshold>0&&(M=!1),"touchstart"!==e.type){var r=!0;a(e.target).is(I)&&(r=!1),document.activeElement&&a(document.activeElement).is(I)&&document.activeElement.blur(),r&&e.preventDefault()}v.emit("onTouchStart",v,e)}}}},v.onTouchMove=function(e){if(e.originalEvent&&(e=e.originalEvent),!(D&&"mousemove"===e.type||e.preventedByNestedSwiper)){if(v.params.onlyExternal)return v.allowClick=!1,void(y&&(v.touches.startX=v.touches.currentX="touchmove"===e.type?e.targetTouches[0].pageX:e.pageX,v.touches.startY=v.touches.currentY="touchmove"===e.type?e.targetTouches[0].pageY:e.pageY,b=Date.now()));if(D&&document.activeElement&&e.target===document.activeElement&&a(e.target).is(I))return x=!0,void(v.allowClick=!1);if(v.emit("onTouchMove",v,e),!(e.targetTouches&&e.targetTouches.length>1)){if(v.touches.currentX="touchmove"===e.type?e.targetTouches[0].pageX:e.pageX,v.touches.currentY="touchmove"===e.type?e.targetTouches[0].pageY:e.pageY,"undefined"==typeof T){var t=180*Math.atan2(Math.abs(v.touches.currentY-v.touches.startY),Math.abs(v.touches.currentX-v.touches.startX))/Math.PI;T=r()?t>v.params.touchAngle:90-t>v.params.touchAngle}if(T&&v.emit("onTouchMoveOpposite",v,e),"undefined"==typeof G&&v.browser.ieTouch&&(v.touches.currentX!==v.touches.startX||v.touches.currentY!==v.touches.startY)&&(G=!0),y){if(T)return void(y=!1);if(G||!v.browser.ieTouch){v.allowClick=!1,v.emit("onSliderMove",v,e),e.preventDefault(),v.params.touchMoveStopPropagation&&!v.params.nested&&e.stopPropagation(),x||(s.loop&&v.fixLoop(),C=v.getWrapperTranslate(),v.setWrapperTransition(0),v.animating&&v.wrapper.trigger("webkitTransitionEnd transitionend oTransitionEnd MSTransitionEnd msTransitionEnd"),v.params.autoplay&&v.autoplaying&&(v.params.autoplayDisableOnInteraction?v.stopAutoplay():v.pauseAutoplay()),z=!1,v.params.grabCursor&&(v.container[0].style.cursor="move",v.container[0].style.cursor="-webkit-grabbing",v.container[0].style.cursor="-moz-grabbin",v.container[0].style.cursor="grabbing")),x=!0;var i=v.touches.diff=r()?v.touches.currentX-v.touches.startX:v.touches.currentY-v.touches.startY;i*=v.params.touchRatio,v.rtl&&(i=-i),v.swipeDirection=i>0?"prev":"next",S=i+C;var n=!0;if(i>0&&S>v.minTranslate()?(n=!1,v.params.resistance&&(S=v.minTranslate()-1+Math.pow(-v.minTranslate()+C+i,v.params.resistanceRatio))):0>i&&S<v.maxTranslate()&&(n=!1,v.params.resistance&&(S=v.maxTranslate()+1-Math.pow(v.maxTranslate()-C-i,v.params.resistanceRatio))),n&&(e.preventedByNestedSwiper=!0),!v.params.allowSwipeToNext&&"next"===v.swipeDirection&&C>S&&(S=C),!v.params.allowSwipeToPrev&&"prev"===v.swipeDirection&&S>C&&(S=C),v.params.followFinger){if(v.params.threshold>0){if(!(Math.abs(i)>v.params.threshold||M))return void(S=C);if(!M)return M=!0,v.touches.startX=v.touches.currentX,v.touches.startY=v.touches.currentY,S=C,void(v.touches.diff=r()?v.touches.currentX-v.touches.startX:v.touches.currentY-v.touches.startY)}(v.params.freeMode||v.params.watchSlidesProgress)&&v.updateActiveIndex(),v.params.freeMode&&(0===k.length&&k.push({position:v.touches[r()?"startX":"startY"],time:b}),k.push({position:v.touches[r()?"currentX":"currentY"],time:(new window.Date).getTime()})),v.updateProgress(S),v.setWrapperTranslate(S)}}}}}},v.onTouchEnd=function(e){if(e.originalEvent&&(e=e.originalEvent),v.emit("onTouchEnd",v,e),y){v.params.grabCursor&&x&&y&&(v.container[0].style.cursor="move",v.container[0].style.cursor="-webkit-grab",v.container[0].style.cursor="-moz-grab",v.container[0].style.cursor="grab");var t=Date.now(),s=t-b;if(v.allowClick&&(v.updateClickedSlide(e),v.emit("onTap",v,e),300>s&&t-E>300&&(P&&clearTimeout(P),P=setTimeout(function(){v&&(v.params.paginationHide&&v.paginationContainer.length>0&&!a(e.target).hasClass(v.params.bulletClass)&&v.paginationContainer.toggleClass(v.params.paginationHiddenClass),v.emit("onClick",v,e))},300)),300>s&&300>t-E&&(P&&clearTimeout(P),v.emit("onDoubleTap",v,e))),E=Date.now(),setTimeout(function(){v&&(v.allowClick=!0)},0),!y||!x||!v.swipeDirection||0===v.touches.diff||S===C)return void(y=x=!1);y=x=!1;var r;if(r=v.params.followFinger?v.rtl?v.translate:-v.translate:-S,v.params.freeMode){if(r<-v.minTranslate())return void v.slideTo(v.activeIndex);if(r>-v.maxTranslate())return void v.slideTo(v.slides.length<v.snapGrid.length?v.snapGrid.length-1:v.slides.length-1);if(v.params.freeModeMomentum){if(k.length>1){var i=k.pop(),n=k.pop(),o=i.position-n.position,l=i.time-n.time;v.velocity=o/l,v.velocity=v.velocity/2,Math.abs(v.velocity)<.02&&(v.velocity=0),(l>150||(new window.Date).getTime()-i.time>300)&&(v.velocity=0)}else v.velocity=0;k.length=0;var p=1e3*v.params.freeModeMomentumRatio,d=v.velocity*p,u=v.translate+d;v.rtl&&(u=-u);var c,m=!1,f=20*Math.abs(v.velocity)*v.params.freeModeMomentumBounceRatio;if(u<v.maxTranslate())v.params.freeModeMomentumBounce?(u+v.maxTranslate()<-f&&(u=v.maxTranslate()-f),c=v.maxTranslate(),m=!0,z=!0):u=v.maxTranslate();else if(u>v.minTranslate())v.params.freeModeMomentumBounce?(u-v.minTranslate()>f&&(u=v.minTranslate()+f),c=v.minTranslate(),m=!0,z=!0):u=v.minTranslate();else if(v.params.freeModeSticky){var h,g=0;for(g=0;g<v.snapGrid.length;g+=1)if(v.snapGrid[g]>-u){h=g;break}u=Math.abs(v.snapGrid[h]-u)<Math.abs(v.snapGrid[h-1]-u)||"next"===v.swipeDirection?v.snapGrid[h]:v.snapGrid[h-1],v.rtl||(u=-u)}if(0!==v.velocity)p=Math.abs(v.rtl?(-u-v.translate)/v.velocity:(u-v.translate)/v.velocity);else if(v.params.freeModeSticky)return void v.slideReset();v.params.freeModeMomentumBounce&&m?(v.updateProgress(c),v.setWrapperTransition(p),v.setWrapperTranslate(u),v.onTransitionStart(),v.animating=!0,v.wrapper.transitionEnd(function(){v&&z&&(v.emit("onMomentumBounce",v),v.setWrapperTransition(v.params.speed),v.setWrapperTranslate(c),v.wrapper.transitionEnd(function(){v&&v.onTransitionEnd()}))})):v.velocity?(v.updateProgress(u),v.setWrapperTransition(p),v.setWrapperTranslate(u),v.onTransitionStart(),v.animating||(v.animating=!0,v.wrapper.transitionEnd(function(){v&&v.onTransitionEnd()}))):v.updateProgress(u),v.updateActiveIndex()}return void((!v.params.freeModeMomentum||s>=v.params.longSwipesMs)&&(v.updateProgress(),v.updateActiveIndex()))}var w,T=0,M=v.slidesSizesGrid[0];for(w=0;w<v.slidesGrid.length;w+=v.params.slidesPerGroup)"undefined"!=typeof v.slidesGrid[w+v.params.slidesPerGroup]?r>=v.slidesGrid[w]&&r<v.slidesGrid[w+v.params.slidesPerGroup]&&(T=w,M=v.slidesGrid[w+v.params.slidesPerGroup]-v.slidesGrid[w]):r>=v.slidesGrid[w]&&(T=w,M=v.slidesGrid[v.slidesGrid.length-1]-v.slidesGrid[v.slidesGrid.length-2]);var I=(r-v.slidesGrid[T])/M;if(s>v.params.longSwipesMs){if(!v.params.longSwipes)return void v.slideTo(v.activeIndex);"next"===v.swipeDirection&&v.slideTo(I>=v.params.longSwipesRatio?T+v.params.slidesPerGroup:T),"prev"===v.swipeDirection&&v.slideTo(I>1-v.params.longSwipesRatio?T+v.params.slidesPerGroup:T)}else{if(!v.params.shortSwipes)return void v.slideTo(v.activeIndex);"next"===v.swipeDirection&&v.slideTo(T+v.params.slidesPerGroup),"prev"===v.swipeDirection&&v.slideTo(T)}}},v._slideTo=function(e,a){return v.slideTo(e,a,!0,!0)},v.slideTo=function(e,a,t,s){"undefined"==typeof t&&(t=!0),"undefined"==typeof e&&(e=0),0>e&&(e=0),v.snapIndex=Math.floor(e/v.params.slidesPerGroup),v.snapIndex>=v.snapGrid.length&&(v.snapIndex=v.snapGrid.length-1);var i=-v.snapGrid[v.snapIndex];v.params.autoplay&&v.autoplaying&&(s||!v.params.autoplayDisableOnInteraction?v.pauseAutoplay(a):v.stopAutoplay()),v.updateProgress(i);for(var n=0;n<v.slidesGrid.length;n++)-Math.floor(100*i)>=Math.floor(100*v.slidesGrid[n])&&(e=n);if(!v.params.allowSwipeToNext&&i<v.translate&&i<v.minTranslate())return!1;if(!v.params.allowSwipeToPrev&&i>v.translate&&i>v.maxTranslate()&&(v.activeIndex||0)!==e)return!1;if("undefined"==typeof a&&(a=v.params.speed),v.previousIndex=v.activeIndex||0,v.activeIndex=e,i===v.translate)return v.updateClasses(),!1;v.updateClasses(),v.onTransitionStart(t);r()?i:0,r()?0:i;return 0===a?(v.setWrapperTransition(0),v.setWrapperTranslate(i),v.onTransitionEnd(t)):(v.setWrapperTransition(a),v.setWrapperTranslate(i),v.animating||(v.animating=!0,v.wrapper.transitionEnd(function(){v&&v.onTransitionEnd(t)}))),!0},v.onTransitionStart=function(e){"undefined"==typeof e&&(e=!0), v.lazy&&v.lazy.onTransitionStart(),e&&(v.emit("onTransitionStart",v),v.activeIndex!==v.previousIndex&&v.emit("onSlideChangeStart",v))},v.onTransitionEnd=function(e){v.animating=!1,v.setWrapperTransition(0),"undefined"==typeof e&&(e=!0),v.lazy&&v.lazy.onTransitionEnd(),e&&(v.emit("onTransitionEnd",v),v.activeIndex!==v.previousIndex&&v.emit("onSlideChangeEnd",v)),v.params.hashnav&&v.hashnav&&v.hashnav.setHash()},v.slideNext=function(e,a,t){if(v.params.loop){if(v.animating)return!1;v.fixLoop();{v.container[0].clientLeft}return v.slideTo(v.activeIndex+v.params.slidesPerGroup,a,e,t)}return v.slideTo(v.activeIndex+v.params.slidesPerGroup,a,e,t)},v._slideNext=function(e){return v.slideNext(!0,e,!0)},v.slidePrev=function(e,a,t){if(v.params.loop){if(v.animating)return!1;v.fixLoop();{v.container[0].clientLeft}return v.slideTo(v.activeIndex-1,a,e,t)}return v.slideTo(v.activeIndex-1,a,e,t)},v._slidePrev=function(e){return v.slidePrev(!0,e,!0)},v.slideReset=function(e,a,t){return v.slideTo(v.activeIndex,a,e)},v.setWrapperTransition=function(e,a){v.wrapper.transition(e),"slide"!==v.params.effect&&v.effects[v.params.effect]&&v.effects[v.params.effect].setTransition(e),v.params.parallax&&v.parallax&&v.parallax.setTransition(e),v.params.scrollbar&&v.scrollbar&&v.scrollbar.setTransition(e),v.params.control&&v.controller&&v.controller.setTransition(e,a),v.emit("onSetTransition",v,e)},v.setWrapperTranslate=function(e,a,t){var s=0,i=0,n=0;r()?s=v.rtl?-e:e:i=e,v.params.virtualTranslate||v.wrapper.transform(v.support.transforms3d?"translate3d("+s+"px, "+i+"px, "+n+"px)":"translate("+s+"px, "+i+"px)"),v.translate=r()?s:i,a&&v.updateActiveIndex(),"slide"!==v.params.effect&&v.effects[v.params.effect]&&v.effects[v.params.effect].setTranslate(v.translate),v.params.parallax&&v.parallax&&v.parallax.setTranslate(v.translate),v.params.scrollbar&&v.scrollbar&&v.scrollbar.setTranslate(v.translate),v.params.control&&v.controller&&v.controller.setTranslate(v.translate,t),v.emit("onSetTranslate",v,v.translate)},v.getTranslate=function(e,a){var t,s,r,i;return"undefined"==typeof a&&(a="x"),v.params.virtualTranslate?v.rtl?-v.translate:v.translate:(r=window.getComputedStyle(e,null),window.WebKitCSSMatrix?i=new window.WebKitCSSMatrix("none"===r.webkitTransform?"":r.webkitTransform):(i=r.MozTransform||r.OTransform||r.MsTransform||r.msTransform||r.transform||r.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),t=i.toString().split(",")),"x"===a&&(s=window.WebKitCSSMatrix?i.m41:parseFloat(16===t.length?t[12]:t[4])),"y"===a&&(s=window.WebKitCSSMatrix?i.m42:parseFloat(16===t.length?t[13]:t[5])),v.rtl&&s&&(s=-s),s||0)},v.getWrapperTranslate=function(e){return"undefined"==typeof e&&(e=r()?"x":"y"),v.getTranslate(v.wrapper[0],e)},v.observers=[],v.initObservers=function(){if(v.params.observeParents)for(var e=v.container.parents(),a=0;a<e.length;a++)l(e[a]);l(v.container[0],{childList:!1}),l(v.wrapper[0],{attributes:!1})},v.disconnectObservers=function(){for(var e=0;e<v.observers.length;e++)v.observers[e].disconnect();v.observers=[]},v.createLoop=function(){v.wrapper.children("."+v.params.slideClass+"."+v.params.slideDuplicateClass).remove();var e=v.wrapper.children("."+v.params.slideClass);"auto"!==v.params.slidesPerView||v.params.loopedSlides||(v.params.loopedSlides=e.length),v.loopedSlides=parseInt(v.params.loopedSlides||v.params.slidesPerView,10),v.loopedSlides=v.loopedSlides+v.params.loopAdditionalSlides,v.loopedSlides>e.length&&(v.loopedSlides=e.length);var t,s=[],r=[];for(e.each(function(t,i){var n=a(this);t<v.loopedSlides&&r.push(i),t<e.length&&t>=e.length-v.loopedSlides&&s.push(i),n.attr("data-swiper-slide-index",t)}),t=0;t<r.length;t++)v.wrapper.append(a(r[t].cloneNode(!0)).addClass(v.params.slideDuplicateClass));for(t=s.length-1;t>=0;t--)v.wrapper.prepend(a(s[t].cloneNode(!0)).addClass(v.params.slideDuplicateClass))},v.destroyLoop=function(){v.wrapper.children("."+v.params.slideClass+"."+v.params.slideDuplicateClass).remove(),v.slides.removeAttr("data-swiper-slide-index")},v.fixLoop=function(){var e;v.activeIndex<v.loopedSlides?(e=v.slides.length-3*v.loopedSlides+v.activeIndex,e+=v.loopedSlides,v.slideTo(e,0,!1,!0)):("auto"===v.params.slidesPerView&&v.activeIndex>=2*v.loopedSlides||v.activeIndex>v.slides.length-2*v.params.slidesPerView)&&(e=-v.slides.length+v.activeIndex+v.loopedSlides,e+=v.loopedSlides,v.slideTo(e,0,!1,!0))},v.appendSlide=function(e){if(v.params.loop&&v.destroyLoop(),"object"==typeof e&&e.length)for(var a=0;a<e.length;a++)e[a]&&v.wrapper.append(e[a]);else v.wrapper.append(e);v.params.loop&&v.createLoop(),v.params.observer&&v.support.observer||v.update(!0)},v.prependSlide=function(e){v.params.loop&&v.destroyLoop();var a=v.activeIndex+1;if("object"==typeof e&&e.length){for(var t=0;t<e.length;t++)e[t]&&v.wrapper.prepend(e[t]);a=v.activeIndex+e.length}else v.wrapper.prepend(e);v.params.loop&&v.createLoop(),v.params.observer&&v.support.observer||v.update(!0),v.slideTo(a,0,!1)},v.removeSlide=function(e){v.params.loop&&(v.destroyLoop(),v.slides=v.wrapper.children("."+v.params.slideClass));var a,t=v.activeIndex;if("object"==typeof e&&e.length){for(var s=0;s<e.length;s++)a=e[s],v.slides[a]&&v.slides.eq(a).remove(),t>a&&t--;t=Math.max(t,0)}else a=e,v.slides[a]&&v.slides.eq(a).remove(),t>a&&t--,t=Math.max(t,0);v.params.loop&&v.createLoop(),v.params.observer&&v.support.observer||v.update(!0),v.params.loop?v.slideTo(t+v.loopedSlides,0,!1):v.slideTo(t,0,!1)},v.removeAllSlides=function(){for(var e=[],a=0;a<v.slides.length;a++)e.push(a);v.removeSlide(e)},v.effects={fade:{setTranslate:function(){for(var e=0;e<v.slides.length;e++){var a=v.slides.eq(e),t=a[0].swiperSlideOffset,s=-t;v.params.virtualTranslate||(s-=v.translate);var i=0;r()||(i=s,s=0);var n=v.params.fade.crossFade?Math.max(1-Math.abs(a[0].progress),0):1+Math.min(Math.max(a[0].progress,-1),0);a.css({opacity:n}).transform("translate3d("+s+"px, "+i+"px, 0px)")}},setTransition:function(e){if(v.slides.transition(e),v.params.virtualTranslate&&0!==e){var a=!1;v.slides.transitionEnd(function(){if(!a&&v){a=!0,v.animating=!1;for(var e=["webkitTransitionEnd","transitionend","oTransitionEnd","MSTransitionEnd","msTransitionEnd"],t=0;t<e.length;t++)v.wrapper.trigger(e[t])}})}}},cube:{setTranslate:function(){var e,t=0;v.params.cube.shadow&&(r()?(e=v.wrapper.find(".swiper-cube-shadow"),0===e.length&&(e=a('<div class="swiper-cube-shadow"></div>'),v.wrapper.append(e)),e.css({height:v.width+"px"})):(e=v.container.find(".swiper-cube-shadow"),0===e.length&&(e=a('<div class="swiper-cube-shadow"></div>'),v.container.append(e))));for(var s=0;s<v.slides.length;s++){var i=v.slides.eq(s),n=90*s,o=Math.floor(n/360);v.rtl&&(n=-n,o=Math.floor(-n/360));var l=Math.max(Math.min(i[0].progress,1),-1),p=0,d=0,u=0;s%4===0?(p=4*-o*v.size,u=0):(s-1)%4===0?(p=0,u=4*-o*v.size):(s-2)%4===0?(p=v.size+4*o*v.size,u=v.size):(s-3)%4===0&&(p=-v.size,u=3*v.size+4*v.size*o),v.rtl&&(p=-p),r()||(d=p,p=0);var c="rotateX("+(r()?0:-n)+"deg) rotateY("+(r()?n:0)+"deg) translate3d("+p+"px, "+d+"px, "+u+"px)";if(1>=l&&l>-1&&(t=90*s+90*l,v.rtl&&(t=90*-s-90*l)),i.transform(c),v.params.cube.slideShadows){var m=i.find(r()?".swiper-slide-shadow-left":".swiper-slide-shadow-top"),f=i.find(r()?".swiper-slide-shadow-right":".swiper-slide-shadow-bottom");0===m.length&&(m=a('<div class="swiper-slide-shadow-'+(r()?"left":"top")+'"></div>'),i.append(m)),0===f.length&&(f=a('<div class="swiper-slide-shadow-'+(r()?"right":"bottom")+'"></div>'),i.append(f));{i[0].progress}m.length&&(m[0].style.opacity=-i[0].progress),f.length&&(f[0].style.opacity=i[0].progress)}}if(v.wrapper.css({"-webkit-transform-origin":"50% 50% -"+v.size/2+"px","-moz-transform-origin":"50% 50% -"+v.size/2+"px","-ms-transform-origin":"50% 50% -"+v.size/2+"px","transform-origin":"50% 50% -"+v.size/2+"px"}),v.params.cube.shadow)if(r())e.transform("translate3d(0px, "+(v.width/2+v.params.cube.shadowOffset)+"px, "+-v.width/2+"px) rotateX(90deg) rotateZ(0deg) scale("+v.params.cube.shadowScale+")");else{var h=Math.abs(t)-90*Math.floor(Math.abs(t)/90),g=1.5-(Math.sin(2*h*Math.PI/360)/2+Math.cos(2*h*Math.PI/360)/2),w=v.params.cube.shadowScale,y=v.params.cube.shadowScale/g,x=v.params.cube.shadowOffset;e.transform("scale3d("+w+", 1, "+y+") translate3d(0px, "+(v.height/2+x)+"px, "+-v.height/2/y+"px) rotateX(-90deg)")}var b=v.isSafari||v.isUiWebView?-v.size/2:0;v.wrapper.transform("translate3d(0px,0,"+b+"px) rotateX("+(r()?0:t)+"deg) rotateY("+(r()?-t:0)+"deg)")},setTransition:function(e){v.slides.transition(e).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(e),v.params.cube.shadow&&!r()&&v.container.find(".swiper-cube-shadow").transition(e)}},coverflow:{setTranslate:function(){for(var e=v.translate,t=r()?-e+v.width/2:-e+v.height/2,s=r()?v.params.coverflow.rotate:-v.params.coverflow.rotate,i=v.params.coverflow.depth,n=0,o=v.slides.length;o>n;n++){var l=v.slides.eq(n),p=v.slidesSizesGrid[n],d=l[0].swiperSlideOffset,u=(t-d-p/2)/p*v.params.coverflow.modifier,c=r()?s*u:0,m=r()?0:s*u,f=-i*Math.abs(u),h=r()?0:v.params.coverflow.stretch*u,g=r()?v.params.coverflow.stretch*u:0;Math.abs(g)<.001&&(g=0),Math.abs(h)<.001&&(h=0),Math.abs(f)<.001&&(f=0),Math.abs(c)<.001&&(c=0),Math.abs(m)<.001&&(m=0);var w="translate3d("+g+"px,"+h+"px,"+f+"px) rotateX("+m+"deg) rotateY("+c+"deg)";if(l.transform(w),l[0].style.zIndex=-Math.abs(Math.round(u))+1,v.params.coverflow.slideShadows){var y=l.find(r()?".swiper-slide-shadow-left":".swiper-slide-shadow-top"),x=l.find(r()?".swiper-slide-shadow-right":".swiper-slide-shadow-bottom");0===y.length&&(y=a('<div class="swiper-slide-shadow-'+(r()?"left":"top")+'"></div>'),l.append(y)),0===x.length&&(x=a('<div class="swiper-slide-shadow-'+(r()?"right":"bottom")+'"></div>'),l.append(x)),y.length&&(y[0].style.opacity=u>0?u:0),x.length&&(x[0].style.opacity=-u>0?-u:0)}}if(v.browser.ie){var b=v.wrapper[0].style;b.perspectiveOrigin=t+"px 50%"}},setTransition:function(e){v.slides.transition(e).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(e)}}},v.lazy={initialImageLoaded:!1,loadImageInSlide:function(e,t){if("undefined"!=typeof e&&("undefined"==typeof t&&(t=!0),0!==v.slides.length)){var s=v.slides.eq(e),r=s.find(".swiper-lazy:not(.swiper-lazy-loaded):not(.swiper-lazy-loading)");!s.hasClass("swiper-lazy")||s.hasClass("swiper-lazy-loaded")||s.hasClass("swiper-lazy-loading")||r.add(s[0]),0!==r.length&&r.each(function(){var e=a(this);e.addClass("swiper-lazy-loading");var r=e.attr("data-background"),i=e.attr("data-src");v.loadImage(e[0],i||r,!1,function(){if(r?(e.css("background-image","url("+r+")"),e.removeAttr("data-background")):(e.attr("src",i),e.removeAttr("data-src")),e.addClass("swiper-lazy-loaded").removeClass("swiper-lazy-loading"),s.find(".swiper-lazy-preloader, .preloader").remove(),v.params.loop&&t){var a=s.attr("data-swiper-slide-index");if(s.hasClass(v.params.slideDuplicateClass)){var n=v.wrapper.children('[data-swiper-slide-index="'+a+'"]:not(.'+v.params.slideDuplicateClass+")");v.lazy.loadImageInSlide(n.index(),!1)}else{var o=v.wrapper.children("."+v.params.slideDuplicateClass+'[data-swiper-slide-index="'+a+'"]');v.lazy.loadImageInSlide(o.index(),!1)}}v.emit("onLazyImageReady",v,s[0],e[0])}),v.emit("onLazyImageLoad",v,s[0],e[0])})}},load:function(){var e;if(v.params.watchSlidesVisibility)v.wrapper.children("."+v.params.slideVisibleClass).each(function(){v.lazy.loadImageInSlide(a(this).index())});else if(v.params.slidesPerView>1)for(e=v.activeIndex;e<v.activeIndex+v.params.slidesPerView;e++)v.slides[e]&&v.lazy.loadImageInSlide(e);else v.lazy.loadImageInSlide(v.activeIndex);if(v.params.lazyLoadingInPrevNext)if(v.params.slidesPerView>1){for(e=v.activeIndex+v.params.slidesPerView;e<v.activeIndex+v.params.slidesPerView+v.params.slidesPerView;e++)v.slides[e]&&v.lazy.loadImageInSlide(e);for(e=v.activeIndex-v.params.slidesPerView;e<v.activeIndex;e++)v.slides[e]&&v.lazy.loadImageInSlide(e)}else{var t=v.wrapper.children("."+v.params.slideNextClass);t.length>0&&v.lazy.loadImageInSlide(t.index());var s=v.wrapper.children("."+v.params.slidePrevClass);s.length>0&&v.lazy.loadImageInSlide(s.index())}},onTransitionStart:function(){v.params.lazyLoading&&(v.params.lazyLoadingOnTransitionStart||!v.params.lazyLoadingOnTransitionStart&&!v.lazy.initialImageLoaded)&&v.lazy.load()},onTransitionEnd:function(){v.params.lazyLoading&&!v.params.lazyLoadingOnTransitionStart&&v.lazy.load()}},v.scrollbar={set:function(){if(v.params.scrollbar){var e=v.scrollbar;e.track=a(v.params.scrollbar),e.drag=e.track.find(".swiper-scrollbar-drag"),0===e.drag.length&&(e.drag=a('<div class="swiper-scrollbar-drag"></div>'),e.track.append(e.drag)),e.drag[0].style.width="",e.drag[0].style.height="",e.trackSize=r()?e.track[0].offsetWidth:e.track[0].offsetHeight,e.divider=v.size/v.virtualSize,e.moveDivider=e.divider*(e.trackSize/v.size),e.dragSize=e.trackSize*e.divider,r()?e.drag[0].style.width=e.dragSize+"px":e.drag[0].style.height=e.dragSize+"px",e.track[0].style.display=e.divider>=1?"none":"",v.params.scrollbarHide&&(e.track[0].style.opacity=0)}},setTranslate:function(){if(v.params.scrollbar){var e,a=v.scrollbar,t=(v.translate||0,a.dragSize);e=(a.trackSize-a.dragSize)*v.progress,v.rtl&&r()?(e=-e,e>0?(t=a.dragSize-e,e=0):-e+a.dragSize>a.trackSize&&(t=a.trackSize+e)):0>e?(t=a.dragSize+e,e=0):e+a.dragSize>a.trackSize&&(t=a.trackSize-e),r()?(a.drag.transform(v.support.transforms3d?"translate3d("+e+"px, 0, 0)":"translateX("+e+"px)"),a.drag[0].style.width=t+"px"):(a.drag.transform(v.support.transforms3d?"translate3d(0px, "+e+"px, 0)":"translateY("+e+"px)"),a.drag[0].style.height=t+"px"),v.params.scrollbarHide&&(clearTimeout(a.timeout),a.track[0].style.opacity=1,a.timeout=setTimeout(function(){a.track[0].style.opacity=0,a.track.transition(400)},1e3))}},setTransition:function(e){v.params.scrollbar&&v.scrollbar.drag.transition(e)}},v.controller={LinearSpline:function(e,a){this.x=e,this.y=a,this.lastIndex=e.length-1;{var t,s;this.x.length}this.interpolate=function(e){return e?(s=r(this.x,e),t=s-1,(e-this.x[t])*(this.y[s]-this.y[t])/(this.x[s]-this.x[t])+this.y[t]):0};var r=function(){var e,a,t;return function(s,r){for(a=-1,e=s.length;e-a>1;)s[t=e+a>>1]<=r?a=t:e=t;return e}}()},getInterpolateFunction:function(e){v.controller.spline||(v.controller.spline=v.params.loop?new v.controller.LinearSpline(v.slidesGrid,e.slidesGrid):new v.controller.LinearSpline(v.snapGrid,e.snapGrid))},setTranslate:function(e,a){function s(a){e=a.rtl&&"horizontal"===a.params.direction?-v.translate:v.translate,"slide"===v.params.controlBy&&(v.controller.getInterpolateFunction(a),i=-v.controller.spline.interpolate(-e)),i&&"container"!==v.params.controlBy||(r=(a.maxTranslate()-a.minTranslate())/(v.maxTranslate()-v.minTranslate()),i=(e-v.minTranslate())*r+a.minTranslate()),v.params.controlInverse&&(i=a.maxTranslate()-i),a.updateProgress(i),a.setWrapperTranslate(i,!1,v),a.updateActiveIndex()}var r,i,n=v.params.control;if(v.isArray(n))for(var o=0;o<n.length;o++)n[o]!==a&&n[o]instanceof t&&s(n[o]);else n instanceof t&&a!==n&&s(n)},setTransition:function(e,a){function s(a){a.setWrapperTransition(e,v),0!==e&&(a.onTransitionStart(),a.wrapper.transitionEnd(function(){i&&(a.params.loop&&"slide"===v.params.controlBy&&a.fixLoop(),a.onTransitionEnd())}))}var r,i=v.params.control;if(v.isArray(i))for(r=0;r<i.length;r++)i[r]!==a&&i[r]instanceof t&&s(i[r]);else i instanceof t&&a!==i&&s(i)}},v.hashnav={init:function(){if(v.params.hashnav){v.hashnav.initialized=!0;var e=document.location.hash.replace("#","");if(e)for(var a=0,t=0,s=v.slides.length;s>t;t++){var r=v.slides.eq(t),i=r.attr("data-hash");if(i===e&&!r.hasClass(v.params.slideDuplicateClass)){var n=r.index();v.slideTo(n,a,v.params.runCallbacksOnInit,!0)}}}},setHash:function(){v.hashnav.initialized&&v.params.hashnav&&(document.location.hash=v.slides.eq(v.activeIndex).attr("data-hash")||"")}},v.disableKeyboardControl=function(){a(document).off("keydown",p)},v.enableKeyboardControl=function(){a(document).on("keydown",p)},v.mousewheel={event:!1,lastScrollTime:(new window.Date).getTime()},v.params.mousewheelControl){try{new window.WheelEvent("wheel"),v.mousewheel.event="wheel"}catch(L){}v.mousewheel.event||void 0===document.onmousewheel||(v.mousewheel.event="mousewheel"),v.mousewheel.event||(v.mousewheel.event="DOMMouseScroll")}v.disableMousewheelControl=function(){return v.mousewheel.event?(v.container.off(v.mousewheel.event,d),!0):!1},v.enableMousewheelControl=function(){return v.mousewheel.event?(v.container.on(v.mousewheel.event,d),!0):!1},v.parallax={setTranslate:function(){v.container.children("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]").each(function(){u(this,v.progress)}),v.slides.each(function(){var e=a(this);e.find("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]").each(function(){var a=Math.min(Math.max(e[0].progress,-1),1);u(this,a)})})},setTransition:function(e){"undefined"==typeof e&&(e=v.params.speed),v.container.find("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]").each(function(){var t=a(this),s=parseInt(t.attr("data-swiper-parallax-duration"),10)||e;0===e&&(s=0),t.transition(s)})}},v._plugins=[];for(var B in v.plugins){var O=v.plugins[B](v,v.params[B]);O&&v._plugins.push(O)}return v.callPlugins=function(e){for(var a=0;a<v._plugins.length;a++)e in v._plugins[a]&&v._plugins[a][e](arguments[1],arguments[2],arguments[3],arguments[4],arguments[5])},v.emitterEventListeners={},v.emit=function(e){v.params[e]&&v.params[e](arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]);var a;if(v.emitterEventListeners[e])for(a=0;a<v.emitterEventListeners[e].length;a++)v.emitterEventListeners[e][a](arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]);v.callPlugins&&v.callPlugins(e,arguments[1],arguments[2],arguments[3],arguments[4],arguments[5])},v.on=function(e,a){return e=c(e),v.emitterEventListeners[e]||(v.emitterEventListeners[e]=[]),v.emitterEventListeners[e].push(a),v},v.off=function(e,a){var t;if(e=c(e),"undefined"==typeof a)return v.emitterEventListeners[e]=[],v;if(v.emitterEventListeners[e]&&0!==v.emitterEventListeners[e].length){for(t=0;t<v.emitterEventListeners[e].length;t++)v.emitterEventListeners[e][t]===a&&v.emitterEventListeners[e].splice(t,1);return v}},v.once=function(e,a){e=c(e);var t=function(){a(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4]),v.off(e,t)};return v.on(e,t),v},v.a11y={makeFocusable:function(e){return e.attr("tabIndex","0"),e},addRole:function(e,a){return e.attr("role",a),e},addLabel:function(e,a){return e.attr("aria-label",a),e},disable:function(e){return e.attr("aria-disabled",!0),e},enable:function(e){return e.attr("aria-disabled",!1),e},onEnterKey:function(e){13===e.keyCode&&(a(e.target).is(v.params.nextButton)?(v.onClickNext(e),v.a11y.notify(v.isEnd?v.params.lastSlideMessage:v.params.nextSlideMessage)):a(e.target).is(v.params.prevButton)&&(v.onClickPrev(e),v.a11y.notify(v.isBeginning?v.params.firstSlideMessage:v.params.prevSlideMessage)),a(e.target).is("."+v.params.bulletClass)&&a(e.target)[0].click())},liveRegion:a('<span class="swiper-notification" aria-live="assertive" aria-atomic="true"></span>'),notify:function(e){var a=v.a11y.liveRegion;0!==a.length&&(a.html(""),a.html(e))},init:function(){if(v.params.nextButton){var e=a(v.params.nextButton);v.a11y.makeFocusable(e),v.a11y.addRole(e,"button"),v.a11y.addLabel(e,v.params.nextSlideMessage)}if(v.params.prevButton){var t=a(v.params.prevButton);v.a11y.makeFocusable(t),v.a11y.addRole(t,"button"),v.a11y.addLabel(t,v.params.prevSlideMessage)}a(v.container).append(v.a11y.liveRegion)},initPagination:function(){v.params.pagination&&v.params.paginationClickable&&v.bullets&&v.bullets.length&&v.bullets.each(function(){var e=a(this);v.a11y.makeFocusable(e),v.a11y.addRole(e,"button"),v.a11y.addLabel(e,v.params.paginationBulletMessage.replace(/{{index}}/,e.index()+1))})},destroy:function(){v.a11y.liveRegion&&v.a11y.liveRegion.length>0&&v.a11y.liveRegion.remove()}},v.init=function(){v.params.loop&&v.createLoop(),v.updateContainerSize(),v.updateSlidesSize(),v.updatePagination(),v.params.scrollbar&&v.scrollbar&&v.scrollbar.set(),"slide"!==v.params.effect&&v.effects[v.params.effect]&&(v.params.loop||v.updateProgress(),v.effects[v.params.effect].setTranslate()),v.params.loop?v.slideTo(v.params.initialSlide+v.loopedSlides,0,v.params.runCallbacksOnInit):(v.slideTo(v.params.initialSlide,0,v.params.runCallbacksOnInit),0===v.params.initialSlide&&(v.parallax&&v.params.parallax&&v.parallax.setTranslate(),v.lazy&&v.params.lazyLoading&&(v.lazy.load(),v.lazy.initialImageLoaded=!0))),v.attachEvents(),v.params.observer&&v.support.observer&&v.initObservers(),v.params.preloadImages&&!v.params.lazyLoading&&v.preloadImages(),v.params.autoplay&&v.startAutoplay(),v.params.keyboardControl&&v.enableKeyboardControl&&v.enableKeyboardControl(),v.params.mousewheelControl&&v.enableMousewheelControl&&v.enableMousewheelControl(),v.params.hashnav&&v.hashnav&&v.hashnav.init(),v.params.a11y&&v.a11y&&v.a11y.init(),v.emit("onInit",v)},v.cleanupStyles=function(){v.container.removeClass(v.classNames.join(" ")).removeAttr("style"),v.wrapper.removeAttr("style"),v.slides&&v.slides.length&&v.slides.removeClass([v.params.slideVisibleClass,v.params.slideActiveClass,v.params.slideNextClass,v.params.slidePrevClass].join(" ")).removeAttr("style").removeAttr("data-swiper-column").removeAttr("data-swiper-row"),v.paginationContainer&&v.paginationContainer.length&&v.paginationContainer.removeClass(v.params.paginationHiddenClass),v.bullets&&v.bullets.length&&v.bullets.removeClass(v.params.bulletActiveClass),v.params.prevButton&&a(v.params.prevButton).removeClass(v.params.buttonDisabledClass),v.params.nextButton&&a(v.params.nextButton).removeClass(v.params.buttonDisabledClass),v.params.scrollbar&&v.scrollbar&&(v.scrollbar.track&&v.scrollbar.track.length&&v.scrollbar.track.removeAttr("style"),v.scrollbar.drag&&v.scrollbar.drag.length&&v.scrollbar.drag.removeAttr("style"))},v.destroy=function(e,a){v.detachEvents(),v.stopAutoplay(),v.params.loop&&v.destroyLoop(),a&&v.cleanupStyles(),v.disconnectObservers(),v.params.keyboardControl&&v.disableKeyboardControl&&v.disableKeyboardControl(),v.params.mousewheelControl&&v.disableMousewheelControl&&v.disableMousewheelControl(),v.params.a11y&&v.a11y&&v.a11y.destroy(),v.emit("onDestroy"),e!==!1&&(v=null)},v.init(),v}};t.prototype={isSafari:function(){var e=navigator.userAgent.toLowerCase();return e.indexOf("safari")>=0&&e.indexOf("chrome")<0&&e.indexOf("android")<0}(),isUiWebView:/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(navigator.userAgent),isArray:function(e){return"[object Array]"===Object.prototype.toString.apply(e)},browser:{ie:window.navigator.pointerEnabled||window.navigator.msPointerEnabled,ieTouch:window.navigator.msPointerEnabled&&window.navigator.msMaxTouchPoints>1||window.navigator.pointerEnabled&&window.navigator.maxTouchPoints>1},device:function(){var e=navigator.userAgent,a=e.match(/(Android);?[\s\/]+([\d.]+)?/),t=e.match(/(iPad).*OS\s([\d_]+)/),s=e.match(/(iPod)(.*OS\s([\d_]+))?/),r=!t&&e.match(/(iPhone\sOS)\s([\d_]+)/);return{ios:t||r||s,android:a}}(),support:{touch:window.Modernizr&&Modernizr.touch===!0||function(){return!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)}(),transforms3d:window.Modernizr&&Modernizr.csstransforms3d===!0||function(){var e=document.createElement("div").style;return"webkitPerspective"in e||"MozPerspective"in e||"OPerspective"in e||"MsPerspective"in e||"perspective"in e}(),flexbox:function(){for(var e=document.createElement("div").style,a="alignItems webkitAlignItems webkitBoxAlign msFlexAlign mozBoxAlign webkitFlexDirection msFlexDirection mozBoxDirection mozBoxOrient webkitBoxDirection webkitBoxOrient".split(" "),t=0;t<a.length;t++)if(a[t]in e)return!0}(),observer:function(){return"MutationObserver"in window||"WebkitMutationObserver"in window}()},plugins:{}};for(var s=["jQuery","Zepto","Dom7"],r=0;r<s.length;r++)window[s[r]]&&e(window[s[r]]);var i;i="undefined"==typeof Dom7?window.Dom7||window.Zepto||window.jQuery:Dom7,i&&("transitionEnd"in i.fn||(i.fn.transitionEnd=function(e){function a(i){if(i.target===this)for(e.call(this,i),t=0;t<s.length;t++)r.off(s[t],a)}var t,s=["webkitTransitionEnd","transitionend","oTransitionEnd","MSTransitionEnd","msTransitionEnd"],r=this;if(e)for(t=0;t<s.length;t++)r.on(s[t],a);return this}),"transform"in i.fn||(i.fn.transform=function(e){for(var a=0;a<this.length;a++){var t=this[a].style;t.webkitTransform=t.MsTransform=t.msTransform=t.MozTransform=t.OTransform=t.transform=e}return this}),"transition"in i.fn||(i.fn.transition=function(e){"string"!=typeof e&&(e+="ms");for(var a=0;a<this.length;a++){var t=this[a].style;t.webkitTransitionDuration=t.MsTransitionDuration=t.msTransitionDuration=t.MozTransitionDuration=t.OTransitionDuration=t.transitionDuration=e}return this})),window.Swiper=t}(),"undefined"!=typeof module?module.exports=window.Swiper:"function"==typeof define&&define.amd&&define([],function(){"use strict";return window.Swiper}); function swiperAnimateCache(){for(allBoxes=window.document.documentElement.querySelectorAll(".ani"),i=0;i<allBoxes.length;i++)allBoxes[i].attributes["style"]?allBoxes[i].setAttribute("swiper-animate-style-cache",allBoxes[i].attributes["style"].value):allBoxes[i].setAttribute("swiper-animate-style-cache"," "),allBoxes[i].style.visibility="hidden"}function swiperAnimate(a){clearSwiperAnimate();var b=a.slides[a.activeIndex].querySelectorAll(".ani");for(i=0;i<b.length;i++)b[i].style.visibility="visible",effect=b[i].attributes["swiper-animate-effect"]?b[i].attributes["swiper-animate-effect"].value:"",b[i].className=b[i].className+" "+effect+" "+"animated",style=b[i].attributes["style"].value,duration=b[i].attributes["swiper-animate-duration"]?b[i].attributes["swiper-animate-duration"].value:"",duration&&(style=style+"animation-duration:"+duration+";-webkit-animation-duration:"+duration+";"),delay=b[i].attributes["swiper-animate-delay"]?b[i].attributes["swiper-animate-delay"].value:"",delay&&(style=style+"animation-delay:"+delay+";-webkit-animation-delay:"+delay+";"),b[i].setAttribute("style",style)}function clearSwiperAnimate(){for(allBoxes=window.document.documentElement.querySelectorAll(".ani"),i=0;i<allBoxes.length;i++)allBoxes[i].attributes["swiper-animate-style-cache"]&&allBoxes[i].setAttribute("style",allBoxes[i].attributes["swiper-animate-style-cache"].value),allBoxes[i].style.visibility="hidden",allBoxes[i].className=allBoxes[i].className.replace("animated"," "),allBoxes[i].attributes["swiper-animate-effect"]&&(effect=allBoxes[i].attributes["swiper-animate-effect"].value,allBoxes[i].className=allBoxes[i].className.replace(effect," "))}
6,538.666667
93,584
0.685728
9d18c8329c0a6e5e863f0393250aaccf34a321a2
132
html
HTML
v/candidateOptions.html
equeslevi/election
a541588e2a1652d9a61dce0e4f4b97116a226863
[ "MIT" ]
null
null
null
v/candidateOptions.html
equeslevi/election
a541588e2a1652d9a61dce0e4f4b97116a226863
[ "MIT" ]
null
null
null
v/candidateOptions.html
equeslevi/election
a541588e2a1652d9a61dce0e4f4b97116a226863
[ "MIT" ]
null
null
null
<!DOCTYPE html> <html> <head> <title></title> </head> <body> <?php include ('../php/navbar-insidev.php');?> </body> </html>
14.666667
47
0.560606
40c23eb82bfcb3446dc157e386516e9af9077d77
7,882
html
HTML
assets/tentang.html
Kojim2014/mp
048cadba089677f6d48f4707db419d85bdfdb61e
[ "MIT" ]
null
null
null
assets/tentang.html
Kojim2014/mp
048cadba089677f6d48f4707db419d85bdfdb61e
[ "MIT" ]
null
null
null
assets/tentang.html
Kojim2014/mp
048cadba089677f6d48f4707db419d85bdfdb61e
[ "MIT" ]
null
null
null
<html> <!-- Mirrored from www.sekolahkoding.com/tentang by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 18 Mar 2016 10:13:15 GMT --> <!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=UTF-8" /><!-- /Added by HTTrack --> <head> <title>Tentang Sekolah Koding | Informasi seputar Sekolah Koding</title> <meta charset="UTF-8"> <meta name="description" content="Informasi tentang sekolah koding, apa itu sekolah koding dan pertanyaan pertanyaan lain. Tempat belajar programming dan web development"> <meta name="keywords" content="Informasi, kursus, online, sekolah, koding, website, belajar, programming, dan, web, development, bahasa, indonesia"> <meta name="author" content="SekolahKoding"> <link rel="stylesheet" href="user/css/main-app.css" charset="utf-8"> <script src="../code.jquery.com/jquery-2.1.3.min.js"></script> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <link rel="icon" href="favicon.ico" type="image/x-icon" /> <!-- for facebook graph--> <meta property="og:title" content="SekolahKoding"> <meta property="og:image" content="/asset/blue-logo.png"> <meta property="og:description" content="Belajar Web Programming dan Design Online di SekolahKoding"> </head> <body class="body-class"> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','../www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-59878621-1', 'auto'); ga('send', 'pageview'); </script> <div id="page-wrapper"> <div id="menu_left_back"></div> <div id="menu_left" class="menu_profil"> <div id="menu_title"> <h2><a href="tentang.html">Tentang SK</a></h2> <h3>jangan nyerah, kadang yang kita cari satu langkah lagi</h3> </div> <div id="menu_left_bottom"> <a href="upacara.html"><li> <img src="asset/upacara-icon.png" alt="" /> Upacara </li></a> <a href="forum.html"><li> <img src="asset/forum-icon.png" alt="" /> Forum</li></a> <a href="perpustakaan.html"><li> <img src="asset/perpus-icon.png" alt="" /> Perpustakaan </li></a> <a href="kelas/index.html"><li> <img src="asset/kelas-icon.png" alt="" /> Kelas </li></a> <a href="perjalanan.html"><li> <img src="asset/jejak-icon.png" alt="" /> Perjalanan </li></a> <a href="member.html"><li> <img src="asset/member-icon.png" alt="" /> Member </li></a> <!-- <a href="/syarat"> <li> <img src="/asset/donasi-icon.png" alt="" /> Syarat </li></a> --> </div> <div class="clear"></div> </div><!-- end menu_left --> <div id="main_wrapper" class="main_profil"> <div id="menu-top-profil"> <div id="blue-logo"> <a href="user.html"><img src="../sekolahkoding.com/asset/blue-logo.png" alt=""/></a> </div> <ul> <li class="login"><a href="user/login.html">Masuk</a></li> <li><a href="user.html">Profil</a></li> <li><a href="kelas/index.html">Kelas</a></li> <li> <!-- notifikasi --> <!-- end of notifikasi --> </li> </ul> <!-- sweetalert--> <script src="../sekolahkoding.com/user/js/sweetalert-dev.js"></script> <link rel="stylesheet" href="../sekolahkoding.com/user/js/sweetalert.css"> </div> <div class="title_content"> <p> Tentang SekolahKoding </p> </div> <div class="content content_syarat"> Assalamualaikum, hi semuanya, selamat datang di SekolahKoding. <div class="faq_tanya">Apa itu SekolahKoding</div> <div class="faq_jawab">SekolahKoding adalah situs untuk belajar programming dan design, khususnya web(website) programming</div> <div class="faq_tanya">Kenapa belajar Koding / Programming</div> <div class="faq_jawab"> Skype bisa mempertemukan keluarga yang berbeda tempat, Twitter dan Facebook bisa menjadi tempat komunikasi antar rakyat dan pemimpin yang selama ini terpisah. Produk-produk ini adalah ide yang dieksekusi dengan senjata 'programming'. Kalau kita punya ide yang bisa bermanfaat, jangan ragu untuk mulai belajar programming. </div> <div class="faq_tanya">Kenapa belajar Design</div> <div class="faq_jawab"> "Batang emas yang dibungkus dengan kain tua, jarang ada yang melirik." Sering hal yang ingin kita sampaikan penuh manfaat, sayangnya tidak terbungkus dengan menarik, karena itu, belajar desain tidak boleh kita lewatkan. </div> <div class="faq_tanya">Kenapa SekolahKoding</div> <div class="faq_jawab"> Sulitnya mencari video tutorial yang berkualitas dalam bahasa Indonesia, menjadi salah satu alasan munculnya SekolahKoding. Tim SekolahKoding terus berusaha mencari 'best practice' atau cara terbaik, dalam menyampaikan materi programming yang banyak orang menyerah di awal karena sulit dipahami. Di SekolahKoding juga teman-teman bisa memposting pertanyaan atau berdiskusi dengan member lain melalui halaman <a style="text-decoration:underline" href="forum.html">Forum</a> </div> <div class="faq_tanya">Apa tujuan SekolahKoding</div> <div class="faq_jawab"> Tujuan SekolahKoding bukan untuk sekedar menambah ilmu atau wawasan teman-teman di bidang programming maupun design, tapi menyiapkan bekal, menjadi modal awal, sehingga tidak ada jarak antara kita dan ide yang dimiliki untuk membuat produk bermanfaat yang bisa membantu banyak orang. </div> <div class="faq_tanya">Apakah harus bayar</div> <div class="faq_jawab"> Keterangan detail mengenai biaya bisa dilihat di halaman <a href="syarat.html" style="text-decoration:underline">syarat</a> </div> <div class="faq_tanya">Tidak tahu mulai belajar dari mana</div> <div class="faq_jawab"> Tenang, untuk teman-teman yang benar-benar belum ada pengalaman, kita sudah menjelaskan di <a style="text-decoration:underline" href="http://sekolahkoding.com/kelas/video/cara-menjadi-web-designer-dan-developer">Video ini</a> </div> <div class="faq_tanya">Saya masih ada pertanyaan lain</div> <div class="faq_jawab"> Teman-teman bisa menghubungi kami melalui tanyaadmin@sekolahkoding.com </div> <div class="faq_tanya">Tim Sekolah Koding</div> <div class="faq_jawab"> <div class="tim_sk"> <a href="https://twitter.com/hilmanrdn"><img src="../sekolahkoding.com/img/tim/hilman.png" alt="foto tim sekolah koding hilman ramadhan" /> <p>Hilman Ramadhan</p></a> </div> <div class="tim_sk"> <a href="https://twitter.com/yoggifirmanda"><img src="../sekolahkoding.com/img/tim/pic.jpg" alt="foto tim sekolah koding yoggi firmanda" /> <p>Yoggi Firmanda</p></a> </div> </div> </div> <div class="clear_h"></div> <div id="footer"> <span style="padding-left:10px;">&copy; 2016 <span>SekolahKoding</span></span> <div id="soc-med-menu"> <a target="_blank" href="https://twitter.com/sekolahkoding"><img src="../sekolahkoding.com/img/twitter.png" alt="logo twitter sekolah koding" /></a> <a target="_blank" href="https://youtube.com/SekolahKoding"><img src="../sekolahkoding.com/img/utube.png" alt="logo youtube sekolah koding" /></a> <a target="_blank" href="https://www.facebook.com/sekolahkoding"><img src="../sekolahkoding.com/img/fb.png" alt="logo facebook sekolah koding" /></a> </div> <div id="footer_extra_menu"> <a href="blog/index.html">Blog</a> <a href="tentang.html">Tentang</a> <a href="syarat.html">Syarat</a> </div> </div> </div> <!-- end main wrapper --> <div class="clear"></div> </div> <!-- end page wrapper --> </body> <!-- Mirrored from www.sekolahkoding.com/tentang by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 18 Mar 2016 10:13:17 GMT --> </html>
45.298851
173
0.674829
0bcec29a46d72a949ec4e1aa62d76e56c184b28b
2,636
js
JavaScript
demo.js
shaojiepeng/layui-treetable
57a9a423f7706cf3750431f1549cb78f96268c28
[ "MIT" ]
31
2018-05-29T02:14:04.000Z
2022-01-24T01:55:46.000Z
demo.js
shaojiepeng/layui-treetable
57a9a423f7706cf3750431f1549cb78f96268c28
[ "MIT" ]
3
2018-05-07T12:40:51.000Z
2019-08-06T11:39:25.000Z
demo.js
shaojiepeng/layui-treetable
57a9a423f7706cf3750431f1549cb78f96268c28
[ "MIT" ]
23
2018-06-07T01:09:44.000Z
2021-09-17T14:45:06.000Z
function showTips1() { layer.tips('展开所有节点', '#expand', { tips: [1, '#3595CC'], time: 3000 }) } function showTips2() { layer.tips('收起所有节点', '#collapse', { tips: [1, '#3595CC'], time: 3000 }) } function showTips3() { layer.tips('获取checkbox选中的节点信息', '#selected', { tips: [1, '#3595CC'], time: 3000 }) } function showTips4() { layer.tips('添加根节点-父节点4,父节点4中带有子节点', '#addNode2', { tips: [1, '#3595CC'], time: 3000 }) } function showTips5() { layer.tips('在父节点2下添加子节点22,子节点22中带有子节点', '#addNode', { tips: [1, '#3595CC'], time: 3000 }) } function showTips6() { layer.tips('修改父节点3的名字', '#editNode', { tips: [1, '#3595CC'], time: 3000 }) } function showTips7() { layer.tips('删除父节点2,所有子节点一起删除', '#removeNode', { tips: [1, '#3595CC'], time: 3000 }) } function showTips8() { layer.tips('获取所有节点的信息', '#all', { tips: [1, '#3595CC'], time: 3000 }) } function showTips9() { layer.tips('获取父节点2的信息', '#getNode', { tips: [1, '#3595CC'], time: 3000 }) } function showTips10() { layer.tips('销毁treetable', '#destory', { tips: [1, '#3595CC'], time: 3000 }) } function showTips11() { layer.tips('展开指定节点:父节点2', '#expandNode', { tips: [1, '#3595CC'], time: 3000 }) } function showTips12() { layer.tips('折叠指定节点:父节点2', '#collapseNode', { tips: [1, '#3595CC'], time: 3000 }) } function showTips13() { layer.tips('勾选 单个节点:父节点1。', '#checkNode', { tips: [1, '#3595CC'], time: 3000 }) } function showTips14() { layer.tips('取消勾选 单个节点:父节点1。', '#uncheckNode', { tips: [2, '#3595CC'], time: 3000 }) } function showTips15() { layer.tips('禁用父节点1的checkbox', '#disableNode', { tips: [2, '#3595CC'], time: 3000 }) } function showTips16() { layer.tips('解禁父节点1的checkbox', '#ableNode', { tips: [2, '#3595CC'], time: 3000 }) } function showTips17() { layer.tips('获取所有未选中节点的信息', '#unSelected', { tips: [2, '#3595CC'], time: 3000 }) } function showTips18() { layer.tips('勾选全部节点', '#checkAllNode', { tips: [2, '#3595CC'], time: 3000 }) } function showTips19() { layer.tips('取消勾选全部节点', '#unCheckAllNode', { tips: [2, '#3595CC'], time: 3000 }) } function showTips20() { layer.tips('根据节点数据的属性搜索,获取条件完全匹配的节点数据 JSON 对象,查找name=父节点1的节点', '#getNodeByParam', { tips: [2, '#3595CC'], time: 4000 }) }
18.828571
87
0.515933
918fe216b5b84ea2f93e7abc9aa552651a3e8bdc
832
html
HTML
_includes/call-to-action.html
inUtil-info/inutil-info.github.io
37570d9e173e740dc8fa417609038f191b245fb9
[ "Apache-2.0" ]
null
null
null
_includes/call-to-action.html
inUtil-info/inutil-info.github.io
37570d9e173e740dc8fa417609038f191b245fb9
[ "Apache-2.0" ]
null
null
null
_includes/call-to-action.html
inUtil-info/inutil-info.github.io
37570d9e173e740dc8fa417609038f191b245fb9
[ "Apache-2.0" ]
null
null
null
<section class="bg-primary" id="about"> <div class="container"> <div class="row"> <div class="col-lg-8 col-lg-offset-2 text-center"> <h2 class="section-heading">Creamos cosas que nos resultan útiles.</h2> <hr class="light"> <p class="text-faded">Todos nuestros diseños y servicios están pensados para que nos resulten útiles a nosotros mismos. Pero estamos encantados de escuchar sugerencias, y tambien dispuestos a construirlas si resuelven tus necesidades. Las crearemos a medida para ti sin ningún coste, siempre y cuando aceptes que el resto de nuestros usuarios las puedan usar, también sin coste.</p> <a href="#" class="btn btn-default btn-xl">Mandanos tu idea "Open Source"...</a> </div> </div> </div> </section>
64
398
0.649038
805c818f7ebac030eb054fe4f8a87da6669f507e
384
asm
Assembly
programs/oeis/006/A006062.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/006/A006062.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/006/A006062.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A006062: Star-hex numbers. ; 1,37,1261,42841,1455337,49438621,1679457781,57052125937,1938092824081,65838103892821,2236557439531837,75977114840189641,2580985347126915961,87677524687474953037,2978454854027021487301,101179787512231255615201 seq $0,2315 ; NSW numbers: a(n) = 6*a(n-1) - a(n-2); also a(n)^2 - 2*b(n)^2 = -1 with b(n)=A001653(n+1). pow $0,2 div $0,48 mul $0,36 add $0,1
42.666667
210
0.755208
aa2eae9b82b5e83acb382320303c4da1ccc3bd6a
1,529
swift
Swift
AssistMobileTest/AssistMobileTest/CustomerSettingsViewController.swift
serge-star/assist-mcommerce-sdk-ios
6e23a75d713f7c72ef189640a2e5ce9802ec3c24
[ "Apache-2.0" ]
null
null
null
AssistMobileTest/AssistMobileTest/CustomerSettingsViewController.swift
serge-star/assist-mcommerce-sdk-ios
6e23a75d713f7c72ef189640a2e5ce9802ec3c24
[ "Apache-2.0" ]
7
2016-11-18T16:32:50.000Z
2019-04-04T13:54:25.000Z
AssistMobileTest/AssistMobileTest/CustomerSettingsViewController.swift
serge-star/assist-mcommerce-sdk-ios
6e23a75d713f7c72ef189640a2e5ce9802ec3c24
[ "Apache-2.0" ]
5
2017-07-18T07:16:10.000Z
2019-06-20T17:03:40.000Z
// // CustomerSettingsViewController.swift // AssistPayTest // // Created by Sergey Kulikov on 07.08.15. // Copyright (c) 2015 Assist. All rights reserved. // import UIKit class CustomerSettingsViewController: UIViewController { @IBOutlet weak var lastname: UITextField! { didSet { lastname.text = Settings.lastname ?? "" } } @IBOutlet weak var firstname: UITextField! { didSet { firstname.text = Settings.firstname ?? "" } } @IBOutlet weak var middlename: UITextField! { didSet { middlename.text = Settings.middlename ?? "" } } @IBOutlet weak var email: UITextField! { didSet { email.text = Settings.email ?? "" } } @IBOutlet weak var mobilePhone: UITextField! { didSet { mobilePhone.text = Settings.mobilePhone ?? "" } } @IBAction func close(_ sender: UIButton) { Settings.lastname = lastname.text Settings.firstname = firstname.text Settings.middlename = middlename.text Settings.email = email.text Settings.mobilePhone = mobilePhone.text dismiss(animated: true, completion: nil) } func textFieldShouldReturn(_ textField: UITextField) -> Bool { textField.resignFirstResponder() return false } override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { view.endEditing(true) } }
24.66129
79
0.589928
5db044d57a4baa9d9ce4c4c9ee58760b8f1e150b
928
go
Go
storage/null/easyjson.go
corestoreio/cspkg
ba02e2933c41080e3863fb6a8d0eb87f09cf2cd7
[ "Apache-2.0" ]
98
2015-03-28T07:38:31.000Z
2017-11-07T16:35:18.000Z
storage/null/easyjson.go
corestoreio/cspkg
ba02e2933c41080e3863fb6a8d0eb87f09cf2cd7
[ "Apache-2.0" ]
10
2015-05-13T23:02:03.000Z
2017-08-16T06:24:52.000Z
storage/null/easyjson.go
corestoreio/cspkg
ba02e2933c41080e3863fb6a8d0eb87f09cf2cd7
[ "Apache-2.0" ]
20
2015-05-27T06:38:46.000Z
2017-06-29T08:13:45.000Z
// +build easyjson // TODO easyjson does not yet respect build tags to be included when parsing // files to generate the code. yet there is a PR which refactores easyjson // parser to go/types. git@github.com:frioux/easyjson.git package null import ( "github.com/mailru/easyjson/jlexer" "github.com/mailru/easyjson/jwriter" ) // 1. TODO add all other types // 2. TODO use the athlete struct and run a benchmark comparison between easyjson, stdlib and json-iterator // 3. TODO fuzzy testing gofuzz func (a String) MarshalEasyJSON(w *jwriter.Writer) { if !a.Valid { w.Raw(nil, nil) return } w.String(a.Data) } func (a *String) UnmarshalEasyJSON(l *jlexer.Lexer) { if l.IsNull() { a.Valid = false a.Data = "" return } a.Valid = true a.Data = l.String() } // IsDefined implements easyjson.Optional interface, same as function IsZero of // this type. func (a String) IsDefined() bool { return a.Valid }
22.095238
107
0.712284
f3e960aa11233931c78be202d5176aa8b30c6e57
1,289
kt
Kotlin
AdvancedMapKotlin/app/src/main/java/com/carto/advanced/kotlin/components/popupcontent/citypopupcontent/CityCell.kt
rexfordnyrk/carto-mobile-android-samples
6cc7d53ddfe8c2b482b84491f8500f9d3c3b4769
[ "BSD-3-Clause" ]
32
2016-08-04T07:49:57.000Z
2021-08-24T08:36:18.000Z
AdvancedMapKotlin/app/src/main/java/com/carto/advanced/kotlin/components/popupcontent/citypopupcontent/CityCell.kt
rexfordnyrk/carto-mobile-android-samples
6cc7d53ddfe8c2b482b84491f8500f9d3c3b4769
[ "BSD-3-Clause" ]
12
2016-08-25T15:32:05.000Z
2022-01-03T15:06:37.000Z
AdvancedMapKotlin/app/src/main/java/com/carto/advanced/kotlin/components/popupcontent/citypopupcontent/CityCell.kt
rexfordnyrk/carto-mobile-android-samples
6cc7d53ddfe8c2b482b84491f8500f9d3c3b4769
[ "BSD-3-Clause" ]
20
2016-12-15T16:46:59.000Z
2022-02-07T09:56:59.000Z
package com.carto.advanced.kotlin.components.popupcontent.citypopupcontent import android.content.Context import android.graphics.Typeface import android.view.Gravity import android.widget.TextView import com.carto.advanced.kotlin.model.City import com.carto.advanced.kotlin.sections.base.views.BaseView import com.carto.advanced.kotlin.sections.base.utils.setFrame import com.carto.advanced.kotlin.utils.Colors /** * Created by aareundo on 13/07/2017. */ class CityCell(context: Context) : BaseView(context) { val label = TextView(context) var item: City? = null init { label.textSize = 15.0f label.gravity = Gravity.CENTER_VERTICAL label.typeface = Typeface.DEFAULT_BOLD addView(label) } val leftPadding = (15 * context.resources.displayMetrics.density).toInt() override fun layoutSubviews() { label.setFrame(leftPadding, 0, frame.width - leftPadding, frame.height) } fun update(city: City) { this.item = city val text = city.name.toUpperCase() if (city.existsLocally) { label.setTextColor(Colors.appleBlue) label.text = "$text (${city.size} MB)" } else { label.setTextColor(Colors.navy) label.text = text } } }
27.425532
79
0.679597
156e53779c802511e1b8d22ee0bbf2f21c87c636
193
rb
Ruby
lib/performance/metrics.rb
alphagov/govwifi-post-auth-api
0e72482bd8c4854612111564e11a4f6579ed7f65
[ "MIT" ]
null
null
null
lib/performance/metrics.rb
alphagov/govwifi-post-auth-api
0e72482bd8c4854612111564e11a4f6579ed7f65
[ "MIT" ]
222
2018-07-16T10:21:43.000Z
2022-03-10T03:13:22.000Z
lib/performance/metrics.rb
alphagov/govwifi-post-auth-api
0e72482bd8c4854612111564e11a4f6579ed7f65
[ "MIT" ]
5
2019-08-29T13:58:32.000Z
2021-04-10T19:11:33.000Z
module Performance module Metrics ELASTICSEARCH_INDEX = "govwifi-metrics".freeze PERIODS = { daily: "day", weekly: "week", monthly: "month", }.freeze end end
16.083333
50
0.611399
729aee0868d81c78ac05a07f1383441cf6c2b49b
3,616
rs
Rust
src/cache/cache_op_executors.rs
caosbad/safe-client-gateway
e10a4856c1dd718aa49a3185965c8bee64013f8c
[ "MIT" ]
null
null
null
src/cache/cache_op_executors.rs
caosbad/safe-client-gateway
e10a4856c1dd718aa49a3185965c8bee64013f8c
[ "MIT" ]
null
null
null
src/cache/cache_op_executors.rs
caosbad/safe-client-gateway
e10a4856c1dd718aa49a3185965c8bee64013f8c
[ "MIT" ]
null
null
null
use crate::cache::cache_operations::{CacheResponse, InvalidationPattern, RequestCached}; use crate::cache::inner_cache::CachedWithCode; use crate::cache::Cache; use crate::providers::info::TOKENS_KEY; use crate::utils::errors::{ApiError, ApiResult}; use rocket::response::content; use serde::Serialize; use std::time::Duration; const CACHE_REQS_PREFIX: &'static str = "c_reqs"; const CACHE_RESP_PREFIX: &'static str = "c_resp"; const CACHE_REQS_RESP_PREFIX: &'static str = "c_re"; pub(super) fn invalidate(cache: &impl Cache, pattern: &InvalidationPattern) { let pattern_str = match pattern { InvalidationPattern::FlushAll => String::from("*"), InvalidationPattern::RequestsResponses(value) => { format!("{}*{}*", CACHE_REQS_RESP_PREFIX, &value) } InvalidationPattern::Tokens => String::from(TOKENS_KEY), }; cache.invalidate_pattern(pattern_str.as_str()); } pub(super) async fn cache_response<S>( cache: &impl Cache, cache_response: &CacheResponse<'_, S>, ) -> ApiResult<content::Json<String>> where S: Serialize, { let cache_key = format!("{}_{}", CACHE_RESP_PREFIX, cache_response.key); let cached = cache.fetch(&cache_key); match cached { Some(value) => Ok(content::Json(value)), None => { let resp_string = serde_json::to_string(&cache_response.generate().await?)?; cache.create(&cache_key, &resp_string, cache_response.duration); Ok(content::Json(resp_string)) } } } pub(super) async fn request_cached( cache: &impl Cache, client: &reqwest::Client, operation: &RequestCached, ) -> ApiResult<String> { let cache_key = format!("{}_{}", CACHE_REQS_PREFIX, &operation.url); match cache.fetch(&cache_key) { Some(cached) => CachedWithCode::split(&cached).to_result(), None => { let request = client .get(&operation.url) .timeout(Duration::from_millis(operation.request_timeout)); let response = (request.send().await).map_err(|err| { if operation.cache_all_errors { cache.create( &cache_key, &CachedWithCode::join(500, &format!("{:?}", &err)), operation.error_cache_duration, ); } err })?; let status_code = response.status().as_u16(); // Early return and no caching if the error is a 500 or greater let is_server_error = response.status().is_server_error(); if !operation.cache_all_errors && is_server_error { return Err(ApiError::from_backend_error( status_code, &format!("Got server error for {}", response.text().await?), )); } let is_client_error = response.status().is_client_error(); let raw_data = response.text().await?; if is_client_error || is_server_error { cache.create( &cache_key, &CachedWithCode::join(status_code, &raw_data), operation.error_cache_duration, ); Err(ApiError::from_backend_error(status_code, &raw_data)) } else { cache.create( &cache_key, &CachedWithCode::join(status_code, &raw_data), operation.cache_duration, ); Ok(raw_data.to_string()) } } } }
36.16
88
0.573285
4f09a5e102f45669000c659a861be9a0eac822a0
10,559
lua
Lua
simplegangs_1.1/lua/simplegangs/cl_init.lua
RW128k/SimpleGangs
ef7c1c5fbde899c80d95c5e6bfa144b0a9f44fdd
[ "MIT" ]
3
2021-10-19T22:21:52.000Z
2022-03-22T17:17:18.000Z
simplegangs_1.1/lua/simplegangs/cl_init.lua
RW128k/SimpleGangs
ef7c1c5fbde899c80d95c5e6bfa144b0a9f44fdd
[ "MIT" ]
null
null
null
simplegangs_1.1/lua/simplegangs/cl_init.lua
RW128k/SimpleGangs
ef7c1c5fbde899c80d95c5e6bfa144b0a9f44fdd
[ "MIT" ]
null
null
null
--[[ SimpleGangs 1.1 Clientside init file loaded at client startup. Defines some miscellaneous functions, hooks and other datatypes such as cached colors and materials. There are no user editable settings located in this file. You should follow the configuration guide within the Owners Manual PDF included with your download. Should you wish to edit this file and require advice or assistance, feel free to contact me using the details provided in the Owners Manual. © RW128k 2021 --]] SimpleGangs = SimpleGangs or {} MsgC(Color(0, 255, 255), "[SimpleGangs] ", Color(253, 185, 19), "Loading SimpleGangs Version 1.1\n") local fontFace = "coolvetica" -- Setup fonts to be used in UI and HUD -- Window titles surface.CreateFont("sg_uifontXL", { font = fontFace, weight = 0, outline = true, size = 50 }) -- Inspect menu target name surface.CreateFont("sg_uifontL", { font = fontFace, weight = 0, outline = true, size = 40 }) -- Main labels surface.CreateFont("sg_uifontM", { font = fontFace, weight = 0, outline = true, size = 30 }) -- Small labels surface.CreateFont("sg_uifontS", { font = fontFace, weight = 0, outline = true, size = 20 }) -- Button titles surface.CreateFont("sg_uifontButton", { font = fontFace, weight = 0, size = 25 }) -- HUD title surface.CreateFont("sg_hudheadfont", { font = fontFace, extended = false, weight = 0, outline = true, size = 25 }) -- Setup local table for storing members of current gang, bank balance and invites SimpleGangs.orgs = { bank = "0", invites = {}, all = {} } -- Cache materials to be used in UI and HUD SimpleGangs.user = Material("simplegangs/player_icon.png") SimpleGangs.hp = Material("simplegangs/hp_icon.png") SimpleGangs.armor = Material("simplegangs/armor_icon.png") SimpleGangs.job = Material("simplegangs/job_icon.png") -- Cache colors to be used in UI and HUD SimpleGangs.color_gold = Color(253, 185, 19, 255) SimpleGangs.color_health = Color(255, 0, 42, 255) SimpleGangs.color_armor = Color(49, 95, 244, 255) SimpleGangs.color_guap = Color(15, 206, 78, 255) function SimpleGangs:getTimeAgo(epoch) -- Function which simply returns a human readable -- string of how much time has passed since a -- given unix time. -- Accepts 1 parameter, epoch, the unix timestamp -- as a number to calculate the time difference of. -- Splits time into seconds, minutes, hours or -- days by converting from seconds and rounding. local timeInt = os.time() - epoch local timeStr if timeInt < 60 then if timeInt == 1 then timeStr = "1 Second" else timeStr = timeInt .. " Seconds" end elseif timeInt < 3600 then if math.floor(timeInt / 60) == 1 then timeStr = "1 Minute" else timeStr = math.floor(timeInt / 60) .. " Minutes" end elseif timeInt < 86400 then if math.floor(timeInt / 3600) == 1 then timeStr = "1 Hour" else timeStr = math.floor(timeInt / 3600) .. " Hours" end else if math.floor(timeInt / 86400) == 1 then timeStr = "1 Day" else timeStr = math.floor(timeInt / 86400) .. " Days" end end return timeStr end function SimpleGangs:formatBank(unformatted) -- Modified version of the DarkRP.formatMoney -- function which accepts a string instead of -- a number and does not add a currency symbol. -- Accepts 1 parameter, unformatted, the money -- value as a string to format. -- Inserts commas into the string and correctly -- formats decimal places. Used in the main -- menu and bank menu for formatting gang bank -- balances, as they are stored as strings. if tonumber(unformatted) < 1e14 then local dp = string.find(unformatted, "%.") or #unformatted + 1 for i = dp - 4, 1, -3 do unformatted = unformatted:sub(1, i) .. "," .. unformatted:sub(i + 1) end if unformatted[#unformatted - 1] == "." then unformatted = unformatted .. "0" end end return unformatted end function SimpleGangs:sepOnline() -- Function which simply returns two tables, -- seperating online and offline members of -- the client's gang. -- Accepts no parameters. -- Iterates over all members of the client's -- gang, adding them to either the online or -- offline table based on whether a player -- can be found matching their Steam ID. local onlineTbl = {} local offlineTbl = {} for id, data in pairs(self.orgs["all"]) do if !player.GetBySteamID64(id) then offlineTbl[tostring(id)] = data else onlineTbl[tostring(id)] = data end end return onlineTbl, offlineTbl end function SimpleGangs:checkAdmin(ply) -- Function which simply checks if a provided -- player is in the admin pool specified in -- the configuration file. -- Accepts 1 parameter, ply, the player object -- of which to check admin status of. -- Iterates over all rank names in the admin -- pool and returns true if the supplied player -- has the rank. If no ranks match, false is -- returned. for _, rank in ipairs(self.AdminRanks) do if ply:GetUserGroup() == rank then return true end end return false end function SimpleGangs:viewProfile(id) -- Function which creates a simple window with -- a derma HTML panel to display steam profiles. -- Accepts 1 parameter, id, a 64 bit Steam ID -- of a player whose profile to open. -- Creates all the user interface components -- and sets the HTML panel's address to the -- Steam community page for the given ID. -- Get text sizes surface.SetFont("sg_uifontM") local loadingW, loadingH = surface.GetTextSize("Loading Page...") -- Main frame local Frame = vgui.Create("DFrame") Frame:SetSize(ScrW() >= 1020 and 1000 or ScrW() - 20, ScrH() >= 720 and 700 or ScrH() - 20) Frame:Center() Frame:SetTitle("User Profile") Frame:SetVisible(true) Frame:SetDraggable(true) Frame:ShowCloseButton(true) Frame:MakePopup() Frame.Paint = function(pnl, w, h) draw.RoundedBox(2, 0, 0, w, h, self.UIBackgroundColor) end Frame.OnScreenSizeChanged = function(pnl, oldScrW, oldScrH) pnl.OnClose = function() end pnl:Close() end -- Loading text (behind HTML panel) local loading = vgui.Create("DLabel", Frame) loading:SetPos((Frame:GetWide() - loadingW) / 2, (Frame:GetTall() - loadingH) / 2) loading:SetFont("sg_uifontM") loading:SetText("Loading Page...") loading:SetWrap(false) loading:SizeToContents() -- HTML panel displaying the webpage local html = vgui.Create("DHTML", Frame) html:Dock(FILL) html:OpenURL("https://steamcommunity.com/profiles/" .. id) end hook.Add("Think", "orgFirstRun", function() -- Gamemode think hook called once when client -- has completed login and is ready to -- dispatch and receive net messages, then is -- removed. -- Used instead of initialize hook as net -- messages do not work properly when game is -- still starting. -- First checks if the game is running in -- single player mode and warns the user then -- makes the inital requests for all necessary -- data (members, invites, HUD prefs, bank -- balance) and finally removes the hook. if game.SinglePlayer() then local singleplayerWarn = Derma_Message("Unfortunately, this addon does not support single player mode. Please recreate your game selecting 2 or more players, or upload this addon to a dedicated server.\nThank you for using SimpleGangs.", "SimpleGangs", "OK") singleplayerWarn.Paint = function(pnl, w, h) draw.RoundedBox(2, 0, 0, w, h, SimpleGangs.UIBackgroundColor) end end net.Start("sg_requestOrgs") net.SendToServer() net.Start("sg_requestInvites") net.SendToServer() net.Start("sg_requestHud") net.SendToServer() net.Start("sg_requestBank") net.SendToServer() hook.Remove("Think", "orgFirstRun") end) hook.Add("OnPlayerChat", "orgCommand", function(ply, msg, isTeam, isDead) -- Player chat hook used to register chat -- commands. -- Checks if a message contains the command -- for the main menu, admin menu or -- leaderboard, and if their respective menus -- have chat command invocation enabled, then -- calls their function if the client was -- the player who dispatched the message and -- suppress it from showing in the chat feed. msg = string.lower(msg) if (string.StartWith(msg, string.lower(SimpleGangs.MenuCommand) .. " ") or msg == string.lower(SimpleGangs.MenuCommand)) and SimpleGangs.EnableCommand then -- Main menu if ply == LocalPlayer() then SimpleGangs:orgMenu() end return true elseif (string.StartWith(msg, string.lower(SimpleGangs.AdminCommand) .. " ") or msg == string.lower(SimpleGangs.AdminCommand)) and SimpleGangs.EnableAdmin then -- Admin Menu if ply == LocalPlayer() then SimpleGangs:adminMenu() end return true elseif (string.StartWith(msg, string.lower(SimpleGangs.LeaderboardCommand) .. " ") or msg == string.lower(SimpleGangs.LeaderboardCommand)) and DarkRP != nil and SimpleGangs.EnableLeaderboard then -- Leaderboard if ply == LocalPlayer() then SimpleGangs:leaderboardMenu() end return true end end) hook.Add("PlayerButtonDown", "orgKeyboard", function(ply, button) -- Player keyboard button press hook used to -- register hotkeys. -- Checks if the pressed key matches the one -- specified in the configuration for the main -- menu and if keyboard button invocation is -- enabled, then calls the main menu if the -- client was the player who pressed the button. if input.IsKeyDown(SimpleGangs.MenuKey) and SimpleGangs.EnableKey then if ply == LocalPlayer() then SimpleGangs:orgMenu() end end end) net.Receive("sg_orgNotify", function() -- Function to handle an incoming notification -- from the server. -- Accepts a string containing the message -- contents. -- Adds the message to the screen for 7 seconds -- and plays the default notification 'tick' -- sound effect. local msg = net.ReadString() notification.AddLegacy(msg, 0, 7) surface.PlaySound("buttons/button15.wav") end) net.Receive("sg_orgChat", function() -- Function to handle an incoming gang chat -- message from the server. -- Accepts a table containing strings and -- colors to be displayed. -- Unpacks and concatenates the provided -- table into the chat feed, formatted -- with the correct colors. local msg = net.ReadTable() chat.AddText(unpack(msg)) end)
30.341954
261
0.691259
6b56621f5e572e20ad2cfe2364962bf2d71d6abc
2,801
c
C
1995/dodsond1.c
lifthrasiir/winner
091f613bd56aeeeb99a07e4b29b316211f8d425c
[ "CC0-1.0" ]
287
2020-12-30T07:54:24.000Z
2022-03-24T15:53:24.000Z
1995/dodsond1.c
lifthrasiir/winner
091f613bd56aeeeb99a07e4b29b316211f8d425c
[ "CC0-1.0" ]
16
2021-01-05T18:00:03.000Z
2022-02-22T03:27:10.000Z
1995/dodsond1.c
lifthrasiir/winner
091f613bd56aeeeb99a07e4b29b316211f8d425c
[ "CC0-1.0" ]
27
2021-01-05T09:50:00.000Z
2022-02-27T12:44:50.000Z
#define X #define XX #define XXX #define XXXX #define XXXXX #define XXXXXX #define XXXXXXX #define orfa for #define XXXXXXXXX #define archa char #define ainma main #define etcharga getchar #define utcharpa putchar X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X XX X X XX X X XXX X XXXXXXXXX X XXX X X XXX X XXXX XXXX X XXX X X XXXX X XX ainma(){ archa XX X XXXX X X XXXX X oink[9],*igpa, X XXXX X X XXXXXX atinla=etcharga(),iocccwa XXXXXX X X XXXX ,apca='A',owla='a',umna=26 XXXX X X XXX ; orfa(; (atinla+1)&&(!((( XXX X X XX atinla-apca)*(apca+umna-atinla) XX X X X >=0)+((atinla-owla)*(owla+umna- X X X atinla)>=0))); utcharpa(atinla), X X X atinla=etcharga()); orfa(; atinla+1; X X X X ){ orfa( igpa=oink ,iocccwa=( X X X X (atinla- XXX apca)*( XXX apca+umna- X X X atinla)>=0) XXX XXX ; (((( X X atinla-apca XXXXX XXXXXXX XXXXX )*(apca+ X X umna-atinla XXXXXX )>=0) XXXXXX +((atinla- X X owla)*(owla+ XXXX umna- XXXX atinla)>=0)) X X &&"-Pig-" XX "Lat-in" XX "COb-fus" X X "ca-tion!!"[ X (((atinla- X apca)*(apca+ X X umna-atinla) X >=0)?atinla- X apca+owla: X X atinla)-owla X ]-'-')||((igpa== X oink)&&!(*( X X igpa++)='w') X )||! X (*( X igpa X ++)=owla); * X X (igpa++)=(( X ( XXX XXX X atinla-apca X X )*(apca+ X umna XXX - XXX X atinla)>=0) X X ?atinla- X apca XXX + XXX owla X :atinla), X X atinla= X X X X etcharga()) X X ; orfa( X atinla=iocccwa?(( X (atinla- X X owla)*(owla+ X umna-atinla)>=0 X )?atinla- X X owla+apca: X atinla): X atinla; ((( X X atinla-apca)* X (apca+umna- X atinla)>=0)+( X X (atinla-owla)* X (owla+ X umna-atinla)>= X X 0)); utcharpa( XX XX atinla),atinla X X =etcharga()); XXXXXXX orfa(*igpa=0, X X igpa=oink; * igpa; utcharpa( X X *(igpa++))); orfa(; (atinla+1)&&(!((( X X atinla-apca )*(apca+ X X umna- XXXXX XXXXX atinla)>=0 X X )+(( XXXXX atinla- X XX owla)*( owla+umna- XX XX atinla)>=0))); utcharpa XX XX (atinla),atinla= XX XX etcharga()); } XX XXXX } XXXX XXXXXXXXX
41.191176
51
0.432703
260ec8bf8c6af5a7b00c04fe003f8267fd669101
306
java
Java
repository-first-version/src/main/java/it/mcella/jcr/oak/upgrade/repository/firstversion/node/root/OakRootNodeFactory.java
sitMCella/Jackrabbit-Oak-repository-upgrade
056b6885a0d07df615acdac471d5cf30eb1d7036
[ "MIT" ]
null
null
null
repository-first-version/src/main/java/it/mcella/jcr/oak/upgrade/repository/firstversion/node/root/OakRootNodeFactory.java
sitMCella/Jackrabbit-Oak-repository-upgrade
056b6885a0d07df615acdac471d5cf30eb1d7036
[ "MIT" ]
null
null
null
repository-first-version/src/main/java/it/mcella/jcr/oak/upgrade/repository/firstversion/node/root/OakRootNodeFactory.java
sitMCella/Jackrabbit-Oak-repository-upgrade
056b6885a0d07df615acdac471d5cf30eb1d7036
[ "MIT" ]
null
null
null
package it.mcella.jcr.oak.upgrade.repository.firstversion.node.root; import it.mcella.jcr.oak.upgrade.repository.JcrNode; public class OakRootNodeFactory implements JcrRootNodeFactory { @Override public JcrRootNode createFrom(JcrNode jcrNode) { return new OakRootNode(jcrNode); } }
23.538462
68
0.767974
650ab0f46dda1e9c953f58c0e88233c1aedea04d
8,825
py
Python
harvester/sharekit/extraction.py
nppo/search-portal
aedf21e334f178c049f9d6cf37cafd6efc07bc0d
[ "MIT" ]
1
2022-01-10T00:26:12.000Z
2022-01-10T00:26:12.000Z
harvester/sharekit/extraction.py
nppo/search-portal
aedf21e334f178c049f9d6cf37cafd6efc07bc0d
[ "MIT" ]
48
2021-11-11T13:43:09.000Z
2022-03-30T11:33:37.000Z
harvester/sharekit/extraction.py
nppo/search-portal
aedf21e334f178c049f9d6cf37cafd6efc07bc0d
[ "MIT" ]
null
null
null
import re from mimetypes import guess_type from django.conf import settings from datagrowth.processors import ExtractProcessor from datagrowth.utils import reach from core.constants import HIGHER_EDUCATION_LEVELS, RESTRICTED_MATERIAL_SETS class SharekitMetadataExtraction(ExtractProcessor): youtube_regex = re.compile(r".*(youtube\.com|youtu\.be).*", re.IGNORECASE) @classmethod def get_record_state(cls, node): return node.get("meta", {}).get("status", "active") ############################# # GENERIC ############################# @classmethod def get_files(cls, node): files = node["attributes"].get("files", []) or [] links = node["attributes"].get("links", []) or [] output = [ { "mime_type": file["resourceMimeType"], "url": file["url"], "title": file["fileName"] } for file in files if file["resourceMimeType"] and file["url"] ] output += [ { "mime_type": "text/html", "url": link["url"], "title": link.get("urlName", None) or f"URL {ix+1}" } for ix, link in enumerate(links) ] return output @classmethod def get_url(cls, node): files = cls.get_files(node) if not files: return return files[0]["url"].strip() @classmethod def get_mime_type(cls, node): files = cls.get_files(node) if not files: return return files[0]["mime_type"] @classmethod def get_technical_type(cls, node): technical_type = node["attributes"].get("technicalFormat", None) if technical_type: return technical_type files = cls.get_files(node) if not files: return technical_type = settings.MIME_TYPE_TO_TECHNICAL_TYPE.get(files[0]["mime_type"], None) if technical_type: return technical_type file_url = files[0]["url"] if not file_url: return mime_type, encoding = guess_type(file_url) return settings.MIME_TYPE_TO_TECHNICAL_TYPE.get(mime_type, "unknown") @classmethod def get_material_types(cls, node): material_types = node["attributes"].get("typesLearningMaterial", []) if not material_types: return [] elif isinstance(material_types, list): return [material_type for material_type in material_types if material_type] else: return [material_types] @classmethod def get_copyright(cls, node): return node["attributes"].get("termsOfUse", None) @classmethod def get_from_youtube(cls, node): url = cls.get_url(node) if not url: return False return cls.youtube_regex.match(url) is not None @classmethod def get_authors(cls, node): authors = node["attributes"].get("authors", []) or [] return [ { "name": author["person"]["name"], "email": author["person"]["email"] } for author in authors ] @classmethod def get_publishers(cls, node): publishers = node["attributes"].get("publishers", []) or [] if isinstance(publishers, str): publishers = [publishers] keywords = node["attributes"].get("keywords", []) or [] # Check HBOVPK tags hbovpk_keywords = [keyword for keyword in keywords if keyword and "hbovpk" in keyword.lower()] if hbovpk_keywords: publishers.append("HBO Verpleegkunde") return publishers @classmethod def get_lom_educational_levels(cls, node): educational_levels = node["attributes"].get("educationalLevels", []) if not educational_levels: return [] return list(set([ educational_level["value"] for educational_level in educational_levels if educational_level["value"] ])) @classmethod def get_lowest_educational_level(cls, node): educational_levels = cls.get_lom_educational_levels(node) current_numeric_level = 3 if len(educational_levels) else -1 for education_level in educational_levels: for higher_education_level, numeric_level in HIGHER_EDUCATION_LEVELS.items(): if not education_level.startswith(higher_education_level): continue # One of the records education levels matches a higher education level. # We re-assign current level and stop processing this education level, # as it shouldn't match multiple higher education levels current_numeric_level = min(current_numeric_level, numeric_level) break else: # No higher education level found inside current education level. # Dealing with an "other" means a lower education level than we're interested in. # So this record has the lowest possible level. We're done processing this seed. current_numeric_level = 0 break return current_numeric_level @classmethod def get_ideas(cls, node): compound_ideas = [vocabulary["value"] for vocabulary in node["attributes"].get("vocabularies", [])] if not compound_ideas: return [] ideas = [] for compound_idea in compound_ideas: ideas += compound_idea.split(" - ") return list(set(ideas)) @classmethod def get_is_restricted(cls, data): link = data["links"]["self"] for restricted_set in RESTRICTED_MATERIAL_SETS: if restricted_set in link: return True return False @classmethod def get_analysis_allowed(cls, node): # We disallow analysis for non-derivative materials as we'll create derivatives in that process # NB: any material that is_restricted will also have analysis_allowed set to False copyright = SharekitMetadataExtraction.get_copyright(node) return (copyright is not None and "nd" not in copyright) and copyright != "yes" @classmethod def get_is_part_of(cls, node): return reach("$.attributes.partOf", node) @classmethod def get_research_themes(cls, node): theme_value = node["attributes"].get("themesResearchObject", []) if not theme_value: return [] return theme_value if isinstance(theme_value, list) else [theme_value] @classmethod def get_empty_list(cls, node): return [] @classmethod def get_none(cls, node): return None @classmethod def get_learning_material_themes(cls, node): theme_value = node["attributes"].get("themesLearningMaterial", []) if not theme_value: return [] return theme_value if isinstance(theme_value, list) else [theme_value] SHAREKIT_EXTRACTION_OBJECTIVE = { "url": SharekitMetadataExtraction.get_url, "files": SharekitMetadataExtraction.get_files, "title": "$.attributes.title", "language": "$.attributes.language", "keywords": "$.attributes.keywords", "description": "$.attributes.abstract", "mime_type": SharekitMetadataExtraction.get_mime_type, "technical_type": SharekitMetadataExtraction.get_technical_type, "material_types": SharekitMetadataExtraction.get_material_types, "copyright": SharekitMetadataExtraction.get_copyright, "copyright_description": SharekitMetadataExtraction.get_none, "aggregation_level": "$.attributes.aggregationlevel", "authors": SharekitMetadataExtraction.get_authors, "publishers": SharekitMetadataExtraction.get_publishers, "publisher_date": "$.attributes.publishedAt", "lom_educational_levels": SharekitMetadataExtraction.get_lom_educational_levels, "lowest_educational_level": SharekitMetadataExtraction.get_lowest_educational_level, "disciplines": SharekitMetadataExtraction.get_empty_list, "ideas": SharekitMetadataExtraction.get_ideas, "from_youtube": SharekitMetadataExtraction.get_from_youtube, "#is_restricted": SharekitMetadataExtraction.get_is_restricted, "analysis_allowed": SharekitMetadataExtraction.get_analysis_allowed, "is_part_of": SharekitMetadataExtraction.get_is_part_of, "has_parts": "$.attributes.hasParts", "doi": "$.attributes.doi", "research_object_type": "$.attributes.typeResearchObject", "research_themes": SharekitMetadataExtraction.get_research_themes, "parties": SharekitMetadataExtraction.get_empty_list, "learning_material_themes": SharekitMetadataExtraction.get_learning_material_themes, "consortium": "$.attributes.consortium" }
37.394068
107
0.643853
a07ec40f16d5299afce69157dbd19794990797d3
4,080
swift
Swift
MarvelHeroes/Heroes/Controllers/DetailHeroViewController.swift
guumeyer/MarveListHeroes
d16960f2f049bc5706506c13fe92e39f16a0f770
[ "Apache-2.0" ]
null
null
null
MarvelHeroes/Heroes/Controllers/DetailHeroViewController.swift
guumeyer/MarveListHeroes
d16960f2f049bc5706506c13fe92e39f16a0f770
[ "Apache-2.0" ]
null
null
null
MarvelHeroes/Heroes/Controllers/DetailHeroViewController.swift
guumeyer/MarveListHeroes
d16960f2f049bc5706506c13fe92e39f16a0f770
[ "Apache-2.0" ]
null
null
null
// // DetailHeroViewController.swift // MarvelHeros // // Created by gustavo r meyer on 8/13/17. // Copyright © 2017 gustavo r meyer. All rights reserved. // import UIKit class DetailHeroViewController: UIViewController { //MARK: - Attributes var hero:Character? var cells = ["profile", "name", "detail","comics", "events","series"] //MARK: - IBOutlets @IBOutlet weak var heroDetailTableView: UITableView! //MARK: - View life cycle override func viewDidLoad() { super.viewDidLoad() setupView() } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) self.title = hero?.name } func setupView(){ heroDetailTableView.delegate = self heroDetailTableView.dataSource = self heroDetailTableView.tableHeaderView = UIView() heroDetailTableView.tableFooterView = UIView() heroDetailTableView.backgroundColor = UIColor.white heroDetailTableView.separatorColor = UIColor.white heroDetailTableView.allowsSelection = false heroDetailTableView.separatorStyle = .none heroDetailTableView.rowHeight = UITableViewAutomaticDimension heroDetailTableView.estimatedRowHeight = 140 heroDetailTableView.reloadData() } } //MARK: - TableView Delegate and DataSource extension DetailHeroViewController: UITableViewDataSource, UITableViewDelegate{ func getIdentifierByIndex(index:Int) -> String { switch index { case 0: return "profileCell" default: return "detailCell" } } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return self.cells.count } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: getIdentifierByIndex(index: indexPath.row)) let cellName = cells[indexPath.row] switch cellName { case "profile": if let profileCell = cell as? ImageViewTableViewCell { profileCell.thumbnailImageView.image = hero?.image } break case "name": if let nameCell = cell as? DetailTableViewCell { nameCell.titleLabel.text = NSLocalizedString("Name", comment: "") nameCell.nameLabel.text = hero?.name nameCell.nameLabel.sizeToFit() } break case "detail": setupDetailTableViewCell(cell!, titleText: NSLocalizedString("Decription", comment: ""), description: (hero?.description)!) break case "comics": setupDetailTableViewCell(cell!, titleText: NSLocalizedString("AmountComics", comment: ""), description: "\(hero?.comics?.available ?? 0)") break case "events": setupDetailTableViewCell(cell!, titleText: NSLocalizedString("NumberOfParticipationsEvents", comment: ""),description: "\(hero?.events?.available ?? 0)") break case"series": setupDetailTableViewCell(cell!, titleText: NSLocalizedString("NumberOfParticipationsSeries", comment: ""),description: "\(hero?.series?.available ?? 0)") break default: break } return cell! } func setupDetailTableViewCell(_ cell:UITableViewCell, titleText:String, description:String){ if let detailCell = cell as? DetailTableViewCell { detailCell.titleLabel.text = titleText detailCell.nameLabel.text = description detailCell.nameLabel.sizeToFit() } } func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { if indexPath.row == 0 { return 190 } return UITableViewAutomaticDimension } }
31.384615
166
0.618137
eb0ca0d5582a9104a5685b6584fd7f1bf47a1908
45,204
asm
Assembly
Code/CustomControl/RAEdit/Src/Function.asm
CherryDT/FbEditMOD
beb0eb22cae1b8f7203d55bd6b293d8ec88231ca
[ "Unlicense" ]
11
2016-12-03T16:35:42.000Z
2022-03-26T06:02:53.000Z
Code/CustomControl/RAEdit/Src/Function.asm
CherryDT/FbEditMOD
beb0eb22cae1b8f7203d55bd6b293d8ec88231ca
[ "Unlicense" ]
1
2018-02-24T20:17:46.000Z
2018-03-02T08:57:40.000Z
Code/CustomControl/RAEdit/Src/Function.asm
CherryDT/FbEditMOD
beb0eb22cae1b8f7203d55bd6b293d8ec88231ca
[ "Unlicense" ]
4
2018-10-19T01:14:55.000Z
2021-09-11T18:51:48.000Z
.code FindTheText proc uses ebx esi edi,hMem:DWORD,pFind:DWORD,fMC:DWORD,fWW:DWORD,fWhiteSpace:DWORD,cpMin:DWORD,cpMax:DWORD,fDir:DWORD LOCAL nLine:DWORD LOCAL lnlen:DWORD LOCAL lpFind[15]:DWORD LOCAL len[15] :DWORD LOCAL findbuff[512]:BYTE LOCAL nIgnore:DWORD LOCAL prev:DWORD LOCAL cp:DWORD xor esi,esi mov lnlen,esi .while esi<16 mov lpFind[esi*4],0 mov len[esi*4],0 inc esi .endw mov esi,pFind lea edi,findbuff mov lpFind[0],edi xor ecx,ecx xor edx,edx .while byte ptr [esi] && ecx<255 && edx<16 mov al,[esi] mov [edi],al .if al==VK_RETURN inc edi mov byte ptr [edi],0 inc edi inc ecx mov len[edx*4],ecx xor ecx,ecx inc edx mov lpFind[edx*4],edi dec edi dec ecx .endif inc esi inc edi inc ecx .endw mov byte ptr [edi],0 mov len[edx*4],ecx mov ebx,hMem .if fDir==1 ; Down invoke GetCharPtr,ebx,cpMin mov nLine,edx mov ecx,eax sub cpMin,ecx mov edx,cpMin mov eax,-1 .while edx<=cpMax mov nIgnore,0 push nLine xor esi,esi .while len[esi*4] call TstLnDown .break .if eax==-1 inc nLine inc esi xor ecx,ecx .endw pop nLine .break .if eax!=-1 mov edx,lnlen add cpMin,edx mov edx,cpMin inc nLine xor ecx,ecx mov eax,-1 .endw .if eax>cpMax mov eax,-1 .endif .else ; Up mov eax,cpMin mov cp,eax invoke GetCharPtr,ebx,cpMin mov nLine,edx mov ecx,eax mov edx,cpMin mov eax,-1 .while sdword ptr edx>=cpMax mov nIgnore,0 push nLine xor esi,esi .while len[esi*4] call TstLnUp .break .if eax==-1 inc nLine inc esi xor ecx,ecx .endw pop nLine .break .if eax!=-1 && eax<=cp dec nLine mov edi,nLine shl edi,2 mov eax,-1 .break .if edi>=[ebx].EDIT.rpLineFree invoke GetCpFromLine,ebx,nLine mov cpMin,eax add edi,[ebx].EDIT.hLine mov edi,[edi].LINE.rpChars add edi,[ebx].EDIT.hChars mov ecx,[edi].CHARS.len add cpMin,ecx mov edx,cpMin mov eax,-1 .endw .endif mov edx,nIgnore ret TstFind: mov prev,1 push ecx push esi mov esi,lpFind[esi*4] dec esi dec ecx TstFind1: inc esi inc ecx TstFind3: mov al,[esi] or al,al je TstFind2 mov ah,[edi+ecx+sizeof CHARS] .if fWhiteSpace movzx edx,al movzx edx,CharTab[edx] .if (al==VK_SPACE || al==VK_TAB) && (ah==VK_SPACE || ah==VK_TAB) .while (byte ptr [edi+ecx+sizeof CHARS]==VK_SPACE || byte ptr [edi+ecx+sizeof CHARS]==VK_TAB) && ecx<[edi].CHARS.len inc ecx inc nIgnore .endw .while byte ptr [esi]==VK_SPACE || byte ptr [esi]==VK_TAB inc esi dec nIgnore .endw jmp TstFind3 .elseif (ah==VK_SPACE || ah==VK_TAB) && (!ecx || edx!=1 || prev!=1) ;Ignore whitespace .while (byte ptr [edi+ecx+sizeof CHARS]==VK_SPACE || byte ptr [edi+ecx+sizeof CHARS]==VK_TAB) && ecx<[edi].CHARS.len inc ecx inc nIgnore .endw mov prev,edx jmp TstFind3 .endif .endif cmp al,ah je TstFind1 .if !fMC movzx edx,al mov al,CaseTab[edx] cmp al,ah je TstFind1 .endif xor eax,eax dec eax TstFind2: .if fWW && !al .if ecx<=[edi].CHARS.len movzx eax,byte ptr [edi+ecx+sizeof CHARS] lea eax,[eax+offset CharTab] mov al,[eax] .if al==CT_CHAR xor eax,eax dec eax .else xor eax,eax .endif .endif .endif pop esi pop ecx or al,al retn TstLnDown: mov edi,nLine shl edi,2 .if edi<[ebx].EDIT.rpLineFree add edi,[ebx].EDIT.hLine mov edi,[edi].LINE.rpChars add edi,[ebx].EDIT.hChars .if !esi mov eax,[edi].CHARS.len mov lnlen,eax .endif Nxt: mov eax,len[esi*4] add eax,ecx .if eax<=[edi].CHARS.len .if fWW && ecx movzx eax,byte ptr [edi+ecx+sizeof CHARS-1] .if byte ptr CharTab[eax]==CT_CHAR inc ecx jmp Nxt .endif .endif call TstFind je Found .if !esi inc ecx jmp Nxt .endif .endif .else ; EOF .if fDir==1 mov cpMin,-1 mov lnlen,0 .else mov cpMax,-1 mov lnlen,0 .endif .endif mov eax,-1 retn Found: .if !esi add cpMin,ecx sub lnlen,ecx .endif mov eax,cpMin retn TstLnUp: mov edi,nLine shl edi,2 .if edi<[ebx].EDIT.rpLineFree add edi,[ebx].EDIT.hLine mov edi,[edi].LINE.rpChars add edi,[ebx].EDIT.hChars .if !esi mov eax,[edi].CHARS.len mov lnlen,eax sub cpMin,ecx .endif .if !CARRY? NxtUp: .if fWW && ecx movzx eax,byte ptr [edi+ecx+sizeof CHARS-1] .if byte ptr CharTab[eax]==CT_CHAR dec ecx jge NxtUp jmp NotFoundUp .endif .endif call TstFind je FoundUp .if !esi dec ecx jge NxtUp .endif .endif .else ; EOF .if fDir==1 mov cpMin,-1 mov lnlen,0 .else mov cpMax,-1 mov lnlen,0 .endif .endif NotFoundUp: mov eax,-1 retn FoundUp: .if !esi add cpMin,ecx sub lnlen,ecx .endif mov eax,cpMin retn FindTheText endp FindTextEx proc uses ebx esi edi,hMem:DWORD,fFlag:DWORD,lpFindTextEx:DWORD LOCAL lpText:DWORD LOCAL len:DWORD LOCAL fMC:DWORD LOCAL fWW:DWORD mov ebx,hMem mov esi,lpFindTextEx mov eax,[esi].FINDTEXTEX.lpstrText mov lpText,eax invoke strlen,eax .if eax mov len,eax xor eax,eax mov fMC,eax mov fWW,eax test fFlag,FR_WHOLEWORD .if !ZERO? inc fWW .endif test fFlag,FR_MATCHCASE .if !ZERO? inc fMC .endif mov eax,[esi].FINDTEXTEX.chrg.cpMin test fFlag,FR_DOWN .if !ZERO? ;Down xor eax,eax test fFlag,FR_IGNOREWHITESPACE .if !ZERO? inc eax .endif mov ecx,[esi].FINDTEXTEX.chrg.cpMax .if ecx==-1 mov ecx,-2 .endif invoke FindTheText,ebx,lpText,fMC,fWW,eax,[esi].FINDTEXTEX.chrg.cpMin,ecx,1 add len,edx .else ;Up xor eax,eax test fFlag,FR_IGNOREWHITESPACE .if !ZERO? inc eax .endif invoke FindTheText,ebx,lpText,fMC,fWW,eax,[esi].FINDTEXTEX.chrg.cpMin,[esi].FINDTEXTEX.chrg.cpMax,-1 add len,edx .endif .if eax!=-1 mov [esi].FINDTEXTEX.chrgText.cpMin,eax mov edx,len add edx,eax mov [esi].FINDTEXTEX.chrgText.cpMax,edx .endif .else mov eax,-1 .endif ret FindTextEx endp IsLine proc uses ebx esi edi,hMem:DWORD,nLine:DWORD,lpszTest:DWORD LOCAL tmpesi:DWORD LOCAL fCmnt:DWORD LOCAL espsave:DWORD LOCAL esisave:DWORD mov eax,esp sub eax,4 mov espsave,eax mov ebx,hMem mov edi,nLine shl edi,2 mov esi,lpszTest .if edi<[ebx].EDIT.rpLineFree && byte ptr [esi] .while byte ptr [esi] mov esisave,esi mov edi,nLine shl edi,2 call TestLine .break .if eax!=-1 mov esi,esisave invoke strlen,esi lea esi,[esi+eax+1] mov eax,-1 .endw .else mov eax,-1 .endif ret TestLine: xor ecx,ecx mov fCmnt,ecx add edi,[ebx].EDIT.hLine mov edi,[edi].LINE.rpChars add edi,[ebx].EDIT.hChars test [edi].CHARS.state,STATE_COMMENT .if !ZERO? mov ax,[esi] .if [ebx].EDIT.ccmntblocks==1 && ax!="/*" && ax!="*/" jmp Nf .elseif [ebx].EDIT.ccmntblocks==2 && ax!="/'" && ax!="'/" jmp Nf .endif .else call SkipSpc or eax,eax jne Nf .endif Nxt: mov ax,[esi] .if ah .if ax==' $' call SkipCmnt inc esi call SkipWord or eax,eax jne Nf mov al,[esi] .if al==' ' inc esi call SkipSpc call SkipCmnt or eax,eax jne Nf .endif .elseif ax==' ?' call SkipCmnt add esi,2 push esi call TestWord pop esi or eax,eax je Found dec esi call SkipWord or eax,eax jne Nf mov al,[esi] .if al==' ' inc esi call SkipSpc call SkipCmnt or eax,eax jne Nf .endif .elseif al=='%' call SkipCmnt inc esi call OptSkipWord jmp Nxt .elseif ax=="'/" ; comment init .while ecx<[edi].CHARS.len movzx eax,byte ptr [edi+ecx+sizeof CHARS] movzx eax,byte ptr [eax+offset CharTab] .if eax==CT_STRING call SkipString .elseif word ptr [edi+ecx+sizeof CHARS]=="'/" inc ecx inc fCmnt .elseif word ptr [edi+ecx+sizeof CHARS]=="/'" inc ecx dec fCmnt .elseif byte ptr [edi+ecx+sizeof CHARS]=="'" && !fCmnt mov ecx,[edi].CHARS.len .endif inc ecx .endw .if sdword ptr fCmnt>0 xor eax,eax jmp Found .endif jmp Nf .elseif ax=="/'" ; Comment end .while ecx<[edi].CHARS.len movzx eax,byte ptr [edi+ecx+sizeof CHARS] movzx eax,byte ptr [eax+offset CharTab] .if eax==CT_STRING call SkipString .elseif word ptr [edi+ecx+sizeof CHARS]=="/'" test [edi].CHARS.state,STATE_COMMENT .if !ZERO? dec fCmnt .endif inc ecx .elseif word ptr [edi+ecx+sizeof CHARS]=="'/" inc fCmnt inc ecx .elseif byte ptr [edi+ecx+sizeof CHARS]=="'" && !fCmnt mov ecx,[edi].CHARS.len .endif inc ecx .endw .if sdword ptr fCmnt<0 xor eax,eax jmp Found .endif jmp Nf .elseif ax=="*/" ; comment init .while ecx<[edi].CHARS.len movzx esi,byte ptr [edi+ecx+sizeof CHARS] movzx esi,byte ptr [esi+offset CharTab] .if esi==CT_STRING call SkipString .elseif word ptr [edi+ecx+sizeof CHARS]=="*/" inc ecx inc fCmnt .elseif word ptr [edi+ecx+sizeof CHARS]=="/*" inc ecx dec fCmnt .endif inc ecx .endw .if sdword ptr fCmnt>0 xor eax,eax jmp Found .endif jmp Nf .elseif ax=="/*" ; Comment end .while ecx<[edi].CHARS.len .if word ptr [edi+ecx+sizeof CHARS]=="/*" dec fCmnt .elseif word ptr [edi+ecx+sizeof CHARS]=="*/" inc fCmnt .endif inc ecx .endw .if sdword ptr fCmnt<0 xor eax,eax jmp Found .endif jmp Nf .endif call SkipCmnt call TestWord or eax,eax jne Nf xor edx,edx .else call SkipCmnt .while ecx<[edi].CHARS.len xor edx,edx cmp al,[edi+ecx+sizeof CHARS] .break .if ZERO? dec edx movzx esi,byte ptr [edi+ecx+sizeof CHARS] movzx esi,byte ptr [esi+offset CharTab] .if esi==CT_CMNTCHAR .break .elseif esi==CT_CMNTDBLCHAR movzx esi,byte ptr [edi+ecx+sizeof CHARS+1] movzx esi,byte ptr [esi+offset CharTab] .break .if esi==CT_CMNTDBLCHAR .elseif esi==CT_STRING call SkipString .endif inc ecx .endw .endif mov eax,edx Found: retn Nf: mov eax,-1 retn SkipString: push eax mov al,[edi+ecx+sizeof CHARS] inc ecx .while ecx<[edi].CHARS.len .break .if al==[edi+ecx+sizeof CHARS] inc ecx .endw pop eax retn SkipCmnt: .if word ptr [edi+ecx+sizeof CHARS]=="'/" push eax inc ecx .while ecx<[edi].CHARS.len inc ecx .break .if word ptr [edi+ecx+sizeof CHARS]=="/'" .endw .if word ptr [edi+ecx+sizeof CHARS]=="/'" add ecx,2 .endif call SkipSpc pop eax .endif retn SkipSpc: .if ecx<[edi].CHARS.len mov al,[edi+ecx+sizeof CHARS] .if al==VK_TAB || al==' ' || al==':' || (al=='*' && [ebx].EDIT.ccmntblocks!=1) inc ecx jmp SkipSpc .elseif al=='"' call SkipString .if byte ptr [edi+ecx+sizeof CHARS]=='"' inc ecx .endif jmp SkipSpc .elseif al==byte ptr bracketcont .if byte ptr [edi+ecx+sizeof CHARS+1]==VK_RETURN inc nLine mov edi,nLine shl edi,2 .if edi<[ebx].EDIT.rpLineFree add edi,[ebx].EDIT.hLine mov edi,[edi].LINE.rpChars add edi,[ebx].EDIT.hChars test [edi].CHARS.state,STATE_COMMENT jne SkipSpcNf xor ecx,ecx jmp SkipSpc .else jmp SkipSpcNf .endif .endif .endif xor eax,eax .else xor eax,eax dec eax .endif retn SkipSpcNf: mov esp,espsave jmp Nf OptSkipWord: push ecx .while ecx<[edi].CHARS.len mov al,[esi] inc esi mov ah,[edi+ecx+sizeof CHARS] inc ecx .if al==VK_SPACE && (ah==VK_SPACE || ah==VK_TAB) pop eax retn .endif .if al>='a' && al<='z' and al,5Fh .endif .if ah>='a' && ah<='z' and ah,5Fh .endif .if al!=ah .while byte ptr [esi-1]!=VK_SPACE inc esi .endw .break .endif .endw pop ecx retn SkipWord: .if ecx<[edi].CHARS.len movzx eax,byte ptr [edi+ecx+sizeof CHARS] .if eax!=VK_TAB && eax!=' ' && eax!=':' lea eax,[eax+offset CharTab] mov al,[eax] .if al==CT_CHAR || al==CT_HICHAR inc ecx jmp SkipWord .else .if al==CT_CMNTCHAR mov ecx,[edi].CHARS.len .endif xor eax,eax dec eax retn .endif .endif xor eax,eax .else xor eax,eax dec eax .endif retn @@: inc esi inc ecx mov al,[esi] .if ecx>=[edi].CHARS.len && al xor eax,eax dec eax retn .endif TestWord: mov ax,[esi] or al,al je @f .if al==' ' mov ax,[edi+ecx+sizeof CHARS] .if al==' ' || al==VK_TAB call SkipSpc call SkipCmnt dec ecx jmp @b .elseif al=='(' dec ecx jmp @b .else xor eax,eax dec eax retn .endif .elseif ax=='(#' inc esi .while ecx<[edi].CHARS.len .break .if byte ptr [edi+ecx+sizeof CHARS]=='(' inc ecx .endw xor eax,eax .if byte ptr [edi+ecx+sizeof CHARS]!='(' dec eax .endif retn .elseif ax=='$$' add esi,3 .while ecx<[edi].CHARS.len push esi call TestWord .if !eax pop eax xor eax,eax retn .endif pop esi inc ecx .endw .elseif ax=='!$' add esi,3 .while ecx<[edi].CHARS.len push esi call SkipSpc call SkipCmnt call TestWord .if !eax call SkipSpc call SkipCmnt pop eax mov al,[edi+ecx+sizeof CHARS] .if al==VK_RETURN || ecx==[edi].CHARS.len xor eax,eax .else movzx eax,al lea eax,[eax+offset CharTab] mov al,[eax] .if al==CT_CMNTCHAR xor eax,eax .else xor eax,eax dec eax .endif .endif retn .endif pop esi inc ecx .endw .elseif al=='*' xor eax,eax push ecx movzx ecx,byte ptr [edi+ecx+sizeof CHARS] movzx ecx,byte ptr [ecx+offset CharTab] .if ecx!=CT_CHAR dec eax .endif pop ecx retn .elseif al=='!' .if byte ptr [esi-1]!=' ' mov al,[edi+ecx+sizeof CHARS] .if al!=' ' && al!=VK_TAB && al!=VK_RETURN xor eax,eax dec eax retn .endif .endif call SkipSpc call SkipCmnt .if ecx==[edi].CHARS.len xor eax,eax retn .endif inc esi mov tmpesi,esi mov ax,[esi] .while TRUE push ecx call TestWord pop edx inc eax .break .if eax mov esi,tmpesi mov ecx,edx call SkipWord .if eax inc ecx .endif call SkipSpc call SkipCmnt xor eax,eax .break .if ecx>=[edi].CHARS.len .endw retn .elseif ax==' $' call SkipWord call SkipSpc call SkipCmnt inc esi inc esi jmp TestWord .endif mov ah,[edi+ecx+sizeof CHARS] .if al>='a' && al<='z' and al,5Fh .endif .if ah>='a' && ah<='z' and ah,5Fh .endif cmp al,'$' je @f cmp al,ah je @b xor eax,eax dec eax retn @@: .if al=='$' xor eax,eax .if ecx<[edi].CHARS.len push ecx movzx ecx,byte ptr [edi+ecx+sizeof CHARS] movzx ecx,byte ptr [ecx+offset CharTab] .if ecx==CT_CHAR || ecx==CT_HICHAR inc eax .endif pop ecx .endif dec eax .else xor eax,eax .if ecx<[edi].CHARS.len push ecx movzx ecx,byte ptr [edi+ecx+sizeof CHARS] movzx ecx,byte ptr [ecx+offset CharTab] .if ecx==CT_CHAR || ecx==CT_HICHAR dec eax .endif pop ecx .elseif ecx>[edi].CHARS.len dec eax .endif .endif retn IsLine endp SetBookMark proc uses ebx,hMem:DWORD,nLine:DWORD,nType:DWORD mov ebx,hMem mov edx,nLine shl edx,2 xor eax,eax .if edx<[ebx].EDIT.rpLineFree add edx,[ebx].EDIT.hLine mov edx,[edx].LINE.rpChars add edx,[ebx].EDIT.hChars mov eax,nType shl eax,4 and eax,STATE_BMMASK and [edx].CHARS.state,-1 xor STATE_BMMASK or [edx].CHARS.state,eax inc nBmid test [edx].CHARS.state,STATE_HIDDEN .if ZERO? mov eax,nBmid mov [edx].CHARS.bmid,eax .endif .endif ret SetBookMark endp GetBookMark proc uses ebx,hMem:DWORD,nLine:DWORD mov ebx,hMem xor eax,eax dec eax mov edx,nLine shl edx,2 .if edx<[ebx].EDIT.rpLineFree add edx,[ebx].EDIT.hLine mov edx,[edx].LINE.rpChars add edx,[ebx].EDIT.hChars mov eax,[edx].CHARS.state and eax,STATE_BMMASK shr eax,4 .endif ret GetBookMark endp ClearBookMarks proc uses ebx esi edi,hMem:DWORD,nType:DWORD mov ebx,hMem and nType,15 mov eax,nType shl eax,4 xor edi,edi .while edi<[ebx].EDIT.rpLineFree mov edx,edi add edx,[ebx].EDIT.hLine mov edx,[edx].LINE.rpChars add edx,[ebx].EDIT.hChars mov ecx,[edx].CHARS.state and ecx,STATE_BMMASK .if eax==ecx and [edx].CHARS.state,-1 xor STATE_BMMASK test [edx].CHARS.state,STATE_HIDDEN .if ZERO? mov [edx].CHARS.bmid,0 .endif .endif add edi,sizeof LINE .endw ret ClearBookMarks endp NextBookMark proc uses ebx esi edi,hMem:DWORD,nLine:DWORD,nType:DWORD LOCAL fExpand:DWORD mov ebx,hMem mov eax,nType and nType,15 and eax,80000000h mov fExpand,eax mov edi,nLine inc edi shl edi,2 xor eax,eax dec eax .while edi<[ebx].EDIT.rpLineFree mov edx,edi add edx,[ebx].EDIT.hLine mov edx,[edx].LINE.rpChars add edx,[ebx].EDIT.hChars mov ecx,[edx].CHARS.state and ecx,STATE_BMMASK shr ecx,4 .if ecx==nType mov eax,edi shr eax,2 .break .endif add edi,sizeof LINE .endw ret NextBookMark endp NextBreakpoint proc uses ebx edi,hMem:DWORD,nLine:DWORD mov ebx,hMem mov edi,nLine inc edi shl edi,2 xor eax,eax dec eax .while edi<[ebx].EDIT.rpLineFree mov edx,edi add edx,[ebx].EDIT.hLine mov edx,[edx].LINE.rpChars add edx,[ebx].EDIT.hChars test [edx].CHARS.state,STATE_BREAKPOINT .if !ZERO? mov eax,edi shr eax,2 .break .endif add edi,sizeof LINE .endw ret NextBreakpoint endp NextError proc uses ebx edi,hMem:DWORD,nLine:DWORD mov ebx,hMem mov edi,nLine inc edi shl edi,2 xor eax,eax dec eax .while edi<[ebx].EDIT.rpLineFree mov edx,edi add edx,[ebx].EDIT.hLine mov edx,[edx].LINE.rpChars add edx,[ebx].EDIT.hChars .if [edx].CHARS.errid mov eax,edi shr eax,2 .break .endif add edi,sizeof LINE .endw ret NextError endp PreviousBookMark proc uses ebx esi edi,hMem:DWORD,nLine:DWORD,nType:DWORD LOCAL fExpand:DWORD mov ebx,hMem mov eax,nType and nType,15 and eax,80000000h mov fExpand,eax xor eax,eax dec eax mov edi,nLine dec edi shl edi,2 .while sdword ptr edi>=0 @@: mov edx,edi add edx,[ebx].EDIT.hLine mov edx,[edx].LINE.rpChars add edx,[ebx].EDIT.hChars mov ecx,[edx].CHARS.state and ecx,STATE_BMMASK shr ecx,4 .if ecx==nType mov eax,edi shr eax,2 .break .endif sub edi,sizeof LINE .endw ret PreviousBookMark endp LockLine proc uses ebx,hMem:DWORD,nLine:DWORD,fLock:DWORD mov ebx,hMem mov eax,nLine shl eax,2 .if eax<[ebx].EDIT.rpLineFree add eax,[ebx].EDIT.hLine mov eax,[eax].LINE.rpChars add eax,[ebx].EDIT.hChars .if fLock or [eax].CHARS.state,STATE_LOCKED .else and [eax].CHARS.state,-1 xor STATE_LOCKED .endif .endif ret LockLine endp IsLineLocked proc uses ebx,hMem:DWORD,nLine:DWORD mov ebx,hMem xor eax,eax test [ebx].EDIT.fstyle,STYLE_READONLY .if ZERO? mov edx,nLine shl edx,2 .if edx<[ebx].EDIT.rpLineFree add edx,[ebx].EDIT.hLine mov edx,[edx].LINE.rpChars add edx,[ebx].EDIT.hChars mov eax,[edx].CHARS.state and eax,STATE_LOCKED .endif .else inc eax .endif ret IsLineLocked endp HideLine proc uses ebx,hMem:DWORD,nLine:DWORD,fHide:DWORD mov ebx,hMem mov eax,nLine shl eax,2 .if eax<[ebx].EDIT.rpLineFree add eax,[ebx].EDIT.hLine mov eax,[eax].LINE.rpChars add eax,[ebx].EDIT.hChars .if fHide test [eax].CHARS.state,STATE_HIDDEN .if ZERO? mov ecx,[eax].CHARS.len .if byte ptr [eax+ecx+sizeof CHARS-1]==0Dh or [eax].CHARS.state,STATE_HIDDEN inc [ebx].EDIT.nHidden call SetYP xor eax,eax inc eax jmp Ex .endif .endif .else test [eax].CHARS.state,STATE_HIDDEN .if !ZERO? and [eax].CHARS.state,-1 xor STATE_HIDDEN dec [ebx].EDIT.nHidden call SetYP xor eax,eax inc eax jmp Ex .endif .endif .endif xor eax,eax Ex: ret SetYP: mov edx,nLine xor eax,eax .if edx<[ebx].EDIT.edta.topln mov [ebx].EDIT.edta.topyp,eax mov [ebx].EDIT.edta.topln,eax mov [ebx].EDIT.edta.topcp,eax .endif .if edx<[ebx].EDIT.edtb.topln mov [ebx].EDIT.edtb.topyp,eax mov [ebx].EDIT.edtb.topln,eax mov [ebx].EDIT.edtb.topcp,eax .endif retn HideLine endp IsLineHidden proc uses ebx,hMem:DWORD,nLine:DWORD mov ebx,hMem mov eax,nLine shl eax,2 .if eax<[ebx].EDIT.rpLineFree add eax,[ebx].EDIT.hLine mov eax,[eax].LINE.rpChars add eax,[ebx].EDIT.hChars mov eax,[eax].CHARS.state and eax,STATE_HIDDEN .else xor eax,eax .endif ret IsLineHidden endp NoBlockLine proc uses ebx,hMem:DWORD,nLine:DWORD,fNoBlock:DWORD mov ebx,hMem mov eax,nLine shl eax,2 .if eax<[ebx].EDIT.rpLineFree add eax,[ebx].EDIT.hLine mov eax,[eax].LINE.rpChars add eax,[ebx].EDIT.hChars .if fNoBlock or [eax].CHARS.state,STATE_NOBLOCK .else and [eax].CHARS.state,-1 xor STATE_NOBLOCK .endif .endif ret NoBlockLine endp IsLineNoBlock proc uses ebx,hMem:DWORD,nLine:DWORD mov ebx,hMem mov eax,nLine shl eax,2 .if eax<[ebx].EDIT.rpLineFree add eax,[ebx].EDIT.hLine mov eax,[eax].LINE.rpChars add eax,[ebx].EDIT.hChars mov eax,[eax].CHARS.state and eax,STATE_NOBLOCK .else xor eax,eax .endif ret IsLineNoBlock endp AltHiliteLine proc uses ebx,hMem:DWORD,nLine:DWORD,fAltHilite:DWORD mov ebx,hMem mov eax,nLine shl eax,2 .if eax<[ebx].EDIT.rpLineFree add eax,[ebx].EDIT.hLine mov eax,[eax].LINE.rpChars add eax,[ebx].EDIT.hChars .if fAltHilite or [eax].CHARS.state,STATE_ALTHILITE .else and [eax].CHARS.state,-1 xor STATE_ALTHILITE .endif .endif ret AltHiliteLine endp IsLineAltHilite proc uses ebx,hMem:DWORD,nLine:DWORD mov ebx,hMem mov eax,nLine shl eax,2 .if eax<[ebx].EDIT.rpLineFree add eax,[ebx].EDIT.hLine mov eax,[eax].LINE.rpChars add eax,[ebx].EDIT.hChars mov eax,[eax].CHARS.state and eax,STATE_ALTHILITE .else xor eax,eax .endif ret IsLineAltHilite endp SetBreakpoint proc uses ebx,hMem:DWORD,nLine:DWORD,fBreakpoint:DWORD mov ebx,hMem mov eax,nLine shl eax,2 .if eax<[ebx].EDIT.rpLineFree add eax,[ebx].EDIT.hLine mov eax,[eax].LINE.rpChars add eax,[ebx].EDIT.hChars .if fBreakpoint or [eax].CHARS.state,STATE_BREAKPOINT .else and [eax].CHARS.state,-1 xor STATE_BREAKPOINT .endif .endif ret SetBreakpoint endp SetError proc uses ebx,hMem:DWORD,nLine:DWORD,nErrID:DWORD mov ebx,hMem mov eax,nLine shl eax,2 .if eax<[ebx].EDIT.rpLineFree add eax,[ebx].EDIT.hLine mov eax,[eax].LINE.rpChars add eax,[ebx].EDIT.hChars mov edx,nErrID mov [eax].CHARS.errid,edx .endif ret SetError endp GetError proc uses ebx,hMem:DWORD,nLine:DWORD mov ebx,hMem mov edx,nLine shl edx,2 xor eax,eax .if edx<[ebx].EDIT.rpLineFree add edx,[ebx].EDIT.hLine mov edx,[edx].LINE.rpChars add edx,[ebx].EDIT.hChars mov eax,[edx].CHARS.errid .endif ret GetError endp SetRedText proc uses ebx,hMem:DWORD,nLine:DWORD,fRed:DWORD mov ebx,hMem mov eax,nLine shl eax,2 .if eax<[ebx].EDIT.rpLineFree add eax,[ebx].EDIT.hLine mov eax,[eax].LINE.rpChars add eax,[ebx].EDIT.hChars .if fRed or [eax].CHARS.state,STATE_REDTEXT .else and [eax].CHARS.state,-1 xor STATE_REDTEXT .endif .endif ret SetRedText endp GetLineState proc uses ebx,hMem:DWORD,nLine:DWORD mov ebx,hMem mov edx,nLine shl edx,2 xor eax,eax .if edx<[ebx].EDIT.rpLineFree add edx,[ebx].EDIT.hLine mov edx,[edx].LINE.rpChars add edx,[ebx].EDIT.hChars mov eax,[edx].CHARS.state .endif ret GetLineState endp IsSelectionLocked proc uses ebx,hMem:DWORD,cpMin:DWORD,cpMax:DWORD LOCAL nLineMax:DWORD mov ebx,hMem mov eax,cpMin .if eax>cpMax xchg eax,cpMax mov cpMin,eax .endif invoke GetCharPtr,ebx,cpMax mov nLineMax,edx invoke GetCharPtr,ebx,cpMin .while edx<=nLineMax push edx invoke IsLineLocked,ebx,edx pop edx or eax,eax jne Ex inc edx .endw Ex: ret IsSelectionLocked endp TrimSpace proc uses ebx edi,hMem:DWORD,nLine:DWORD,fLeft:DWORD LOCAL cp:DWORD mov ebx,hMem mov edi,nLine invoke GetCpFromLine,ebx,edi mov cp,eax shl edi,2 xor edx,edx .if edi<[ebx].EDIT.rpLineFree add edi,[ebx].EDIT.hLine mov edi,[edi].LINE.rpChars add edi,[ebx].EDIT.hChars mov edx,[edi].CHARS.len .if edx .if fLeft ;Left trim (Not implemented) xor ecx,ecx .else ;Right trim push edx mov al,[edi+edx+sizeof CHARS-1] push eax .if al==0Dh dec edx .endif mov ecx,edx @@: mov al,[edi+ecx+sizeof CHARS-1] .if al==' ' || al==VK_TAB dec ecx jne @b .endif mov eax,cp add eax,ecx sub edx,ecx push edx lea edx,[edi+ecx+sizeof CHARS] pop ecx .if ecx push ecx invoke SaveUndo,ebx,UNDO_DELETEBLOCK,eax,edx,ecx pop ecx .endif pop eax .if ecx sub [edi].CHARS.len,ecx mov edx,[edi].CHARS.len .if al==0Dh mov [edi+edx+sizeof CHARS-1],al .endif and [edi].CHARS.state,-1 xor (STATE_CHANGED or STATE_CHANGESAVED) or [edi].CHARS.state,STATE_CHANGED .endif pop edx sub edx,ecx .endif .endif .endif .if ecx push edx xor eax,eax mov [ebx].EDIT.edta.topyp,eax mov [ebx].EDIT.edta.topln,eax mov [ebx].EDIT.edta.topcp,eax mov [ebx].EDIT.edtb.topyp,eax mov [ebx].EDIT.edtb.topln,eax mov [ebx].EDIT.edtb.topcp,eax .if ![ebx].EDIT.fChanged mov [ebx].EDIT.fChanged,TRUE invoke InvalidateRect,[ebx].EDIT.hsta,NULL,TRUE .endif invoke GetTopFromYp,ebx,[ebx].EDIT.edta.hwnd,[ebx].EDIT.edta.cpy invoke GetTopFromYp,ebx,[ebx].EDIT.edtb.hwnd,[ebx].EDIT.edtb.cpy invoke InvalidateLine,ebx,[ebx].EDIT.edta.hwnd,nLine invoke InvalidateLine,ebx,[ebx].EDIT.edtb.hwnd,nLine inc [ebx].EDIT.nchange pop edx .endif Ex: mov eax,edx ret TrimSpace endp SkipSpace proc uses ebx esi,hMem:DWORD,cp:DWORD,fLeft:DWORD mov ebx,hMem invoke GetCharPtr,ebx,cp mov esi,[ebx].EDIT.rpChars add esi,[ebx].EDIT.hChars mov edx,eax .if !fLeft @@: .if edx<[esi].CHARS.len mov al,[esi+edx+sizeof CHARS] .if al==' ' || al==VK_TAB inc edx jmp @b .endif .endif .else @@: .if edx mov al,[esi+edx+sizeof CHARS-1] .if al==' ' || al==VK_TAB dec edx jmp @b .endif .endif .endif mov eax,[ebx].EDIT.cpLine add eax,edx ret SkipSpace endp SkipWhiteSpace proc uses ebx esi,hMem:DWORD,cp:DWORD,fLeft:DWORD mov ebx,hMem invoke GetCharPtr,ebx,cp mov esi,[ebx].EDIT.rpChars add esi,[ebx].EDIT.hChars mov edx,eax .if !fLeft @@: .if edx<[esi].CHARS.len mov al,[esi+edx+sizeof CHARS] invoke IsChar .if al!=1 inc edx jmp @b .endif .endif .else @@: .if edx mov al,[esi+edx+sizeof CHARS] invoke IsChar .if al!=1 dec edx jmp @b .endif .endif .endif mov eax,[ebx].EDIT.cpLine add eax,edx ret SkipWhiteSpace endp GetWordStart proc uses ebx esi,hMem:DWORD,cp:DWORD,nType:DWORD mov ebx,hMem invoke GetCharPtr,ebx,cp mov esi,[ebx].EDIT.rpChars add esi,[ebx].EDIT.hChars mov edx,eax @@: .if edx mov al,[esi+edx+sizeof CHARS-1] .if al=='.' && nType dec edx jmp @b .elseif al=='>' && nType==2 && edx>2 .if byte ptr [esi+edx+sizeof CHARS-2]=='-' dec edx dec edx jmp @b .endif .elseif al==')' && nType==2 xor ecx,ecx .while edx>1 mov al,[esi+edx+sizeof CHARS-1] .if al==")" inc ecx .elseif al=='(' dec ecx .if !ecx dec edx .break .endif .endif dec edx .endw jmp @b .else invoke IsChar .endif .if al==1 dec edx jmp @b .endif .endif mov eax,[ebx].EDIT.cpLine add eax,edx ret GetWordStart endp GetLineStart proc uses ebx,hMem:DWORD,cp:DWORD mov ebx,hMem invoke GetCharPtr,ebx,cp mov eax,[ebx].EDIT.cpLine ret GetLineStart endp GetTabPos proc uses ebx esi,hMem:DWORD,cp:DWORD mov ebx,hMem invoke GetCharPtr,ebx,cp mov esi,[ebx].EDIT.rpChars add esi,[ebx].EDIT.hChars mov edx,eax xor eax,eax xor ecx,ecx .while sdword ptr ecx<edx inc eax .if byte ptr [esi+ecx+sizeof CHARS]==VK_TAB || eax==[ebx].EDIT.nTab xor eax,eax .endif inc ecx .endw ret GetTabPos endp GetWordEnd proc uses ebx esi,hMem:DWORD,cp:DWORD,nType:DWORD mov ebx,hMem invoke GetCharPtr,ebx,cp mov esi,[ebx].EDIT.rpChars add esi,[ebx].EDIT.hChars mov edx,eax @@: .if edx<[esi].CHARS.len mov al,[esi+edx+sizeof CHARS] .if al=='.' && nType inc edx jmp @b .elseif al=='-' && nType==2 && byte ptr [esi+edx+sizeof CHARS+1]=='>' inc edx inc edx jmp @b .elseif al=='(' && nType==2 xor ecx,ecx .while edx<[esi].CHARS.len mov al,[esi+edx+sizeof CHARS] .if al=="(" inc ecx .elseif al==')' dec ecx .if !ecx inc edx .break .endif .endif inc edx .endw jmp @b .else invoke IsChar .endif .if al==1 inc edx jmp @b .endif .endif mov eax,[ebx].EDIT.cpLine add eax,edx ret GetWordEnd endp GetLineEnd proc uses ebx esi,hMem:DWORD,cp:DWORD mov ebx,hMem invoke GetCharPtr,ebx,cp mov esi,[ebx].EDIT.rpChars add esi,[ebx].EDIT.hChars mov edx,eax @@: .if edx<[esi].CHARS.len mov al,[esi+edx+sizeof CHARS] invoke IsChar .if al==1 inc edx jmp @b .endif .endif mov eax,[ebx].EDIT.cpLine add eax,[esi].CHARS.len dec eax .if byte ptr [esi+eax+sizeof CHARS]==VK_RETURN dec eax .endif ret GetLineEnd endp StreamIn proc uses ebx esi edi,hMem:DWORD,lParam:DWORD LOCAL hCMem:DWORD LOCAL dwRead:DWORD LOCAL fUnicode:DWORD mov ebx,hMem invoke xGlobalAlloc,GMEM_FIXED or GMEM_ZEROINIT,MAXSTREAM*3+4096 mov hCMem,eax invoke GlobalLock,hCMem xor edi,edi mov dwRead,edi mov fUnicode,edi @@: mov esi,hCMem add esi,MAXSTREAM call ReadChars or eax,eax jne @f .if dwRead .if !fUnicode movzx eax,word ptr [esi] .if eax==0FEFFh && dwRead>=2 ;Unicode mov eax,2 mov [ebx].EDIT.funicode,TRUE mov fUnicode,eax add esi,eax sub dwRead,eax .else mov fUnicode,1 mov [ebx].EDIT.funicode,FALSE .endif .endif .if fUnicode==2 mov edx,dwRead shr edx,1 invoke WideCharToMultiByte,CP_ACP,0,esi,edx,hCMem,MAXSTREAM,NULL,NULL mov dwRead,eax mov esi,hCMem .endif xor ecx,ecx .while ecx<dwRead push ecx movzx eax,byte ptr [esi+ecx] .if eax!=0Ah invoke InsertChar,ebx,edi,eax .endif pop ecx inc edi inc ecx .endw jmp @b .endif @@: invoke GlobalUnlock,hCMem invoke GlobalFree,hCMem mov [ebx].EDIT.nHidden,0 ret ReadChars: mov edx,lParam mov [edx].EDITSTREAM.dwError,0 lea eax,dwRead push eax mov eax,MAXSTREAM push eax mov eax,esi push eax push [edx].EDITSTREAM.dwCookie call [edx].EDITSTREAM.pfnCallback retn StreamIn endp StreamOut proc uses ebx esi edi,hMem:DWORD,lParam:DWORD LOCAL dwWrite:DWORD LOCAL hCMem:DWORD LOCAL nChars:DWORD mov ebx,hMem invoke xGlobalAlloc,GMEM_FIXED or GMEM_ZEROINIT,MAXSTREAM*3+4096 mov hCMem,eax invoke GlobalLock,hCMem mov esi,[ebx].EDIT.hLine .if [ebx].EDIT.funicode ; Save as unicode mov eax,hCMem mov word ptr [eax],0FEFFh mov nChars,2 call StreamAnsi @@: call FillCMem or ecx,ecx je Ex call StreamUnicode or eax,eax je @b .else ; Save as ansi @@: call FillCMem or ecx,ecx je Ex call StreamAnsi or eax,eax je @b .endif Ex: invoke GlobalUnlock,hCMem invoke GlobalFree,hCMem ret StreamUnicode: mov eax,hCMem add eax,MAXSTREAM+1024 invoke MultiByteToWideChar,CP_ACP,0,hCMem,nChars,eax,MAXSTREAM+1024 mov edx,lParam mov [edx].EDITSTREAM.dwError,0 lea eax,dwWrite push eax mov eax,nChars shl eax,1 push eax mov eax,hCMem add eax,MAXSTREAM+1024 push eax mov eax,[edx].EDITSTREAM.dwCookie push eax call [edx].EDITSTREAM.pfnCallback retn StreamAnsi: mov edx,lParam mov [edx].EDITSTREAM.dwError,0 lea eax,dwWrite push eax push nChars push hCMem mov eax,[edx].EDITSTREAM.dwCookie push eax call [edx].EDITSTREAM.pfnCallback retn FillCMem: xor ecx,ecx xor edx,edx mov nChars,ecx mov eax,esi sub eax,[ebx].EDIT.hLine .if eax<[ebx].EDIT.rpLineFree push esi mov edi,hCMem mov esi,[esi].LINE.rpChars add esi,[ebx].EDIT.hChars .while ecx<[esi].CHARS.len mov al,[esi+ecx+sizeof CHARS] mov [edi],al inc ecx inc edi inc nChars .if al==0Dh mov byte ptr [edi],0Ah inc edx inc edi inc nChars .endif .if nChars>=MAXSTREAM pushad .if [ebx].EDIT.funicode call StreamUnicode .else call StreamAnsi .endif popad mov edi,hCMem mov nChars,0 .endif .endw pop esi add esi,sizeof LINE .endif add ecx,edx retn StreamOut endp HiliteLine proc uses ebx,hMem:DWORD,nLine:DWORD,nColor:DWORD mov ebx,hMem mov edx,nLine shl edx,2 .if edx<[ebx].EDIT.rpLineFree add edx,[ebx].EDIT.hLine mov edx,[edx].LINE.rpChars add edx,[ebx].EDIT.hChars and [edx].CHARS.state,-1 xor STATE_HILITEMASK mov eax,nColor and eax,STATE_HILITEMASK or [edx].CHARS.state,eax invoke InvalidateLine,ebx,[ebx].EDIT.edta.hwnd,nLine invoke InvalidateLine,ebx,[ebx].EDIT.edtb.hwnd,nLine .endif xor eax,eax ret HiliteLine endp SelChange proc uses ebx,hMem:DWORD,nType:DWORD LOCAL sc:RASELCHANGE mov ebx,hMem .if [ebx].EDIT.cpbrst!=-1 mov [ebx].EDIT.cpbrst,-1 mov [ebx].EDIT.cpbren,-1 invoke InvalidateEdit,ebx,[ebx].EDIT.edta.hwnd invoke InvalidateEdit,ebx,[ebx].EDIT.edtb.hwnd .endif invoke GetCharPtr,hMem,[ebx].EDIT.cpMin mov edx,[ebx].EDIT.ID mov eax,[ebx].EDIT.hwnd mov sc.nmhdr.hwndFrom,eax mov sc.nmhdr.idFrom,edx mov sc.nmhdr.code,EN_SELCHANGE test [ebx].EDIT.nMode,MODE_BLOCK .if ZERO? mov eax,[ebx].EDIT.cpMin mov sc.chrg.cpMin,eax mov eax,[ebx].EDIT.cpMax mov sc.chrg.cpMax,eax .else mov eax,[ebx].EDIT.cpLine add eax,[ebx].EDIT.blrg.clMin mov sc.chrg.cpMin,eax mov sc.chrg.cpMax,eax .endif mov eax,nType mov sc.seltyp,ax mov eax,[ebx].EDIT.line mov sc.line,eax mov eax,[ebx].EDIT.cpLine mov sc.cpLine,eax mov eax,[ebx].EDIT.rpChars add eax,[ebx].EDIT.hChars mov sc.lpLine,eax mov eax,[ebx].EDIT.rpLineFree shr eax,2 dec eax mov sc.nlines,eax mov eax,[ebx].EDIT.nHidden mov sc.nhidden,eax mov eax,[ebx].EDIT.nchange sub eax,[ebx].EDIT.nlastchange .if eax add [ebx].EDIT.nlastchange,eax mov eax,TRUE .endif mov sc.fchanged,eax mov ecx,[ebx].EDIT.nPageBreak xor eax,eax .if ecx mov eax,[ebx].EDIT.line xor edx,edx div ecx .endif mov sc.npage,eax mov eax,[ebx].EDIT.nWordGroup mov sc.nWordGroup,eax .if ![ebx].EDIT.nsplitt mov eax,[ebx].EDIT.cpMin mov [ebx].EDIT.edta.cp,eax mov [ebx].EDIT.edtb.cp,eax .endif mov eax,[ebx].EDIT.line .if eax!=[ebx].EDIT.lastline .if [ebx].EDIT.fhilite invoke HiliteLine,ebx,[ebx].EDIT.lastline,0 invoke HiliteLine,ebx,[ebx].EDIT.line,[ebx].EDIT.fhilite .endif mov eax,[ebx].EDIT.line mov [ebx].EDIT.lastline,eax .endif invoke SendMessage,[ebx].EDIT.hpar,WM_NOTIFY,[ebx].EDIT.ID,addr sc ret SelChange endp AutoIndent proc uses ebx esi,hMem:DWORD LOCAL nLine:DWORD mov ebx,hMem invoke GetLineFromCp,ebx,[ebx].EDIT.cpMin .if eax mov nLine,eax xor edx,edx push [ebx].EDIT.fOvr mov [ebx].EDIT.fOvr,FALSE @@: mov eax,nLine mov esi,[ebx].EDIT.hLine lea esi,[esi+eax*sizeof LINE-sizeof LINE] mov esi,[esi].LINE.rpChars add esi,[ebx].EDIT.hChars .if edx<[esi].CHARS.len movzx eax,byte ptr [esi+edx+sizeof CHARS] .if al==' ' || al==VK_TAB push edx push eax invoke InsertChar,ebx,[ebx].EDIT.cpMin,eax pop eax invoke SaveUndo,ebx,UNDO_INSERT,[ebx].EDIT.cpMin,eax,1 mov eax,[ebx].EDIT.cpMin inc eax mov [ebx].EDIT.cpMin,eax mov [ebx].EDIT.cpMax,eax pop edx inc edx jmp @b .endif .endif pop [ebx].EDIT.fOvr .endif ret AutoIndent endp IsCharPos proc uses ebx esi,hMem:DWORD,cp:DWORD LOCAL nMax:DWORD mov ebx,hMem invoke GetCharPtr,ebx,cp mov nMax,eax mov esi,[ebx].EDIT.rpChars add esi,[ebx].EDIT.hChars test [esi].CHARS.state,STATE_COMMENT .if ZERO? xor ecx,ecx .while ecx<nMax .if [ebx].EDIT.ccmntblocks==1 && word ptr [esi+ecx+sizeof CHARS]=="*/" add ecx,2 .while ecx<nMax .break .if word ptr [esi+ecx+sizeof CHARS]=="/*" inc ecx .endw .if word ptr [esi+ecx+sizeof CHARS]=="/*" add ecx,2 .else ;On comment block mov eax,1 jmp Ex .endif .elseif [ebx].EDIT.ccmntblocks==2 && word ptr [esi+ecx+sizeof CHARS]=="'/" add ecx,2 .while ecx<nMax .break .if word ptr [esi+ecx+sizeof CHARS]=="/'" inc ecx .endw .if word ptr [esi+ecx+sizeof CHARS]=="/'" add ecx,2 .else ;On comment block mov eax,1 jmp Ex .endif .else movzx eax,byte ptr [esi+ecx+sizeof CHARS] mov al,byte ptr [eax+offset CharTab] .if al==CT_CMNTCHAR mov eax,2 jmp Ex .elseif al==CT_CMNTDBLCHAR mov al,byte ptr [esi+ecx+sizeof CHARS] mov ah,byte ptr [esi+ecx+sizeof CHARS+1] .if al==ah || ah=='*' mov eax,2 jmp Ex .endif .elseif al==CT_STRING mov al,byte ptr [esi+ecx+sizeof CHARS] .while ecx<nMax inc ecx .break .if al==byte ptr [esi+ecx+sizeof CHARS] .endw .if ecx>=nMax mov eax,3 jmp Ex .endif .endif inc ecx .endif .endw xor eax,eax .else ;On comment block mov eax,1 .endif Ex: ret IsCharPos endp BracketMatchRight proc uses ebx esi edi,hMem:DWORD,nChr:DWORD,nMatch:DWORD,cp:DWORD LOCAL nCount:DWORD mov ebx,hMem mov nCount,0 invoke GetCharPtr,ebx,cp mov edx,eax mov edi,[ebx].EDIT.hChars add edi,[ebx].EDIT.rpChars .while edx<=[edi].CHARS.len mov al,byte ptr nMatch mov ah,byte ptr nChr mov cl,byte ptr bracketcont mov ch,byte ptr bracketcont+1 .if al==byte ptr [edi+edx+sizeof CHARS] push edx invoke IsCharPos,ebx,cp pop edx .if !eax dec nCount .if ZERO? mov eax,edx add eax,[ebx].EDIT.cpLine ret .endif .endif .elseif ah==byte ptr [edi+edx+sizeof CHARS] push edx invoke IsCharPos,ebx,cp pop edx .if !eax inc nCount .endif .elseif (cl==byte ptr [edi+edx+sizeof CHARS] || ch==byte ptr [edi+edx+sizeof CHARS]) && edx<=[edi].CHARS.len .if byte ptr [edi+edx+sizeof CHARS]!=VK_RETURN push edx invoke IsCharPos,ebx,cp pop edx inc edx inc cp .if !eax .while (byte ptr [edi+edx+sizeof CHARS]==VK_SPACE || byte ptr [edi+edx+sizeof CHARS]==VK_TAB) && edx<[edi].CHARS.len inc edx inc cp .endw .endif .if byte ptr [edi+edx+sizeof CHARS]==VK_RETURN inc cp mov eax,cp invoke GetCharPtr,ebx,eax mov edx,eax mov edi,[ebx].EDIT.hChars add edi,[ebx].EDIT.rpChars xor edx,edx .endif .else inc cp mov eax,cp invoke GetCharPtr,ebx,eax mov edx,eax mov edi,[ebx].EDIT.hChars add edi,[ebx].EDIT.rpChars xor edx,edx .endif dec edx dec cp .endif inc edx inc cp .endw xor eax,eax dec eax ret BracketMatchRight endp BracketMatchLeft proc uses ebx esi edi,hMem:DWORD,nChr:DWORD,nMatch:DWORD,cp:DWORD LOCAL nCount:DWORD mov ebx,hMem mov nCount,0 push cp invoke GetCharPtr,ebx,cp mov edx,eax mov edi,[ebx].EDIT.hChars add edi,[ebx].EDIT.rpChars .while sdword ptr edx>=0 mov al,byte ptr nMatch mov ah,byte ptr nChr .if al==byte ptr [edi+edx+sizeof CHARS] push edx invoke IsCharPos,ebx,cp pop edx .if !eax dec nCount .if ZERO? mov eax,edx add eax,[ebx].EDIT.cpLine jmp Ex .endif .endif .elseif ah==byte ptr [edi+edx+sizeof CHARS] push edx invoke IsCharPos,ebx,cp pop edx .if !eax inc nCount .endif .endif .if !edx && [ebx].EDIT.line dec cp invoke GetCharPtr,ebx,cp mov edx,eax mov edi,[ebx].EDIT.hChars add edi,[ebx].EDIT.rpChars .while (byte ptr [edi+edx+sizeof CHARS]==VK_SPACE || byte ptr [edi+edx+sizeof CHARS]==VK_TAB) && edx!=0 dec edx dec cp .endw push edx invoke IsCharPos,ebx,cp pop edx .if !eax .if byte ptr bracketcont!=VK_RETURN .if edx dec edx mov al,byte ptr [edi+edx+sizeof CHARS] .if al!=byte ptr bracketcont && al!=byte ptr bracketcont+1 .break .endif .endif .endif .endif inc cp inc edx .endif dec edx dec cp .endw xor eax,eax dec eax Ex: pop cp push eax invoke GetCharPtr,ebx,cp pop eax ret BracketMatchLeft endp BracketMatch proc uses ebx,hMem:DWORD,nChr:DWORD,cp:DWORD mov ebx,hMem .if [ebx].EDIT.cpbrst!=-1 || [ebx].EDIT.cpbren!=-1 invoke InvalidateEdit,ebx,[ebx].EDIT.edta.hwnd invoke InvalidateEdit,ebx,[ebx].EDIT.edtb.hwnd xor eax,eax dec eax mov [ebx].EDIT.cpbrst,eax mov [ebx].EDIT.cpbren,eax .endif mov al,byte ptr nChr xor ecx,ecx .while byte ptr bracketstart[ecx] .if al==bracketstart[ecx] push ecx invoke IsCharPos,ebx,cp pop ecx or eax,eax jne Ex movzx eax,byte ptr bracketend[ecx] invoke BracketMatchRight,ebx,nChr,eax,cp mov [ebx].EDIT.cpbren,eax mov eax,cp mov [ebx].EDIT.cpbrst,eax invoke InvalidateEdit,ebx,[ebx].EDIT.edta.hwnd invoke InvalidateEdit,ebx,[ebx].EDIT.edtb.hwnd mov eax,[ebx].EDIT.cpbren jmp Ex .endif inc ecx .endw xor ecx,ecx .while byte ptr bracketend[ecx] .if al==bracketend[ecx] push ecx invoke IsCharPos,ebx,cp pop ecx or eax,eax jne Ex movzx eax,byte ptr bracketstart[ecx] invoke BracketMatchLeft,ebx,nChr,eax,cp mov [ebx].EDIT.cpbrst,eax mov eax,cp mov [ebx].EDIT.cpbren,eax invoke InvalidateEdit,ebx,[ebx].EDIT.edta.hwnd invoke InvalidateEdit,ebx,[ebx].EDIT.edtb.hwnd mov eax,[ebx].EDIT.cpbrst jmp Ex .endif inc ecx .endw mov eax,-1 Ex: ret BracketMatch endp GetLineBegin proc uses ebx esi edi,hMem:DWORD,nLine:DWORD mov eax,nLine .if eax .while nLine dec nLine mov eax,nLine lea edi,[eax*4] add edi,[ebx].EDIT.hLine mov esi,[edi].LINE.rpChars add esi,[ebx].EDIT.hChars mov ecx,[esi].CHARS.len .break .if ecx<2 mov al,[esi+ecx+sizeof CHARS-2] .break .if al!=bracketcont && al !=bracketcont[1] .endw mov eax,nLine inc eax .endif ret GetLineBegin endp
19.826316
130
0.605632
4017e81751acd786a081fe31fba89cb291c3edae
4,789
py
Python
Data-Visualization/Seaborn/Plotting graphs with Seaborn.py
Akshat-MS/DataScience-Learning
e3614eeb3aef9c6ba80b425f043b12bc09665d72
[ "MIT" ]
null
null
null
Data-Visualization/Seaborn/Plotting graphs with Seaborn.py
Akshat-MS/DataScience-Learning
e3614eeb3aef9c6ba80b425f043b12bc09665d72
[ "MIT" ]
null
null
null
Data-Visualization/Seaborn/Plotting graphs with Seaborn.py
Akshat-MS/DataScience-Learning
e3614eeb3aef9c6ba80b425f043b12bc09665d72
[ "MIT" ]
null
null
null
#!/usr/bin/env python # coding: utf-8 # # Plotting graphs with Seaborn # In[2]: import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns # In[3]: iris = sns.load_dataset('iris') iris.shape # In[4]: iris.head() # In[5]: iris['species'].unique() # # Univariate Analysis # ## Histogram # # #### Definition # # Histogram indicates how numerical data are distributed. or it is a **graphical representation of data points grouped into ranges** that the user specifies. or Histograms illustrate the frequency distribution of data sets. # # #### Key Pointers # # - Histograms show data in a bar graph-like manner by grouping outcomes along a vertical axis. # - The y-axis of a histogram represents occurrences, either by number or by percentage or in simple words the height of each bar represents either a number count or a percentage. # - MACD (Moving Average Convergence Divergence) histograms are used in technical analysis to indicate changes in momentum in the market. # # #### Difference between histograms and bar charts # # Often, histograms are confused with bar charts.Generally, a histogram is used to plot continuous data, in which each bin represents a range of values, while a bar chart shows categorical data # # More techincally,Histograms depict the frequency distribution of variables in a data set. A bar graph, by contrast, represents a graphical comparison of discrete or categorical variables. # # #### A Histogram's Function # # In statistics, histograms are used to indicate the frequencies of particular types of variables occurring within a defined range. As an example, a census that focuses on the demography of a country may show a histogram showing the number of people aged 0 - 10, 11 - 20, 21 - 30, 31 - 40, 41 - 50, etc. # # A histogram can be customized in several ways by the analyst. As an alternative to frequency, one could use percent of total or density as labels. # Another factor to consider would be bucket size. In the above example, there are 5 buckets with an interval of ten. You could change this, for example, to 10 buckets with a 5-minute interval instead. # # A histogram gives a rough idea of the underlying distribution of data, and is often used for density estimation: estimating the probability density function of underlying variables. # # In[6]: iris['petal_length'] # In[9]: sns.histplot(data=iris,x = 'petal_length',bins = 30) # In[13]: sns.histplot(data=iris,x = 'petal_length',bins = 30,hue='species') # ## KDE - Kernel Density Estimation # # contiuous probability density function (PDF) # In[11]: sns.kdeplot(data = iris, x='petal_length') # In[12]: sns.kdeplot(data = iris, x='petal_length',hue='species') plt.show() # ## Distribution plot # In[14]: sns.displot(data=iris,x='sepal_length',bins=40,hue='species') # ## Bivariante Analysis # ## Scatter plot - using seaborn # In[18]: sns.scatterplot(data=iris,x='petal_length',y = 'petal_width',hue='species') #plt.xlim(-5,10) plt.show() # ## scatter plot using matplotlib # In[20]: setosa = iris[iris['species'] == 'setosa'] versicolor = iris[iris['species'] == 'versicolor'] virginica = iris[iris['species'] == 'virginica'] # In[22]: plt.scatter(x=setosa['petal_length'],y=setosa['petal_width'], c = 'blue') plt.scatter(x=versicolor['petal_length'],y=versicolor['petal_width'], c = 'orange') plt.scatter(x=virginica['petal_length'],y=virginica['petal_width'], c = 'green') # ## Joint plot (Default it joins displot and scatterplot) # In[25]: sns.jointplot(data=iris,x='petal_length',y='petal_width',hue='species') plt.show # In[33]: # ['scatter', 'hist', 'hex', 'kde', 'reg', 'resid'] sns.jointplot(data=iris,x='petal_length',y='petal_width',kind='reg') plt.show # In[38]: sns.jointplot(data=iris,x='petal_length',y='petal_width',hue='species',kind='kde') plt.show # In[41]: sns.jointplot(data=iris,x='sepal_length',y='sepal_width',kind='hex') plt.show # ## Multivariate Analysis # In[42]: iris.head() # In[45]: sns.pairplot(data = iris, hue='species') # # Categorial variables # ## Univariate Analysis # In[46]: iris.head() # In[47]: sns.countplot(data=iris,x = 'species') # ## Box plot # In[49]: sns.boxplot(data=iris, y = 'petal_length') # # Boxplot for Multi-variant Analysis # In[51]: sns.boxplot(data=iris,x = 'species', y = 'sepal_length') # ## violinplot shows distribution and outliers. # In[53]: sns.violinplot(data=iris,x = 'species', y = 'sepal_length') # ## Matrix Plots # In[56]: corr = iris.corr() corr # In[60]: sns.heatmap(corr,annot = True) # In[61]: car_crashes = sns.load_dataset('car_crashes').corr() # In[62]: sns.heatmap(car_crashes.corr(),annot = True) # In[ ]:
18.780392
303
0.70119
6e16733e016c15118d6bf7c839e47db17d10c091
7,207
html
HTML
UI/Blog-Page/signup.html
devu2/My-Brand-David-Uwayezu
6921d7abcd78a0242e7b1ac45aa5d3ce9e8feabb
[ "MIT" ]
null
null
null
UI/Blog-Page/signup.html
devu2/My-Brand-David-Uwayezu
6921d7abcd78a0242e7b1ac45aa5d3ce9e8feabb
[ "MIT" ]
5
2020-07-17T00:00:48.000Z
2021-09-02T16:29:05.000Z
UI/Blog-Page/signup.html
devu2/My-Brand-David-Uwayezu
6921d7abcd78a0242e7b1ac45aa5d3ce9e8feabb
[ "MIT" ]
null
null
null
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta http-equiv="X-UA-Compatible" content="ie=edge" /> <title>Sign Up</title> <link rel="stylesheet" type="text/css" href="../Assets/CSS/index.css" /> <link rel="stylesheet" type="text/css" href="../Assets/CSS/signup.css" /> <!-- <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous"> --> <script src="https://kit.fontawesome.com/de5b2b25e1.js" crossorigin="anonymous" ></script> <script defer src="signup.js"></script> </head> <body> <main> <div> <a href="../Blog-Page/blog.html"><p id="wall">Wall</p></a> </div> <section> <div class="sider-bar" id="icons"> <header> <a href="../Landing-page/index.html" ><img src="../Assets/Images/Capture.JPG" width="90px" /></a> </header> <ul> <li> <a href="../Landing-page/index.html" ><i class="fas fa-home icon active"></i>Home</a > </li> <li> <a href="../About-Me-Page/about.html" ><i class="fa fa-fw fa-user icon"></i>About</a > </li> <li> <a href="../Skills-page/skills.html" ><i class="fas fa-cog icon"></i>Skills</a > </li> <li> <a href="../work-page/work.html" ><i class="fa fa-fw fa-wrench icon"></i>Works</a > </li> <li> <a href="../Contact-Me-Page/contact.html" ><i class="far fa-envelope icon"></i>Contact</a > </li> <li> <a href="../Blog-Page/blog.html" ><i class="fas fa-blog icon"></i>Blogs</a > </li> </ul> <div class="social-links"> <ul> <li> <a href="https://www.instagram.com/david_uwayezu/?hl=en" target="_blank" ><i class="fa fa-instagram start-social-links"></i >Instagram</a > </li> <li> <a href="https://web.facebook.com/david.uwayezu" target="_blank" ><i class="fa fa-facebook"></i>Facebook</a > </li> <li> <a href="https://www.linkedin.com/in/david-uwayezu-77b94b145/" target="_blank" ><i class="fa fa-linkedin"></i>Linkedin</a > </li> <li> <a href="" target="_blank" ><i class="fa fa-twitter"></i>Twitter</a > </li> <li> <a href="https://github.com/devu2" target="_blank" ><i class="fa fa-github end-social-links"></i>Github</a > </li> </ul> </div> </div> <div class="sign-up"> <h1>Sign UP Form</h1> <form action="" class="sign-up-form" id="signupform"> <div class="formContol"> <input type="text" name="firstname" id="firstname" placeholder="First Name" /> <i class="fas fa-check-circle"></i> <i class="fas fa-exclamation-circle"></i> <small>Error message</small> </div> <div class="formContol"> <input type="text" name="lastname" id="lastname" placeholder="Last Name" /> <i class="fas fa-check-circle"></i> <i class="fas fa-exclamation-circle"></i> <small>Error message</small> </div> <div class="formContol"> <input type="email" name="email" id="email" placeholder="Email" /> <!-- <i class="zmdi zmdi-email"></i> --> <i class="fas fa-check-circle"></i> <i class="fas fa-exclamation-circle"></i> <small>Error message</small> </div> <div class="formContol"> <input type="text" name="username" id="username" placeholder="Username" /> <i class="fas fa-check-circle"></i> <i class="fas fa-exclamation-circle"></i> <small>Error message</small> </div> <div class="formContol"> <input type="password" name="password" id="passwordOne" placeholder="Password" /> <i class="fas fa-check-circle"></i> <i class="fas fa-exclamation-circle"></i> <small>Error message</small> </div> <div class="formContol"> <input type="password" name="password" id="passwordTwo" placeholder="Password confirmation" /> <i class="fas fa-check-circle"></i> <i class="fas fa-exclamation-circle"></i> <small>Error message</small> </div> <input type="submit" value="Sign Up" /> <p> Already have an account? <a href="../Blog-Page/signin.html" class="signin">Signin</a> </p> <!-- <i class="zmdi zmdi-arrow-right"></i> --> </form> </div> </section> </main> <script src="https://www.gstatic.com/firebasejs/7.17.1/firebase-app.js"></script> <script src="https://www.gstatic.com/firebasejs/7.17.1/firebase-auth.js"></script> <script src="https://www.gstatic.com/firebasejs/7.17.1/firebase-database.js"></script> <script src="https://www.gstatic.com/firebasejs/7.17.1/firebase-storage.js"></script> <script src="https://www.gstatic.com/firebasejs/7.17.1/firebase-firestore.js"></script> <!-- <script src="https://kit.fontawesome.com/de5b2b25e1.js" crossorigin="anonymous"></script> --> <!-- <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script> --> <!-- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script> --> </body> </html>
37.149485
224
0.480644
e55ba07149ac5984a87f97174618eb39fa4b8765
2,236
tsx
TypeScript
src/cad/NumberInput.tsx
VolodymyrButs/CL
afcb00e54e66be246d5c06714a0df39e24fbd26b
[ "MIT" ]
null
null
null
src/cad/NumberInput.tsx
VolodymyrButs/CL
afcb00e54e66be246d5c06714a0df39e24fbd26b
[ "MIT" ]
null
null
null
src/cad/NumberInput.tsx
VolodymyrButs/CL
afcb00e54e66be246d5c06714a0df39e24fbd26b
[ "MIT" ]
null
null
null
import React, { RefObject } from 'react' import { useTranslation } from 'react-i18next' import styled from 'styled-components' import { light } from './themes/light' const Input = styled.input` font-size: 20px; height: 26px; max-width: 100px; width: 100%; box-sizing: border-box; padding: 2px; border: none; border-radius: 0; border-bottom: solid 1px ${light.bgColor}; @media (max-width: 767px) { font-size: 16px; height: 20px; } ` const Label = styled.span` font-size: 10px; padding-left: 5px; ` const Wrapper = styled.div` position: relative; display: flex; flex-direction: column; padding: 5px; ` const Unit = styled.span` position: absolute; bottom: 7px; right: 5px; ` type Props = { onChange: (event: { target: { value: string } }) => void value: number min?: number max?: number forwardRef?: RefObject<HTMLInputElement> | null pattern?: string type?: string placeholder?: string setInputValue: (arg: number) => void } export const NumberInput = ({ value, min = 0, max = 99999, onChange, forwardRef = null, pattern = '[0-9]*', type = 'text', placeholder = '0', setInputValue, }: Props) => { const { t } = useTranslation() const handleChange = (event: { target: { value: string } }) => { if (isNaN(Number(event.target.value))) { setInputValue(100) return } if (Number(event.target.value) < 0) { setInputValue(100) return } if ((min !== undefined || min === 0) && value < min) { setInputValue(min) return } if ((max !== undefined || max === 0) && value > max) { setInputValue(max) return } onChange(event) } return ( <Wrapper> <Label> {placeholder} </Label> <Unit>{t('unit')}</Unit> <Input value={value} inputMode="decimal" ref={forwardRef} onChange={handleChange} type={type} pattern={pattern} /> </Wrapper> ) }
23.291667
68
0.525939
50725027c162e96a2e7873fd2c0a0b42585eb442
6,349
go
Go
main.go
Zate/poedom
764dd9d37c56b71ade47c2ae6d29dbbddc50abeb
[ "MIT" ]
1
2018-02-02T16:10:07.000Z
2018-02-02T16:10:07.000Z
main.go
Zate/poedom
764dd9d37c56b71ade47c2ae6d29dbbddc50abeb
[ "MIT" ]
null
null
null
main.go
Zate/poedom
764dd9d37c56b71ade47c2ae6d29dbbddc50abeb
[ "MIT" ]
null
null
null
package main import ( "bytes" "encoding/json" "fmt" "html/template" "io" "io/ioutil" "log" "math/rand" "net/http" "os" "strings" "time" "github.com/buger/jsonparser" "github.com/labstack/echo" "github.com/labstack/echo/middleware" "github.com/zate/go-randomdata" ) // CheckErr to handle errors func CheckErr(err error) { if err != nil { log.Fatal(err) } } // GetNums gets the random numbers to determine class and ascendency func GetNums(num1 int, gems int) (classNum int, ascenNum int, gemNum int) { s1 := rand.NewSource(time.Now().UnixNano()) r1 := rand.New(s1) choice := r1.Intn(num1) s2 := rand.NewSource(time.Now().UnixNano()) r2 := rand.New(s2) ascen := r2.Intn(3) s3 := rand.NewSource(time.Now().UnixNano()) r3 := rand.New(s3) gem := r3.Intn(gems) return choice, ascen, gem } // GetGems makes a GET request to the API func GetGems(uri string) (b []byte) { c := &http.Client{} r, err := http.NewRequest("GET", "https://raw.githubusercontent.com/brather1ng/RePoE/master/data/"+uri, nil) CheckErr(err) resp, err := c.Do(r) CheckErr(err) defer resp.Body.Close() b, err = ioutil.ReadAll(resp.Body) CheckErr(err) return b } // Classes should contain a list of all the classes and ascendencies type Classes []struct { Class string `json:"Class"` Ascension []string `json:"Ascension"` } // Result contains the result of choosing a random class / ascendency type Result struct { Class string `json:"class" xml:"class"` Ascendency string `json:"ascendency" xml:"ascendency"` } // TemplateRenderer is a custom html/template renderer for Echo framework type TemplateRenderer struct { templates *template.Template } // Render renders a template document func (t *TemplateRenderer) Render(w io.Writer, name string, data interface{}, c echo.Context) error { if viewContext, isMap := data.(map[string]interface{}); isMap { viewContext["reverse"] = c.Echo().Reverse } return t.templates.ExecuteTemplate(w, name, data) } func contains(arr []string, str string) bool { for _, a := range arr { if a == str { return true } } return false } func main() { log.SetFlags(log.LstdFlags | log.Lmicroseconds | log.Lshortfile) e := echo.New() e.Static("/static", "static") e.File("/favicon.ico", "favicon.ico") e.File("/common.css", "common.css") e.Use(middleware.Logger()) e.Use(middleware.CORSWithConfig(middleware.CORSConfig{ AllowOrigins: []string{"*"}, AllowMethods: []string{echo.GET, echo.PUT, echo.POST, echo.DELETE}, })) var b []byte var Classes Classes var tags []string //var gems []Gems //log.Println(gems) c := []byte(`[{"Class":"Duelist","Ascension":["Slayer","Gladiator","Champion"]},{"Class":"Shadow","Ascension":["Assassin","Saboteur","Trickster"]},{"Class":"Marauder","Ascension":["Juggernaut","Berserker","Chieftain"]},{"Class":"Witch","Ascension":["Necromancer","Occultist","Elementalist"]},{"Class":"Ranger","Ascension":["Deadeye","Raider","Pathfinder"]},{"Class":"Templar","Ascension":["Inquisitor","Hierophant","Guardian"]},{"Class":"Scion","Ascension":["Ascendant","Ascendant","Ascendant"]}]`) err := json.Unmarshal(c, &Classes) b = GetGems("gems.json") buf := new(bytes.Buffer) json.Indent(buf, []byte(b), "", " ") file, err := os.Create("gems.json") CheckErr(err) defer file.Close() fmt.Fprintf(file, buf.String()) gems := []string{} var handler func([]byte, []byte, jsonparser.ValueType, int) error handler = func(key []byte, value []byte, dataType jsonparser.ValueType, offset int) error { skip := false rs, _ := jsonparser.GetString(value, "base_item", "release_state") dn, _ := jsonparser.GetString(value, "base_item", "display_name") sup, _ := jsonparser.GetBoolean(value, "is_support") mc, _ := jsonparser.GetBoolean(value, "active_skill", "is_manually_casted") tag, _, _, _ := jsonparser.Get(value, "active_skill", "types") _ = json.Unmarshal(tag, &tags) for _, t := range tags { //log.Println(t) switch t { case "vaal", "aura", "curse", "movement", "buff": skip = true } } if rs == "released" && sup == false && mc == true && skip == false && dn != "Portal" && dn != "Detonate Mines" && dn != "Decoy Totem" { //log.Printf("%v %v", dn, tags[0]) gems = append(gems, dn) } return nil } jsonparser.ObjectEach(b, handler) numGems := len(gems) log.Println(numGems) renderer := &TemplateRenderer{ templates: template.Must(template.ParseGlob("public/*.html")), } e.Renderer = renderer e.GET("/api", func(c echo.Context) error { num1 := 7 scion := c.FormValue("scion") if scion == "no" { num1 = 6 } choice, ascen, rndgem := GetNums(num1, numGems) gemImg := strings.Replace(gems[rndgem], " ", "_", -1) r := map[string]interface{}{ "class": Classes[choice].Class, "ascendency": Classes[choice].Ascension[ascen], "name": randomdata.SillyName(), "gemImg": gemImg, "gem": gems[rndgem], "league": randomdata.StringSample("SSF Hardcore Abyss", "Normal Hardcore Abyss", "SSF Softcore Abyss", "Normal Softcore Abyss", "SSF Hardcore Standard", "Normal Hardcore Standard", "SSF Softcore Standard", "Normal Softcore Standard"), // "ssf": randomdata.StringSample("SSF", "Normal"), // "hc": randomdata.StringSample("HardCore", "SoftCore"), } return c.JSON(http.StatusOK, r) }) e.GET("/", func(c echo.Context) error { num1 := 7 scion := c.FormValue("scion") if scion == "no" { num1 = 6 } temp := "rnd.html" league := c.FormValue("league") if league == "true" { temp = "rndl.html" } choice, ascen, rndgem := GetNums(num1, numGems) gemImg := strings.Replace(gems[rndgem], " ", "_", -1) return c.Render(http.StatusOK, temp, map[string]interface{}{ "class": Classes[choice].Class, "ascendency": Classes[choice].Ascension[ascen], "name": randomdata.SillyName(), "gemImg": gemImg, "gem": gems[rndgem], "league": randomdata.StringSample("SSF Hardcore Abyss", "Normal Hardcore Abyss", "SSF Softcore Abyss", "Normal Softcore Abyss", "SSF Hardcore Standard", "Normal Hardcore Standard", "SSF Softcore Standard", "Normal Softcore Standard"), // "ssf": randomdata.StringSample("SSF", "Normal"), // "hc": randomdata.StringSample("HardCore", "SoftCore"), }) }).Name = "index" e.Logger.Fatal(e.Start(":2086")) }
31.122549
499
0.655221
2083469b48ca6183cff99d84ae8327c13337b7b3
98
css
CSS
src/styles/ErrorMessage.css
rhofvendahl/step-solve
a5959a4cbf72a04722e6c35ffb8da63474acd06b
[ "MIT" ]
null
null
null
src/styles/ErrorMessage.css
rhofvendahl/step-solve
a5959a4cbf72a04722e6c35ffb8da63474acd06b
[ "MIT" ]
null
null
null
src/styles/ErrorMessage.css
rhofvendahl/step-solve
a5959a4cbf72a04722e6c35ffb8da63474acd06b
[ "MIT" ]
null
null
null
.error { color: #CC0B00; position: fixed; bottom: 2rem; left: 2rem; font-size: 1.5rem; }
14
20
0.612245
2a2c2951e2bcbf811cf3e2206bdece0b8b66d51e
690
java
Java
src/main/java/hu/alphabox/clamav/client/command/Command.java
alphabox/clamav-client
a808716190f8b834f1c70e2ad53d8e1854400b26
[ "Apache-2.0" ]
1
2020-03-25T09:48:18.000Z
2020-03-25T09:48:18.000Z
src/main/java/hu/alphabox/clamav/client/command/Command.java
alphabox/clamav-client
a808716190f8b834f1c70e2ad53d8e1854400b26
[ "Apache-2.0" ]
null
null
null
src/main/java/hu/alphabox/clamav/client/command/Command.java
alphabox/clamav-client
a808716190f8b834f1c70e2ad53d8e1854400b26
[ "Apache-2.0" ]
1
2018-04-02T21:36:18.000Z
2018-04-02T21:36:18.000Z
package hu.alphabox.clamav.client.command; import java.io.ByteArrayOutputStream; import java.io.IOException; import hu.alphabox.clamav.client.ClamAVSeparator; /** * * It represents a ClamAV command. * You can send every command with the simple {@code ClamAVClient}, except * the IDSESSION and the END command, which we use in the session based * clients. * * @author Daniel Mecsei * */ public interface Command { /** * * @param separator an {@code ClamAVSeparator} * @return the requested command in a byte array * @throws IOException if an I/O error occurs. */ public ByteArrayOutputStream getRequestByteArray(ClamAVSeparator separator) throws IOException; }
23.793103
96
0.743478
5134b9a993cabf36e85a36c6ce69e1a9e1ff5b7e
979
swift
Swift
lupa/Global/LupaVersion.swift
LuisPalacios/lupa
6178c23b2f816cbc13525b321721040ac2d91722
[ "MIT" ]
2
2015-08-16T16:36:43.000Z
2015-11-04T15:14:31.000Z
lupa/Global/LupaVersion.swift
LuisPalacios/lupa
6178c23b2f816cbc13525b321721040ac2d91722
[ "MIT" ]
null
null
null
lupa/Global/LupaVersion.swift
LuisPalacios/lupa
6178c23b2f816cbc13525b321721040ac2d91722
[ "MIT" ]
null
null
null
// // ..DO NOT EDIT THIS FILE. It's created automatically from Xcode // Last update: Thu Nov 9 22:35:23 CET 2017 // // // INTRODUCTION // ============ // How to mix XCode version numbers + GIT 'commit' and 'tag' numbers // in order to have a program version string that is useful and // at the same time is compatible with AppStore and GIT. // // Objective: Create a set of #define's in an include file that will be // consumed from your project in order to show the version // // // XCode has created this file with the #define's below and has also // changed the following attributes in the plist file: // /Users/luis/priv/prog.git/github-luispa/lupa/lupa/Info.plist // XCode Version = CFBundleShortVersionString = @"1.2.2" // XCode Build = CFBundleVersion = 94 // // Defines created by XCode that can be used in this project: // let skPROGRAM_DISPLAY_VERSION = "1.2.2" let ikPROGRAM_VERSION = 94 let skPROGRAM_BUILD = "5c125e1"
33.758621
71
0.682329
40f9a3799178118aa154ba03c7d12e8c2c6b2300
244
sql
SQL
sql/tables/sys_login_stat.sql
following5/oc-server3
d555890a5248e5f17e3fc9057f439a75b74d31a5
[ "RSA-MD" ]
null
null
null
sql/tables/sys_login_stat.sql
following5/oc-server3
d555890a5248e5f17e3fc9057f439a75b74d31a5
[ "RSA-MD" ]
null
null
null
sql/tables/sys_login_stat.sql
following5/oc-server3
d555890a5248e5f17e3fc9057f439a75b74d31a5
[ "RSA-MD" ]
null
null
null
SET NAMES 'utf8'; DROP TABLE IF EXISTS `sys_login_stat`; CREATE TABLE `sys_login_stat` ( `day` date NOT NULL, `type` char(10) NOT NULL, `count` int(11) NOT NULL, UNIQUE KEY `day` (`day`,`type`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ;
27.111111
41
0.688525
16b05a4e44b3bfe2a8b9240ea27367d4a5d68a48
14,828
swift
Swift
Core/PHDataManagerCoreData.swift
gee4vee/PasteboardHistory.swift
abcc1e914678bba6656126c38ebece5730391679
[ "Apache-2.0" ]
null
null
null
Core/PHDataManagerCoreData.swift
gee4vee/PasteboardHistory.swift
abcc1e914678bba6656126c38ebece5730391679
[ "Apache-2.0" ]
null
null
null
Core/PHDataManagerCoreData.swift
gee4vee/PasteboardHistory.swift
abcc1e914678bba6656126c38ebece5730391679
[ "Apache-2.0" ]
null
null
null
// // DataManager.swift // // Created by Gabriel Valencia on 4/17/17. // Copyright © 2017 Gabriel Valencia. All rights reserved. // import Cocoa import CoreData import Foundation import SUtils public class PHDataManagerCoreData: NSObject, PHDataMgr { static let MODEL_NAME = "PasteboardHistory" static let BASE_PB_ITEM_CLASS_NAME = "PasteboardItem" static let STRING_PB_ITEM_CLASS_NAME = "StringPasteboardItem" static let BINARY_PB_ITEM_CLASS_NAME = "BinaryPasteboardItem" var maxItems: Int = Preferences.DEFAULT_MAX_SAVED_ITEMS var observer: CoreDataContextObserver? override public init() { super.init() self.refreshMaxSavedItems() NotificationCenter.default.addObserver(self, selector: #selector(PHDataManagerCoreData.defaultsChanged(notification:)), name: UserDefaults.didChangeNotification, object: nil) } public func refreshMaxSavedItems() { if let maxPref = PreferencesManager.getPrefs().string(forKey: Preferences.PREF_KEY_MAX_SAVED_ITEMS) { self.maxItems = Int(maxPref)! } } @objc public func defaultsChanged(notification:NSNotification){ if let defaults = notification.object as? UserDefaults { if let maxPref = defaults.string(forKey: Preferences.PREF_KEY_MAX_SAVED_ITEMS) { self.maxItems = Int(maxPref)! } } } // MARK: - Core Data stack @available(OSX 10.12, *) lazy var persistentContainer: NSPersistentContainer = { NSLog("Initializing persistent container for PasteboardHistory...") let sexyFrameworkBundleIdentifier = "com.valencia.PasteboardHistory" let customKitBundle = Bundle(identifier: sexyFrameworkBundleIdentifier)! let modelURL = customKitBundle.url(forResource: PHDataManagerCoreData.MODEL_NAME, withExtension: "momd")! guard let mom = NSManagedObjectModel.mergedModel(from: [customKitBundle]) else { fatalError("Could not load model") } /* The persistent container for the application. This implementation creates and returns a container, having loaded the store for the application to it. This property is optional since there are legitimate error conditions that could cause the creation of the store to fail. */ let container = NSPersistentContainer(name: PHDataManagerCoreData.MODEL_NAME, managedObjectModel: mom) container.loadPersistentStores(completionHandler: { (storeDescription, error) in if let error = error { // Replace this implementation with code to handle the error appropriately. // fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. /* Typical reasons for an error here include: * The parent directory does not exist, cannot be created, or disallows writing. * The persistent store is not accessible, due to permissions or data protection when the device is locked. * The device is out of space. * The store could not be migrated to the current model version. Check the error message to determine what the actual problem was. */ fatalError("Unresolved error \(error)") } }) return container }() public func getManagedObjectCtx() -> NSManagedObjectContext { var ctx: NSManagedObjectContext? if #available(OSX 10.12, *) { ctx = self.persistentContainer.viewContext } else { ctx = self.managedObjectContext } let mp = NSMergePolicy.init(merge: NSMergePolicyType.mergeByPropertyStoreTrumpMergePolicyType) ctx?.mergePolicy = mp self.observer = CoreDataContextObserver(context: ctx!) return ctx! } @available(macOS 10.11, *) public lazy var managedObjectModel: NSManagedObjectModel = { let modelURL = Bundle.main.url(forResource: PHDataManagerCoreData.MODEL_NAME, withExtension: "momd")! return NSManagedObjectModel(contentsOf: modelURL)! }() @available(macOS 10.11, *) public lazy var managedObjectContext: NSManagedObjectContext = { NSLog("Initializing managed object context directly...") let persistentStoreCoordinator = self.persistentStoreCoordinator // Initialize Managed Object Context var managedObjectContext = NSManagedObjectContext(concurrencyType: .mainQueueConcurrencyType) // Configure Managed Object Context managedObjectContext.persistentStoreCoordinator = persistentStoreCoordinator managedObjectContext.mergePolicy = NSMergePolicy.init(merge: NSMergePolicyType.mergeByPropertyStoreTrumpMergePolicyType) return managedObjectContext }() @available(macOS 10.11, *) public lazy var persistentStoreCoordinator: NSPersistentStoreCoordinator = { // Initialize Persistent Store Coordinator let persistentStoreCoordinator = NSPersistentStoreCoordinator(managedObjectModel: self.managedObjectModel) // URL Documents Directory let URLs = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask) let applicationDocumentsDirectory = URLs[(URLs.count - 1)] // URL Persistent Store let URLPersistentStore = applicationDocumentsDirectory.appendingPathComponent(PHDataManagerCoreData.MODEL_NAME + ".sqlite") do { // Add Persistent Store to Persistent Store Coordinator try persistentStoreCoordinator.addPersistentStore(ofType: NSSQLiteStoreType, configurationName: nil, at: URLPersistentStore, options: nil) } catch { // Populate Error var userInfo = [String: AnyObject]() userInfo[NSLocalizedDescriptionKey] = "There was an error creating or loading the application's saved data." as AnyObject userInfo[NSLocalizedFailureReasonErrorKey] = "There was an error creating or loading the application's saved data." as AnyObject userInfo[NSUnderlyingErrorKey] = error as NSError let wrappedError = NSError(domain: "com.valencia.PasteboardHistory", code: 1001, userInfo: userInfo) NSLog("Unresolved error \(wrappedError), \(wrappedError.userInfo)") abort() } return persistentStoreCoordinator }() // MARK: - Core Data Saving and Undo support public func save(_ sender: AnyObject?) { // Performs the save action for the application, which is to send the save: message to the application's managed object context. Any encountered errors are presented to the user. let context = self.getManagedObjectCtx() if !context.commitEditing() { NSLog("\(NSStringFromClass(type(of: self))) unable to commit editing before saving") } if context.hasChanges { do { // enforce max items self.enforceMaxSavedItems(doSave: false) try context.save() } catch { let nserror = error as NSError NSApplication.shared.presentError(nserror) } } } public func enforceMaxSavedItems(doSave: Bool) { let context = self.getManagedObjectCtx() if !context.commitEditing() { NSLog("\(NSStringFromClass(type(of: self))) unable to commit editing before saving") } do { self.refreshMaxSavedItems() // enforce max items let count = self.fetchTotalCount() if (count > self.maxItems) { let overage = count - self.maxItems let oldest = self.fetchOldest(numToFetch: overage) for item in oldest { try self.deleteById(id: item.id!) } } if doSave { try context.save() } } catch { let nserror = error as NSError NSApplication.shared.presentError(nserror) } } public func saveItemString(str: String) -> StringPasteboardItem { var strItem: StringPasteboardItem? if #available(OSX 10.12, *) { strItem = StringPasteboardItem(context: self.getManagedObjectCtx()) } else { // Fallback on earlier versions strItem = NSEntityDescription.insertNewObject(forEntityName: PHDataManagerCoreData.STRING_PB_ITEM_CLASS_NAME, into: self.getManagedObjectCtx()) as? StringPasteboardItem } strItem!.content = str self.save(nil) NSLog("Saved new \(PHDataManagerCoreData.STRING_PB_ITEM_CLASS_NAME): \(strItem!.content ?? "nil")") return strItem! } public func saveItemBinary(blob: NSData) -> BinaryPasteboardItem { var bItem: BinaryPasteboardItem? if #available(OSX 10.12, *) { bItem = BinaryPasteboardItem(context: self.getManagedObjectCtx()) } else { // Fallback on earlier versions bItem = NSEntityDescription.insertNewObject(forEntityName: PHDataManagerCoreData.BINARY_PB_ITEM_CLASS_NAME, into: self.getManagedObjectCtx()) as? BinaryPasteboardItem } bItem!.binContent = blob // TODO update ID based on binary data. self.observer?.observeObject(object: bItem!, completionBlock: {(object, state) in if let updatedContent = object.committedValues(forKeys: ["binContent"])["binContent"] as? NSData { if let binaryObj = object as? BinaryPasteboardItem { // TODO update ID based on binary data. NSLog("Binary data for item \(binaryObj.id ?? "nil") updated with size \(updatedContent.length)") } } }) self.save(nil) NSLog("Saved new \(PHDataManagerCoreData.BINARY_PB_ITEM_CLASS_NAME) with data size \(bItem!.binContent?.length ?? -1)") return bItem! } public func fetchById(id: String) -> PasteboardItem? { let fetchReq: NSFetchRequest<PasteboardItem> = PasteboardItem.fetchRequest() fetchReq.predicate = NSPredicate(format: "id == %@", argumentArray: [id]) let sortDesc = NSSortDescriptor(key: "timestamp", ascending: false) fetchReq.sortDescriptors = [sortDesc] do { let results = try self.getManagedObjectCtx().fetch(fetchReq) if results.count == 0 { return nil } return results[0] } catch { fatalError("Failed to fetch pasteboard items with id \(id): \(error)") } } public func fetchByStringContent(content: String) -> StringPasteboardItem? { let fetchReq: NSFetchRequest<StringPasteboardItem> = StringPasteboardItem.fetchRequest() fetchReq.predicate = NSPredicate(format: "content == %@", argumentArray: [content]) let sortDesc = NSSortDescriptor(key: "timestamp", ascending: false) fetchReq.sortDescriptors = [sortDesc] do { let results = try self.getManagedObjectCtx().fetch(fetchReq) if results.count == 0 { return nil } return results[0] } catch { fatalError("Failed to fetch pasteboard items with content \(content): \(error)") } } public func fetchOldest(numToFetch: Int) -> [PasteboardItem] { let fetchReq: NSFetchRequest<StringPasteboardItem> = StringPasteboardItem.fetchRequest() fetchReq.fetchLimit = numToFetch let sortDesc = NSSortDescriptor(key: "timestamp", ascending: true) fetchReq.sortDescriptors = [sortDesc] do { let results = try self.getManagedObjectCtx().fetch(fetchReq) return results } catch { fatalError("Failed to fetch oldest items due to error \(error)") } } public func fetchAllPasteboardItems() -> [PasteboardItem] { let fetchAllReq: NSFetchRequest<PasteboardItem> = PasteboardItem.fetchRequest() let sortDesc = NSSortDescriptor(key: "timestamp", ascending: false) fetchAllReq.sortDescriptors = [sortDesc] do { let results = try self.getManagedObjectCtx().fetch(fetchAllReq) return results } catch { fatalError("Failed to fetch saved pasteboard items: \(error)") } } public func fetchTotalCount() -> Int { let fetchAllReq: NSFetchRequest<PasteboardItem> = PasteboardItem.fetchRequest() do { let count = try self.getManagedObjectCtx().count(for: fetchAllReq) return count } catch { fatalError("Failed to fetch saved pasteboard item count: \(error)") } } public func deleteById(id: String) throws { let fetchRequest = NSFetchRequest<NSFetchRequestResult>(entityName: PHDataManagerCoreData.BASE_PB_ITEM_CLASS_NAME) fetchRequest.predicate = NSPredicate(format: "id == %@", argumentArray: [id]) let deleteRequest = NSBatchDeleteRequest(fetchRequest: fetchRequest) do { try self.getManagedObjectCtx().execute(deleteRequest) } catch { NSLog(error.localizedDescription) throw DataMgrError.DeleteFailed(cause: error) } } public func deleteByStringContent(content: String) throws { let fetchRequest = NSFetchRequest<NSFetchRequestResult>(entityName: PHDataManagerCoreData.BASE_PB_ITEM_CLASS_NAME) fetchRequest.predicate = NSPredicate(format: "content == %@", argumentArray: [content]) let deleteRequest = NSBatchDeleteRequest(fetchRequest: fetchRequest) do { try self.getManagedObjectCtx().execute(deleteRequest) } catch { NSLog(error.localizedDescription) throw DataMgrError.DeleteFailed(cause: error) } } public func deleteAllPasteboardItems() throws { let fetchRequest = NSFetchRequest<NSFetchRequestResult>(entityName: PHDataManagerCoreData.BASE_PB_ITEM_CLASS_NAME) let deleteRequest = NSBatchDeleteRequest(fetchRequest: fetchRequest) do { try self.getManagedObjectCtx().execute(deleteRequest) } catch { NSLog(error.localizedDescription) throw DataMgrError.DeleteFailed(cause: error) } } }
43.230321
199
0.641624
da01fe462c37f24ca7cae46f8cd129f3f96d25c8
4,339
sql
SQL
migrations/blog/blog_init.sql
AlloVince/blog
dddd349ac2c20ac766a24086f1edcb99df4c2104
[ "MIT" ]
null
null
null
migrations/blog/blog_init.sql
AlloVince/blog
dddd349ac2c20ac766a24086f1edcb99df4c2104
[ "MIT" ]
null
null
null
migrations/blog/blog_init.sql
AlloVince/blog
dddd349ac2c20ac766a24086f1edcb99df4c2104
[ "MIT" ]
null
null
null
# Dump of table eva_blog_posts # ------------------------------------------------------------ CREATE TABLE `eva_blog_posts` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID', `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '标题', `status` enum('draft','published','pending') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'pending' COMMENT '状态', `visibility` enum('public','private','password') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'public' COMMENT '可见性', `type` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'article' COMMENT '分类', `codeType` varchar(30) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'markdown' COMMENT '原始代码类型', `language` varchar(5) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'en' COMMENT '语言', `parentId` int(10) NOT NULL DEFAULT '0' COMMENT '父ID', `slug` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '唯一标示', `contentStorage` enum('local','remote') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'local' COMMENT '正文存储方式[本地|远程]', `contentRemoteUrl` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '正文远程URL', `contentRemoteHash` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '正文远程Hash', `contentSynchronizedAt` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '正文上次同步时间', `sortOrder` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '排序', `createdAt` int(10) unsigned NOT NULL COMMENT '创建时间', `userId` bigint(19) unsigned NOT NULL DEFAULT '0' COMMENT '创建用户ID', `username` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '创建用户名', `updatedAt` int(10) NOT NULL DEFAULT '0' COMMENT '更新时间', `editorId` bigint(19) unsigned DEFAULT '0' COMMENT '更新用户ID', `editorName` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '更新用户ID', `commentStatus` enum('open','closed','authority') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'open' COMMENT '评论状态', `commentType` varchar(15) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'local' COMMENT '评论类型', `commentCount` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '评论数量', `viewCount` bigint(20) NOT NULL DEFAULT '0' COMMENT '访问量', `imageId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '封面ID', `image` varchar(300) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '封面URL', `summary` varchar(500) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '摘要', `sourceName` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '来源', `sourceUrl` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '来源Url', `deletedAt` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', PRIMARY KEY (`id`), UNIQUE KEY `slug` (`slug`), KEY `createdAt` (`createdAt`), KEY `status` (`status`,`type`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='文章表'; # Dump of table eva_blog_tags # ------------------------------------------------------------ CREATE TABLE `eva_blog_tags` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID', `tagName` varchar(30) COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT 'Tag名', `parentId` int(10) unsigned DEFAULT '0' COMMENT '父ID', `rootId` int(10) unsigned DEFAULT '0' COMMENT '根ID', `sortOrder` int(10) unsigned DEFAULT '0' COMMENT '排序编号', `count` int(10) unsigned DEFAULT '0' COMMENT '统计', PRIMARY KEY (`id`), UNIQUE KEY `tagName` (`tagName`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; # Dump of table eva_blog_tags_posts # ------------------------------------------------------------ CREATE TABLE `eva_blog_tags_posts` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID', `tagId` int(10) unsigned NOT NULL COMMENT 'TAG ID', `postId` int(10) unsigned NOT NULL COMMENT 'POST ID', PRIMARY KEY (`id`), UNIQUE KEY `tagId` (`tagId`,`postId`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; # Dump of table eva_blog_texts # ------------------------------------------------------------ CREATE TABLE `eva_blog_texts` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID', `postId` int(20) unsigned NOT NULL COMMENT '文章ID', `metaKeywords` text COLLATE utf8_unicode_ci COMMENT 'Meta Keywords', `metaDescription` text COLLATE utf8_unicode_ci COMMENT 'Meta Description', `content` longtext COLLATE utf8_unicode_ci NOT NULL COMMENT '文章正文', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
52.277108
115
0.698318
a193a14f9d73e64ed309e9715a5b4b5035247795
6,424
h
C
ds/netapi/netdom/varg.h
npocmaka/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
17
2020-11-13T13:42:52.000Z
2021-09-16T09:13:13.000Z
ds/netapi/netdom/varg.h
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
2
2020-10-19T08:02:06.000Z
2020-10-19T08:23:18.000Z
ds/netapi/netdom/varg.h
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
14
2020-11-14T09:43:20.000Z
2021-08-28T08:59:57.000Z
/*****************************************************************************\ Author: Corey Morgan (coreym) Copyright (c) 1998-2001 Microsoft Corporation \*****************************************************************************/ #ifndef _VARG_H_012599_ #define _VARG_H_012599_ #define MAXSTR 1025 #define NETDOM_MAX_CMDLINE 2048 //Class CToken //It represents a Single Token. class CToken { public: CToken(PCWSTR psz, BOOL bQuote); CToken(); ~CToken(); BOOL Init(PCWSTR psz, BOOL bQuote); PWSTR GetToken() const; BOOL IsSwitch() const; BOOL IsSlash() const; private: LPWSTR m_pszToken; BOOL m_bInitQuote; }; typedef CToken * LPTOKEN; #define ARG_TYPE_INT 0 #define ARG_TYPE_BOOL 1 #define ARG_TYPE_STR 2 #define ARG_TYPE_HELP 3 #define ARG_TYPE_DEBUG 4 #define ARG_TYPE_MSZ 5 #define ARG_TYPE_INTSTR 6 #define ARG_TYPE_VERB 7 // Verbs are not preceeded by a switch character #define ARG_TYPE_LAST 8 #define ARG_FLAG_OPTIONAL 0x00000001 #define ARG_FLAG_REQUIRED 0x00000002 #define ARG_FLAG_DEFAULTABLE 0x00000004 //#define ARG_FLAG_NOFLAG 0x00000008 // unused. #define ARG_FLAG_HIDDEN 0x00000010 #define ARG_FLAG_VERB 0x00000020 // For operation and sub-operation params that do not have a switch char. // Verbs are two state: present or not present; they do not have qualifers such as a user-entered string. #define ARG_FLAG_STDIN 0x00000040 // This must be Required. If not sepcified read from standard input #define ARG_FLAG_ATLEASTONE 0x00000080 // If this flag is specified on one or more switch, at // least one of those switches must be defined #define ARG_FLAG_OBJECT 0x00000100 // The object arg is the 3rd param for most commands. #define ARG_TERMINATOR 0,NULL,0,NULL,ARG_TYPE_LAST,0,(CMD_TYPE)0,FALSE,NULL #define ID_ARG2_NULL (LONG)-1 #define CMD_TYPE void* typedef struct _ARG_RECORD { LONG idArg1; LPTSTR strArg1; LONG idArg2; LPTSTR strArg2; int fType; DWORD fFlag; union{ void* vValue; LPTSTR strValue; int nValue; BOOL bValue; }; BOOL bDefined; DWORD (*fntValidation)(PVOID pArg); } ARG_RECORD, *PARG_RECORD; //Error Source #define ERROR_FROM_PARSER 1 #define ERROR_FROM_VLDFN 2 #define ERROR_WIN32_ERROR 3 //Parse Errors for when ERROR_SOURCE is ERROR_FROM_PARSER /* SWITCH value is incorrect. ArgRecIndex is index of record. ArgvIndex is index of token. */ #define PARSE_ERROR_SWITCH_VALUE 1 /*No Value is given for a swich when one is expected. ArgRecIndex is index of record. ArgvIndex is -1. */ #define PARSE_ERROR_SWICH_NO_VALUE 2 /* Invalid Input ArgRecIndex is -1, ArgvIndex is index of token. */ #define PARSE_ERROR_UNKNOWN_INPUT_PARAMETER 3 /* Required switch is not defined. ArgRecIndex is index of record. ArgvIndex is -1. */ #define PARSE_ERROR_SWITCH_NOTDEFINED 4 /* Switch or Parameter is defined twice. ArgRecIndex is index of record. ArgvIndex is -1 */ #define PARSE_ERROR_MULTIPLE_DEF 5 /* Error Reading From STDIN. ArgRecIndex is -1. ArgvIndex is -1. */ #define ERROR_READING_FROM_STDIN 6 /* Parser Encountered Help Switch ArgRecIndex is index of record. ArgvIndex is -1 */ #define PARSE_ERROR_HELP_SWITCH 7 /* The ARG_FLAG_ATLEASTONE flag was defined on one or more switch yet none of these switches were defined ArgRecIndex is -1 ArgvIndex is -1 */ #define PARSE_ERROR_ATLEASTONE_NOTDEFINED 8 /* Parser Encountered Expert Help Switch ArgRecIndex is index of record. ArgvIndex is -1 */ #define PARSE_ERROR_EXPERT_HELP_SWITCH 9 //Parse Errors for when ERROR_SOURCE is VLDFN /* Use this error code when Validation Function has handled the error and Shown appropriate error message. */ #define VLDFN_ERROR_NO_ERROR 1 //Error is returned by Parser in PARSE_ERROR structure //ErrorSource: Source of Error. Parser or Validation Function //Error This is the actual error code. Its value depend on ErrorSource value. // if( ErrorSource == PARSE_ERROR ) // possible values are ERROR_FROM_PARSER ERROR_FROM_VLDFN // if( ErrorSource == ERROR_FROM_VLDFN ) // depends on the function // ArgRecIndex is appropriate index in the ARG_RECORD, if applicable else -1 // ArgvIndex is approproate index in the agrv array, if applicable else -1 typedef struct _PARSE_ERROR { INT ErrorSource; DWORD Error; INT ArgRecIndex; INT ArgvIndex; } PARSE_ERROR, *PPARSE_ERROR; BOOL ParseCmd(IN ARG_RECORD *Commands, IN int argc, IN CToken *pToken, IN bool fSkipObject, OUT PPARSE_ERROR pError, IN BOOL bValidate = FALSE); void FreeCmd(ARG_RECORD *Commands); DWORD GetCommandInput(OUT int *pargc, //Number of Tokens OUT LPTOKEN *ppToken); //Array of CToken BOOL LoadCmd(ARG_RECORD *Commands); DWORD Tokenize(IN LPWSTR pBuf, IN LONG BufLen, IN LPWSTR pszDelimiters, OUT CToken **ppToken, OUT int *argc, IN LPWSTR pszAltDelimiters = NULL); LONG GetToken(IN LPWSTR pBuf, IN LONG BufLen, IN LPWSTR pszDelimiters, OUT BOOL *bQuote, OUT LPWSTR *ppToken); // Checks if the Standard Handle has been redirected BOOL FileIsConsole( HANDLE fp ); //Function to display string to STDOUT, appending newline VOID DisplayOutput(IN LPWSTR pszOut); //Function to display string to STDOUT, without newline VOID DisplayOutputNoNewline(IN LPWSTR pszOut); // Reads user input, caller must do a LocalFree on ppBuffer LONG ReadFromIn(PWSTR *ppBuffer); // Copied from JSchwart on 2/19/2001 void MyWriteConsole( HANDLE fp, LPWSTR lpBuffer, DWORD cchBuffer ); void WriteStandardOut(PCWSTR pszFormat, ...); #endif //_VARG_H_012599_
28.936937
154
0.636675
0b8d785a697c0b3da778b64fbf2cc6f8d4ea2d37
19,032
py
Python
tools/ig/definitions.py
grahamegrieve/vocab-poc
9f8b6c29b32f15c9513f16f148fdf2a441ba3897
[ "BSD-3-Clause" ]
2
2017-06-25T22:15:18.000Z
2017-09-15T05:12:50.000Z
tools/ig/definitions.py
grahamegrieve/vocab-poc
9f8b6c29b32f15c9513f16f148fdf2a441ba3897
[ "BSD-3-Clause" ]
null
null
null
tools/ig/definitions.py
grahamegrieve/vocab-poc
9f8b6c29b32f15c9513f16f148fdf2a441ba3897
[ "BSD-3-Clause" ]
null
null
null
#! /usr/bin/env python3. # create ig definition file with all value sets in the /resources directory import json, os, sys, logging, re, csv from lxml import etree #logging.disable(logging.CRITICAL) logging.basicConfig(level=logging.DEBUG, format=' %(asctime)s - %(levelname)s- %(message)s') logging.info('Start of program') logging.info('The logging module is working.') # create the ig.json file template as dictoinary logging.info('create the ig.json file template as dictionary') # globals dir = os.getcwd() + '/' # current dir logging.info('cwd = ' + dir) ''' this is the definitions file skeleton you need to modify as needed see ig publisher documenentation at f http://wiki.hl7.org/index.php?title=IG_Publisher_Documentation or more information.''' igpy = { "broken-links": "warning", "canonicalBase": "http://www.fhir.org/guides/ig-template", "defaults": { "Any": { "template-base": "base.html", "template-format": "format.html" }, "CapabilityStatement": { "template-base": "capst.html" }, "CodeSystem": { "template-base": "codesys.html" }, "ConceptMap": { "template-base": "cm.html" }, "OperationDefinition": { "template-base": "op.html" }, "StructureDefinition": { "template-base": "sd.html", "template-defns": "sd-definitions.html", "template-mappings": "sd-mappings.html" }, "ValueSet": { "template-base": "vs.html" } }, "dependencyList": [{}], "do-transforms": "false", "extraTemplates": [ "mappings" ], "fixed-business-version": "0.0.0", "gen-examples": "false", "jurisdiction": "US", "no-inactive-codes": "false", "paths": { "output": "output", "pages": [], "qa": "qa", "resources": [], "specification": "http://build.fhir.org", "temp": "temp", "txCache": "txCache" }, "resources": {}, "sct-edition": "http://snomed.info/sct/731000124108", "source": "ig.xml", "special-urls": [], "spreadsheets": [], "tool": "jekyll", "version": "3.1.0", "working-dir": None, "title": "Implementation Guide Template", "status": "draft", "publisher": "Health eData Inc", "extensions": [], "searches": [], "codesystems": [], "valuesets": [], "structuremaps": [] } logging.info('create the ig.xml file template as string') ''' this is the ig.xml file skeleton may need to modify as needed see ig publisher documenentation at f http://wiki.hl7.org/index.php?title=IG_Publisher_Documentation or more information. The Cap Case words are variables that are replaced by variables in the definitions file''' igxml ='''<?xml version="1.0" encoding="UTF-8"?><!--Hidden IG for de facto IG publishing--><ImplementationGuide xmlns="http://hl7.org/fhir"><id value="ig"/><url value="BASE/ImplementationGuide/ig"/><name value="TITLE"/><status value="STATUS"/><experimental value="true"/><publisher value="PUBLISHER"/><package><name value="base"/></package><page><source value="index.html"/><title value="TITLE Homepage"/><kind value="page"/></page></ImplementationGuide>''' # Function definitions here def init_igpy(): # read non array csv file with open('definitions.csv') as defnfile: # grab a CSV file and make a dict file 'reader reader = csv.DictReader(defnfile, dialect='excel') for row in reader: # each row equal row of csv file as a dict for row_key in row.keys(): # get keys in row logging.info('row_key: ' + row_key) if row[row_key] == 'FALSE' or row[row_key] == 'TRUE': # clean up excel propensity to change the string true/false to TRUE/FALSE row[row_key] = row[row_key].lower() if row[row_key] != "": logging.info('row_key: ' + row_key) try: # deal with nested elements first row_key0 = row_key.split(".")[0] row_key1 = row_key.split(".")[1] # deal with lists first : append csv element to dict value for itemz in row[row_key].split('|'): igpy[row_key0][row_key1].append(itemz) logging.info('updating ig.json with this: { "' + row_key0 + '" { "' + row_key1 + '": ["' + itemz + '",...] } }') except IndexError: # unnested dict elements # deal with lists first : append csv element to dict value for (itemz) in (row[row_key].split('|')): # loop over list of dependencies try: # deal with lists first : append csv element to dict value igpy[row_key].append(itemz) logging.info('updating ig.json with this: { "' + row_key + '": [..."' + itemz + '",...] }') except AttributeError: # simple key value pairs igpy[row_key] = itemz # add/replace csv element to existing dict file logging.info('updating ig.json with this: { "' + row_key + '": "' + itemz + '" }') except AttributeError: # nested dict elements # todo - deal with nested list elements igpy[row_key0][row_key1] = row[row_key] # add/replace csv element to existing dict fil logging.info('updating ig.json with this: { "' + row_key0 + '" { "' + row_key1 + '": "' + row[row_key] + '" } }') except TypeError: # unnested list of objects for (item,itemz) in enumerate(row[row_key].split('|')): # loop over list of dependencies try: igpy[row_key0][item][row_key1]=itemz # create an object for each item in cell except IndexError: igpy[row_key0].append({row_key1:itemz}) # create an object for each item in cell logging.info('updating ig.json with this: { "' + row_key0 + '"[' + str(item) + ']' +':{ "' + row_key1 + '": "' + itemz + '",... }') return def init_igxml(): global igxml logging.info('replace variables in igxml with definitions file value: ' + 'Title: = ' + igpy['title']) igxml = igxml.replace('TITLE', igpy['title']) logging.info('replace variables in igxml with defintions file value: ' + 'Status: = ' + igpy['status']) igxml = igxml.replace('STATUS', igpy['status']) logging.info('replace variables in igxml with defintions file value: ' + 'Base: = ' + igpy['canonicalBase']) igxml = igxml.replace('BASE', igpy['canonicalBase']) logging.info('replace variables in igxml with defintions file value: ' + 'Publisher: = ' + igpy['publisher']) igxml = igxml.replace('PUBLISHER', igpy['publisher']) return(igxml) def make_op_frag(frag_id): # create [id].md file for new operations # default content for files op_frag = ''' This is the markdown file that gets inserted into the op.html template. ''' # check if files already exist before writing files frag = dir + 'pages/_includes/' + frag_id fragf = open(frag + '.md', 'w') fragf.write(frag_id + '.md file\n' + op_frag) logging.info('added file: ' + frag + '.md') return def make_frags(frag_id): # create [id]-intro.md, [id]-search.md and [id]-summary.md files # default content for files intro = ''' This is the introduction markdown file that gets inserted into the sd.html template. This profile sets minimum expectations for blah blah blah ##### Mandatory Data Elements and Terminology The following data-elements are mandatory (i.e data MUST be present). blah blah blah **must have:** 1. blah 1. blah 1. blah **Additional Profile specific implementation guidance:** #### Examples ''' srch = ''' This is the search markdown file that gets inserted into the sd.html Quick Start section for explanation of the search requirements. ''' sumry = ''' This is the summary markdown file that gets inserted into the sd.html template. for a more formal narrative summary of constraints. in future hope to automate this to computer generated code. #### Complete Summary of the Mandatory Requirements 1. 1. 1. ''' # check if files already exist before writing files frag = dir + 'pages/_includes/'+ frag_id fragf = open(frag + '-intro.md', 'w') fragf.write(frag_id + '-intro.md file\n' + intro) logging.info('added file: ' + frag + '-intro.md') fragf = open(frag + '-summary.md', 'w') fragf.write(frag_id + '-summary.md' + sumry) logging.info('added file: ' + frag + '-summary.md') fragf = open(frag + '-search.md', 'w') fragf.write(frag_id + '-search.md file\n' + srch) logging.info('added file: ' + frag +'-search.md') return def update_sd(i, type, logical): namespaces = {'o': 'urn:schemas-microsoft-com:office:office', 'x': 'urn:schemas-microsoft-com:office:excel', 'ss': 'urn:schemas-microsoft-com:office:spreadsheet', } igpy['spreadsheets'].append(i) logging.info('cwd = ' + dir) logging.info('adding ' + i + ' to spreadsheets array') sd_file = open(dir + 'resources/' + i) # for each spreadsheet in /resources open value and read SD id and create and append dict struct to definiions file sdxml = etree.parse(sd_file) # lxml module to parse excel xml if logical: # Get the id from the data element row2 column "element" sdid = sdxml.xpath('/ss:Workbook/ss:Worksheet[3]/ss:Table/ss:Row[2]/ss:Cell[2]/ss:Data', namespaces=namespaces) # use xpath to get the id from the spreadsheet and retain case temp_id = sdid[0].text # retain case update_igxml('StructureDefinition','logical' , temp_id)# add to ig.xml as an SD else: sdid = sdxml.xpath('/ss:Workbook/ss:Worksheet[2]/ss:Table/ss:Row[11]/ss:Cell[2]/ss:Data', namespaces=namespaces) # use xpath to get the id from the spreadsheet and lower case temp_id = sdid[0].text.lower() # use lower case update_igjson(type, temp_id) # add base to definitions file update_igjson(type, temp_id, 'defns') # add base to definitions file if not os.path.exists(dir + 'pages/_includes/'+ temp_id + '-intro.md'): # if intro fragment is missing then create new page fragments for extension make_frags(temp_id) return def update_igxml(type, purpose, id): ev = 'false' if purpose == "example": ev = 'true' vsxml = '<resource><example value="' + ev + '"/><sourceReference><reference value="' + type + '/' + id + '"/></sourceReference></resource>' # concat id into appropriate string global igxml igxml = igxml.replace('name value="base"/>', 'name value="base"/>' + vsxml) # add valueset base def to ig resource logging.info('adding ' + type + vsxml + ' to resources in ig.xml') return def update_igjson(type, id, template = 'base', filename = "blah"): # add base to ig.json - can extend for other templates if needed with extra 'template' param if template == 'base': igpy['resources'][type + '/' + id] = { template : type + '-' + id + '.html'} # concat id into appropriate strings and add valuset base def to resources in def file logging.info('adding ' + type + ' ' + id + ' base to resources ig.json') if template == 'source': igpy['resources'][type + '/' + id][template] = filename # concat filename + xml into appropriate strings and add source in def file logging.info('adding ' + id + ' source filename to resources ig.json') if template == 'defns': igpy['resources'][type + '/' + id][template] = type + '-' + id + '-definitions.html' # concat id into appropriate strings and add sd defitions to in def file logging.info('adding ' + type + ' ' + id + ' definitions to resources ig.json') return def update_def(filename, type, purpose): vsid_re = re.compile(r'<id value="(.*)"/>') # regex for finding the index in vs vs_file = open( dir + 'resources/' + filename) # can use a package like untangle or Xmltodict but I'm gonna regex it for now" vsxml = vs_file.read() # convert to string vsmo = vsid_re.search(vsxml) # get match object which contains id vsid = vsmo.group(1) # get id as string update_igjson(type, vsid) # add base to definitions file update_igjson(type, vsid, 'source', filename) # add source filename to definitions file if type == 'StructureDefinition': update_igjson(type, vsid, 'defns') # add base to definitions file if not os.path.exists(dir + 'pages/_includes/'+ vsid + '-intro.md'): # if intro file fragment is missing then create new page fragments for extension make_frags(vsid) if type == 'OperationDefinition': if not os.path.exists(dir + 'pages/_includes/'+ vsid + '.md'): # if file is missing then create new page fragments for extension make_op_frag(vsid) update_igxml(type, purpose, vsid) return def update_example(type, id, filename): update_igxml(type, 'example', id) # add example to ig.xml file update_igjson(type, id ) # add example base to definitions file update_igjson(type, id,'source', filename) # add source filename to definitions file igpy['defaults'][type] = {'template-base': 'ex.html'} # add example template for type logging.info('adding example template to type ' +type + ' in ig.json') return def get_file(e): ex_file = open(dir + 'examples/' + e) # for each example in /examples open logging.info('load example xml file ' + dir + 'examples/' + e) return ex_file def main(): init_igpy() # read CSV file and update the configuration data init_igxml() # add title, publisher etc to ig.xml global dir if igpy['working-dir']: dir = igpy['working-dir'] # change to the local path name specified in the csv file if present logging.info('cwd = ' + dir) resources = os.listdir(dir + 'resources') # get all the files in the resource directory for i in range(len(resources)): # run through all the files looking for spreadsheets and valuesets if 'spreadsheet' in resources[i]: # for spreadsheets append to the igpy[spreadsheet] array. if 'logical' in resources[i]: # check if logical model logical = True # these need to be handled differently else: logical = False update_sd(resources[i], 'StructureDefinition', logical) # append to the igpy[spreadsheet] array. if 'valueset' in resources[ i]: # for each vs in /resources open valueset resources and read id and create and append dict struct to definiions file update_def(resources[i], 'ValueSet', 'terminology') if 'codesystem' in resources[ i]: # for each vs in /resources open valueset resources and read id and create and append dict struct to definiions file update_def(resources[i], 'CodeSystem', 'terminology') if 'conceptmap' in resources[ i]: # for each vs in /resources open valueset resources and read id and create and append dict struct to definiions file update_def(resources[i], 'ConceptMap', 'terminology') if 'capabilitystatement' in resources[ i]: # for each cs in /resources open, read id and create and append dict struct to definiions file update_def(resources[i], 'CapabilityStatement', 'conformance') if 'operationdefinition' in resources[ i]: # for each cs in /resources open, read id and create and append dict struct to definiions file update_def(resources[i], 'OperationDefinition', 'conformance') if 'structuredefinition' in resources[ i]: # for each cs in /resources open, read id and create and append dict struct to definiions file update_def(resources[i], 'StructureDefinition', 'conformance') if 'searchparameter' in resources[ i]: # for each cs in /resources open, read id and create and append dict struct to definiions file update_def(resources[i], 'SearchParameter', 'conformance') # add spreadsheet extensions for extension in igpy['extensions']: update_igjson('StructureDefinition', extension, 'base') update_igjson('StructureDefinition', extension, 'defns') if not os.path.exists(dir + 'pages/_includes/'+ extension + '-intro.md'): # if intro fragment is missing then create new page fragments for extension make_frags(extension) # add spreadsheet search parameters for search in igpy['searches']: update_igjson('SearchParameter', search, 'base') # add spreadsheet code systems for codesystem in igpy['codesystems']: update_igjson('CodeSystem', codesystem, 'base') update_igjson('ValueSet', codesystem, 'base') # add spreadsheet valuesets for valueset in igpy['valuesets']: update_igjson('ValueSet', valueset, 'base') # add spreadsheet structuremaps for structuremap in igpy['structuremaps']: update_igjson('StructureMap', structuremap, 'base') examples = os.listdir( dir + 'examples') # get all the examples in the examples directory assuming are in json or xml for i in range(len(examples)): # run through all the examples and get id and resource type if 'json' in examples[ i]: # for each cs in /resources open, read id and create and append dict struct to definiions file exjson = json.load(get_file(examples[i])) extype = exjson['resourceType'] ex_id = exjson['id'] update_example(extype, ex_id, examples[i]) if 'xml' in examples[ i]: # for each cs in /resources open, read id and create and append dict struct to definiions file ex_xml = etree.parse(get_file(examples[i])) # lxml module to parse example xml ex_id = ex_xml.xpath('//f:id/@value', namespaces={'f': 'http://hl7.org/fhir'}) # use xpath to get the id extype = ex_xml.xpath('name(/*)') # use xpath to get the type ''' update_example(extype, ex_id[0], examples[i]) # write files ig_file = open(dir + 'ig.json', 'w') ig_file.write(json.dumps(igpy)) # convert dict to json and replace ig.json with this file logging.info('ig.json now looks like : ' + json.dumps(igpy)) ig_file = open(dir + 'resources/ig.xml', 'w') ig_file.write(igxml) # replace ig.xml with this file logging.info('ig.xml now looks like : ' + igxml) return #main if __name__ == '__main__': main() logging.info('End of program')
49.5625
457
0.620954
b1a59637022fedfb68a49e099c050bd91e1bca90
248
h
C
samples/bluetooth/gatt/bas.h
timoML/zephyr-riscv
f14d41a7f352570dcd534d5af0819a33c7e728ae
[ "Apache-2.0" ]
189
2017-04-01T03:05:01.000Z
2022-03-29T10:36:48.000Z
samples/bluetooth/gatt/bas.h
timoML/zephyr-riscv
f14d41a7f352570dcd534d5af0819a33c7e728ae
[ "Apache-2.0" ]
47
2018-09-10T13:55:32.000Z
2022-02-28T14:15:42.000Z
samples/bluetooth/gatt/bas.h
timoML/zephyr-riscv
f14d41a7f352570dcd534d5af0819a33c7e728ae
[ "Apache-2.0" ]
56
2017-05-04T03:51:13.000Z
2022-01-10T06:23:29.000Z
/** @file * @brief BAS Service sample */ /* * Copyright (c) 2016 Intel Corporation * * SPDX-License-Identifier: Apache-2.0 */ #ifdef __cplusplus extern "C" { #endif void bas_init(void); void bas_notify(void); #ifdef __cplusplus } #endif
11.809524
39
0.673387