code
stringlengths
3
1.05M
repo_name
stringlengths
4
116
path
stringlengths
3
942
language
stringclasses
30 values
license
stringclasses
15 values
size
int32
3
1.05M
<? $this->title = Yii::t("UserModule.user", 'Create profile field'); $this->breadcrumbs=array( Yii::t("UserModule.user", 'Profile fields')=>array('admin'), Yii::t("UserModule.user", 'Create')); ?> <?php echo $this->renderPartial('_form', array('model'=>$model)); ?>
stsoft/printable
protected/modules/profile/views/fields/create.php
PHP
bsd-3-clause
270
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_45) on Mon Jul 12 18:25:20 IDT 2021 --> <title>com.exlibris.repository.persistence.sip</title> <meta name="date" content="2021-07-12"> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../script.js"></script> </head> <body> <h1 class="bar"><a href="../../../../../com/exlibris/repository/persistence/sip/package-summary.html" target="classFrame">com.exlibris.repository.persistence.sip</a></h1> <div class="indexContainer"> <h2 title="Classes">Classes</h2> <ul title="Classes"> <li><a href="SIPStatusInfo.html" title="class in com.exlibris.repository.persistence.sip" target="classFrame">SIPStatusInfo</a></li> </ul> </div> </body> </html>
ExLibrisGroup/Rosetta.dps-sdk-projects
7.1/javadoc/com/exlibris/repository/persistence/sip/package-frame.html
HTML
bsd-3-clause
906
/* * Kit.h * * Created on: 21 Aug 2016 * Author: jeremy */ #ifndef SOURCE_DRUMKIT_KITS_KIT_H_ #define SOURCE_DRUMKIT_KITS_KIT_H_ #include "KitParameters.h" #include "KitManager.h" #include "../../Sound/SoundBank/SoundBank.h" #include "../Instruments/Instrument.h" #include "../Triggers/Triggers/Trigger.h" #include <string> #include <vector> namespace DrumKit { class Kit { public: Kit(const KitParameters& params, std::vector<TriggerPtr> const& trigs, std::shared_ptr<Sound::SoundBank> sb); virtual ~Kit(); void Enable(); void Disable(); void Save() const { KitManager::SaveKit(parameters.configFilePath, parameters);} void SetInstrumentVolume(size_t id, float volume); std::string GetConfigFilePath() const noexcept { return parameters.configFilePath; } float GetInstrumentVolume(int id) const { return instruments[id]->GetVolume(); } std::string GetInstrumentName(std::size_t id) const; std::string GetName() const noexcept { return parameters.kitName; } int GetNumInstruments() const { return (int)parameters.instrumentParameters.size(); } const std::vector<InstrumentPtr>& GetInstruments() const { return instruments; } private: void CreateInstruments(); KitParameters parameters; const std::vector<TriggerPtr>& triggers; std::shared_ptr<Sound::SoundBank> soundBank; std::vector<InstrumentPtr> instruments; }; } /* namespace DrumKit */ #endif /* SOURCE_DRUMKIT_KITS_KIT_H_ */
SpintroniK/libeXaDrums
DrumKit/Kits/Kit.h
C
bsd-3-clause
1,473
# -*- coding: utf-8 -*- # # Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the copyright holder nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. from .fetchers import NUPermissionsFetcher from .fetchers import NUMetadatasFetcher from .fetchers import NUGlobalMetadatasFetcher from bambou import NURESTObject class NUAvatar(NURESTObject): """ Represents a Avatar in the VSD Notes: Avatar """ __rest_name__ = "avatar" __resource_name__ = "avatars" ## Constants CONST_ENTITY_SCOPE_GLOBAL = "GLOBAL" CONST_ENTITY_SCOPE_ENTERPRISE = "ENTERPRISE" def __init__(self, **kwargs): """ Initializes a Avatar instance Notes: You can specify all parameters while calling this methods. A special argument named `data` will enable you to load the object from a Python dictionary Examples: >>> avatar = NUAvatar(id=u'xxxx-xxx-xxx-xxx', name=u'Avatar') >>> avatar = NUAvatar(data=my_dict) """ super(NUAvatar, self).__init__() # Read/Write Attributes self._last_updated_by = None self._last_updated_date = None self._embedded_metadata = None self._entity_scope = None self._creation_date = None self._owner = None self._external_id = None self._type = None self.expose_attribute(local_name="last_updated_by", remote_name="lastUpdatedBy", attribute_type=str, is_required=False, is_unique=False) self.expose_attribute(local_name="last_updated_date", remote_name="lastUpdatedDate", attribute_type=str, is_required=False, is_unique=False) self.expose_attribute(local_name="embedded_metadata", remote_name="embeddedMetadata", attribute_type=list, is_required=False, is_unique=False) self.expose_attribute(local_name="entity_scope", remote_name="entityScope", attribute_type=str, is_required=False, is_unique=False, choices=[u'ENTERPRISE', u'GLOBAL']) self.expose_attribute(local_name="creation_date", remote_name="creationDate", attribute_type=str, is_required=False, is_unique=False) self.expose_attribute(local_name="owner", remote_name="owner", attribute_type=str, is_required=False, is_unique=False) self.expose_attribute(local_name="external_id", remote_name="externalID", attribute_type=str, is_required=False, is_unique=True) self.expose_attribute(local_name="type", remote_name="type", attribute_type=str, is_required=False, is_unique=False) # Fetchers self.permissions = NUPermissionsFetcher.fetcher_with_object(parent_object=self, relationship="child") self.metadatas = NUMetadatasFetcher.fetcher_with_object(parent_object=self, relationship="child") self.global_metadatas = NUGlobalMetadatasFetcher.fetcher_with_object(parent_object=self, relationship="child") self._compute_args(**kwargs) # Properties @property def last_updated_by(self): """ Get last_updated_by value. Notes: ID of the user who last updated the object. This attribute is named `lastUpdatedBy` in VSD API. """ return self._last_updated_by @last_updated_by.setter def last_updated_by(self, value): """ Set last_updated_by value. Notes: ID of the user who last updated the object. This attribute is named `lastUpdatedBy` in VSD API. """ self._last_updated_by = value @property def last_updated_date(self): """ Get last_updated_date value. Notes: Time stamp when this object was last updated. This attribute is named `lastUpdatedDate` in VSD API. """ return self._last_updated_date @last_updated_date.setter def last_updated_date(self, value): """ Set last_updated_date value. Notes: Time stamp when this object was last updated. This attribute is named `lastUpdatedDate` in VSD API. """ self._last_updated_date = value @property def embedded_metadata(self): """ Get embedded_metadata value. Notes: Metadata objects associated with this entity. This will contain a list of Metadata objects if the API request is made using the special flag to enable the embedded Metadata feature. Only a maximum of Metadata objects is returned based on the value set in the system configuration. This attribute is named `embeddedMetadata` in VSD API. """ return self._embedded_metadata @embedded_metadata.setter def embedded_metadata(self, value): """ Set embedded_metadata value. Notes: Metadata objects associated with this entity. This will contain a list of Metadata objects if the API request is made using the special flag to enable the embedded Metadata feature. Only a maximum of Metadata objects is returned based on the value set in the system configuration. This attribute is named `embeddedMetadata` in VSD API. """ self._embedded_metadata = value @property def entity_scope(self): """ Get entity_scope value. Notes: Specify if scope of entity is Data center or Enterprise level This attribute is named `entityScope` in VSD API. """ return self._entity_scope @entity_scope.setter def entity_scope(self, value): """ Set entity_scope value. Notes: Specify if scope of entity is Data center or Enterprise level This attribute is named `entityScope` in VSD API. """ self._entity_scope = value @property def creation_date(self): """ Get creation_date value. Notes: Time stamp when this object was created. This attribute is named `creationDate` in VSD API. """ return self._creation_date @creation_date.setter def creation_date(self, value): """ Set creation_date value. Notes: Time stamp when this object was created. This attribute is named `creationDate` in VSD API. """ self._creation_date = value @property def owner(self): """ Get owner value. Notes: Identifies the user that has created this object. """ return self._owner @owner.setter def owner(self, value): """ Set owner value. Notes: Identifies the user that has created this object. """ self._owner = value @property def external_id(self): """ Get external_id value. Notes: External object ID. Used for integration with third party systems This attribute is named `externalID` in VSD API. """ return self._external_id @external_id.setter def external_id(self, value): """ Set external_id value. Notes: External object ID. Used for integration with third party systems This attribute is named `externalID` in VSD API. """ self._external_id = value @property def type(self): """ Get type value. Notes: The image type """ return self._type @type.setter def type(self, value): """ Set type value. Notes: The image type """ self._type = value
nuagenetworks/vspk-python
vspk/v6/nuavatar.py
Python
bsd-3-clause
9,831
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> <title>Zend_Session - Zend Framework Manual</title> </head> <body> <table width="100%"> <tr valign="top"> <td width="85%"> <table width="100%"> <tr> <td width="25%" style="text-align: left;"> <a href="zend.service.yahoo.html">Zend_Service_Yahoo</a> </td> <td width="50%" style="text-align: center;"> <div class="up"><span class="up"><a href="reference.html">Zend Framework Reference</a></span><br /> <span class="home"><a href="manual.html">Programmer's Reference Guide</a></span></div> </td> <td width="25%" style="text-align: right;"> <div class="next" style="text-align: right; float: right;"><a href="zend.session.introduction.html">Einf&uuml;hrung</a></div> </td> </tr> </table> <hr /> <div id="zend.session" class="chapter"><div class="info"><h1>Zend_Session</h1><strong>Table of Contents</strong><ul class="chunklist chunklist_title"> <li><a href="zend.session.introduction.html">Einf&uuml;hrung</a></li> <li><a href="zend.session.basic_usage.html">Grunds&auml;tzliche Verwendung</a></li> <li><a href="zend.session.advanced_usage.html">Fortgeschrittene Benutzung</a></li> <li><a href="zend.session.global_session_management.html">Globales Session Management</a></li> <li><a href="zend.session.savehandler.dbtable.html">Zend_Session_SaveHandler_DbTable</a></li> </ul> </div> </div> <hr /> <table width="100%"> <tr> <td width="25%" style="text-align: left;"> <a href="zend.service.yahoo.html">Zend_Service_Yahoo</a> </td> <td width="50%" style="text-align: center;"> <div class="up"><span class="up"><a href="reference.html">Zend Framework Reference</a></span><br /> <span class="home"><a href="manual.html">Programmer's Reference Guide</a></span></div> </td> <td width="25%" style="text-align: right;"> <div class="next" style="text-align: right; float: right;"><a href="zend.session.introduction.html">Einf&uuml;hrung</a></div> </td> </tr> </table> </td> <td style="font-size: smaller;" width="15%"> <style type="text/css"> #leftbar { float: left; width: 186px; padding: 5px; font-size: smaller; } ul.toc { margin: 0px 5px 5px 5px; padding: 0px; } ul.toc li { font-size: 85%; margin: 1px 0 1px 1px; padding: 1px 0 1px 11px; list-style-type: none; background-repeat: no-repeat; background-position: center left; } ul.toc li.header { font-size: 115%; padding: 5px 0px 5px 11px; border-bottom: 1px solid #cccccc; margin-bottom: 5px; } ul.toc li.active { font-weight: bold; } ul.toc li a { text-decoration: none; } ul.toc li a:hover { text-decoration: underline; } </style> <ul class="toc"> <li class="header home"><a href="manual.html">Programmer's Reference Guide</a></li> <li class="header up"><a href="manual.html">Programmer's Reference Guide</a></li> <li class="header up"><a href="reference.html">Zend Framework Reference</a></li> <li><a href="zend.acl.html">Zend_Acl</a></li> <li><a href="zend.amf.html">Zend_Amf</a></li> <li><a href="zend.application.html">Zend_Application</a></li> <li><a href="zend.auth.html">Zend_Auth</a></li> <li><a href="zend.barcode.html">Zend_Barcode</a></li> <li><a href="zend.cache.html">Zend_Cache</a></li> <li><a href="zend.captcha.html">Zend_Captcha</a></li> <li><a href="zend.cloud.html">SimpleCloud API: Zend_Cloud</a></li> <li><a href="zend.codegenerator.html">Zend_CodeGenerator</a></li> <li><a href="zend.config.html">Zend_Config</a></li> <li><a href="zend.config.writer.html">Zend_Config_Writer</a></li> <li><a href="zend.console.getopt.html">Zend_Console_Getopt</a></li> <li><a href="zend.controller.html">Zend_Controller</a></li> <li><a href="zend.currency.html">Zend_Currency</a></li> <li><a href="zend.date.html">Zend_Date</a></li> <li><a href="zend.db.html">Zend_Db</a></li> <li><a href="zend.debug.html">Zend_Debug</a></li> <li><a href="zend.dojo.html">Zend_Dojo</a></li> <li><a href="zend.dom.html">Zend_Dom</a></li> <li><a href="zend.exception.html">Zend_Exception</a></li> <li><a href="zend.feed.html">Zend_Feed</a></li> <li><a href="zend.file.html">Zend_File</a></li> <li><a href="zend.filter.html">Zend_Filter</a></li> <li><a href="zend.form.html">Zend_Form</a></li> <li><a href="zend.gdata.html">Zend_Gdata</a></li> <li><a href="zend.http.html">Zend_Http</a></li> <li><a href="zend.infocard.html">Zend_InfoCard</a></li> <li><a href="zend.json.html">Zend_Json</a></li> <li><a href="zend.layout.html">Zend_Layout</a></li> <li><a href="zend.ldap.html">Zend_Ldap</a></li> <li><a href="zend.loader.html">Zend_Loader</a></li> <li><a href="zend.locale.html">Zend_Locale</a></li> <li><a href="zend.log.html">Zend_Log</a></li> <li><a href="zend.mail.html">Zend_Mail</a></li> <li><a href="zend.markup.html">Zend_Markup</a></li> <li><a href="zend.measure.html">Zend_Measure</a></li> <li><a href="zend.memory.html">Zend_Memory</a></li> <li><a href="zend.mime.html">Zend_Mime</a></li> <li><a href="zend.navigation.html">Zend_Navigation</a></li> <li><a href="zend.oauth.html">Zend_Oauth</a></li> <li><a href="zend.openid.html">Zend_OpenId</a></li> <li><a href="zend.paginator.html">Zend_Paginator</a></li> <li><a href="zend.pdf.html">Zend_Pdf</a></li> <li><a href="zend.progressbar.html">Zend_ProgressBar</a></li> <li><a href="zend.queue.html">Zend_Queue</a></li> <li><a href="zend.reflection.html">Zend_Reflection</a></li> <li><a href="zend.registry.html">Zend_Registry</a></li> <li><a href="zend.rest.html">Zend_Rest</a></li> <li><a href="zend.search.lucene.html">Zend_Search_Lucene</a></li> <li><a href="zend.serializer.html">Zend_Serializer</a></li> <li><a href="zend.server.html">Zend_Server</a></li> <li><a href="zend.service.html">Zend_Service</a></li> <li class="active"><a href="zend.session.html">Zend_Session</a></li> <li><a href="zend.soap.html">Zend_Soap</a></li> <li><a href="zend.tag.html">Zend_Tag</a></li> <li><a href="zend.test.html">Zend_Test</a></li> <li><a href="zend.text.html">Zend_Text</a></li> <li><a href="zend.timesync.html">Zend_TimeSync</a></li> <li><a href="zend.tool.html">Zend_Tool</a></li> <li><a href="zend.tool.framework.html">Zend_Tool_Framework</a></li> <li><a href="zend.tool.project.html">Zend_Tool_Project</a></li> <li><a href="zend.translate.html">Zend_Translate</a></li> <li><a href="zend.uri.html">Zend_Uri</a></li> <li><a href="zend.validate.html">Zend_Validate</a></li> <li><a href="zend.version.html">Zend_Version</a></li> <li><a href="zend.view.html">Zend_View</a></li> <li><a href="zend.wildfire.html">Zend_Wildfire</a></li> <li><a href="zend.xmlrpc.html">Zend_XmlRpc</a></li> <li><a href="zendx.console.process.unix.html">ZendX_Console_Process_Unix</a></li> <li><a href="zendx.jquery.html">ZendX_JQuery</a></li> </ul> </td> </tr> </table> </body> </html>
wukchung/Home-development
documentation/manual/core/de/zend.session.html
HTML
bsd-3-clause
7,661
/* * hostapd / Initialization and configuration * Copyright (c) 2002-2014, Jouni Malinen <[email protected]> * * This software may be distributed under the terms of the BSD license. * See README for more details. */ #include "utils/includes.h" #include "utils/common.h" #include "utils/eloop.h" #include "common/ieee802_11_defs.h" #include "common/wpa_ctrl.h" #include "common/hw_features_common.h" #include "radius/radius_client.h" #include "radius/radius_das.h" #include "eap_server/tncs.h" #include "eapol_auth/eapol_auth_sm.h" #include "eapol_auth/eapol_auth_sm_i.h" #include "fst/fst.h" #include "hostapd.h" #include "authsrv.h" #include "sta_info.h" #include "accounting.h" #include "ap_list.h" #include "beacon.h" #include "iapp.h" #include "ieee802_1x.h" #include "ieee802_11_auth.h" #include "vlan_init.h" #include "wpa_auth.h" #include "wps_hostapd.h" #include "hw_features.h" #include "wpa_auth_glue.h" #include "ap_drv_ops.h" #include "ap_config.h" #include "p2p_hostapd.h" #include "gas_serv.h" #include "dfs.h" #include "ieee802_11.h" #include "bss_load.h" #include "x_snoop.h" #include "dhcp_snoop.h" #include "ndisc_snoop.h" #include "neighbor_db.h" #include "rrm.h" #ifdef CONFIG_KARMA_ATTACK #include "karma_handlers.h" #endif static int hostapd_flush_old_stations(struct hostapd_data *hapd, u16 reason); static int hostapd_setup_encryption(char *iface, struct hostapd_data *hapd); static int hostapd_broadcast_wep_clear(struct hostapd_data *hapd); static int setup_interface2(struct hostapd_iface *iface); static void channel_list_update_timeout(void *eloop_ctx, void *timeout_ctx); #ifdef CONFIG_KARMA_ATTACK struct hostapd_data *g_hapd_data; #endif int hostapd_for_each_interface(struct hapd_interfaces *interfaces, int (*cb)(struct hostapd_iface *iface, void *ctx), void *ctx) { size_t i; int ret; for (i = 0; i < interfaces->count; i++) { ret = cb(interfaces->iface[i], ctx); if (ret) return ret; } return 0; } static void hostapd_reload_bss(struct hostapd_data *hapd) { struct hostapd_ssid *ssid; #ifndef CONFIG_NO_RADIUS radius_client_reconfig(hapd->radius, hapd->conf->radius); #endif /* CONFIG_NO_RADIUS */ ssid = &hapd->conf->ssid; if (!ssid->wpa_psk_set && ssid->wpa_psk && !ssid->wpa_psk->next && ssid->wpa_passphrase_set && ssid->wpa_passphrase) { /* * Force PSK to be derived again since SSID or passphrase may * have changed. */ hostapd_config_clear_wpa_psk(&hapd->conf->ssid.wpa_psk); } if (hostapd_setup_wpa_psk(hapd->conf)) { wpa_printf(MSG_ERROR, "Failed to re-configure WPA PSK " "after reloading configuration"); } if (hapd->conf->ieee802_1x || hapd->conf->wpa) hostapd_set_drv_ieee8021x(hapd, hapd->conf->iface, 1); else hostapd_set_drv_ieee8021x(hapd, hapd->conf->iface, 0); if ((hapd->conf->wpa || hapd->conf->osen) && hapd->wpa_auth == NULL) { hostapd_setup_wpa(hapd); if (hapd->wpa_auth) wpa_init_keys(hapd->wpa_auth); } else if (hapd->conf->wpa) { const u8 *wpa_ie; size_t wpa_ie_len; hostapd_reconfig_wpa(hapd); wpa_ie = wpa_auth_get_wpa_ie(hapd->wpa_auth, &wpa_ie_len); if (hostapd_set_generic_elem(hapd, wpa_ie, wpa_ie_len)) wpa_printf(MSG_ERROR, "Failed to configure WPA IE for " "the kernel driver."); } else if (hapd->wpa_auth) { wpa_deinit(hapd->wpa_auth); hapd->wpa_auth = NULL; hostapd_set_privacy(hapd, 0); hostapd_setup_encryption(hapd->conf->iface, hapd); hostapd_set_generic_elem(hapd, (u8 *) "", 0); } ieee802_11_set_beacon(hapd); hostapd_update_wps(hapd); if (hapd->conf->ssid.ssid_set && hostapd_set_ssid(hapd, hapd->conf->ssid.ssid, hapd->conf->ssid.ssid_len)) { wpa_printf(MSG_ERROR, "Could not set SSID for kernel driver"); /* try to continue */ } wpa_printf(MSG_DEBUG, "Reconfigured interface %s", hapd->conf->iface); } static void hostapd_clear_old(struct hostapd_iface *iface) { size_t j; /* * Deauthenticate all stations since the new configuration may not * allow them to use the BSS anymore. */ for (j = 0; j < iface->num_bss; j++) { hostapd_flush_old_stations(iface->bss[j], WLAN_REASON_PREV_AUTH_NOT_VALID); hostapd_broadcast_wep_clear(iface->bss[j]); #ifndef CONFIG_NO_RADIUS /* TODO: update dynamic data based on changed configuration * items (e.g., open/close sockets, etc.) */ radius_client_flush(iface->bss[j]->radius, 0); #endif /* CONFIG_NO_RADIUS */ } } int hostapd_reload_config(struct hostapd_iface *iface) { struct hostapd_data *hapd = iface->bss[0]; struct hostapd_config *newconf, *oldconf; size_t j; if (iface->config_fname == NULL) { /* Only in-memory config in use - assume it has been updated */ hostapd_clear_old(iface); for (j = 0; j < iface->num_bss; j++) hostapd_reload_bss(iface->bss[j]); return 0; } if (iface->interfaces == NULL || iface->interfaces->config_read_cb == NULL) return -1; newconf = iface->interfaces->config_read_cb(iface->config_fname); if (newconf == NULL) return -1; hostapd_clear_old(iface); oldconf = hapd->iconf; iface->conf = newconf; for (j = 0; j < iface->num_bss; j++) { hapd = iface->bss[j]; hapd->iconf = newconf; hapd->iconf->channel = oldconf->channel; hapd->iconf->acs = oldconf->acs; hapd->iconf->secondary_channel = oldconf->secondary_channel; hapd->iconf->ieee80211n = oldconf->ieee80211n; hapd->iconf->ieee80211ac = oldconf->ieee80211ac; hapd->iconf->ht_capab = oldconf->ht_capab; hapd->iconf->vht_capab = oldconf->vht_capab; hapd->iconf->vht_oper_chwidth = oldconf->vht_oper_chwidth; hapd->iconf->vht_oper_centr_freq_seg0_idx = oldconf->vht_oper_centr_freq_seg0_idx; hapd->iconf->vht_oper_centr_freq_seg1_idx = oldconf->vht_oper_centr_freq_seg1_idx; hapd->conf = newconf->bss[j]; hostapd_reload_bss(hapd); } hostapd_config_free(oldconf); return 0; } static void hostapd_broadcast_key_clear_iface(struct hostapd_data *hapd, const char *ifname) { int i; if (!ifname) return; for (i = 0; i < NUM_WEP_KEYS; i++) { if (hostapd_drv_set_key(ifname, hapd, WPA_ALG_NONE, NULL, i, 0, NULL, 0, NULL, 0)) { wpa_printf(MSG_DEBUG, "Failed to clear default " "encryption keys (ifname=%s keyidx=%d)", ifname, i); } } #ifdef CONFIG_IEEE80211W if (hapd->conf->ieee80211w) { for (i = NUM_WEP_KEYS; i < NUM_WEP_KEYS + 2; i++) { if (hostapd_drv_set_key(ifname, hapd, WPA_ALG_NONE, NULL, i, 0, NULL, 0, NULL, 0)) { wpa_printf(MSG_DEBUG, "Failed to clear " "default mgmt encryption keys " "(ifname=%s keyidx=%d)", ifname, i); } } } #endif /* CONFIG_IEEE80211W */ } static int hostapd_broadcast_wep_clear(struct hostapd_data *hapd) { hostapd_broadcast_key_clear_iface(hapd, hapd->conf->iface); return 0; } static int hostapd_broadcast_wep_set(struct hostapd_data *hapd) { int errors = 0, idx; struct hostapd_ssid *ssid = &hapd->conf->ssid; idx = ssid->wep.idx; if (ssid->wep.default_len && hostapd_drv_set_key(hapd->conf->iface, hapd, WPA_ALG_WEP, broadcast_ether_addr, idx, 1, NULL, 0, ssid->wep.key[idx], ssid->wep.len[idx])) { wpa_printf(MSG_WARNING, "Could not set WEP encryption."); errors++; } return errors; } static void hostapd_free_hapd_data(struct hostapd_data *hapd) { os_free(hapd->probereq_cb); hapd->probereq_cb = NULL; hapd->num_probereq_cb = 0; #ifdef CONFIG_P2P wpabuf_free(hapd->p2p_beacon_ie); hapd->p2p_beacon_ie = NULL; wpabuf_free(hapd->p2p_probe_resp_ie); hapd->p2p_probe_resp_ie = NULL; #endif /* CONFIG_P2P */ if (!hapd->started) { wpa_printf(MSG_ERROR, "%s: Interface %s wasn't started", __func__, hapd->conf->iface); return; } hapd->started = 0; wpa_printf(MSG_DEBUG, "%s(%s)", __func__, hapd->conf->iface); iapp_deinit(hapd->iapp); hapd->iapp = NULL; accounting_deinit(hapd); hostapd_deinit_wpa(hapd); vlan_deinit(hapd); hostapd_acl_deinit(hapd); #ifndef CONFIG_NO_RADIUS radius_client_deinit(hapd->radius); hapd->radius = NULL; radius_das_deinit(hapd->radius_das); hapd->radius_das = NULL; #endif /* CONFIG_NO_RADIUS */ hostapd_deinit_wps(hapd); authsrv_deinit(hapd); if (hapd->interface_added) { hapd->interface_added = 0; if (hostapd_if_remove(hapd, WPA_IF_AP_BSS, hapd->conf->iface)) { wpa_printf(MSG_WARNING, "Failed to remove BSS interface %s", hapd->conf->iface); hapd->interface_added = 1; } else { /* * Since this was a dynamically added interface, the * driver wrapper may have removed its internal instance * and hapd->drv_priv is not valid anymore. */ hapd->drv_priv = NULL; } } wpabuf_free(hapd->time_adv); #ifdef CONFIG_INTERWORKING gas_serv_deinit(hapd); #endif /* CONFIG_INTERWORKING */ bss_load_update_deinit(hapd); ndisc_snoop_deinit(hapd); dhcp_snoop_deinit(hapd); x_snoop_deinit(hapd); #ifdef CONFIG_SQLITE bin_clear_free(hapd->tmp_eap_user.identity, hapd->tmp_eap_user.identity_len); bin_clear_free(hapd->tmp_eap_user.password, hapd->tmp_eap_user.password_len); #endif /* CONFIG_SQLITE */ #ifdef CONFIG_MESH wpabuf_free(hapd->mesh_pending_auth); hapd->mesh_pending_auth = NULL; #endif /* CONFIG_MESH */ hostapd_clean_rrm(hapd); } /** * hostapd_cleanup - Per-BSS cleanup (deinitialization) * @hapd: Pointer to BSS data * * This function is used to free all per-BSS data structures and resources. * Most of the modules that are initialized in hostapd_setup_bss() are * deinitialized here. */ static void hostapd_cleanup(struct hostapd_data *hapd) { wpa_printf(MSG_DEBUG, "%s(hapd=%p (%s))", __func__, hapd, hapd->conf->iface); if (hapd->iface->interfaces && hapd->iface->interfaces->ctrl_iface_deinit) hapd->iface->interfaces->ctrl_iface_deinit(hapd); hostapd_free_hapd_data(hapd); } static void sta_track_deinit(struct hostapd_iface *iface) { struct hostapd_sta_info *info; if (!iface->num_sta_seen) return; while ((info = dl_list_first(&iface->sta_seen, struct hostapd_sta_info, list))) { dl_list_del(&info->list); iface->num_sta_seen--; sta_track_del(info); } } static void hostapd_cleanup_iface_partial(struct hostapd_iface *iface) { wpa_printf(MSG_DEBUG, "%s(%p)", __func__, iface); #ifdef CONFIG_IEEE80211N #ifdef NEED_AP_MLME hostapd_stop_setup_timers(iface); #endif /* NEED_AP_MLME */ #endif /* CONFIG_IEEE80211N */ hostapd_free_hw_features(iface->hw_features, iface->num_hw_features); iface->hw_features = NULL; os_free(iface->current_rates); iface->current_rates = NULL; os_free(iface->basic_rates); iface->basic_rates = NULL; ap_list_deinit(iface); sta_track_deinit(iface); } /** * hostapd_cleanup_iface - Complete per-interface cleanup * @iface: Pointer to interface data * * This function is called after per-BSS data structures are deinitialized * with hostapd_cleanup(). */ static void hostapd_cleanup_iface(struct hostapd_iface *iface) { wpa_printf(MSG_DEBUG, "%s(%p)", __func__, iface); eloop_cancel_timeout(channel_list_update_timeout, iface, NULL); hostapd_cleanup_iface_partial(iface); hostapd_config_free(iface->conf); iface->conf = NULL; os_free(iface->config_fname); os_free(iface->bss); wpa_printf(MSG_DEBUG, "%s: free iface=%p", __func__, iface); os_free(iface); } static void hostapd_clear_wep(struct hostapd_data *hapd) { if (hapd->drv_priv && !hapd->iface->driver_ap_teardown) { hostapd_set_privacy(hapd, 0); hostapd_broadcast_wep_clear(hapd); } } static int hostapd_setup_encryption(char *iface, struct hostapd_data *hapd) { int i; hostapd_broadcast_wep_set(hapd); if (hapd->conf->ssid.wep.default_len) { hostapd_set_privacy(hapd, 1); return 0; } /* * When IEEE 802.1X is not enabled, the driver may need to know how to * set authentication algorithms for static WEP. */ hostapd_drv_set_authmode(hapd, hapd->conf->auth_algs); for (i = 0; i < 4; i++) { if (hapd->conf->ssid.wep.key[i] && hostapd_drv_set_key(iface, hapd, WPA_ALG_WEP, NULL, i, i == hapd->conf->ssid.wep.idx, NULL, 0, hapd->conf->ssid.wep.key[i], hapd->conf->ssid.wep.len[i])) { wpa_printf(MSG_WARNING, "Could not set WEP " "encryption."); return -1; } if (hapd->conf->ssid.wep.key[i] && i == hapd->conf->ssid.wep.idx) hostapd_set_privacy(hapd, 1); } return 0; } static int hostapd_flush_old_stations(struct hostapd_data *hapd, u16 reason) { int ret = 0; u8 addr[ETH_ALEN]; if (hostapd_drv_none(hapd) || hapd->drv_priv == NULL) return 0; if (!hapd->iface->driver_ap_teardown) { wpa_dbg(hapd->msg_ctx, MSG_DEBUG, "Flushing old station entries"); if (hostapd_flush(hapd)) { wpa_msg(hapd->msg_ctx, MSG_WARNING, "Could not connect to kernel driver"); ret = -1; } } wpa_dbg(hapd->msg_ctx, MSG_DEBUG, "Deauthenticate all stations"); os_memset(addr, 0xff, ETH_ALEN); hostapd_drv_sta_deauth(hapd, addr, reason); hostapd_free_stas(hapd); return ret; } static void hostapd_bss_deinit_no_free(struct hostapd_data *hapd) { #ifdef CONFIG_KARMA_ATTACK free_all_karma_data(hapd); #endif hostapd_free_stas(hapd); hostapd_flush_old_stations(hapd, WLAN_REASON_DEAUTH_LEAVING); hostapd_clear_wep(hapd); } /** * hostapd_validate_bssid_configuration - Validate BSSID configuration * @iface: Pointer to interface data * Returns: 0 on success, -1 on failure * * This function is used to validate that the configured BSSIDs are valid. */ static int hostapd_validate_bssid_configuration(struct hostapd_iface *iface) { u8 mask[ETH_ALEN] = { 0 }; struct hostapd_data *hapd = iface->bss[0]; unsigned int i = iface->conf->num_bss, bits = 0, j; int auto_addr = 0; if (hostapd_drv_none(hapd)) return 0; if (iface->conf->use_driver_iface_addr) return 0; /* Generate BSSID mask that is large enough to cover the BSSIDs. */ /* Determine the bits necessary to cover the number of BSSIDs. */ for (i--; i; i >>= 1) bits++; /* Determine the bits necessary to any configured BSSIDs, if they are higher than the number of BSSIDs. */ for (j = 0; j < iface->conf->num_bss; j++) { if (is_zero_ether_addr(iface->conf->bss[j]->bssid)) { if (j) auto_addr++; continue; } for (i = 0; i < ETH_ALEN; i++) { mask[i] |= iface->conf->bss[j]->bssid[i] ^ hapd->own_addr[i]; } } if (!auto_addr) goto skip_mask_ext; for (i = 0; i < ETH_ALEN && mask[i] == 0; i++) ; j = 0; if (i < ETH_ALEN) { j = (5 - i) * 8; while (mask[i] != 0) { mask[i] >>= 1; j++; } } if (bits < j) bits = j; if (bits > 40) { wpa_printf(MSG_ERROR, "Too many bits in the BSSID mask (%u)", bits); return -1; } os_memset(mask, 0xff, ETH_ALEN); j = bits / 8; for (i = 5; i > 5 - j; i--) mask[i] = 0; j = bits % 8; while (j--) mask[i] <<= 1; skip_mask_ext: wpa_printf(MSG_DEBUG, "BSS count %lu, BSSID mask " MACSTR " (%d bits)", (unsigned long) iface->conf->num_bss, MAC2STR(mask), bits); if (!auto_addr) return 0; for (i = 0; i < ETH_ALEN; i++) { if ((hapd->own_addr[i] & mask[i]) != hapd->own_addr[i]) { wpa_printf(MSG_ERROR, "Invalid BSSID mask " MACSTR " for start address " MACSTR ".", MAC2STR(mask), MAC2STR(hapd->own_addr)); wpa_printf(MSG_ERROR, "Start address must be the " "first address in the block (i.e., addr " "AND mask == addr)."); return -1; } } return 0; } static int mac_in_conf(struct hostapd_config *conf, const void *a) { size_t i; for (i = 0; i < conf->num_bss; i++) { if (hostapd_mac_comp(conf->bss[i]->bssid, a) == 0) { return 1; } } return 0; } #ifndef CONFIG_NO_RADIUS static int hostapd_das_nas_mismatch(struct hostapd_data *hapd, struct radius_das_attrs *attr) { if (attr->nas_identifier && (!hapd->conf->nas_identifier || os_strlen(hapd->conf->nas_identifier) != attr->nas_identifier_len || os_memcmp(hapd->conf->nas_identifier, attr->nas_identifier, attr->nas_identifier_len) != 0)) { wpa_printf(MSG_DEBUG, "RADIUS DAS: NAS-Identifier mismatch"); return 1; } if (attr->nas_ip_addr && (hapd->conf->own_ip_addr.af != AF_INET || os_memcmp(&hapd->conf->own_ip_addr.u.v4, attr->nas_ip_addr, 4) != 0)) { wpa_printf(MSG_DEBUG, "RADIUS DAS: NAS-IP-Address mismatch"); return 1; } #ifdef CONFIG_IPV6 if (attr->nas_ipv6_addr && (hapd->conf->own_ip_addr.af != AF_INET6 || os_memcmp(&hapd->conf->own_ip_addr.u.v6, attr->nas_ipv6_addr, 16) != 0)) { wpa_printf(MSG_DEBUG, "RADIUS DAS: NAS-IPv6-Address mismatch"); return 1; } #endif /* CONFIG_IPV6 */ return 0; } static struct sta_info * hostapd_das_find_sta(struct hostapd_data *hapd, struct radius_das_attrs *attr, int *multi) { struct sta_info *selected, *sta; char buf[128]; int num_attr = 0; int count; *multi = 0; for (sta = hapd->sta_list; sta; sta = sta->next) sta->radius_das_match = 1; if (attr->sta_addr) { num_attr++; sta = ap_get_sta(hapd, attr->sta_addr); if (!sta) { wpa_printf(MSG_DEBUG, "RADIUS DAS: No Calling-Station-Id match"); return NULL; } selected = sta; for (sta = hapd->sta_list; sta; sta = sta->next) { if (sta != selected) sta->radius_das_match = 0; } wpa_printf(MSG_DEBUG, "RADIUS DAS: Calling-Station-Id match"); } if (attr->acct_session_id) { num_attr++; if (attr->acct_session_id_len != 16) { wpa_printf(MSG_DEBUG, "RADIUS DAS: Acct-Session-Id cannot match"); return NULL; } count = 0; for (sta = hapd->sta_list; sta; sta = sta->next) { if (!sta->radius_das_match) continue; os_snprintf(buf, sizeof(buf), "%016llX", (unsigned long long) sta->acct_session_id); if (os_memcmp(attr->acct_session_id, buf, 16) != 0) sta->radius_das_match = 0; else count++; } if (count == 0) { wpa_printf(MSG_DEBUG, "RADIUS DAS: No matches remaining after Acct-Session-Id check"); return NULL; } wpa_printf(MSG_DEBUG, "RADIUS DAS: Acct-Session-Id match"); } if (attr->acct_multi_session_id) { num_attr++; if (attr->acct_multi_session_id_len != 16) { wpa_printf(MSG_DEBUG, "RADIUS DAS: Acct-Multi-Session-Id cannot match"); return NULL; } count = 0; for (sta = hapd->sta_list; sta; sta = sta->next) { if (!sta->radius_das_match) continue; if (!sta->eapol_sm || !sta->eapol_sm->acct_multi_session_id) { sta->radius_das_match = 0; continue; } os_snprintf(buf, sizeof(buf), "%016llX", (unsigned long long) sta->eapol_sm->acct_multi_session_id); if (os_memcmp(attr->acct_multi_session_id, buf, 16) != 0) sta->radius_das_match = 0; else count++; } if (count == 0) { wpa_printf(MSG_DEBUG, "RADIUS DAS: No matches remaining after Acct-Multi-Session-Id check"); return NULL; } wpa_printf(MSG_DEBUG, "RADIUS DAS: Acct-Multi-Session-Id match"); } if (attr->cui) { num_attr++; count = 0; for (sta = hapd->sta_list; sta; sta = sta->next) { struct wpabuf *cui; if (!sta->radius_das_match) continue; cui = ieee802_1x_get_radius_cui(sta->eapol_sm); if (!cui || wpabuf_len(cui) != attr->cui_len || os_memcmp(wpabuf_head(cui), attr->cui, attr->cui_len) != 0) sta->radius_das_match = 0; else count++; } if (count == 0) { wpa_printf(MSG_DEBUG, "RADIUS DAS: No matches remaining after Chargeable-User-Identity check"); return NULL; } wpa_printf(MSG_DEBUG, "RADIUS DAS: Chargeable-User-Identity match"); } if (attr->user_name) { num_attr++; count = 0; for (sta = hapd->sta_list; sta; sta = sta->next) { u8 *identity; size_t identity_len; if (!sta->radius_das_match) continue; identity = ieee802_1x_get_identity(sta->eapol_sm, &identity_len); if (!identity || identity_len != attr->user_name_len || os_memcmp(identity, attr->user_name, identity_len) != 0) sta->radius_das_match = 0; else count++; } if (count == 0) { wpa_printf(MSG_DEBUG, "RADIUS DAS: No matches remaining after User-Name check"); return NULL; } wpa_printf(MSG_DEBUG, "RADIUS DAS: User-Name match"); } if (num_attr == 0) { /* * In theory, we could match all current associations, but it * seems safer to just reject requests that do not include any * session identification attributes. */ wpa_printf(MSG_DEBUG, "RADIUS DAS: No session identification attributes included"); return NULL; } selected = NULL; for (sta = hapd->sta_list; sta; sta = sta->next) { if (sta->radius_das_match) { if (selected) { *multi = 1; return NULL; } selected = sta; } } return selected; } static int hostapd_das_disconnect_pmksa(struct hostapd_data *hapd, struct radius_das_attrs *attr) { if (!hapd->wpa_auth) return -1; return wpa_auth_radius_das_disconnect_pmksa(hapd->wpa_auth, attr); } static enum radius_das_res hostapd_das_disconnect(void *ctx, struct radius_das_attrs *attr) { struct hostapd_data *hapd = ctx; struct sta_info *sta; int multi; if (hostapd_das_nas_mismatch(hapd, attr)) return RADIUS_DAS_NAS_MISMATCH; sta = hostapd_das_find_sta(hapd, attr, &multi); if (sta == NULL) { if (multi) { wpa_printf(MSG_DEBUG, "RADIUS DAS: Multiple sessions match - not supported"); return RADIUS_DAS_MULTI_SESSION_MATCH; } if (hostapd_das_disconnect_pmksa(hapd, attr) == 0) { wpa_printf(MSG_DEBUG, "RADIUS DAS: PMKSA cache entry matched"); return RADIUS_DAS_SUCCESS; } wpa_printf(MSG_DEBUG, "RADIUS DAS: No matching session found"); return RADIUS_DAS_SESSION_NOT_FOUND; } wpa_printf(MSG_DEBUG, "RADIUS DAS: Found a matching session " MACSTR " - disconnecting", MAC2STR(sta->addr)); wpa_auth_pmksa_remove(hapd->wpa_auth, sta->addr); hostapd_drv_sta_deauth(hapd, sta->addr, WLAN_REASON_PREV_AUTH_NOT_VALID); ap_sta_deauthenticate(hapd, sta, WLAN_REASON_PREV_AUTH_NOT_VALID); return RADIUS_DAS_SUCCESS; } #endif /* CONFIG_NO_RADIUS */ /** * hostapd_setup_bss - Per-BSS setup (initialization) * @hapd: Pointer to BSS data * @first: Whether this BSS is the first BSS of an interface; -1 = not first, * but interface may exist * * This function is used to initialize all per-BSS data structures and * resources. This gets called in a loop for each BSS when an interface is * initialized. Most of the modules that are initialized here will be * deinitialized in hostapd_cleanup(). */ static int hostapd_setup_bss(struct hostapd_data *hapd, int first) { struct hostapd_bss_config *conf = hapd->conf; u8 ssid[SSID_MAX_LEN + 1]; int ssid_len, set_ssid; char force_ifname[IFNAMSIZ]; u8 if_addr[ETH_ALEN]; int flush_old_stations = 1; wpa_printf(MSG_DEBUG, "%s(hapd=%p (%s), first=%d)", __func__, hapd, conf->iface, first); #ifdef EAP_SERVER_TNC if (conf->tnc && tncs_global_init() < 0) { wpa_printf(MSG_ERROR, "Failed to initialize TNCS"); return -1; } #endif /* EAP_SERVER_TNC */ if (hapd->started) { wpa_printf(MSG_ERROR, "%s: Interface %s was already started", __func__, conf->iface); return -1; } hapd->started = 1; if (!first || first == -1) { u8 *addr = hapd->own_addr; if (!is_zero_ether_addr(conf->bssid)) { /* Allocate the configured BSSID. */ os_memcpy(hapd->own_addr, conf->bssid, ETH_ALEN); if (hostapd_mac_comp(hapd->own_addr, hapd->iface->bss[0]->own_addr) == 0) { wpa_printf(MSG_ERROR, "BSS '%s' may not have " "BSSID set to the MAC address of " "the radio", conf->iface); return -1; } } else if (hapd->iconf->use_driver_iface_addr) { addr = NULL; } else { /* Allocate the next available BSSID. */ do { inc_byte_array(hapd->own_addr, ETH_ALEN); } while (mac_in_conf(hapd->iconf, hapd->own_addr)); } hapd->interface_added = 1; if (hostapd_if_add(hapd->iface->bss[0], WPA_IF_AP_BSS, conf->iface, addr, hapd, &hapd->drv_priv, force_ifname, if_addr, conf->bridge[0] ? conf->bridge : NULL, first == -1)) { wpa_printf(MSG_ERROR, "Failed to add BSS (BSSID=" MACSTR ")", MAC2STR(hapd->own_addr)); hapd->interface_added = 0; return -1; } if (!addr) os_memcpy(hapd->own_addr, if_addr, ETH_ALEN); } if (conf->wmm_enabled < 0) conf->wmm_enabled = hapd->iconf->ieee80211n; #ifdef CONFIG_IEEE80211R if (is_zero_ether_addr(conf->r1_key_holder)) os_memcpy(conf->r1_key_holder, hapd->own_addr, ETH_ALEN); #endif /* CONFIG_IEEE80211R */ #ifdef CONFIG_MESH if (hapd->iface->mconf == NULL) flush_old_stations = 0; #endif /* CONFIG_MESH */ if (flush_old_stations) hostapd_flush_old_stations(hapd, WLAN_REASON_PREV_AUTH_NOT_VALID); hostapd_set_privacy(hapd, 0); hostapd_broadcast_wep_clear(hapd); if (hostapd_setup_encryption(conf->iface, hapd)) return -1; /* * Fetch the SSID from the system and use it or, * if one was specified in the config file, verify they * match. */ ssid_len = hostapd_get_ssid(hapd, ssid, sizeof(ssid)); if (ssid_len < 0) { wpa_printf(MSG_ERROR, "Could not read SSID from system"); return -1; } if (conf->ssid.ssid_set) { /* * If SSID is specified in the config file and it differs * from what is being used then force installation of the * new SSID. */ set_ssid = (conf->ssid.ssid_len != (size_t) ssid_len || os_memcmp(conf->ssid.ssid, ssid, ssid_len) != 0); } else { /* * No SSID in the config file; just use the one we got * from the system. */ set_ssid = 0; conf->ssid.ssid_len = ssid_len; os_memcpy(conf->ssid.ssid, ssid, conf->ssid.ssid_len); } if (!hostapd_drv_none(hapd)) { wpa_printf(MSG_ERROR, "Using interface %s with hwaddr " MACSTR " and ssid \"%s\"", conf->iface, MAC2STR(hapd->own_addr), wpa_ssid_txt(conf->ssid.ssid, conf->ssid.ssid_len)); } if (hostapd_setup_wpa_psk(conf)) { wpa_printf(MSG_ERROR, "WPA-PSK setup failed."); return -1; } /* Set SSID for the kernel driver (to be used in beacon and probe * response frames) */ if (set_ssid && hostapd_set_ssid(hapd, conf->ssid.ssid, conf->ssid.ssid_len)) { wpa_printf(MSG_ERROR, "Could not set SSID for kernel driver"); return -1; } if (wpa_debug_level <= MSG_MSGDUMP) conf->radius->msg_dumps = 1; #ifndef CONFIG_NO_RADIUS hapd->radius = radius_client_init(hapd, conf->radius); if (hapd->radius == NULL) { wpa_printf(MSG_ERROR, "RADIUS client initialization failed."); return -1; } if (conf->radius_das_port) { struct radius_das_conf das_conf; os_memset(&das_conf, 0, sizeof(das_conf)); das_conf.port = conf->radius_das_port; das_conf.shared_secret = conf->radius_das_shared_secret; das_conf.shared_secret_len = conf->radius_das_shared_secret_len; das_conf.client_addr = &conf->radius_das_client_addr; das_conf.time_window = conf->radius_das_time_window; das_conf.require_event_timestamp = conf->radius_das_require_event_timestamp; das_conf.require_message_authenticator = conf->radius_das_require_message_authenticator; das_conf.ctx = hapd; das_conf.disconnect = hostapd_das_disconnect; hapd->radius_das = radius_das_init(&das_conf); if (hapd->radius_das == NULL) { wpa_printf(MSG_ERROR, "RADIUS DAS initialization " "failed."); return -1; } } #endif /* CONFIG_NO_RADIUS */ if (hostapd_acl_init(hapd)) { wpa_printf(MSG_ERROR, "ACL initialization failed."); return -1; } if (hostapd_init_wps(hapd, conf)) return -1; if (authsrv_init(hapd) < 0) return -1; if (ieee802_1x_init(hapd)) { wpa_printf(MSG_ERROR, "IEEE 802.1X initialization failed."); return -1; } if ((conf->wpa || conf->osen) && hostapd_setup_wpa(hapd)) return -1; if (accounting_init(hapd)) { wpa_printf(MSG_ERROR, "Accounting initialization failed."); return -1; } if (conf->ieee802_11f && (hapd->iapp = iapp_init(hapd, conf->iapp_iface)) == NULL) { wpa_printf(MSG_ERROR, "IEEE 802.11F (IAPP) initialization " "failed."); return -1; } #ifdef CONFIG_INTERWORKING if (gas_serv_init(hapd)) { wpa_printf(MSG_ERROR, "GAS server initialization failed"); return -1; } if (conf->qos_map_set_len && hostapd_drv_set_qos_map(hapd, conf->qos_map_set, conf->qos_map_set_len)) { wpa_printf(MSG_ERROR, "Failed to initialize QoS Map"); return -1; } #endif /* CONFIG_INTERWORKING */ if (conf->bss_load_update_period && bss_load_update_init(hapd)) { wpa_printf(MSG_ERROR, "BSS Load initialization failed"); return -1; } if (conf->proxy_arp) { if (x_snoop_init(hapd)) { wpa_printf(MSG_ERROR, "Generic snooping infrastructure initialization failed"); return -1; } if (dhcp_snoop_init(hapd)) { wpa_printf(MSG_ERROR, "DHCP snooping initialization failed"); return -1; } if (ndisc_snoop_init(hapd)) { wpa_printf(MSG_ERROR, "Neighbor Discovery snooping initialization failed"); return -1; } } if (!hostapd_drv_none(hapd) && vlan_init(hapd)) { wpa_printf(MSG_ERROR, "VLAN initialization failed."); return -1; } if (!conf->start_disabled && ieee802_11_set_beacon(hapd) < 0) return -1; if (hapd->wpa_auth && wpa_init_keys(hapd->wpa_auth) < 0) return -1; if (hapd->driver && hapd->driver->set_operstate) hapd->driver->set_operstate(hapd->drv_priv, 1); return 0; } static void hostapd_tx_queue_params(struct hostapd_iface *iface) { struct hostapd_data *hapd = iface->bss[0]; int i; struct hostapd_tx_queue_params *p; #ifdef CONFIG_MESH if (iface->mconf == NULL) return; #endif /* CONFIG_MESH */ for (i = 0; i < NUM_TX_QUEUES; i++) { p = &iface->conf->tx_queue[i]; if (hostapd_set_tx_queue_params(hapd, i, p->aifs, p->cwmin, p->cwmax, p->burst)) { wpa_printf(MSG_DEBUG, "Failed to set TX queue " "parameters for queue %d.", i); /* Continue anyway */ } } } static int hostapd_set_acl_list(struct hostapd_data *hapd, struct mac_acl_entry *mac_acl, int n_entries, u8 accept_acl) { struct hostapd_acl_params *acl_params; int i, err; acl_params = os_zalloc(sizeof(*acl_params) + (n_entries * sizeof(acl_params->mac_acl[0]))); if (!acl_params) return -ENOMEM; for (i = 0; i < n_entries; i++) os_memcpy(acl_params->mac_acl[i].addr, mac_acl[i].addr, ETH_ALEN); acl_params->acl_policy = accept_acl; acl_params->num_mac_acl = n_entries; err = hostapd_drv_set_acl(hapd, acl_params); os_free(acl_params); return err; } static void hostapd_set_acl(struct hostapd_data *hapd) { struct hostapd_config *conf = hapd->iconf; int err; u8 accept_acl; if (hapd->iface->drv_max_acl_mac_addrs == 0) return; if (conf->bss[0]->macaddr_acl == DENY_UNLESS_ACCEPTED) { accept_acl = 1; err = hostapd_set_acl_list(hapd, conf->bss[0]->accept_mac, conf->bss[0]->num_accept_mac, accept_acl); if (err) { wpa_printf(MSG_DEBUG, "Failed to set accept acl"); return; } } else if (conf->bss[0]->macaddr_acl == ACCEPT_UNLESS_DENIED) { accept_acl = 0; err = hostapd_set_acl_list(hapd, conf->bss[0]->deny_mac, conf->bss[0]->num_deny_mac, accept_acl); if (err) { wpa_printf(MSG_DEBUG, "Failed to set deny acl"); return; } } } static int start_ctrl_iface_bss(struct hostapd_data *hapd) { if (!hapd->iface->interfaces || !hapd->iface->interfaces->ctrl_iface_init) return 0; if (hapd->iface->interfaces->ctrl_iface_init(hapd)) { wpa_printf(MSG_ERROR, "Failed to setup control interface for %s", hapd->conf->iface); return -1; } return 0; } static int start_ctrl_iface(struct hostapd_iface *iface) { size_t i; if (!iface->interfaces || !iface->interfaces->ctrl_iface_init) return 0; for (i = 0; i < iface->num_bss; i++) { struct hostapd_data *hapd = iface->bss[i]; if (iface->interfaces->ctrl_iface_init(hapd)) { wpa_printf(MSG_ERROR, "Failed to setup control interface for %s", hapd->conf->iface); return -1; } } return 0; } static void channel_list_update_timeout(void *eloop_ctx, void *timeout_ctx) { struct hostapd_iface *iface = eloop_ctx; if (!iface->wait_channel_update) { wpa_printf(MSG_INFO, "Channel list update timeout, but interface was not waiting for it"); return; } /* * It is possible that the existing channel list is acceptable, so try * to proceed. */ wpa_printf(MSG_DEBUG, "Channel list update timeout - try to continue anyway"); setup_interface2(iface); } void hostapd_channel_list_updated(struct hostapd_iface *iface, int initiator) { if (!iface->wait_channel_update || initiator != REGDOM_SET_BY_USER) return; wpa_printf(MSG_DEBUG, "Channel list updated - continue setup"); eloop_cancel_timeout(channel_list_update_timeout, iface, NULL); setup_interface2(iface); } static int setup_interface(struct hostapd_iface *iface) { struct hostapd_data *hapd = iface->bss[0]; size_t i; /* * It is possible that setup_interface() is called after the interface * was disabled etc., in which case driver_ap_teardown is possibly set * to 1. Clear it here so any other key/station deletion, which is not * part of a teardown flow, would also call the relevant driver * callbacks. */ iface->driver_ap_teardown = 0; if (!iface->phy[0]) { const char *phy = hostapd_drv_get_radio_name(hapd); if (phy) { wpa_printf(MSG_DEBUG, "phy: %s", phy); os_strlcpy(iface->phy, phy, sizeof(iface->phy)); } } /* * Make sure that all BSSes get configured with a pointer to the same * driver interface. */ for (i = 1; i < iface->num_bss; i++) { iface->bss[i]->driver = hapd->driver; iface->bss[i]->drv_priv = hapd->drv_priv; } if (hostapd_validate_bssid_configuration(iface)) return -1; /* * Initialize control interfaces early to allow external monitoring of * channel setup operations that may take considerable amount of time * especially for DFS cases. */ if (start_ctrl_iface(iface)) return -1; if (hapd->iconf->country[0] && hapd->iconf->country[1]) { char country[4], previous_country[4]; hostapd_set_state(iface, HAPD_IFACE_COUNTRY_UPDATE); if (hostapd_get_country(hapd, previous_country) < 0) previous_country[0] = '\0'; os_memcpy(country, hapd->iconf->country, 3); country[3] = '\0'; if (hostapd_set_country(hapd, country) < 0) { wpa_printf(MSG_ERROR, "Failed to set country code"); return -1; } wpa_printf(MSG_DEBUG, "Previous country code %s, new country code %s", previous_country, country); if (os_strncmp(previous_country, country, 2) != 0) { wpa_printf(MSG_DEBUG, "Continue interface setup after channel list update"); iface->wait_channel_update = 1; eloop_register_timeout(5, 0, channel_list_update_timeout, iface, NULL); return 0; } } return setup_interface2(iface); } static int setup_interface2(struct hostapd_iface *iface) { iface->wait_channel_update = 0; if (hostapd_get_hw_features(iface)) { /* Not all drivers support this yet, so continue without hw * feature data. */ } else { int ret = hostapd_select_hw_mode(iface); if (ret < 0) { wpa_printf(MSG_ERROR, "Could not select hw_mode and " "channel. (%d)", ret); goto fail; } if (ret == 1) { wpa_printf(MSG_DEBUG, "Interface initialization will be completed in a callback (ACS)"); return 0; } ret = hostapd_check_ht_capab(iface); if (ret < 0) goto fail; if (ret == 1) { wpa_printf(MSG_DEBUG, "Interface initialization will " "be completed in a callback"); return 0; } if (iface->conf->ieee80211h) wpa_printf(MSG_DEBUG, "DFS support is enabled"); } return hostapd_setup_interface_complete(iface, 0); fail: hostapd_set_state(iface, HAPD_IFACE_DISABLED); wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, AP_EVENT_DISABLED); if (iface->interfaces && iface->interfaces->terminate_on_error) eloop_terminate(); return -1; } #ifdef CONFIG_FST static const u8 * fst_hostapd_get_bssid_cb(void *ctx) { struct hostapd_data *hapd = ctx; return hapd->own_addr; } static void fst_hostapd_get_channel_info_cb(void *ctx, enum hostapd_hw_mode *hw_mode, u8 *channel) { struct hostapd_data *hapd = ctx; *hw_mode = ieee80211_freq_to_chan(hapd->iface->freq, channel); } static void fst_hostapd_set_ies_cb(void *ctx, const struct wpabuf *fst_ies) { struct hostapd_data *hapd = ctx; if (hapd->iface->fst_ies != fst_ies) { hapd->iface->fst_ies = fst_ies; if (ieee802_11_set_beacon(hapd)) wpa_printf(MSG_WARNING, "FST: Cannot set beacon"); } } static int fst_hostapd_send_action_cb(void *ctx, const u8 *da, struct wpabuf *buf) { struct hostapd_data *hapd = ctx; return hostapd_drv_send_action(hapd, hapd->iface->freq, 0, da, wpabuf_head(buf), wpabuf_len(buf)); } static const struct wpabuf * fst_hostapd_get_mb_ie_cb(void *ctx, const u8 *addr) { struct hostapd_data *hapd = ctx; struct sta_info *sta = ap_get_sta(hapd, addr); return sta ? sta->mb_ies : NULL; } static void fst_hostapd_update_mb_ie_cb(void *ctx, const u8 *addr, const u8 *buf, size_t size) { struct hostapd_data *hapd = ctx; struct sta_info *sta = ap_get_sta(hapd, addr); if (sta) { struct mb_ies_info info; if (!mb_ies_info_by_ies(&info, buf, size)) { wpabuf_free(sta->mb_ies); sta->mb_ies = mb_ies_by_info(&info); } } } static const u8 * fst_hostapd_get_sta(struct fst_get_peer_ctx **get_ctx, Boolean mb_only) { struct sta_info *s = (struct sta_info *) *get_ctx; if (mb_only) { for (; s && !s->mb_ies; s = s->next) ; } if (s) { *get_ctx = (struct fst_get_peer_ctx *) s->next; return s->addr; } *get_ctx = NULL; return NULL; } static const u8 * fst_hostapd_get_peer_first(void *ctx, struct fst_get_peer_ctx **get_ctx, Boolean mb_only) { struct hostapd_data *hapd = ctx; *get_ctx = (struct fst_get_peer_ctx *) hapd->sta_list; return fst_hostapd_get_sta(get_ctx, mb_only); } static const u8 * fst_hostapd_get_peer_next(void *ctx, struct fst_get_peer_ctx **get_ctx, Boolean mb_only) { return fst_hostapd_get_sta(get_ctx, mb_only); } void fst_hostapd_fill_iface_obj(struct hostapd_data *hapd, struct fst_wpa_obj *iface_obj) { iface_obj->ctx = hapd; iface_obj->get_bssid = fst_hostapd_get_bssid_cb; iface_obj->get_channel_info = fst_hostapd_get_channel_info_cb; iface_obj->set_ies = fst_hostapd_set_ies_cb; iface_obj->send_action = fst_hostapd_send_action_cb; iface_obj->get_mb_ie = fst_hostapd_get_mb_ie_cb; iface_obj->update_mb_ie = fst_hostapd_update_mb_ie_cb; iface_obj->get_peer_first = fst_hostapd_get_peer_first; iface_obj->get_peer_next = fst_hostapd_get_peer_next; } #endif /* CONFIG_FST */ #ifdef NEED_AP_MLME static enum nr_chan_width hostapd_get_nr_chan_width(struct hostapd_data *hapd, int ht, int vht) { if (!ht && !vht) return NR_CHAN_WIDTH_20; if (!hapd->iconf->secondary_channel) return NR_CHAN_WIDTH_20; if (!vht || hapd->iconf->vht_oper_chwidth == VHT_CHANWIDTH_USE_HT) return NR_CHAN_WIDTH_40; if (hapd->iconf->vht_oper_chwidth == VHT_CHANWIDTH_80MHZ) return NR_CHAN_WIDTH_80; if (hapd->iconf->vht_oper_chwidth == VHT_CHANWIDTH_160MHZ) return NR_CHAN_WIDTH_160; if (hapd->iconf->vht_oper_chwidth == VHT_CHANWIDTH_80P80MHZ) return NR_CHAN_WIDTH_80P80; return NR_CHAN_WIDTH_20; } #endif /* NEED_AP_MLME */ static void hostapd_set_own_neighbor_report(struct hostapd_data *hapd) { #ifdef NEED_AP_MLME u16 capab = hostapd_own_capab_info(hapd); int ht = hapd->iconf->ieee80211n && !hapd->conf->disable_11n; int vht = hapd->iconf->ieee80211ac && !hapd->conf->disable_11ac; struct wpa_ssid_value ssid; u8 channel, op_class; int center_freq1 = 0, center_freq2 = 0; enum nr_chan_width width; u32 bssid_info; struct wpabuf *nr; if (!(hapd->conf->radio_measurements[0] & WLAN_RRM_CAPS_NEIGHBOR_REPORT)) return; bssid_info = 3; /* AP is reachable */ bssid_info |= NEI_REP_BSSID_INFO_SECURITY; /* "same as the AP" */ bssid_info |= NEI_REP_BSSID_INFO_KEY_SCOPE; /* "same as the AP" */ if (capab & WLAN_CAPABILITY_SPECTRUM_MGMT) bssid_info |= NEI_REP_BSSID_INFO_SPECTRUM_MGMT; bssid_info |= NEI_REP_BSSID_INFO_RM; /* RRM is supported */ if (hapd->conf->wmm_enabled) { bssid_info |= NEI_REP_BSSID_INFO_QOS; if (hapd->conf->wmm_uapsd && (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_AP_UAPSD)) bssid_info |= NEI_REP_BSSID_INFO_APSD; } if (ht) { bssid_info |= NEI_REP_BSSID_INFO_HT | NEI_REP_BSSID_INFO_DELAYED_BA; /* VHT bit added in IEEE P802.11-REVmc/D4.3 */ if (vht) bssid_info |= NEI_REP_BSSID_INFO_VHT; } /* TODO: Set NEI_REP_BSSID_INFO_MOBILITY_DOMAIN if MDE is set */ ieee80211_freq_to_channel_ext(hapd->iface->freq, hapd->iconf->secondary_channel, hapd->iconf->vht_oper_chwidth, &op_class, &channel); width = hostapd_get_nr_chan_width(hapd, ht, vht); if (vht) { center_freq1 = ieee80211_chan_to_freq( NULL, op_class, hapd->iconf->vht_oper_centr_freq_seg0_idx); if (width == NR_CHAN_WIDTH_80P80) center_freq2 = ieee80211_chan_to_freq( NULL, op_class, hapd->iconf->vht_oper_centr_freq_seg1_idx); } else if (ht) { center_freq1 = hapd->iface->freq + 10 * hapd->iconf->secondary_channel; } ssid.ssid_len = hapd->conf->ssid.ssid_len; os_memcpy(ssid.ssid, hapd->conf->ssid.ssid, ssid.ssid_len); /* * Neighbor Report element size = BSSID + BSSID info + op_class + chan + * phy type + wide bandwidth channel subelement. */ nr = wpabuf_alloc(ETH_ALEN + 4 + 1 + 1 + 1 + 5); if (!nr) return; wpabuf_put_data(nr, hapd->own_addr, ETH_ALEN); wpabuf_put_le32(nr, bssid_info); wpabuf_put_u8(nr, op_class); wpabuf_put_u8(nr, channel); wpabuf_put_u8(nr, ieee80211_get_phy_type(hapd->iface->freq, ht, vht)); /* * Wide Bandwidth Channel subelement may be needed to allow the * receiving STA to send packets to the AP. See IEEE P802.11-REVmc/D5.0 * Figure 9-301. */ wpabuf_put_u8(nr, WNM_NEIGHBOR_WIDE_BW_CHAN); wpabuf_put_u8(nr, 3); wpabuf_put_u8(nr, width); wpabuf_put_u8(nr, center_freq1); wpabuf_put_u8(nr, center_freq2); hostapd_neighbor_set(hapd, hapd->own_addr, &ssid, nr, hapd->iconf->lci, hapd->iconf->civic); wpabuf_free(nr); #endif /* NEED_AP_MLME */ } static int hostapd_setup_interface_complete_sync(struct hostapd_iface *iface, int err) { struct hostapd_data *hapd = iface->bss[0]; size_t j; u8 *prev_addr; int delay_apply_cfg = 0; int res_dfs_offload = 0; if (err) goto fail; wpa_printf(MSG_DEBUG, "Completing interface initialization"); if (iface->conf->channel) { #ifdef NEED_AP_MLME int res; #endif /* NEED_AP_MLME */ iface->freq = hostapd_hw_get_freq(hapd, iface->conf->channel); wpa_printf(MSG_DEBUG, "Mode: %s Channel: %d " "Frequency: %d MHz", hostapd_hw_mode_txt(iface->conf->hw_mode), iface->conf->channel, iface->freq); #ifdef NEED_AP_MLME /* Handle DFS only if it is not offloaded to the driver */ if (!(iface->drv_flags & WPA_DRIVER_FLAGS_DFS_OFFLOAD)) { /* Check DFS */ res = hostapd_handle_dfs(iface); if (res <= 0) { if (res < 0) goto fail; return res; } } else { /* If DFS is offloaded to the driver */ res_dfs_offload = hostapd_handle_dfs_offload(iface); if (res_dfs_offload <= 0) { if (res_dfs_offload < 0) goto fail; } else { wpa_printf(MSG_DEBUG, "Proceed with AP/channel setup"); /* * If this is a DFS channel, move to completing * AP setup. */ if (res_dfs_offload == 1) goto dfs_offload; /* Otherwise fall through. */ } } #endif /* NEED_AP_MLME */ #ifdef CONFIG_MESH if (iface->mconf != NULL) { wpa_printf(MSG_DEBUG, "%s: Mesh configuration will be applied while joining the mesh network", iface->bss[0]->conf->iface); delay_apply_cfg = 1; } #endif /* CONFIG_MESH */ if (!delay_apply_cfg && hostapd_set_freq(hapd, hapd->iconf->hw_mode, iface->freq, hapd->iconf->channel, hapd->iconf->ieee80211n, hapd->iconf->ieee80211ac, hapd->iconf->secondary_channel, hapd->iconf->vht_oper_chwidth, hapd->iconf->vht_oper_centr_freq_seg0_idx, hapd->iconf->vht_oper_centr_freq_seg1_idx)) { wpa_printf(MSG_ERROR, "Could not set channel for " "kernel driver"); goto fail; } } if (iface->current_mode) { if (hostapd_prepare_rates(iface, iface->current_mode)) { wpa_printf(MSG_ERROR, "Failed to prepare rates " "table."); hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211, HOSTAPD_LEVEL_WARNING, "Failed to prepare rates table."); goto fail; } } if (hapd->iconf->rts_threshold > -1 && hostapd_set_rts(hapd, hapd->iconf->rts_threshold)) { wpa_printf(MSG_ERROR, "Could not set RTS threshold for " "kernel driver"); goto fail; } if (hapd->iconf->fragm_threshold > -1 && hostapd_set_frag(hapd, hapd->iconf->fragm_threshold)) { wpa_printf(MSG_ERROR, "Could not set fragmentation threshold " "for kernel driver"); goto fail; } prev_addr = hapd->own_addr; for (j = 0; j < iface->num_bss; j++) { hapd = iface->bss[j]; if (j) os_memcpy(hapd->own_addr, prev_addr, ETH_ALEN); if (hostapd_setup_bss(hapd, j == 0)) { do { hapd = iface->bss[j]; hostapd_bss_deinit_no_free(hapd); hostapd_free_hapd_data(hapd); } while (j-- > 0); goto fail; } if (is_zero_ether_addr(hapd->conf->bssid)) prev_addr = hapd->own_addr; } hapd = iface->bss[0]; hostapd_tx_queue_params(iface); ap_list_init(iface); hostapd_set_acl(hapd); if (hostapd_driver_commit(hapd) < 0) { wpa_printf(MSG_ERROR, "%s: Failed to commit driver " "configuration", __func__); goto fail; } /* * WPS UPnP module can be initialized only when the "upnp_iface" is up. * If "interface" and "upnp_iface" are the same (e.g., non-bridge * mode), the interface is up only after driver_commit, so initialize * WPS after driver_commit. */ for (j = 0; j < iface->num_bss; j++) { if (hostapd_init_wps_complete(iface->bss[j])) goto fail; } if ((iface->drv_flags & WPA_DRIVER_FLAGS_DFS_OFFLOAD) && !res_dfs_offload) { /* * If freq is DFS, and DFS is offloaded to the driver, then wait * for CAC to complete. */ wpa_printf(MSG_DEBUG, "%s: Wait for CAC to complete", __func__); return res_dfs_offload; } #ifdef NEED_AP_MLME dfs_offload: #endif /* NEED_AP_MLME */ #ifdef CONFIG_FST if (hapd->iconf->fst_cfg.group_id[0]) { struct fst_wpa_obj iface_obj; fst_hostapd_fill_iface_obj(hapd, &iface_obj); iface->fst = fst_attach(hapd->conf->iface, hapd->own_addr, &iface_obj, &hapd->iconf->fst_cfg); if (!iface->fst) { wpa_printf(MSG_ERROR, "Could not attach to FST %s", hapd->iconf->fst_cfg.group_id); goto fail; } } #endif /* CONFIG_FST */ hostapd_set_state(iface, HAPD_IFACE_ENABLED); wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, AP_EVENT_ENABLED); if (hapd->setup_complete_cb) hapd->setup_complete_cb(hapd->setup_complete_cb_ctx); wpa_printf(MSG_DEBUG, "%s: Setup of interface done.", iface->bss[0]->conf->iface); if (iface->interfaces && iface->interfaces->terminate_on_error > 0) iface->interfaces->terminate_on_error--; for (j = 0; j < iface->num_bss; j++) hostapd_set_own_neighbor_report(iface->bss[j]); return 0; fail: wpa_printf(MSG_ERROR, "Interface initialization failed"); hostapd_set_state(iface, HAPD_IFACE_DISABLED); wpa_msg(hapd->msg_ctx, MSG_INFO, AP_EVENT_DISABLED); #ifdef CONFIG_FST if (iface->fst) { fst_detach(iface->fst); iface->fst = NULL; } #endif /* CONFIG_FST */ if (iface->interfaces && iface->interfaces->terminate_on_error) eloop_terminate(); return -1; } /** * hostapd_setup_interface_complete - Complete interface setup * * This function is called when previous steps in the interface setup has been * completed. This can also start operations, e.g., DFS, that will require * additional processing before interface is ready to be enabled. Such * operations will call this function from eloop callbacks when finished. */ int hostapd_setup_interface_complete(struct hostapd_iface *iface, int err) { struct hapd_interfaces *interfaces = iface->interfaces; struct hostapd_data *hapd = iface->bss[0]; unsigned int i; int not_ready_in_sync_ifaces = 0; if (!iface->need_to_start_in_sync) return hostapd_setup_interface_complete_sync(iface, err); if (err) { wpa_printf(MSG_ERROR, "Interface initialization failed"); hostapd_set_state(iface, HAPD_IFACE_DISABLED); iface->need_to_start_in_sync = 0; wpa_msg(hapd->msg_ctx, MSG_INFO, AP_EVENT_DISABLED); if (interfaces && interfaces->terminate_on_error) eloop_terminate(); return -1; } if (iface->ready_to_start_in_sync) { /* Already in ready and waiting. should never happpen */ return 0; } for (i = 0; i < interfaces->count; i++) { if (interfaces->iface[i]->need_to_start_in_sync && !interfaces->iface[i]->ready_to_start_in_sync) not_ready_in_sync_ifaces++; } /* * Check if this is the last interface, if yes then start all the other * waiting interfaces. If not, add this interface to the waiting list. */ if (not_ready_in_sync_ifaces > 1 && iface->state == HAPD_IFACE_DFS) { /* * If this interface went through CAC, do not synchronize, just * start immediately. */ iface->need_to_start_in_sync = 0; wpa_printf(MSG_INFO, "%s: Finished CAC - bypass sync and start interface", iface->bss[0]->conf->iface); return hostapd_setup_interface_complete_sync(iface, err); } if (not_ready_in_sync_ifaces > 1) { /* need to wait as there are other interfaces still coming up */ iface->ready_to_start_in_sync = 1; wpa_printf(MSG_INFO, "%s: Interface waiting to sync with other interfaces", iface->bss[0]->conf->iface); return 0; } wpa_printf(MSG_INFO, "%s: Last interface to sync - starting all interfaces", iface->bss[0]->conf->iface); iface->need_to_start_in_sync = 0; hostapd_setup_interface_complete_sync(iface, err); for (i = 0; i < interfaces->count; i++) { if (interfaces->iface[i]->need_to_start_in_sync && interfaces->iface[i]->ready_to_start_in_sync) { hostapd_setup_interface_complete_sync( interfaces->iface[i], 0); /* Only once the interfaces are sync started */ interfaces->iface[i]->need_to_start_in_sync = 0; } } return 0; } /** * hostapd_setup_interface - Setup of an interface * @iface: Pointer to interface data. * Returns: 0 on success, -1 on failure * * Initializes the driver interface, validates the configuration, * and sets driver parameters based on the configuration. * Flushes old stations, sets the channel, encryption, * beacons, and WDS links based on the configuration. * * If interface setup requires more time, e.g., to perform HT co-ex scans, ACS, * or DFS operations, this function returns 0 before such operations have been * completed. The pending operations are registered into eloop and will be * completed from eloop callbacks. Those callbacks end up calling * hostapd_setup_interface_complete() once setup has been completed. */ int hostapd_setup_interface(struct hostapd_iface *iface) { int ret; ret = setup_interface(iface); if (ret) { wpa_printf(MSG_ERROR, "%s: Unable to setup interface.", iface->bss[0]->conf->iface); return -1; } return 0; } /** * hostapd_alloc_bss_data - Allocate and initialize per-BSS data * @hapd_iface: Pointer to interface data * @conf: Pointer to per-interface configuration * @bss: Pointer to per-BSS configuration for this BSS * Returns: Pointer to allocated BSS data * * This function is used to allocate per-BSS data structure. This data will be * freed after hostapd_cleanup() is called for it during interface * deinitialization. */ struct hostapd_data * hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface, struct hostapd_config *conf, struct hostapd_bss_config *bss) { struct hostapd_data *hapd; hapd = os_zalloc(sizeof(*hapd)); if (hapd == NULL) return NULL; hapd->new_assoc_sta_cb = hostapd_new_assoc_sta; hapd->iconf = conf; hapd->conf = bss; hapd->iface = hapd_iface; hapd->driver = hapd->iconf->driver; hapd->ctrl_sock = -1; dl_list_init(&hapd->ctrl_dst); dl_list_init(&hapd->nr_db); return hapd; } static void hostapd_bss_deinit(struct hostapd_data *hapd) { if (!hapd) return; wpa_printf(MSG_DEBUG, "%s: deinit bss %s", __func__, hapd->conf->iface); hostapd_bss_deinit_no_free(hapd); wpa_msg(hapd->msg_ctx, MSG_INFO, AP_EVENT_DISABLED); hostapd_cleanup(hapd); } void hostapd_interface_deinit(struct hostapd_iface *iface) { int j; wpa_printf(MSG_DEBUG, "%s(%p)", __func__, iface); if (iface == NULL) return; hostapd_set_state(iface, HAPD_IFACE_DISABLED); #ifdef CONFIG_IEEE80211N #ifdef NEED_AP_MLME hostapd_stop_setup_timers(iface); eloop_cancel_timeout(ap_ht2040_timeout, iface, NULL); #endif /* NEED_AP_MLME */ #endif /* CONFIG_IEEE80211N */ eloop_cancel_timeout(channel_list_update_timeout, iface, NULL); iface->wait_channel_update = 0; #ifdef CONFIG_FST if (iface->fst) { fst_detach(iface->fst); iface->fst = NULL; } #endif /* CONFIG_FST */ for (j = iface->num_bss - 1; j >= 0; j--) { if (!iface->bss) break; hostapd_bss_deinit(iface->bss[j]); } } void hostapd_interface_free(struct hostapd_iface *iface) { size_t j; wpa_printf(MSG_DEBUG, "%s(%p)", __func__, iface); for (j = 0; j < iface->num_bss; j++) { if (!iface->bss) break; wpa_printf(MSG_DEBUG, "%s: free hapd %p", __func__, iface->bss[j]); os_free(iface->bss[j]); } hostapd_cleanup_iface(iface); } struct hostapd_iface * hostapd_alloc_iface(void) { struct hostapd_iface *hapd_iface; hapd_iface = os_zalloc(sizeof(*hapd_iface)); if (!hapd_iface) return NULL; dl_list_init(&hapd_iface->sta_seen); return hapd_iface; } /** * hostapd_init - Allocate and initialize per-interface data * @config_file: Path to the configuration file * Returns: Pointer to the allocated interface data or %NULL on failure * * This function is used to allocate main data structures for per-interface * data. The allocated data buffer will be freed by calling * hostapd_cleanup_iface(). */ struct hostapd_iface * hostapd_init(struct hapd_interfaces *interfaces, const char *config_file) { struct hostapd_iface *hapd_iface = NULL; struct hostapd_config *conf = NULL; struct hostapd_data *hapd; size_t i; hapd_iface = hostapd_alloc_iface(); if (hapd_iface == NULL) goto fail; hapd_iface->config_fname = os_strdup(config_file); if (hapd_iface->config_fname == NULL) goto fail; conf = interfaces->config_read_cb(hapd_iface->config_fname); if (conf == NULL) goto fail; hapd_iface->conf = conf; hapd_iface->num_bss = conf->num_bss; hapd_iface->bss = os_calloc(conf->num_bss, sizeof(struct hostapd_data *)); if (hapd_iface->bss == NULL) goto fail; for (i = 0; i < conf->num_bss; i++) { hapd = hapd_iface->bss[i] = hostapd_alloc_bss_data(hapd_iface, conf, conf->bss[i]); if (hapd == NULL) goto fail; hapd->msg_ctx = hapd; } #ifdef CONFIG_KARMA_ATTACK g_hapd_data = hapd_iface->bss[0]; #endif return hapd_iface; fail: wpa_printf(MSG_ERROR, "Failed to set up interface with %s", config_file); if (conf) hostapd_config_free(conf); if (hapd_iface) { os_free(hapd_iface->config_fname); os_free(hapd_iface->bss); wpa_printf(MSG_DEBUG, "%s: free iface %p", __func__, hapd_iface); os_free(hapd_iface); } return NULL; } static int ifname_in_use(struct hapd_interfaces *interfaces, const char *ifname) { size_t i, j; for (i = 0; i < interfaces->count; i++) { struct hostapd_iface *iface = interfaces->iface[i]; for (j = 0; j < iface->num_bss; j++) { struct hostapd_data *hapd = iface->bss[j]; if (os_strcmp(ifname, hapd->conf->iface) == 0) return 1; } } return 0; } /** * hostapd_interface_init_bss - Read configuration file and init BSS data * * This function is used to parse configuration file for a BSS. This BSS is * added to an existing interface sharing the same radio (if any) or a new * interface is created if this is the first interface on a radio. This * allocate memory for the BSS. No actual driver operations are started. * * This is similar to hostapd_interface_init(), but for a case where the * configuration is used to add a single BSS instead of all BSSes for a radio. */ struct hostapd_iface * hostapd_interface_init_bss(struct hapd_interfaces *interfaces, const char *phy, const char *config_fname, int debug) { struct hostapd_iface *new_iface = NULL, *iface = NULL; struct hostapd_data *hapd; int k; size_t i, bss_idx; if (!phy || !*phy) return NULL; for (i = 0; i < interfaces->count; i++) { if (os_strcmp(interfaces->iface[i]->phy, phy) == 0) { iface = interfaces->iface[i]; break; } } wpa_printf(MSG_INFO, "Configuration file: %s (phy %s)%s", config_fname, phy, iface ? "" : " --> new PHY"); if (iface) { struct hostapd_config *conf; struct hostapd_bss_config **tmp_conf; struct hostapd_data **tmp_bss; struct hostapd_bss_config *bss; const char *ifname; /* Add new BSS to existing iface */ conf = interfaces->config_read_cb(config_fname); if (conf == NULL) return NULL; if (conf->num_bss > 1) { wpa_printf(MSG_ERROR, "Multiple BSSes specified in BSS-config"); hostapd_config_free(conf); return NULL; } ifname = conf->bss[0]->iface; if (ifname[0] != '\0' && ifname_in_use(interfaces, ifname)) { wpa_printf(MSG_ERROR, "Interface name %s already in use", ifname); hostapd_config_free(conf); return NULL; } tmp_conf = os_realloc_array( iface->conf->bss, iface->conf->num_bss + 1, sizeof(struct hostapd_bss_config *)); tmp_bss = os_realloc_array(iface->bss, iface->num_bss + 1, sizeof(struct hostapd_data *)); if (tmp_bss) iface->bss = tmp_bss; if (tmp_conf) { iface->conf->bss = tmp_conf; iface->conf->last_bss = tmp_conf[0]; } if (tmp_bss == NULL || tmp_conf == NULL) { hostapd_config_free(conf); return NULL; } bss = iface->conf->bss[iface->conf->num_bss] = conf->bss[0]; iface->conf->num_bss++; hapd = hostapd_alloc_bss_data(iface, iface->conf, bss); if (hapd == NULL) { iface->conf->num_bss--; hostapd_config_free(conf); return NULL; } iface->conf->last_bss = bss; iface->bss[iface->num_bss] = hapd; hapd->msg_ctx = hapd; bss_idx = iface->num_bss++; conf->num_bss--; conf->bss[0] = NULL; hostapd_config_free(conf); } else { /* Add a new iface with the first BSS */ new_iface = iface = hostapd_init(interfaces, config_fname); if (!iface) return NULL; os_strlcpy(iface->phy, phy, sizeof(iface->phy)); iface->interfaces = interfaces; bss_idx = 0; } for (k = 0; k < debug; k++) { if (iface->bss[bss_idx]->conf->logger_stdout_level > 0) iface->bss[bss_idx]->conf->logger_stdout_level--; } if (iface->conf->bss[bss_idx]->iface[0] == '\0' && !hostapd_drv_none(iface->bss[bss_idx])) { wpa_printf(MSG_ERROR, "Interface name not specified in %s", config_fname); if (new_iface) hostapd_interface_deinit_free(new_iface); return NULL; } return iface; } void hostapd_interface_deinit_free(struct hostapd_iface *iface) { const struct wpa_driver_ops *driver; void *drv_priv; wpa_printf(MSG_DEBUG, "%s(%p)", __func__, iface); if (iface == NULL) return; wpa_printf(MSG_DEBUG, "%s: num_bss=%u conf->num_bss=%u", __func__, (unsigned int) iface->num_bss, (unsigned int) iface->conf->num_bss); driver = iface->bss[0]->driver; drv_priv = iface->bss[0]->drv_priv; hostapd_interface_deinit(iface); wpa_printf(MSG_DEBUG, "%s: driver=%p drv_priv=%p -> hapd_deinit", __func__, driver, drv_priv); if (driver && driver->hapd_deinit && drv_priv) { driver->hapd_deinit(drv_priv); iface->bss[0]->drv_priv = NULL; } hostapd_interface_free(iface); } static void hostapd_deinit_driver(const struct wpa_driver_ops *driver, void *drv_priv, struct hostapd_iface *hapd_iface) { size_t j; wpa_printf(MSG_DEBUG, "%s: driver=%p drv_priv=%p -> hapd_deinit", __func__, driver, drv_priv); if (driver && driver->hapd_deinit && drv_priv) { driver->hapd_deinit(drv_priv); for (j = 0; j < hapd_iface->num_bss; j++) { wpa_printf(MSG_DEBUG, "%s:bss[%d]->drv_priv=%p", __func__, (int) j, hapd_iface->bss[j]->drv_priv); if (hapd_iface->bss[j]->drv_priv == drv_priv) hapd_iface->bss[j]->drv_priv = NULL; } } } int hostapd_enable_iface(struct hostapd_iface *hapd_iface) { size_t j; if (hapd_iface->bss[0]->drv_priv != NULL) { wpa_printf(MSG_ERROR, "Interface %s already enabled", hapd_iface->conf->bss[0]->iface); return -1; } wpa_printf(MSG_DEBUG, "Enable interface %s", hapd_iface->conf->bss[0]->iface); for (j = 0; j < hapd_iface->num_bss; j++) hostapd_set_security_params(hapd_iface->conf->bss[j], 1); if (hostapd_config_check(hapd_iface->conf, 1) < 0) { wpa_printf(MSG_INFO, "Invalid configuration - cannot enable"); return -1; } if (hapd_iface->interfaces == NULL || hapd_iface->interfaces->driver_init == NULL || hapd_iface->interfaces->driver_init(hapd_iface)) return -1; if (hostapd_setup_interface(hapd_iface)) { hostapd_deinit_driver(hapd_iface->bss[0]->driver, hapd_iface->bss[0]->drv_priv, hapd_iface); return -1; } return 0; } int hostapd_reload_iface(struct hostapd_iface *hapd_iface) { size_t j; wpa_printf(MSG_DEBUG, "Reload interface %s", hapd_iface->conf->bss[0]->iface); for (j = 0; j < hapd_iface->num_bss; j++) hostapd_set_security_params(hapd_iface->conf->bss[j], 1); if (hostapd_config_check(hapd_iface->conf, 1) < 0) { wpa_printf(MSG_ERROR, "Updated configuration is invalid"); return -1; } hostapd_clear_old(hapd_iface); for (j = 0; j < hapd_iface->num_bss; j++) hostapd_reload_bss(hapd_iface->bss[j]); return 0; } int hostapd_disable_iface(struct hostapd_iface *hapd_iface) { size_t j; const struct wpa_driver_ops *driver; void *drv_priv; if (hapd_iface == NULL) return -1; if (hapd_iface->bss[0]->drv_priv == NULL) { wpa_printf(MSG_INFO, "Interface %s already disabled", hapd_iface->conf->bss[0]->iface); return -1; } wpa_msg(hapd_iface->bss[0]->msg_ctx, MSG_INFO, AP_EVENT_DISABLED); driver = hapd_iface->bss[0]->driver; drv_priv = hapd_iface->bss[0]->drv_priv; hapd_iface->driver_ap_teardown = !!(hapd_iface->drv_flags & WPA_DRIVER_FLAGS_AP_TEARDOWN_SUPPORT); /* same as hostapd_interface_deinit without deinitializing ctrl-iface */ for (j = 0; j < hapd_iface->num_bss; j++) { struct hostapd_data *hapd = hapd_iface->bss[j]; hostapd_bss_deinit_no_free(hapd); hostapd_free_hapd_data(hapd); } hostapd_deinit_driver(driver, drv_priv, hapd_iface); /* From hostapd_cleanup_iface: These were initialized in * hostapd_setup_interface and hostapd_setup_interface_complete */ hostapd_cleanup_iface_partial(hapd_iface); wpa_printf(MSG_DEBUG, "Interface %s disabled", hapd_iface->bss[0]->conf->iface); hostapd_set_state(hapd_iface, HAPD_IFACE_DISABLED); return 0; } static struct hostapd_iface * hostapd_iface_alloc(struct hapd_interfaces *interfaces) { struct hostapd_iface **iface, *hapd_iface; iface = os_realloc_array(interfaces->iface, interfaces->count + 1, sizeof(struct hostapd_iface *)); if (iface == NULL) return NULL; interfaces->iface = iface; hapd_iface = interfaces->iface[interfaces->count] = hostapd_alloc_iface(); if (hapd_iface == NULL) { wpa_printf(MSG_ERROR, "%s: Failed to allocate memory for " "the interface", __func__); return NULL; } interfaces->count++; hapd_iface->interfaces = interfaces; return hapd_iface; } static struct hostapd_config * hostapd_config_alloc(struct hapd_interfaces *interfaces, const char *ifname, const char *ctrl_iface, const char *driver) { struct hostapd_bss_config *bss; struct hostapd_config *conf; /* Allocates memory for bss and conf */ conf = hostapd_config_defaults(); if (conf == NULL) { wpa_printf(MSG_ERROR, "%s: Failed to allocate memory for " "configuration", __func__); return NULL; } if (driver) { int j; for (j = 0; wpa_drivers[j]; j++) { if (os_strcmp(driver, wpa_drivers[j]->name) == 0) { conf->driver = wpa_drivers[j]; goto skip; } } wpa_printf(MSG_ERROR, "Invalid/unknown driver '%s' - registering the default driver", driver); } conf->driver = wpa_drivers[0]; if (conf->driver == NULL) { wpa_printf(MSG_ERROR, "No driver wrappers registered!"); hostapd_config_free(conf); return NULL; } skip: bss = conf->last_bss = conf->bss[0]; os_strlcpy(bss->iface, ifname, sizeof(bss->iface)); bss->ctrl_interface = os_strdup(ctrl_iface); if (bss->ctrl_interface == NULL) { hostapd_config_free(conf); return NULL; } /* Reading configuration file skipped, will be done in SET! * From reading the configuration till the end has to be done in * SET */ return conf; } static int hostapd_data_alloc(struct hostapd_iface *hapd_iface, struct hostapd_config *conf) { size_t i; struct hostapd_data *hapd; hapd_iface->bss = os_calloc(conf->num_bss, sizeof(struct hostapd_data *)); if (hapd_iface->bss == NULL) return -1; for (i = 0; i < conf->num_bss; i++) { hapd = hapd_iface->bss[i] = hostapd_alloc_bss_data(hapd_iface, conf, conf->bss[i]); if (hapd == NULL) { while (i > 0) { i--; os_free(hapd_iface->bss[i]); hapd_iface->bss[i] = NULL; } os_free(hapd_iface->bss); hapd_iface->bss = NULL; return -1; } hapd->msg_ctx = hapd; } hapd_iface->conf = conf; hapd_iface->num_bss = conf->num_bss; return 0; } int hostapd_add_iface(struct hapd_interfaces *interfaces, char *buf) { struct hostapd_config *conf = NULL; struct hostapd_iface *hapd_iface = NULL, *new_iface = NULL; struct hostapd_data *hapd; char *ptr; size_t i, j; const char *conf_file = NULL, *phy_name = NULL; if (os_strncmp(buf, "bss_config=", 11) == 0) { char *pos; phy_name = buf + 11; pos = os_strchr(phy_name, ':'); if (!pos) return -1; *pos++ = '\0'; conf_file = pos; if (!os_strlen(conf_file)) return -1; hapd_iface = hostapd_interface_init_bss(interfaces, phy_name, conf_file, 0); if (!hapd_iface) return -1; for (j = 0; j < interfaces->count; j++) { if (interfaces->iface[j] == hapd_iface) break; } if (j == interfaces->count) { struct hostapd_iface **tmp; tmp = os_realloc_array(interfaces->iface, interfaces->count + 1, sizeof(struct hostapd_iface *)); if (!tmp) { hostapd_interface_deinit_free(hapd_iface); return -1; } interfaces->iface = tmp; interfaces->iface[interfaces->count++] = hapd_iface; new_iface = hapd_iface; } if (new_iface) { if (interfaces->driver_init(hapd_iface)) goto fail; if (hostapd_setup_interface(hapd_iface)) { hostapd_deinit_driver( hapd_iface->bss[0]->driver, hapd_iface->bss[0]->drv_priv, hapd_iface); goto fail; } } else { /* Assign new BSS with bss[0]'s driver info */ hapd = hapd_iface->bss[hapd_iface->num_bss - 1]; hapd->driver = hapd_iface->bss[0]->driver; hapd->drv_priv = hapd_iface->bss[0]->drv_priv; os_memcpy(hapd->own_addr, hapd_iface->bss[0]->own_addr, ETH_ALEN); if (start_ctrl_iface_bss(hapd) < 0 || (hapd_iface->state == HAPD_IFACE_ENABLED && hostapd_setup_bss(hapd, -1))) { hostapd_cleanup(hapd); hapd_iface->bss[hapd_iface->num_bss - 1] = NULL; hapd_iface->conf->num_bss--; hapd_iface->num_bss--; wpa_printf(MSG_DEBUG, "%s: free hapd %p %s", __func__, hapd, hapd->conf->iface); hostapd_config_free_bss(hapd->conf); hapd->conf = NULL; os_free(hapd); return -1; } } return 0; } ptr = os_strchr(buf, ' '); if (ptr == NULL) return -1; *ptr++ = '\0'; if (os_strncmp(ptr, "config=", 7) == 0) conf_file = ptr + 7; for (i = 0; i < interfaces->count; i++) { if (!os_strcmp(interfaces->iface[i]->conf->bss[0]->iface, buf)) { wpa_printf(MSG_INFO, "Cannot add interface - it " "already exists"); return -1; } } hapd_iface = hostapd_iface_alloc(interfaces); if (hapd_iface == NULL) { wpa_printf(MSG_ERROR, "%s: Failed to allocate memory " "for interface", __func__); goto fail; } new_iface = hapd_iface; if (conf_file && interfaces->config_read_cb) { conf = interfaces->config_read_cb(conf_file); if (conf && conf->bss) os_strlcpy(conf->bss[0]->iface, buf, sizeof(conf->bss[0]->iface)); } else { char *driver = os_strchr(ptr, ' '); if (driver) *driver++ = '\0'; conf = hostapd_config_alloc(interfaces, buf, ptr, driver); } if (conf == NULL || conf->bss == NULL) { wpa_printf(MSG_ERROR, "%s: Failed to allocate memory " "for configuration", __func__); goto fail; } if (hostapd_data_alloc(hapd_iface, conf) < 0) { wpa_printf(MSG_ERROR, "%s: Failed to allocate memory " "for hostapd", __func__); goto fail; } conf = NULL; if (start_ctrl_iface(hapd_iface) < 0) goto fail; wpa_printf(MSG_INFO, "Add interface '%s'", hapd_iface->conf->bss[0]->iface); return 0; fail: if (conf) hostapd_config_free(conf); if (hapd_iface) { if (hapd_iface->bss) { for (i = 0; i < hapd_iface->num_bss; i++) { hapd = hapd_iface->bss[i]; if (!hapd) continue; if (hapd_iface->interfaces && hapd_iface->interfaces->ctrl_iface_deinit) hapd_iface->interfaces-> ctrl_iface_deinit(hapd); wpa_printf(MSG_DEBUG, "%s: free hapd %p (%s)", __func__, hapd_iface->bss[i], hapd->conf->iface); hostapd_cleanup(hapd); os_free(hapd); hapd_iface->bss[i] = NULL; } os_free(hapd_iface->bss); hapd_iface->bss = NULL; } if (new_iface) { interfaces->count--; interfaces->iface[interfaces->count] = NULL; } hostapd_cleanup_iface(hapd_iface); } return -1; } static int hostapd_remove_bss(struct hostapd_iface *iface, unsigned int idx) { size_t i; wpa_printf(MSG_INFO, "Remove BSS '%s'", iface->conf->bss[idx]->iface); /* Remove hostapd_data only if it has already been initialized */ if (idx < iface->num_bss) { struct hostapd_data *hapd = iface->bss[idx]; hostapd_bss_deinit(hapd); wpa_printf(MSG_DEBUG, "%s: free hapd %p (%s)", __func__, hapd, hapd->conf->iface); hostapd_config_free_bss(hapd->conf); hapd->conf = NULL; os_free(hapd); iface->num_bss--; for (i = idx; i < iface->num_bss; i++) iface->bss[i] = iface->bss[i + 1]; } else { hostapd_config_free_bss(iface->conf->bss[idx]); iface->conf->bss[idx] = NULL; } iface->conf->num_bss--; for (i = idx; i < iface->conf->num_bss; i++) iface->conf->bss[i] = iface->conf->bss[i + 1]; return 0; } int hostapd_remove_iface(struct hapd_interfaces *interfaces, char *buf) { struct hostapd_iface *hapd_iface; size_t i, j, k = 0; for (i = 0; i < interfaces->count; i++) { hapd_iface = interfaces->iface[i]; if (hapd_iface == NULL) return -1; if (!os_strcmp(hapd_iface->conf->bss[0]->iface, buf)) { wpa_printf(MSG_INFO, "Remove interface '%s'", buf); hapd_iface->driver_ap_teardown = !!(hapd_iface->drv_flags & WPA_DRIVER_FLAGS_AP_TEARDOWN_SUPPORT); hostapd_interface_deinit_free(hapd_iface); k = i; while (k < (interfaces->count - 1)) { interfaces->iface[k] = interfaces->iface[k + 1]; k++; } interfaces->count--; return 0; } for (j = 0; j < hapd_iface->conf->num_bss; j++) { if (!os_strcmp(hapd_iface->conf->bss[j]->iface, buf)) { hapd_iface->driver_ap_teardown = !(hapd_iface->drv_flags & WPA_DRIVER_FLAGS_AP_TEARDOWN_SUPPORT); return hostapd_remove_bss(hapd_iface, j); } } } return -1; } /** * hostapd_new_assoc_sta - Notify that a new station associated with the AP * @hapd: Pointer to BSS data * @sta: Pointer to the associated STA data * @reassoc: 1 to indicate this was a re-association; 0 = first association * * This function will be called whenever a station associates with the AP. It * can be called from ieee802_11.c for drivers that export MLME to hostapd and * from drv_callbacks.c based on driver events for drivers that take care of * management frames (IEEE 802.11 authentication and association) internally. */ void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta, int reassoc) { if (hapd->tkip_countermeasures) { hostapd_drv_sta_deauth(hapd, sta->addr, WLAN_REASON_MICHAEL_MIC_FAILURE); return; } hostapd_prune_associations(hapd, sta->addr); ap_sta_clear_disconnect_timeouts(hapd, sta); /* IEEE 802.11F (IAPP) */ if (hapd->conf->ieee802_11f) iapp_new_station(hapd->iapp, sta); #ifdef CONFIG_P2P if (sta->p2p_ie == NULL && !sta->no_p2p_set) { sta->no_p2p_set = 1; hapd->num_sta_no_p2p++; if (hapd->num_sta_no_p2p == 1) hostapd_p2p_non_p2p_sta_connected(hapd); } #endif /* CONFIG_P2P */ /* Start accounting here, if IEEE 802.1X and WPA are not used. * IEEE 802.1X/WPA code will start accounting after the station has * been authorized. */ if (!hapd->conf->ieee802_1x && !hapd->conf->wpa && !hapd->conf->osen) { ap_sta_set_authorized(hapd, sta, 1); os_get_reltime(&sta->connected_time); accounting_sta_start(hapd, sta); } /* Start IEEE 802.1X authentication process for new stations */ ieee802_1x_new_station(hapd, sta); if (reassoc) { if (sta->auth_alg != WLAN_AUTH_FT && !(sta->flags & (WLAN_STA_WPS | WLAN_STA_MAYBE_WPS))) wpa_auth_sm_event(sta->wpa_sm, WPA_REAUTH); } else wpa_auth_sta_associated(hapd->wpa_auth, sta->wpa_sm); if (!(hapd->iface->drv_flags & WPA_DRIVER_FLAGS_INACTIVITY_TIMER)) { wpa_printf(MSG_DEBUG, "%s: %s: reschedule ap_handle_timer timeout for " MACSTR " (%d seconds - ap_max_inactivity)", hapd->conf->iface, __func__, MAC2STR(sta->addr), hapd->conf->ap_max_inactivity); eloop_cancel_timeout(ap_handle_timer, hapd, sta); eloop_register_timeout(hapd->conf->ap_max_inactivity, 0, ap_handle_timer, hapd, sta); } } const char * hostapd_state_text(enum hostapd_iface_state s) { switch (s) { case HAPD_IFACE_UNINITIALIZED: return "UNINITIALIZED"; case HAPD_IFACE_DISABLED: return "DISABLED"; case HAPD_IFACE_COUNTRY_UPDATE: return "COUNTRY_UPDATE"; case HAPD_IFACE_ACS: return "ACS"; case HAPD_IFACE_HT_SCAN: return "HT_SCAN"; case HAPD_IFACE_DFS: return "DFS"; case HAPD_IFACE_ENABLED: return "ENABLED"; } return "UNKNOWN"; } void hostapd_set_state(struct hostapd_iface *iface, enum hostapd_iface_state s) { wpa_printf(MSG_INFO, "%s: interface state %s->%s", iface->conf ? iface->conf->bss[0]->iface : "N/A", hostapd_state_text(iface->state), hostapd_state_text(s)); iface->state = s; } int hostapd_csa_in_progress(struct hostapd_iface *iface) { unsigned int i; for (i = 0; i < iface->num_bss; i++) if (iface->bss[i]->csa_in_progress) return 1; return 0; } #ifdef NEED_AP_MLME static void free_beacon_data(struct beacon_data *beacon) { os_free(beacon->head); beacon->head = NULL; os_free(beacon->tail); beacon->tail = NULL; os_free(beacon->probe_resp); beacon->probe_resp = NULL; os_free(beacon->beacon_ies); beacon->beacon_ies = NULL; os_free(beacon->proberesp_ies); beacon->proberesp_ies = NULL; os_free(beacon->assocresp_ies); beacon->assocresp_ies = NULL; } static int hostapd_build_beacon_data(struct hostapd_data *hapd, struct beacon_data *beacon) { struct wpabuf *beacon_extra, *proberesp_extra, *assocresp_extra; struct wpa_driver_ap_params params; int ret; os_memset(beacon, 0, sizeof(*beacon)); ret = ieee802_11_build_ap_params(hapd, &params); if (ret < 0) return ret; ret = hostapd_build_ap_extra_ies(hapd, &beacon_extra, &proberesp_extra, &assocresp_extra); if (ret) goto free_ap_params; ret = -1; beacon->head = os_malloc(params.head_len); if (!beacon->head) goto free_ap_extra_ies; os_memcpy(beacon->head, params.head, params.head_len); beacon->head_len = params.head_len; beacon->tail = os_malloc(params.tail_len); if (!beacon->tail) goto free_beacon; os_memcpy(beacon->tail, params.tail, params.tail_len); beacon->tail_len = params.tail_len; if (params.proberesp != NULL) { beacon->probe_resp = os_malloc(params.proberesp_len); if (!beacon->probe_resp) goto free_beacon; os_memcpy(beacon->probe_resp, params.proberesp, params.proberesp_len); beacon->probe_resp_len = params.proberesp_len; } /* copy the extra ies */ if (beacon_extra) { beacon->beacon_ies = os_malloc(wpabuf_len(beacon_extra)); if (!beacon->beacon_ies) goto free_beacon; os_memcpy(beacon->beacon_ies, beacon_extra->buf, wpabuf_len(beacon_extra)); beacon->beacon_ies_len = wpabuf_len(beacon_extra); } if (proberesp_extra) { beacon->proberesp_ies = os_malloc(wpabuf_len(proberesp_extra)); if (!beacon->proberesp_ies) goto free_beacon; os_memcpy(beacon->proberesp_ies, proberesp_extra->buf, wpabuf_len(proberesp_extra)); beacon->proberesp_ies_len = wpabuf_len(proberesp_extra); } if (assocresp_extra) { beacon->assocresp_ies = os_malloc(wpabuf_len(assocresp_extra)); if (!beacon->assocresp_ies) goto free_beacon; os_memcpy(beacon->assocresp_ies, assocresp_extra->buf, wpabuf_len(assocresp_extra)); beacon->assocresp_ies_len = wpabuf_len(assocresp_extra); } ret = 0; free_beacon: /* if the function fails, the caller should not free beacon data */ if (ret) free_beacon_data(beacon); free_ap_extra_ies: hostapd_free_ap_extra_ies(hapd, beacon_extra, proberesp_extra, assocresp_extra); free_ap_params: ieee802_11_free_ap_params(&params); return ret; } /* * TODO: This flow currently supports only changing channel and width within * the same hw_mode. Any other changes to MAC parameters or provided settings * are not supported. */ static int hostapd_change_config_freq(struct hostapd_data *hapd, struct hostapd_config *conf, struct hostapd_freq_params *params, struct hostapd_freq_params *old_params) { int channel; if (!params->channel) { /* check if the new channel is supported by hw */ params->channel = hostapd_hw_get_channel(hapd, params->freq); } channel = params->channel; if (!channel) return -1; /* if a pointer to old_params is provided we save previous state */ if (old_params && hostapd_set_freq_params(old_params, conf->hw_mode, hostapd_hw_get_freq(hapd, conf->channel), conf->channel, conf->ieee80211n, conf->ieee80211ac, conf->secondary_channel, conf->vht_oper_chwidth, conf->vht_oper_centr_freq_seg0_idx, conf->vht_oper_centr_freq_seg1_idx, conf->vht_capab)) return -1; switch (params->bandwidth) { case 0: case 20: case 40: conf->vht_oper_chwidth = VHT_CHANWIDTH_USE_HT; break; case 80: if (params->center_freq2) conf->vht_oper_chwidth = VHT_CHANWIDTH_80P80MHZ; else conf->vht_oper_chwidth = VHT_CHANWIDTH_80MHZ; break; case 160: conf->vht_oper_chwidth = VHT_CHANWIDTH_160MHZ; break; default: return -1; } conf->channel = channel; conf->ieee80211n = params->ht_enabled; conf->secondary_channel = params->sec_channel_offset; ieee80211_freq_to_chan(params->center_freq1, &conf->vht_oper_centr_freq_seg0_idx); ieee80211_freq_to_chan(params->center_freq2, &conf->vht_oper_centr_freq_seg1_idx); /* TODO: maybe call here hostapd_config_check here? */ return 0; } static int hostapd_fill_csa_settings(struct hostapd_data *hapd, struct csa_settings *settings) { struct hostapd_iface *iface = hapd->iface; struct hostapd_freq_params old_freq; int ret; u8 chan, vht_bandwidth; os_memset(&old_freq, 0, sizeof(old_freq)); if (!iface || !iface->freq || hapd->csa_in_progress) return -1; switch (settings->freq_params.bandwidth) { case 80: if (settings->freq_params.center_freq2) vht_bandwidth = VHT_CHANWIDTH_80P80MHZ; else vht_bandwidth = VHT_CHANWIDTH_80MHZ; break; case 160: vht_bandwidth = VHT_CHANWIDTH_160MHZ; break; default: vht_bandwidth = VHT_CHANWIDTH_USE_HT; break; } if (ieee80211_freq_to_channel_ext( settings->freq_params.freq, settings->freq_params.sec_channel_offset, vht_bandwidth, &hapd->iface->cs_oper_class, &chan) == NUM_HOSTAPD_MODES) { wpa_printf(MSG_DEBUG, "invalid frequency for channel switch (freq=%d, sec_channel_offset=%d, vht_enabled=%d)", settings->freq_params.freq, settings->freq_params.sec_channel_offset, settings->freq_params.vht_enabled); return -1; } settings->freq_params.channel = chan; ret = hostapd_change_config_freq(iface->bss[0], iface->conf, &settings->freq_params, &old_freq); if (ret) return ret; ret = hostapd_build_beacon_data(hapd, &settings->beacon_after); /* change back the configuration */ hostapd_change_config_freq(iface->bss[0], iface->conf, &old_freq, NULL); if (ret) return ret; /* set channel switch parameters for csa ie */ hapd->cs_freq_params = settings->freq_params; hapd->cs_count = settings->cs_count; hapd->cs_block_tx = settings->block_tx; ret = hostapd_build_beacon_data(hapd, &settings->beacon_csa); if (ret) { free_beacon_data(&settings->beacon_after); return ret; } settings->counter_offset_beacon[0] = hapd->cs_c_off_beacon; settings->counter_offset_presp[0] = hapd->cs_c_off_proberesp; settings->counter_offset_beacon[1] = hapd->cs_c_off_ecsa_beacon; settings->counter_offset_presp[1] = hapd->cs_c_off_ecsa_proberesp; return 0; } void hostapd_cleanup_cs_params(struct hostapd_data *hapd) { os_memset(&hapd->cs_freq_params, 0, sizeof(hapd->cs_freq_params)); hapd->cs_count = 0; hapd->cs_block_tx = 0; hapd->cs_c_off_beacon = 0; hapd->cs_c_off_proberesp = 0; hapd->csa_in_progress = 0; hapd->cs_c_off_ecsa_beacon = 0; hapd->cs_c_off_ecsa_proberesp = 0; } int hostapd_switch_channel(struct hostapd_data *hapd, struct csa_settings *settings) { int ret; if (!(hapd->iface->drv_flags & WPA_DRIVER_FLAGS_AP_CSA)) { wpa_printf(MSG_INFO, "CSA is not supported"); return -1; } ret = hostapd_fill_csa_settings(hapd, settings); if (ret) return ret; ret = hostapd_drv_switch_channel(hapd, settings); free_beacon_data(&settings->beacon_csa); free_beacon_data(&settings->beacon_after); if (ret) { /* if we failed, clean cs parameters */ hostapd_cleanup_cs_params(hapd); return ret; } hapd->csa_in_progress = 1; return 0; } void hostapd_switch_channel_fallback(struct hostapd_iface *iface, const struct hostapd_freq_params *freq_params) { int vht_seg0_idx = 0, vht_seg1_idx = 0, vht_bw = VHT_CHANWIDTH_USE_HT; unsigned int i; wpa_printf(MSG_DEBUG, "Restarting all CSA-related BSSes"); if (freq_params->center_freq1) vht_seg0_idx = 36 + (freq_params->center_freq1 - 5180) / 5; if (freq_params->center_freq2) vht_seg1_idx = 36 + (freq_params->center_freq2 - 5180) / 5; switch (freq_params->bandwidth) { case 0: case 20: case 40: vht_bw = VHT_CHANWIDTH_USE_HT; break; case 80: if (freq_params->center_freq2) vht_bw = VHT_CHANWIDTH_80P80MHZ; else vht_bw = VHT_CHANWIDTH_80MHZ; break; case 160: vht_bw = VHT_CHANWIDTH_160MHZ; break; default: wpa_printf(MSG_WARNING, "Unknown CSA bandwidth: %d", freq_params->bandwidth); break; } iface->freq = freq_params->freq; iface->conf->channel = freq_params->channel; iface->conf->secondary_channel = freq_params->sec_channel_offset; iface->conf->vht_oper_centr_freq_seg0_idx = vht_seg0_idx; iface->conf->vht_oper_centr_freq_seg1_idx = vht_seg1_idx; iface->conf->vht_oper_chwidth = vht_bw; iface->conf->ieee80211n = freq_params->ht_enabled; iface->conf->ieee80211ac = freq_params->vht_enabled; /* * cs_params must not be cleared earlier because the freq_params * argument may actually point to one of these. */ for (i = 0; i < iface->num_bss; i++) hostapd_cleanup_cs_params(iface->bss[i]); hostapd_disable_iface(iface); hostapd_enable_iface(iface); } #endif /* NEED_AP_MLME */ struct hostapd_data * hostapd_get_iface(struct hapd_interfaces *interfaces, const char *ifname) { size_t i, j; for (i = 0; i < interfaces->count; i++) { struct hostapd_iface *iface = interfaces->iface[i]; for (j = 0; j < iface->num_bss; j++) { struct hostapd_data *hapd = iface->bss[j]; if (os_strcmp(ifname, hapd->conf->iface) == 0) return hapd; } } return NULL; } void hostapd_periodic_iface(struct hostapd_iface *iface) { size_t i; ap_list_timer(iface); for (i = 0; i < iface->num_bss; i++) { struct hostapd_data *hapd = iface->bss[i]; if (!hapd->started) continue; #ifndef CONFIG_NO_RADIUS hostapd_acl_expire(hapd); #endif /* CONFIG_NO_RADIUS */ } }
wifiphisher/roguehostapd
roguehostapd/hostapd-2_6/src/ap/hostapd.c
C
bsd-3-clause
84,878
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE191_Integer_Underflow__int_listen_socket_postdec_45.c Label Definition File: CWE191_Integer_Underflow__int.label.xml Template File: sources-sinks-45.tmpl.c */ /* * @description * CWE: 191 Integer Underflow * BadSource: listen_socket Read data using a listen socket (server side) * GoodSource: Set data to a small, non-zero number (negative two) * Sinks: decrement * GoodSink: Ensure there will not be an underflow before decrementing data * BadSink : Decrement data, which can cause an Underflow * Flow Variant: 45 Data flow: data passed as a static global variable from one function to another in the same source file * * */ #include "std_testcase.h" #ifdef _WIN32 #include <winsock2.h> #include <windows.h> #include <direct.h> #pragma comment(lib, "ws2_32") /* include ws2_32.lib when linking */ #define CLOSE_SOCKET closesocket #else #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <unistd.h> #define INVALID_SOCKET -1 #define SOCKET_ERROR -1 #define CLOSE_SOCKET close #define SOCKET int #endif #define TCP_PORT 27015 #define LISTEN_BACKLOG 5 #define CHAR_ARRAY_SIZE (3 * sizeof(data) + 2) static int CWE191_Integer_Underflow__int_listen_socket_postdec_45_badData; static int CWE191_Integer_Underflow__int_listen_socket_postdec_45_goodG2BData; static int CWE191_Integer_Underflow__int_listen_socket_postdec_45_goodB2GData; #ifndef OMITBAD static void badSink() { int data = CWE191_Integer_Underflow__int_listen_socket_postdec_45_badData; { /* POTENTIAL FLAW: Decrementing data could cause an underflow */ data--; int result = data; printIntLine(result); } } void CWE191_Integer_Underflow__int_listen_socket_postdec_45_bad() { int data; /* Initialize data */ data = 0; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE191_Integer_Underflow__int_listen_socket_postdec_45_badData = data; badSink(); } #endif /* OMITBAD */ #ifndef OMITGOOD /* goodG2B() uses the GoodSource with the BadSink */ static void goodG2BSink() { int data = CWE191_Integer_Underflow__int_listen_socket_postdec_45_goodG2BData; { /* POTENTIAL FLAW: Decrementing data could cause an underflow */ data--; int result = data; printIntLine(result); } } static void goodG2B() { int data; /* Initialize data */ data = 0; /* FIX: Use a small, non-zero value that will not cause an integer underflow in the sinks */ data = -2; CWE191_Integer_Underflow__int_listen_socket_postdec_45_goodG2BData = data; goodG2BSink(); } /* goodB2G() uses the BadSource with the GoodSink */ static void goodB2GSink() { int data = CWE191_Integer_Underflow__int_listen_socket_postdec_45_goodB2GData; /* FIX: Add a check to prevent an underflow from occurring */ if (data > INT_MIN) { data--; int result = data; printIntLine(result); } else { printLine("data value is too large to perform arithmetic safely."); } } static void goodB2G() { int data; /* Initialize data */ data = 0; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE191_Integer_Underflow__int_listen_socket_postdec_45_goodB2GData = data; goodB2GSink(); } void CWE191_Integer_Underflow__int_listen_socket_postdec_45_good() { goodG2B(); goodB2G(); } #endif /* OMITGOOD */ /* Below is the main(). It is only used when building this testcase on its own for testing or for building a binary to use in testing binary analysis tools. It is not used when compiling all the testcases as one application, which is how source code analysis tools are tested. */ #ifdef INCLUDEMAIN int main(int argc, char * argv[]) { /* seed randomness */ srand( (unsigned)time(NULL) ); #ifndef OMITGOOD printLine("Calling good()..."); CWE191_Integer_Underflow__int_listen_socket_postdec_45_good(); printLine("Finished good()"); #endif /* OMITGOOD */ #ifndef OMITBAD printLine("Calling bad()..."); CWE191_Integer_Underflow__int_listen_socket_postdec_45_bad(); printLine("Finished bad()"); #endif /* OMITBAD */ return 0; } #endif
JianpingZeng/xcc
xcc/test/juliet/testcases/CWE191_Integer_Underflow/s04/CWE191_Integer_Underflow__int_listen_socket_postdec_45.c
C
bsd-3-clause
8,543
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. //------------------------------------------------------------------------------ // Description of the life cycle of a instance of MetricsService. // // OVERVIEW // // A MetricsService instance is typically created at application startup. It is // the central controller for the acquisition of log data, and the automatic // transmission of that log data to an external server. Its major job is to // manage logs, grouping them for transmission, and transmitting them. As part // of its grouping, MS finalizes logs by including some just-in-time gathered // memory statistics, snapshotting the current stats of numerous histograms, // closing the logs, translating to protocol buffer format, and compressing the // results for transmission. Transmission includes submitting a compressed log // as data in a URL-post, and retransmitting (or retaining at process // termination) if the attempted transmission failed. Retention across process // terminations is done using the the PrefServices facilities. The retained logs // (the ones that never got transmitted) are compressed and base64-encoded // before being persisted. // // Logs fall into one of two categories: "initial logs," and "ongoing logs." // There is at most one initial log sent for each complete run of Chrome (from // startup, to browser shutdown). An initial log is generally transmitted some // short time (1 minute?) after startup, and includes stats such as recent crash // info, the number and types of plugins, etc. The external server's response // to the initial log conceptually tells this MS if it should continue // transmitting logs (during this session). The server response can actually be // much more detailed, and always includes (at a minimum) how often additional // ongoing logs should be sent. // // After the above initial log, a series of ongoing logs will be transmitted. // The first ongoing log actually begins to accumulate information stating when // the MS was first constructed. Note that even though the initial log is // commonly sent a full minute after startup, the initial log does not include // much in the way of user stats. The most common interlog period (delay) // is 30 minutes. That time period starts when the first user action causes a // logging event. This means that if there is no user action, there may be long // periods without any (ongoing) log transmissions. Ongoing logs typically // contain very detailed records of user activities (ex: opened tab, closed // tab, fetched URL, maximized window, etc.) In addition, just before an // ongoing log is closed out, a call is made to gather memory statistics. Those // memory statistics are deposited into a histogram, and the log finalization // code is then called. In the finalization, a call to a Histogram server // acquires a list of all local histograms that have been flagged for upload // to the UMA server. The finalization also acquires the most recent number // of page loads, along with any counts of renderer or plugin crashes. // // When the browser shuts down, there will typically be a fragment of an ongoing // log that has not yet been transmitted. At shutdown time, that fragment is // closed (including snapshotting histograms), and persisted, for potential // transmission during a future run of the product. // // There are two slightly abnormal shutdown conditions. There is a // "disconnected scenario," and a "really fast startup and shutdown" scenario. // In the "never connected" situation, the user has (during the running of the // process) never established an internet connection. As a result, attempts to // transmit the initial log have failed, and a lot(?) of data has accumulated in // the ongoing log (which didn't yet get closed, because there was never even a // contemplation of sending it). There is also a kindred "lost connection" // situation, where a loss of connection prevented an ongoing log from being // transmitted, and a (still open) log was stuck accumulating a lot(?) of data, // while the earlier log retried its transmission. In both of these // disconnected situations, two logs need to be, and are, persistently stored // for future transmission. // // The other unusual shutdown condition, termed "really fast startup and // shutdown," involves the deliberate user termination of the process before // the initial log is even formed or transmitted. In that situation, no logging // is done, but the historical crash statistics remain (unlogged) for inclusion // in a future run's initial log. (i.e., we don't lose crash stats). // // With the above overview, we can now describe the state machine's various // states, based on the State enum specified in the state_ member. Those states // are: // // INITIALIZED, // Constructor was called. // INIT_TASK_SCHEDULED, // Waiting for deferred init tasks to finish. // INIT_TASK_DONE, // Waiting for timer to send initial log. // SENDING_LOGS, // Sending logs and creating new ones when we run out. // // In more detail, we have: // // INITIALIZED, // Constructor was called. // The MS has been constructed, but has taken no actions to compose the // initial log. // // INIT_TASK_SCHEDULED, // Waiting for deferred init tasks to finish. // Typically about 30 seconds after startup, a task is sent to a second thread // (the file thread) to perform deferred (lower priority and slower) // initialization steps such as getting the list of plugins. That task will // (when complete) make an async callback (via a Task) to indicate the // completion. // // INIT_TASK_DONE, // Waiting for timer to send initial log. // The callback has arrived, and it is now possible for an initial log to be // created. This callback typically arrives back less than one second after // the deferred init task is dispatched. // // SENDING_LOGS, // Sending logs an creating new ones when we run out. // Logs from previous sessions have been loaded, and initial logs have been // created (an optional stability log and the first metrics log). We will // send all of these logs, and when run out, we will start cutting new logs // to send. We will also cut a new log if we expect a shutdown. // // The progression through the above states is simple, and sequential. // States proceed from INITIAL to SENDING_LOGS, and remain in the latter until // shutdown. // // Also note that whenever we successfully send a log, we mirror the list // of logs into the PrefService. This ensures that IF we crash, we won't start // up and retransmit our old logs again. // // Due to race conditions, it is always possible that a log file could be sent // twice. For example, if a log file is sent, but not yet acknowledged by // the external server, and the user shuts down, then a copy of the log may be // saved for re-transmission. These duplicates could be filtered out server // side, but are not expected to be a significant problem. // // //------------------------------------------------------------------------------ #include "components/metrics/metrics_service.h" #include <algorithm> #include "base/bind.h" #include "base/callback.h" #include "base/metrics/histogram.h" #include "base/metrics/histogram_base.h" #include "base/metrics/histogram_samples.h" #include "base/metrics/sparse_histogram.h" #include "base/metrics/statistics_recorder.h" #include "base/prefs/pref_registry_simple.h" #include "base/prefs/pref_service.h" #include "base/strings/string_number_conversions.h" #include "base/strings/utf_string_conversions.h" #include "base/threading/platform_thread.h" #include "base/threading/thread.h" #include "base/threading/thread_restrictions.h" #include "base/time/time.h" #include "base/tracked_objects.h" #include "base/values.h" #include "components/metrics/metrics_log.h" #include "components/metrics/metrics_log_manager.h" #include "components/metrics/metrics_log_uploader.h" #include "components/metrics/metrics_pref_names.h" #include "components/metrics/metrics_reporting_scheduler.h" #include "components/metrics/metrics_service_client.h" #include "components/metrics/metrics_state_manager.h" #include "components/variations/entropy_provider.h" namespace metrics { namespace { // Check to see that we're being called on only one thread. bool IsSingleThreaded() { static base::PlatformThreadId thread_id = 0; if (!thread_id) thread_id = base::PlatformThread::CurrentId(); return base::PlatformThread::CurrentId() == thread_id; } // The delay, in seconds, after starting recording before doing expensive // initialization work. #if defined(OS_ANDROID) || defined(OS_IOS) // On mobile devices, a significant portion of sessions last less than a minute. // Use a shorter timer on these platforms to avoid losing data. // TODO(dfalcantara): To avoid delaying startup, tighten up initialization so // that it occurs after the user gets their initial page. const int kInitializationDelaySeconds = 5; #else const int kInitializationDelaySeconds = 30; #endif // The maximum number of events in a log uploaded to the UMA server. const int kEventLimit = 2400; // If an upload fails, and the transmission was over this byte count, then we // will discard the log, and not try to retransmit it. We also don't persist // the log to the prefs for transmission during the next chrome session if this // limit is exceeded. const size_t kUploadLogAvoidRetransmitSize = 100 * 1024; // Interval, in minutes, between state saves. const int kSaveStateIntervalMinutes = 5; enum ResponseStatus { UNKNOWN_FAILURE, SUCCESS, BAD_REQUEST, // Invalid syntax or log too large. NO_RESPONSE, NUM_RESPONSE_STATUSES }; ResponseStatus ResponseCodeToStatus(int response_code) { switch (response_code) { case -1: return NO_RESPONSE; case 200: return SUCCESS; case 400: return BAD_REQUEST; default: return UNKNOWN_FAILURE; } } #if defined(OS_ANDROID) || defined(OS_IOS) void MarkAppCleanShutdownAndCommit(CleanExitBeacon* clean_exit_beacon, PrefService* local_state) { clean_exit_beacon->WriteBeaconValue(true); local_state->SetInteger(prefs::kStabilityExecutionPhase, MetricsService::SHUTDOWN_COMPLETE); // Start writing right away (write happens on a different thread). local_state->CommitPendingWrite(); } #endif // defined(OS_ANDROID) || defined(OS_IOS) } // namespace SyntheticTrialGroup::SyntheticTrialGroup(uint32 trial, uint32 group) { id.name = trial; id.group = group; } SyntheticTrialGroup::~SyntheticTrialGroup() { } // static MetricsService::ShutdownCleanliness MetricsService::clean_shutdown_status_ = MetricsService::CLEANLY_SHUTDOWN; MetricsService::ExecutionPhase MetricsService::execution_phase_ = MetricsService::UNINITIALIZED_PHASE; // static void MetricsService::RegisterPrefs(PrefRegistrySimple* registry) { DCHECK(IsSingleThreaded()); MetricsStateManager::RegisterPrefs(registry); MetricsLog::RegisterPrefs(registry); registry->RegisterInt64Pref(prefs::kInstallDate, 0); registry->RegisterInt64Pref(prefs::kStabilityLaunchTimeSec, 0); registry->RegisterInt64Pref(prefs::kStabilityLastTimestampSec, 0); registry->RegisterStringPref(prefs::kStabilityStatsVersion, std::string()); registry->RegisterInt64Pref(prefs::kStabilityStatsBuildTime, 0); registry->RegisterBooleanPref(prefs::kStabilityExitedCleanly, true); registry->RegisterIntegerPref(prefs::kStabilityExecutionPhase, UNINITIALIZED_PHASE); registry->RegisterBooleanPref(prefs::kStabilitySessionEndCompleted, true); registry->RegisterIntegerPref(prefs::kMetricsSessionID, -1); registry->RegisterListPref(prefs::kMetricsInitialLogs); registry->RegisterListPref(prefs::kMetricsOngoingLogs); registry->RegisterInt64Pref(prefs::kUninstallLaunchCount, 0); registry->RegisterInt64Pref(prefs::kUninstallMetricsUptimeSec, 0); } MetricsService::MetricsService(MetricsStateManager* state_manager, MetricsServiceClient* client, PrefService* local_state) : log_manager_(local_state, kUploadLogAvoidRetransmitSize), histogram_snapshot_manager_(this), state_manager_(state_manager), client_(client), local_state_(local_state), clean_exit_beacon_(client->GetRegistryBackupKey(), local_state), recording_active_(false), reporting_active_(false), test_mode_active_(false), state_(INITIALIZED), log_upload_in_progress_(false), idle_since_last_transmission_(false), session_id_(-1), self_ptr_factory_(this), state_saver_factory_(this) { DCHECK(IsSingleThreaded()); DCHECK(state_manager_); DCHECK(client_); DCHECK(local_state_); // Set the install date if this is our first run. int64 install_date = local_state_->GetInt64(prefs::kInstallDate); if (install_date == 0) local_state_->SetInt64(prefs::kInstallDate, base::Time::Now().ToTimeT()); } MetricsService::~MetricsService() { DisableRecording(); } void MetricsService::InitializeMetricsRecordingState() { InitializeMetricsState(); base::Closure upload_callback = base::Bind(&MetricsService::StartScheduledUpload, self_ptr_factory_.GetWeakPtr()); scheduler_.reset( new MetricsReportingScheduler( upload_callback, // MetricsServiceClient outlives MetricsService, and // MetricsReportingScheduler is tied to the lifetime of |this|. base::Bind(&MetricsServiceClient::GetStandardUploadInterval, base::Unretained(client_)))); } void MetricsService::Start() { HandleIdleSinceLastTransmission(false); EnableRecording(); EnableReporting(); } bool MetricsService::StartIfMetricsReportingEnabled() { const bool enabled = state_manager_->IsMetricsReportingEnabled(); if (enabled) Start(); return enabled; } void MetricsService::StartRecordingForTests() { test_mode_active_ = true; EnableRecording(); DisableReporting(); } void MetricsService::Stop() { HandleIdleSinceLastTransmission(false); DisableReporting(); DisableRecording(); } void MetricsService::EnableReporting() { if (reporting_active_) return; reporting_active_ = true; StartSchedulerIfNecessary(); } void MetricsService::DisableReporting() { reporting_active_ = false; } std::string MetricsService::GetClientId() { return state_manager_->client_id(); } int64 MetricsService::GetInstallDate() { return local_state_->GetInt64(prefs::kInstallDate); } int64 MetricsService::GetMetricsReportingEnabledDate() { return local_state_->GetInt64(prefs::kMetricsReportingEnabledTimestamp); } scoped_ptr<const base::FieldTrial::EntropyProvider> MetricsService::CreateEntropyProvider() { // TODO(asvitkine): Refactor the code so that MetricsService does not expose // this method. return state_manager_->CreateEntropyProvider(); } void MetricsService::EnableRecording() { DCHECK(IsSingleThreaded()); if (recording_active_) return; recording_active_ = true; state_manager_->ForceClientIdCreation(); client_->SetMetricsClientId(state_manager_->client_id()); if (!log_manager_.current_log()) OpenNewLog(); for (size_t i = 0; i < metrics_providers_.size(); ++i) metrics_providers_[i]->OnRecordingEnabled(); base::RemoveActionCallback(action_callback_); action_callback_ = base::Bind(&MetricsService::OnUserAction, base::Unretained(this)); base::AddActionCallback(action_callback_); } void MetricsService::DisableRecording() { DCHECK(IsSingleThreaded()); if (!recording_active_) return; recording_active_ = false; client_->OnRecordingDisabled(); base::RemoveActionCallback(action_callback_); for (size_t i = 0; i < metrics_providers_.size(); ++i) metrics_providers_[i]->OnRecordingDisabled(); PushPendingLogsToPersistentStorage(); } bool MetricsService::recording_active() const { DCHECK(IsSingleThreaded()); return recording_active_; } bool MetricsService::reporting_active() const { DCHECK(IsSingleThreaded()); return reporting_active_; } void MetricsService::RecordDelta(const base::HistogramBase& histogram, const base::HistogramSamples& snapshot) { log_manager_.current_log()->RecordHistogramDelta(histogram.histogram_name(), snapshot); } void MetricsService::InconsistencyDetected( base::HistogramBase::Inconsistency problem) { UMA_HISTOGRAM_ENUMERATION("Histogram.InconsistenciesBrowser", problem, base::HistogramBase::NEVER_EXCEEDED_VALUE); } void MetricsService::UniqueInconsistencyDetected( base::HistogramBase::Inconsistency problem) { UMA_HISTOGRAM_ENUMERATION("Histogram.InconsistenciesBrowserUnique", problem, base::HistogramBase::NEVER_EXCEEDED_VALUE); } void MetricsService::InconsistencyDetectedInLoggedCount(int amount) { UMA_HISTOGRAM_COUNTS("Histogram.InconsistentSnapshotBrowser", std::abs(amount)); } void MetricsService::HandleIdleSinceLastTransmission(bool in_idle) { // If there wasn't a lot of action, maybe the computer was asleep, in which // case, the log transmissions should have stopped. Here we start them up // again. if (!in_idle && idle_since_last_transmission_) StartSchedulerIfNecessary(); idle_since_last_transmission_ = in_idle; } void MetricsService::OnApplicationNotIdle() { if (recording_active_) HandleIdleSinceLastTransmission(false); } void MetricsService::RecordStartOfSessionEnd() { LogCleanShutdown(); RecordBooleanPrefValue(prefs::kStabilitySessionEndCompleted, false); } void MetricsService::RecordCompletedSessionEnd() { LogCleanShutdown(); RecordBooleanPrefValue(prefs::kStabilitySessionEndCompleted, true); } #if defined(OS_ANDROID) || defined(OS_IOS) void MetricsService::OnAppEnterBackground() { scheduler_->Stop(); MarkAppCleanShutdownAndCommit(&clean_exit_beacon_, local_state_); // At this point, there's no way of knowing when the process will be // killed, so this has to be treated similar to a shutdown, closing and // persisting all logs. Unlinke a shutdown, the state is primed to be ready // to continue logging and uploading if the process does return. if (recording_active() && state_ >= SENDING_LOGS) { PushPendingLogsToPersistentStorage(); // Persisting logs closes the current log, so start recording a new log // immediately to capture any background work that might be done before the // process is killed. OpenNewLog(); } } void MetricsService::OnAppEnterForeground() { clean_exit_beacon_.WriteBeaconValue(false); StartSchedulerIfNecessary(); } #else void MetricsService::LogNeedForCleanShutdown() { clean_exit_beacon_.WriteBeaconValue(false); // Redundant setting to be sure we call for a clean shutdown. clean_shutdown_status_ = NEED_TO_SHUTDOWN; } #endif // defined(OS_ANDROID) || defined(OS_IOS) // static void MetricsService::SetExecutionPhase(ExecutionPhase execution_phase, PrefService* local_state) { execution_phase_ = execution_phase; local_state->SetInteger(prefs::kStabilityExecutionPhase, execution_phase_); } void MetricsService::RecordBreakpadRegistration(bool success) { if (!success) IncrementPrefValue(prefs::kStabilityBreakpadRegistrationFail); else IncrementPrefValue(prefs::kStabilityBreakpadRegistrationSuccess); } void MetricsService::RecordBreakpadHasDebugger(bool has_debugger) { if (!has_debugger) IncrementPrefValue(prefs::kStabilityDebuggerNotPresent); else IncrementPrefValue(prefs::kStabilityDebuggerPresent); } void MetricsService::ClearSavedStabilityMetrics() { for (size_t i = 0; i < metrics_providers_.size(); ++i) metrics_providers_[i]->ClearSavedStabilityMetrics(); // Reset the prefs that are managed by MetricsService/MetricsLog directly. local_state_->SetInteger(prefs::kStabilityCrashCount, 0); local_state_->SetInteger(prefs::kStabilityExecutionPhase, UNINITIALIZED_PHASE); local_state_->SetInteger(prefs::kStabilityIncompleteSessionEndCount, 0); local_state_->SetInteger(prefs::kStabilityLaunchCount, 0); local_state_->SetBoolean(prefs::kStabilitySessionEndCompleted, true); } void MetricsService::PushExternalLog(const std::string& log) { log_manager_.StoreLog(log, MetricsLog::ONGOING_LOG); } //------------------------------------------------------------------------------ // private methods //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ // Initialization methods void MetricsService::InitializeMetricsState() { const int64 buildtime = MetricsLog::GetBuildTime(); const std::string version = client_->GetVersionString(); bool version_changed = false; if (local_state_->GetInt64(prefs::kStabilityStatsBuildTime) != buildtime || local_state_->GetString(prefs::kStabilityStatsVersion) != version) { local_state_->SetString(prefs::kStabilityStatsVersion, version); local_state_->SetInt64(prefs::kStabilityStatsBuildTime, buildtime); version_changed = true; } log_manager_.LoadPersistedUnsentLogs(); session_id_ = local_state_->GetInteger(prefs::kMetricsSessionID); if (!clean_exit_beacon_.exited_cleanly()) { IncrementPrefValue(prefs::kStabilityCrashCount); // Reset flag, and wait until we call LogNeedForCleanShutdown() before // monitoring. clean_exit_beacon_.WriteBeaconValue(true); } bool has_initial_stability_log = false; if (!clean_exit_beacon_.exited_cleanly() || ProvidersHaveStabilityMetrics()) { // TODO(rtenneti): On windows, consider saving/getting execution_phase from // the registry. int execution_phase = local_state_->GetInteger(prefs::kStabilityExecutionPhase); UMA_HISTOGRAM_SPARSE_SLOWLY("Chrome.Browser.CrashedExecutionPhase", execution_phase); // If the previous session didn't exit cleanly, or if any provider // explicitly requests it, prepare an initial stability log - // provided UMA is enabled. if (state_manager_->IsMetricsReportingEnabled()) has_initial_stability_log = PrepareInitialStabilityLog(); } // If no initial stability log was generated and there was a version upgrade, // clear the stability stats from the previous version (so that they don't get // attributed to the current version). This could otherwise happen due to a // number of different edge cases, such as if the last version crashed before // it could save off a system profile or if UMA reporting is disabled (which // normally results in stats being accumulated). if (!has_initial_stability_log && version_changed) ClearSavedStabilityMetrics(); // Update session ID. ++session_id_; local_state_->SetInteger(prefs::kMetricsSessionID, session_id_); // Stability bookkeeping IncrementPrefValue(prefs::kStabilityLaunchCount); DCHECK_EQ(UNINITIALIZED_PHASE, execution_phase_); SetExecutionPhase(START_METRICS_RECORDING, local_state_); if (!local_state_->GetBoolean(prefs::kStabilitySessionEndCompleted)) { IncrementPrefValue(prefs::kStabilityIncompleteSessionEndCount); // This is marked false when we get a WM_ENDSESSION. local_state_->SetBoolean(prefs::kStabilitySessionEndCompleted, true); } // Call GetUptimes() for the first time, thus allowing all later calls // to record incremental uptimes accurately. base::TimeDelta ignored_uptime_parameter; base::TimeDelta startup_uptime; GetUptimes(local_state_, &startup_uptime, &ignored_uptime_parameter); DCHECK_EQ(0, startup_uptime.InMicroseconds()); // For backwards compatibility, leave this intact in case Omaha is checking // them. prefs::kStabilityLastTimestampSec may also be useless now. // TODO(jar): Delete these if they have no uses. local_state_->SetInt64(prefs::kStabilityLaunchTimeSec, base::Time::Now().ToTimeT()); // Bookkeeping for the uninstall metrics. IncrementLongPrefsValue(prefs::kUninstallLaunchCount); // Kick off the process of saving the state (so the uptime numbers keep // getting updated) every n minutes. ScheduleNextStateSave(); } void MetricsService::OnUserAction(const std::string& action) { if (!ShouldLogEvents()) return; log_manager_.current_log()->RecordUserAction(action); HandleIdleSinceLastTransmission(false); } void MetricsService::FinishedGatheringInitialMetrics() { DCHECK_EQ(INIT_TASK_SCHEDULED, state_); state_ = INIT_TASK_DONE; // Create the initial log. if (!initial_metrics_log_.get()) { initial_metrics_log_ = CreateLog(MetricsLog::ONGOING_LOG); NotifyOnDidCreateMetricsLog(); } scheduler_->InitTaskComplete(); } void MetricsService::GetUptimes(PrefService* pref, base::TimeDelta* incremental_uptime, base::TimeDelta* uptime) { base::TimeTicks now = base::TimeTicks::Now(); // If this is the first call, init |first_updated_time_| and // |last_updated_time_|. if (last_updated_time_.is_null()) { first_updated_time_ = now; last_updated_time_ = now; } *incremental_uptime = now - last_updated_time_; *uptime = now - first_updated_time_; last_updated_time_ = now; const int64 incremental_time_secs = incremental_uptime->InSeconds(); if (incremental_time_secs > 0) { int64 metrics_uptime = pref->GetInt64(prefs::kUninstallMetricsUptimeSec); metrics_uptime += incremental_time_secs; pref->SetInt64(prefs::kUninstallMetricsUptimeSec, metrics_uptime); } } void MetricsService::NotifyOnDidCreateMetricsLog() { DCHECK(IsSingleThreaded()); for (size_t i = 0; i < metrics_providers_.size(); ++i) metrics_providers_[i]->OnDidCreateMetricsLog(); } //------------------------------------------------------------------------------ // State save methods void MetricsService::ScheduleNextStateSave() { state_saver_factory_.InvalidateWeakPtrs(); base::MessageLoop::current()->PostDelayedTask(FROM_HERE, base::Bind(&MetricsService::SaveLocalState, state_saver_factory_.GetWeakPtr()), base::TimeDelta::FromMinutes(kSaveStateIntervalMinutes)); } void MetricsService::SaveLocalState() { RecordCurrentState(local_state_); // TODO(jar):110021 Does this run down the batteries???? ScheduleNextStateSave(); } //------------------------------------------------------------------------------ // Recording control methods void MetricsService::OpenNewLog() { DCHECK(!log_manager_.current_log()); log_manager_.BeginLoggingWithLog(CreateLog(MetricsLog::ONGOING_LOG)); NotifyOnDidCreateMetricsLog(); if (state_ == INITIALIZED) { // We only need to schedule that run once. state_ = INIT_TASK_SCHEDULED; base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&MetricsService::StartGatheringMetrics, self_ptr_factory_.GetWeakPtr()), base::TimeDelta::FromSeconds(kInitializationDelaySeconds)); } } void MetricsService::StartGatheringMetrics() { client_->StartGatheringMetrics( base::Bind(&MetricsService::FinishedGatheringInitialMetrics, self_ptr_factory_.GetWeakPtr())); } void MetricsService::CloseCurrentLog() { if (!log_manager_.current_log()) return; // TODO(jar): Integrate bounds on log recording more consistently, so that we // can stop recording logs that are too big much sooner. if (log_manager_.current_log()->num_events() > kEventLimit) { UMA_HISTOGRAM_COUNTS("UMA.Discarded Log Events", log_manager_.current_log()->num_events()); log_manager_.DiscardCurrentLog(); OpenNewLog(); // Start trivial log to hold our histograms. } // Put incremental data (histogram deltas, and realtime stats deltas) at the // end of all log transmissions (initial log handles this separately). // RecordIncrementalStabilityElements only exists on the derived // MetricsLog class. MetricsLog* current_log = log_manager_.current_log(); DCHECK(current_log); RecordCurrentEnvironment(current_log); base::TimeDelta incremental_uptime; base::TimeDelta uptime; GetUptimes(local_state_, &incremental_uptime, &uptime); current_log->RecordStabilityMetrics(metrics_providers_.get(), incremental_uptime, uptime); current_log->RecordGeneralMetrics(metrics_providers_.get()); RecordCurrentHistograms(); log_manager_.FinishCurrentLog(); } void MetricsService::PushPendingLogsToPersistentStorage() { if (state_ < SENDING_LOGS) return; // We didn't and still don't have time to get plugin list etc. CloseCurrentLog(); log_manager_.PersistUnsentLogs(); } //------------------------------------------------------------------------------ // Transmission of logs methods void MetricsService::StartSchedulerIfNecessary() { // Never schedule cutting or uploading of logs in test mode. if (test_mode_active_) return; // Even if reporting is disabled, the scheduler is needed to trigger the // creation of the initial log, which must be done in order for any logs to be // persisted on shutdown or backgrounding. if (recording_active() && (reporting_active() || state_ < SENDING_LOGS)) { scheduler_->Start(); } } void MetricsService::StartScheduledUpload() { DCHECK(state_ >= INIT_TASK_DONE); // If we're getting no notifications, then the log won't have much in it, and // it's possible the computer is about to go to sleep, so don't upload and // stop the scheduler. // If recording has been turned off, the scheduler doesn't need to run. // If reporting is off, proceed if the initial log hasn't been created, since // that has to happen in order for logs to be cut and stored when persisting. // TODO(stuartmorgan): Call Stop() on the scheduler when reporting and/or // recording are turned off instead of letting it fire and then aborting. if (idle_since_last_transmission_ || !recording_active() || (!reporting_active() && state_ >= SENDING_LOGS)) { scheduler_->Stop(); scheduler_->UploadCancelled(); return; } // If there are unsent logs, send the next one. If not, start the asynchronous // process of finalizing the current log for upload. if (state_ == SENDING_LOGS && log_manager_.has_unsent_logs()) { SendNextLog(); } else { // There are no logs left to send, so start creating a new one. client_->CollectFinalMetrics( base::Bind(&MetricsService::OnFinalLogInfoCollectionDone, self_ptr_factory_.GetWeakPtr())); } } void MetricsService::OnFinalLogInfoCollectionDone() { // If somehow there is a log upload in progress, we return and hope things // work out. The scheduler isn't informed since if this happens, the scheduler // will get a response from the upload. DCHECK(!log_upload_in_progress_); if (log_upload_in_progress_) return; // Abort if metrics were turned off during the final info gathering. if (!recording_active()) { scheduler_->Stop(); scheduler_->UploadCancelled(); return; } if (state_ == INIT_TASK_DONE) { PrepareInitialMetricsLog(); } else { DCHECK_EQ(SENDING_LOGS, state_); CloseCurrentLog(); OpenNewLog(); } SendNextLog(); } void MetricsService::SendNextLog() { DCHECK_EQ(SENDING_LOGS, state_); if (!reporting_active()) { scheduler_->Stop(); scheduler_->UploadCancelled(); return; } if (!log_manager_.has_unsent_logs()) { // Should only get here if serializing the log failed somehow. // Just tell the scheduler it was uploaded and wait for the next log // interval. scheduler_->UploadFinished(true, log_manager_.has_unsent_logs()); return; } if (!log_manager_.has_staged_log()) log_manager_.StageNextLogForUpload(); SendStagedLog(); } bool MetricsService::ProvidersHaveStabilityMetrics() { // Check whether any metrics provider has stability metrics. for (size_t i = 0; i < metrics_providers_.size(); ++i) { if (metrics_providers_[i]->HasStabilityMetrics()) return true; } return false; } bool MetricsService::PrepareInitialStabilityLog() { DCHECK_EQ(INITIALIZED, state_); scoped_ptr<MetricsLog> initial_stability_log( CreateLog(MetricsLog::INITIAL_STABILITY_LOG)); // Do not call NotifyOnDidCreateMetricsLog here because the stability // log describes stats from the _previous_ session. if (!initial_stability_log->LoadSavedEnvironmentFromPrefs()) return false; log_manager_.PauseCurrentLog(); log_manager_.BeginLoggingWithLog(initial_stability_log.Pass()); // Note: Some stability providers may record stability stats via histograms, // so this call has to be after BeginLoggingWithLog(). log_manager_.current_log()->RecordStabilityMetrics( metrics_providers_.get(), base::TimeDelta(), base::TimeDelta()); RecordCurrentStabilityHistograms(); // Note: RecordGeneralMetrics() intentionally not called since this log is for // stability stats from a previous session only. log_manager_.FinishCurrentLog(); log_manager_.ResumePausedLog(); // Store unsent logs, including the stability log that was just saved, so // that they're not lost in case of a crash before upload time. log_manager_.PersistUnsentLogs(); return true; } void MetricsService::PrepareInitialMetricsLog() { DCHECK_EQ(INIT_TASK_DONE, state_); RecordCurrentEnvironment(initial_metrics_log_.get()); base::TimeDelta incremental_uptime; base::TimeDelta uptime; GetUptimes(local_state_, &incremental_uptime, &uptime); // Histograms only get written to the current log, so make the new log current // before writing them. log_manager_.PauseCurrentLog(); log_manager_.BeginLoggingWithLog(initial_metrics_log_.Pass()); // Note: Some stability providers may record stability stats via histograms, // so this call has to be after BeginLoggingWithLog(). MetricsLog* current_log = log_manager_.current_log(); current_log->RecordStabilityMetrics(metrics_providers_.get(), base::TimeDelta(), base::TimeDelta()); current_log->RecordGeneralMetrics(metrics_providers_.get()); RecordCurrentHistograms(); log_manager_.FinishCurrentLog(); log_manager_.ResumePausedLog(); // Store unsent logs, including the initial log that was just saved, so // that they're not lost in case of a crash before upload time. log_manager_.PersistUnsentLogs(); state_ = SENDING_LOGS; } void MetricsService::SendStagedLog() { DCHECK(log_manager_.has_staged_log()); if (!log_manager_.has_staged_log()) return; DCHECK(!log_upload_in_progress_); log_upload_in_progress_ = true; if (!log_uploader_) { log_uploader_ = client_->CreateUploader( base::Bind(&MetricsService::OnLogUploadComplete, self_ptr_factory_.GetWeakPtr())); } const std::string hash = base::HexEncode(log_manager_.staged_log_hash().data(), log_manager_.staged_log_hash().size()); bool success = log_uploader_->UploadLog(log_manager_.staged_log(), hash); UMA_HISTOGRAM_BOOLEAN("UMA.UploadCreation", success); if (!success) { // Skip this upload and hope things work out next time. log_manager_.DiscardStagedLog(); scheduler_->UploadCancelled(); log_upload_in_progress_ = false; return; } HandleIdleSinceLastTransmission(true); } void MetricsService::OnLogUploadComplete(int response_code) { DCHECK_EQ(SENDING_LOGS, state_); DCHECK(log_upload_in_progress_); log_upload_in_progress_ = false; // Log a histogram to track response success vs. failure rates. UMA_HISTOGRAM_ENUMERATION("UMA.UploadResponseStatus.Protobuf", ResponseCodeToStatus(response_code), NUM_RESPONSE_STATUSES); bool upload_succeeded = response_code == 200; // Provide boolean for error recovery (allow us to ignore response_code). bool discard_log = false; const size_t log_size = log_manager_.staged_log().length(); if (upload_succeeded) { UMA_HISTOGRAM_COUNTS_10000("UMA.LogSize.OnSuccess", log_size / 1024); } else if (log_size > kUploadLogAvoidRetransmitSize) { UMA_HISTOGRAM_COUNTS("UMA.Large Rejected Log was Discarded", static_cast<int>(log_size)); discard_log = true; } else if (response_code == 400) { // Bad syntax. Retransmission won't work. discard_log = true; } if (upload_succeeded || discard_log) { log_manager_.DiscardStagedLog(); // Store the updated list to disk now that the removed log is uploaded. log_manager_.PersistUnsentLogs(); } // Error 400 indicates a problem with the log, not with the server, so // don't consider that a sign that the server is in trouble. bool server_is_healthy = upload_succeeded || response_code == 400; scheduler_->UploadFinished(server_is_healthy, log_manager_.has_unsent_logs()); if (server_is_healthy) client_->OnLogUploadComplete(); } void MetricsService::IncrementPrefValue(const char* path) { int value = local_state_->GetInteger(path); local_state_->SetInteger(path, value + 1); } void MetricsService::IncrementLongPrefsValue(const char* path) { int64 value = local_state_->GetInt64(path); local_state_->SetInt64(path, value + 1); } bool MetricsService::UmaMetricsProperlyShutdown() { CHECK(clean_shutdown_status_ == CLEANLY_SHUTDOWN || clean_shutdown_status_ == NEED_TO_SHUTDOWN); return clean_shutdown_status_ == CLEANLY_SHUTDOWN; } void MetricsService::AddSyntheticTrialObserver( SyntheticTrialObserver* observer) { synthetic_trial_observer_list_.AddObserver(observer); if (!synthetic_trial_groups_.empty()) observer->OnSyntheticTrialsChanged(synthetic_trial_groups_); } void MetricsService::RemoveSyntheticTrialObserver( SyntheticTrialObserver* observer) { synthetic_trial_observer_list_.RemoveObserver(observer); } void MetricsService::RegisterSyntheticFieldTrial( const SyntheticTrialGroup& trial) { for (size_t i = 0; i < synthetic_trial_groups_.size(); ++i) { if (synthetic_trial_groups_[i].id.name == trial.id.name) { if (synthetic_trial_groups_[i].id.group != trial.id.group) { synthetic_trial_groups_[i].id.group = trial.id.group; synthetic_trial_groups_[i].start_time = base::TimeTicks::Now(); NotifySyntheticTrialObservers(); } return; } } SyntheticTrialGroup trial_group = trial; trial_group.start_time = base::TimeTicks::Now(); synthetic_trial_groups_.push_back(trial_group); NotifySyntheticTrialObservers(); } void MetricsService::RegisterMetricsProvider( scoped_ptr<MetricsProvider> provider) { DCHECK_EQ(INITIALIZED, state_); metrics_providers_.push_back(provider.release()); } void MetricsService::CheckForClonedInstall( scoped_refptr<base::SingleThreadTaskRunner> task_runner) { state_manager_->CheckForClonedInstall(task_runner); } void MetricsService::NotifySyntheticTrialObservers() { FOR_EACH_OBSERVER(SyntheticTrialObserver, synthetic_trial_observer_list_, OnSyntheticTrialsChanged(synthetic_trial_groups_)); } void MetricsService::GetCurrentSyntheticFieldTrials( std::vector<variations::ActiveGroupId>* synthetic_trials) { DCHECK(synthetic_trials); synthetic_trials->clear(); const MetricsLog* current_log = log_manager_.current_log(); for (size_t i = 0; i < synthetic_trial_groups_.size(); ++i) { if (synthetic_trial_groups_[i].start_time <= current_log->creation_time()) synthetic_trials->push_back(synthetic_trial_groups_[i].id); } } scoped_ptr<MetricsLog> MetricsService::CreateLog(MetricsLog::LogType log_type) { return make_scoped_ptr(new MetricsLog(state_manager_->client_id(), session_id_, log_type, client_, local_state_)); } void MetricsService::RecordCurrentEnvironment(MetricsLog* log) { std::vector<variations::ActiveGroupId> synthetic_trials; GetCurrentSyntheticFieldTrials(&synthetic_trials); log->RecordEnvironment(metrics_providers_.get(), synthetic_trials, GetInstallDate(), GetMetricsReportingEnabledDate()); UMA_HISTOGRAM_COUNTS_100("UMA.SyntheticTrials.Count", synthetic_trials.size()); } void MetricsService::RecordCurrentHistograms() { DCHECK(log_manager_.current_log()); histogram_snapshot_manager_.PrepareDeltas( base::Histogram::kNoFlags, base::Histogram::kUmaTargetedHistogramFlag); } void MetricsService::RecordCurrentStabilityHistograms() { DCHECK(log_manager_.current_log()); histogram_snapshot_manager_.PrepareDeltas( base::Histogram::kNoFlags, base::Histogram::kUmaStabilityHistogramFlag); } void MetricsService::LogCleanShutdown() { // Redundant setting to assure that we always reset this value at shutdown // (and that we don't use some alternate path, and not call LogCleanShutdown). clean_shutdown_status_ = CLEANLY_SHUTDOWN; clean_exit_beacon_.WriteBeaconValue(true); RecordCurrentState(local_state_); local_state_->SetInteger(prefs::kStabilityExecutionPhase, MetricsService::SHUTDOWN_COMPLETE); } bool MetricsService::ShouldLogEvents() { // We simply don't log events to UMA if there is a single incognito // session visible. The problem is that we always notify using the orginal // profile in order to simplify notification processing. return !client_->IsOffTheRecordSessionActive(); } void MetricsService::RecordBooleanPrefValue(const char* path, bool value) { DCHECK(IsSingleThreaded()); local_state_->SetBoolean(path, value); RecordCurrentState(local_state_); } void MetricsService::RecordCurrentState(PrefService* pref) { pref->SetInt64(prefs::kStabilityLastTimestampSec, base::Time::Now().ToTimeT()); } } // namespace metrics
ltilve/chromium
components/metrics/metrics_service.cc
C++
bsd-3-clause
42,424
/* * PROJECT: Atomix Development * LICENSE: BSD 3-Clause (LICENSE.md) * PURPOSE: Cgt MSIL * PROGRAMMERS: Aman Priyadarshi ([email protected]) */ using System; using System.Reflection; using Atomixilc.Machine; using Atomixilc.Attributes; using Atomixilc.Machine.x86; namespace Atomixilc.IL { [ILImpl(ILCode.Cgt)] internal class Cgt_il : MSIL { public Cgt_il() : base(ILCode.Cgt) { } /* * URL : https://msdn.microsoft.com/en-us/library/system.reflection.emit.opcodes.Cgt(v=vs.110).aspx * Description : Compares two values. If the first value is greater than the second, the integer value 1 (int32) is pushed onto the evaluation stack; otherwise 0 (int32) is pushed onto the evaluation stack. */ internal override void Execute(Options Config, OpCodeType xOp, MethodBase method, Optimizer Optimizer) { if (Optimizer.vStack.Count < 2) throw new Exception("Internal Compiler Error: vStack.Count < 2"); var itemA = Optimizer.vStack.Pop(); var itemB = Optimizer.vStack.Pop(); var xCurrentLabel = Helper.GetLabel(xOp.Position); var xNextLabel = Helper.GetLabel(xOp.NextPosition); var size = Math.Max(Helper.GetTypeSize(itemA.OperandType, Config.TargetPlatform), Helper.GetTypeSize(itemB.OperandType, Config.TargetPlatform)); /* The stack transitional behavior, in sequential order, is: * value1 is pushed onto the stack. * value2 is pushed onto the stack. * value2 and value1 are popped from the stack; cgt tests if value1 is greater than value2. * If value1 is greater than value2, 1 is pushed onto the stack; otherwise 0 is pushed onto the stack. */ switch (Config.TargetPlatform) { case Architecture.x86: { if (itemA.IsFloat || itemB.IsFloat || size > 4) throw new Exception(string.Format("UnImplemented '{0}'", msIL)); if (!itemA.SystemStack || !itemB.SystemStack) throw new Exception(string.Format("UnImplemented-RegisterType '{0}'", msIL)); new Pop { DestinationReg = Register.EAX }; new Pop { DestinationReg = Register.EDX }; new Cmp { DestinationReg = Register.EDX, SourceReg = Register.EAX }; new Setg { DestinationReg = Register.AL }; new Movzx { DestinationReg = Register.EAX, SourceReg = Register.AL, Size = 8 }; new Push { DestinationReg = Register.EAX }; Optimizer.vStack.Push(new StackItem(typeof(bool))); Optimizer.SaveStack(xOp.NextPosition); } break; default: throw new Exception(string.Format("Unsupported target platform '{0}' for MSIL '{1}'", Config.TargetPlatform, msIL)); } } } }
amaneureka/AtomOS
src/Compiler/Atomixilc/IL/Comparison/Cgt.cs
C#
bsd-3-clause
3,259
{{ define "footer" }} <div class="ui inverted footer vertical segment"> <div class="ui stackable center aligned page grid"> <!-- <div class="ten wide column"> <div class="ui three column center aligned stackable grid"> <div class="column"> <h5 class="ui inverted header">Courses</h5> <div class="ui inverted link list"> <a class="item">Registration</a> <a class="item">Course Calendar</a> <a class="item">Professors</a> </div> </div> <div class="column"> <h5 class="ui inverted header">Library</h5> <div class="ui inverted link list"> <a class="item">A-Z</a> <a class="item">Most Popular</a> <a class="item">Recently Changed</a> </div> </div> <div class="column"> <h5 class="ui inverted header">Community</h5> <div class="ui inverted link list"> <a class="item">BBS</a> <a class="item">Careers</a> <a class="item">Privacy Policy</a> </div> </div> </div> </div> --> <div class="six wide column"> <h5 class="ui inverted header">Contact Us</h5> <addr> 22 Acacia Avenue <br> Chiswick, London <br> </addr> <p>(44) 123-4567</p> </div> </div> </div> {{ end }}
russmack/hoist
www/footer.html
HTML
bsd-3-clause
1,461
# itten
selassid/itten
README.md
Markdown
bsd-3-clause
8
/** * This code is free software; you can redistribute it and/or modify it under * the terms of the new BSD License. * * Copyright (c) 2008-2011, Sebastian Staudt */ package com.github.koraktor.steamcondenser.steam.community; import static com.github.koraktor.steamcondenser.steam.community.XMLUtil.loadXml; import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import static org.powermock.api.mockito.PowerMockito.mockStatic; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; import com.github.koraktor.steamcondenser.steam.community.portal2.Portal2Stats; /** * @author Guto Maia */ @RunWith(PowerMockRunner.class) @PrepareForTest({ DocumentBuilderFactory.class, DocumentBuilder.class }) public class Portal2StatsTest extends StatsTestCase<Portal2Stats>{ public Portal2StatsTest() { super("gutomaia", "portal2"); } @Test public void getPortal2Stats() throws Exception { assertEquals("Portal 2", stats.getGameName()); assertEquals("Portal2", stats.getGameFriendlyName()); assertEquals(620, stats.getAppId()); assertEquals("0", stats.getHoursPlayed()); assertEquals(76561197985077150l, stats.getSteamId64()); } @Test public void achievements() throws Exception { assertEquals(17, stats.getAchievementsDone()); } }
gutomaia/steam-condenser-java
src/test/java/com/github/koraktor/steamcondenser/steam/community/Portal2StatsTest.java
Java
bsd-3-clause
1,630
package com.atlassian.pageobjects.components.aui; import com.atlassian.pageobjects.PageBinder; import com.atlassian.pageobjects.binder.Init; import com.atlassian.pageobjects.binder.InvalidPageStateException; import com.atlassian.pageobjects.components.TabbedComponent; import com.atlassian.pageobjects.elements.PageElement; import com.atlassian.pageobjects.elements.PageElementFinder; import com.atlassian.pageobjects.elements.query.Poller; import org.openqa.selenium.By; import javax.inject.Inject; import java.util.List; /** * Represents a tabbed content area created via AUI. * * This is an example of a reusable components. */ public class AuiTabs implements TabbedComponent { @Inject protected PageBinder pageBinder; @Inject protected PageElementFinder elementFinder; private final By rootLocator; private PageElement rootElement; public AuiTabs(By locator) { this.rootLocator = locator; } @Init public void initialize() { this.rootElement = elementFinder.find(rootLocator); } public PageElement selectedTab() { List<PageElement> items = rootElement.find(By.className("tabs-menu")).findAll(By.tagName("li")); for(int i = 0; i < items.size(); i++) { PageElement tab = items.get(i); if(tab.hasClass("active-tab")) { return tab; } } throw new InvalidPageStateException("A tab must be active.", this); } public PageElement selectedView() { List<PageElement> panes = rootElement.findAll(By.className("tabs-pane")); for(int i = 0; i < panes.size(); i++) { PageElement pane = panes.get(i); if(pane.hasClass("active-pane")) { return pane; } } throw new InvalidPageStateException("A pane must be active", this); } public List<PageElement> tabs() { return rootElement.find(By.className("tabs-menu")).findAll(By.tagName("li")); } public PageElement openTab(String tabText) { List<PageElement> tabs = rootElement.find(By.className("tabs-menu")).findAll(By.tagName("a")); for(int i = 0; i < tabs.size(); i++) { if(tabs.get(i).getText().equals(tabText)) { PageElement listItem = tabs.get(i); listItem.click(); // find the pane and wait until it has class "active-pane" String tabViewHref = listItem.getAttribute("href"); String tabViewClassName = tabViewHref.substring(tabViewHref.indexOf('#') + 1); PageElement pane = rootElement.find(By.id(tabViewClassName)); Poller.waitUntilTrue(pane.timed().hasClass("active-pane")); return pane; } } throw new InvalidPageStateException("Tab not found", this); } public PageElement openTab(PageElement tab) { String tabIdentifier = tab.getText(); return openTab(tabIdentifier); } }
adini121/atlassian
atlassian-pageobjects-elements/src/main/java/com/atlassian/pageobjects/components/aui/AuiTabs.java
Java
bsd-3-clause
3,108
<?php /** * iDatabase数据管理控制器 * * @author young * @version 2013.11.22 * */ namespace Idatabase\Controller; use My\Common\Controller\Action; class ImportController extends Action { /** * 读取当前数据集合的mongocollection实例 * * @var object */ private $_data; /** * 读取数据属性结构的mongocollection实例 * * @var object */ private $_structure; /** * 读取集合列表集合的mongocollection实例 * * @var object */ private $_collection; /** * 当前集合所属项目 * * @var string */ private $_project_id = ''; /** * 当前集合所属集合 集合的alias别名或者_id的__toString()结果 * * @var string */ private $_collection_id = ''; /** * 存储数据的物理集合名称 * * @var string */ private $_collection_name = ''; /** * 存储当前集合的结局结构信息 * * @var array */ private $_schema = null; /** * 存储查询显示字段列表 * * @var array */ private $_fields = array(); /** * Gearman客户端 * * @var object */ private $_gmClient; /** * 存储文件 * * @var object */ private $_file; /** * 初始化函数 * * @see \My\Common\ActionController::init() */ public function init() { resetTimeMemLimit(); $this->_project_id = isset($_REQUEST['__PROJECT_ID__']) ? trim($_REQUEST['__PROJECT_ID__']) : ''; if (empty($this->_project_id)) throw new \Exception('$this->_project_id值未设定'); $this->_collection = $this->model('Idatabase\Model\Collection'); $this->_collection_id = isset($_REQUEST['__COLLECTION_ID__']) ? trim($_REQUEST['__COLLECTION_ID__']) : ''; if (empty($this->_collection_id)) throw new \Exception('$this->_collection_id值未设定'); $this->_collection_id = $this->getCollectionIdByName($this->_collection_id); $this->_collection_name = 'idatabase_collection_' . $this->_collection_id; $this->_data = $this->collection($this->_collection_name); $this->_structure = $this->model('Idatabase\Model\Structure'); $this->_file = $this->model('Idatabase\Model\File'); // 建立gearman客户端连接 $this->_gmClient = $this->gearman()->client(); $this->getSchema(); } /** * 将导入数据脚本放置到gearman中进行,加快页面的响应速度 */ public function importCsvJobAction() { // 大数据量导采用mongoimport直接导入的方式导入数据 $collection_id = trim($this->params()->fromPost('__COLLECTION_ID__', null)); $physicalDrop = filter_var($this->params()->fromPost('physicalDrop', false), FILTER_VALIDATE_BOOLEAN); $upload = $this->params()->fromFiles('import'); if (empty($collection_id) || empty($upload)) { return $this->msg(false, '上传文件或者集合编号不能为空'); } $uploadFileNameLower = strtolower($upload['name']); if (strpos($uploadFileNameLower, '.zip') !== false) { $bytes = file_get_contents($upload['tmp_name']); $fileInfo = $this->_file->storeBytesToGridFS($bytes, 'import.zip'); $key = $fileInfo['_id']->__toString(); } else { if (strpos($uploadFileNameLower, '.csv') === false) { return $this->msg(false, '请上传csv格式的文件'); } $bytes = file_get_contents($upload['tmp_name']); if (! detectUTF8($bytes)) { return $this->msg(false, '请使用文本编辑器将文件转化为UTF-8格式'); } $fileInfo = $this->_file->storeBytesToGridFS($bytes, 'import.csv'); $key = $fileInfo['_id']->__toString(); } $workload = array(); $workload['key'] = $key; $workload['collection_id'] = $collection_id; $workload['physicalDrop'] = $physicalDrop; // $jobHandle = $this->_gmClient->doBackground('dataImport', serialize($workload), $key); $jobHandle = $this->_gmClient->doBackground('bsonImport', serialize($workload), $key); $stat = $this->_gmClient->jobStatus($jobHandle); if (isset($stat[0]) && $stat[0]) { return $this->msg(true, '数据导入任务已经被受理,请稍后片刻若干分钟,导入时间取决于数据量(1w/s)。'); } else { return $this->msg(false, '任务提交失败'); } } /** * 导入数据到集合内 */ public function importAction() { try { $importSheetName = trim($this->params()->fromPost('sheetName', null)); $file = $this->params()->fromFiles('import', null); if ($importSheetName == null) { return $this->msg(false, '请设定需要导入的sheet'); } if ($file == null) { return $this->msg(false, '请上传Excel数据表格文件'); } if ($file['error'] === UPLOAD_ERR_OK) { $fileName = $file['name']; $filePath = $file['tmp_name']; $ext = strtolower(pathinfo($fileName, PATHINFO_EXTENSION)); switch ($ext) { case 'xlsx': $inputFileType = 'Excel2007'; break; default: return $this->msg(false, '很抱歉,您上传的文件格式无法识别,格式要求:*.xlsx'); } $objReader = \PHPExcel_IOFactory::createReader($inputFileType); $objReader->setReadDataOnly(true); $objReader->setLoadSheetsOnly($importSheetName); $objPHPExcel = $objReader->load($filePath); if (! in_array($importSheetName, array_values($objPHPExcel->getSheetNames()))) { return $this->msg(false, 'Sheet:"' . $importSheetName . '",不存在,请检查您导入的Excel表格'); } $objPHPExcel->setActiveSheetIndexByName($importSheetName); $objActiveSheet = $objPHPExcel->getActiveSheet(); $sheetData = $objActiveSheet->toArray(null, true, true, true); $objPHPExcel->disconnectWorksheets(); unset($objReader, $objPHPExcel, $objActiveSheet); if (empty($sheetData)) { return $this->msg(false, '请确认表格中未包含有效数据,请复核'); } $firstRow = array_shift($sheetData); if (count($firstRow) == 0) { return $this->msg(false, '标题行数据为空'); } $titles = array(); foreach ($firstRow as $col => $value) { $value = trim($value); if (in_array($value, array_keys($this->_schema), true)) { $titles[$col] = $this->_schema[$value]; } else if (in_array($value, array_values($this->_schema), true)) { $titles[$col] = $value; } } if (count($titles) == 0) { return $this->msg(false, '无匹配的标题或者标题字段,请检查导入数据的格式是否正确'); } array_walk($sheetData, function ($row, $rowNumber) use($titles) { $insertData = array(); foreach ($titles as $col => $colName) { $insertData[$colName] = formatData($row[$col], $this->_fields[$colName]); } $this->_data->insertByFindAndModify($insertData); unset($insertData); }); // 用bson文件代替插入数据 // $bson = ''; // foreach ($sheetData as $rowNumber=>$row) { // $insertData = array(); // foreach ($titles as $col => $colName) { // $insertData[$colName] = formatData($row[$col], $this->_fields[$colName]); // } // $bson .= bson_encode($insertData); // } unset($sheetData); return $this->msg(true, '导入成功'); } else { return $this->msg(false, '上传文件失败'); } } catch (\Exception $e) { fb(exceptionMsg($e), \FirePHP::LOG); return $this->msg(false, '导入失败,发生异常'); } } /** * 获取集合的数据结构 * * @return array */ private function getSchema() { $this->_schema = array(); $this->_fields = array(); $cursor = $this->_structure->find(array( 'collection_id' => $this->_collection_id )); while ($cursor->hasNext()) { $row = $cursor->getNext(); $this->_schema[$row['label']] = $row['field']; $this->_fields[$row['field']] = $row['type']; } return true; } /** * 根据集合的名称获取集合的_id * * @param string $name * @throws \Exception or string */ private function getCollectionIdByName($name) { try { new \MongoId($name); return $name; } catch (\MongoException $ex) {} $collectionInfo = $this->_collection->findOne(array( 'project_id' => $this->_project_id, 'name' => $name )); if ($collectionInfo == null) { throw new \Exception('集合名称不存在于指定项目'); } return $collectionInfo['_id']->__toString(); } }
icatholic/icc
module/Idatabase/src/Idatabase/Controller/ImportController.php
PHP
bsd-3-clause
10,381
<?php use yii\helpers\Html; use yii\widgets\ActiveForm; /* @var $this yii\web\View */ /* @var $model app\models\IzinmenutupjalanSearch */ /* @var $form yii\widgets\ActiveForm */ ?> <div class="izinmenutupjalan-search"> <?php $form = ActiveForm::begin([ 'action' => ['index'], 'method' => 'get', ]); ?> <?= $form->field($model, 'id_imj') ?> <?= $form->field($model, 'id_akun') ?> <?= $form->field($model, 'nomor_imj') ?> <?= $form->field($model, 'tglDikeluarkan_imj') ?> <?= $form->field($model, 'tglPengajuan_imj') ?> <?php // echo $form->field($model, 'kepada_imj') ?> <?php // echo $form->field($model, 'alamat_imj') ?> <?php // echo $form->field($model, 'namaAcara_imj') ?> <?php // echo $form->field($model, 'jalanDitutup_imj') ?> <?php // echo $form->field($model, 'penutupanJalanMaksimal_imj') ?> <?php // echo $form->field($model, 'tglAcara_imj') ?> <?php // echo $form->field($model, 'JamAcara_imj') ?> <?php // echo $form->field($model, 'tglAcaraSelesai_imj') ?> <?php // echo $form->field($model, 'jamAcaraSelesai_imj') ?> <?php // echo $form->field($model, 'tembusan_imj') ?> <?php // echo $form->field($model, 'keterangan_imj') ?> <div class="form-group"> <?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?> <?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?> </div> <?php ActiveForm::end(); ?> </div>
dinarwm/kppt
views/Izinmenutupjalan/_search.php
PHP
bsd-3-clause
1,483
# -*- coding: utf-8 -*- """ Display currently playing song from Google Play Music Desktop Player. Configuration parameters: cache_timeout: how often we refresh this module in seconds (default 5) format: specify the items and ordering of the data in the status bar. These area 1:1 match to gpmdp-remote's options (default is '♫ {info}'). Format of status string placeholders: See `gpmdp-remote help`. Simply surround the items you want displayed (i.e. `album`) with curly braces (i.e. `{album}`) and place as-desired in the format string. {info} Print info about now playing song {title} Print current song title {artist} Print current song artist {album} Print current song album {album_art} Print current song album art URL {time_current} Print current song time in milliseconds {time_total} Print total song time in milliseconds {status} Print whether GPMDP is paused or playing {current} Print now playing song in "artist - song" format {help} Print this help message Requires: gpmdp: http://www.googleplaymusicdesktopplayer.com/ gpmdp-remote: https://github.com/iandrewt/gpmdp-remote @author Aaron Fields https://twitter.com/spirotot @license BSD """ from time import time from subprocess import check_output class Py3status: """ """ # available configuration parameters cache_timeout = 5 format = u'♫ {info}' @staticmethod def _run_cmd(cmd): return check_output(['gpmdp-remote', cmd]).decode('utf-8').strip() def gpmdp(self, i3s_output_list, i3s_config): if self._run_cmd('status') == 'Paused': result = '' else: cmds = ['info', 'title', 'artist', 'album', 'status', 'current', 'time_total', 'time_current', 'album_art'] data = {} for cmd in cmds: if '{%s}' % cmd in self.format: data[cmd] = self._run_cmd(cmd) result = self.format.format(**data) response = { 'cached_until': time() + self.cache_timeout, 'full_text': result } return response if __name__ == "__main__": """ Run module in test mode. """ from py3status.module_test import module_test module_test(Py3status)
Spirotot/py3status
py3status/modules/gpmdp.py
Python
bsd-3-clause
2,411
<!DOCTYPE html> <html> <meta charset="utf-8"> <title>Date parser test — 100&lt;=x&lt;=999 and January&lt;=y&lt;=December and 100&lt;=z&lt;=999 — 100 december 100</title> <script src="../date_test.js"></script> <p>Failed (Script did not run)</p> <script> test_date_invalid("100 december 100", "Invalid Date") </script> </html>
operasoftware/presto-testo
core/features/dateParsing/TestCases/individual/SpaceSeparator/587.html
HTML
bsd-3-clause
345
// // buffered_write_stream.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~ // // Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #ifndef BOOST_ASIO_BUFFERED_WRITE_STREAM_HPP #define BOOST_ASIO_BUFFERED_WRITE_STREAM_HPP #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) #include <boost/asio/detail/config.hpp> #include <cstddef> #include <boost/asio/buffered_write_stream_fwd.hpp> #include <boost/asio/buffer.hpp> #include <boost/asio/completion_condition.hpp> #include <boost/asio/detail/bind_handler.hpp> #include <boost/asio/detail/buffered_stream_storage.hpp> #include <boost/asio/detail/noncopyable.hpp> #include <boost/asio/detail/type_traits.hpp> #include <boost/asio/error.hpp> #include <boost/asio/io_service.hpp> #include <boost/asio/write.hpp> #include <boost/asio/detail/push_options.hpp> namespace pdalboost {} namespace boost = pdalboost; namespace pdalboost { namespace asio { /// Adds buffering to the write-related operations of a stream. /** * The buffered_write_stream class template can be used to add buffering to the * synchronous and asynchronous write operations of a stream. * * @par Thread Safety * @e Distinct @e objects: Safe.@n * @e Shared @e objects: Unsafe. * * @par Concepts: * AsyncReadStream, AsyncWriteStream, Stream, SyncReadStream, SyncWriteStream. */ template <typename Stream> class buffered_write_stream : private noncopyable { public: /// The type of the next layer. typedef typename remove_reference<Stream>::type next_layer_type; /// The type of the lowest layer. typedef typename next_layer_type::lowest_layer_type lowest_layer_type; #if defined(GENERATING_DOCUMENTATION) /// The default buffer size. static const std::size_t default_buffer_size = implementation_defined; #else BOOST_ASIO_STATIC_CONSTANT(std::size_t, default_buffer_size = 1024); #endif /// Construct, passing the specified argument to initialise the next layer. template <typename Arg> explicit buffered_write_stream(Arg& a) : next_layer_(a), storage_(default_buffer_size) { } /// Construct, passing the specified argument to initialise the next layer. template <typename Arg> buffered_write_stream(Arg& a, std::size_t buffer_size) : next_layer_(a), storage_(buffer_size) { } /// Get a reference to the next layer. next_layer_type& next_layer() { return next_layer_; } /// Get a reference to the lowest layer. lowest_layer_type& lowest_layer() { return next_layer_.lowest_layer(); } /// Get a const reference to the lowest layer. const lowest_layer_type& lowest_layer() const { return next_layer_.lowest_layer(); } /// Get the io_service associated with the object. pdalboost::asio::io_service& get_io_service() { return next_layer_.get_io_service(); } /// Close the stream. void close() { next_layer_.close(); } /// Close the stream. pdalboost::system::error_code close(pdalboost::system::error_code& ec) { return next_layer_.close(ec); } /// Flush all data from the buffer to the next layer. Returns the number of /// bytes written to the next layer on the last write operation. Throws an /// exception on failure. std::size_t flush(); /// Flush all data from the buffer to the next layer. Returns the number of /// bytes written to the next layer on the last write operation, or 0 if an /// error occurred. std::size_t flush(pdalboost::system::error_code& ec); /// Start an asynchronous flush. template <typename WriteHandler> BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, void (pdalboost::system::error_code, std::size_t)) async_flush(BOOST_ASIO_MOVE_ARG(WriteHandler) handler); /// Write the given data to the stream. Returns the number of bytes written. /// Throws an exception on failure. template <typename ConstBufferSequence> std::size_t write_some(const ConstBufferSequence& buffers); /// Write the given data to the stream. Returns the number of bytes written, /// or 0 if an error occurred and the error handler did not throw. template <typename ConstBufferSequence> std::size_t write_some(const ConstBufferSequence& buffers, pdalboost::system::error_code& ec); /// Start an asynchronous write. The data being written must be valid for the /// lifetime of the asynchronous operation. template <typename ConstBufferSequence, typename WriteHandler> BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, void (pdalboost::system::error_code, std::size_t)) async_write_some(const ConstBufferSequence& buffers, BOOST_ASIO_MOVE_ARG(WriteHandler) handler); /// Read some data from the stream. Returns the number of bytes read. Throws /// an exception on failure. template <typename MutableBufferSequence> std::size_t read_some(const MutableBufferSequence& buffers) { return next_layer_.read_some(buffers); } /// Read some data from the stream. Returns the number of bytes read or 0 if /// an error occurred. template <typename MutableBufferSequence> std::size_t read_some(const MutableBufferSequence& buffers, pdalboost::system::error_code& ec) { return next_layer_.read_some(buffers, ec); } /// Start an asynchronous read. The buffer into which the data will be read /// must be valid for the lifetime of the asynchronous operation. template <typename MutableBufferSequence, typename ReadHandler> BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, void (pdalboost::system::error_code, std::size_t)) async_read_some(const MutableBufferSequence& buffers, BOOST_ASIO_MOVE_ARG(ReadHandler) handler) { detail::async_result_init< ReadHandler, void (pdalboost::system::error_code, std::size_t)> init( BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); next_layer_.async_read_some(buffers, BOOST_ASIO_MOVE_CAST(BOOST_ASIO_HANDLER_TYPE(ReadHandler, void (pdalboost::system::error_code, std::size_t)))(init.handler)); return init.result.get(); } /// Peek at the incoming data on the stream. Returns the number of bytes read. /// Throws an exception on failure. template <typename MutableBufferSequence> std::size_t peek(const MutableBufferSequence& buffers) { return next_layer_.peek(buffers); } /// Peek at the incoming data on the stream. Returns the number of bytes read, /// or 0 if an error occurred. template <typename MutableBufferSequence> std::size_t peek(const MutableBufferSequence& buffers, pdalboost::system::error_code& ec) { return next_layer_.peek(buffers, ec); } /// Determine the amount of data that may be read without blocking. std::size_t in_avail() { return next_layer_.in_avail(); } /// Determine the amount of data that may be read without blocking. std::size_t in_avail(pdalboost::system::error_code& ec) { return next_layer_.in_avail(ec); } private: /// Copy data into the internal buffer from the specified source buffer. /// Returns the number of bytes copied. template <typename ConstBufferSequence> std::size_t copy(const ConstBufferSequence& buffers); /// The next layer. Stream next_layer_; // The data in the buffer. detail::buffered_stream_storage storage_; }; } // namespace asio } // namespace pdalboost #include <boost/asio/detail/pop_options.hpp> #include <boost/asio/impl/buffered_write_stream.hpp> #endif // BOOST_ASIO_BUFFERED_WRITE_STREAM_HPP
verma/PDAL
boost/boost/asio/buffered_write_stream.hpp
C++
bsd-3-clause
7,635
//////////////////////////////////////////////////////////////////////////////////// /// /// \file reporttimeout.cpp /// \brief This file contains the implementation of a JAUS message. /// /// <br>Author(s): Bo Sun /// <br>Created: 17 November 2009 /// <br>Copyright (c) 2009 /// <br>Applied Cognition and Training in Immersive Virtual Environments /// <br>(ACTIVE) Laboratory /// <br>Institute for Simulation and Training (IST) /// <br>University of Central Florida (UCF) /// <br>All rights reserved. /// <br>Email: [email protected] /// <br>Web: http://active.ist.ucf.edu /// /// Redistribution and use in source and binary forms, with or without /// modification, are permitted provided that the following conditions are met: /// * Redistributions of source code must retain the above copyright /// notice, this list of conditions and the following disclaimer. /// * Redistributions in binary form must reproduce the above copyright /// notice, this list of conditions and the following disclaimer in the /// documentation and/or other materials provided with the distribution. /// * Neither the name of the ACTIVE LAB, IST, UCF, nor the /// names of its contributors may be used to endorse or promote products /// derived from this software without specific prior written permission. /// /// THIS SOFTWARE IS PROVIDED BY THE ACTIVE LAB''AS IS'' AND ANY /// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED /// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE /// DISCLAIMED. IN NO EVENT SHALL UCF BE LIABLE FOR ANY /// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES /// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; /// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND /// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT /// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS /// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /// //////////////////////////////////////////////////////////////////////////////////// #include "jaus/core/control/reporttimeout.h" using namespace JAUS; //////////////////////////////////////////////////////////////////////////////////// /// /// \brief Constructor, initializes default values. /// /// \param[in] src Source ID of message sender. /// \param[in] dest Destination ID of message. /// //////////////////////////////////////////////////////////////////////////////////// ReportTimeout::ReportTimeout(const Address& dest, const Address& src) : Message(REPORT_TIMEOUT, dest, src) { mTimeoutSeconds = 0; } //////////////////////////////////////////////////////////////////////////////////// /// /// \brief Copy constructor. /// //////////////////////////////////////////////////////////////////////////////////// ReportTimeout::ReportTimeout(const ReportTimeout& message) : Message(REPORT_TIMEOUT) { *this = message; } //////////////////////////////////////////////////////////////////////////////////// /// /// \brief Destructor. /// //////////////////////////////////////////////////////////////////////////////////// ReportTimeout::~ReportTimeout() { } //////////////////////////////////////////////////////////////////////////////////// /// /// \brief Writes message payload to the packet. /// /// Message contents are written to the packet following the JAUS standard. /// /// \param[out] packet Packet to write payload to. /// /// \return -1 on error, otherwise number of bytes written. /// //////////////////////////////////////////////////////////////////////////////////// int ReportTimeout::WriteMessageBody(Packet& packet) const { int expected = BYTE_SIZE; int written = 0; written += packet.Write(mTimeoutSeconds); return expected == written ? written : -1; } //////////////////////////////////////////////////////////////////////////////////// /// /// \brief Reads message payload from the packet. /// /// Message contents are read from the packet following the JAUS standard. /// /// \param[in] packet Packet containing message payload data to read. /// /// \return -1 on error, otherwise number of bytes written. /// //////////////////////////////////////////////////////////////////////////////////// int ReportTimeout::ReadMessageBody(const Packet& packet) { int expected = BYTE_SIZE; int read = 0; read += packet.Read(mTimeoutSeconds); return expected == read ? read : -1; } //////////////////////////////////////////////////////////////////////////////////// /// /// \brief Clears message payload data. /// //////////////////////////////////////////////////////////////////////////////////// void ReportTimeout::ClearMessageBody() { mTimeoutSeconds = 0; } //////////////////////////////////////////////////////////////////////////////////// /// /// \brief Runs a test case to validate the message class. /// /// \return 1 on success, otherwise 0. /// //////////////////////////////////////////////////////////////////////////////////// int ReportTimeout::RunTestCase() const { int result = 0; Packet packet; ReportTimeout msg1, msg2; msg1.SetTimeoutSeconds(100); if( msg1.WriteMessageBody(packet) != -1 && msg2.ReadMessageBody(packet) != -1 && msg1.GetTimeoutSeconds() == msg2.GetTimeoutSeconds()) { result = 1; } return result; } //////////////////////////////////////////////////////////////////////////////////// /// /// \brief Sets equal to. /// //////////////////////////////////////////////////////////////////////////////////// ReportTimeout& ReportTimeout::operator=(const ReportTimeout& message) { if(this != &message) { CopyHeaderData(&message); mTimeoutSeconds = message.mTimeoutSeconds; } return *this; } /* End of File */
jmesmon/jaus--
src/jaus/core/control/reporttimeout.cpp
C++
bsd-3-clause
6,127
/*! normalize.css v3.0.1 | MIT License | git.io/normalize */ html { font-family: sans-serif; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; } body { margin: 0; } article, aside, details, figcaption, figure, footer, header, hgroup, main, nav, section, summary { display: block; } audio, canvas, progress, video { display: inline-block; vertical-align: baseline; } audio:not([controls]) { display: none; height: 0; } [hidden], template { display: none; } a { background: transparent; } a:active, a:hover { outline: 0; } abbr[title] { border-bottom: 1px dotted; } b, strong { font-weight: bold; } dfn { font-style: italic; } h1 { font-size: 2em; margin: 0.67em 0; } mark { background: #ff0; color: #000; } small { font-size: 80%; } sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; } sup { top: -0.5em; } sub { bottom: -0.25em; } img { border: 0; } svg:not(:root) { overflow: hidden; } figure { margin: 1em 40px; } hr { -moz-box-sizing: content-box; box-sizing: content-box; height: 0; } pre { overflow: auto; } code, kbd, pre, samp { font-family: monospace, monospace; font-size: 1em; } button, input, optgroup, select, textarea { color: inherit; font: inherit; margin: 0; } button { overflow: visible; } button, select { text-transform: none; } button, html input[type="button"], input[type="reset"], input[type="submit"] { -webkit-appearance: button; cursor: pointer; } button[disabled], html input[disabled] { cursor: default; } button::-moz-focus-inner, input::-moz-focus-inner { border: 0; padding: 0; } input { line-height: normal; } input[type="checkbox"], input[type="radio"] { box-sizing: border-box; padding: 0; } input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { height: auto; } input[type="search"] { -webkit-appearance: textfield; -moz-box-sizing: content-box; -webkit-box-sizing: content-box; box-sizing: content-box; } input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; } fieldset { border: 1px solid #c0c0c0; margin: 0 2px; padding: 0.35em 0.625em 0.75em; } legend { border: 0; padding: 0; } textarea { overflow: auto; } optgroup { font-weight: bold; } table { border-collapse: collapse; border-spacing: 0; } td, th { padding: 0; } @media print { * { text-shadow: none !important; color: #000 !important; background: transparent !important; box-shadow: none !important; } a, a:visited { text-decoration: underline; } a[href]:after { content: " (" attr(href) ")"; } abbr[title]:after { content: " (" attr(title) ")"; } a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; } pre, blockquote { border: 1px solid #999; page-break-inside: avoid; } thead { display: table-header-group; } tr, img { page-break-inside: avoid; } img { max-width: 100% !important; } p, h2, h3 { orphans: 3; widows: 3; } h2, h3 { page-break-after: avoid; } select { background: #fff !important; } .navbar { display: none; } .table td, .table th { background-color: #fff !important; } .btn > .caret, .dropup > .btn > .caret { border-top-color: #000 !important; } .label { border: 1px solid #000; } .table { border-collapse: collapse !important; } .table-bordered th, .table-bordered td { border: 1px solid #ddd !important; } } @font-face { font-family: 'Glyphicons Halflings'; src: url('bootstrap-3.2.0/fonts/glyphicons-halflings-regular.eot'); src: url('bootstrap-3.2.0/fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('bootstrap-3.2.0/fonts/glyphicons-halflings-regular.woff') format('woff'), url('bootstrap-3.2.0/fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('bootstrap-3.2.0/fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg'); } .glyphicon { position: relative; top: 1px; display: inline-block; font-family: 'Glyphicons Halflings'; font-style: normal; font-weight: normal; line-height: 1; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .glyphicon-asterisk:before { content: "\2a"; } .glyphicon-plus:before { content: "\2b"; } .glyphicon-euro:before { content: "\20ac"; } .glyphicon-minus:before { content: "\2212"; } .glyphicon-cloud:before { content: "\2601"; } .glyphicon-envelope:before { content: "\2709"; } .glyphicon-pencil:before { content: "\270f"; } .glyphicon-glass:before { content: "\e001"; } .glyphicon-music:before { content: "\e002"; } .glyphicon-search:before { content: "\e003"; } .glyphicon-heart:before { content: "\e005"; } .glyphicon-star:before { content: "\e006"; } .glyphicon-star-empty:before { content: "\e007"; } .glyphicon-user:before { content: "\e008"; } .glyphicon-film:before { content: "\e009"; } .glyphicon-th-large:before { content: "\e010"; } .glyphicon-th:before { content: "\e011"; } .glyphicon-th-list:before { content: "\e012"; } .glyphicon-ok:before { content: "\e013"; } .glyphicon-remove:before { content: "\e014"; } .glyphicon-zoom-in:before { content: "\e015"; } .glyphicon-zoom-out:before { content: "\e016"; } .glyphicon-off:before { content: "\e017"; } .glyphicon-signal:before { content: "\e018"; } .glyphicon-cog:before { content: "\e019"; } .glyphicon-trash:before { content: "\e020"; } .glyphicon-home:before { content: "\e021"; } .glyphicon-file:before { content: "\e022"; } .glyphicon-time:before { content: "\e023"; } .glyphicon-road:before { content: "\e024"; } .glyphicon-download-alt:before { content: "\e025"; } .glyphicon-download:before { content: "\e026"; } .glyphicon-upload:before { content: "\e027"; } .glyphicon-inbox:before { content: "\e028"; } .glyphicon-play-circle:before { content: "\e029"; } .glyphicon-repeat:before { content: "\e030"; } .glyphicon-refresh:before { content: "\e031"; } .glyphicon-list-alt:before { content: "\e032"; } .glyphicon-lock:before { content: "\e033"; } .glyphicon-flag:before { content: "\e034"; } .glyphicon-headphones:before { content: "\e035"; } .glyphicon-volume-off:before { content: "\e036"; } .glyphicon-volume-down:before { content: "\e037"; } .glyphicon-volume-up:before { content: "\e038"; } .glyphicon-qrcode:before { content: "\e039"; } .glyphicon-barcode:before { content: "\e040"; } .glyphicon-tag:before { content: "\e041"; } .glyphicon-tags:before { content: "\e042"; } .glyphicon-book:before { content: "\e043"; } .glyphicon-bookmark:before { content: "\e044"; } .glyphicon-print:before { content: "\e045"; } .glyphicon-camera:before { content: "\e046"; } .glyphicon-font:before { content: "\e047"; } .glyphicon-bold:before { content: "\e048"; } .glyphicon-italic:before { content: "\e049"; } .glyphicon-text-height:before { content: "\e050"; } .glyphicon-text-width:before { content: "\e051"; } .glyphicon-align-left:before { content: "\e052"; } .glyphicon-align-center:before { content: "\e053"; } .glyphicon-align-right:before { content: "\e054"; } .glyphicon-align-justify:before { content: "\e055"; } .glyphicon-list:before { content: "\e056"; } .glyphicon-indent-left:before { content: "\e057"; } .glyphicon-indent-right:before { content: "\e058"; } .glyphicon-facetime-video:before { content: "\e059"; } .glyphicon-picture:before { content: "\e060"; } .glyphicon-map-marker:before { content: "\e062"; } .glyphicon-adjust:before { content: "\e063"; } .glyphicon-tint:before { content: "\e064"; } .glyphicon-edit:before { content: "\e065"; } .glyphicon-share:before { content: "\e066"; } .glyphicon-check:before { content: "\e067"; } .glyphicon-move:before { content: "\e068"; } .glyphicon-step-backward:before { content: "\e069"; } .glyphicon-fast-backward:before { content: "\e070"; } .glyphicon-backward:before { content: "\e071"; } .glyphicon-play:before { content: "\e072"; } .glyphicon-pause:before { content: "\e073"; } .glyphicon-stop:before { content: "\e074"; } .glyphicon-forward:before { content: "\e075"; } .glyphicon-fast-forward:before { content: "\e076"; } .glyphicon-step-forward:before { content: "\e077"; } .glyphicon-eject:before { content: "\e078"; } .glyphicon-chevron-left:before { content: "\e079"; } .glyphicon-chevron-right:before { content: "\e080"; } .glyphicon-plus-sign:before { content: "\e081"; } .glyphicon-minus-sign:before { content: "\e082"; } .glyphicon-remove-sign:before { content: "\e083"; } .glyphicon-ok-sign:before { content: "\e084"; } .glyphicon-question-sign:before { content: "\e085"; } .glyphicon-info-sign:before { content: "\e086"; } .glyphicon-screenshot:before { content: "\e087"; } .glyphicon-remove-circle:before { content: "\e088"; } .glyphicon-ok-circle:before { content: "\e089"; } .glyphicon-ban-circle:before { content: "\e090"; } .glyphicon-arrow-left:before { content: "\e091"; } .glyphicon-arrow-right:before { content: "\e092"; } .glyphicon-arrow-up:before { content: "\e093"; } .glyphicon-arrow-down:before { content: "\e094"; } .glyphicon-share-alt:before { content: "\e095"; } .glyphicon-resize-full:before { content: "\e096"; } .glyphicon-resize-small:before { content: "\e097"; } .glyphicon-exclamation-sign:before { content: "\e101"; } .glyphicon-gift:before { content: "\e102"; } .glyphicon-leaf:before { content: "\e103"; } .glyphicon-fire:before { content: "\e104"; } .glyphicon-eye-open:before { content: "\e105"; } .glyphicon-eye-close:before { content: "\e106"; } .glyphicon-warning-sign:before { content: "\e107"; } .glyphicon-plane:before { content: "\e108"; } .glyphicon-calendar:before { content: "\e109"; } .glyphicon-random:before { content: "\e110"; } .glyphicon-comment:before { content: "\e111"; } .glyphicon-magnet:before { content: "\e112"; } .glyphicon-chevron-up:before { content: "\e113"; } .glyphicon-chevron-down:before { content: "\e114"; } .glyphicon-retweet:before { content: "\e115"; } .glyphicon-shopping-cart:before { content: "\e116"; } .glyphicon-folder-close:before { content: "\e117"; } .glyphicon-folder-open:before { content: "\e118"; } .glyphicon-resize-vertical:before { content: "\e119"; } .glyphicon-resize-horizontal:before { content: "\e120"; } .glyphicon-hdd:before { content: "\e121"; } .glyphicon-bullhorn:before { content: "\e122"; } .glyphicon-bell:before { content: "\e123"; } .glyphicon-certificate:before { content: "\e124"; } .glyphicon-thumbs-up:before { content: "\e125"; } .glyphicon-thumbs-down:before { content: "\e126"; } .glyphicon-hand-right:before { content: "\e127"; } .glyphicon-hand-left:before { content: "\e128"; } .glyphicon-hand-up:before { content: "\e129"; } .glyphicon-hand-down:before { content: "\e130"; } .glyphicon-circle-arrow-right:before { content: "\e131"; } .glyphicon-circle-arrow-left:before { content: "\e132"; } .glyphicon-circle-arrow-up:before { content: "\e133"; } .glyphicon-circle-arrow-down:before { content: "\e134"; } .glyphicon-globe:before { content: "\e135"; } .glyphicon-wrench:before { content: "\e136"; } .glyphicon-tasks:before { content: "\e137"; } .glyphicon-filter:before { content: "\e138"; } .glyphicon-briefcase:before { content: "\e139"; } .glyphicon-fullscreen:before { content: "\e140"; } .glyphicon-dashboard:before { content: "\e141"; } .glyphicon-paperclip:before { content: "\e142"; } .glyphicon-heart-empty:before { content: "\e143"; } .glyphicon-link:before { content: "\e144"; } .glyphicon-phone:before { content: "\e145"; } .glyphicon-pushpin:before { content: "\e146"; } .glyphicon-usd:before { content: "\e148"; } .glyphicon-gbp:before { content: "\e149"; } .glyphicon-sort:before { content: "\e150"; } .glyphicon-sort-by-alphabet:before { content: "\e151"; } .glyphicon-sort-by-alphabet-alt:before { content: "\e152"; } .glyphicon-sort-by-order:before { content: "\e153"; } .glyphicon-sort-by-order-alt:before { content: "\e154"; } .glyphicon-sort-by-attributes:before { content: "\e155"; } .glyphicon-sort-by-attributes-alt:before { content: "\e156"; } .glyphicon-unchecked:before { content: "\e157"; } .glyphicon-expand:before { content: "\e158"; } .glyphicon-collapse-down:before { content: "\e159"; } .glyphicon-collapse-up:before { content: "\e160"; } .glyphicon-log-in:before { content: "\e161"; } .glyphicon-flash:before { content: "\e162"; } .glyphicon-log-out:before { content: "\e163"; } .glyphicon-new-window:before { content: "\e164"; } .glyphicon-record:before { content: "\e165"; } .glyphicon-save:before { content: "\e166"; } .glyphicon-open:before { content: "\e167"; } .glyphicon-saved:before { content: "\e168"; } .glyphicon-import:before { content: "\e169"; } .glyphicon-export:before { content: "\e170"; } .glyphicon-send:before { content: "\e171"; } .glyphicon-floppy-disk:before { content: "\e172"; } .glyphicon-floppy-saved:before { content: "\e173"; } .glyphicon-floppy-remove:before { content: "\e174"; } .glyphicon-floppy-save:before { content: "\e175"; } .glyphicon-floppy-open:before { content: "\e176"; } .glyphicon-credit-card:before { content: "\e177"; } .glyphicon-transfer:before { content: "\e178"; } .glyphicon-cutlery:before { content: "\e179"; } .glyphicon-header:before { content: "\e180"; } .glyphicon-compressed:before { content: "\e181"; } .glyphicon-earphone:before { content: "\e182"; } .glyphicon-phone-alt:before { content: "\e183"; } .glyphicon-tower:before { content: "\e184"; } .glyphicon-stats:before { content: "\e185"; } .glyphicon-sd-video:before { content: "\e186"; } .glyphicon-hd-video:before { content: "\e187"; } .glyphicon-subtitles:before { content: "\e188"; } .glyphicon-sound-stereo:before { content: "\e189"; } .glyphicon-sound-dolby:before { content: "\e190"; } .glyphicon-sound-5-1:before { content: "\e191"; } .glyphicon-sound-6-1:before { content: "\e192"; } .glyphicon-sound-7-1:before { content: "\e193"; } .glyphicon-copyright-mark:before { content: "\e194"; } .glyphicon-registration-mark:before { content: "\e195"; } .glyphicon-cloud-download:before { content: "\e197"; } .glyphicon-cloud-upload:before { content: "\e198"; } .glyphicon-tree-conifer:before { content: "\e199"; } .glyphicon-tree-deciduous:before { content: "\e200"; } * { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } *:before, *:after { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } html { font-size: 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } body { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.42857143; color: #333333; background-color: #ffffff; } input, button, select, textarea { font-family: inherit; font-size: inherit; line-height: inherit; } a { color: #428bca; text-decoration: none; } a:hover, a:focus { color: #2a6496; text-decoration: underline; } a:focus { outline: thin dotted; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } figure { margin: 0; } img { vertical-align: middle; } .img-responsive, .thumbnail > img, .thumbnail a > img, .carousel-inner > .item > img, .carousel-inner > .item > a > img { display: block; width: 100% \9; max-width: 100%; height: auto; } .img-rounded { border-radius: 6px; } .img-thumbnail { padding: 4px; line-height: 1.42857143; background-color: #ffffff; border: 1px solid #dddddd; border-radius: 4px; -webkit-transition: all 0.2s ease-in-out; -o-transition: all 0.2s ease-in-out; transition: all 0.2s ease-in-out; display: inline-block; width: 100% \9; max-width: 100%; height: auto; } .img-circle { border-radius: 50%; } hr { margin-top: 20px; margin-bottom: 20px; border: 0; border-top: 1px solid #eeeeee; } .sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; } .sr-only-focusable:active, .sr-only-focusable:focus { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; } h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-family: inherit; font-weight: 500; line-height: 1.1; color: inherit; } h1 small, h2 small, h3 small, h4 small, h5 small, h6 small, .h1 small, .h2 small, .h3 small, .h4 small, .h5 small, .h6 small, h1 .small, h2 .small, h3 .small, h4 .small, h5 .small, h6 .small, .h1 .small, .h2 .small, .h3 .small, .h4 .small, .h5 .small, .h6 .small { font-weight: normal; line-height: 1; color: #777777; } h1, .h1, h2, .h2, h3, .h3 { margin-top: 20px; margin-bottom: 10px; } h1 small, .h1 small, h2 small, .h2 small, h3 small, .h3 small, h1 .small, .h1 .small, h2 .small, .h2 .small, h3 .small, .h3 .small { font-size: 65%; } h4, .h4, h5, .h5, h6, .h6 { margin-top: 10px; margin-bottom: 10px; } h4 small, .h4 small, h5 small, .h5 small, h6 small, .h6 small, h4 .small, .h4 .small, h5 .small, .h5 .small, h6 .small, .h6 .small { font-size: 75%; } h1, .h1 { font-size: 36px; } h2, .h2 { font-size: 30px; } h3, .h3 { font-size: 24px; } h4, .h4 { font-size: 18px; } h5, .h5 { font-size: 14px; } h6, .h6 { font-size: 12px; } p { margin: 0 0 10px; } .lead { margin-bottom: 20px; font-size: 16px; font-weight: 300; line-height: 1.4; } @media (min-width: 768px) { .lead { font-size: 21px; } } small, .small { font-size: 85%; } cite { font-style: normal; } mark, .mark { background-color: #fcf8e3; padding: .2em; } .text-left { text-align: left; } .text-right { text-align: right; } .text-center { text-align: center; } .text-justify { text-align: justify; } .text-nowrap { white-space: nowrap; } .text-lowercase { text-transform: lowercase; } .text-uppercase { text-transform: uppercase; } .text-capitalize { text-transform: capitalize; } .text-muted { color: #777777; } .text-primary { color: #428bca; } a.text-primary:hover { color: #3071a9; } .text-success { color: #3c763d; } a.text-success:hover { color: #2b542c; } .text-info { color: #31708f; } a.text-info:hover { color: #245269; } .text-warning { color: #8a6d3b; } a.text-warning:hover { color: #66512c; } .text-danger { color: #a94442; } a.text-danger:hover { color: #843534; } .bg-primary { color: #fff; background-color: #428bca; } a.bg-primary:hover { background-color: #3071a9; } .bg-success { background-color: #dff0d8; } a.bg-success:hover { background-color: #c1e2b3; } .bg-info { background-color: #d9edf7; } a.bg-info:hover { background-color: #afd9ee; } .bg-warning { background-color: #fcf8e3; } a.bg-warning:hover { background-color: #f7ecb5; } .bg-danger { background-color: #f2dede; } a.bg-danger:hover { background-color: #e4b9b9; } .page-header { padding-bottom: 9px; margin: 40px 0 20px; border-bottom: 1px solid #eeeeee; } ul, ol { margin-top: 0; margin-bottom: 10px; } ul ul, ol ul, ul ol, ol ol { margin-bottom: 0; } .list-unstyled { padding-left: 0; list-style: none; } .list-inline { padding-left: 0; list-style: none; margin-left: -5px; } .list-inline > li { display: inline-block; padding-left: 5px; padding-right: 5px; } dl { margin-top: 0; margin-bottom: 20px; } dt, dd { line-height: 1.42857143; } dt { font-weight: bold; } dd { margin-left: 0; } @media (min-width: 768px) { .dl-horizontal dt { float: left; width: 160px; clear: left; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .dl-horizontal dd { margin-left: 180px; } } abbr[title], abbr[data-original-title] { cursor: help; border-bottom: 1px dotted #777777; } .initialism { font-size: 90%; text-transform: uppercase; } blockquote { padding: 10px 20px; margin: 0 0 20px; font-size: 17.5px; border-left: 5px solid #eeeeee; } blockquote p:last-child, blockquote ul:last-child, blockquote ol:last-child { margin-bottom: 0; } blockquote footer, blockquote small, blockquote .small { display: block; font-size: 80%; line-height: 1.42857143; color: #777777; } blockquote footer:before, blockquote small:before, blockquote .small:before { content: '\2014 \00A0'; } .blockquote-reverse, blockquote.pull-right { padding-right: 15px; padding-left: 0; border-right: 5px solid #eeeeee; border-left: 0; text-align: right; } .blockquote-reverse footer:before, blockquote.pull-right footer:before, .blockquote-reverse small:before, blockquote.pull-right small:before, .blockquote-reverse .small:before, blockquote.pull-right .small:before { content: ''; } .blockquote-reverse footer:after, blockquote.pull-right footer:after, .blockquote-reverse small:after, blockquote.pull-right small:after, .blockquote-reverse .small:after, blockquote.pull-right .small:after { content: '\00A0 \2014'; } blockquote:before, blockquote:after { content: ""; } address { margin-bottom: 20px; font-style: normal; line-height: 1.42857143; } code, kbd, pre, samp { font-family: Menlo, Monaco, Consolas, "Courier New", monospace; } code { padding: 2px 4px; font-size: 90%; color: #c7254e; background-color: #f9f2f4; border-radius: 4px; } kbd { padding: 2px 4px; font-size: 90%; color: #ffffff; background-color: #333333; border-radius: 3px; box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25); } kbd kbd { padding: 0; font-size: 100%; box-shadow: none; } pre { display: block; padding: 9.5px; margin: 0 0 10px; font-size: 13px; line-height: 1.42857143; word-break: break-all; word-wrap: break-word; color: #333333; background-color: #f5f5f5; border: 1px solid #cccccc; border-radius: 4px; } pre code { padding: 0; font-size: inherit; color: inherit; white-space: pre-wrap; background-color: transparent; border-radius: 0; } .pre-scrollable { max-height: 340px; overflow-y: scroll; } .container { margin-right: auto; margin-left: auto; padding-left: 15px; padding-right: 15px; } @media (min-width: 768px) { .container { width: 750px; } } @media (min-width: 992px) { .container { width: 970px; } } @media (min-width: 1200px) { .container { width: 1170px; } } .container-fluid { margin-right: auto; margin-left: auto; padding-left: 15px; padding-right: 15px; } .row { margin-left: -15px; margin-right: -15px; } .col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 { position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; } .col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 { float: left; } .col-xs-12 { width: 100%; } .col-xs-11 { width: 91.66666667%; } .col-xs-10 { width: 83.33333333%; } .col-xs-9 { width: 75%; } .col-xs-8 { width: 66.66666667%; } .col-xs-7 { width: 58.33333333%; } .col-xs-6 { width: 50%; } .col-xs-5 { width: 41.66666667%; } .col-xs-4 { width: 33.33333333%; } .col-xs-3 { width: 25%; } .col-xs-2 { width: 16.66666667%; } .col-xs-1 { width: 8.33333333%; } .col-xs-pull-12 { right: 100%; } .col-xs-pull-11 { right: 91.66666667%; } .col-xs-pull-10 { right: 83.33333333%; } .col-xs-pull-9 { right: 75%; } .col-xs-pull-8 { right: 66.66666667%; } .col-xs-pull-7 { right: 58.33333333%; } .col-xs-pull-6 { right: 50%; } .col-xs-pull-5 { right: 41.66666667%; } .col-xs-pull-4 { right: 33.33333333%; } .col-xs-pull-3 { right: 25%; } .col-xs-pull-2 { right: 16.66666667%; } .col-xs-pull-1 { right: 8.33333333%; } .col-xs-pull-0 { right: auto; } .col-xs-push-12 { left: 100%; } .col-xs-push-11 { left: 91.66666667%; } .col-xs-push-10 { left: 83.33333333%; } .col-xs-push-9 { left: 75%; } .col-xs-push-8 { left: 66.66666667%; } .col-xs-push-7 { left: 58.33333333%; } .col-xs-push-6 { left: 50%; } .col-xs-push-5 { left: 41.66666667%; } .col-xs-push-4 { left: 33.33333333%; } .col-xs-push-3 { left: 25%; } .col-xs-push-2 { left: 16.66666667%; } .col-xs-push-1 { left: 8.33333333%; } .col-xs-push-0 { left: auto; } .col-xs-offset-12 { margin-left: 100%; } .col-xs-offset-11 { margin-left: 91.66666667%; } .col-xs-offset-10 { margin-left: 83.33333333%; } .col-xs-offset-9 { margin-left: 75%; } .col-xs-offset-8 { margin-left: 66.66666667%; } .col-xs-offset-7 { margin-left: 58.33333333%; } .col-xs-offset-6 { margin-left: 50%; } .col-xs-offset-5 { margin-left: 41.66666667%; } .col-xs-offset-4 { margin-left: 33.33333333%; } .col-xs-offset-3 { margin-left: 25%; } .col-xs-offset-2 { margin-left: 16.66666667%; } .col-xs-offset-1 { margin-left: 8.33333333%; } .col-xs-offset-0 { margin-left: 0%; } @media (min-width: 768px) { .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 { float: left; } .col-sm-12 { width: 100%; } .col-sm-11 { width: 91.66666667%; } .col-sm-10 { width: 83.33333333%; } .col-sm-9 { width: 75%; } .col-sm-8 { width: 66.66666667%; } .col-sm-7 { width: 58.33333333%; } .col-sm-6 { width: 50%; } .col-sm-5 { width: 41.66666667%; } .col-sm-4 { width: 33.33333333%; } .col-sm-3 { width: 25%; } .col-sm-2 { width: 16.66666667%; } .col-sm-1 { width: 8.33333333%; } .col-sm-pull-12 { right: 100%; } .col-sm-pull-11 { right: 91.66666667%; } .col-sm-pull-10 { right: 83.33333333%; } .col-sm-pull-9 { right: 75%; } .col-sm-pull-8 { right: 66.66666667%; } .col-sm-pull-7 { right: 58.33333333%; } .col-sm-pull-6 { right: 50%; } .col-sm-pull-5 { right: 41.66666667%; } .col-sm-pull-4 { right: 33.33333333%; } .col-sm-pull-3 { right: 25%; } .col-sm-pull-2 { right: 16.66666667%; } .col-sm-pull-1 { right: 8.33333333%; } .col-sm-pull-0 { right: auto; } .col-sm-push-12 { left: 100%; } .col-sm-push-11 { left: 91.66666667%; } .col-sm-push-10 { left: 83.33333333%; } .col-sm-push-9 { left: 75%; } .col-sm-push-8 { left: 66.66666667%; } .col-sm-push-7 { left: 58.33333333%; } .col-sm-push-6 { left: 50%; } .col-sm-push-5 { left: 41.66666667%; } .col-sm-push-4 { left: 33.33333333%; } .col-sm-push-3 { left: 25%; } .col-sm-push-2 { left: 16.66666667%; } .col-sm-push-1 { left: 8.33333333%; } .col-sm-push-0 { left: auto; } .col-sm-offset-12 { margin-left: 100%; } .col-sm-offset-11 { margin-left: 91.66666667%; } .col-sm-offset-10 { margin-left: 83.33333333%; } .col-sm-offset-9 { margin-left: 75%; } .col-sm-offset-8 { margin-left: 66.66666667%; } .col-sm-offset-7 { margin-left: 58.33333333%; } .col-sm-offset-6 { margin-left: 50%; } .col-sm-offset-5 { margin-left: 41.66666667%; } .col-sm-offset-4 { margin-left: 33.33333333%; } .col-sm-offset-3 { margin-left: 25%; } .col-sm-offset-2 { margin-left: 16.66666667%; } .col-sm-offset-1 { margin-left: 8.33333333%; } .col-sm-offset-0 { margin-left: 0%; } } @media (min-width: 992px) { .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 { float: left; } .col-md-12 { width: 100%; } .col-md-11 { width: 91.66666667%; } .col-md-10 { width: 83.33333333%; } .col-md-9 { width: 75%; } .col-md-8 { width: 66.66666667%; } .col-md-7 { width: 58.33333333%; } .col-md-6 { width: 50%; } .col-md-5 { width: 41.66666667%; } .col-md-4 { width: 33.33333333%; } .col-md-3 { width: 25%; } .col-md-2 { width: 16.66666667%; } .col-md-1 { width: 8.33333333%; } .col-md-pull-12 { right: 100%; } .col-md-pull-11 { right: 91.66666667%; } .col-md-pull-10 { right: 83.33333333%; } .col-md-pull-9 { right: 75%; } .col-md-pull-8 { right: 66.66666667%; } .col-md-pull-7 { right: 58.33333333%; } .col-md-pull-6 { right: 50%; } .col-md-pull-5 { right: 41.66666667%; } .col-md-pull-4 { right: 33.33333333%; } .col-md-pull-3 { right: 25%; } .col-md-pull-2 { right: 16.66666667%; } .col-md-pull-1 { right: 8.33333333%; } .col-md-pull-0 { right: auto; } .col-md-push-12 { left: 100%; } .col-md-push-11 { left: 91.66666667%; } .col-md-push-10 { left: 83.33333333%; } .col-md-push-9 { left: 75%; } .col-md-push-8 { left: 66.66666667%; } .col-md-push-7 { left: 58.33333333%; } .col-md-push-6 { left: 50%; } .col-md-push-5 { left: 41.66666667%; } .col-md-push-4 { left: 33.33333333%; } .col-md-push-3 { left: 25%; } .col-md-push-2 { left: 16.66666667%; } .col-md-push-1 { left: 8.33333333%; } .col-md-push-0 { left: auto; } .col-md-offset-12 { margin-left: 100%; } .col-md-offset-11 { margin-left: 91.66666667%; } .col-md-offset-10 { margin-left: 83.33333333%; } .col-md-offset-9 { margin-left: 75%; } .col-md-offset-8 { margin-left: 66.66666667%; } .col-md-offset-7 { margin-left: 58.33333333%; } .col-md-offset-6 { margin-left: 50%; } .col-md-offset-5 { margin-left: 41.66666667%; } .col-md-offset-4 { margin-left: 33.33333333%; } .col-md-offset-3 { margin-left: 25%; } .col-md-offset-2 { margin-left: 16.66666667%; } .col-md-offset-1 { margin-left: 8.33333333%; } .col-md-offset-0 { margin-left: 0%; } } @media (min-width: 1200px) { .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 { float: left; } .col-lg-12 { width: 100%; } .col-lg-11 { width: 91.66666667%; } .col-lg-10 { width: 83.33333333%; } .col-lg-9 { width: 75%; } .col-lg-8 { width: 66.66666667%; } .col-lg-7 { width: 58.33333333%; } .col-lg-6 { width: 50%; } .col-lg-5 { width: 41.66666667%; } .col-lg-4 { width: 33.33333333%; } .col-lg-3 { width: 25%; } .col-lg-2 { width: 16.66666667%; } .col-lg-1 { width: 8.33333333%; } .col-lg-pull-12 { right: 100%; } .col-lg-pull-11 { right: 91.66666667%; } .col-lg-pull-10 { right: 83.33333333%; } .col-lg-pull-9 { right: 75%; } .col-lg-pull-8 { right: 66.66666667%; } .col-lg-pull-7 { right: 58.33333333%; } .col-lg-pull-6 { right: 50%; } .col-lg-pull-5 { right: 41.66666667%; } .col-lg-pull-4 { right: 33.33333333%; } .col-lg-pull-3 { right: 25%; } .col-lg-pull-2 { right: 16.66666667%; } .col-lg-pull-1 { right: 8.33333333%; } .col-lg-pull-0 { right: auto; } .col-lg-push-12 { left: 100%; } .col-lg-push-11 { left: 91.66666667%; } .col-lg-push-10 { left: 83.33333333%; } .col-lg-push-9 { left: 75%; } .col-lg-push-8 { left: 66.66666667%; } .col-lg-push-7 { left: 58.33333333%; } .col-lg-push-6 { left: 50%; } .col-lg-push-5 { left: 41.66666667%; } .col-lg-push-4 { left: 33.33333333%; } .col-lg-push-3 { left: 25%; } .col-lg-push-2 { left: 16.66666667%; } .col-lg-push-1 { left: 8.33333333%; } .col-lg-push-0 { left: auto; } .col-lg-offset-12 { margin-left: 100%; } .col-lg-offset-11 { margin-left: 91.66666667%; } .col-lg-offset-10 { margin-left: 83.33333333%; } .col-lg-offset-9 { margin-left: 75%; } .col-lg-offset-8 { margin-left: 66.66666667%; } .col-lg-offset-7 { margin-left: 58.33333333%; } .col-lg-offset-6 { margin-left: 50%; } .col-lg-offset-5 { margin-left: 41.66666667%; } .col-lg-offset-4 { margin-left: 33.33333333%; } .col-lg-offset-3 { margin-left: 25%; } .col-lg-offset-2 { margin-left: 16.66666667%; } .col-lg-offset-1 { margin-left: 8.33333333%; } .col-lg-offset-0 { margin-left: 0%; } } table { background-color: transparent; } th { text-align: left; } .table { width: 100%; max-width: 100%; margin-bottom: 20px; } .table > thead > tr > th, .table > tbody > tr > th, .table > tfoot > tr > th, .table > thead > tr > td, .table > tbody > tr > td, .table > tfoot > tr > td { padding: 8px; line-height: 1.42857143; vertical-align: top; border-top: 1px solid #dddddd; } .table > thead > tr > th { vertical-align: bottom; border-bottom: 2px solid #dddddd; } .table > caption + thead > tr:first-child > th, .table > colgroup + thead > tr:first-child > th, .table > thead:first-child > tr:first-child > th, .table > caption + thead > tr:first-child > td, .table > colgroup + thead > tr:first-child > td, .table > thead:first-child > tr:first-child > td { border-top: 0; } .table > tbody + tbody { border-top: 2px solid #dddddd; } .table .table { background-color: #ffffff; } .table-condensed > thead > tr > th, .table-condensed > tbody > tr > th, .table-condensed > tfoot > tr > th, .table-condensed > thead > tr > td, .table-condensed > tbody > tr > td, .table-condensed > tfoot > tr > td { padding: 5px; } .table-bordered { border: 1px solid #dddddd; } .table-bordered > thead > tr > th, .table-bordered > tbody > tr > th, .table-bordered > tfoot > tr > th, .table-bordered > thead > tr > td, .table-bordered > tbody > tr > td, .table-bordered > tfoot > tr > td { border: 1px solid #dddddd; } .table-bordered > thead > tr > th, .table-bordered > thead > tr > td { border-bottom-width: 2px; } .table-striped > tbody > tr:nth-child(odd) > td, .table-striped > tbody > tr:nth-child(odd) > th { background-color: #f9f9f9; } .table-hover > tbody > tr:hover > td, .table-hover > tbody > tr:hover > th { background-color: #f5f5f5; } table col[class*="col-"] { position: static; float: none; display: table-column; } table td[class*="col-"], table th[class*="col-"] { position: static; float: none; display: table-cell; } .table > thead > tr > td.active, .table > tbody > tr > td.active, .table > tfoot > tr > td.active, .table > thead > tr > th.active, .table > tbody > tr > th.active, .table > tfoot > tr > th.active, .table > thead > tr.active > td, .table > tbody > tr.active > td, .table > tfoot > tr.active > td, .table > thead > tr.active > th, .table > tbody > tr.active > th, .table > tfoot > tr.active > th { background-color: #f5f5f5; } .table-hover > tbody > tr > td.active:hover, .table-hover > tbody > tr > th.active:hover, .table-hover > tbody > tr.active:hover > td, .table-hover > tbody > tr:hover > .active, .table-hover > tbody > tr.active:hover > th { background-color: #e8e8e8; } .table > thead > tr > td.success, .table > tbody > tr > td.success, .table > tfoot > tr > td.success, .table > thead > tr > th.success, .table > tbody > tr > th.success, .table > tfoot > tr > th.success, .table > thead > tr.success > td, .table > tbody > tr.success > td, .table > tfoot > tr.success > td, .table > thead > tr.success > th, .table > tbody > tr.success > th, .table > tfoot > tr.success > th { background-color: #dff0d8; } .table-hover > tbody > tr > td.success:hover, .table-hover > tbody > tr > th.success:hover, .table-hover > tbody > tr.success:hover > td, .table-hover > tbody > tr:hover > .success, .table-hover > tbody > tr.success:hover > th { background-color: #d0e9c6; } .table > thead > tr > td.info, .table > tbody > tr > td.info, .table > tfoot > tr > td.info, .table > thead > tr > th.info, .table > tbody > tr > th.info, .table > tfoot > tr > th.info, .table > thead > tr.info > td, .table > tbody > tr.info > td, .table > tfoot > tr.info > td, .table > thead > tr.info > th, .table > tbody > tr.info > th, .table > tfoot > tr.info > th { background-color: #d9edf7; } .table-hover > tbody > tr > td.info:hover, .table-hover > tbody > tr > th.info:hover, .table-hover > tbody > tr.info:hover > td, .table-hover > tbody > tr:hover > .info, .table-hover > tbody > tr.info:hover > th { background-color: #c4e3f3; } .table > thead > tr > td.warning, .table > tbody > tr > td.warning, .table > tfoot > tr > td.warning, .table > thead > tr > th.warning, .table > tbody > tr > th.warning, .table > tfoot > tr > th.warning, .table > thead > tr.warning > td, .table > tbody > tr.warning > td, .table > tfoot > tr.warning > td, .table > thead > tr.warning > th, .table > tbody > tr.warning > th, .table > tfoot > tr.warning > th { background-color: #fcf8e3; } .table-hover > tbody > tr > td.warning:hover, .table-hover > tbody > tr > th.warning:hover, .table-hover > tbody > tr.warning:hover > td, .table-hover > tbody > tr:hover > .warning, .table-hover > tbody > tr.warning:hover > th { background-color: #faf2cc; } .table > thead > tr > td.danger, .table > tbody > tr > td.danger, .table > tfoot > tr > td.danger, .table > thead > tr > th.danger, .table > tbody > tr > th.danger, .table > tfoot > tr > th.danger, .table > thead > tr.danger > td, .table > tbody > tr.danger > td, .table > tfoot > tr.danger > td, .table > thead > tr.danger > th, .table > tbody > tr.danger > th, .table > tfoot > tr.danger > th { background-color: #f2dede; } .table-hover > tbody > tr > td.danger:hover, .table-hover > tbody > tr > th.danger:hover, .table-hover > tbody > tr.danger:hover > td, .table-hover > tbody > tr:hover > .danger, .table-hover > tbody > tr.danger:hover > th { background-color: #ebcccc; } @media screen and (max-width: 767px) { .table-responsive { width: 100%; margin-bottom: 15px; overflow-y: hidden; overflow-x: auto; -ms-overflow-style: -ms-autohiding-scrollbar; border: 1px solid #dddddd; -webkit-overflow-scrolling: touch; } .table-responsive > .table { margin-bottom: 0; } .table-responsive > .table > thead > tr > th, .table-responsive > .table > tbody > tr > th, .table-responsive > .table > tfoot > tr > th, .table-responsive > .table > thead > tr > td, .table-responsive > .table > tbody > tr > td, .table-responsive > .table > tfoot > tr > td { white-space: nowrap; } .table-responsive > .table-bordered { border: 0; } .table-responsive > .table-bordered > thead > tr > th:first-child, .table-responsive > .table-bordered > tbody > tr > th:first-child, .table-responsive > .table-bordered > tfoot > tr > th:first-child, .table-responsive > .table-bordered > thead > tr > td:first-child, .table-responsive > .table-bordered > tbody > tr > td:first-child, .table-responsive > .table-bordered > tfoot > tr > td:first-child { border-left: 0; } .table-responsive > .table-bordered > thead > tr > th:last-child, .table-responsive > .table-bordered > tbody > tr > th:last-child, .table-responsive > .table-bordered > tfoot > tr > th:last-child, .table-responsive > .table-bordered > thead > tr > td:last-child, .table-responsive > .table-bordered > tbody > tr > td:last-child, .table-responsive > .table-bordered > tfoot > tr > td:last-child { border-right: 0; } .table-responsive > .table-bordered > tbody > tr:last-child > th, .table-responsive > .table-bordered > tfoot > tr:last-child > th, .table-responsive > .table-bordered > tbody > tr:last-child > td, .table-responsive > .table-bordered > tfoot > tr:last-child > td { border-bottom: 0; } } fieldset { padding: 0; margin: 0; border: 0; min-width: 0; } legend { display: block; width: 100%; padding: 0; margin-bottom: 20px; font-size: 21px; line-height: inherit; color: #333333; border: 0; border-bottom: 1px solid #e5e5e5; } label { display: inline-block; max-width: 100%; margin-bottom: 5px; font-weight: bold; } input[type="search"] { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } input[type="radio"], input[type="checkbox"] { margin: 4px 0 0; margin-top: 1px \9; line-height: normal; } input[type="file"] { display: block; } input[type="range"] { display: block; width: 100%; } select[multiple], select[size] { height: auto; } input[type="file"]:focus, input[type="radio"]:focus, input[type="checkbox"]:focus { outline: thin dotted; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } output { display: block; padding-top: 7px; font-size: 14px; line-height: 1.42857143; color: #555555; } .form-control { display: block; width: 100%; height: 34px; padding: 6px 12px; font-size: 14px; line-height: 1.42857143; color: #555555; background-color: #ffffff; background-image: none; border: 1px solid #cccccc; border-radius: 4px; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; } .form-control:focus { border-color: #66afe9; outline: 0; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6); box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6); } .form-control::-moz-placeholder { color: #777777; opacity: 1; } .form-control:-ms-input-placeholder { color: #777777; } .form-control::-webkit-input-placeholder { color: #777777; } .form-control[disabled], .form-control[readonly], fieldset[disabled] .form-control { cursor: not-allowed; background-color: #eeeeee; opacity: 1; } textarea.form-control { height: auto; } input[type="search"] { -webkit-appearance: none; } input[type="date"], input[type="time"], input[type="datetime-local"], input[type="month"] { line-height: 34px; line-height: 1.42857143 \0; } input[type="date"].input-sm, input[type="time"].input-sm, input[type="datetime-local"].input-sm, input[type="month"].input-sm { line-height: 30px; } input[type="date"].input-lg, input[type="time"].input-lg, input[type="datetime-local"].input-lg, input[type="month"].input-lg { line-height: 46px; } .form-group { margin-bottom: 15px; } .radio, .checkbox { position: relative; display: block; min-height: 20px; margin-top: 10px; margin-bottom: 10px; } .radio label, .checkbox label { padding-left: 20px; margin-bottom: 0; font-weight: normal; cursor: pointer; } .radio input[type="radio"], .radio-inline input[type="radio"], .checkbox input[type="checkbox"], .checkbox-inline input[type="checkbox"] { position: absolute; margin-left: -20px; margin-top: 4px \9; } .radio + .radio, .checkbox + .checkbox { margin-top: -5px; } .radio-inline, .checkbox-inline { display: inline-block; padding-left: 20px; margin-bottom: 0; vertical-align: middle; font-weight: normal; cursor: pointer; } .radio-inline + .radio-inline, .checkbox-inline + .checkbox-inline { margin-top: 0; margin-left: 10px; } input[type="radio"][disabled], input[type="checkbox"][disabled], input[type="radio"].disabled, input[type="checkbox"].disabled, fieldset[disabled] input[type="radio"], fieldset[disabled] input[type="checkbox"] { cursor: not-allowed; } .radio-inline.disabled, .checkbox-inline.disabled, fieldset[disabled] .radio-inline, fieldset[disabled] .checkbox-inline { cursor: not-allowed; } .radio.disabled label, .checkbox.disabled label, fieldset[disabled] .radio label, fieldset[disabled] .checkbox label { cursor: not-allowed; } .form-control-static { padding-top: 7px; padding-bottom: 7px; margin-bottom: 0; } .form-control-static.input-lg, .form-control-static.input-sm { padding-left: 0; padding-right: 0; } .input-sm, .form-horizontal .form-group-sm .form-control { height: 30px; padding: 5px 10px; font-size: 12px; line-height: 1.5; border-radius: 3px; } select.input-sm { height: 30px; line-height: 30px; } textarea.input-sm, select[multiple].input-sm { height: auto; } .input-lg, .form-horizontal .form-group-lg .form-control { height: 46px; padding: 10px 16px; font-size: 18px; line-height: 1.33; border-radius: 6px; } select.input-lg { height: 46px; line-height: 46px; } textarea.input-lg, select[multiple].input-lg { height: auto; } .has-feedback { position: relative; } .has-feedback .form-control { padding-right: 42.5px; } .form-control-feedback { position: absolute; top: 25px; right: 0; z-index: 2; display: block; width: 34px; height: 34px; line-height: 34px; text-align: center; } .input-lg + .form-control-feedback { width: 46px; height: 46px; line-height: 46px; } .input-sm + .form-control-feedback { width: 30px; height: 30px; line-height: 30px; } .has-success .help-block, .has-success .control-label, .has-success .radio, .has-success .checkbox, .has-success .radio-inline, .has-success .checkbox-inline { color: #3c763d; } .has-success .form-control { border-color: #3c763d; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } .has-success .form-control:focus { border-color: #2b542c; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168; } .has-success .input-group-addon { color: #3c763d; border-color: #3c763d; background-color: #dff0d8; } .has-success .form-control-feedback { color: #3c763d; } .has-warning .help-block, .has-warning .control-label, .has-warning .radio, .has-warning .checkbox, .has-warning .radio-inline, .has-warning .checkbox-inline { color: #8a6d3b; } .has-warning .form-control { border-color: #8a6d3b; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } .has-warning .form-control:focus { border-color: #66512c; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b; } .has-warning .input-group-addon { color: #8a6d3b; border-color: #8a6d3b; background-color: #fcf8e3; } .has-warning .form-control-feedback { color: #8a6d3b; } .has-error .help-block, .has-error .control-label, .has-error .radio, .has-error .checkbox, .has-error .radio-inline, .has-error .checkbox-inline { color: #a94442; } .has-error .form-control { border-color: #a94442; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } .has-error .form-control:focus { border-color: #843534; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483; } .has-error .input-group-addon { color: #a94442; border-color: #a94442; background-color: #f2dede; } .has-error .form-control-feedback { color: #a94442; } .has-feedback label.sr-only ~ .form-control-feedback { top: 0; } .help-block { display: block; margin-top: 5px; margin-bottom: 10px; color: #737373; } @media (min-width: 768px) { .form-inline .form-group { display: inline-block; margin-bottom: 0; vertical-align: middle; } .form-inline .form-control { display: inline-block; width: auto; vertical-align: middle; } .form-inline .input-group { display: inline-table; vertical-align: middle; } .form-inline .input-group .input-group-addon, .form-inline .input-group .input-group-btn, .form-inline .input-group .form-control { width: auto; } .form-inline .input-group > .form-control { width: 100%; } .form-inline .control-label { margin-bottom: 0; vertical-align: middle; } .form-inline .radio, .form-inline .checkbox { display: inline-block; margin-top: 0; margin-bottom: 0; vertical-align: middle; } .form-inline .radio label, .form-inline .checkbox label { padding-left: 0; } .form-inline .radio input[type="radio"], .form-inline .checkbox input[type="checkbox"] { position: relative; margin-left: 0; } .form-inline .has-feedback .form-control-feedback { top: 0; } } .form-horizontal .radio, .form-horizontal .checkbox, .form-horizontal .radio-inline, .form-horizontal .checkbox-inline { margin-top: 0; margin-bottom: 0; padding-top: 7px; } .form-horizontal .radio, .form-horizontal .checkbox { min-height: 27px; } .form-horizontal .form-group { margin-left: -15px; margin-right: -15px; } @media (min-width: 768px) { .form-horizontal .control-label { text-align: right; margin-bottom: 0; padding-top: 7px; } } .form-horizontal .has-feedback .form-control-feedback { top: 0; right: 15px; } @media (min-width: 768px) { .form-horizontal .form-group-lg .control-label { padding-top: 14.3px; } } @media (min-width: 768px) { .form-horizontal .form-group-sm .control-label { padding-top: 6px; } } .btn { display: inline-block; margin-bottom: 0; font-weight: normal; text-align: center; vertical-align: middle; cursor: pointer; background-image: none; border: 1px solid transparent; white-space: nowrap; padding: 6px 12px; font-size: 14px; line-height: 1.42857143; border-radius: 4px; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .btn:focus, .btn:active:focus, .btn.active:focus { outline: thin dotted; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } .btn:hover, .btn:focus { color: #333333; text-decoration: none; } .btn:active, .btn.active { outline: 0; background-image: none; -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); } .btn.disabled, .btn[disabled], fieldset[disabled] .btn { cursor: not-allowed; pointer-events: none; opacity: 0.65; filter: alpha(opacity=65); -webkit-box-shadow: none; box-shadow: none; } .btn-default { color: #333333; background-color: #ffffff; border-color: #cccccc; } .btn-default:hover, .btn-default:focus, .btn-default:active, .btn-default.active, .open > .dropdown-toggle.btn-default { color: #333333; background-color: #e6e6e6; border-color: #adadad; } .btn-default:active, .btn-default.active, .open > .dropdown-toggle.btn-default { background-image: none; } .btn-default.disabled, .btn-default[disabled], fieldset[disabled] .btn-default, .btn-default.disabled:hover, .btn-default[disabled]:hover, fieldset[disabled] .btn-default:hover, .btn-default.disabled:focus, .btn-default[disabled]:focus, fieldset[disabled] .btn-default:focus, .btn-default.disabled:active, .btn-default[disabled]:active, fieldset[disabled] .btn-default:active, .btn-default.disabled.active, .btn-default[disabled].active, fieldset[disabled] .btn-default.active { background-color: #ffffff; border-color: #cccccc; } .btn-default .badge { color: #ffffff; background-color: #333333; } .btn-primary { color: #ffffff; background-color: #428bca; border-color: #357ebd; } .btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active, .open > .dropdown-toggle.btn-primary { color: #ffffff; background-color: #3071a9; border-color: #285e8e; } .btn-primary:active, .btn-primary.active, .open > .dropdown-toggle.btn-primary { background-image: none; } .btn-primary.disabled, .btn-primary[disabled], fieldset[disabled] .btn-primary, .btn-primary.disabled:hover, .btn-primary[disabled]:hover, fieldset[disabled] .btn-primary:hover, .btn-primary.disabled:focus, .btn-primary[disabled]:focus, fieldset[disabled] .btn-primary:focus, .btn-primary.disabled:active, .btn-primary[disabled]:active, fieldset[disabled] .btn-primary:active, .btn-primary.disabled.active, .btn-primary[disabled].active, fieldset[disabled] .btn-primary.active { background-color: #428bca; border-color: #357ebd; } .btn-primary .badge { color: #428bca; background-color: #ffffff; } .btn-success { color: #ffffff; background-color: #5cb85c; border-color: #4cae4c; } .btn-success:hover, .btn-success:focus, .btn-success:active, .btn-success.active, .open > .dropdown-toggle.btn-success { color: #ffffff; background-color: #449d44; border-color: #398439; } .btn-success:active, .btn-success.active, .open > .dropdown-toggle.btn-success { background-image: none; } .btn-success.disabled, .btn-success[disabled], fieldset[disabled] .btn-success, .btn-success.disabled:hover, .btn-success[disabled]:hover, fieldset[disabled] .btn-success:hover, .btn-success.disabled:focus, .btn-success[disabled]:focus, fieldset[disabled] .btn-success:focus, .btn-success.disabled:active, .btn-success[disabled]:active, fieldset[disabled] .btn-success:active, .btn-success.disabled.active, .btn-success[disabled].active, fieldset[disabled] .btn-success.active { background-color: #5cb85c; border-color: #4cae4c; } .btn-success .badge { color: #5cb85c; background-color: #ffffff; } .btn-info { color: #ffffff; background-color: #5bc0de; border-color: #46b8da; } .btn-info:hover, .btn-info:focus, .btn-info:active, .btn-info.active, .open > .dropdown-toggle.btn-info { color: #ffffff; background-color: #31b0d5; border-color: #269abc; } .btn-info:active, .btn-info.active, .open > .dropdown-toggle.btn-info { background-image: none; } .btn-info.disabled, .btn-info[disabled], fieldset[disabled] .btn-info, .btn-info.disabled:hover, .btn-info[disabled]:hover, fieldset[disabled] .btn-info:hover, .btn-info.disabled:focus, .btn-info[disabled]:focus, fieldset[disabled] .btn-info:focus, .btn-info.disabled:active, .btn-info[disabled]:active, fieldset[disabled] .btn-info:active, .btn-info.disabled.active, .btn-info[disabled].active, fieldset[disabled] .btn-info.active { background-color: #5bc0de; border-color: #46b8da; } .btn-info .badge { color: #5bc0de; background-color: #ffffff; } .btn-warning { color: #ffffff; background-color: #f0ad4e; border-color: #eea236; } .btn-warning:hover, .btn-warning:focus, .btn-warning:active, .btn-warning.active, .open > .dropdown-toggle.btn-warning { color: #ffffff; background-color: #ec971f; border-color: #d58512; } .btn-warning:active, .btn-warning.active, .open > .dropdown-toggle.btn-warning { background-image: none; } .btn-warning.disabled, .btn-warning[disabled], fieldset[disabled] .btn-warning, .btn-warning.disabled:hover, .btn-warning[disabled]:hover, fieldset[disabled] .btn-warning:hover, .btn-warning.disabled:focus, .btn-warning[disabled]:focus, fieldset[disabled] .btn-warning:focus, .btn-warning.disabled:active, .btn-warning[disabled]:active, fieldset[disabled] .btn-warning:active, .btn-warning.disabled.active, .btn-warning[disabled].active, fieldset[disabled] .btn-warning.active { background-color: #f0ad4e; border-color: #eea236; } .btn-warning .badge { color: #f0ad4e; background-color: #ffffff; } .btn-danger { color: #ffffff; background-color: #d9534f; border-color: #d43f3a; } .btn-danger:hover, .btn-danger:focus, .btn-danger:active, .btn-danger.active, .open > .dropdown-toggle.btn-danger { color: #ffffff; background-color: #c9302c; border-color: #ac2925; } .btn-danger:active, .btn-danger.active, .open > .dropdown-toggle.btn-danger { background-image: none; } .btn-danger.disabled, .btn-danger[disabled], fieldset[disabled] .btn-danger, .btn-danger.disabled:hover, .btn-danger[disabled]:hover, fieldset[disabled] .btn-danger:hover, .btn-danger.disabled:focus, .btn-danger[disabled]:focus, fieldset[disabled] .btn-danger:focus, .btn-danger.disabled:active, .btn-danger[disabled]:active, fieldset[disabled] .btn-danger:active, .btn-danger.disabled.active, .btn-danger[disabled].active, fieldset[disabled] .btn-danger.active { background-color: #d9534f; border-color: #d43f3a; } .btn-danger .badge { color: #d9534f; background-color: #ffffff; } .btn-link { color: #428bca; font-weight: normal; cursor: pointer; border-radius: 0; } .btn-link, .btn-link:active, .btn-link[disabled], fieldset[disabled] .btn-link { background-color: transparent; -webkit-box-shadow: none; box-shadow: none; } .btn-link, .btn-link:hover, .btn-link:focus, .btn-link:active { border-color: transparent; } .btn-link:hover, .btn-link:focus { color: #2a6496; text-decoration: underline; background-color: transparent; } .btn-link[disabled]:hover, fieldset[disabled] .btn-link:hover, .btn-link[disabled]:focus, fieldset[disabled] .btn-link:focus { color: #777777; text-decoration: none; } .btn-lg, .btn-group-lg > .btn { padding: 10px 16px; font-size: 18px; line-height: 1.33; border-radius: 6px; } .btn-sm, .btn-group-sm > .btn { padding: 5px 10px; font-size: 12px; line-height: 1.5; border-radius: 3px; } .btn-xs, .btn-group-xs > .btn { padding: 1px 5px; font-size: 12px; line-height: 1.5; border-radius: 3px; } .btn-block { display: block; width: 100%; } .btn-block + .btn-block { margin-top: 5px; } input[type="submit"].btn-block, input[type="reset"].btn-block, input[type="button"].btn-block { width: 100%; } .fade { opacity: 0; -webkit-transition: opacity 0.15s linear; -o-transition: opacity 0.15s linear; transition: opacity 0.15s linear; } .fade.in { opacity: 1; } .collapse { display: none; } .collapse.in { display: block; } tr.collapse.in { display: table-row; } tbody.collapse.in { display: table-row-group; } .collapsing { position: relative; height: 0; overflow: hidden; -webkit-transition: height 0.35s ease; -o-transition: height 0.35s ease; transition: height 0.35s ease; } .caret { display: inline-block; width: 0; height: 0; margin-left: 2px; vertical-align: middle; border-top: 4px solid; border-right: 4px solid transparent; border-left: 4px solid transparent; } .dropdown { position: relative; } .dropdown-toggle:focus { outline: 0; } .dropdown-menu { position: absolute; top: 100%; left: 0; z-index: 1000; display: none; float: left; min-width: 160px; padding: 5px 0; margin: 2px 0 0; list-style: none; font-size: 14px; text-align: left; background-color: #ffffff; border: 1px solid #cccccc; border: 1px solid rgba(0, 0, 0, 0.15); border-radius: 4px; -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); background-clip: padding-box; } .dropdown-menu.pull-right { right: 0; left: auto; } .dropdown-menu .divider { height: 1px; margin: 9px 0; overflow: hidden; background-color: #e5e5e5; } .dropdown-menu > li > a { display: block; padding: 3px 20px; clear: both; font-weight: normal; line-height: 1.42857143; color: #333333; white-space: nowrap; } .dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus { text-decoration: none; color: #262626; background-color: #f5f5f5; } .dropdown-menu > .active > a, .dropdown-menu > .active > a:hover, .dropdown-menu > .active > a:focus { color: #ffffff; text-decoration: none; outline: 0; background-color: #428bca; } .dropdown-menu > .disabled > a, .dropdown-menu > .disabled > a:hover, .dropdown-menu > .disabled > a:focus { color: #777777; } .dropdown-menu > .disabled > a:hover, .dropdown-menu > .disabled > a:focus { text-decoration: none; background-color: transparent; background-image: none; filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); cursor: not-allowed; } .open > .dropdown-menu { display: block; } .open > a { outline: 0; } .dropdown-menu-right { left: auto; right: 0; } .dropdown-menu-left { left: 0; right: auto; } .dropdown-header { display: block; padding: 3px 20px; font-size: 12px; line-height: 1.42857143; color: #777777; white-space: nowrap; } .dropdown-backdrop { position: fixed; left: 0; right: 0; bottom: 0; top: 0; z-index: 990; } .pull-right > .dropdown-menu { right: 0; left: auto; } .dropup .caret, .navbar-fixed-bottom .dropdown .caret { border-top: 0; border-bottom: 4px solid; content: ""; } .dropup .dropdown-menu, .navbar-fixed-bottom .dropdown .dropdown-menu { top: auto; bottom: 100%; margin-bottom: 1px; } @media (min-width: 768px) { .navbar-right .dropdown-menu { left: auto; right: 0; } .navbar-right .dropdown-menu-left { left: 0; right: auto; } } .btn-group, .btn-group-vertical { position: relative; display: inline-block; vertical-align: middle; } .btn-group > .btn, .btn-group-vertical > .btn { position: relative; float: left; } .btn-group > .btn:hover, .btn-group-vertical > .btn:hover, .btn-group > .btn:focus, .btn-group-vertical > .btn:focus, .btn-group > .btn:active, .btn-group-vertical > .btn:active, .btn-group > .btn.active, .btn-group-vertical > .btn.active { z-index: 2; } .btn-group > .btn:focus, .btn-group-vertical > .btn:focus { outline: 0; } .btn-group .btn + .btn, .btn-group .btn + .btn-group, .btn-group .btn-group + .btn, .btn-group .btn-group + .btn-group { margin-left: -1px; } .btn-toolbar { margin-left: -5px; } .btn-toolbar .btn-group, .btn-toolbar .input-group { float: left; } .btn-toolbar > .btn, .btn-toolbar > .btn-group, .btn-toolbar > .input-group { margin-left: 5px; } .btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) { border-radius: 0; } .btn-group > .btn:first-child { margin-left: 0; } .btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) { border-bottom-right-radius: 0; border-top-right-radius: 0; } .btn-group > .btn:last-child:not(:first-child), .btn-group > .dropdown-toggle:not(:first-child) { border-bottom-left-radius: 0; border-top-left-radius: 0; } .btn-group > .btn-group { float: left; } .btn-group > .btn-group:not(:first-child):not(:last-child) > .btn { border-radius: 0; } .btn-group > .btn-group:first-child > .btn:last-child, .btn-group > .btn-group:first-child > .dropdown-toggle { border-bottom-right-radius: 0; border-top-right-radius: 0; } .btn-group > .btn-group:last-child > .btn:first-child { border-bottom-left-radius: 0; border-top-left-radius: 0; } .btn-group .dropdown-toggle:active, .btn-group.open .dropdown-toggle { outline: 0; } .btn-group > .btn + .dropdown-toggle { padding-left: 8px; padding-right: 8px; } .btn-group > .btn-lg + .dropdown-toggle { padding-left: 12px; padding-right: 12px; } .btn-group.open .dropdown-toggle { -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); } .btn-group.open .dropdown-toggle.btn-link { -webkit-box-shadow: none; box-shadow: none; } .btn .caret { margin-left: 0; } .btn-lg .caret { border-width: 5px 5px 0; border-bottom-width: 0; } .dropup .btn-lg .caret { border-width: 0 5px 5px; } .btn-group-vertical > .btn, .btn-group-vertical > .btn-group, .btn-group-vertical > .btn-group > .btn { display: block; float: none; width: 100%; max-width: 100%; } .btn-group-vertical > .btn-group > .btn { float: none; } .btn-group-vertical > .btn + .btn, .btn-group-vertical > .btn + .btn-group, .btn-group-vertical > .btn-group + .btn, .btn-group-vertical > .btn-group + .btn-group { margin-top: -1px; margin-left: 0; } .btn-group-vertical > .btn:not(:first-child):not(:last-child) { border-radius: 0; } .btn-group-vertical > .btn:first-child:not(:last-child) { border-top-right-radius: 4px; border-bottom-right-radius: 0; border-bottom-left-radius: 0; } .btn-group-vertical > .btn:last-child:not(:first-child) { border-bottom-left-radius: 4px; border-top-right-radius: 0; border-top-left-radius: 0; } .btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn { border-radius: 0; } .btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child, .btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle { border-bottom-right-radius: 0; border-bottom-left-radius: 0; } .btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child { border-top-right-radius: 0; border-top-left-radius: 0; } .btn-group-justified { display: table; width: 100%; table-layout: fixed; border-collapse: separate; } .btn-group-justified > .btn, .btn-group-justified > .btn-group { float: none; display: table-cell; width: 1%; } .btn-group-justified > .btn-group .btn { width: 100%; } .btn-group-justified > .btn-group .dropdown-menu { left: auto; } [data-toggle="buttons"] > .btn > input[type="radio"], [data-toggle="buttons"] > .btn > input[type="checkbox"] { position: absolute; z-index: -1; opacity: 0; filter: alpha(opacity=0); } .input-group { position: relative; display: table; border-collapse: separate; } .input-group[class*="col-"] { float: none; padding-left: 0; padding-right: 0; } .input-group .form-control { position: relative; z-index: 2; float: left; width: 100%; margin-bottom: 0; } .input-group-lg > .form-control, .input-group-lg > .input-group-addon, .input-group-lg > .input-group-btn > .btn { height: 46px; padding: 10px 16px; font-size: 18px; line-height: 1.33; border-radius: 6px; } select.input-group-lg > .form-control, select.input-group-lg > .input-group-addon, select.input-group-lg > .input-group-btn > .btn { height: 46px; line-height: 46px; } textarea.input-group-lg > .form-control, textarea.input-group-lg > .input-group-addon, textarea.input-group-lg > .input-group-btn > .btn, select[multiple].input-group-lg > .form-control, select[multiple].input-group-lg > .input-group-addon, select[multiple].input-group-lg > .input-group-btn > .btn { height: auto; } .input-group-sm > .form-control, .input-group-sm > .input-group-addon, .input-group-sm > .input-group-btn > .btn { height: 30px; padding: 5px 10px; font-size: 12px; line-height: 1.5; border-radius: 3px; } select.input-group-sm > .form-control, select.input-group-sm > .input-group-addon, select.input-group-sm > .input-group-btn > .btn { height: 30px; line-height: 30px; } textarea.input-group-sm > .form-control, textarea.input-group-sm > .input-group-addon, textarea.input-group-sm > .input-group-btn > .btn, select[multiple].input-group-sm > .form-control, select[multiple].input-group-sm > .input-group-addon, select[multiple].input-group-sm > .input-group-btn > .btn { height: auto; } .input-group-addon, .input-group-btn, .input-group .form-control { display: table-cell; } .input-group-addon:not(:first-child):not(:last-child), .input-group-btn:not(:first-child):not(:last-child), .input-group .form-control:not(:first-child):not(:last-child) { border-radius: 0; } .input-group-addon, .input-group-btn { width: 1%; white-space: nowrap; vertical-align: middle; } .input-group-addon { padding: 6px 12px; font-size: 14px; font-weight: normal; line-height: 1; color: #555555; text-align: center; background-color: #eeeeee; border: 1px solid #cccccc; border-radius: 4px; } .input-group-addon.input-sm { padding: 5px 10px; font-size: 12px; border-radius: 3px; } .input-group-addon.input-lg { padding: 10px 16px; font-size: 18px; border-radius: 6px; } .input-group-addon input[type="radio"], .input-group-addon input[type="checkbox"] { margin-top: 0; } .input-group .form-control:first-child, .input-group-addon:first-child, .input-group-btn:first-child > .btn, .input-group-btn:first-child > .btn-group > .btn, .input-group-btn:first-child > .dropdown-toggle, .input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle), .input-group-btn:last-child > .btn-group:not(:last-child) > .btn { border-bottom-right-radius: 0; border-top-right-radius: 0; } .input-group-addon:first-child { border-right: 0; } .input-group .form-control:last-child, .input-group-addon:last-child, .input-group-btn:last-child > .btn, .input-group-btn:last-child > .btn-group > .btn, .input-group-btn:last-child > .dropdown-toggle, .input-group-btn:first-child > .btn:not(:first-child), .input-group-btn:first-child > .btn-group:not(:first-child) > .btn { border-bottom-left-radius: 0; border-top-left-radius: 0; } .input-group-addon:last-child { border-left: 0; } .input-group-btn { position: relative; font-size: 0; white-space: nowrap; } .input-group-btn > .btn { position: relative; } .input-group-btn > .btn + .btn { margin-left: -1px; } .input-group-btn > .btn:hover, .input-group-btn > .btn:focus, .input-group-btn > .btn:active { z-index: 2; } .input-group-btn:first-child > .btn, .input-group-btn:first-child > .btn-group { margin-right: -1px; } .input-group-btn:last-child > .btn, .input-group-btn:last-child > .btn-group { margin-left: -1px; } .nav { margin-bottom: 0; padding-left: 0; list-style: none; } .nav > li { position: relative; display: block; } .nav > li > a { position: relative; display: block; padding: 10px 15px; } .nav > li > a:hover, .nav > li > a:focus { text-decoration: none; background-color: #eeeeee; } .nav > li.disabled > a { color: #777777; } .nav > li.disabled > a:hover, .nav > li.disabled > a:focus { color: #777777; text-decoration: none; background-color: transparent; cursor: not-allowed; } .nav .open > a, .nav .open > a:hover, .nav .open > a:focus { background-color: #eeeeee; border-color: #428bca; } .nav .nav-divider { height: 1px; margin: 9px 0; overflow: hidden; background-color: #e5e5e5; } .nav > li > a > img { max-width: none; } .nav-tabs { border-bottom: 1px solid #dddddd; } .nav-tabs > li { float: left; margin-bottom: -1px; } .nav-tabs > li > a { margin-right: 2px; line-height: 1.42857143; border: 1px solid transparent; border-radius: 4px 4px 0 0; } .nav-tabs > li > a:hover { border-color: #eeeeee #eeeeee #dddddd; } .nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus { color: #555555; background-color: #ffffff; border: 1px solid #dddddd; border-bottom-color: transparent; cursor: default; } .nav-tabs.nav-justified { width: 100%; border-bottom: 0; } .nav-tabs.nav-justified > li { float: none; } .nav-tabs.nav-justified > li > a { text-align: center; margin-bottom: 5px; } .nav-tabs.nav-justified > .dropdown .dropdown-menu { top: auto; left: auto; } @media (min-width: 768px) { .nav-tabs.nav-justified > li { display: table-cell; width: 1%; } .nav-tabs.nav-justified > li > a { margin-bottom: 0; } } .nav-tabs.nav-justified > li > a { margin-right: 0; border-radius: 4px; } .nav-tabs.nav-justified > .active > a, .nav-tabs.nav-justified > .active > a:hover, .nav-tabs.nav-justified > .active > a:focus { border: 1px solid #dddddd; } @media (min-width: 768px) { .nav-tabs.nav-justified > li > a { border-bottom: 1px solid #dddddd; border-radius: 4px 4px 0 0; } .nav-tabs.nav-justified > .active > a, .nav-tabs.nav-justified > .active > a:hover, .nav-tabs.nav-justified > .active > a:focus { border-bottom-color: #ffffff; } } .nav-pills > li { float: left; } .nav-pills > li > a { border-radius: 4px; } .nav-pills > li + li { margin-left: 2px; } .nav-pills > li.active > a, .nav-pills > li.active > a:hover, .nav-pills > li.active > a:focus { color: #ffffff; background-color: #428bca; } .nav-stacked > li { float: none; } .nav-stacked > li + li { margin-top: 2px; margin-left: 0; } .nav-justified { width: 100%; } .nav-justified > li { float: none; } .nav-justified > li > a { text-align: center; margin-bottom: 5px; } .nav-justified > .dropdown .dropdown-menu { top: auto; left: auto; } @media (min-width: 768px) { .nav-justified > li { display: table-cell; width: 1%; } .nav-justified > li > a { margin-bottom: 0; } } .nav-tabs-justified { border-bottom: 0; } .nav-tabs-justified > li > a { margin-right: 0; border-radius: 4px; } .nav-tabs-justified > .active > a, .nav-tabs-justified > .active > a:hover, .nav-tabs-justified > .active > a:focus { border: 1px solid #dddddd; } @media (min-width: 768px) { .nav-tabs-justified > li > a { border-bottom: 1px solid #dddddd; border-radius: 4px 4px 0 0; } .nav-tabs-justified > .active > a, .nav-tabs-justified > .active > a:hover, .nav-tabs-justified > .active > a:focus { border-bottom-color: #ffffff; } } .tab-content > .tab-pane { display: none; } .tab-content > .active { display: block; } .nav-tabs .dropdown-menu { margin-top: -1px; border-top-right-radius: 0; border-top-left-radius: 0; } .navbar { position: relative; min-height: 50px; margin-bottom: 20px; border: 1px solid transparent; } @media (min-width: 768px) { .navbar { border-radius: 4px; } } @media (min-width: 768px) { .navbar-header { float: left; } } .navbar-collapse { overflow-x: visible; padding-right: 15px; padding-left: 15px; border-top: 1px solid transparent; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1); -webkit-overflow-scrolling: touch; } .navbar-collapse.in { overflow-y: auto; } @media (min-width: 768px) { .navbar-collapse { width: auto; border-top: 0; box-shadow: none; } .navbar-collapse.collapse { display: block !important; height: auto !important; padding-bottom: 0; overflow: visible !important; } .navbar-collapse.in { overflow-y: visible; } .navbar-fixed-top .navbar-collapse, .navbar-static-top .navbar-collapse, .navbar-fixed-bottom .navbar-collapse { padding-left: 0; padding-right: 0; } } .navbar-fixed-top .navbar-collapse, .navbar-fixed-bottom .navbar-collapse { max-height: 340px; } @media (max-width: 480px) and (orientation: landscape) { .navbar-fixed-top .navbar-collapse, .navbar-fixed-bottom .navbar-collapse { max-height: 200px; } } .container > .navbar-header, .container-fluid > .navbar-header, .container > .navbar-collapse, .container-fluid > .navbar-collapse { margin-right: -15px; margin-left: -15px; } @media (min-width: 768px) { .container > .navbar-header, .container-fluid > .navbar-header, .container > .navbar-collapse, .container-fluid > .navbar-collapse { margin-right: 0; margin-left: 0; } } .navbar-static-top { z-index: 1000; border-width: 0 0 1px; } @media (min-width: 768px) { .navbar-static-top { border-radius: 0; } } .navbar-fixed-top, .navbar-fixed-bottom { position: fixed; right: 0; left: 0; z-index: 1030; -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); } @media (min-width: 768px) { .navbar-fixed-top, .navbar-fixed-bottom { border-radius: 0; } } .navbar-fixed-top { top: 0; border-width: 0 0 1px; } .navbar-fixed-bottom { bottom: 0; margin-bottom: 0; border-width: 1px 0 0; } .navbar-brand { float: left; padding: 15px 15px; font-size: 18px; line-height: 20px; height: 50px; } .navbar-brand:hover, .navbar-brand:focus { text-decoration: none; } @media (min-width: 768px) { .navbar > .container .navbar-brand, .navbar > .container-fluid .navbar-brand { margin-left: -15px; } } .navbar-toggle { position: relative; float: right; margin-right: 15px; padding: 9px 10px; margin-top: 8px; margin-bottom: 8px; background-color: transparent; background-image: none; border: 1px solid transparent; border-radius: 4px; } .navbar-toggle:focus { outline: 0; } .navbar-toggle .icon-bar { display: block; width: 22px; height: 2px; border-radius: 1px; } .navbar-toggle .icon-bar + .icon-bar { margin-top: 4px; } @media (min-width: 768px) { .navbar-toggle { display: none; } } .navbar-nav { margin: 7.5px -15px; } .navbar-nav > li > a { padding-top: 10px; padding-bottom: 10px; line-height: 20px; } @media (max-width: 767px) { .navbar-nav .open .dropdown-menu { position: static; float: none; width: auto; margin-top: 0; background-color: transparent; border: 0; box-shadow: none; } .navbar-nav .open .dropdown-menu > li > a, .navbar-nav .open .dropdown-menu .dropdown-header { padding: 5px 15px 5px 25px; } .navbar-nav .open .dropdown-menu > li > a { line-height: 20px; } .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-nav .open .dropdown-menu > li > a:focus { background-image: none; } } @media (min-width: 768px) { .navbar-nav { float: left; margin: 0; } .navbar-nav > li { float: left; } .navbar-nav > li > a { padding-top: 15px; padding-bottom: 15px; } .navbar-nav.navbar-right:last-child { margin-right: -15px; } } @media (min-width: 768px) { .navbar-left { float: left !important; float: left; } .navbar-right { float: right !important; float: right; } } .navbar-form { margin-left: -15px; margin-right: -15px; padding: 10px 15px; border-top: 1px solid transparent; border-bottom: 1px solid transparent; -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); margin-top: 8px; margin-bottom: 8px; } @media (min-width: 768px) { .navbar-form .form-group { display: inline-block; margin-bottom: 0; vertical-align: middle; } .navbar-form .form-control { display: inline-block; width: auto; vertical-align: middle; } .navbar-form .input-group { display: inline-table; vertical-align: middle; } .navbar-form .input-group .input-group-addon, .navbar-form .input-group .input-group-btn, .navbar-form .input-group .form-control { width: auto; } .navbar-form .input-group > .form-control { width: 100%; } .navbar-form .control-label { margin-bottom: 0; vertical-align: middle; } .navbar-form .radio, .navbar-form .checkbox { display: inline-block; margin-top: 0; margin-bottom: 0; vertical-align: middle; } .navbar-form .radio label, .navbar-form .checkbox label { padding-left: 0; } .navbar-form .radio input[type="radio"], .navbar-form .checkbox input[type="checkbox"] { position: relative; margin-left: 0; } .navbar-form .has-feedback .form-control-feedback { top: 0; } } @media (max-width: 767px) { .navbar-form .form-group { margin-bottom: 5px; } } @media (min-width: 768px) { .navbar-form { width: auto; border: 0; margin-left: 0; margin-right: 0; padding-top: 0; padding-bottom: 0; -webkit-box-shadow: none; box-shadow: none; } .navbar-form.navbar-right:last-child { margin-right: -15px; } } .navbar-nav > li > .dropdown-menu { margin-top: 0; border-top-right-radius: 0; border-top-left-radius: 0; } .navbar-fixed-bottom .navbar-nav > li > .dropdown-menu { border-bottom-right-radius: 0; border-bottom-left-radius: 0; } .navbar-btn { margin-top: 8px; margin-bottom: 8px; } .navbar-btn.btn-sm { margin-top: 10px; margin-bottom: 10px; } .navbar-btn.btn-xs { margin-top: 14px; margin-bottom: 14px; } .navbar-text { margin-top: 15px; margin-bottom: 15px; } @media (min-width: 768px) { .navbar-text { float: left; margin-left: 15px; margin-right: 15px; } .navbar-text.navbar-right:last-child { margin-right: 0; } } .navbar-default { background-color: #f8f8f8; border-color: #e7e7e7; } .navbar-default .navbar-brand { color: #777777; } .navbar-default .navbar-brand:hover, .navbar-default .navbar-brand:focus { color: #5e5e5e; background-color: transparent; } .navbar-default .navbar-text { color: #777777; } .navbar-default .navbar-nav > li > a { color: #777777; } .navbar-default .navbar-nav > li > a:hover, .navbar-default .navbar-nav > li > a:focus { color: #333333; background-color: transparent; } .navbar-default .navbar-nav > .active > a, .navbar-default .navbar-nav > .active > a:hover, .navbar-default .navbar-nav > .active > a:focus { color: #555555; background-color: #e7e7e7; } .navbar-default .navbar-nav > .disabled > a, .navbar-default .navbar-nav > .disabled > a:hover, .navbar-default .navbar-nav > .disabled > a:focus { color: #cccccc; background-color: transparent; } .navbar-default .navbar-toggle { border-color: #dddddd; } .navbar-default .navbar-toggle:hover, .navbar-default .navbar-toggle:focus { background-color: #dddddd; } .navbar-default .navbar-toggle .icon-bar { background-color: #888888; } .navbar-default .navbar-collapse, .navbar-default .navbar-form { border-color: #e7e7e7; } .navbar-default .navbar-nav > .open > a, .navbar-default .navbar-nav > .open > a:hover, .navbar-default .navbar-nav > .open > a:focus { background-color: #e7e7e7; color: #555555; } @media (max-width: 767px) { .navbar-default .navbar-nav .open .dropdown-menu > li > a { color: #777777; } .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus { color: #333333; background-color: transparent; } .navbar-default .navbar-nav .open .dropdown-menu > .active > a, .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus { color: #555555; background-color: #e7e7e7; } .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a, .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus { color: #cccccc; background-color: transparent; } } .navbar-default .navbar-link { color: #777777; } .navbar-default .navbar-link:hover { color: #333333; } .navbar-default .btn-link { color: #777777; } .navbar-default .btn-link:hover, .navbar-default .btn-link:focus { color: #333333; } .navbar-default .btn-link[disabled]:hover, fieldset[disabled] .navbar-default .btn-link:hover, .navbar-default .btn-link[disabled]:focus, fieldset[disabled] .navbar-default .btn-link:focus { color: #cccccc; } .navbar-inverse { background-color: #222222; border-color: #080808; } .navbar-inverse .navbar-brand { color: #777777; } .navbar-inverse .navbar-brand:hover, .navbar-inverse .navbar-brand:focus { color: #ffffff; background-color: transparent; } .navbar-inverse .navbar-text { color: #777777; } .navbar-inverse .navbar-nav > li > a { color: #777777; } .navbar-inverse .navbar-nav > li > a:hover, .navbar-inverse .navbar-nav > li > a:focus { color: #ffffff; background-color: transparent; } .navbar-inverse .navbar-nav > .active > a, .navbar-inverse .navbar-nav > .active > a:hover, .navbar-inverse .navbar-nav > .active > a:focus { color: #ffffff; background-color: #080808; } .navbar-inverse .navbar-nav > .disabled > a, .navbar-inverse .navbar-nav > .disabled > a:hover, .navbar-inverse .navbar-nav > .disabled > a:focus { color: #444444; background-color: transparent; } .navbar-inverse .navbar-toggle { border-color: #333333; } .navbar-inverse .navbar-toggle:hover, .navbar-inverse .navbar-toggle:focus { background-color: #333333; } .navbar-inverse .navbar-toggle .icon-bar { background-color: #ffffff; } .navbar-inverse .navbar-collapse, .navbar-inverse .navbar-form { border-color: #101010; } .navbar-inverse .navbar-nav > .open > a, .navbar-inverse .navbar-nav > .open > a:hover, .navbar-inverse .navbar-nav > .open > a:focus { background-color: #080808; color: #ffffff; } @media (max-width: 767px) { .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header { border-color: #080808; } .navbar-inverse .navbar-nav .open .dropdown-menu .divider { background-color: #080808; } .navbar-inverse .navbar-nav .open .dropdown-menu > li > a { color: #777777; } .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus { color: #ffffff; background-color: transparent; } .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a, .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover, .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus { color: #ffffff; background-color: #080808; } .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a, .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover, .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus { color: #444444; background-color: transparent; } } .navbar-inverse .navbar-link { color: #777777; } .navbar-inverse .navbar-link:hover { color: #ffffff; } .navbar-inverse .btn-link { color: #777777; } .navbar-inverse .btn-link:hover, .navbar-inverse .btn-link:focus { color: #ffffff; } .navbar-inverse .btn-link[disabled]:hover, fieldset[disabled] .navbar-inverse .btn-link:hover, .navbar-inverse .btn-link[disabled]:focus, fieldset[disabled] .navbar-inverse .btn-link:focus { color: #444444; } .breadcrumb { padding: 8px 15px; margin-bottom: 20px; list-style: none; background-color: #f5f5f5; border-radius: 4px; } .breadcrumb > li { display: inline-block; } .breadcrumb > li + li:before { content: "/\00a0"; padding: 0 5px; color: #cccccc; } .breadcrumb > .active { color: #777777; } .pagination { display: inline-block; padding-left: 0; margin: 20px 0; border-radius: 4px; } .pagination > li { display: inline; } .pagination > li > a, .pagination > li > span { position: relative; float: left; padding: 6px 12px; line-height: 1.42857143; text-decoration: none; color: #428bca; background-color: #ffffff; border: 1px solid #dddddd; margin-left: -1px; } .pagination > li:first-child > a, .pagination > li:first-child > span { margin-left: 0; border-bottom-left-radius: 4px; border-top-left-radius: 4px; } .pagination > li:last-child > a, .pagination > li:last-child > span { border-bottom-right-radius: 4px; border-top-right-radius: 4px; } .pagination > li > a:hover, .pagination > li > span:hover, .pagination > li > a:focus, .pagination > li > span:focus { color: #2a6496; background-color: #eeeeee; border-color: #dddddd; } .pagination > .active > a, .pagination > .active > span, .pagination > .active > a:hover, .pagination > .active > span:hover, .pagination > .active > a:focus, .pagination > .active > span:focus { z-index: 2; color: #ffffff; background-color: #428bca; border-color: #428bca; cursor: default; } .pagination > .disabled > span, .pagination > .disabled > span:hover, .pagination > .disabled > span:focus, .pagination > .disabled > a, .pagination > .disabled > a:hover, .pagination > .disabled > a:focus { color: #777777; background-color: #ffffff; border-color: #dddddd; cursor: not-allowed; } .pagination-lg > li > a, .pagination-lg > li > span { padding: 10px 16px; font-size: 18px; } .pagination-lg > li:first-child > a, .pagination-lg > li:first-child > span { border-bottom-left-radius: 6px; border-top-left-radius: 6px; } .pagination-lg > li:last-child > a, .pagination-lg > li:last-child > span { border-bottom-right-radius: 6px; border-top-right-radius: 6px; } .pagination-sm > li > a, .pagination-sm > li > span { padding: 5px 10px; font-size: 12px; } .pagination-sm > li:first-child > a, .pagination-sm > li:first-child > span { border-bottom-left-radius: 3px; border-top-left-radius: 3px; } .pagination-sm > li:last-child > a, .pagination-sm > li:last-child > span { border-bottom-right-radius: 3px; border-top-right-radius: 3px; } .pager { padding-left: 0; margin: 20px 0; list-style: none; text-align: center; } .pager li { display: inline; } .pager li > a, .pager li > span { display: inline-block; padding: 5px 14px; background-color: #ffffff; border: 1px solid #dddddd; border-radius: 15px; } .pager li > a:hover, .pager li > a:focus { text-decoration: none; background-color: #eeeeee; } .pager .next > a, .pager .next > span { float: right; } .pager .previous > a, .pager .previous > span { float: left; } .pager .disabled > a, .pager .disabled > a:hover, .pager .disabled > a:focus, .pager .disabled > span { color: #777777; background-color: #ffffff; cursor: not-allowed; } .label { display: inline; padding: .2em .6em .3em; font-size: 75%; font-weight: bold; line-height: 1; color: #ffffff; text-align: center; white-space: nowrap; vertical-align: baseline; border-radius: .25em; } a.label:hover, a.label:focus { color: #ffffff; text-decoration: none; cursor: pointer; } .label:empty { display: none; } .btn .label { position: relative; top: -1px; } .label-default { background-color: #777777; } .label-default[href]:hover, .label-default[href]:focus { background-color: #5e5e5e; } .label-primary { background-color: #428bca; } .label-primary[href]:hover, .label-primary[href]:focus { background-color: #3071a9; } .label-success { background-color: #5cb85c; } .label-success[href]:hover, .label-success[href]:focus { background-color: #449d44; } .label-info { background-color: #5bc0de; } .label-info[href]:hover, .label-info[href]:focus { background-color: #31b0d5; } .label-warning { background-color: #f0ad4e; } .label-warning[href]:hover, .label-warning[href]:focus { background-color: #ec971f; } .label-danger { background-color: #d9534f; } .label-danger[href]:hover, .label-danger[href]:focus { background-color: #c9302c; } .badge { display: inline-block; min-width: 10px; padding: 3px 7px; font-size: 12px; font-weight: bold; color: #ffffff; line-height: 1; vertical-align: baseline; white-space: nowrap; text-align: center; background-color: #777777; border-radius: 10px; } .badge:empty { display: none; } .btn .badge { position: relative; top: -1px; } .btn-xs .badge { top: 0; padding: 1px 5px; } a.badge:hover, a.badge:focus { color: #ffffff; text-decoration: none; cursor: pointer; } a.list-group-item.active > .badge, .nav-pills > .active > a > .badge { color: #428bca; background-color: #ffffff; } .nav-pills > li > a > .badge { margin-left: 3px; } .jumbotron { padding: 30px; margin-bottom: 30px; color: inherit; background-color: #eeeeee; } .jumbotron h1, .jumbotron .h1 { color: inherit; } .jumbotron p { margin-bottom: 15px; font-size: 21px; font-weight: 200; } .jumbotron > hr { border-top-color: #d5d5d5; } .container .jumbotron { border-radius: 6px; } .jumbotron .container { max-width: 100%; } @media screen and (min-width: 768px) { .jumbotron { padding-top: 48px; padding-bottom: 48px; } .container .jumbotron { padding-left: 60px; padding-right: 60px; } .jumbotron h1, .jumbotron .h1 { font-size: 63px; } } .thumbnail { display: block; padding: 4px; margin-bottom: 20px; line-height: 1.42857143; background-color: #ffffff; border: 1px solid #dddddd; border-radius: 4px; -webkit-transition: all 0.2s ease-in-out; -o-transition: all 0.2s ease-in-out; transition: all 0.2s ease-in-out; } .thumbnail > img, .thumbnail a > img { margin-left: auto; margin-right: auto; } a.thumbnail:hover, a.thumbnail:focus, a.thumbnail.active { border-color: #428bca; } .thumbnail .caption { padding: 9px; color: #333333; } .alert { padding: 15px; margin-bottom: 20px; border: 1px solid transparent; border-radius: 4px; } .alert h4 { margin-top: 0; color: inherit; } .alert .alert-link { font-weight: bold; } .alert > p, .alert > ul { margin-bottom: 0; } .alert > p + p { margin-top: 5px; } .alert-dismissable, .alert-dismissible { padding-right: 35px; } .alert-dismissable .close, .alert-dismissible .close { position: relative; top: -2px; right: -21px; color: inherit; } .alert-success { background-color: #dff0d8; border-color: #d6e9c6; color: #3c763d; } .alert-success hr { border-top-color: #c9e2b3; } .alert-success .alert-link { color: #2b542c; } .alert-info { background-color: #d9edf7; border-color: #bce8f1; color: #31708f; } .alert-info hr { border-top-color: #a6e1ec; } .alert-info .alert-link { color: #245269; } .alert-warning { background-color: #fcf8e3; border-color: #faebcc; color: #8a6d3b; } .alert-warning hr { border-top-color: #f7e1b5; } .alert-warning .alert-link { color: #66512c; } .alert-danger { background-color: #f2dede; border-color: #ebccd1; color: #a94442; } .alert-danger hr { border-top-color: #e4b9c0; } .alert-danger .alert-link { color: #843534; } @-webkit-keyframes progress-bar-stripes { from { background-position: 40px 0; } to { background-position: 0 0; } } @keyframes progress-bar-stripes { from { background-position: 40px 0; } to { background-position: 0 0; } } .progress { overflow: hidden; height: 20px; margin-bottom: 20px; background-color: #f5f5f5; border-radius: 4px; -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); } .progress-bar { float: left; width: 0%; height: 100%; font-size: 12px; line-height: 20px; color: #ffffff; text-align: center; background-color: #428bca; -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); -webkit-transition: width 0.6s ease; -o-transition: width 0.6s ease; transition: width 0.6s ease; } .progress-striped .progress-bar, .progress-bar-striped { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-size: 40px 40px; } .progress.active .progress-bar, .progress-bar.active { -webkit-animation: progress-bar-stripes 2s linear infinite; -o-animation: progress-bar-stripes 2s linear infinite; animation: progress-bar-stripes 2s linear infinite; } .progress-bar[aria-valuenow="1"], .progress-bar[aria-valuenow="2"] { min-width: 30px; } .progress-bar[aria-valuenow="0"] { color: #777777; min-width: 30px; background-color: transparent; background-image: none; box-shadow: none; } .progress-bar-success { background-color: #5cb85c; } .progress-striped .progress-bar-success { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .progress-bar-info { background-color: #5bc0de; } .progress-striped .progress-bar-info { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .progress-bar-warning { background-color: #f0ad4e; } .progress-striped .progress-bar-warning { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .progress-bar-danger { background-color: #d9534f; } .progress-striped .progress-bar-danger { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .media, .media-body { overflow: hidden; zoom: 1; } .media, .media .media { margin-top: 15px; } .media:first-child { margin-top: 0; } .media-object { display: block; } .media-heading { margin: 0 0 5px; } .media > .pull-left { margin-right: 10px; } .media > .pull-right { margin-left: 10px; } .media-list { padding-left: 0; list-style: none; } .list-group { margin-bottom: 20px; padding-left: 0; } .list-group-item { position: relative; display: block; padding: 10px 15px; margin-bottom: -1px; background-color: #ffffff; border: 1px solid #dddddd; } .list-group-item:first-child { border-top-right-radius: 4px; border-top-left-radius: 4px; } .list-group-item:last-child { margin-bottom: 0; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; } .list-group-item > .badge { float: right; } .list-group-item > .badge + .badge { margin-right: 5px; } a.list-group-item { color: #555555; } a.list-group-item .list-group-item-heading { color: #333333; } a.list-group-item:hover, a.list-group-item:focus { text-decoration: none; color: #555555; background-color: #f5f5f5; } .list-group-item.disabled, .list-group-item.disabled:hover, .list-group-item.disabled:focus { background-color: #eeeeee; color: #777777; } .list-group-item.disabled .list-group-item-heading, .list-group-item.disabled:hover .list-group-item-heading, .list-group-item.disabled:focus .list-group-item-heading { color: inherit; } .list-group-item.disabled .list-group-item-text, .list-group-item.disabled:hover .list-group-item-text, .list-group-item.disabled:focus .list-group-item-text { color: #777777; } .list-group-item.active, .list-group-item.active:hover, .list-group-item.active:focus { z-index: 2; color: #ffffff; background-color: #428bca; border-color: #428bca; } .list-group-item.active .list-group-item-heading, .list-group-item.active:hover .list-group-item-heading, .list-group-item.active:focus .list-group-item-heading, .list-group-item.active .list-group-item-heading > small, .list-group-item.active:hover .list-group-item-heading > small, .list-group-item.active:focus .list-group-item-heading > small, .list-group-item.active .list-group-item-heading > .small, .list-group-item.active:hover .list-group-item-heading > .small, .list-group-item.active:focus .list-group-item-heading > .small { color: inherit; } .list-group-item.active .list-group-item-text, .list-group-item.active:hover .list-group-item-text, .list-group-item.active:focus .list-group-item-text { color: #e1edf7; } .list-group-item-success { color: #3c763d; background-color: #dff0d8; } a.list-group-item-success { color: #3c763d; } a.list-group-item-success .list-group-item-heading { color: inherit; } a.list-group-item-success:hover, a.list-group-item-success:focus { color: #3c763d; background-color: #d0e9c6; } a.list-group-item-success.active, a.list-group-item-success.active:hover, a.list-group-item-success.active:focus { color: #fff; background-color: #3c763d; border-color: #3c763d; } .list-group-item-info { color: #31708f; background-color: #d9edf7; } a.list-group-item-info { color: #31708f; } a.list-group-item-info .list-group-item-heading { color: inherit; } a.list-group-item-info:hover, a.list-group-item-info:focus { color: #31708f; background-color: #c4e3f3; } a.list-group-item-info.active, a.list-group-item-info.active:hover, a.list-group-item-info.active:focus { color: #fff; background-color: #31708f; border-color: #31708f; } .list-group-item-warning { color: #8a6d3b; background-color: #fcf8e3; } a.list-group-item-warning { color: #8a6d3b; } a.list-group-item-warning .list-group-item-heading { color: inherit; } a.list-group-item-warning:hover, a.list-group-item-warning:focus { color: #8a6d3b; background-color: #faf2cc; } a.list-group-item-warning.active, a.list-group-item-warning.active:hover, a.list-group-item-warning.active:focus { color: #fff; background-color: #8a6d3b; border-color: #8a6d3b; } .list-group-item-danger { color: #a94442; background-color: #f2dede; } a.list-group-item-danger { color: #a94442; } a.list-group-item-danger .list-group-item-heading { color: inherit; } a.list-group-item-danger:hover, a.list-group-item-danger:focus { color: #a94442; background-color: #ebcccc; } a.list-group-item-danger.active, a.list-group-item-danger.active:hover, a.list-group-item-danger.active:focus { color: #fff; background-color: #a94442; border-color: #a94442; } .list-group-item-heading { margin-top: 0; margin-bottom: 5px; } .list-group-item-text { margin-bottom: 0; line-height: 1.3; } .panel { margin-bottom: 20px; background-color: #ffffff; border: 1px solid transparent; border-radius: 4px; -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); } .panel-body { padding: 15px; } .panel-heading { padding: 10px 15px; border-bottom: 1px solid transparent; border-top-right-radius: 3px; border-top-left-radius: 3px; } .panel-heading > .dropdown .dropdown-toggle { color: inherit; } .panel-title { margin-top: 0; margin-bottom: 0; font-size: 16px; color: inherit; } .panel-title > a { color: inherit; } .panel-footer { padding: 10px 15px; background-color: #f5f5f5; border-top: 1px solid #dddddd; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; } .panel > .list-group { margin-bottom: 0; } .panel > .list-group .list-group-item { border-width: 1px 0; border-radius: 0; } .panel > .list-group:first-child .list-group-item:first-child { border-top: 0; border-top-right-radius: 3px; border-top-left-radius: 3px; } .panel > .list-group:last-child .list-group-item:last-child { border-bottom: 0; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; } .panel-heading + .list-group .list-group-item:first-child { border-top-width: 0; } .list-group + .panel-footer { border-top-width: 0; } .panel > .table, .panel > .table-responsive > .table, .panel > .panel-collapse > .table { margin-bottom: 0; } .panel > .table:first-child, .panel > .table-responsive:first-child > .table:first-child { border-top-right-radius: 3px; border-top-left-radius: 3px; } .panel > .table:first-child > thead:first-child > tr:first-child td:first-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child, .panel > .table:first-child > tbody:first-child > tr:first-child td:first-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child, .panel > .table:first-child > thead:first-child > tr:first-child th:first-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child, .panel > .table:first-child > tbody:first-child > tr:first-child th:first-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child { border-top-left-radius: 3px; } .panel > .table:first-child > thead:first-child > tr:first-child td:last-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child, .panel > .table:first-child > tbody:first-child > tr:first-child td:last-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child, .panel > .table:first-child > thead:first-child > tr:first-child th:last-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child, .panel > .table:first-child > tbody:first-child > tr:first-child th:last-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child { border-top-right-radius: 3px; } .panel > .table:last-child, .panel > .table-responsive:last-child > .table:last-child { border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; } .panel > .table:last-child > tbody:last-child > tr:last-child td:first-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child, .panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child, .panel > .table:last-child > tbody:last-child > tr:last-child th:first-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child, .panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child { border-bottom-left-radius: 3px; } .panel > .table:last-child > tbody:last-child > tr:last-child td:last-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child, .panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child, .panel > .table:last-child > tbody:last-child > tr:last-child th:last-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child, .panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child { border-bottom-right-radius: 3px; } .panel > .panel-body + .table, .panel > .panel-body + .table-responsive { border-top: 1px solid #dddddd; } .panel > .table > tbody:first-child > tr:first-child th, .panel > .table > tbody:first-child > tr:first-child td { border-top: 0; } .panel > .table-bordered, .panel > .table-responsive > .table-bordered { border: 0; } .panel > .table-bordered > thead > tr > th:first-child, .panel > .table-responsive > .table-bordered > thead > tr > th:first-child, .panel > .table-bordered > tbody > tr > th:first-child, .panel > .table-responsive > .table-bordered > tbody > tr > th:first-child, .panel > .table-bordered > tfoot > tr > th:first-child, .panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child, .panel > .table-bordered > thead > tr > td:first-child, .panel > .table-responsive > .table-bordered > thead > tr > td:first-child, .panel > .table-bordered > tbody > tr > td:first-child, .panel > .table-responsive > .table-bordered > tbody > tr > td:first-child, .panel > .table-bordered > tfoot > tr > td:first-child, .panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child { border-left: 0; } .panel > .table-bordered > thead > tr > th:last-child, .panel > .table-responsive > .table-bordered > thead > tr > th:last-child, .panel > .table-bordered > tbody > tr > th:last-child, .panel > .table-responsive > .table-bordered > tbody > tr > th:last-child, .panel > .table-bordered > tfoot > tr > th:last-child, .panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child, .panel > .table-bordered > thead > tr > td:last-child, .panel > .table-responsive > .table-bordered > thead > tr > td:last-child, .panel > .table-bordered > tbody > tr > td:last-child, .panel > .table-responsive > .table-bordered > tbody > tr > td:last-child, .panel > .table-bordered > tfoot > tr > td:last-child, .panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child { border-right: 0; } .panel > .table-bordered > thead > tr:first-child > td, .panel > .table-responsive > .table-bordered > thead > tr:first-child > td, .panel > .table-bordered > tbody > tr:first-child > td, .panel > .table-responsive > .table-bordered > tbody > tr:first-child > td, .panel > .table-bordered > thead > tr:first-child > th, .panel > .table-responsive > .table-bordered > thead > tr:first-child > th, .panel > .table-bordered > tbody > tr:first-child > th, .panel > .table-responsive > .table-bordered > tbody > tr:first-child > th { border-bottom: 0; } .panel > .table-bordered > tbody > tr:last-child > td, .panel > .table-responsive > .table-bordered > tbody > tr:last-child > td, .panel > .table-bordered > tfoot > tr:last-child > td, .panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td, .panel > .table-bordered > tbody > tr:last-child > th, .panel > .table-responsive > .table-bordered > tbody > tr:last-child > th, .panel > .table-bordered > tfoot > tr:last-child > th, .panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th { border-bottom: 0; } .panel > .table-responsive { border: 0; margin-bottom: 0; } .panel-group { margin-bottom: 20px; } .panel-group .panel { margin-bottom: 0; border-radius: 4px; } .panel-group .panel + .panel { margin-top: 5px; } .panel-group .panel-heading { border-bottom: 0; } .panel-group .panel-heading + .panel-collapse > .panel-body { border-top: 1px solid #dddddd; } .panel-group .panel-footer { border-top: 0; } .panel-group .panel-footer + .panel-collapse .panel-body { border-bottom: 1px solid #dddddd; } .panel-default { border-color: #dddddd; } .panel-default > .panel-heading { color: #333333; background-color: #f5f5f5; border-color: #dddddd; } .panel-default > .panel-heading + .panel-collapse > .panel-body { border-top-color: #dddddd; } .panel-default > .panel-heading .badge { color: #f5f5f5; background-color: #333333; } .panel-default > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #dddddd; } .panel-primary { border-color: #428bca; } .panel-primary > .panel-heading { color: #ffffff; background-color: #428bca; border-color: #428bca; } .panel-primary > .panel-heading + .panel-collapse > .panel-body { border-top-color: #428bca; } .panel-primary > .panel-heading .badge { color: #428bca; background-color: #ffffff; } .panel-primary > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #428bca; } .panel-success { border-color: #d6e9c6; } .panel-success > .panel-heading { color: #3c763d; background-color: #dff0d8; border-color: #d6e9c6; } .panel-success > .panel-heading + .panel-collapse > .panel-body { border-top-color: #d6e9c6; } .panel-success > .panel-heading .badge { color: #dff0d8; background-color: #3c763d; } .panel-success > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #d6e9c6; } .panel-info { border-color: #bce8f1; } .panel-info > .panel-heading { color: #31708f; background-color: #d9edf7; border-color: #bce8f1; } .panel-info > .panel-heading + .panel-collapse > .panel-body { border-top-color: #bce8f1; } .panel-info > .panel-heading .badge { color: #d9edf7; background-color: #31708f; } .panel-info > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #bce8f1; } .panel-warning { border-color: #faebcc; } .panel-warning > .panel-heading { color: #8a6d3b; background-color: #fcf8e3; border-color: #faebcc; } .panel-warning > .panel-heading + .panel-collapse > .panel-body { border-top-color: #faebcc; } .panel-warning > .panel-heading .badge { color: #fcf8e3; background-color: #8a6d3b; } .panel-warning > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #faebcc; } .panel-danger { border-color: #ebccd1; } .panel-danger > .panel-heading { color: #a94442; background-color: #f2dede; border-color: #ebccd1; } .panel-danger > .panel-heading + .panel-collapse > .panel-body { border-top-color: #ebccd1; } .panel-danger > .panel-heading .badge { color: #f2dede; background-color: #a94442; } .panel-danger > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #ebccd1; } .embed-responsive { position: relative; display: block; height: 0; padding: 0; overflow: hidden; } .embed-responsive .embed-responsive-item, .embed-responsive iframe, .embed-responsive embed, .embed-responsive object { position: absolute; top: 0; left: 0; bottom: 0; height: 100%; width: 100%; border: 0; } .embed-responsive.embed-responsive-16by9 { padding-bottom: 56.25%; } .embed-responsive.embed-responsive-4by3 { padding-bottom: 75%; } .well { min-height: 20px; padding: 19px; margin-bottom: 20px; background-color: #f5f5f5; border: 1px solid #e3e3e3; border-radius: 4px; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); } .well blockquote { border-color: #ddd; border-color: rgba(0, 0, 0, 0.15); } .well-lg { padding: 24px; border-radius: 6px; } .well-sm { padding: 9px; border-radius: 3px; } .close { float: right; font-size: 21px; font-weight: bold; line-height: 1; color: #000000; text-shadow: 0 1px 0 #ffffff; opacity: 0.2; filter: alpha(opacity=20); } .close:hover, .close:focus { color: #000000; text-decoration: none; cursor: pointer; opacity: 0.5; filter: alpha(opacity=50); } button.close { padding: 0; cursor: pointer; background: transparent; border: 0; -webkit-appearance: none; } .modal-open { overflow: hidden; } .modal { display: none; overflow: hidden; position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1050; -webkit-overflow-scrolling: touch; outline: 0; } .modal.fade .modal-dialog { -webkit-transform: translate3d(0, -25%, 0); transform: translate3d(0, -25%, 0); -webkit-transition: -webkit-transform 0.3s ease-out; -moz-transition: -moz-transform 0.3s ease-out; -o-transition: -o-transform 0.3s ease-out; transition: transform 0.3s ease-out; } .modal.in .modal-dialog { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); } .modal-open .modal { overflow-x: hidden; overflow-y: auto; } .modal-dialog { position: relative; width: auto; margin: 10px; } .modal-content { position: relative; background-color: #ffffff; border: 1px solid #999999; border: 1px solid rgba(0, 0, 0, 0.2); border-radius: 6px; -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); background-clip: padding-box; outline: 0; } .modal-backdrop { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1040; background-color: #000000; } .modal-backdrop.fade { opacity: 0; filter: alpha(opacity=0); } .modal-backdrop.in { opacity: 0.5; filter: alpha(opacity=50); } .modal-header { padding: 15px; border-bottom: 1px solid #e5e5e5; min-height: 16.42857143px; } .modal-header .close { margin-top: -2px; } .modal-title { margin: 0; line-height: 1.42857143; } .modal-body { position: relative; padding: 15px; } .modal-footer { padding: 15px; text-align: right; border-top: 1px solid #e5e5e5; } .modal-footer .btn + .btn { margin-left: 5px; margin-bottom: 0; } .modal-footer .btn-group .btn + .btn { margin-left: -1px; } .modal-footer .btn-block + .btn-block { margin-left: 0; } .modal-scrollbar-measure { position: absolute; top: -9999px; width: 50px; height: 50px; overflow: scroll; } @media (min-width: 768px) { .modal-dialog { width: 600px; margin: 30px auto; } .modal-content { -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); } .modal-sm { width: 300px; } } @media (min-width: 992px) { .modal-lg { width: 900px; } } .tooltip { position: absolute; z-index: 1070; display: block; visibility: visible; font-size: 12px; line-height: 1.4; opacity: 0; filter: alpha(opacity=0); } .tooltip.in { opacity: 0.9; filter: alpha(opacity=90); } .tooltip.top { margin-top: -3px; padding: 5px 0; } .tooltip.right { margin-left: 3px; padding: 0 5px; } .tooltip.bottom { margin-top: 3px; padding: 5px 0; } .tooltip.left { margin-left: -3px; padding: 0 5px; } .tooltip-inner { max-width: 200px; padding: 3px 8px; color: #ffffff; text-align: center; text-decoration: none; background-color: #000000; border-radius: 4px; } .tooltip-arrow { position: absolute; width: 0; height: 0; border-color: transparent; border-style: solid; } .tooltip.top .tooltip-arrow { bottom: 0; left: 50%; margin-left: -5px; border-width: 5px 5px 0; border-top-color: #000000; } .tooltip.top-left .tooltip-arrow { bottom: 0; left: 5px; border-width: 5px 5px 0; border-top-color: #000000; } .tooltip.top-right .tooltip-arrow { bottom: 0; right: 5px; border-width: 5px 5px 0; border-top-color: #000000; } .tooltip.right .tooltip-arrow { top: 50%; left: 0; margin-top: -5px; border-width: 5px 5px 5px 0; border-right-color: #000000; } .tooltip.left .tooltip-arrow { top: 50%; right: 0; margin-top: -5px; border-width: 5px 0 5px 5px; border-left-color: #000000; } .tooltip.bottom .tooltip-arrow { top: 0; left: 50%; margin-left: -5px; border-width: 0 5px 5px; border-bottom-color: #000000; } .tooltip.bottom-left .tooltip-arrow { top: 0; left: 5px; border-width: 0 5px 5px; border-bottom-color: #000000; } .tooltip.bottom-right .tooltip-arrow { top: 0; right: 5px; border-width: 0 5px 5px; border-bottom-color: #000000; } .popover { position: absolute; top: 0; left: 0; z-index: 1060; display: none; max-width: 276px; padding: 1px; text-align: left; background-color: #ffffff; background-clip: padding-box; border: 1px solid #cccccc; border: 1px solid rgba(0, 0, 0, 0.2); border-radius: 6px; -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); white-space: normal; } .popover.top { margin-top: -10px; } .popover.right { margin-left: 10px; } .popover.bottom { margin-top: 10px; } .popover.left { margin-left: -10px; } .popover-title { margin: 0; padding: 8px 14px; font-size: 14px; font-weight: normal; line-height: 18px; background-color: #f7f7f7; border-bottom: 1px solid #ebebeb; border-radius: 5px 5px 0 0; } .popover-content { padding: 9px 14px; } .popover > .arrow, .popover > .arrow:after { position: absolute; display: block; width: 0; height: 0; border-color: transparent; border-style: solid; } .popover > .arrow { border-width: 11px; } .popover > .arrow:after { border-width: 10px; content: ""; } .popover.top > .arrow { left: 50%; margin-left: -11px; border-bottom-width: 0; border-top-color: #999999; border-top-color: rgba(0, 0, 0, 0.25); bottom: -11px; } .popover.top > .arrow:after { content: " "; bottom: 1px; margin-left: -10px; border-bottom-width: 0; border-top-color: #ffffff; } .popover.right > .arrow { top: 50%; left: -11px; margin-top: -11px; border-left-width: 0; border-right-color: #999999; border-right-color: rgba(0, 0, 0, 0.25); } .popover.right > .arrow:after { content: " "; left: 1px; bottom: -10px; border-left-width: 0; border-right-color: #ffffff; } .popover.bottom > .arrow { left: 50%; margin-left: -11px; border-top-width: 0; border-bottom-color: #999999; border-bottom-color: rgba(0, 0, 0, 0.25); top: -11px; } .popover.bottom > .arrow:after { content: " "; top: 1px; margin-left: -10px; border-top-width: 0; border-bottom-color: #ffffff; } .popover.left > .arrow { top: 50%; right: -11px; margin-top: -11px; border-right-width: 0; border-left-color: #999999; border-left-color: rgba(0, 0, 0, 0.25); } .popover.left > .arrow:after { content: " "; right: 1px; border-right-width: 0; border-left-color: #ffffff; bottom: -10px; } .carousel { position: relative; } .carousel-inner { position: relative; overflow: hidden; width: 100%; } .carousel-inner > .item { display: none; position: relative; -webkit-transition: 0.6s ease-in-out left; -o-transition: 0.6s ease-in-out left; transition: 0.6s ease-in-out left; } .carousel-inner > .item > img, .carousel-inner > .item > a > img { line-height: 1; } .carousel-inner > .active, .carousel-inner > .next, .carousel-inner > .prev { display: block; } .carousel-inner > .active { left: 0; } .carousel-inner > .next, .carousel-inner > .prev { position: absolute; top: 0; width: 100%; } .carousel-inner > .next { left: 100%; } .carousel-inner > .prev { left: -100%; } .carousel-inner > .next.left, .carousel-inner > .prev.right { left: 0; } .carousel-inner > .active.left { left: -100%; } .carousel-inner > .active.right { left: 100%; } .carousel-control { position: absolute; top: 0; left: 0; bottom: 0; width: 15%; opacity: 0.5; filter: alpha(opacity=50); font-size: 20px; color: #ffffff; text-align: center; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); } .carousel-control.left { background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%); background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%); background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1); } .carousel-control.right { left: auto; right: 0; background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%); background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%); background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1); } .carousel-control:hover, .carousel-control:focus { outline: 0; color: #ffffff; text-decoration: none; opacity: 0.9; filter: alpha(opacity=90); } .carousel-control .icon-prev, .carousel-control .icon-next, .carousel-control .glyphicon-chevron-left, .carousel-control .glyphicon-chevron-right { position: absolute; top: 50%; z-index: 5; display: inline-block; } .carousel-control .icon-prev, .carousel-control .glyphicon-chevron-left { left: 50%; margin-left: -10px; } .carousel-control .icon-next, .carousel-control .glyphicon-chevron-right { right: 50%; margin-right: -10px; } .carousel-control .icon-prev, .carousel-control .icon-next { width: 20px; height: 20px; margin-top: -10px; font-family: serif; } .carousel-control .icon-prev:before { content: '\2039'; } .carousel-control .icon-next:before { content: '\203a'; } .carousel-indicators { position: absolute; bottom: 10px; left: 50%; z-index: 15; width: 60%; margin-left: -30%; padding-left: 0; list-style: none; text-align: center; } .carousel-indicators li { display: inline-block; width: 10px; height: 10px; margin: 1px; text-indent: -999px; border: 1px solid #ffffff; border-radius: 10px; cursor: pointer; background-color: #000 \9; background-color: rgba(0, 0, 0, 0); } .carousel-indicators .active { margin: 0; width: 12px; height: 12px; background-color: #ffffff; } .carousel-caption { position: absolute; left: 15%; right: 15%; bottom: 20px; z-index: 10; padding-top: 20px; padding-bottom: 20px; color: #ffffff; text-align: center; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); } .carousel-caption .btn { text-shadow: none; } @media screen and (min-width: 768px) { .carousel-control .glyphicon-chevron-left, .carousel-control .glyphicon-chevron-right, .carousel-control .icon-prev, .carousel-control .icon-next { width: 30px; height: 30px; margin-top: -15px; font-size: 30px; } .carousel-control .glyphicon-chevron-left, .carousel-control .icon-prev { margin-left: -15px; } .carousel-control .glyphicon-chevron-right, .carousel-control .icon-next { margin-right: -15px; } .carousel-caption { left: 20%; right: 20%; padding-bottom: 30px; } .carousel-indicators { bottom: 20px; } } .clearfix:before, .clearfix:after, .dl-horizontal dd:before, .dl-horizontal dd:after, .container:before, .container:after, .container-fluid:before, .container-fluid:after, .row:before, .row:after, .form-horizontal .form-group:before, .form-horizontal .form-group:after, .btn-toolbar:before, .btn-toolbar:after, .btn-group-vertical > .btn-group:before, .btn-group-vertical > .btn-group:after, .nav:before, .nav:after, .navbar:before, .navbar:after, .navbar-header:before, .navbar-header:after, .navbar-collapse:before, .navbar-collapse:after, .pager:before, .pager:after, .panel-body:before, .panel-body:after, .modal-footer:before, .modal-footer:after, html.boxed-layout #layout-main-container:before, html.boxed-layout #layout-main-container:after, html.boxed-layout #layout-tripel-container:before, html.boxed-layout #layout-tripel-container:after, html.boxed-layout #layout-footer:before, html.boxed-layout #layout-footer:after, html.fixed-nav.boxed-layout #layout-navigation:before, html.fixed-nav.boxed-layout #layout-navigation:after, html.floating-nav.boxed-layout .navbar-wrapper:before, html.floating-nav.boxed-layout .navbar-wrapper:after, #layout-main:before, #layout-main:after, #layout-tripel:before, #layout-tripel:after, #footer-quad:before, #footer-quad:after, html.sticky-footer.boxed-layout #footer:before, html.sticky-footer.boxed-layout #footer:after, html.orchard-users form:before, html.orchard-users form:after { content: " "; display: table; } .clearfix:after, .dl-horizontal dd:after, .container:after, .container-fluid:after, .row:after, .form-horizontal .form-group:after, .btn-toolbar:after, .btn-group-vertical > .btn-group:after, .nav:after, .navbar:after, .navbar-header:after, .navbar-collapse:after, .pager:after, .panel-body:after, .modal-footer:after, html.boxed-layout #layout-main-container:after, html.boxed-layout #layout-tripel-container:after, html.boxed-layout #layout-footer:after, html.fixed-nav.boxed-layout #layout-navigation:after, html.floating-nav.boxed-layout .navbar-wrapper:after, #layout-main:after, #layout-tripel:after, #footer-quad:after, html.sticky-footer.boxed-layout #footer:after, html.orchard-users form:after { clear: both; } .center-block { display: block; margin-left: auto; margin-right: auto; } .pull-right { float: right !important; } .pull-left { float: left !important; } .hide { display: none !important; } .show { display: block !important; } .invisible { visibility: hidden; } .text-hide { font: 0/0 a; color: transparent; text-shadow: none; background-color: transparent; border: 0; } .hidden { display: none !important; visibility: hidden !important; } .affix { position: fixed; -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); } @-ms-viewport { width: device-width; } .visible-xs, .visible-sm, .visible-md, .visible-lg { display: none !important; } .visible-xs-block, .visible-xs-inline, .visible-xs-inline-block, .visible-sm-block, .visible-sm-inline, .visible-sm-inline-block, .visible-md-block, .visible-md-inline, .visible-md-inline-block, .visible-lg-block, .visible-lg-inline, .visible-lg-inline-block { display: none !important; } @media (max-width: 767px) { .visible-xs { display: block !important; } table.visible-xs { display: table; } tr.visible-xs { display: table-row !important; } th.visible-xs, td.visible-xs { display: table-cell !important; } } @media (max-width: 767px) { .visible-xs-block { display: block !important; } } @media (max-width: 767px) { .visible-xs-inline { display: inline !important; } } @media (max-width: 767px) { .visible-xs-inline-block { display: inline-block !important; } } @media (min-width: 768px) and (max-width: 991px) { .visible-sm { display: block !important; } table.visible-sm { display: table; } tr.visible-sm { display: table-row !important; } th.visible-sm, td.visible-sm { display: table-cell !important; } } @media (min-width: 768px) and (max-width: 991px) { .visible-sm-block { display: block !important; } } @media (min-width: 768px) and (max-width: 991px) { .visible-sm-inline { display: inline !important; } } @media (min-width: 768px) and (max-width: 991px) { .visible-sm-inline-block { display: inline-block !important; } } @media (min-width: 992px) and (max-width: 1199px) { .visible-md { display: block !important; } table.visible-md { display: table; } tr.visible-md { display: table-row !important; } th.visible-md, td.visible-md { display: table-cell !important; } } @media (min-width: 992px) and (max-width: 1199px) { .visible-md-block { display: block !important; } } @media (min-width: 992px) and (max-width: 1199px) { .visible-md-inline { display: inline !important; } } @media (min-width: 992px) and (max-width: 1199px) { .visible-md-inline-block { display: inline-block !important; } } @media (min-width: 1200px) { .visible-lg { display: block !important; } table.visible-lg { display: table; } tr.visible-lg { display: table-row !important; } th.visible-lg, td.visible-lg { display: table-cell !important; } } @media (min-width: 1200px) { .visible-lg-block { display: block !important; } } @media (min-width: 1200px) { .visible-lg-inline { display: inline !important; } } @media (min-width: 1200px) { .visible-lg-inline-block { display: inline-block !important; } } @media (max-width: 767px) { .hidden-xs { display: none !important; } } @media (min-width: 768px) and (max-width: 991px) { .hidden-sm { display: none !important; } } @media (min-width: 992px) and (max-width: 1199px) { .hidden-md { display: none !important; } } @media (min-width: 1200px) { .hidden-lg { display: none !important; } } .visible-print { display: none !important; } @media print { .visible-print { display: block !important; } table.visible-print { display: table; } tr.visible-print { display: table-row !important; } th.visible-print, td.visible-print { display: table-cell !important; } } .visible-print-block { display: none !important; } @media print { .visible-print-block { display: block !important; } } .visible-print-inline { display: none !important; } @media print { .visible-print-inline { display: inline !important; } } .visible-print-inline-block { display: none !important; } @media print { .visible-print-inline-block { display: inline-block !important; } } @media print { .hidden-print { display: none !important; } } /*! * Font Awesome 4.2.0 by @davegandy - http://fontawesome.io - @fontawesome * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) */ /* FONT PATH * -------------------------- */ @font-face { font-family: 'FontAwesome'; src: url('font-awesome-4.2.0/fonts/fontawesome-webfont.eot?v=4.2.0'); src: url('font-awesome-4.2.0/fonts/fontawesome-webfont.eot?#iefix&v=4.2.0') format('embedded-opentype'), url('font-awesome-4.2.0/fonts/fontawesome-webfont.woff?v=4.2.0') format('woff'), url('font-awesome-4.2.0/fonts/fontawesome-webfont.ttf?v=4.2.0') format('truetype'), url('font-awesome-4.2.0/fonts/fontawesome-webfont.svg?v=4.2.0#fontawesomeregular') format('svg'); font-weight: normal; font-style: normal; } .fa { display: inline-block; font: normal normal normal 14px/1 FontAwesome; font-size: inherit; text-rendering: auto; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } /* makes the font 33% larger relative to the icon container */ .fa-lg { font-size: 1.33333333em; line-height: 0.75em; vertical-align: -15%; } .fa-2x { font-size: 2em; } .fa-3x { font-size: 3em; } .fa-4x { font-size: 4em; } .fa-5x { font-size: 5em; } .fa-fw { width: 1.28571429em; text-align: center; } .fa-ul { padding-left: 0; margin-left: 2.14285714em; list-style-type: none; } .fa-ul > li { position: relative; } .fa-li { position: absolute; left: -2.14285714em; width: 2.14285714em; top: 0.14285714em; text-align: center; } .fa-li.fa-lg { left: -1.85714286em; } .fa-border { padding: .2em .25em .15em; border: solid 0.08em #eeeeee; border-radius: .1em; } .pull-right { float: right; } .pull-left { float: left; } .fa.pull-left { margin-right: .3em; } .fa.pull-right { margin-left: .3em; } .fa-spin { -webkit-animation: fa-spin 2s infinite linear; animation: fa-spin 2s infinite linear; } @-webkit-keyframes fa-spin { 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } 100% { -webkit-transform: rotate(359deg); transform: rotate(359deg); } } @keyframes fa-spin { 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } 100% { -webkit-transform: rotate(359deg); transform: rotate(359deg); } } .fa-rotate-90 { filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1); -webkit-transform: rotate(90deg); -ms-transform: rotate(90deg); transform: rotate(90deg); } .fa-rotate-180 { filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2); -webkit-transform: rotate(180deg); -ms-transform: rotate(180deg); transform: rotate(180deg); } .fa-rotate-270 { filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); -webkit-transform: rotate(270deg); -ms-transform: rotate(270deg); transform: rotate(270deg); } .fa-flip-horizontal { filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1); -webkit-transform: scale(-1, 1); -ms-transform: scale(-1, 1); transform: scale(-1, 1); } .fa-flip-vertical { filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1); -webkit-transform: scale(1, -1); -ms-transform: scale(1, -1); transform: scale(1, -1); } :root .fa-rotate-90, :root .fa-rotate-180, :root .fa-rotate-270, :root .fa-flip-horizontal, :root .fa-flip-vertical { filter: none; } .fa-stack { position: relative; display: inline-block; width: 2em; height: 2em; line-height: 2em; vertical-align: middle; } .fa-stack-1x, .fa-stack-2x { position: absolute; left: 0; width: 100%; text-align: center; } .fa-stack-1x { line-height: inherit; } .fa-stack-2x { font-size: 2em; } .fa-inverse { color: #ffffff; } /* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen readers do not read off random characters that represent icons */ .fa-glass:before { content: "\f000"; } .fa-music:before { content: "\f001"; } .fa-search:before { content: "\f002"; } .fa-envelope-o:before { content: "\f003"; } .fa-heart:before { content: "\f004"; } .fa-star:before { content: "\f005"; } .fa-star-o:before { content: "\f006"; } .fa-user:before { content: "\f007"; } .fa-film:before { content: "\f008"; } .fa-th-large:before { content: "\f009"; } .fa-th:before { content: "\f00a"; } .fa-th-list:before { content: "\f00b"; } .fa-check:before { content: "\f00c"; } .fa-remove:before, .fa-close:before, .fa-times:before { content: "\f00d"; } .fa-search-plus:before { content: "\f00e"; } .fa-search-minus:before { content: "\f010"; } .fa-power-off:before { content: "\f011"; } .fa-signal:before { content: "\f012"; } .fa-gear:before, .fa-cog:before { content: "\f013"; } .fa-trash-o:before { content: "\f014"; } .fa-home:before { content: "\f015"; } .fa-file-o:before { content: "\f016"; } .fa-clock-o:before { content: "\f017"; } .fa-road:before { content: "\f018"; } .fa-download:before { content: "\f019"; } .fa-arrow-circle-o-down:before { content: "\f01a"; } .fa-arrow-circle-o-up:before { content: "\f01b"; } .fa-inbox:before { content: "\f01c"; } .fa-play-circle-o:before { content: "\f01d"; } .fa-rotate-right:before, .fa-repeat:before { content: "\f01e"; } .fa-refresh:before { content: "\f021"; } .fa-list-alt:before { content: "\f022"; } .fa-lock:before { content: "\f023"; } .fa-flag:before { content: "\f024"; } .fa-headphones:before { content: "\f025"; } .fa-volume-off:before { content: "\f026"; } .fa-volume-down:before { content: "\f027"; } .fa-volume-up:before { content: "\f028"; } .fa-qrcode:before { content: "\f029"; } .fa-barcode:before { content: "\f02a"; } .fa-tag:before { content: "\f02b"; } .fa-tags:before { content: "\f02c"; } .fa-book:before { content: "\f02d"; } .fa-bookmark:before { content: "\f02e"; } .fa-print:before { content: "\f02f"; } .fa-camera:before { content: "\f030"; } .fa-font:before { content: "\f031"; } .fa-bold:before { content: "\f032"; } .fa-italic:before { content: "\f033"; } .fa-text-height:before { content: "\f034"; } .fa-text-width:before { content: "\f035"; } .fa-align-left:before { content: "\f036"; } .fa-align-center:before { content: "\f037"; } .fa-align-right:before { content: "\f038"; } .fa-align-justify:before { content: "\f039"; } .fa-list:before { content: "\f03a"; } .fa-dedent:before, .fa-outdent:before { content: "\f03b"; } .fa-indent:before { content: "\f03c"; } .fa-video-camera:before { content: "\f03d"; } .fa-photo:before, .fa-image:before, .fa-picture-o:before { content: "\f03e"; } .fa-pencil:before { content: "\f040"; } .fa-map-marker:before { content: "\f041"; } .fa-adjust:before { content: "\f042"; } .fa-tint:before { content: "\f043"; } .fa-edit:before, .fa-pencil-square-o:before { content: "\f044"; } .fa-share-square-o:before { content: "\f045"; } .fa-check-square-o:before { content: "\f046"; } .fa-arrows:before { content: "\f047"; } .fa-step-backward:before { content: "\f048"; } .fa-fast-backward:before { content: "\f049"; } .fa-backward:before { content: "\f04a"; } .fa-play:before { content: "\f04b"; } .fa-pause:before { content: "\f04c"; } .fa-stop:before { content: "\f04d"; } .fa-forward:before { content: "\f04e"; } .fa-fast-forward:before { content: "\f050"; } .fa-step-forward:before { content: "\f051"; } .fa-eject:before { content: "\f052"; } .fa-chevron-left:before { content: "\f053"; } .fa-chevron-right:before { content: "\f054"; } .fa-plus-circle:before { content: "\f055"; } .fa-minus-circle:before { content: "\f056"; } .fa-times-circle:before { content: "\f057"; } .fa-check-circle:before { content: "\f058"; } .fa-question-circle:before { content: "\f059"; } .fa-info-circle:before { content: "\f05a"; } .fa-crosshairs:before { content: "\f05b"; } .fa-times-circle-o:before { content: "\f05c"; } .fa-check-circle-o:before { content: "\f05d"; } .fa-ban:before { content: "\f05e"; } .fa-arrow-left:before { content: "\f060"; } .fa-arrow-right:before { content: "\f061"; } .fa-arrow-up:before { content: "\f062"; } .fa-arrow-down:before { content: "\f063"; } .fa-mail-forward:before, .fa-share:before { content: "\f064"; } .fa-expand:before { content: "\f065"; } .fa-compress:before { content: "\f066"; } .fa-plus:before { content: "\f067"; } .fa-minus:before { content: "\f068"; } .fa-asterisk:before { content: "\f069"; } .fa-exclamation-circle:before { content: "\f06a"; } .fa-gift:before { content: "\f06b"; } .fa-leaf:before { content: "\f06c"; } .fa-fire:before { content: "\f06d"; } .fa-eye:before { content: "\f06e"; } .fa-eye-slash:before { content: "\f070"; } .fa-warning:before, .fa-exclamation-triangle:before { content: "\f071"; } .fa-plane:before { content: "\f072"; } .fa-calendar:before { content: "\f073"; } .fa-random:before { content: "\f074"; } .fa-comment:before { content: "\f075"; } .fa-magnet:before { content: "\f076"; } .fa-chevron-up:before { content: "\f077"; } .fa-chevron-down:before { content: "\f078"; } .fa-retweet:before { content: "\f079"; } .fa-shopping-cart:before { content: "\f07a"; } .fa-folder:before { content: "\f07b"; } .fa-folder-open:before { content: "\f07c"; } .fa-arrows-v:before { content: "\f07d"; } .fa-arrows-h:before { content: "\f07e"; } .fa-bar-chart-o:before, .fa-bar-chart:before { content: "\f080"; } .fa-twitter-square:before { content: "\f081"; } .fa-facebook-square:before { content: "\f082"; } .fa-camera-retro:before { content: "\f083"; } .fa-key:before { content: "\f084"; } .fa-gears:before, .fa-cogs:before { content: "\f085"; } .fa-comments:before { content: "\f086"; } .fa-thumbs-o-up:before { content: "\f087"; } .fa-thumbs-o-down:before { content: "\f088"; } .fa-star-half:before { content: "\f089"; } .fa-heart-o:before { content: "\f08a"; } .fa-sign-out:before { content: "\f08b"; } .fa-linkedin-square:before { content: "\f08c"; } .fa-thumb-tack:before { content: "\f08d"; } .fa-external-link:before { content: "\f08e"; } .fa-sign-in:before { content: "\f090"; } .fa-trophy:before { content: "\f091"; } .fa-github-square:before { content: "\f092"; } .fa-upload:before { content: "\f093"; } .fa-lemon-o:before { content: "\f094"; } .fa-phone:before { content: "\f095"; } .fa-square-o:before { content: "\f096"; } .fa-bookmark-o:before { content: "\f097"; } .fa-phone-square:before { content: "\f098"; } .fa-twitter:before { content: "\f099"; } .fa-facebook:before { content: "\f09a"; } .fa-github:before { content: "\f09b"; } .fa-unlock:before { content: "\f09c"; } .fa-credit-card:before { content: "\f09d"; } .fa-rss:before { content: "\f09e"; } .fa-hdd-o:before { content: "\f0a0"; } .fa-bullhorn:before { content: "\f0a1"; } .fa-bell:before { content: "\f0f3"; } .fa-certificate:before { content: "\f0a3"; } .fa-hand-o-right:before { content: "\f0a4"; } .fa-hand-o-left:before { content: "\f0a5"; } .fa-hand-o-up:before { content: "\f0a6"; } .fa-hand-o-down:before { content: "\f0a7"; } .fa-arrow-circle-left:before { content: "\f0a8"; } .fa-arrow-circle-right:before { content: "\f0a9"; } .fa-arrow-circle-up:before { content: "\f0aa"; } .fa-arrow-circle-down:before { content: "\f0ab"; } .fa-globe:before { content: "\f0ac"; } .fa-wrench:before { content: "\f0ad"; } .fa-tasks:before { content: "\f0ae"; } .fa-filter:before { content: "\f0b0"; } .fa-briefcase:before { content: "\f0b1"; } .fa-arrows-alt:before { content: "\f0b2"; } .fa-group:before, .fa-users:before { content: "\f0c0"; } .fa-chain:before, .fa-link:before { content: "\f0c1"; } .fa-cloud:before { content: "\f0c2"; } .fa-flask:before { content: "\f0c3"; } .fa-cut:before, .fa-scissors:before { content: "\f0c4"; } .fa-copy:before, .fa-files-o:before { content: "\f0c5"; } .fa-paperclip:before { content: "\f0c6"; } .fa-save:before, .fa-floppy-o:before { content: "\f0c7"; } .fa-square:before { content: "\f0c8"; } .fa-navicon:before, .fa-reorder:before, .fa-bars:before { content: "\f0c9"; } .fa-list-ul:before { content: "\f0ca"; } .fa-list-ol:before { content: "\f0cb"; } .fa-strikethrough:before { content: "\f0cc"; } .fa-underline:before { content: "\f0cd"; } .fa-table:before { content: "\f0ce"; } .fa-magic:before { content: "\f0d0"; } .fa-truck:before { content: "\f0d1"; } .fa-pinterest:before { content: "\f0d2"; } .fa-pinterest-square:before { content: "\f0d3"; } .fa-google-plus-square:before { content: "\f0d4"; } .fa-google-plus:before { content: "\f0d5"; } .fa-money:before { content: "\f0d6"; } .fa-caret-down:before { content: "\f0d7"; } .fa-caret-up:before { content: "\f0d8"; } .fa-caret-left:before { content: "\f0d9"; } .fa-caret-right:before { content: "\f0da"; } .fa-columns:before { content: "\f0db"; } .fa-unsorted:before, .fa-sort:before { content: "\f0dc"; } .fa-sort-down:before, .fa-sort-desc:before { content: "\f0dd"; } .fa-sort-up:before, .fa-sort-asc:before { content: "\f0de"; } .fa-envelope:before { content: "\f0e0"; } .fa-linkedin:before { content: "\f0e1"; } .fa-rotate-left:before, .fa-undo:before { content: "\f0e2"; } .fa-legal:before, .fa-gavel:before { content: "\f0e3"; } .fa-dashboard:before, .fa-tachometer:before { content: "\f0e4"; } .fa-comment-o:before { content: "\f0e5"; } .fa-comments-o:before { content: "\f0e6"; } .fa-flash:before, .fa-bolt:before { content: "\f0e7"; } .fa-sitemap:before { content: "\f0e8"; } .fa-umbrella:before { content: "\f0e9"; } .fa-paste:before, .fa-clipboard:before { content: "\f0ea"; } .fa-lightbulb-o:before { content: "\f0eb"; } .fa-exchange:before { content: "\f0ec"; } .fa-cloud-download:before { content: "\f0ed"; } .fa-cloud-upload:before { content: "\f0ee"; } .fa-user-md:before { content: "\f0f0"; } .fa-stethoscope:before { content: "\f0f1"; } .fa-suitcase:before { content: "\f0f2"; } .fa-bell-o:before { content: "\f0a2"; } .fa-coffee:before { content: "\f0f4"; } .fa-cutlery:before { content: "\f0f5"; } .fa-file-text-o:before { content: "\f0f6"; } .fa-building-o:before { content: "\f0f7"; } .fa-hospital-o:before { content: "\f0f8"; } .fa-ambulance:before { content: "\f0f9"; } .fa-medkit:before { content: "\f0fa"; } .fa-fighter-jet:before { content: "\f0fb"; } .fa-beer:before { content: "\f0fc"; } .fa-h-square:before { content: "\f0fd"; } .fa-plus-square:before { content: "\f0fe"; } .fa-angle-double-left:before { content: "\f100"; } .fa-angle-double-right:before { content: "\f101"; } .fa-angle-double-up:before { content: "\f102"; } .fa-angle-double-down:before { content: "\f103"; } .fa-angle-left:before { content: "\f104"; } .fa-angle-right:before { content: "\f105"; } .fa-angle-up:before { content: "\f106"; } .fa-angle-down:before { content: "\f107"; } .fa-desktop:before { content: "\f108"; } .fa-laptop:before { content: "\f109"; } .fa-tablet:before { content: "\f10a"; } .fa-mobile-phone:before, .fa-mobile:before { content: "\f10b"; } .fa-circle-o:before { content: "\f10c"; } .fa-quote-left:before { content: "\f10d"; } .fa-quote-right:before { content: "\f10e"; } .fa-spinner:before { content: "\f110"; } .fa-circle:before { content: "\f111"; } .fa-mail-reply:before, .fa-reply:before { content: "\f112"; } .fa-github-alt:before { content: "\f113"; } .fa-folder-o:before { content: "\f114"; } .fa-folder-open-o:before { content: "\f115"; } .fa-smile-o:before { content: "\f118"; } .fa-frown-o:before { content: "\f119"; } .fa-meh-o:before { content: "\f11a"; } .fa-gamepad:before { content: "\f11b"; } .fa-keyboard-o:before { content: "\f11c"; } .fa-flag-o:before { content: "\f11d"; } .fa-flag-checkered:before { content: "\f11e"; } .fa-terminal:before { content: "\f120"; } .fa-code:before { content: "\f121"; } .fa-mail-reply-all:before, .fa-reply-all:before { content: "\f122"; } .fa-star-half-empty:before, .fa-star-half-full:before, .fa-star-half-o:before { content: "\f123"; } .fa-location-arrow:before { content: "\f124"; } .fa-crop:before { content: "\f125"; } .fa-code-fork:before { content: "\f126"; } .fa-unlink:before, .fa-chain-broken:before { content: "\f127"; } .fa-question:before { content: "\f128"; } .fa-info:before { content: "\f129"; } .fa-exclamation:before { content: "\f12a"; } .fa-superscript:before { content: "\f12b"; } .fa-subscript:before { content: "\f12c"; } .fa-eraser:before { content: "\f12d"; } .fa-puzzle-piece:before { content: "\f12e"; } .fa-microphone:before { content: "\f130"; } .fa-microphone-slash:before { content: "\f131"; } .fa-shield:before { content: "\f132"; } .fa-calendar-o:before { content: "\f133"; } .fa-fire-extinguisher:before { content: "\f134"; } .fa-rocket:before { content: "\f135"; } .fa-maxcdn:before { content: "\f136"; } .fa-chevron-circle-left:before { content: "\f137"; } .fa-chevron-circle-right:before { content: "\f138"; } .fa-chevron-circle-up:before { content: "\f139"; } .fa-chevron-circle-down:before { content: "\f13a"; } .fa-html5:before { content: "\f13b"; } .fa-css3:before { content: "\f13c"; } .fa-anchor:before { content: "\f13d"; } .fa-unlock-alt:before { content: "\f13e"; } .fa-bullseye:before { content: "\f140"; } .fa-ellipsis-h:before { content: "\f141"; } .fa-ellipsis-v:before { content: "\f142"; } .fa-rss-square:before { content: "\f143"; } .fa-play-circle:before { content: "\f144"; } .fa-ticket:before { content: "\f145"; } .fa-minus-square:before { content: "\f146"; } .fa-minus-square-o:before { content: "\f147"; } .fa-level-up:before { content: "\f148"; } .fa-level-down:before { content: "\f149"; } .fa-check-square:before { content: "\f14a"; } .fa-pencil-square:before { content: "\f14b"; } .fa-external-link-square:before { content: "\f14c"; } .fa-share-square:before { content: "\f14d"; } .fa-compass:before { content: "\f14e"; } .fa-toggle-down:before, .fa-caret-square-o-down:before { content: "\f150"; } .fa-toggle-up:before, .fa-caret-square-o-up:before { content: "\f151"; } .fa-toggle-right:before, .fa-caret-square-o-right:before { content: "\f152"; } .fa-euro:before, .fa-eur:before { content: "\f153"; } .fa-gbp:before { content: "\f154"; } .fa-dollar:before, .fa-usd:before { content: "\f155"; } .fa-rupee:before, .fa-inr:before { content: "\f156"; } .fa-cny:before, .fa-rmb:before, .fa-yen:before, .fa-jpy:before { content: "\f157"; } .fa-ruble:before, .fa-rouble:before, .fa-rub:before { content: "\f158"; } .fa-won:before, .fa-krw:before { content: "\f159"; } .fa-bitcoin:before, .fa-btc:before { content: "\f15a"; } .fa-file:before { content: "\f15b"; } .fa-file-text:before { content: "\f15c"; } .fa-sort-alpha-asc:before { content: "\f15d"; } .fa-sort-alpha-desc:before { content: "\f15e"; } .fa-sort-amount-asc:before { content: "\f160"; } .fa-sort-amount-desc:before { content: "\f161"; } .fa-sort-numeric-asc:before { content: "\f162"; } .fa-sort-numeric-desc:before { content: "\f163"; } .fa-thumbs-up:before { content: "\f164"; } .fa-thumbs-down:before { content: "\f165"; } .fa-youtube-square:before { content: "\f166"; } .fa-youtube:before { content: "\f167"; } .fa-xing:before { content: "\f168"; } .fa-xing-square:before { content: "\f169"; } .fa-youtube-play:before { content: "\f16a"; } .fa-dropbox:before { content: "\f16b"; } .fa-stack-overflow:before { content: "\f16c"; } .fa-instagram:before { content: "\f16d"; } .fa-flickr:before { content: "\f16e"; } .fa-adn:before { content: "\f170"; } .fa-bitbucket:before { content: "\f171"; } .fa-bitbucket-square:before { content: "\f172"; } .fa-tumblr:before { content: "\f173"; } .fa-tumblr-square:before { content: "\f174"; } .fa-long-arrow-down:before { content: "\f175"; } .fa-long-arrow-up:before { content: "\f176"; } .fa-long-arrow-left:before { content: "\f177"; } .fa-long-arrow-right:before { content: "\f178"; } .fa-apple:before { content: "\f179"; } .fa-windows:before { content: "\f17a"; } .fa-android:before { content: "\f17b"; } .fa-linux:before { content: "\f17c"; } .fa-dribbble:before { content: "\f17d"; } .fa-skype:before { content: "\f17e"; } .fa-foursquare:before { content: "\f180"; } .fa-trello:before { content: "\f181"; } .fa-female:before { content: "\f182"; } .fa-male:before { content: "\f183"; } .fa-gittip:before { content: "\f184"; } .fa-sun-o:before { content: "\f185"; } .fa-moon-o:before { content: "\f186"; } .fa-archive:before { content: "\f187"; } .fa-bug:before { content: "\f188"; } .fa-vk:before { content: "\f189"; } .fa-weibo:before { content: "\f18a"; } .fa-renren:before { content: "\f18b"; } .fa-pagelines:before { content: "\f18c"; } .fa-stack-exchange:before { content: "\f18d"; } .fa-arrow-circle-o-right:before { content: "\f18e"; } .fa-arrow-circle-o-left:before { content: "\f190"; } .fa-toggle-left:before, .fa-caret-square-o-left:before { content: "\f191"; } .fa-dot-circle-o:before { content: "\f192"; } .fa-wheelchair:before { content: "\f193"; } .fa-vimeo-square:before { content: "\f194"; } .fa-turkish-lira:before, .fa-try:before { content: "\f195"; } .fa-plus-square-o:before { content: "\f196"; } .fa-space-shuttle:before { content: "\f197"; } .fa-slack:before { content: "\f198"; } .fa-envelope-square:before { content: "\f199"; } .fa-wordpress:before { content: "\f19a"; } .fa-openid:before { content: "\f19b"; } .fa-institution:before, .fa-bank:before, .fa-university:before { content: "\f19c"; } .fa-mortar-board:before, .fa-graduation-cap:before { content: "\f19d"; } .fa-yahoo:before { content: "\f19e"; } .fa-google:before { content: "\f1a0"; } .fa-reddit:before { content: "\f1a1"; } .fa-reddit-square:before { content: "\f1a2"; } .fa-stumbleupon-circle:before { content: "\f1a3"; } .fa-stumbleupon:before { content: "\f1a4"; } .fa-delicious:before { content: "\f1a5"; } .fa-digg:before { content: "\f1a6"; } .fa-pied-piper:before { content: "\f1a7"; } .fa-pied-piper-alt:before { content: "\f1a8"; } .fa-drupal:before { content: "\f1a9"; } .fa-joomla:before { content: "\f1aa"; } .fa-language:before { content: "\f1ab"; } .fa-fax:before { content: "\f1ac"; } .fa-building:before { content: "\f1ad"; } .fa-child:before { content: "\f1ae"; } .fa-paw:before { content: "\f1b0"; } .fa-spoon:before { content: "\f1b1"; } .fa-cube:before { content: "\f1b2"; } .fa-cubes:before { content: "\f1b3"; } .fa-behance:before { content: "\f1b4"; } .fa-behance-square:before { content: "\f1b5"; } .fa-steam:before { content: "\f1b6"; } .fa-steam-square:before { content: "\f1b7"; } .fa-recycle:before { content: "\f1b8"; } .fa-automobile:before, .fa-car:before { content: "\f1b9"; } .fa-cab:before, .fa-taxi:before { content: "\f1ba"; } .fa-tree:before { content: "\f1bb"; } .fa-spotify:before { content: "\f1bc"; } .fa-deviantart:before { content: "\f1bd"; } .fa-soundcloud:before { content: "\f1be"; } .fa-database:before { content: "\f1c0"; } .fa-file-pdf-o:before { content: "\f1c1"; } .fa-file-word-o:before { content: "\f1c2"; } .fa-file-excel-o:before { content: "\f1c3"; } .fa-file-powerpoint-o:before { content: "\f1c4"; } .fa-file-photo-o:before, .fa-file-picture-o:before, .fa-file-image-o:before { content: "\f1c5"; } .fa-file-zip-o:before, .fa-file-archive-o:before { content: "\f1c6"; } .fa-file-sound-o:before, .fa-file-audio-o:before { content: "\f1c7"; } .fa-file-movie-o:before, .fa-file-video-o:before { content: "\f1c8"; } .fa-file-code-o:before { content: "\f1c9"; } .fa-vine:before { content: "\f1ca"; } .fa-codepen:before { content: "\f1cb"; } .fa-jsfiddle:before { content: "\f1cc"; } .fa-life-bouy:before, .fa-life-buoy:before, .fa-life-saver:before, .fa-support:before, .fa-life-ring:before { content: "\f1cd"; } .fa-circle-o-notch:before { content: "\f1ce"; } .fa-ra:before, .fa-rebel:before { content: "\f1d0"; } .fa-ge:before, .fa-empire:before { content: "\f1d1"; } .fa-git-square:before { content: "\f1d2"; } .fa-git:before { content: "\f1d3"; } .fa-hacker-news:before { content: "\f1d4"; } .fa-tencent-weibo:before { content: "\f1d5"; } .fa-qq:before { content: "\f1d6"; } .fa-wechat:before, .fa-weixin:before { content: "\f1d7"; } .fa-send:before, .fa-paper-plane:before { content: "\f1d8"; } .fa-send-o:before, .fa-paper-plane-o:before { content: "\f1d9"; } .fa-history:before { content: "\f1da"; } .fa-circle-thin:before { content: "\f1db"; } .fa-header:before { content: "\f1dc"; } .fa-paragraph:before { content: "\f1dd"; } .fa-sliders:before { content: "\f1de"; } .fa-share-alt:before { content: "\f1e0"; } .fa-share-alt-square:before { content: "\f1e1"; } .fa-bomb:before { content: "\f1e2"; } .fa-soccer-ball-o:before, .fa-futbol-o:before { content: "\f1e3"; } .fa-tty:before { content: "\f1e4"; } .fa-binoculars:before { content: "\f1e5"; } .fa-plug:before { content: "\f1e6"; } .fa-slideshare:before { content: "\f1e7"; } .fa-twitch:before { content: "\f1e8"; } .fa-yelp:before { content: "\f1e9"; } .fa-newspaper-o:before { content: "\f1ea"; } .fa-wifi:before { content: "\f1eb"; } .fa-calculator:before { content: "\f1ec"; } .fa-paypal:before { content: "\f1ed"; } .fa-google-wallet:before { content: "\f1ee"; } .fa-cc-visa:before { content: "\f1f0"; } .fa-cc-mastercard:before { content: "\f1f1"; } .fa-cc-discover:before { content: "\f1f2"; } .fa-cc-amex:before { content: "\f1f3"; } .fa-cc-paypal:before { content: "\f1f4"; } .fa-cc-stripe:before { content: "\f1f5"; } .fa-bell-slash:before { content: "\f1f6"; } .fa-bell-slash-o:before { content: "\f1f7"; } .fa-trash:before { content: "\f1f8"; } .fa-copyright:before { content: "\f1f9"; } .fa-at:before { content: "\f1fa"; } .fa-eyedropper:before { content: "\f1fb"; } .fa-paint-brush:before { content: "\f1fc"; } .fa-birthday-cake:before { content: "\f1fd"; } .fa-area-chart:before { content: "\f1fe"; } .fa-pie-chart:before { content: "\f200"; } .fa-line-chart:before { content: "\f201"; } .fa-lastfm:before { content: "\f202"; } .fa-lastfm-square:before { content: "\f203"; } .fa-toggle-off:before { content: "\f204"; } .fa-toggle-on:before { content: "\f205"; } .fa-bicycle:before { content: "\f206"; } .fa-bus:before { content: "\f207"; } .fa-ioxhost:before { content: "\f208"; } .fa-angellist:before { content: "\f209"; } .fa-cc:before { content: "\f20a"; } .fa-shekel:before, .fa-sheqel:before, .fa-ils:before { content: "\f20b"; } .fa-meanpath:before { content: "\f20c"; } html.boxed-layout #layout-main-container, html.boxed-layout #layout-tripel-container, html.boxed-layout #layout-footer { margin-right: auto; margin-left: auto; padding-left: 15px; padding-right: 15px; } @media (min-width: 768px) { html.boxed-layout #layout-main-container, html.boxed-layout #layout-tripel-container, html.boxed-layout #layout-footer { width: 750px; } } @media (min-width: 992px) { html.boxed-layout #layout-main-container, html.boxed-layout #layout-tripel-container, html.boxed-layout #layout-footer { width: 970px; } } @media (min-width: 1200px) { html.boxed-layout #layout-main-container, html.boxed-layout #layout-tripel-container, html.boxed-layout #layout-footer { width: 1170px; } } html.boxed-layout #layout-main-container > .navbar-header, html.boxed-layout #layout-tripel-container > .navbar-header, html.boxed-layout #layout-footer > .navbar-header, html.boxed-layout #layout-main-container > .navbar-collapse, html.boxed-layout #layout-tripel-container > .navbar-collapse, html.boxed-layout #layout-footer > .navbar-collapse { margin-right: -15px; margin-left: -15px; } @media (min-width: 768px) { html.boxed-layout #layout-main-container > .navbar-header, html.boxed-layout #layout-tripel-container > .navbar-header, html.boxed-layout #layout-footer > .navbar-header, html.boxed-layout #layout-main-container > .navbar-collapse, html.boxed-layout #layout-tripel-container > .navbar-collapse, html.boxed-layout #layout-footer > .navbar-collapse { margin-right: 0; margin-left: 0; } } html.fluid-layout #layout-main-container, html.fluid-layout #layout-tripel-container, html.fluid-layout #layout-footer { padding: 0 15px; } html.fixed-nav.boxed-layout #layout-navigation { margin-right: auto; margin-left: auto; padding-left: 15px; padding-right: 15px; } @media (min-width: 768px) { html.fixed-nav.boxed-layout #layout-navigation { width: 750px; } } @media (min-width: 992px) { html.fixed-nav.boxed-layout #layout-navigation { width: 970px; } } @media (min-width: 1200px) { html.fixed-nav.boxed-layout #layout-navigation { width: 1170px; } } html.fixed-nav.boxed-layout #layout-navigation > .navbar-header, html.fixed-nav.boxed-layout #layout-navigation > .navbar-collapse { margin-right: -15px; margin-left: -15px; } @media (min-width: 768px) { html.fixed-nav.boxed-layout #layout-navigation > .navbar-header, html.fixed-nav.boxed-layout #layout-navigation > .navbar-collapse { margin-right: 0; margin-left: 0; } } html.fixed-nav.fluid-layout #layout-navigation { padding: 0 15px; } html.floating-nav #layout-navigation { position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; } @media (min-width: 992px) { html.floating-nav #layout-navigation { float: left; width: 100%; } } html.floating-nav.boxed-layout .navbar-wrapper { margin-right: auto; margin-left: auto; padding-left: 15px; padding-right: 15px; } @media (min-width: 768px) { html.floating-nav.boxed-layout .navbar-wrapper { width: 750px; } } @media (min-width: 992px) { html.floating-nav.boxed-layout .navbar-wrapper { width: 970px; } } @media (min-width: 1200px) { html.floating-nav.boxed-layout .navbar-wrapper { width: 1170px; } } html.floating-nav.boxed-layout .navbar-wrapper > .navbar-header, html.floating-nav.boxed-layout .navbar-wrapper > .navbar-collapse { margin-right: -15px; margin-left: -15px; } @media (min-width: 768px) { html.floating-nav.boxed-layout .navbar-wrapper > .navbar-header, html.floating-nav.boxed-layout .navbar-wrapper > .navbar-collapse { margin-right: 0; margin-left: 0; } } html.floating-nav.fluid-layout .navbar-wrapper { padding: 0 15px; } #layout-main, #layout-tripel, #footer-quad { margin-left: -15px; margin-right: -15px; } #layout-content { position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; } @media (min-width: 992px) { #layout-content { float: left; width: 100%; } } .aside-1 #layout-content, .aside-2 #layout-content { position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; } @media (min-width: 992px) { .aside-1 #layout-content, .aside-2 #layout-content { float: left; width: 75%; } } .aside-12 #layout-content { position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; } @media (min-width: 992px) { .aside-12 #layout-content { float: left; width: 50%; } } #aside-first, #aside-second { position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; } @media (min-width: 992px) { #aside-first, #aside-second { float: left; width: 25%; } } .tripel-1 #tripel-first, .tripel-2 #tripel-first, .tripel-3 #tripel-first, .tripel-1 #tripel-second, .tripel-2 #tripel-second, .tripel-3 #tripel-second, .tripel-1 #tripel-third, .tripel-2 #tripel-third, .tripel-3 #tripel-third { position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; } @media (min-width: 992px) { .tripel-1 #tripel-first, .tripel-2 #tripel-first, .tripel-3 #tripel-first, .tripel-1 #tripel-second, .tripel-2 #tripel-second, .tripel-3 #tripel-second, .tripel-1 #tripel-third, .tripel-2 #tripel-third, .tripel-3 #tripel-third { float: left; width: 100%; } } .tripel-12 #tripel-first, .tripel-13 #tripel-first, .tripel-23 #tripel-first, .tripel-12 #tripel-second, .tripel-13 #tripel-second, .tripel-23 #tripel-second, .tripel-12 #tripel-third, .tripel-13 #tripel-third, .tripel-23 #tripel-third { position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; } @media (min-width: 992px) { .tripel-12 #tripel-first, .tripel-13 #tripel-first, .tripel-23 #tripel-first, .tripel-12 #tripel-second, .tripel-13 #tripel-second, .tripel-23 #tripel-second, .tripel-12 #tripel-third, .tripel-13 #tripel-third, .tripel-23 #tripel-third { float: left; width: 50%; } } .tripel-123 #tripel-first, .tripel-123 #tripel-second, .tripel-123 #tripel-third { position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; } @media (min-width: 992px) { .tripel-123 #tripel-first, .tripel-123 #tripel-second, .tripel-123 #tripel-third { float: left; width: 33.33333333%; } } .split-1 + #layout-footer #footer-quad-first, .split-2 + #layout-footer #footer-quad-first, .split-3 + #layout-footer #footer-quad-first, .split-4 + #layout-footer #footer-quad-first, .split-1 + #layout-footer #footer-quad-second, .split-2 + #layout-footer #footer-quad-second, .split-3 + #layout-footer #footer-quad-second, .split-4 + #layout-footer #footer-quad-second, .split-1 + #layout-footer #footer-quad-third, .split-2 + #layout-footer #footer-quad-third, .split-3 + #layout-footer #footer-quad-third, .split-4 + #layout-footer #footer-quad-third, .split-1 + #layout-footer #footer-quad-fourth, .split-2 + #layout-footer #footer-quad-fourth, .split-3 + #layout-footer #footer-quad-fourth, .split-4 + #layout-footer #footer-quad-fourth { position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; } @media (min-width: 992px) { .split-1 + #layout-footer #footer-quad-first, .split-2 + #layout-footer #footer-quad-first, .split-3 + #layout-footer #footer-quad-first, .split-4 + #layout-footer #footer-quad-first, .split-1 + #layout-footer #footer-quad-second, .split-2 + #layout-footer #footer-quad-second, .split-3 + #layout-footer #footer-quad-second, .split-4 + #layout-footer #footer-quad-second, .split-1 + #layout-footer #footer-quad-third, .split-2 + #layout-footer #footer-quad-third, .split-3 + #layout-footer #footer-quad-third, .split-4 + #layout-footer #footer-quad-third, .split-1 + #layout-footer #footer-quad-fourth, .split-2 + #layout-footer #footer-quad-fourth, .split-3 + #layout-footer #footer-quad-fourth, .split-4 + #layout-footer #footer-quad-fourth { float: left; width: 100%; } } .split-12 + #layout-footer #footer-quad-first, .split-13 + #layout-footer #footer-quad-first, .split-14 + #layout-footer #footer-quad-first, .split-23 + #layout-footer #footer-quad-first, .split-24 + #layout-footer #footer-quad-first, .split-34 + #layout-footer #footer-quad-first, .split-12 + #layout-footer #footer-quad-second, .split-13 + #layout-footer #footer-quad-second, .split-14 + #layout-footer #footer-quad-second, .split-23 + #layout-footer #footer-quad-second, .split-24 + #layout-footer #footer-quad-second, .split-34 + #layout-footer #footer-quad-second, .split-12 + #layout-footer #footer-quad-third, .split-13 + #layout-footer #footer-quad-third, .split-14 + #layout-footer #footer-quad-third, .split-23 + #layout-footer #footer-quad-third, .split-24 + #layout-footer #footer-quad-third, .split-34 + #layout-footer #footer-quad-third, .split-12 + #layout-footer #footer-quad-fourth, .split-13 + #layout-footer #footer-quad-fourth, .split-14 + #layout-footer #footer-quad-fourth, .split-23 + #layout-footer #footer-quad-fourth, .split-24 + #layout-footer #footer-quad-fourth, .split-34 + #layout-footer #footer-quad-fourth { position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; } @media (min-width: 992px) { .split-12 + #layout-footer #footer-quad-first, .split-13 + #layout-footer #footer-quad-first, .split-14 + #layout-footer #footer-quad-first, .split-23 + #layout-footer #footer-quad-first, .split-24 + #layout-footer #footer-quad-first, .split-34 + #layout-footer #footer-quad-first, .split-12 + #layout-footer #footer-quad-second, .split-13 + #layout-footer #footer-quad-second, .split-14 + #layout-footer #footer-quad-second, .split-23 + #layout-footer #footer-quad-second, .split-24 + #layout-footer #footer-quad-second, .split-34 + #layout-footer #footer-quad-second, .split-12 + #layout-footer #footer-quad-third, .split-13 + #layout-footer #footer-quad-third, .split-14 + #layout-footer #footer-quad-third, .split-23 + #layout-footer #footer-quad-third, .split-24 + #layout-footer #footer-quad-third, .split-34 + #layout-footer #footer-quad-third, .split-12 + #layout-footer #footer-quad-fourth, .split-13 + #layout-footer #footer-quad-fourth, .split-14 + #layout-footer #footer-quad-fourth, .split-23 + #layout-footer #footer-quad-fourth, .split-24 + #layout-footer #footer-quad-fourth, .split-34 + #layout-footer #footer-quad-fourth { float: left; width: 50%; } } .split-123 + #layout-footer #footer-quad-first, .split-124 + #layout-footer #footer-quad-first, .split-134 + #layout-footer #footer-quad-first, .split-234 + #layout-footer #footer-quad-first, .split-123 + #layout-footer #footer-quad-second, .split-124 + #layout-footer #footer-quad-second, .split-134 + #layout-footer #footer-quad-second, .split-234 + #layout-footer #footer-quad-second, .split-123 + #layout-footer #footer-quad-third, .split-124 + #layout-footer #footer-quad-third, .split-134 + #layout-footer #footer-quad-third, .split-234 + #layout-footer #footer-quad-third, .split-123 + #layout-footer #footer-quad-fourth, .split-124 + #layout-footer #footer-quad-fourth, .split-134 + #layout-footer #footer-quad-fourth, .split-234 + #layout-footer #footer-quad-fourth { position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; } @media (min-width: 992px) { .split-123 + #layout-footer #footer-quad-first, .split-124 + #layout-footer #footer-quad-first, .split-134 + #layout-footer #footer-quad-first, .split-234 + #layout-footer #footer-quad-first, .split-123 + #layout-footer #footer-quad-second, .split-124 + #layout-footer #footer-quad-second, .split-134 + #layout-footer #footer-quad-second, .split-234 + #layout-footer #footer-quad-second, .split-123 + #layout-footer #footer-quad-third, .split-124 + #layout-footer #footer-quad-third, .split-134 + #layout-footer #footer-quad-third, .split-234 + #layout-footer #footer-quad-third, .split-123 + #layout-footer #footer-quad-fourth, .split-124 + #layout-footer #footer-quad-fourth, .split-134 + #layout-footer #footer-quad-fourth, .split-234 + #layout-footer #footer-quad-fourth { float: left; width: 33.33333333%; } } .split-1234 + #layout-footer #footer-quad-first, .split-1234 + #layout-footer #footer-quad-second, .split-1234 + #layout-footer #footer-quad-third, .split-1234 + #layout-footer #footer-quad-fourth { position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; } @media (min-width: 992px) { .split-1234 + #layout-footer #footer-quad-first, .split-1234 + #layout-footer #footer-quad-second, .split-1234 + #layout-footer #footer-quad-third, .split-1234 + #layout-footer #footer-quad-fourth { float: left; width: 25%; } } html.sticky-footer { min-height: 100%; position: relative; } html.sticky-footer #layout-footer { position: absolute; bottom: 0; width: 100%; } html.sticky-footer.boxed-layout #footer { margin-right: auto; margin-left: auto; padding-left: 15px; padding-right: 15px; } @media (min-width: 768px) { html.sticky-footer.boxed-layout #footer { width: 750px; } } @media (min-width: 992px) { html.sticky-footer.boxed-layout #footer { width: 970px; } } @media (min-width: 1200px) { html.sticky-footer.boxed-layout #footer { width: 1170px; } } html.sticky-footer.boxed-layout #footer > .navbar-header, html.sticky-footer.boxed-layout #footer > .navbar-collapse { margin-right: -15px; margin-left: -15px; } @media (min-width: 768px) { html.sticky-footer.boxed-layout #footer > .navbar-header, html.sticky-footer.boxed-layout #footer > .navbar-collapse { margin-right: 0; margin-left: 0; } } html.sticky-footer.fluid-layout #footer { padding: 0 15px; } .carousel-control .fa-chevron-left { width: 30px; height: 30px; margin-top: -15px; margin-left: -15px; font-size: 30px; left: 50%; position: absolute; top: 50%; z-index: 5; display: inline-block; } .carousel-control .fa-chevron-right { width: 30px; height: 30px; margin-top: -15px; margin-left: -15px; font-size: 30px; right: 50%; position: absolute; top: 50%; z-index: 5; display: inline-block; } .media .comment-avatar { margin-right: 10px; } ul.comments li { margin-top: 40px; } #toTop { position: fixed; right: 5px; bottom: 10px; cursor: pointer; display: none; text-align: center; z-index: 500; } #toTop:hover { opacity: .7; } /* add user icon before menu */ .menuUserName > a:before { content: "\f007"; font-family: "FontAwesome"; margin-right: 5px; } .widget-search-form { float: none !important; } .dropdown-menu ul { left: 100%; top: 0; } .dropdown .dropdown:hover > .dropdown-menu, .dropdown .dropdown .dropdown:hover > .dropdown-menu, .dropdown .dropdown .dropdown .dropdown:hover > .dropdown-menu, .dropdown .dropdown .dropdown .dropdown .dropdown:hover > .dropdown-menu { display: block; } .dropdown-menu i { line-height: 1.42857143; } .navbar-brand { padding-left: 0; } fieldset > div { margin-bottom: 15px; } input[type="color"], input[type="date"], input[type="datetime"], input[type="datetime-local"], input[type="email"], input[type="file"], input[type="month"], input[type="number"], input[type="password"], input[type="range"], input[type="search"], input[type="tel"], input[type="text"], input[type="time"], input[type="url"], input[type="week"], select, textarea { display: block; width: 100%; height: 34px; padding: 6px 12px; font-size: 14px; line-height: 1.42857143; color: #555555; background-color: #ffffff; background-image: none; border: 1px solid #cccccc; border-radius: 4px; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; } input[type="color"]:focus, input[type="date"]:focus, input[type="datetime"]:focus, input[type="datetime-local"]:focus, input[type="email"]:focus, input[type="file"]:focus, input[type="month"]:focus, input[type="number"]:focus, input[type="password"]:focus, input[type="range"]:focus, input[type="search"]:focus, input[type="tel"]:focus, input[type="text"]:focus, input[type="time"]:focus, input[type="url"]:focus, input[type="week"]:focus, select:focus, textarea:focus { border-color: #66afe9; outline: 0; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6); box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6); } input[type="color"]::-moz-placeholder, input[type="date"]::-moz-placeholder, input[type="datetime"]::-moz-placeholder, input[type="datetime-local"]::-moz-placeholder, input[type="email"]::-moz-placeholder, input[type="file"]::-moz-placeholder, input[type="month"]::-moz-placeholder, input[type="number"]::-moz-placeholder, input[type="password"]::-moz-placeholder, input[type="range"]::-moz-placeholder, input[type="search"]::-moz-placeholder, input[type="tel"]::-moz-placeholder, input[type="text"]::-moz-placeholder, input[type="time"]::-moz-placeholder, input[type="url"]::-moz-placeholder, input[type="week"]::-moz-placeholder, select::-moz-placeholder, textarea::-moz-placeholder { color: #777777; opacity: 1; } input[type="color"]:-ms-input-placeholder, input[type="date"]:-ms-input-placeholder, input[type="datetime"]:-ms-input-placeholder, input[type="datetime-local"]:-ms-input-placeholder, input[type="email"]:-ms-input-placeholder, input[type="file"]:-ms-input-placeholder, input[type="month"]:-ms-input-placeholder, input[type="number"]:-ms-input-placeholder, input[type="password"]:-ms-input-placeholder, input[type="range"]:-ms-input-placeholder, input[type="search"]:-ms-input-placeholder, input[type="tel"]:-ms-input-placeholder, input[type="text"]:-ms-input-placeholder, input[type="time"]:-ms-input-placeholder, input[type="url"]:-ms-input-placeholder, input[type="week"]:-ms-input-placeholder, select:-ms-input-placeholder, textarea:-ms-input-placeholder { color: #777777; } input[type="color"]::-webkit-input-placeholder, input[type="date"]::-webkit-input-placeholder, input[type="datetime"]::-webkit-input-placeholder, input[type="datetime-local"]::-webkit-input-placeholder, input[type="email"]::-webkit-input-placeholder, input[type="file"]::-webkit-input-placeholder, input[type="month"]::-webkit-input-placeholder, input[type="number"]::-webkit-input-placeholder, input[type="password"]::-webkit-input-placeholder, input[type="range"]::-webkit-input-placeholder, input[type="search"]::-webkit-input-placeholder, input[type="tel"]::-webkit-input-placeholder, input[type="text"]::-webkit-input-placeholder, input[type="time"]::-webkit-input-placeholder, input[type="url"]::-webkit-input-placeholder, input[type="week"]::-webkit-input-placeholder, select::-webkit-input-placeholder, textarea::-webkit-input-placeholder { color: #777777; } input[type="color"][disabled], input[type="date"][disabled], input[type="datetime"][disabled], input[type="datetime-local"][disabled], input[type="email"][disabled], input[type="file"][disabled], input[type="month"][disabled], input[type="number"][disabled], input[type="password"][disabled], input[type="range"][disabled], input[type="search"][disabled], input[type="tel"][disabled], input[type="text"][disabled], input[type="time"][disabled], input[type="url"][disabled], input[type="week"][disabled], select[disabled], textarea[disabled], input[type="color"][readonly], input[type="date"][readonly], input[type="datetime"][readonly], input[type="datetime-local"][readonly], input[type="email"][readonly], input[type="file"][readonly], input[type="month"][readonly], input[type="number"][readonly], input[type="password"][readonly], input[type="range"][readonly], input[type="search"][readonly], input[type="tel"][readonly], input[type="text"][readonly], input[type="time"][readonly], input[type="url"][readonly], input[type="week"][readonly], select[readonly], textarea[readonly], fieldset[disabled] input[type="color"], fieldset[disabled] input[type="date"], fieldset[disabled] input[type="datetime"], fieldset[disabled] input[type="datetime-local"], fieldset[disabled] input[type="email"], fieldset[disabled] input[type="file"], fieldset[disabled] input[type="month"], fieldset[disabled] input[type="number"], fieldset[disabled] input[type="password"], fieldset[disabled] input[type="range"], fieldset[disabled] input[type="search"], fieldset[disabled] input[type="tel"], fieldset[disabled] input[type="text"], fieldset[disabled] input[type="time"], fieldset[disabled] input[type="url"], fieldset[disabled] input[type="week"], fieldset[disabled] select, fieldset[disabled] textarea { cursor: not-allowed; background-color: #eeeeee; opacity: 1; } textareainput[type="color"], textareainput[type="date"], textareainput[type="datetime"], textareainput[type="datetime-local"], textareainput[type="email"], textareainput[type="file"], textareainput[type="month"], textareainput[type="number"], textareainput[type="password"], textareainput[type="range"], textareainput[type="search"], textareainput[type="tel"], textareainput[type="text"], textareainput[type="time"], textareainput[type="url"], textareainput[type="week"], textareaselect, textareatextarea { height: auto; } textarea { height: auto; } button { display: inline-block; margin-bottom: 0; font-weight: normal; text-align: center; vertical-align: middle; cursor: pointer; background-image: none; border: 1px solid transparent; white-space: nowrap; padding: 6px 12px; font-size: 14px; line-height: 1.42857143; border-radius: 4px; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; color: #333333; background-color: #ffffff; border-color: #cccccc; } button:focus, button:active:focus, button.active:focus { outline: thin dotted; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } button:hover, button:focus { color: #333333; text-decoration: none; } button:active, button.active { outline: 0; background-image: none; -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); } button.disabled, button[disabled], fieldset[disabled] button { cursor: not-allowed; pointer-events: none; opacity: 0.65; filter: alpha(opacity=65); -webkit-box-shadow: none; box-shadow: none; } button:hover, button:focus, button:active, button.active, .open > .dropdown-togglebutton { color: #333333; background-color: #e6e6e6; border-color: #adadad; } button:active, button.active, .open > .dropdown-togglebutton { background-image: none; } button.disabled, button[disabled], fieldset[disabled] button, button.disabled:hover, button[disabled]:hover, fieldset[disabled] button:hover, button.disabled:focus, button[disabled]:focus, fieldset[disabled] button:focus, button.disabled:active, button[disabled]:active, fieldset[disabled] button:active, button.disabled.active, button[disabled].active, fieldset[disabled] button.active { background-color: #ffffff; border-color: #cccccc; } button .badge { color: #ffffff; background-color: #333333; } button.primaryAction { color: #ffffff; background-color: #428bca; border-color: #357ebd; } button.primaryAction:hover, button.primaryAction:focus, button.primaryAction:active, button.primaryAction.active, .open > .dropdown-togglebutton.primaryAction { color: #ffffff; background-color: #3071a9; border-color: #285e8e; } button.primaryAction:active, button.primaryAction.active, .open > .dropdown-togglebutton.primaryAction { background-image: none; } button.primaryAction.disabled, button.primaryAction[disabled], fieldset[disabled] button.primaryAction, button.primaryAction.disabled:hover, button.primaryAction[disabled]:hover, fieldset[disabled] button.primaryAction:hover, button.primaryAction.disabled:focus, button.primaryAction[disabled]:focus, fieldset[disabled] button.primaryAction:focus, button.primaryAction.disabled:active, button.primaryAction[disabled]:active, fieldset[disabled] button.primaryAction:active, button.primaryAction.disabled.active, button.primaryAction[disabled].active, fieldset[disabled] button.primaryAction.active { background-color: #428bca; border-color: #357ebd; } button.primaryAction .badge { color: #428bca; background-color: #ffffff; } ol, ul { padding-left: 0; list-style: none; } .pager { display: inline-block; padding-left: 0; margin: 20px 0; border-radius: 4px; } .pager > li { display: inline; } .pager > li > a, .pager > li > span { position: relative; float: left; padding: 6px 12px; line-height: 1.42857143; text-decoration: none; color: #428bca; background-color: #ffffff; border: 1px solid #dddddd; margin-left: -1px; } .pager > li:first-child > a, .pager > li:first-child > span { margin-left: 0; border-bottom-left-radius: 4px; border-top-left-radius: 4px; } .pager > li:last-child > a, .pager > li:last-child > span { border-bottom-right-radius: 4px; border-top-right-radius: 4px; } .pager > li > a:hover, .pager > li > span:hover, .pager > li > a:focus, .pager > li > span:focus { color: #2a6496; background-color: #eeeeee; border-color: #dddddd; } .pager > .active > a, .pager > .active > span, .pager > .active > a:hover, .pager > .active > span:hover, .pager > .active > a:focus, .pager > .active > span:focus { z-index: 2; color: #ffffff; background-color: #428bca; border-color: #428bca; cursor: default; } .pager > .disabled > span, .pager > .disabled > span:hover, .pager > .disabled > span:focus, .pager > .disabled > a, .pager > .disabled > a:hover, .pager > .disabled > a:focus { color: #777777; background-color: #ffffff; border-color: #dddddd; cursor: not-allowed; } html.orchard-users form { margin-left: -15px; margin-right: -15px; } html.orchard-users form fieldset { position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; } @media (min-width: 992px) { html.orchard-users form fieldset { float: left; width: 50%; } } .input-validation-error { -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); border-color: #a94442 !important; } .field-validation-error { display: block; margin-top: 5px; margin-bottom: 10px; color: #737373; color: #a94442; } .widget h1 { font-family: inherit; font-weight: 500; line-height: 1.1; color: inherit; margin-top: 20px; margin-bottom: 10px; font-size: 24px; } .widget h1 small, .widget h1 .small { font-weight: normal; line-height: 1; color: #777777; } .widget h1 small, .widget h1 .small { font-size: 65%; } .tags, .comment-count { margin-right: 20px; } /* Z-INDEX */ .formError { z-index: 990; } .formError .formErrorContent { z-index: 991; } .formError .formErrorArrow { z-index: 996; } .ui-dialog .formError { z-index: 5000; } .ui-dialog .formError .formErrorContent { z-index: 5001; } .ui-dialog .formError .formErrorArrow { z-index: 5006; } .inputContainer { position: relative; float: left; } .formError { position: absolute; top: 300px; left: 300px; display: block; cursor: pointer; text-align: left; } .formError.inline { position: relative; top: 0; left: 0; display: inline-block; } .ajaxSubmit { padding: 20px; background: #55ea55; border: 0px solid #ffffff; display: none; } .formError .formErrorContent { width: 100%; background: #ee0101; position: relative; color: #ffffff; min-width: 120px; font-size: 11px; border: 0px solid #ffffff; box-shadow: 0 0 2px #333333; -moz-box-shadow: 0 0 2px #333333; -webkit-box-shadow: 0 0 2px #333333; -o-box-shadow: 0 0 2px #333333; padding: 4px 10px 4px 10px; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px; -o-border-radius: 6px; } .formError.inline .formErrorContent { box-shadow: none; -moz-box-shadow: none; -webkit-box-shadow: none; -o-box-shadow: none; border: none; border-radius: 0; -moz-border-radius: 0; -webkit-border-radius: 0; -o-border-radius: 0; } .greenPopup .formErrorContent { background: #33be40; } .blackPopup .formErrorContent { background: #393939; color: #FFF; } .formError .formErrorArrow { width: 15px; margin: -2px 0 0 13px; position: relative; } body[dir='rtl'] .formError .formErrorArrow, body.rtl .formError .formErrorArrow { margin: -2px 13px 0 0; } .formError .formErrorArrowBottom { box-shadow: none; -moz-box-shadow: none; -webkit-box-shadow: none; -o-box-shadow: none; margin: 0px 0 0 12px; top: 2px; } .formError .formErrorArrow div { border-left: 0px solid #ffffff; border-right: 0px solid #ffffff; box-shadow: 0 1px 1px #4d4d4d; -moz-box-shadow: 0 1px 1px #4d4d4d; -webkit-box-shadow: 0 1px 1px #4d4d4d; -o-box-shadow: 0 1px 1px #4d4d4d; font-size: 0px; height: 1px; background: #ee0101; margin: 0 auto; line-height: 0; font-size: 0; display: block; } .formError .formErrorArrowBottom div { box-shadow: none; -moz-box-shadow: none; -webkit-box-shadow: none; -o-box-shadow: none; } .greenPopup .formErrorArrow div { background: #33be40; } .blackPopup .formErrorArrow div { background: #393939; color: #FFF; } .formError .formErrorArrow .line10 { width: 13px; border: none; } .formError .formErrorArrow .line9 { width: 11px; border: none; } .formError .formErrorArrow .line8 { width: 11px; } .formError .formErrorArrow .line7 { width: 9px; } .formError .formErrorArrow .line6 { width: 7px; } .formError .formErrorArrow .line5 { width: 5px; } .formError .formErrorArrow .line4 { width: 3px; } .formError .formErrorArrow .line3 { width: 0px; border-left: 0px solid #ffffff; border-right: 0px solid #ffffff; border-bottom: 0 solid #ffffff; } .formError .formErrorArrow .line2 { width: 3px; border: none; background: #ffffff; } .formError .formErrorArrow .line1 { width: 1px; border: none; background: #ffffff; } .portfolio-filter { padding: 25px 15px; text-transform: uppercase; font-size: 11px; } .portfolio-item { overflow: hidden; -webkit-transition: all 0.2s ease; transition: all 0.2s ease; border-radius: 3px; } .portfolio-item .portfolio-thumb { position: relative; overflow: hidden; } .portfolio-item .portfolio-thumb img { -webkit-transition: all 0.2s ease; transition: all 0.2s ease; } .portfolio-item .portfolio-details { text-align: center; padding: 20px; border-top: 0; overflow: hidden; } .portfolio-item .portfolio-details h5 { margin-top: 0; position: relative; } .portfolio-item .portfolio-details p { margin-top: 20px; margin-bottom: 0; } .isotope { -webkit-transition-property: height, width; -moz-transition-property: height, width; -ms-transition-property: height, width; -o-transition-property: height, width; transition-property: height, width; } .isotope, .isotope .isotope-item { -webkit-transition-duration: 0.8s; -moz-transition-duration: 0.8s; -ms-transition-duration: 0.8s; -o-transition-duration: 0.8s; transition-duration: 0.8s; } .latest-twitter-list h5 { display: inline-block; margin: 0; } .latest-twitter-list li { margin-bottom: 10px; } .navbar-nav > li > .dropdown-menu .dropdown-menu { margin-top: -6px; } /*# sourceMappingURL=site-default.css.map */
m8ker/vgcollection
Themes/PJS.Bootstrap/Styles/site-default.css
CSS
bsd-3-clause
191,099
/********************************************************************** * * Copyright (c) 2004-2005 Endace Technology Ltd, Hamilton, New Zealand. * All rights reserved. * * This source code is proprietary to Endace Technology Limited and no part * of it may be redistributed, published or disclosed except as outlined in * the written contract supplied with this product. * * $Id: df_types.h,v 1.3 2006/03/28 03:55:07 ben Exp $ * **********************************************************************/ /********************************************************************** * FILE: df_types.h * DESCRIPTION: Defines the internal types used by the dagfilter API * library. * * * HISTORY: 15-12-05 Initial revision * **********************************************************************/ #ifndef DF_TYPES_H #define DF_TYPES_H /* ADT headers */ #include "adt_list.h" #include "adt_array_list.h" /*-------------------------------------------------------------------- PROTOCOLS These protocol types allow for extended filter functionality, for example if filtering on a TCP protocol filter, port filters can be added to the ip filter. ---------------------------------------------------------------------*/ #define DF_PROTO_ICMP 1 #define DF_PROTO_TCP 6 #define DF_PROTO_UDP 17 #define DF_PROTO_SCTP 132 /*-------------------------------------------------------------------- SIGNATURES ---------------------------------------------------------------------*/ #define SIG_RULESET 0xD68FC735 #define SIG_IPV4_RULE 0x3758E847 #define SIG_IPV6_RULE 0xA79B7AEF #define ISIPRULE_SIGNATURE(x) (((x) == SIG_IPV4_RULE) ? 1 : \ ((x) == SIG_IPV6_RULE) ? 1 : 0) #define ISRULE_SIGNATURE(x) (((x) == SIG_IPV4_RULE) ? 1 : \ ((x) == SIG_IPV6_RULE) ? 1 : 0) /*-------------------------------------------------------------------- RULESET ---------------------------------------------------------------------*/ typedef struct df_ruleset_s { uint32_t signature; /* signature 0xD68FC735 */ ListPtr rule_list; /* list of filters in the ruleset */ } df_ruleset_t; /*-------------------------------------------------------------------- FILTER RULE META DATA All filter data structures should have a filter_meta_t as their first data field, this allows the meta-data functions to cast the filter to a filter_meta_t type for processing. ---------------------------------------------------------------------*/ typedef struct df_rule_meta_s { uint32_t signature; /* signature for the filter type, should be unique for each filter */ /* see above for possible filter signatures. */ /* ruleset handle */ RulesetH ruleset; /* handle to the parent ruleset */ /* meta data */ uint16_t action : 1; /* 1 for accept, 0 for reject */ uint16_t steering : 1; /* 1 for steer to line, 0 for steer to host */ uint16_t reserved : 14; /* reserved for future use */ uint16_t snap_len; /* the snap length of the accepted packets */ uint16_t rule_tag; /* the filter tag set in ERf header, only lower 14-bits are used */ uint16_t priority; } df_rule_meta_t; /*-------------------------------------------------------------------- STANDARD RULE TYPES ---------------------------------------------------------------------*/ typedef struct icmp_type_ruler_s { uint8_t type; uint8_t mask; } icmp_type_rule_t; typedef struct port_rule_s { uint16_t port; uint16_t mask; } port_rule_t; typedef struct ipv4_addr_rule_s { uint8_t addr[4]; uint8_t mask[4]; } ipv4_addr_rule_t; typedef struct ipv6_addr_rule_s { uint8_t addr[16]; uint8_t mask[16]; } ipv6_addr_rule_t; typedef struct ipv6_flow_rule_s { uint32_t flow; uint32_t mask; } ipv6_flow_rule_t; typedef struct tcp_flags_rule_s { uint8_t flags; uint8_t mask; } tcp_flags_rule_t; /*-------------------------------------------------------------------- IPV4 RULE ---------------------------------------------------------------------*/ typedef struct df_ipv4_rule_s { /* meta data */ df_rule_meta_t meta; /* ip header */ ipv4_addr_rule_t source; /* source filter */ ipv4_addr_rule_t dest; /* destination filter */ /* level 5/6 */ uint8_t protocol; /* protocol to filter on, 0xFF for no protocol filter */ tcp_flags_rule_t tcp_flags; /* tcp flags to filter on (only valid if protocol is 6) */ ArrayListPtr port_rules; /* list of port filters (only valid if protocol is 6,17 or 132)*/ ArrayListPtr icmp_type_rules; /* list of icmp type filters (only valid if protocol is 1) */ } df_ipv4_rule_t; /*-------------------------------------------------------------------- IPV6 RULE ---------------------------------------------------------------------*/ typedef struct df_ipv6_rule_s { /* meta data */ df_rule_meta_t meta; /* ip header */ ipv6_addr_rule_t source; /* source filter */ ipv6_addr_rule_t dest; /* destination filter */ ipv6_flow_rule_t flow; /* flow label filter */ /* level 5/6 */ uint8_t protocol; /* protocol to filter on, 0xFF for no protocol filter */ tcp_flags_rule_t tcp_flags; /* tcp flags to filter on (only valid if protocol is 6) */ ArrayListPtr port_rules; /* list of port filters (only valid if protocol is 6,17 or 132)*/ ArrayListPtr icmp_type_rules; /* list of icmp type filters (only valid if protocol is 1) */ } df_ipv6_rule_t; /*-------------------------------------------------------------------- PORT RULE ---------------------------------------------------------------------*/ #define DFFLAG_BITMASK 0x01 #define DFFLAG_RANGE 0x02 #define DFFLAG_SOURCE 0x80 #define DFFLAG_DEST 0x00 typedef struct df_port_rule_s { uint8_t flags; union { struct { uint16_t value; uint16_t mask; } bitmask; struct { uint16_t min; uint16_t max; } range; } rule; } df_port_rule_t; /*-------------------------------------------------------------------- ICMP TYPE RULE ---------------------------------------------------------------------*/ typedef struct df_icmp_type_rule_s { uint8_t flags; union { struct { uint8_t value; uint8_t mask; } bitmask; struct { uint8_t min; uint8_t max; } range; } rule; } df_icmp_type_rule_t; #endif // DF_TYPES_H
mgrosvenor/camio1.0
dag/dagixp_filter/df_types.h
C
bsd-3-clause
7,011
////functionen hämtar alla artiklar med hjälp av getJSON //och får tillbaka en array med alla artiklar //efter den är klar kallar den på functionen ShoArtTab. //som skriver ut alla artiklar i en tabell. function getAllAdminProducts() { $.getJSON("index2.php/getAllProducts").done(showArtTab); } //functionen showArtTab får en array av getAllArticle funktionen //som den loopar igenom och anväder för att skapa upp en tabell med alla de olika //artiklarna function showArtTab(cart){ var mainTabell = document.createElement('div'); mainTabell.setAttribute('id', 'mainTabell'); var tbl = document.createElement('table'); tbl.setAttribute('border', '1'); var tr = document.createElement('tr'); var th2 = document.createElement('th'); var txt2 = document.createTextNode('Produktid'); var th3 = document.createElement('th'); var txt3 = document.createTextNode('Produktnamn'); var th4 = document.createElement('th'); var txt4 = document.createTextNode('Kategori'); var th5 = document.createElement('th'); var txt5 = document.createTextNode('Pris'); var th6 = document.createElement('th'); var txt6 = document.createTextNode('Bild'); var th7 = document.createElement('th'); var txt7 = document.createTextNode('Delete'); var th8 = document.createElement('th'); var txt8 = document.createTextNode('Update'); th2.appendChild(txt2); tr.appendChild(th2); th3.appendChild(txt3); tr.appendChild(th3); th4.appendChild(txt4); tr.appendChild(th4); th5.appendChild(txt5); tr.appendChild(th5); th6.appendChild(txt6); tr.appendChild(th6); th7.appendChild(txt7); tr.appendChild(th7); th8.appendChild(txt8); tr.appendChild(th8); tbl.appendChild(tr); var i = 0; do{ var row = tbl.insertRow(-1); row.insertCell(-1).innerHTML = cart[i].produktid; var cell2 = row.insertCell(-1); cell2.innerHTML = cart[i].namn; var cell3 = row.insertCell(-1); cell3.innerHTML = cart[i].kategori; var cell4 = row.insertCell(-1); cell4.innerHTML = cart[i].pris; var cell6 = row.insertCell(-1); cell6.innerHTML = '<img src="' + cart[i].img + '" height="70" width="70"/>'; var cell7 = row.insertCell(-1); cell7.innerHTML = "<a href='#' onclick='removeArt(\"" +cart[i].produktid+ "\",\""+ "\");'>Remove</a>"; var cell8 = row.insertCell(-1); cell8.innerHTML = "<a href='#' onclick='getUpdate(\"" +cart[i].produktid+ "\",\""+ "\");'>Update</a>"; tbl.appendChild(row); i++; }while(i< cart.length); $('#main').html(tbl); } //öppnar en dialogruta när man trycker på "Add Article" knappen //med det som finns i diven med id:addArt function showAddArt(){ $('#addArt').dialog({ show:'fade', position:'center' }); } //när man trycker på "Add Article" knappen i dialogrutan så ska den lägga till datan //från formuläret som görs med .serialize som hämtar datan från textfälten. function addArticle(){ $.post('index2.php/AdminController/addProduct',$('#addArtForm').serialize()).done(getAllAdminProducts); $("#addArt").dialog('close'); } //tar bort en artikel med att hämta in dess namn och skicka förfrågningen till modellen function deleteArt(prodid) { $.getJSON("index2.php/AdminController/deleteProduct/"+prodid); } function removeArt(prodid){ var r=confirm("Vill du ta bort den här produkten?"); if (r==true) { x="JA"; } else { x="NEJ"; } if(x === "JA"){ deleteArt(prodid); getAllAdminProducts(); } } //en function som tar in namnet //och använder det när man kallar på getArt function getUpdate(prodid){ getArt(prodid); } //får in artikelid och använder det för att hämta alla artiklar som har samma //id med hjälp av modellen. function getArt(prodid){ $.getJSON("index2.php/Controller/getProdById/"+prodid).done(showArt); } //en function som visar en dialog ruta med färdig i fylld data i textfällten //från den uppgift man vill uppdatera. function showArt(data){ $('#updateId').attr('value',data[0].produktid); $('#updateNamn').attr('value',data[0].namn); $('#updateKategori').attr('value',data[0].kategori); $('#updatePris').attr('value',data[0].pris); $('#updateImg').attr('value',data[0].img); $('#update').dialog({ show:'fade', position:'center', }); } //när man trycker på uppdatera så hämtar den datan från forumlätert med hjälp av // .serialize och skickar datan till modellen. //stänger sen dialogrutan. function updateArt(){ $.post("index2.php/AdminController/updateProduct/", $('#updateForm').serialize()).done(getAllAdminProducts); $("#update").dialog('close'); }
cider94/JsKlar
start/admin.js
JavaScript
bsd-3-clause
4,847
<?php namespace common\models; use Yii; use yii\db\ActiveRecord; /** * This is the model class for table "template_js". * * @property integer $id * @property integer $template_id * @property integer $js_id * * @property Js $js * @property Template $template */ class TemplateJs extends ActiveRecord { /** * @inheritdoc */ public static function tableName() { return 'template_js'; } /** * @inheritdoc */ public function rules() { return [ [['template_id', 'js_id'], 'required'], [['template_id', 'js_id'], 'integer'] ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => Yii::t('app', 'ID'), 'template_id' => Yii::t('app', 'Template ID'), 'js_id' => Yii::t('app', 'Js ID'), ]; } /** * @return \yii\db\ActiveQuery */ public function getJs() { return $this->hasOne(Js::className(), ['id' => 'js_id']); } /** * @return \yii\db\ActiveQuery */ public function getTemplate() { return $this->hasOne(Template::className(), ['id' => 'template_id']); } }
dmitry-grasevich/tg
common/models/TemplateJs.php
PHP
bsd-3-clause
1,232
create table Account_ ( accountId int8 not null primary key, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, parentAccountId int8, name varchar(75), legalName varchar(75), legalId varchar(75), legalType varchar(75), sicCode varchar(75), tickerSymbol varchar(75), industry varchar(75), type_ varchar(75), size_ varchar(75) ) extent size 16 next size 16 lock mode row; create table Address ( addressId int8 not null primary key, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, classNameId int8, classPK int8, street1 varchar(75), street2 varchar(75), street3 varchar(75), city varchar(75), zip varchar(75), regionId int8, countryId int8, typeId int, mailing boolean, primary_ boolean ) extent size 16 next size 16 lock mode row; create table AnnouncementsDelivery ( deliveryId int8 not null primary key, companyId int8, userId int8, type_ varchar(75), email boolean, sms boolean, website boolean ) extent size 16 next size 16 lock mode row; create table AnnouncementsEntry ( uuid_ varchar(75), entryId int8 not null primary key, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, classNameId int8, classPK int8, title varchar(75), content lvarchar, url lvarchar, type_ varchar(75), displayDate datetime YEAR TO FRACTION, expirationDate datetime YEAR TO FRACTION, priority int, alert boolean ) extent size 16 next size 16 lock mode row; create table AnnouncementsFlag ( flagId int8 not null primary key, userId int8, createDate datetime YEAR TO FRACTION, entryId int8, value int ) extent size 16 next size 16 lock mode row; create table BlogsEntry ( uuid_ varchar(75), entryId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, title varchar(150), urlTitle varchar(150), content text, displayDate datetime YEAR TO FRACTION, draft boolean, allowTrackbacks boolean, trackbacks text ) extent size 16 next size 16 lock mode row; create table BlogsStatsUser ( statsUserId int8 not null primary key, groupId int8, companyId int8, userId int8, entryCount int, lastPostDate datetime YEAR TO FRACTION, ratingsTotalEntries int, ratingsTotalScore float, ratingsAverageScore float ) extent size 16 next size 16 lock mode row; create table BookmarksEntry ( uuid_ varchar(75), entryId int8 not null primary key, groupId int8, companyId int8, userId int8, createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, folderId int8, name varchar(255), url lvarchar, comments lvarchar, visits int, priority int ) extent size 16 next size 16 lock mode row; create table BookmarksFolder ( uuid_ varchar(75), folderId int8 not null primary key, groupId int8, companyId int8, userId int8, createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, parentFolderId int8, name varchar(75), description lvarchar ) extent size 16 next size 16 lock mode row; create table BrowserTracker ( browserTrackerId int8 not null primary key, userId int8, browserKey int8 ) extent size 16 next size 16 lock mode row; create table CalEvent ( uuid_ varchar(75), eventId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, title varchar(75), description lvarchar, startDate datetime YEAR TO FRACTION, endDate datetime YEAR TO FRACTION, durationHour int, durationMinute int, allDay boolean, timeZoneSensitive boolean, type_ varchar(75), repeating boolean, recurrence text, remindBy int, firstReminder int, secondReminder int ) extent size 16 next size 16 lock mode row; create table ClassName_ ( classNameId int8 not null primary key, value varchar(200) ) extent size 16 next size 16 lock mode row; create table Company ( companyId int8 not null primary key, accountId int8, webId varchar(75), key_ text, virtualHost varchar(75), mx varchar(75), homeURL lvarchar, logoId int8, system boolean ) extent size 16 next size 16 lock mode row; create table Contact_ ( contactId int8 not null primary key, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, accountId int8, parentContactId int8, firstName varchar(75), middleName varchar(75), lastName varchar(75), prefixId int, suffixId int, male boolean, birthday datetime YEAR TO FRACTION, smsSn varchar(75), aimSn varchar(75), facebookSn varchar(75), icqSn varchar(75), jabberSn varchar(75), msnSn varchar(75), mySpaceSn varchar(75), skypeSn varchar(75), twitterSn varchar(75), ymSn varchar(75), employeeStatusId varchar(75), employeeNumber varchar(75), jobTitle varchar(100), jobClass varchar(75), hoursOfOperation varchar(75) ) extent size 16 next size 16 lock mode row; create table Counter ( name varchar(75) not null primary key, currentId int8 ) extent size 16 next size 16 lock mode row; create table Country ( countryId int8 not null primary key, name varchar(75), a2 varchar(75), a3 varchar(75), number_ varchar(75), idd_ varchar(75), active_ boolean ) extent size 16 next size 16 lock mode row; create table CyrusUser ( userId varchar(75) not null primary key, password_ varchar(75) not null ) extent size 16 next size 16 lock mode row; create table CyrusVirtual ( emailAddress varchar(75) not null primary key, userId varchar(75) not null ) extent size 16 next size 16 lock mode row; create table DLFileEntry ( uuid_ varchar(75), fileEntryId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), versionUserId int8, versionUserName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, folderId int8, name varchar(255), title varchar(255), description lvarchar, version float, size_ int, readCount int, extraSettings text ) extent size 16 next size 16 lock mode row; create table DLFileRank ( fileRankId int8 not null primary key, groupId int8, companyId int8, userId int8, createDate datetime YEAR TO FRACTION, folderId int8, name varchar(255) ) extent size 16 next size 16 lock mode row; create table DLFileShortcut ( uuid_ varchar(75), fileShortcutId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, folderId int8, toFolderId int8, toName varchar(255) ) extent size 16 next size 16 lock mode row; create table DLFileVersion ( fileVersionId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, folderId int8, name varchar(255), version float, size_ int ) extent size 16 next size 16 lock mode row; create table DLFolder ( uuid_ varchar(75), folderId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, parentFolderId int8, name varchar(100), description lvarchar, lastPostDate datetime YEAR TO FRACTION ) extent size 16 next size 16 lock mode row; create table EmailAddress ( emailAddressId int8 not null primary key, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, classNameId int8, classPK int8, address varchar(75), typeId int, primary_ boolean ) extent size 16 next size 16 lock mode row; create table ExpandoColumn ( columnId int8 not null primary key, companyId int8, tableId int8, name varchar(75), type_ int, defaultData lvarchar, typeSettings lvarchar(4096) ) extent size 16 next size 16 lock mode row; create table ExpandoRow ( rowId_ int8 not null primary key, companyId int8, tableId int8, classPK int8 ) extent size 16 next size 16 lock mode row; create table ExpandoTable ( tableId int8 not null primary key, companyId int8, classNameId int8, name varchar(75) ) extent size 16 next size 16 lock mode row; create table ExpandoValue ( valueId int8 not null primary key, companyId int8, tableId int8, columnId int8, rowId_ int8, classNameId int8, classPK int8, data_ lvarchar ) extent size 16 next size 16 lock mode row; create table Group_ ( groupId int8 not null primary key, companyId int8, creatorUserId int8, classNameId int8, classPK int8, parentGroupId int8, liveGroupId int8, name varchar(75), description lvarchar, type_ int, typeSettings lvarchar, friendlyURL varchar(100), active_ boolean ) extent size 16 next size 16 lock mode row; create table Groups_Orgs ( groupId int8 not null, organizationId int8 not null, primary key (groupId, organizationId) ) extent size 16 next size 16 lock mode row; create table Groups_Permissions ( groupId int8 not null, permissionId int8 not null, primary key (groupId, permissionId) ) extent size 16 next size 16 lock mode row; create table Groups_Roles ( groupId int8 not null, roleId int8 not null, primary key (groupId, roleId) ) extent size 16 next size 16 lock mode row; create table Groups_UserGroups ( groupId int8 not null, userGroupId int8 not null, primary key (groupId, userGroupId) ) extent size 16 next size 16 lock mode row; create table IGFolder ( uuid_ varchar(75), folderId int8 not null primary key, groupId int8, companyId int8, userId int8, createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, parentFolderId int8, name varchar(75), description lvarchar ) extent size 16 next size 16 lock mode row; create table IGImage ( uuid_ varchar(75), imageId int8 not null primary key, groupId int8, companyId int8, userId int8, createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, folderId int8, name varchar(75), description lvarchar, smallImageId int8, largeImageId int8, custom1ImageId int8, custom2ImageId int8 ) extent size 16 next size 16 lock mode row; create table Image ( imageId int8 not null primary key, modifiedDate datetime YEAR TO FRACTION, text_ text, type_ varchar(75), height int, width int, size_ int ) extent size 16 next size 16 lock mode row; create table JournalArticle ( uuid_ varchar(75), id_ int8 not null primary key, resourcePrimKey int8, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, articleId varchar(75), version float, title varchar(100), urlTitle varchar(150), description lvarchar, content text, type_ varchar(75), structureId varchar(75), templateId varchar(75), displayDate datetime YEAR TO FRACTION, approved boolean, approvedByUserId int8, approvedByUserName varchar(75), approvedDate datetime YEAR TO FRACTION, expired boolean, expirationDate datetime YEAR TO FRACTION, reviewDate datetime YEAR TO FRACTION, indexable boolean, smallImage boolean, smallImageId int8, smallImageURL varchar(75) ) extent size 16 next size 16 lock mode row; create table JournalArticleImage ( articleImageId int8 not null primary key, groupId int8, articleId varchar(75), version float, elInstanceId varchar(75), elName varchar(75), languageId varchar(75), tempImage boolean ) extent size 16 next size 16 lock mode row; create table JournalArticleResource ( resourcePrimKey int8 not null primary key, groupId int8, articleId varchar(75) ) extent size 16 next size 16 lock mode row; create table JournalContentSearch ( contentSearchId int8 not null primary key, groupId int8, companyId int8, privateLayout boolean, layoutId int8, portletId varchar(200), articleId varchar(75) ) extent size 16 next size 16 lock mode row; create table JournalFeed ( uuid_ varchar(75), id_ int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, feedId varchar(75), name varchar(75), description lvarchar, type_ varchar(75), structureId varchar(75), templateId varchar(75), rendererTemplateId varchar(75), delta int, orderByCol varchar(75), orderByType varchar(75), targetLayoutFriendlyUrl varchar(75), targetPortletId varchar(75), contentField varchar(75), feedType varchar(75), feedVersion float ) extent size 16 next size 16 lock mode row; create table JournalStructure ( uuid_ varchar(75), id_ int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, structureId varchar(75), parentStructureId varchar(75), name varchar(75), description lvarchar, xsd text ) extent size 16 next size 16 lock mode row; create table JournalTemplate ( uuid_ varchar(75), id_ int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, templateId varchar(75), structureId varchar(75), name varchar(75), description lvarchar, xsl text, langType varchar(75), cacheable boolean, smallImage boolean, smallImageId int8, smallImageURL varchar(75) ) extent size 16 next size 16 lock mode row; create table Layout ( plid int8 not null primary key, groupId int8, companyId int8, privateLayout boolean, layoutId int8, parentLayoutId int8, name lvarchar, title lvarchar, description lvarchar, type_ varchar(75), typeSettings lvarchar(4096), hidden_ boolean, friendlyURL varchar(100), iconImage boolean, iconImageId int8, themeId varchar(75), colorSchemeId varchar(75), wapThemeId varchar(75), wapColorSchemeId varchar(75), css lvarchar, priority int, dlFolderId int8 ) extent size 16 next size 16 lock mode row; create table LayoutSet ( layoutSetId int8 not null primary key, groupId int8, companyId int8, privateLayout boolean, logo boolean, logoId int8, themeId varchar(75), colorSchemeId varchar(75), wapThemeId varchar(75), wapColorSchemeId varchar(75), css lvarchar, pageCount int, virtualHost varchar(75) ) extent size 16 next size 16 lock mode row; create table ListType ( listTypeId int not null primary key, name varchar(75), type_ varchar(75) ) extent size 16 next size 16 lock mode row; create table MBBan ( banId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, banUserId int8 ) extent size 16 next size 16 lock mode row; create table MBCategory ( uuid_ varchar(75), categoryId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, parentCategoryId int8, name varchar(75), description lvarchar, threadCount int, messageCount int, lastPostDate datetime YEAR TO FRACTION ) extent size 16 next size 16 lock mode row; create table MBDiscussion ( discussionId int8 not null primary key, classNameId int8, classPK int8, threadId int8 ) extent size 16 next size 16 lock mode row; create table MBMailingList ( uuid_ varchar(75), mailingListId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, categoryId int8, emailAddress varchar(75), inProtocol varchar(75), inServerName varchar(75), inServerPort int, inUseSSL boolean, inUserName varchar(75), inPassword varchar(75), inReadInterval int, outEmailAddress varchar(75), outCustom boolean, outServerName varchar(75), outServerPort int, outUseSSL boolean, outUserName varchar(75), outPassword varchar(75), active_ boolean ) extent size 16 next size 16 lock mode row; create table MBMessage ( uuid_ varchar(75), messageId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, classNameId int8, classPK int8, categoryId int8, threadId int8, parentMessageId int8, subject varchar(75), body text, attachments boolean, anonymous boolean, priority float ) extent size 16 next size 16 lock mode row; create table MBMessageFlag ( messageFlagId int8 not null primary key, userId int8, modifiedDate datetime YEAR TO FRACTION, threadId int8, messageId int8, flag int ) extent size 16 next size 16 lock mode row; create table MBStatsUser ( statsUserId int8 not null primary key, groupId int8, userId int8, messageCount int, lastPostDate datetime YEAR TO FRACTION ) extent size 16 next size 16 lock mode row; create table MBThread ( threadId int8 not null primary key, groupId int8, categoryId int8, rootMessageId int8, messageCount int, viewCount int, lastPostByUserId int8, lastPostDate datetime YEAR TO FRACTION, priority float ) extent size 16 next size 16 lock mode row; create table MembershipRequest ( membershipRequestId int8 not null primary key, companyId int8, userId int8, createDate datetime YEAR TO FRACTION, groupId int8, comments lvarchar, replyComments lvarchar, replyDate datetime YEAR TO FRACTION, replierUserId int8, statusId int ) extent size 16 next size 16 lock mode row; create table Organization_ ( organizationId int8 not null primary key, companyId int8, parentOrganizationId int8, leftOrganizationId int8, rightOrganizationId int8, name varchar(100), type_ varchar(75), recursable boolean, regionId int8, countryId int8, statusId int, comments lvarchar ) extent size 16 next size 16 lock mode row; create table OrgGroupPermission ( organizationId int8 not null, groupId int8 not null, permissionId int8 not null, primary key (organizationId, groupId, permissionId) ) extent size 16 next size 16 lock mode row; create table OrgGroupRole ( organizationId int8 not null, groupId int8 not null, roleId int8 not null, primary key (organizationId, groupId, roleId) ) extent size 16 next size 16 lock mode row; create table OrgLabor ( orgLaborId int8 not null primary key, organizationId int8, typeId int, sunOpen int, sunClose int, monOpen int, monClose int, tueOpen int, tueClose int, wedOpen int, wedClose int, thuOpen int, thuClose int, friOpen int, friClose int, satOpen int, satClose int ) extent size 16 next size 16 lock mode row; create table PasswordPolicy ( passwordPolicyId int8 not null primary key, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, defaultPolicy boolean, name varchar(75), description lvarchar, changeable boolean, changeRequired boolean, minAge int8, checkSyntax boolean, allowDictionaryWords boolean, minLength int, history boolean, historyCount int, expireable boolean, maxAge int8, warningTime int8, graceLimit int, lockout boolean, maxFailure int, lockoutDuration int8, requireUnlock boolean, resetFailureCount int8 ) extent size 16 next size 16 lock mode row; create table PasswordPolicyRel ( passwordPolicyRelId int8 not null primary key, passwordPolicyId int8, classNameId int8, classPK int8 ) extent size 16 next size 16 lock mode row; create table PasswordTracker ( passwordTrackerId int8 not null primary key, userId int8, createDate datetime YEAR TO FRACTION, password_ varchar(75) ) extent size 16 next size 16 lock mode row; create table Permission_ ( permissionId int8 not null primary key, companyId int8, actionId varchar(75), resourceId int8 ) extent size 16 next size 16 lock mode row; create table Phone ( phoneId int8 not null primary key, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, classNameId int8, classPK int8, number_ varchar(75), extension varchar(75), typeId int, primary_ boolean ) extent size 16 next size 16 lock mode row; create table PluginSetting ( pluginSettingId int8 not null primary key, companyId int8, pluginId varchar(75), pluginType varchar(75), roles lvarchar, active_ boolean ) extent size 16 next size 16 lock mode row; create table PollsChoice ( uuid_ varchar(75), choiceId int8 not null primary key, questionId int8, name varchar(75), description lvarchar(1000) ) extent size 16 next size 16 lock mode row; create table PollsQuestion ( uuid_ varchar(75), questionId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, title lvarchar(500), description lvarchar, expirationDate datetime YEAR TO FRACTION, lastVoteDate datetime YEAR TO FRACTION ) extent size 16 next size 16 lock mode row; create table PollsVote ( voteId int8 not null primary key, userId int8, questionId int8, choiceId int8, voteDate datetime YEAR TO FRACTION ) extent size 16 next size 16 lock mode row; create table Portlet ( id_ int8 not null primary key, companyId int8, portletId varchar(200), roles lvarchar, active_ boolean ) extent size 16 next size 16 lock mode row; create table PortletItem ( portletItemId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, name varchar(75), portletId varchar(75), classNameId int8 ) extent size 16 next size 16 lock mode row; create table PortletPreferences ( portletPreferencesId int8 not null primary key, ownerId int8, ownerType int, plid int8, portletId varchar(200), preferences text ) extent size 16 next size 16 lock mode row; create table RatingsEntry ( entryId int8 not null primary key, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, classNameId int8, classPK int8, score float ) extent size 16 next size 16 lock mode row; create table RatingsStats ( statsId int8 not null primary key, classNameId int8, classPK int8, totalEntries int, totalScore float, averageScore float ) extent size 16 next size 16 lock mode row; create table Region ( regionId int8 not null primary key, countryId int8, regionCode varchar(75), name varchar(75), active_ boolean ) extent size 16 next size 16 lock mode row; create table Release_ ( releaseId int8 not null primary key, createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, buildNumber int, buildDate datetime YEAR TO FRACTION, verified boolean, testString lvarchar(1024) ) extent size 16 next size 16 lock mode row; create table Resource_ ( resourceId int8 not null primary key, codeId int8, primKey varchar(255) ) extent size 16 next size 16 lock mode row; create table ResourceAction ( resourceActionId int8 not null primary key, name varchar(75), actionId varchar(75), bitwiseValue int8 ) extent size 16 next size 16 lock mode row; create table ResourceCode ( codeId int8 not null primary key, companyId int8, name varchar(255), scope int ) extent size 16 next size 16 lock mode row; create table ResourcePermission ( resourcePermissionId int8 not null primary key, companyId int8, name varchar(255), scope int, primKey varchar(255), roleId int8, actionIds int8 ) extent size 16 next size 16 lock mode row; create table Role_ ( roleId int8 not null primary key, companyId int8, classNameId int8, classPK int8, name varchar(75), title lvarchar, description lvarchar, type_ int, subtype varchar(75) ) extent size 16 next size 16 lock mode row; create table Roles_Permissions ( roleId int8 not null, permissionId int8 not null, primary key (roleId, permissionId) ) extent size 16 next size 16 lock mode row; create table SCFrameworkVersi_SCProductVers ( frameworkVersionId int8 not null, productVersionId int8 not null, primary key (frameworkVersionId, productVersionId) ) extent size 16 next size 16 lock mode row; create table SCFrameworkVersion ( frameworkVersionId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, name varchar(75), url lvarchar, active_ boolean, priority int ) extent size 16 next size 16 lock mode row; create table SCLicense ( licenseId int8 not null primary key, name varchar(75), url lvarchar, openSource boolean, active_ boolean, recommended boolean ) extent size 16 next size 16 lock mode row; create table SCLicenses_SCProductEntries ( licenseId int8 not null, productEntryId int8 not null, primary key (licenseId, productEntryId) ) extent size 16 next size 16 lock mode row; create table SCProductEntry ( productEntryId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, name varchar(75), type_ varchar(75), tags varchar(255), shortDescription lvarchar, longDescription lvarchar, pageURL lvarchar, author varchar(75), repoGroupId varchar(75), repoArtifactId varchar(75) ) extent size 16 next size 16 lock mode row; create table SCProductScreenshot ( productScreenshotId int8 not null primary key, companyId int8, groupId int8, productEntryId int8, thumbnailId int8, fullImageId int8, priority int ) extent size 16 next size 16 lock mode row; create table SCProductVersion ( productVersionId int8 not null primary key, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, productEntryId int8, version varchar(75), changeLog lvarchar, downloadPageURL lvarchar, directDownloadURL varchar(2000), repoStoreArtifact boolean ) extent size 16 next size 16 lock mode row; create table ServiceComponent ( serviceComponentId int8 not null primary key, buildNamespace varchar(75), buildNumber int8, buildDate int8, data_ text ) extent size 16 next size 16 lock mode row; create table Shard ( shardId int8 not null primary key, classNameId int8, classPK int8, name varchar(75) ) extent size 16 next size 16 lock mode row; create table ShoppingCart ( cartId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, itemIds lvarchar, couponCodes varchar(75), altShipping int, insure boolean ) extent size 16 next size 16 lock mode row; create table ShoppingCategory ( categoryId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, parentCategoryId int8, name varchar(75), description lvarchar ) extent size 16 next size 16 lock mode row; create table ShoppingCoupon ( couponId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, code_ varchar(75), name varchar(75), description lvarchar, startDate datetime YEAR TO FRACTION, endDate datetime YEAR TO FRACTION, active_ boolean, limitCategories lvarchar, limitSkus lvarchar, minOrder float, discount float, discountType varchar(75) ) extent size 16 next size 16 lock mode row; create table ShoppingItem ( itemId int8 not null primary key, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, categoryId int8, sku varchar(75), name varchar(200), description lvarchar, properties lvarchar, fields_ boolean, fieldsQuantities lvarchar, minQuantity int, maxQuantity int, price float, discount float, taxable boolean, shipping float, useShippingFormula boolean, requiresShipping boolean, stockQuantity int, featured_ boolean, sale_ boolean, smallImage boolean, smallImageId int8, smallImageURL varchar(75), mediumImage boolean, mediumImageId int8, mediumImageURL varchar(75), largeImage boolean, largeImageId int8, largeImageURL varchar(75) ) extent size 16 next size 16 lock mode row; create table ShoppingItemField ( itemFieldId int8 not null primary key, itemId int8, name varchar(75), values_ lvarchar, description lvarchar ) extent size 16 next size 16 lock mode row; create table ShoppingItemPrice ( itemPriceId int8 not null primary key, itemId int8, minQuantity int, maxQuantity int, price float, discount float, taxable boolean, shipping float, useShippingFormula boolean, status int ) extent size 16 next size 16 lock mode row; create table ShoppingOrder ( orderId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, number_ varchar(75), tax float, shipping float, altShipping varchar(75), requiresShipping boolean, insure boolean, insurance float, couponCodes varchar(75), couponDiscount float, billingFirstName varchar(75), billingLastName varchar(75), billingEmailAddress varchar(75), billingCompany varchar(75), billingStreet varchar(75), billingCity varchar(75), billingState varchar(75), billingZip varchar(75), billingCountry varchar(75), billingPhone varchar(75), shipToBilling boolean, shippingFirstName varchar(75), shippingLastName varchar(75), shippingEmailAddress varchar(75), shippingCompany varchar(75), shippingStreet varchar(75), shippingCity varchar(75), shippingState varchar(75), shippingZip varchar(75), shippingCountry varchar(75), shippingPhone varchar(75), ccName varchar(75), ccType varchar(75), ccNumber varchar(75), ccExpMonth int, ccExpYear int, ccVerNumber varchar(75), comments lvarchar, ppTxnId varchar(75), ppPaymentStatus varchar(75), ppPaymentGross float, ppReceiverEmail varchar(75), ppPayerEmail varchar(75), sendOrderEmail boolean, sendShippingEmail boolean ) extent size 16 next size 16 lock mode row; create table ShoppingOrderItem ( orderItemId int8 not null primary key, orderId int8, itemId varchar(75), sku varchar(75), name varchar(200), description lvarchar, properties lvarchar, price float, quantity int, shippedDate datetime YEAR TO FRACTION ) extent size 16 next size 16 lock mode row; create table SocialActivity ( activityId int8 not null primary key, groupId int8, companyId int8, userId int8, createDate datetime YEAR TO FRACTION, mirrorActivityId int8, classNameId int8, classPK int8, type_ int, extraData lvarchar, receiverUserId int8 ) extent size 16 next size 16 lock mode row; create table SocialRelation ( uuid_ varchar(75), relationId int8 not null primary key, companyId int8, createDate datetime YEAR TO FRACTION, userId1 int8, userId2 int8, type_ int ) extent size 16 next size 16 lock mode row; create table SocialRequest ( uuid_ varchar(75), requestId int8 not null primary key, groupId int8, companyId int8, userId int8, createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, classNameId int8, classPK int8, type_ int, extraData lvarchar, receiverUserId int8, status int ) extent size 16 next size 16 lock mode row; create table Subscription ( subscriptionId int8 not null primary key, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, classNameId int8, classPK int8, frequency varchar(75) ) extent size 16 next size 16 lock mode row; create table TagsAsset ( assetId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, classNameId int8, classPK int8, visible boolean, startDate datetime YEAR TO FRACTION, endDate datetime YEAR TO FRACTION, publishDate datetime YEAR TO FRACTION, expirationDate datetime YEAR TO FRACTION, mimeType varchar(75), title varchar(255), description lvarchar, summary lvarchar, url lvarchar, height int, width int, priority float, viewCount int ) extent size 16 next size 16 lock mode row; create table TagsAssets_TagsEntries ( assetId int8 not null, entryId int8 not null, primary key (assetId, entryId) ) extent size 16 next size 16 lock mode row; create table TagsEntry ( entryId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, parentEntryId int8, name varchar(75), vocabularyId int8 ) extent size 16 next size 16 lock mode row; create table TagsProperty ( propertyId int8 not null primary key, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, entryId int8, key_ varchar(75), value varchar(255) ) extent size 16 next size 16 lock mode row; create table TagsSource ( sourceId int8 not null primary key, parentSourceId int8, name varchar(75), acronym varchar(75) ) extent size 16 next size 16 lock mode row; create table TagsVocabulary ( vocabularyId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, name varchar(75), description varchar(75), folksonomy boolean ) extent size 16 next size 16 lock mode row; create table TasksProposal ( proposalId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, classNameId int8, classPK varchar(75), name varchar(75), description lvarchar, publishDate datetime YEAR TO FRACTION, dueDate datetime YEAR TO FRACTION ) extent size 16 next size 16 lock mode row; create table TasksReview ( reviewId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, proposalId int8, assignedByUserId int8, assignedByUserName varchar(75), stage int, completed boolean, rejected boolean ) extent size 16 next size 16 lock mode row; create table User_ ( uuid_ varchar(75), userId int8 not null primary key, companyId int8, createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, defaultUser boolean, contactId int8, password_ varchar(75), passwordEncrypted boolean, passwordReset boolean, passwordModifiedDate datetime YEAR TO FRACTION, reminderQueryQuestion varchar(75), reminderQueryAnswer varchar(75), graceLoginCount int, screenName varchar(75), emailAddress varchar(75), openId lvarchar(1024), portraitId int8, languageId varchar(75), timeZoneId varchar(75), greeting varchar(255), comments lvarchar, firstName varchar(75), middleName varchar(75), lastName varchar(75), jobTitle varchar(75), loginDate datetime YEAR TO FRACTION, loginIP varchar(75), lastLoginDate datetime YEAR TO FRACTION, lastLoginIP varchar(75), lastFailedLoginDate datetime YEAR TO FRACTION, failedLoginAttempts int, lockout boolean, lockoutDate datetime YEAR TO FRACTION, agreedToTermsOfUse boolean, active_ boolean ) extent size 16 next size 16 lock mode row; create table UserGroup ( userGroupId int8 not null primary key, companyId int8, parentUserGroupId int8, name varchar(75), description lvarchar ) extent size 16 next size 16 lock mode row; create table UserGroupRole ( userId int8 not null, groupId int8 not null, roleId int8 not null, primary key (userId, groupId, roleId) ) extent size 16 next size 16 lock mode row; create table UserIdMapper ( userIdMapperId int8 not null primary key, userId int8, type_ varchar(75), description varchar(75), externalUserId varchar(75) ) extent size 16 next size 16 lock mode row; create table Users_Groups ( userId int8 not null, groupId int8 not null, primary key (userId, groupId) ) extent size 16 next size 16 lock mode row; create table Users_Orgs ( userId int8 not null, organizationId int8 not null, primary key (userId, organizationId) ) extent size 16 next size 16 lock mode row; create table Users_Permissions ( userId int8 not null, permissionId int8 not null, primary key (userId, permissionId) ) extent size 16 next size 16 lock mode row; create table Users_Roles ( userId int8 not null, roleId int8 not null, primary key (userId, roleId) ) extent size 16 next size 16 lock mode row; create table Users_UserGroups ( userGroupId int8 not null, userId int8 not null, primary key (userGroupId, userId) ) extent size 16 next size 16 lock mode row; create table UserTracker ( userTrackerId int8 not null primary key, companyId int8, userId int8, modifiedDate datetime YEAR TO FRACTION, sessionId varchar(200), remoteAddr varchar(75), remoteHost varchar(75), userAgent varchar(200) ) extent size 16 next size 16 lock mode row; create table UserTrackerPath ( userTrackerPathId int8 not null primary key, userTrackerId int8, path_ lvarchar, pathDate datetime YEAR TO FRACTION ) extent size 16 next size 16 lock mode row; create table Vocabulary ( vocabularyId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, name varchar(75), description varchar(75), folksonomy boolean ) extent size 16 next size 16 lock mode row; create table WebDAVProps ( webDavPropsId int8 not null primary key, companyId int8, createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, classNameId int8, classPK int8, props text ) extent size 16 next size 16 lock mode row; create table Website ( websiteId int8 not null primary key, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, classNameId int8, classPK int8, url lvarchar, typeId int, primary_ boolean ) extent size 16 next size 16 lock mode row; create table WikiNode ( uuid_ varchar(75), nodeId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, name varchar(75), description lvarchar, lastPostDate datetime YEAR TO FRACTION ) extent size 16 next size 16 lock mode row; create table WikiPage ( uuid_ varchar(75), pageId int8 not null primary key, resourcePrimKey int8, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, nodeId int8, title varchar(255), version float, minorEdit boolean, content text, summary lvarchar, format varchar(75), head boolean, parentTitle varchar(75), redirectTitle varchar(75) ) extent size 16 next size 16 lock mode row; create table WikiPageResource ( resourcePrimKey int8 not null primary key, nodeId int8, title varchar(75) ) extent size 16 next size 16 lock mode row; insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (1, 'Canada', 'CA', 'CAN', '124', '001', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (2, 'China', 'CN', 'CHN', '156', '086', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (3, 'France', 'FR', 'FRA', '250', '033', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (4, 'Germany', 'DE', 'DEU', '276', '049', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (5, 'Hong Kong', 'HK', 'HKG', '344', '852', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (6, 'Hungary', 'HU', 'HUN', '348', '036', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (7, 'Israel', 'IL', 'ISR', '376', '972', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (8, 'Italy', 'IT', 'ITA', '380', '039', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (9, 'Japan', 'JP', 'JPN', '392', '081', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (10, 'South Korea', 'KR', 'KOR', '410', '082', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (11, 'Netherlands', 'NL', 'NLD', '528', '031', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (12, 'Portugal', 'PT', 'PRT', '620', '351', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (13, 'Russia', 'RU', 'RUS', '643', '007', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (14, 'Singapore', 'SG', 'SGP', '702', '065', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (15, 'Spain', 'ES', 'ESP', '724', '034', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (16, 'Turkey', 'TR', 'TUR', '792', '090', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (17, 'Vietnam', 'VM', 'VNM', '704', '084', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (18, 'United Kingdom', 'GB', 'GBR', '826', '044', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (19, 'United States', 'US', 'USA', '840', '001', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (20, 'Afghanistan', 'AF', 'AFG', '4', '093', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (21, 'Albania', 'AL', 'ALB', '8', '355', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (22, 'Algeria', 'DZ', 'DZA', '12', '213', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (23, 'American Samoa', 'AS', 'ASM', '16', '684', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (24, 'Andorra', 'AD', 'AND', '20', '376', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (25, 'Angola', 'AO', 'AGO', '24', '244', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (26, 'Anguilla', 'AI', 'AIA', '660', '264', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (27, 'Antarctica', 'AQ', 'ATA', '10', '672', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (28, 'Antigua', 'AG', 'ATG', '28', '268', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (29, 'Argentina', 'AR', 'ARG', '32', '054', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (30, 'Armenia', 'AM', 'ARM', '51', '374', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (31, 'Aruba', 'AW', 'ABW', '533', '297', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (32, 'Australia', 'AU', 'AUS', '36', '061', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (33, 'Austria', 'AT', 'AUT', '40', '043', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (34, 'Azerbaijan', 'AZ', 'AZE', '31', '994', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (35, 'Bahamas', 'BS', 'BHS', '44', '242', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (36, 'Bahrain', 'BH', 'BHR', '48', '973', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (37, 'Bangladesh', 'BD', 'BGD', '50', '880', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (38, 'Barbados', 'BB', 'BRB', '52', '246', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (39, 'Belarus', 'BY', 'BLR', '112', '375', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (40, 'Belgium', 'BE', 'BEL', '56', '032', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (41, 'Belize', 'BZ', 'BLZ', '84', '501', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (42, 'Benin', 'BJ', 'BEN', '204', '229', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (43, 'Bermuda', 'BM', 'BMU', '60', '441', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (44, 'Bhutan', 'BT', 'BTN', '64', '975', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (45, 'Bolivia', 'BO', 'BOL', '68', '591', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (46, 'Bosnia-Herzegovina', 'BA', 'BIH', '70', '387', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (47, 'Botswana', 'BW', 'BWA', '72', '267', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (48, 'Brazil', 'BR', 'BRA', '76', '055', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (49, 'British Virgin Islands', 'VG', 'VGB', '92', '284', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (50, 'Brunei', 'BN', 'BRN', '96', '673', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (51, 'Bulgaria', 'BG', 'BGR', '100', '359', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (52, 'Burkina Faso', 'BF', 'BFA', '854', '226', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (53, 'Burma (Myanmar)', 'MM', 'MMR', '104', '095', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (54, 'Burundi', 'BI', 'BDI', '108', '257', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (55, 'Cambodia', 'KH', 'KHM', '116', '855', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (56, 'Cameroon', 'CM', 'CMR', '120', '237', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (57, 'Cape Verde Island', 'CV', 'CPV', '132', '238', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (58, 'Cayman Islands', 'KY', 'CYM', '136', '345', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (59, 'Central African Republic', 'CF', 'CAF', '140', '236', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (60, 'Chad', 'TD', 'TCD', '148', '235', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (61, 'Chile', 'CL', 'CHL', '152', '056', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (62, 'Christmas Island', 'CX', 'CXR', '162', '061', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (63, 'Cocos Islands', 'CC', 'CCK', '166', '061', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (64, 'Colombia', 'CO', 'COL', '170', '057', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (65, 'Comoros', 'KM', 'COM', '174', '269', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (66, 'Republic of Congo', 'CD', 'COD', '180', '242', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (67, 'Democratic Republic of Congo', 'CG', 'COG', '178', '243', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (68, 'Cook Islands', 'CK', 'COK', '184', '682', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (69, 'Costa Rica', 'CR', 'CRI', '188', '506', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (70, 'Croatia', 'HR', 'HRV', '191', '385', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (71, 'Cuba', 'CU', 'CUB', '192', '053', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (72, 'Cyprus', 'CY', 'CYP', '196', '357', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (73, 'Czech Republic', 'CZ', 'CZE', '203', '420', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (74, 'Denmark', 'DK', 'DNK', '208', '045', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (75, 'Djibouti', 'DJ', 'DJI', '262', '253', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (76, 'Dominica', 'DM', 'DMA', '212', '767', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (77, 'Dominican Republic', 'DO', 'DOM', '214', '809', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (78, 'Ecuador', 'EC', 'ECU', '218', '593', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (79, 'Egypt', 'EG', 'EGY', '818', '020', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (80, 'El Salvador', 'SV', 'SLV', '222', '503', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (81, 'Equatorial Guinea', 'GQ', 'GNQ', '226', '240', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (82, 'Eritrea', 'ER', 'ERI', '232', '291', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (83, 'Estonia', 'EE', 'EST', '233', '372', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (84, 'Ethiopia', 'ET', 'ETH', '231', '251', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (85, 'Faeroe Islands', 'FO', 'FRO', '234', '298', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (86, 'Falkland Islands', 'FK', 'FLK', '238', '500', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (87, 'Fiji Islands', 'FJ', 'FJI', '242', '679', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (88, 'Finland', 'FI', 'FIN', '246', '358', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (89, 'French Guiana', 'GF', 'GUF', '254', '594', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (90, 'French Polynesia', 'PF', 'PYF', '258', '689', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (91, 'Gabon', 'GA', 'GAB', '266', '241', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (92, 'Gambia', 'GM', 'GMB', '270', '220', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (93, 'Georgia', 'GE', 'GEO', '268', '995', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (94, 'Ghana', 'GH', 'GHA', '288', '233', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (95, 'Gibraltar', 'GI', 'GIB', '292', '350', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (96, 'Greece', 'GR', 'GRC', '300', '030', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (97, 'Greenland', 'GL', 'GRL', '304', '299', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (98, 'Grenada', 'GD', 'GRD', '308', '473', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (99, 'Guadeloupe', 'GP', 'GLP', '312', '590', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (100, 'Guam', 'GU', 'GUM', '316', '671', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (101, 'Guatemala', 'GT', 'GTM', '320', '502', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (102, 'Guinea', 'GN', 'GIN', '324', '224', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (103, 'Guinea-Bissau', 'GW', 'GNB', '624', '245', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (104, 'Guyana', 'GY', 'GUY', '328', '592', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (105, 'Haiti', 'HT', 'HTI', '332', '509', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (106, 'Honduras', 'HN', 'HND', '340', '504', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (107, 'Iceland', 'IS', 'ISL', '352', '354', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (108, 'India', 'IN', 'IND', '356', '091', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (109, 'Indonesia', 'ID', 'IDN', '360', '062', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (110, 'Iran', 'IR', 'IRN', '364', '098', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (111, 'Iraq', 'IQ', 'IRQ', '368', '964', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (112, 'Ireland', 'IE', 'IRL', '372', '353', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (113, 'Ivory Coast', 'CI', 'CIV', '384', '225', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (114, 'Jamaica', 'JM', 'JAM', '388', '876', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (115, 'Jordan', 'JO', 'JOR', '400', '962', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (116, 'Kazakhstan', 'KZ', 'KAZ', '398', '007', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (117, 'Kenya', 'KE', 'KEN', '404', '254', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (118, 'Kiribati', 'KI', 'KIR', '408', '686', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (119, 'Kuwait', 'KW', 'KWT', '414', '965', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (120, 'North Korea', 'KP', 'PRK', '408', '850', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (121, 'Kyrgyzstan', 'KG', 'KGZ', '471', '996', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (122, 'Laos', 'LA', 'LAO', '418', '856', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (123, 'Latvia', 'LV', 'LVA', '428', '371', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (124, 'Lebanon', 'LB', 'LBN', '422', '961', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (125, 'Lesotho', 'LS', 'LSO', '426', '266', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (126, 'Liberia', 'LR', 'LBR', '430', '231', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (127, 'Libya', 'LY', 'LBY', '434', '218', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (128, 'Liechtenstein', 'LI', 'LIE', '438', '423', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (129, 'Lithuania', 'LT', 'LTU', '440', '370', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (130, 'Luxembourg', 'LU', 'LUX', '442', '352', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (131, 'Macau', 'MO', 'MAC', '446', '853', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (132, 'Macedonia', 'MK', 'MKD', '807', '389', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (133, 'Madagascar', 'MG', 'MDG', '450', '261', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (134, 'Malawi', 'MW', 'MWI', '454', '265', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (135, 'Malaysia', 'MY', 'MYS', '458', '060', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (136, 'Maldives', 'MV', 'MDV', '462', '960', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (137, 'Mali', 'ML', 'MLI', '466', '223', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (138, 'Malta', 'MT', 'MLT', '470', '356', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (139, 'Marshall Islands', 'MH', 'MHL', '584', '692', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (140, 'Martinique', 'MQ', 'MTQ', '474', '596', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (141, 'Mauritania', 'MR', 'MRT', '478', '222', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (142, 'Mauritius', 'MU', 'MUS', '480', '230', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (143, 'Mayotte Island', 'YT', 'MYT', '175', '269', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (144, 'Mexico', 'MX', 'MEX', '484', '052', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (145, 'Micronesia', 'FM', 'FSM', '583', '691', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (146, 'Moldova', 'MD', 'MDA', '498', '373', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (147, 'Monaco', 'MC', 'MCO', '492', '377', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (148, 'Mongolia', 'MN', 'MNG', '496', '976', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (149, 'Montenegro', 'ME', 'MNE', '499', '382', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (150, 'Montserrat', 'MS', 'MSR', '500', '664', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (151, 'Morocco', 'MA', 'MAR', '504', '212', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (152, 'Mozambique', 'MZ', 'MOZ', '508', '258', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (153, 'Namibia', 'NA', 'NAM', '516', '264', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (154, 'Nauru', 'NR', 'NRU', '520', '674', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (155, 'Nepal', 'NP', 'NPL', '524', '977', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (156, 'Netherlands Antilles', 'AN', 'ANT', '530', '599', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (157, 'New Caledonia', 'NC', 'NCL', '540', '687', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (158, 'New Zealand', 'NZ', 'NZL', '554', '064', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (159, 'Nicaragua', 'NI', 'NIC', '558', '505', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (160, 'Niger', 'NE', 'NER', '562', '227', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (161, 'Nigeria', 'NG', 'NGA', '566', '234', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (162, 'Niue', 'NU', 'NIU', '570', '683', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (163, 'Norfolk Island', 'NF', 'NFK', '574', '672', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (164, 'Norway', 'NO', 'NOR', '578', '047', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (165, 'Oman', 'OM', 'OMN', '512', '968', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (166, 'Pakistan', 'PK', 'PAK', '586', '092', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (167, 'Palau', 'PW', 'PLW', '585', '680', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (168, 'Palestine', 'PS', 'PSE', '275', '970', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (169, 'Panama', 'PA', 'PAN', '591', '507', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (170, 'Papua New Guinea', 'PG', 'PNG', '598', '675', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (171, 'Paraguay', 'PY', 'PRY', '600', '595', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (172, 'Peru', 'PE', 'PER', '604', '051', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (173, 'Philippines', 'PH', 'PHL', '608', '063', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (174, 'Poland', 'PL', 'POL', '616', '048', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (175, 'Puerto Rico', 'PR', 'PRI', '630', '787', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (176, 'Qatar', 'QA', 'QAT', '634', '974', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (177, 'Reunion Island', 'RE', 'REU', '638', '262', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (178, 'Romania', 'RO', 'ROU', '642', '040', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (179, 'Rwanda', 'RW', 'RWA', '646', '250', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (180, 'St. Helena', 'SH', 'SHN', '654', '290', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (181, 'St. Kitts', 'KN', 'KNA', '659', '869', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (182, 'St. Lucia', 'LC', 'LCA', '662', '758', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (183, 'St. Pierre & Miquelon', 'PM', 'SPM', '666', '508', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (184, 'St. Vincent', 'VC', 'VCT', '670', '784', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (185, 'San Marino', 'SM', 'SMR', '674', '378', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (186, 'Sao Tome & Principe', 'ST', 'STP', '678', '239', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (187, 'Saudi Arabia', 'SA', 'SAU', '682', '966', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (188, 'Senegal', 'SN', 'SEN', '686', '221', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (189, 'Serbia', 'RS', 'SRB', '688', '381', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (190, 'Seychelles', 'SC', 'SYC', '690', '248', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (191, 'Sierra Leone', 'SL', 'SLE', '694', '249', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (192, 'Slovakia', 'SK', 'SVK', '703', '421', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (193, 'Slovenia', 'SI', 'SVN', '705', '386', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (194, 'Solomon Islands', 'SB', 'SLB', '90', '677', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (195, 'Somalia', 'SO', 'SOM', '706', '252', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (196, 'South Africa', 'ZA', 'ZAF', '710', '027', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (197, 'Sri Lanka', 'LK', 'LKA', '144', '094', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (198, 'Sudan', 'SD', 'SDN', '736', '095', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (199, 'Suriname', 'SR', 'SUR', '740', '597', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (200, 'Swaziland', 'SZ', 'SWZ', '748', '268', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (201, 'Sweden', 'SE', 'SWE', '752', '046', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (202, 'Switzerland', 'CH', 'CHE', '756', '041', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (203, 'Syria', 'SY', 'SYR', '760', '963', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (204, 'Taiwan', 'TW', 'TWN', '158', '886', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (205, 'Tajikistan', 'TJ', 'TJK', '762', '992', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (206, 'Tanzania', 'TZ', 'TZA', '834', '255', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (207, 'Thailand', 'TH', 'THA', '764', '066', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (208, 'Togo', 'TG', 'TGO', '768', '228', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (209, 'Tonga', 'TO', 'TON', '776', '676', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (210, 'Trinidad & Tobago', 'TT', 'TTO', '780', '868', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (211, 'Tunisia', 'TN', 'TUN', '788', '216', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (212, 'Turkmenistan', 'TM', 'TKM', '795', '993', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (213, 'Turks & Caicos', 'TC', 'TCA', '796', '649', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (214, 'Tuvalu', 'TV', 'TUV', '798', '688', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (215, 'Uganda', 'UG', 'UGA', '800', '256', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (216, 'Ukraine', 'UA', 'UKR', '804', '380', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (217, 'United Arab Emirates', 'AE', 'ARE', '784', '971', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (218, 'Uruguay', 'UY', 'URY', '858', '598', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (219, 'Uzbekistan', 'UZ', 'UZB', '860', '998', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (220, 'Vanuatu', 'VU', 'VUT', '548', '678', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (221, 'Vatican City', 'VA', 'VAT', '336', '039', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (222, 'Venezuela', 'VE', 'VEN', '862', '058', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (223, 'Wallis & Futuna', 'WF', 'WLF', '876', '681', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (224, 'Western Samoa', 'EH', 'ESH', '732', '685', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (225, 'Yemen', 'YE', 'YEM', '887', '967', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (226, 'Zambia', 'ZM', 'ZMB', '894', '260', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (227, 'Zimbabwe', 'ZW', 'ZWE', '716', '263', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (1001, 1, 'AB', 'Alberta', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (1002, 1, 'BC', 'British Columbia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (1003, 1, 'MB', 'Manitoba', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (1004, 1, 'NB', 'New Brunswick', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (1005, 1, 'NL', 'Newfoundland and Labrador', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (1006, 1, 'NT', 'Northwest Territories', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (1007, 1, 'NS', 'Nova Scotia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (1008, 1, 'NU', 'Nunavut', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (1009, 1, 'ON', 'Ontario', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (1010, 1, 'PE', 'Prince Edward Island', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (1011, 1, 'QC', 'Quebec', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (1012, 1, 'SK', 'Saskatchewan', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (1013, 1, 'YT', 'Yukon', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3001, 3, 'A', 'Alsace', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3002, 3, 'B', 'Aquitaine', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3003, 3, 'C', 'Auvergne', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3004, 3, 'P', 'Basse-Normandie', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3005, 3, 'D', 'Bourgogne', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3006, 3, 'E', 'Bretagne', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3007, 3, 'F', 'Centre', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3008, 3, 'G', 'Champagne-Ardenne', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3009, 3, 'H', 'Corse', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3010, 3, 'GF', 'Guyane', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3011, 3, 'I', 'Franche Comté', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3012, 3, 'GP', 'Guadeloupe', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3013, 3, 'Q', 'Haute-Normandie', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3014, 3, 'J', 'Île-de-France', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3015, 3, 'K', 'Languedoc-Roussillon', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3016, 3, 'L', 'Limousin', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3017, 3, 'M', 'Lorraine', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3018, 3, 'MQ', 'Martinique', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3019, 3, 'N', 'Midi-Pyrénées', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3020, 3, 'O', 'Nord Pas de Calais', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3021, 3, 'R', 'Pays de la Loire', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3022, 3, 'S', 'Picardie', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3023, 3, 'T', 'Poitou-Charentes', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3024, 3, 'U', 'Provence-Alpes-Côte-d\'Azur', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3025, 3, 'RE', 'Réunion', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3026, 3, 'V', 'Rhône-Alpes', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (4001, 4, 'BW', 'Baden-Württemberg', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (4002, 4, 'BY', 'Bayern', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (4003, 4, 'BE', 'Berlin', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (4004, 4, 'BR', 'Brandenburg', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (4005, 4, 'HB', 'Bremen', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (4006, 4, 'HH', 'Hamburg', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (4007, 4, 'HE', 'Hessen', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (4008, 4, 'MV', 'Mecklenburg-Vorpommern', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (4009, 4, 'NI', 'Niedersachsen', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (4010, 4, 'NW', 'Nordrhein-Westfalen', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (4011, 4, 'RP', 'Rheinland-Pfalz', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (4012, 4, 'SL', 'Saarland', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (4013, 4, 'SN', 'Sachsen', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (4014, 4, 'ST', 'Sachsen-Anhalt', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (4015, 4, 'SH', 'Schleswig-Holstein', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (4016, 4, 'TH', 'Thüringen', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8001, 8, 'AG', 'Agrigento', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8002, 8, 'AL', 'Alessandria', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8003, 8, 'AN', 'Ancona', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8004, 8, 'AO', 'Aosta', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8005, 8, 'AR', 'Arezzo', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8006, 8, 'AP', 'Ascoli Piceno', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8007, 8, 'AT', 'Asti', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8008, 8, 'AV', 'Avellino', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8009, 8, 'BA', 'Bari', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8010, 8, 'BT', 'Barletta-Andria-Trani', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8011, 8, 'BL', 'Belluno', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8012, 8, 'BN', 'Benevento', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8013, 8, 'BG', 'Bergamo', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8014, 8, 'BI', 'Biella', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8015, 8, 'BO', 'Bologna', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8016, 8, 'BZ', 'Bolzano', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8017, 8, 'BS', 'Brescia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8018, 8, 'BR', 'Brindisi', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8019, 8, 'CA', 'Cagliari', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8020, 8, 'CL', 'Caltanissetta', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8021, 8, 'CB', 'Campobasso', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8022, 8, 'CI', 'Carbonia-Iglesias', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8023, 8, 'CE', 'Caserta', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8024, 8, 'CT', 'Catania', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8025, 8, 'CZ', 'Catanzaro', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8026, 8, 'CH', 'Chieti', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8027, 8, 'CO', 'Como', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8028, 8, 'CS', 'Cosenza', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8029, 8, 'CR', 'Cremona', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8030, 8, 'KR', 'Crotone', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8031, 8, 'CN', 'Cuneo', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8032, 8, 'EN', 'Enna', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8033, 8, 'FM', 'Fermo', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8034, 8, 'FE', 'Ferrara', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8035, 8, 'FI', 'Firenze', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8036, 8, 'FG', 'Foggia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8037, 8, 'FC', 'Forli-Cesena', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8038, 8, 'FR', 'Frosinone', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8039, 8, 'GE', 'Genova', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8040, 8, 'GO', 'Gorizia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8041, 8, 'GR', 'Grosseto', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8042, 8, 'IM', 'Imperia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8043, 8, 'IS', 'Isernia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8044, 8, 'AQ', 'L''Aquila', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8045, 8, 'SP', 'La Spezia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8046, 8, 'LT', 'Latina', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8047, 8, 'LE', 'Lecce', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8048, 8, 'LC', 'Lecco', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8049, 8, 'LI', 'Livorno', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8050, 8, 'LO', 'Lodi', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8051, 8, 'LU', 'Lucca', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8052, 8, 'MC', 'Macerata', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8053, 8, 'MN', 'Mantova', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8054, 8, 'MS', 'Massa-Carrara', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8055, 8, 'MT', 'Matera', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8056, 8, 'MA', 'Medio Campidano', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8057, 8, 'ME', 'Messina', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8058, 8, 'MI', 'Milano', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8059, 8, 'MO', 'Modena', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8060, 8, 'MZ', 'Monza', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8061, 8, 'NA', 'Napoli', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8062, 8, 'NO', 'Novara', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8063, 8, 'NU', 'Nuoro', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8064, 8, 'OG', 'Ogliastra', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8065, 8, 'OT', 'Olbia-Tempio', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8066, 8, 'OR', 'Oristano', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8067, 8, 'PD', 'Padova', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8068, 8, 'PA', 'Palermo', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8069, 8, 'PR', 'Parma', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8070, 8, 'PV', 'Pavia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8071, 8, 'PG', 'Perugia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8072, 8, 'PU', 'Pesaro e Urbino', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8073, 8, 'PE', 'Pescara', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8074, 8, 'PC', 'Piacenza', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8075, 8, 'PI', 'Pisa', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8076, 8, 'PT', 'Pistoia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8077, 8, 'PN', 'Pordenone', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8078, 8, 'PZ', 'Potenza', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8079, 8, 'PO', 'Prato', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8080, 8, 'RG', 'Ragusa', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8081, 8, 'RA', 'Ravenna', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8082, 8, 'RC', 'Reggio Calabria', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8083, 8, 'RE', 'Reggio Emilia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8084, 8, 'RI', 'Rieti', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8085, 8, 'RN', 'Rimini', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8086, 8, 'RM', 'Roma', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8087, 8, 'RO', 'Rovigo', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8088, 8, 'SA', 'Salerno', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8089, 8, 'SS', 'Sassari', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8090, 8, 'SV', 'Savona', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8091, 8, 'SI', 'Siena', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8092, 8, 'SR', 'Siracusa', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8093, 8, 'SO', 'Sondrio', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8094, 8, 'TA', 'Taranto', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8095, 8, 'TE', 'Teramo', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8096, 8, 'TR', 'Terni', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8097, 8, 'TO', 'Torino', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8098, 8, 'TP', 'Trapani', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8099, 8, 'TN', 'Trento', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8100, 8, 'TV', 'Treviso', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8101, 8, 'TS', 'Trieste', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8102, 8, 'UD', 'Udine', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8103, 8, 'VA', 'Varese', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8104, 8, 'VE', 'Venezia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8105, 8, 'VB', 'Verbano-Cusio-Ossola', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8106, 8, 'VC', 'Vercelli', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8107, 8, 'VR', 'Verona', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8108, 8, 'VV', 'Vibo Valentia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8109, 8, 'VI', 'Vicenza', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8110, 8, 'VT', 'Viterbo', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (15001, 15, 'AN', 'Andalusia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (15002, 15, 'AR', 'Aragon', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (15003, 15, 'AS', 'Asturias', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (15004, 15, 'IB', 'Balearic Islands', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (15005, 15, 'PV', 'Basque Country', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (15006, 15, 'CN', 'Canary Islands', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (15007, 15, 'CB', 'Cantabria', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (15008, 15, 'CL', 'Castile and Leon', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (15009, 15, 'CM', 'Castile-La Mancha', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (15010, 15, 'CT', 'Catalonia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (15011, 15, 'CE', 'Ceuta', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (15012, 15, 'EX', 'Extremadura', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (15013, 15, 'GA', 'Galicia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (15014, 15, 'LO', 'La Rioja', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (15015, 15, 'M', 'Madrid', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (15016, 15, 'ML', 'Melilla', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (15017, 15, 'MU', 'Murcia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (15018, 15, 'NA', 'Navarra', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (15019, 15, 'VC', 'Valencia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19001, 19, 'AL', 'Alabama', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19002, 19, 'AK', 'Alaska', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19003, 19, 'AZ', 'Arizona', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19004, 19, 'AR', 'Arkansas', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19005, 19, 'CA', 'California', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19006, 19, 'CO', 'Colorado', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19007, 19, 'CT', 'Connecticut', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19008, 19, 'DC', 'District of Columbia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19009, 19, 'DE', 'Delaware', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19010, 19, 'FL', 'Florida', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19011, 19, 'GA', 'Georgia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19012, 19, 'HI', 'Hawaii', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19013, 19, 'ID', 'Idaho', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19014, 19, 'IL', 'Illinois', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19015, 19, 'IN', 'Indiana', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19016, 19, 'IA', 'Iowa', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19017, 19, 'KS', 'Kansas', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19018, 19, 'KY', 'Kentucky ', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19019, 19, 'LA', 'Louisiana ', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19020, 19, 'ME', 'Maine', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19021, 19, 'MD', 'Maryland', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19022, 19, 'MA', 'Massachusetts', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19023, 19, 'MI', 'Michigan', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19024, 19, 'MN', 'Minnesota', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19025, 19, 'MS', 'Mississippi', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19026, 19, 'MO', 'Missouri', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19027, 19, 'MT', 'Montana', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19028, 19, 'NE', 'Nebraska', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19029, 19, 'NV', 'Nevada', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19030, 19, 'NH', 'New Hampshire', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19031, 19, 'NJ', 'New Jersey', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19032, 19, 'NM', 'New Mexico', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19033, 19, 'NY', 'New York', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19034, 19, 'NC', 'North Carolina', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19035, 19, 'ND', 'North Dakota', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19036, 19, 'OH', 'Ohio', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19037, 19, 'OK', 'Oklahoma ', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19038, 19, 'OR', 'Oregon', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19039, 19, 'PA', 'Pennsylvania', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19040, 19, 'PR', 'Puerto Rico', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19041, 19, 'RI', 'Rhode Island', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19042, 19, 'SC', 'South Carolina', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19043, 19, 'SD', 'South Dakota', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19044, 19, 'TN', 'Tennessee', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19045, 19, 'TX', 'Texas', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19046, 19, 'UT', 'Utah', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19047, 19, 'VT', 'Vermont', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19048, 19, 'VA', 'Virginia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19049, 19, 'WA', 'Washington', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19050, 19, 'WV', 'West Virginia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19051, 19, 'WI', 'Wisconsin', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19052, 19, 'WY', 'Wyoming', 'T'); -- -- List types for accounts -- insert into ListType (listTypeId, name, type_) values (10000, 'Billing', 'com.liferay.portal.model.Account.address'); insert into ListType (listTypeId, name, type_) values (10001, 'Other', 'com.liferay.portal.model.Account.address'); insert into ListType (listTypeId, name, type_) values (10002, 'P.O. Box', 'com.liferay.portal.model.Account.address'); insert into ListType (listTypeId, name, type_) values (10003, 'Shipping', 'com.liferay.portal.model.Account.address'); insert into ListType (listTypeId, name, type_) values (10004, 'E-mail', 'com.liferay.portal.model.Account.emailAddress'); insert into ListType (listTypeId, name, type_) values (10005, 'E-mail 2', 'com.liferay.portal.model.Account.emailAddress'); insert into ListType (listTypeId, name, type_) values (10006, 'E-mail 3', 'com.liferay.portal.model.Account.emailAddress'); insert into ListType (listTypeId, name, type_) values (10007, 'Fax', 'com.liferay.portal.model.Account.phone'); insert into ListType (listTypeId, name, type_) values (10008, 'Local', 'com.liferay.portal.model.Account.phone'); insert into ListType (listTypeId, name, type_) values (10009, 'Other', 'com.liferay.portal.model.Account.phone'); insert into ListType (listTypeId, name, type_) values (10010, 'Toll-Free', 'com.liferay.portal.model.Account.phone'); insert into ListType (listTypeId, name, type_) values (10011, 'TTY', 'com.liferay.portal.model.Account.phone'); insert into ListType (listTypeId, name, type_) values (10012, 'Intranet', 'com.liferay.portal.model.Account.website'); insert into ListType (listTypeId, name, type_) values (10013, 'Public', 'com.liferay.portal.model.Account.website'); -- -- List types for contacts -- insert into ListType (listTypeId, name, type_) values (11000, 'Business', 'com.liferay.portal.model.Contact.address'); insert into ListType (listTypeId, name, type_) values (11001, 'Other', 'com.liferay.portal.model.Contact.address'); insert into ListType (listTypeId, name, type_) values (11002, 'Personal', 'com.liferay.portal.model.Contact.address'); insert into ListType (listTypeId, name, type_) values (11003, 'E-mail', 'com.liferay.portal.model.Contact.emailAddress'); insert into ListType (listTypeId, name, type_) values (11004, 'E-mail 2', 'com.liferay.portal.model.Contact.emailAddress'); insert into ListType (listTypeId, name, type_) values (11005, 'E-mail 3', 'com.liferay.portal.model.Contact.emailAddress'); insert into ListType (listTypeId, name, type_) values (11006, 'Business', 'com.liferay.portal.model.Contact.phone'); insert into ListType (listTypeId, name, type_) values (11007, 'Business Fax', 'com.liferay.portal.model.Contact.phone'); insert into ListType (listTypeId, name, type_) values (11008, 'Mobile', 'com.liferay.portal.model.Contact.phone'); insert into ListType (listTypeId, name, type_) values (11009, 'Other', 'com.liferay.portal.model.Contact.phone'); insert into ListType (listTypeId, name, type_) values (11010, 'Pager', 'com.liferay.portal.model.Contact.phone'); insert into ListType (listTypeId, name, type_) values (11011, 'Personal', 'com.liferay.portal.model.Contact.phone'); insert into ListType (listTypeId, name, type_) values (11012, 'Personal Fax', 'com.liferay.portal.model.Contact.phone'); insert into ListType (listTypeId, name, type_) values (11013, 'TTY', 'com.liferay.portal.model.Contact.phone'); insert into ListType (listTypeId, name, type_) values (11014, 'Dr.', 'com.liferay.portal.model.Contact.prefix'); insert into ListType (listTypeId, name, type_) values (11015, 'Mr.', 'com.liferay.portal.model.Contact.prefix'); insert into ListType (listTypeId, name, type_) values (11016, 'Mrs.', 'com.liferay.portal.model.Contact.prefix'); insert into ListType (listTypeId, name, type_) values (11017, 'Ms.', 'com.liferay.portal.model.Contact.prefix'); insert into ListType (listTypeId, name, type_) values (11020, 'II', 'com.liferay.portal.model.Contact.suffix'); insert into ListType (listTypeId, name, type_) values (11021, 'III', 'com.liferay.portal.model.Contact.suffix'); insert into ListType (listTypeId, name, type_) values (11022, 'IV', 'com.liferay.portal.model.Contact.suffix'); insert into ListType (listTypeId, name, type_) values (11023, 'Jr.', 'com.liferay.portal.model.Contact.suffix'); insert into ListType (listTypeId, name, type_) values (11024, 'PhD.', 'com.liferay.portal.model.Contact.suffix'); insert into ListType (listTypeId, name, type_) values (11025, 'Sr.', 'com.liferay.portal.model.Contact.suffix'); insert into ListType (listTypeId, name, type_) values (11026, 'Blog', 'com.liferay.portal.model.Contact.website'); insert into ListType (listTypeId, name, type_) values (11027, 'Business', 'com.liferay.portal.model.Contact.website'); insert into ListType (listTypeId, name, type_) values (11028, 'Other', 'com.liferay.portal.model.Contact.website'); insert into ListType (listTypeId, name, type_) values (11029, 'Personal', 'com.liferay.portal.model.Contact.website'); -- -- List types for organizations -- insert into ListType (listTypeId, name, type_) values (12000, 'Billing', 'com.liferay.portal.model.Organization.address'); insert into ListType (listTypeId, name, type_) values (12001, 'Other', 'com.liferay.portal.model.Organization.address'); insert into ListType (listTypeId, name, type_) values (12002, 'P.O. Box', 'com.liferay.portal.model.Organization.address'); insert into ListType (listTypeId, name, type_) values (12003, 'Shipping', 'com.liferay.portal.model.Organization.address'); insert into ListType (listTypeId, name, type_) values (12004, 'E-mail', 'com.liferay.portal.model.Organization.emailAddress'); insert into ListType (listTypeId, name, type_) values (12005, 'E-mail 2', 'com.liferay.portal.model.Organization.emailAddress'); insert into ListType (listTypeId, name, type_) values (12006, 'E-mail 3', 'com.liferay.portal.model.Organization.emailAddress'); insert into ListType (listTypeId, name, type_) values (12007, 'Fax', 'com.liferay.portal.model.Organization.phone'); insert into ListType (listTypeId, name, type_) values (12008, 'Local', 'com.liferay.portal.model.Organization.phone'); insert into ListType (listTypeId, name, type_) values (12009, 'Other', 'com.liferay.portal.model.Organization.phone'); insert into ListType (listTypeId, name, type_) values (12010, 'Toll-Free', 'com.liferay.portal.model.Organization.phone'); insert into ListType (listTypeId, name, type_) values (12011, 'TTY', 'com.liferay.portal.model.Organization.phone'); insert into ListType (listTypeId, name, type_) values (12012, 'Administrative', 'com.liferay.portal.model.Organization.service'); insert into ListType (listTypeId, name, type_) values (12013, 'Contracts', 'com.liferay.portal.model.Organization.service'); insert into ListType (listTypeId, name, type_) values (12014, 'Donation', 'com.liferay.portal.model.Organization.service'); insert into ListType (listTypeId, name, type_) values (12015, 'Retail', 'com.liferay.portal.model.Organization.service'); insert into ListType (listTypeId, name, type_) values (12016, 'Training', 'com.liferay.portal.model.Organization.service'); insert into ListType (listTypeId, name, type_) values (12017, 'Full Member', 'com.liferay.portal.model.Organization.status'); insert into ListType (listTypeId, name, type_) values (12018, 'Provisional Member', 'com.liferay.portal.model.Organization.status'); insert into ListType (listTypeId, name, type_) values (12019, 'Intranet', 'com.liferay.portal.model.Organization.website'); insert into ListType (listTypeId, name, type_) values (12020, 'Public', 'com.liferay.portal.model.Organization.website'); insert into Counter values ('com.liferay.counter.model.Counter', 10000); insert into Release_ (releaseId, createDate, modifiedDate, buildNumber, verified) values (1, CURRENT YEAR TO FRACTION, CURRENT YEAR TO FRACTION, 5203, 'F'); create table QUARTZ_JOB_DETAILS ( JOB_NAME varchar(80) not null, JOB_GROUP varchar(80) not null, DESCRIPTION varchar(120), JOB_CLASS_NAME varchar(128) not null, IS_DURABLE boolean not null, IS_VOLATILE boolean not null, IS_STATEFUL boolean not null, REQUESTS_RECOVERY boolean not null, JOB_DATA byte in table, primary key (JOB_NAME, JOB_GROUP) ) extent size 16 next size 16 lock mode row; create table QUARTZ_JOB_LISTENERS ( JOB_NAME varchar(80) not null, JOB_GROUP varchar(80) not null, JOB_LISTENER varchar(80) not null, primary key (JOB_NAME, JOB_GROUP, JOB_LISTENER) ) extent size 16 next size 16 lock mode row; create table QUARTZ_TRIGGERS ( TRIGGER_NAME varchar(80) not null, TRIGGER_GROUP varchar(80) not null, JOB_NAME varchar(80) not null, JOB_GROUP varchar(80) not null, IS_VOLATILE boolean not null, DESCRIPTION varchar(120), NEXT_FIRE_TIME int8, PREV_FIRE_TIME int8, PRIORITY int, TRIGGER_STATE varchar(16) not null, TRIGGER_TYPE varchar(8) not null, START_TIME int8 not null, END_TIME int8, CALENDAR_NAME varchar(80), MISFIRE_INSTR int, JOB_DATA byte in table, primary key (TRIGGER_NAME, TRIGGER_GROUP) ) extent size 16 next size 16 lock mode row; create table QUARTZ_SIMPLE_TRIGGERS ( TRIGGER_NAME varchar(80) not null, TRIGGER_GROUP varchar(80) not null, REPEAT_COUNT int8 not null, REPEAT_INTERVAL int8 not null, TIMES_TRIGGERED int8 not null, primary key (TRIGGER_NAME, TRIGGER_GROUP) ) extent size 16 next size 16 lock mode row; create table QUARTZ_CRON_TRIGGERS ( TRIGGER_NAME varchar(80) not null, TRIGGER_GROUP varchar(80) not null, CRON_EXPRESSION varchar(80) not null, TIME_ZONE_ID varchar(80), primary key (TRIGGER_NAME, TRIGGER_GROUP) ) extent size 16 next size 16 lock mode row; create table QUARTZ_BLOB_TRIGGERS ( TRIGGER_NAME varchar(80) not null, TRIGGER_GROUP varchar(80) not null, BLOB_DATA byte in table, primary key (TRIGGER_NAME, TRIGGER_GROUP) ) extent size 16 next size 16 lock mode row; create table QUARTZ_TRIGGER_LISTENERS ( TRIGGER_NAME varchar(80) not null, TRIGGER_GROUP varchar(80) not null, TRIGGER_LISTENER varchar(80) not null, primary key (TRIGGER_NAME, TRIGGER_GROUP, TRIGGER_LISTENER) ) extent size 16 next size 16 lock mode row; create table QUARTZ_CALENDARS ( CALENDAR_NAME varchar(80) not null primary key, CALENDAR byte in table not null ) extent size 16 next size 16 lock mode row; create table QUARTZ_PAUSED_TRIGGER_GRPS ( TRIGGER_GROUP varchar(80) not null primary key ) extent size 16 next size 16 lock mode row; create table QUARTZ_FIRED_TRIGGERS ( ENTRY_ID varchar(95) not null primary key, TRIGGER_NAME varchar(80) not null, TRIGGER_GROUP varchar(80) not null, IS_VOLATILE boolean not null, INSTANCE_NAME varchar(80) not null, FIRED_TIME int8 not null, PRIORITY int not null, STATE varchar(16) not null, JOB_NAME varchar(80), JOB_GROUP varchar(80), IS_STATEFUL boolean, REQUESTS_RECOVERY boolean ) extent size 16 next size 16 lock mode row; create table QUARTZ_SCHEDULER_STATE ( INSTANCE_NAME varchar(80) not null primary key, LAST_CHECKIN_TIME int8 not null, CHECKIN_INTERVAL int8 not null ) extent size 16 next size 16 lock mode row; create table QUARTZ_LOCKS ( LOCK_NAME varchar(40) not null primary key ) extent size 16 next size 16 lock mode row; insert into QUARTZ_LOCKS values('TRIGGER_ACCESS'); insert into QUARTZ_LOCKS values('JOB_ACCESS'); insert into QUARTZ_LOCKS values('CALENDAR_ACCESS'); insert into QUARTZ_LOCKS values('STATE_ACCESS'); insert into QUARTZ_LOCKS values('MISFIRE_ACCESS'); create index IX_F7655CC3 on QUARTZ_TRIGGERS (NEXT_FIRE_TIME); create index IX_9955EFB5 on QUARTZ_TRIGGERS (TRIGGER_STATE); create index IX_8040C593 on QUARTZ_TRIGGERS (TRIGGER_STATE, NEXT_FIRE_TIME); create index IX_804154AF on QUARTZ_FIRED_TRIGGERS (INSTANCE_NAME); create index IX_BAB9A1F7 on QUARTZ_FIRED_TRIGGERS (JOB_GROUP); create index IX_ADEE6A17 on QUARTZ_FIRED_TRIGGERS (JOB_NAME); create index IX_64B194F2 on QUARTZ_FIRED_TRIGGERS (TRIGGER_GROUP); create index IX_5FEABBC on QUARTZ_FIRED_TRIGGERS (TRIGGER_NAME); create index IX_20D8706C on QUARTZ_FIRED_TRIGGERS (TRIGGER_NAME, TRIGGER_GROUP);
NCIP/cagrid
cagrid/Software/portal/cagrid-portal/portals/liferay-ext/sql/portal-minimal/portal-minimal-informix.sql
SQL
bsd-3-clause
106,694
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width,initial-scale=1"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="lang:clipboard.copy" content="Copy to clipboard"> <meta name="lang:clipboard.copied" content="Copied to clipboard"> <meta name="lang:search.language" content="en"> <meta name="lang:search.pipeline.stopwords" content="True"> <meta name="lang:search.pipeline.trimmer" content="True"> <meta name="lang:search.result.none" content="No matching documents"> <meta name="lang:search.result.one" content="1 matching document"> <meta name="lang:search.result.other" content="# matching documents"> <meta name="lang:search.tokenizer" content="[\s\-]+"> <link href="https://fonts.gstatic.com/" rel="preconnect" crossorigin> <link href="https://fonts.googleapis.com/css?family=Roboto+Mono:400,500,700|Roboto:300,400,400i,700&display=fallback" rel="stylesheet"> <style> body, input { font-family: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif } code, kbd, pre { font-family: "Roboto Mono", "Courier New", Courier, monospace } </style> <link rel="stylesheet" href="../_static/stylesheets/application.css"/> <link rel="stylesheet" href="../_static/stylesheets/application-palette.css"/> <link rel="stylesheet" href="../_static/stylesheets/application-fixes.css"/> <link rel="stylesheet" href="../_static/fonts/material-icons.css"/> <meta name="theme-color" content="#3f51b5"> <script src="../_static/javascripts/modernizr.js"></script> <title>statsmodels.miscmodels.count.PoissonGMLE.loglike &#8212; statsmodels</title> <link rel="icon" type="image/png" sizes="32x32" href="../_static/icons/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="16x16" href="../_static/icons/favicon-16x16.png"> <link rel="manifest" href="../_static/icons/site.webmanifest"> <link rel="mask-icon" href="../_static/icons/safari-pinned-tab.svg" color="#919191"> <meta name="msapplication-TileColor" content="#2b5797"> <meta name="msapplication-config" content="../_static/icons/browserconfig.xml"> <link rel="stylesheet" href="../_static/stylesheets/examples.css"> <link rel="stylesheet" href="../_static/stylesheets/deprecation.css"> <link rel="stylesheet" href="../_static/material.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <link rel="stylesheet" type="text/css" href="../_static/graphviz.css" /> <script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> <script src="../_static/jquery.js"></script> <script src="../_static/underscore.js"></script> <script src="../_static/doctools.js"></script> <script src="../_static/language_data.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> <script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script> <link rel="shortcut icon" href="../_static/favicon.ico"/> <link rel="author" title="About these documents" href="../about.html" /> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="next" title="statsmodels.miscmodels.count.PoissonGMLE.loglikeobs" href="statsmodels.miscmodels.count.PoissonGMLE.loglikeobs.html" /> <link rel="prev" title="statsmodels.miscmodels.count.PoissonGMLE.initialize" href="statsmodels.miscmodels.count.PoissonGMLE.initialize.html" /> </head> <body dir=ltr data-md-color-primary=indigo data-md-color-accent=blue> <svg class="md-svg"> <defs data-children-count="0"> <svg xmlns="http://www.w3.org/2000/svg" width="416" height="448" viewBox="0 0 416 448" id="__github"><path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19T128 352t-18.125-8.5-10.75-19T96 304t3.125-20.5 10.75-19T128 256t18.125 8.5 10.75 19T160 304zm160 0q0 10-3.125 20.5t-10.75 19T288 352t-18.125-8.5-10.75-19T256 304t3.125-20.5 10.75-19T288 256t18.125 8.5 10.75 19T320 304zm40 0q0-30-17.25-51T296 232q-10.25 0-48.75 5.25Q229.5 240 208 240t-39.25-2.75Q130.75 232 120 232q-29.5 0-46.75 21T56 304q0 22 8 38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0 37.25-1.75t35-7.375 30.5-15 20.25-25.75T360 304zm56-44q0 51.75-15.25 82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5T212 416q-19.5 0-35.5-.75t-36.875-3.125-38.125-7.5-34.25-12.875T37 371.5t-21.5-28.75Q0 312 0 260q0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25 30.875Q171.5 96 212 96q37 0 70 8 26.25-20.5 46.75-30.25T376 64q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34 99.5z"/></svg> </defs> </svg> <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search"> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <a href="#generated/statsmodels.miscmodels.count.PoissonGMLE.loglike" tabindex="1" class="md-skip"> Skip to content </a> <header class="md-header" data-md-component="header"> <nav class="md-header-nav md-grid"> <div class="md-flex navheader"> <div class="md-flex__cell md-flex__cell--shrink"> <a href="../index.html" title="statsmodels" class="md-header-nav__button md-logo"> <img src="../_static/statsmodels-logo-v2-bw.svg" height="26" alt="statsmodels logo"> </a> </div> <div class="md-flex__cell md-flex__cell--shrink"> <label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label> </div> <div class="md-flex__cell md-flex__cell--stretch"> <div class="md-flex__ellipsis md-header-nav__title" data-md-component="title"> <span class="md-header-nav__topic">statsmodels v0.12.1</span> <span class="md-header-nav__topic"> statsmodels.miscmodels.count.PoissonGMLE.loglike </span> </div> </div> <div class="md-flex__cell md-flex__cell--shrink"> <label class="md-icon md-icon--search md-header-nav__button" for="__search"></label> <div class="md-search" data-md-component="search" role="dialog"> <label class="md-search__overlay" for="__search"></label> <div class="md-search__inner" role="search"> <form class="md-search__form" action="../search.html" method="GET" name="search"> <input type="text" class="md-search__input" name="q" placeholder="Search" autocapitalize="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <label class="md-icon md-search__icon" for="__search"></label> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> &#xE5CD; </button> </form> <div class="md-search__output"> <div class="md-search__scrollwrap" data-md-scrollfix> <div class="md-search-result" data-md-component="result"> <div class="md-search-result__meta"> Type to start searching </div> <ol class="md-search-result__list"></ol> </div> </div> </div> </div> </div> </div> <div class="md-flex__cell md-flex__cell--shrink"> <div class="md-header-nav__source"> <a href="https://github.com/statsmodels/statsmodels" title="Go to repository" class="md-source" data-md-source="github"> <div class="md-source__icon"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24" width="28" height="28"> <use xlink:href="#__github" width="24" height="24"></use> </svg> </div> <div class="md-source__repository"> statsmodels </div> </a> </div> </div> <script src="../_static/javascripts/version_dropdown.js"></script> <script> var json_loc = "../_static/versions.json", target_loc = "../../", text = "Versions"; $( document ).ready( add_version_dropdown(json_loc, target_loc, text)); </script> </div> </nav> </header> <div class="md-container"> <nav class="md-tabs" data-md-component="tabs"> <div class="md-tabs__inner md-grid"> <ul class="md-tabs__list"> <li class="md-tabs__item"><a href="../user-guide.html" class="md-tabs__link">User Guide</a></li> <li class="md-tabs__item"><a href="../miscmodels.html" class="md-tabs__link">Other Models <code class="xref py py-mod docutils literal notranslate"><span class="pre">miscmodels</span></code></a></li> <li class="md-tabs__item"><a href="statsmodels.miscmodels.count.PoissonGMLE.html" class="md-tabs__link">statsmodels.miscmodels.count.PoissonGMLE</a></li> </ul> </div> </nav> <main class="md-main"> <div class="md-main__inner md-grid" data-md-component="container"> <div class="md-sidebar md-sidebar--primary" data-md-component="navigation"> <div class="md-sidebar__scrollwrap"> <div class="md-sidebar__inner"> <nav class="md-nav md-nav--primary" data-md-level="0"> <label class="md-nav__title md-nav__title--site" for="__drawer"> <a href="../index.html" title="statsmodels" class="md-nav__button md-logo"> <img src="../_static/statsmodels-logo-v2-bw.svg" alt=" logo" width="48" height="48"> </a> <a href="../index.html" title="statsmodels">statsmodels v0.12.1</a> </label> <div class="md-nav__source"> <a href="https://github.com/statsmodels/statsmodels" title="Go to repository" class="md-source" data-md-source="github"> <div class="md-source__icon"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24" width="28" height="28"> <use xlink:href="#__github" width="24" height="24"></use> </svg> </div> <div class="md-source__repository"> statsmodels </div> </a> </div> <ul class="md-nav__list"> <li class="md-nav__item"> <a href="../install.html" class="md-nav__link">Installing statsmodels</a> </li> <li class="md-nav__item"> <a href="../gettingstarted.html" class="md-nav__link">Getting started</a> </li> <li class="md-nav__item"> <a href="../user-guide.html" class="md-nav__link">User Guide</a> <ul class="md-nav__list"> <li class="md-nav__item"> <a href="../user-guide.html#background" class="md-nav__link">Background</a> </li> <li class="md-nav__item"> <a href="../user-guide.html#regression-and-linear-models" class="md-nav__link">Regression and Linear Models</a> </li> <li class="md-nav__item"> <a href="../user-guide.html#time-series-analysis" class="md-nav__link">Time Series Analysis</a> </li> <li class="md-nav__item"> <a href="../user-guide.html#other-models" class="md-nav__link">Other Models</a> <ul class="md-nav__list"> <li class="md-nav__item"> <a href="../duration.html" class="md-nav__link">Methods for Survival and Duration Analysis</a> </li> <li class="md-nav__item"> <a href="../nonparametric.html" class="md-nav__link">Nonparametric Methods <code class="xref py py-mod docutils literal notranslate"><span class="pre">nonparametric</span></code></a> </li> <li class="md-nav__item"> <a href="../gmm.html" class="md-nav__link">Generalized Method of Moments <code class="xref py py-mod docutils literal notranslate"><span class="pre">gmm</span></code></a> </li> <li class="md-nav__item"> <a href="../miscmodels.html" class="md-nav__link">Other Models <code class="xref py py-mod docutils literal notranslate"><span class="pre">miscmodels</span></code></a> </li> <li class="md-nav__item"> <a href="../multivariate.html" class="md-nav__link">Multivariate Statistics <code class="xref py py-mod docutils literal notranslate"><span class="pre">multivariate</span></code></a> </li></ul> </li> <li class="md-nav__item"> <a href="../user-guide.html#statistics-and-tools" class="md-nav__link">Statistics and Tools</a> </li> <li class="md-nav__item"> <a href="../user-guide.html#data-sets" class="md-nav__link">Data Sets</a> </li> <li class="md-nav__item"> <a href="../user-guide.html#sandbox" class="md-nav__link">Sandbox</a> </li></ul> </li> <li class="md-nav__item"> <a href="../examples/index.html" class="md-nav__link">Examples</a> </li> <li class="md-nav__item"> <a href="../api.html" class="md-nav__link">API Reference</a> </li> <li class="md-nav__item"> <a href="../about.html" class="md-nav__link">About statsmodels</a> </li> <li class="md-nav__item"> <a href="../dev/index.html" class="md-nav__link">Developer Page</a> </li> <li class="md-nav__item"> <a href="../release/index.html" class="md-nav__link">Release Notes</a> </li> </ul> </nav> </div> </div> </div> <div class="md-sidebar md-sidebar--secondary" data-md-component="toc"> <div class="md-sidebar__scrollwrap"> <div class="md-sidebar__inner"> <nav class="md-nav md-nav--secondary"> <ul class="md-nav__list" data-md-scrollfix=""> <li class="md-nav__item"><a class="md-nav__extra_link" href="../_sources/generated/statsmodels.miscmodels.count.PoissonGMLE.loglike.rst.txt">Show Source</a> </li> <li id="searchbox" class="md-nav__item"></li> </ul> </nav> </div> </div> </div> <div class="md-content"> <article class="md-content__inner md-typeset" role="main"> <h1 id="generated-statsmodels-miscmodels-count-poissongmle-loglike--page-root">statsmodels.miscmodels.count.PoissonGMLE.loglike<a class="headerlink" href="#generated-statsmodels-miscmodels-count-poissongmle-loglike--page-root" title="Permalink to this headline">¶</a></h1> <dl class="py method"> <dt id="statsmodels.miscmodels.count.PoissonGMLE.loglike"> <code class="sig-prename descclassname">PoissonGMLE.</code><code class="sig-name descname">loglike</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">params</span></em><span class="sig-paren">)</span><a class="headerlink" href="#statsmodels.miscmodels.count.PoissonGMLE.loglike" title="Permalink to this definition">¶</a></dt> <dd><p>Log-likelihood of model at params</p> </dd></dl> </article> </div> </div> </main> </div> <footer class="md-footer"> <div class="md-footer-nav"> <nav class="md-footer-nav__inner md-grid"> <a href="statsmodels.miscmodels.count.PoissonGMLE.initialize.html" title="statsmodels.miscmodels.count.PoissonGMLE.initialize" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev"> <div class="md-flex__cell md-flex__cell--shrink"> <i class="md-icon md-icon--arrow-back md-footer-nav__button"></i> </div> <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title"> <span class="md-flex__ellipsis"> <span class="md-footer-nav__direction"> Previous </span> statsmodels.miscmodels.count.PoissonGMLE.initialize </span> </div> </a> <a href="statsmodels.miscmodels.count.PoissonGMLE.loglikeobs.html" title="statsmodels.miscmodels.count.PoissonGMLE.loglikeobs" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next"> <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title"><span class="md-flex__ellipsis"> <span class="md-footer-nav__direction"> Next </span> statsmodels.miscmodels.count.PoissonGMLE.loglikeobs </span> </div> <div class="md-flex__cell md-flex__cell--shrink"><i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i> </div> </a> </nav> </div> <div class="md-footer-meta md-typeset"> <div class="md-footer-meta__inner md-grid"> <div class="md-footer-copyright"> <div class="md-footer-copyright__highlight"> &#169; Copyright 2009-2019, Josef Perktold, Skipper Seabold, Jonathan Taylor, statsmodels-developers. </div> Last updated on Oct 29, 2020. <br/> Created using <a href="http://www.sphinx-doc.org/">Sphinx</a> 3.2.1. and <a href="https://github.com/bashtage/sphinx-material/">Material for Sphinx</a> </div> </div> </div> </footer> <script src="../_static/javascripts/application.js"></script> <script>app.initialize({version: "1.0.4", url: {base: ".."}})</script> </body> </html>
statsmodels/statsmodels.github.io
v0.12.1/generated/statsmodels.miscmodels.count.PoissonGMLE.loglike.html
HTML
bsd-3-clause
18,169
/** * Copyright (c) 2015, Legendum Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * * Neither the name of ntil nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** * ntil - create a handler to call a function until the result is good. * * This package provides a single method "ntil()" which is called thus: * * ntil(performer, success, failure, opts) * * checker - a function to check a result and return true or false * performer - a function to call to perform a task which may succeed or fail * success - an optional function to process the result of a successful call * failure - an optional function to process the result of a failed call * opts - an optional hash of options (see below) * * ntil() will return a handler that may be called with any number of arguments. * The performer function will receive these arguments, with a final "next" arg * appended to the argument list, such that it should be called on completion, * passing the result (as a single argument *or* multiple arguments) thus: * * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * * var ntil = require('ntil'); * var handler = ntil( * function(result) { return result === 3 }, // the checker * function myFunc(a, b, next) { next(a + b) }, // the performer * function(result) { console.log('success! ' + result) }, // on success * function(result) { console.log('failure! ' + result) }, // on failure * {logger: console} // options * ); * * handler(1, 1); // this will fail after 7 attempts (taking about a minute) * handler(1, 2); // this will succeed immediately * * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * * ...and here's the equivalent code in a syntax more similar to promises: * * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * * var ntil = require('./ntil'); * var handler = ntil( * function(result) { return result === 3 } * ).exec( * function myFunc(a, b, next) { next(a + b) } * ).done( * function(result) { console.log('success! ' + result) } * ).fail( * function(result) { console.log('failure! ' + result) } * }.opts( * {logger: console} * ).func(); * * handler(1, 1); // this will fail after 7 attempts (taking about a minute) * handler(1, 2); // this will succeed immediately * * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * * Note that the logger includes "myFunc" in log messages, because the function * is named. An alternative is to use the "name" option (see below). * * The "checker" function checks that the result is 3, causing the first handler * to fail (it has a result of 2, not 3) and the second handler to succeed. * * The output from both these examples is: * * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * * perform: 1 failure - trying again in 1 seconds * perform: success * success! 3 * perform: 2 failures - trying again in 2 seconds * perform: 3 failures - trying again in 4 seconds * perform: 4 failures - trying again in 8 seconds * perform: 5 failures - trying again in 16 seconds * perform: 6 failures - trying again in 32 seconds * perform: too many failures (7) * failure! 2 * * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * * * The options may optionally include: * name: The name of the "performer" function we're calling, e.g. "getData" * logger: A logger object that responds to "info" and "warn" method calls * waitSecs: The initial duration in seconds to wait before retrying * waitMult: The factor by which to multiply the wait duration upon each retry * maxCalls: The maximum number of calls to make before failing * * Note that "waitSecs" defaults to 1, "waitMult" defaults to 2, and "maxCalls" * defaults to 7. * * Ideas for improvement? Email [email protected] */ (function() { "use strict"; var sig = "Check params: function ntil(checker, performer, success, failure, opts)"; function chain(checker, opts) { this.opts = function(options) { opts = options; return this } this.exec = function(perform) { this.perform = perform; return this }; this.done = function(success) { this.success = success; return this }; this.fail = function(failure) { this.failure = failure; return this }; this.func = function() { return ntil(checker, this.perform, this.success, this.failure, opts); }; } function ntil(checker, performer, success, failure, opts) { opts = opts || {}; if (typeof checker !== 'function') throw sig; if (typeof performer !== 'function') return new chain(checker, performer); var name = opts.name || performer.name || 'anonymous function', logger = opts.logger, waitSecs = opts.waitSecs || 1, waitMult = opts.waitMult || 2, maxCalls = opts.maxCalls || 7; // it takes about a minute for 7 attempts return function() { var args = Array.prototype.slice.call(arguments, 0), wait = waitSecs, calls = 0; function next() { var result = Array.prototype.slice.call(arguments, 0); if (checker.apply(checker, result) === true) { if (logger) logger.info(name + ': success'); if (typeof success === 'function') success.apply(success, result); } else { calls++; if (calls < maxCalls) { if (logger) logger.warn(name + ': ' + calls + ' failure' + (calls === 1 ? '' : 's') + ' - trying again in ' + wait + ' seconds'); setTimeout(function() { invoke(); }, wait * 1000); wait *= waitMult; } else { if (logger) logger.warn(name + ': too many failures (' + calls + ')'); if (typeof failure === 'function') failure.apply(failure, result); } } } function invoke() { try { performer.apply(performer, args); } catch (e) { if (logger) logger.warn(name + ': exception "' + e + '"'); next(); } } args.push(next); invoke(); } } if (typeof module !== 'undefined' && module.exports) { module.exports = ntil; } else { // browser? this.ntil = ntil; } }).call(this);
legendum/ntil
ntil.js
JavaScript
bsd-3-clause
7,810
<?php use yii\bootstrap\ActiveForm; use yii\helpers\Html; use yii\grid\GridView; use yii\helpers\Url; use app\models\Ticket; $this->params['breadcrumbs'][] = ['label' => Yii::t('app','ticket list'), 'url' => ['#']]; $this->params['addUrl'] = 'ticket/new'; ?> <div class="row"> <div class="col-lg-12"> <!-- START YOUR CONTENT HERE --> <div class="portlet"><!-- /Portlet --> <div class="portlet-heading dark"> <div class="portlet-title"> <h4><i class="fa fa-newspaper-o"></i> <?=Yii::t("app","my ticket") ?></h4> </div> <div class="portlet-widgets"> <a data-toggle="collapse" data-parent="#accordion" href="#basic"><i class="fa fa-chevron-down"></i></a> <span class="divider"></span> <a href="#" class="box-close"><i class="fa fa-times"></i></a> </div> <div class="clearfix"></div> </div> <div id="basic" class="panel-collapse collapse in"> <div class="portlet-body"> <div class="row"> <div class="log-lg-12"> <?=Yii::$app->session->getFlash("message")?> </div> <div class="col-lg-12"> <?=GridView::widget( [ 'dataProvider' => $dataProvider, //'filterModel' => $model, 'tableOptions' => ['class'=>'table table-bordered table-hover tc-table table-responsive'], 'layout' => '<div class="hidden-sm hidden-xs hidden-md">{summary}</div>{errors}{items}<div class="pagination pull-right">{pager}</div> <div class="clearfix"></div>', 'columns'=>[ ['class' => 'yii\grid\SerialColumn'], 'ticket_id' => [ 'attribute' => 'ticket_id', 'footer' => Yii::t('app','id'), 'headerOptions' => ['class'=>'hidden-xs hidden-sm'], 'contentOptions'=> ['class'=>'hidden-xs hidden-sm'], 'footerOptions' => ['class'=>'hidden-xs hidden-sm'], ], 'ticket_date' => [ 'attribute' => 'ticket_date', 'footer' => Yii::t('app','date'), ], 'ticket_subject' => [ 'attribute' => 'ticket_subject', 'footer' => Yii::t('app','subject'), ], 'ticket_status_string' => [ 'attribute' => 'ticket_status_string', 'footer' => Yii::t('app','status'), 'headerOptions' => ['class'=>'hidden-xs hidden-sm'], 'contentOptions'=> ['class'=>'hidden-xs hidden-sm'], 'footerOptions' => ['class'=>'hidden-xs hidden-sm'], ], 'helpdesk_name' => [ 'attribute' => 'helpdesk_name', 'footer' => Yii::t('app','support'), ], ], 'showFooter' => true , ] );?> </div> </div> </div> </div> </div><!--/Portlet --> </div> <!-- Enf of col lg--> </div> <!-- ENd of row --> <script> //for tables checkbox dem jQuery(function($) { $('.input-group.date').datepicker({ autoclose : true, format: "dd/mm/yyyy" }); $('table th input:checkbox').on('click' , function(){ var that = this; $(this).closest('table').find('tr > td:first-child input:checkbox') .each(function(){ this.checked = that.checked; $(this).closest('tr').toggleClass('selected'); }); }); $('.btn-pwd').click(function (e) { if (!confirm('<?=Yii::t('app/message','msg btn password')?>')) return false; return true; }); $('.btn-delete').click(function (e) { if (!confirm('<?=Yii::t('app/message','msg btn delete')?>')) return false; return true; }); }); </script>
suhe/bdoticket
views/ticket/ticket_all_request.php
PHP
bsd-3-clause
3,532
/* * This file is part of the Soletta Project * * Copyright (C) 2015 Intel Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * Neither the name of Intel Corporation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <errno.h> #include <netinet/in.h> #include <stdint.h> #include <stdbool.h> #include <stdio.h> #define SOL_LOG_DOMAIN &_sol_oic_server_log_domain #include "cbor.h" #include "sol-coap.h" #include "sol-json.h" #include "sol-log-internal.h" #include "sol-platform.h" #include "sol-str-slice.h" #include "sol-util.h" #include "sol-vector.h" #include "sol-oic-cbor.h" #include "sol-oic-common.h" #include "sol-oic-server.h" SOL_LOG_INTERNAL_DECLARE(_sol_oic_server_log_domain, "oic-server"); struct sol_oic_server { struct sol_coap_server *server; struct sol_coap_server *dtls_server; struct sol_vector resources; struct sol_oic_server_information *information; int refcnt; }; struct sol_oic_server_resource { struct sol_coap_resource *coap; char *href; char *rt; char *iface; enum sol_oic_resource_flag flags; struct { struct { sol_coap_responsecode_t (*handle)(const struct sol_network_link_addr *cliaddr, const void *data, const struct sol_vector *input, struct sol_vector *output); } get, put, post, delete; const void *data; } callback; }; static struct sol_oic_server oic_server; #define OIC_SERVER_CHECK(ret) \ do { \ if (oic_server.refcnt == 0) { \ SOL_WRN("OIC API used before initialization"); \ return ret; \ } \ } while (0) #define OIC_COAP_SERVER_UDP_PORT 5683 #define OIC_COAP_SERVER_DTLS_PORT 5684 static int _sol_oic_server_d(struct sol_coap_server *server, const struct sol_coap_resource *resource, struct sol_coap_packet *req, const struct sol_network_link_addr *cliaddr, void *data) { const uint8_t format_cbor = SOL_COAP_CONTENTTYPE_APPLICATION_CBOR; CborEncoder encoder, root, map, rep_map; CborError err; struct sol_coap_packet *response; const char *os_version; uint8_t *payload; uint16_t size; OIC_SERVER_CHECK(-ENOTCONN); response = sol_coap_packet_new(req); SOL_NULL_CHECK(response, -ENOMEM); sol_coap_add_option(response, SOL_COAP_OPTION_CONTENT_FORMAT, &format_cbor, sizeof(format_cbor)); if (sol_coap_packet_get_payload(response, &payload, &size) < 0) { SOL_WRN("Couldn't obtain payload from CoAP packet"); goto out; } cbor_encoder_init(&encoder, payload, size, 0); err = cbor_encoder_create_array(&encoder, &root, 2); err |= cbor_encode_uint(&root, SOL_OIC_PAYLOAD_PLATFORM); err |= cbor_encoder_create_map(&root, &map, CborIndefiniteLength); err |= cbor_encode_text_stringz(&map, SOL_OIC_KEY_HREF); err |= cbor_encode_text_stringz(&map, "/oic/d"); err |= cbor_encoder_create_map(&map, &rep_map, CborIndefiniteLength); #define APPEND_KEY_VALUE(k, v) \ do { \ err |= cbor_encode_text_stringz(&rep_map, k); \ err |= cbor_encode_text_string(&rep_map, \ oic_server.information->v.data, oic_server.information->v.len); \ } while (0) APPEND_KEY_VALUE(SOL_OIC_KEY_MANUF_NAME, manufacturer_name); APPEND_KEY_VALUE(SOL_OIC_KEY_MANUF_URL, manufacturer_url); APPEND_KEY_VALUE(SOL_OIC_KEY_MODEL_NUM, model_number); APPEND_KEY_VALUE(SOL_OIC_KEY_MANUF_DATE, manufacture_date); APPEND_KEY_VALUE(SOL_OIC_KEY_PLATFORM_VER, platform_version); APPEND_KEY_VALUE(SOL_OIC_KEY_HW_VER, hardware_version); APPEND_KEY_VALUE(SOL_OIC_KEY_FIRMWARE_VER, firmware_version); APPEND_KEY_VALUE(SOL_OIC_KEY_SUPPORT_URL, support_url); #undef APPEND_KEY_VALUE err |= cbor_encode_text_stringz(&rep_map, SOL_OIC_KEY_PLATFORM_ID); err |= cbor_encode_byte_string(&rep_map, (const uint8_t *)oic_server.information->platform_id.data, oic_server.information->platform_id.len); err |= cbor_encode_text_stringz(&rep_map, SOL_OIC_KEY_SYSTEM_TIME); err |= cbor_encode_text_stringz(&rep_map, ""); err |= cbor_encode_text_stringz(&rep_map, SOL_OIC_KEY_OS_VER); os_version = sol_platform_get_os_version(); err |= cbor_encode_text_stringz(&rep_map, os_version ? os_version : "Unknown"); err |= cbor_encoder_close_container(&rep_map, &map); err |= cbor_encoder_close_container(&map, &root); err |= cbor_encoder_close_container(&encoder, &root); if (err == CborNoError) { sol_coap_header_set_type(response, SOL_COAP_TYPE_ACK); sol_coap_header_set_code(response, SOL_COAP_RSPCODE_OK); sol_coap_packet_set_payload_used(response, encoder.ptr - payload); return sol_coap_send_packet(server, response, cliaddr); } SOL_WRN("Error encoding platform CBOR response: %s", cbor_error_string(err)); out: sol_coap_packet_unref(response); return -ENOMEM; } static const struct sol_coap_resource oic_d_coap_resource = { SOL_SET_API_VERSION(.api_version = SOL_COAP_RESOURCE_API_VERSION, ) .path = { SOL_STR_SLICE_LITERAL("oic"), SOL_STR_SLICE_LITERAL("d"), SOL_STR_SLICE_EMPTY }, .get = _sol_oic_server_d, .flags = SOL_COAP_FLAGS_NONE }; static unsigned int as_nibble(const char c) { if (c >= '0' && c <= '9') return c - '0'; if (c >= 'a' && c <= 'f') return c - 'a' + 10; if (c >= 'A' && c <= 'F') return c - 'A' + 10; SOL_WRN("Invalid hex character: %d", c); return 0; } static const uint8_t * get_machine_id(void) { static uint8_t machine_id[16] = { 0 }; static bool machine_id_set = false; const char *machine_id_buf; if (unlikely(!machine_id_set)) { machine_id_buf = sol_platform_get_machine_id(); if (!machine_id_buf) { SOL_WRN("Could not get machine ID"); memset(machine_id, 0xFF, sizeof(machine_id)); } else { const char *p; size_t i; for (p = machine_id_buf, i = 0; i < 16; i++, p += 2) machine_id[i] = as_nibble(*p) << 4 | as_nibble(*(p + 1)); } machine_id_set = true; } return machine_id; } static int _sol_oic_server_res(struct sol_coap_server *server, const struct sol_coap_resource *resource, struct sol_coap_packet *req, const struct sol_network_link_addr *cliaddr, void *data) { CborEncoder encoder, array; CborError err; struct sol_oic_server_resource *iter; struct sol_coap_packet *resp; uint16_t size; const uint8_t format_cbor = SOL_COAP_CONTENTTYPE_APPLICATION_CBOR; uint8_t *payload; uint16_t idx; const uint8_t *uri_query; uint16_t uri_query_len; uri_query = sol_coap_find_first_option(req, SOL_COAP_OPTION_URI_QUERY, &uri_query_len); if (uri_query && uri_query_len > sizeof("rt=") - 1) { uri_query += sizeof("rt=") - 1; uri_query_len -= 3; } else { uri_query = NULL; uri_query_len = 0; } resp = sol_coap_packet_new(req); SOL_NULL_CHECK(resp, -ENOMEM); sol_coap_header_set_type(resp, SOL_COAP_TYPE_ACK); sol_coap_add_option(resp, SOL_COAP_OPTION_CONTENT_FORMAT, &format_cbor, sizeof(format_cbor)); sol_coap_packet_get_payload(resp, &payload, &size); cbor_encoder_init(&encoder, payload, size, 0); if (uri_query) { err = cbor_encoder_create_array(&encoder, &array, CborIndefiniteLength); } else { err = cbor_encoder_create_array(&encoder, &array, 1 + oic_server.resources.len); } err |= cbor_encode_uint(&array, SOL_OIC_PAYLOAD_DISCOVERY); SOL_VECTOR_FOREACH_IDX (&oic_server.resources, iter, idx) { CborEncoder map, prop_map, policy_map; if (uri_query && iter->rt) { size_t rt_len = strlen(iter->rt); if (rt_len != uri_query_len) continue; if (memcmp(uri_query, iter->rt, rt_len) != 0) continue; } if (!(iter->flags & SOL_OIC_FLAG_DISCOVERABLE)) continue; if (!(iter->flags & SOL_OIC_FLAG_ACTIVE)) continue; err |= cbor_encoder_create_map(&array, &map, 3); err |= cbor_encode_text_stringz(&map, SOL_OIC_KEY_HREF); err |= cbor_encode_text_stringz(&map, iter->href); err |= cbor_encode_text_stringz(&map, SOL_OIC_KEY_DEVICE_ID); err |= cbor_encode_byte_string(&map, get_machine_id(), 16); err |= cbor_encode_text_stringz(&map, SOL_OIC_KEY_PROPERTIES); err |= cbor_encoder_create_map(&map, &prop_map, !!iter->iface + !!iter->rt + 1); if (iter->iface) { CborEncoder if_array; err |= cbor_encode_text_stringz(&prop_map, SOL_OIC_KEY_INTERFACES); err |= cbor_encoder_create_array(&prop_map, &if_array, 1); err |= cbor_encode_text_stringz(&if_array, iter->iface); err |= cbor_encoder_close_container(&prop_map, &if_array); } if (iter->rt) { CborEncoder rt_array; err |= cbor_encode_text_stringz(&prop_map, SOL_OIC_KEY_RESOURCE_TYPES); err |= cbor_encoder_create_array(&prop_map, &rt_array, 1); err |= cbor_encode_text_stringz(&rt_array, iter->rt); err |= cbor_encoder_close_container(&prop_map, &rt_array); } err |= cbor_encode_text_stringz(&prop_map, SOL_OIC_KEY_POLICY); err |= cbor_encoder_create_map(&prop_map, &policy_map, CborIndefiniteLength); err |= cbor_encode_text_stringz(&policy_map, SOL_OIC_KEY_BITMAP); err |= cbor_encode_uint(&policy_map, iter->flags); err |= cbor_encoder_close_container(&prop_map, &policy_map); err |= cbor_encoder_close_container(&map, &prop_map); err |= cbor_encoder_close_container(&array, &map); } err |= cbor_encoder_close_container(&encoder, &array); if (err != CborNoError) { char addr[SOL_INET_ADDR_STRLEN]; sol_network_addr_to_str(cliaddr, addr, sizeof(addr)); SOL_WRN("Error building response for /oc/core, server %p client %s: %s", oic_server.server, addr, cbor_error_string(err)); sol_coap_header_set_code(resp, SOL_COAP_RSPCODE_INTERNAL_ERROR); } else { sol_coap_header_set_code(resp, SOL_COAP_RSPCODE_OK); sol_coap_packet_set_payload_used(resp, encoder.ptr - payload); } return sol_coap_send_packet(server, resp, cliaddr); } static const struct sol_coap_resource oic_res_coap_resource = { SOL_SET_API_VERSION(.api_version = SOL_COAP_RESOURCE_API_VERSION, ) .path = { SOL_STR_SLICE_LITERAL("oic"), SOL_STR_SLICE_LITERAL("res"), SOL_STR_SLICE_EMPTY }, .get = _sol_oic_server_res, .flags = SOL_COAP_FLAGS_NONE }; static struct sol_oic_server_information * init_static_info(void) { struct sol_oic_server_information information = { .manufacturer_name = SOL_STR_SLICE_LITERAL(OIC_MANUFACTURER_NAME), .manufacturer_url = SOL_STR_SLICE_LITERAL(OIC_MANUFACTURER_URL), .model_number = SOL_STR_SLICE_LITERAL(OIC_MODEL_NUMBER), .manufacture_date = SOL_STR_SLICE_LITERAL(OIC_MANUFACTURE_DATE), .platform_version = SOL_STR_SLICE_LITERAL(OIC_PLATFORM_VERSION), .hardware_version = SOL_STR_SLICE_LITERAL(OIC_HARDWARE_VERSION), .firmware_version = SOL_STR_SLICE_LITERAL(OIC_FIRMWARE_VERSION), .support_url = SOL_STR_SLICE_LITERAL(OIC_SUPPORT_URL) }; struct sol_oic_server_information *info; information.platform_id = SOL_STR_SLICE_STR((const char *)get_machine_id(), 16); info = sol_util_memdup(&information, sizeof(*info)); SOL_NULL_CHECK(info, NULL); return info; } SOL_API int sol_oic_server_init(void) { struct sol_oic_server_information *info; if (oic_server.refcnt > 0) { oic_server.refcnt++; return 0; } SOL_LOG_INTERNAL_INIT_ONCE; info = init_static_info(); SOL_NULL_CHECK(info, -1); oic_server.server = sol_coap_server_new(OIC_COAP_SERVER_UDP_PORT); if (!oic_server.server) goto error; if (!sol_coap_server_register_resource(oic_server.server, &oic_d_coap_resource, NULL)) goto error; if (!sol_coap_server_register_resource(oic_server.server, &oic_res_coap_resource, NULL)) { sol_coap_server_unregister_resource(oic_server.server, &oic_d_coap_resource); goto error; } oic_server.dtls_server = sol_coap_secure_server_new(OIC_COAP_SERVER_DTLS_PORT); if (!oic_server.dtls_server) { if (errno == ENOSYS) { SOL_INF("DTLS support not built in, OIC server running in insecure mode"); } else { SOL_INF("DTLS server could not be created for OIC server: %s", sol_util_strerrora(errno)); } } else { if (!sol_coap_server_register_resource(oic_server.dtls_server, &oic_d_coap_resource, NULL)) { SOL_WRN("Could not register device info secure resource, OIC server running in insecure mode"); sol_coap_server_unref(oic_server.dtls_server); oic_server.dtls_server = NULL; } } oic_server.information = info; sol_vector_init(&oic_server.resources, sizeof(struct sol_oic_server_resource)); oic_server.refcnt++; return 0; error: free(info); return -1; } SOL_API void sol_oic_server_release(void) { struct sol_oic_server_resource *res; uint16_t idx; OIC_SERVER_CHECK(); if (--oic_server.refcnt > 0) return; SOL_VECTOR_FOREACH_REVERSE_IDX (&oic_server.resources, res, idx) sol_coap_server_unregister_resource(oic_server.server, res->coap); if (oic_server.dtls_server) { SOL_VECTOR_FOREACH_REVERSE_IDX (&oic_server.resources, res, idx) sol_coap_server_unregister_resource(oic_server.dtls_server, res->coap); sol_coap_server_unregister_resource(oic_server.dtls_server, &oic_d_coap_resource); sol_coap_server_unref(oic_server.dtls_server); } sol_vector_clear(&oic_server.resources); sol_coap_server_unregister_resource(oic_server.server, &oic_d_coap_resource); sol_coap_server_unregister_resource(oic_server.server, &oic_res_coap_resource); sol_coap_server_unref(oic_server.server); free(oic_server.information); } static void _clear_repr_vector(struct sol_vector *repr) { struct sol_oic_repr_field *field; uint16_t idx; SOL_VECTOR_FOREACH_IDX (repr, field, idx) { if (field->type == SOL_OIC_REPR_TYPE_TEXT_STRING || field->type == SOL_OIC_REPR_TYPE_BYTE_STRING) { free((char *)field->v_slice.data); } } sol_vector_clear(repr); } static int _sol_oic_resource_type_handle( sol_coap_responsecode_t (*handle_fn)(const struct sol_network_link_addr *cliaddr, const void *data, const struct sol_vector *input, struct sol_vector *output), struct sol_coap_server *server, struct sol_coap_packet *req, const struct sol_network_link_addr *cliaddr, struct sol_oic_server_resource *res, bool expect_payload) { const uint8_t format_cbor = SOL_COAP_CONTENTTYPE_APPLICATION_CBOR; struct sol_coap_packet *response; struct sol_vector input = SOL_VECTOR_INIT(struct sol_oic_repr_field); struct sol_vector output = SOL_VECTOR_INIT(struct sol_oic_repr_field); sol_coap_responsecode_t code = SOL_COAP_RSPCODE_INTERNAL_ERROR; OIC_SERVER_CHECK(-ENOTCONN); response = sol_coap_packet_new(req); if (!response) { SOL_WRN("Could not build response packet."); return -1; } if (!handle_fn) { code = SOL_COAP_RSPCODE_NOT_IMPLEMENTED; goto done; } if (expect_payload) { if (!sol_oic_pkt_has_cbor_content(req)) { code = SOL_COAP_RSPCODE_BAD_REQUEST; goto done; } if (sol_oic_decode_cbor_repr(req, &input) != CborNoError) { code = SOL_COAP_RSPCODE_BAD_REQUEST; goto done; } } code = handle_fn(cliaddr, res->callback.data, &input, &output); if (code == SOL_COAP_RSPCODE_CONTENT) { sol_coap_add_option(response, SOL_COAP_OPTION_CONTENT_FORMAT, &format_cbor, sizeof(format_cbor)); if (sol_oic_encode_cbor_repr(response, res->href, &output) != CborNoError) code = SOL_COAP_RSPCODE_INTERNAL_ERROR; } done: sol_coap_header_set_type(response, SOL_COAP_TYPE_ACK); sol_coap_header_set_code(response, code == SOL_COAP_RSPCODE_CONTENT ? SOL_COAP_RSPCODE_OK : code); _clear_repr_vector(&input); /* Output vector is user-built, so it's not safe to call * _clear_repr_vector() on it. Clean the vector itself, but not its * items.*/ sol_vector_clear(&output); return sol_coap_send_packet(server, response, cliaddr); } #define DEFINE_RESOURCE_TYPE_CALLBACK_FOR_METHOD(method, expect_payload) \ static int \ _sol_oic_resource_type_ ## method(struct sol_coap_server *server, \ const struct sol_coap_resource *resource, struct sol_coap_packet *req, \ const struct sol_network_link_addr *cliaddr, void *data) \ { \ struct sol_oic_server_resource *res = data; \ return _sol_oic_resource_type_handle(res->callback.method.handle, \ server, req, cliaddr, res, expect_payload); \ } DEFINE_RESOURCE_TYPE_CALLBACK_FOR_METHOD(get, false) DEFINE_RESOURCE_TYPE_CALLBACK_FOR_METHOD(put, true) DEFINE_RESOURCE_TYPE_CALLBACK_FOR_METHOD(post, true) DEFINE_RESOURCE_TYPE_CALLBACK_FOR_METHOD(delete, true) #undef DEFINE_RESOURCE_TYPE_CALLBACK_FOR_METHOD static struct sol_coap_resource * create_coap_resource(struct sol_oic_server_resource *resource) { const struct sol_str_slice endpoint = sol_str_slice_from_str(resource->href); struct sol_coap_resource *res; unsigned int count = 0; unsigned int current; size_t i; for (i = 0; i < endpoint.len; i++) if (endpoint.data[i] == '/') count++; SOL_INT_CHECK(count, == 0, NULL); if (endpoint.data[0] != '/') { SOL_WRN("Invalid endpoint - Path '%.*s' does not start with '/'", SOL_STR_SLICE_PRINT(endpoint)); return NULL; } if (endpoint.data[endpoint.len - 1] == '/') { SOL_WRN("Invalid endpoint - Path '%.*s' ends with '/'", SOL_STR_SLICE_PRINT(endpoint)); return NULL; } /* alloc space for the path plus empty slice at the end */ res = calloc(1, sizeof(struct sol_coap_resource) + (count + 1) * sizeof(struct sol_str_slice)); SOL_NULL_CHECK(res, NULL); SOL_SET_API_VERSION(res->api_version = SOL_COAP_RESOURCE_API_VERSION; ) res->path[0].data = &endpoint.data[1]; for (i = 1, current = 0; i < endpoint.len; i++) { if (endpoint.data[i] == '/') res->path[++current].data = &endpoint.data[i + 1]; else res->path[current].len++; } res->get = _sol_oic_resource_type_get; res->put = _sol_oic_resource_type_put; res->post = _sol_oic_resource_type_post; res->delete = _sol_oic_resource_type_delete; if (resource->flags & SOL_OIC_FLAG_DISCOVERABLE) res->flags |= SOL_COAP_FLAGS_WELL_KNOWN; if (oic_server.dtls_server) resource->flags |= SOL_OIC_FLAG_SECURE; res->iface = sol_str_slice_from_str(resource->iface); res->resource_type = sol_str_slice_from_str(resource->rt); return res; } static char * create_endpoint(void) { static unsigned int id = 0; char *buffer = NULL; int r; r = asprintf(&buffer, "/sol/%x", id++); return r < 0 ? NULL : buffer; } SOL_API struct sol_oic_server_resource * sol_oic_server_add_resource(const struct sol_oic_resource_type *rt, const void *handler_data, enum sol_oic_resource_flag flags) { struct sol_oic_server_resource *res; OIC_SERVER_CHECK(NULL); SOL_NULL_CHECK(rt, NULL); #ifndef SOL_NO_API_VERSION if (unlikely(rt->api_version != SOL_OIC_RESOURCE_TYPE_API_VERSION)) { SOL_WRN("Couldn't add resource_type with " "version '%u'. Expected version '%u'.", rt->api_version, SOL_OIC_RESOURCE_TYPE_API_VERSION); return NULL; } #endif res = sol_vector_append(&oic_server.resources); SOL_NULL_CHECK(res, NULL); res->callback.data = handler_data; res->callback.get.handle = rt->get.handle; res->callback.put.handle = rt->put.handle; res->callback.post.handle = rt->post.handle; res->callback.delete.handle = rt->delete.handle; res->flags = flags; res->rt = strndup(rt->resource_type.data, rt->resource_type.len); SOL_NULL_CHECK_GOTO(res->rt, remove_res); res->iface = strndup(rt->interface.data, rt->interface.len); SOL_NULL_CHECK_GOTO(res->iface, free_rt); res->href = create_endpoint(); SOL_NULL_CHECK_GOTO(res->href, free_iface); res->coap = create_coap_resource(res); SOL_NULL_CHECK_GOTO(res->coap, free_coap); if (!sol_coap_server_register_resource(oic_server.server, res->coap, res)) goto free_coap; if (oic_server.dtls_server) { if (!sol_coap_server_register_resource(oic_server.dtls_server, res->coap, res)) { SOL_WRN("Could not register resource in DTLS server"); goto unregister_resource; } } return res; unregister_resource: sol_coap_server_unregister_resource(oic_server.server, res->coap); free_coap: free(res->coap); free_iface: free(res->iface); free_rt: free(res->rt); remove_res: sol_vector_del(&oic_server.resources, oic_server.resources.len - 1); return NULL; } SOL_API void sol_oic_server_del_resource(struct sol_oic_server_resource *resource) { struct sol_oic_server_resource *iter; uint16_t idx; OIC_SERVER_CHECK(); SOL_NULL_CHECK(resource); sol_coap_server_unregister_resource(oic_server.server, resource->coap); if (oic_server.dtls_server) sol_coap_server_unregister_resource(oic_server.dtls_server, resource->coap); free(resource->coap); free(resource->href); free(resource->iface); free(resource->rt); SOL_VECTOR_FOREACH_REVERSE_IDX (&oic_server.resources, iter, idx) { if (iter == resource) { sol_vector_del(&oic_server.resources, idx); return; } } SOL_ERR("Could not find resource %p in OIC server resource list", resource); } static bool send_notification_to_server(struct sol_oic_server_resource *resource, const struct sol_vector *fields, struct sol_coap_server *server) { const uint8_t format_cbor = SOL_COAP_CONTENTTYPE_APPLICATION_CBOR; struct sol_coap_packet *pkt; pkt = sol_coap_packet_notification_new(oic_server.server, resource->coap); SOL_NULL_CHECK(pkt, false); sol_coap_add_option(pkt, SOL_COAP_OPTION_CONTENT_FORMAT, &format_cbor, sizeof(format_cbor)); if (sol_oic_encode_cbor_repr(pkt, resource->href, fields) != CborNoError) { sol_coap_header_set_code(pkt, SOL_COAP_RSPCODE_INTERNAL_ERROR); } else { sol_coap_header_set_code(pkt, SOL_COAP_RSPCODE_OK); } sol_coap_header_set_type(pkt, SOL_COAP_TYPE_ACK); return !sol_coap_packet_send_notification(oic_server.server, resource->coap, pkt); } SOL_API bool sol_oic_notify_observers(struct sol_oic_server_resource *resource, const struct sol_vector *fields) { bool sent_server = false; bool sent_dtls_server = false; SOL_NULL_CHECK(resource, false); sent_server = send_notification_to_server(resource, fields, oic_server.server); if (oic_server.dtls_server) sent_dtls_server = send_notification_to_server(resource, fields, oic_server.dtls_server); return sent_server || sent_dtls_server; }
rchiossi/soletta
src/lib/comms/sol-oic-server.c
C
bsd-3-clause
25,099
<?php use yii\helpers\Html; /* @var $this yii\web\View */ /* @var $model app\models\Category */ $this->title = 'Update Consultant Category: ' . ' ' . $model->category; $this->params['breadcrumbs'][] = ['label' => 'Categories', 'url' => ['index']]; $this->params['breadcrumbs'][] = ['label' => $model->category, 'url' => ['view', 'id' => $model->categoryid]]; $this->params['breadcrumbs'][] = 'Update'; ?> <div class="category-update"> <h1><?= Html::encode($this->title) ?></h1> <?= $this->render('_form', [ 'model' => $model, ]) ?> </div>
prayogo/pms.yii2
views/category/update.php
PHP
bsd-3-clause
565
/* ========================================================================= */ /* ------------------------------------------------------------------------- */ /*! \file cmdtextfield.h \date Dec 2011 \author TNick \brief Contains the definition for CmdTextField class *//* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Please read COPYING and README files in root folder ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ /* ------------------------------------------------------------------------- */ /* ========================================================================= */ #ifndef __CMDTEXTFIELD_INC__ #define __CMDTEXTFIELD_INC__ // // // // /* INCLUDES ------------------------------------------------------------ */ #include <QPlainTextEdit> #include <QLabel> #include <QStringList> /* INCLUDES ============================================================ */ // // // // /* CLASS --------------------------------------------------------------- */ namespace Gui { /** * @brief class representing a plain text control that interprets commands */ class CmdTextField :public QPlainTextEdit { Q_OBJECT // // // // /* DEFINITIONS ----------------------------------------------------- */ /* DEFINITIONS ===================================================== */ // // // // /* DATA ------------------------------------------------------------ */ private: /** * @brief associated log panel */ QPlainTextEdit * tx_Log; /** * @brief the label shown in front of text */ QLabel * lbl_; /** * @brief previously inputted text */ QStringList tx_prev_; /** * @brief index of previously inputted text */ int prev_idx_; /* DATA ============================================================ */ // // // // /* FUNCTIONS ------------------------------------------------------- */ public: /** * @brief constructor; */ CmdTextField ( QWidget * parent = 0 ); /** * @brief constructor; */ CmdTextField ( QPlainTextEdit * log_target, QWidget * parent = 0 ); /** * @brief destructor; */ virtual ~CmdTextField ( void ); /** * @brief get */ inline QPlainTextEdit * assocLog ( void ) { return tx_Log; } /** * @brief set */ inline void setAssocLog ( QPlainTextEdit * new_val ) { tx_Log = new_val; } /** * @brief change the text displayied at the left of the input box */ void setLabelText ( const QString & new_val = QString() ); protected: /** * @brief filter the keys */ void keyPressEvent ( QKeyEvent *e ); /** * @brief helps us keep the label in place */ void resizeEvent ( QResizeEvent * ); private: /** * @brief common initialisation to all constructors */ void init ( void ); /** * @brief append a new string to the list */ void appendCommand ( const QString & s_in ); /** * @brief get previously entered string at index i */ QString previousCommand ( int i = 0 ); /* FUNCTIONS ======================================================= */ // // // // }; /* class CmdTextField */ /* CLASS =============================================================== */ // // // // } // namespace Gui #endif // __CMDTEXTFIELD_INC__ /* ------------------------------------------------------------------------- */ /* ========================================================================= */
google-code/cad-play-ground
source/gui/cmdtextfield.h
C
bsd-3-clause
3,470
/* * Copyright (c) 2011, Run With Robots * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the fastjson library nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY RUN WITH ROBOTS ''AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL MICHAEL ANDERSON BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef FASTJSON_DOM_H #define FASTJSON_DOM_H #include "fastjson/core.h" #include "fastjson/utils.h" #include "fastjson/error.h" //TODO: Ugly that we need this.. can we remove it later? #include <vector> #include <sstream> #include <string.h> namespace fastjson { namespace dom { //Requires the DATA type to have a next pointer to DATA //We hijack that pointer for use in the free list. template<typename DATA> class Pager { public: Pager() : free_ptr(NULL), data(), available_count_(0) { } ~Pager() { for(unsigned int i=0; i<data.size(); ++i) { delete [] data[i]; } } uint32_t n_available() const { return available_count_; } void create_and_add_page(uint32_t n) { DATA * new_page = new DATA[n]; for(unsigned int i=0; i<n; ++i) { new_page[i].next = free_ptr; free_ptr = new_page + i; } data.push_back(new_page); available_count_+=n; } //We dont really use N - but if we ever track in-use entries too we'll need it void add_used_page( DATA * page, uint32_t /* N */ ) { data.push_back(page); } DATA * create_value() { if(available_count_==0) { //TODO: This should not be hardcoded to 10... create_and_add_page(10); } available_count_--; DATA * value = free_ptr; free_ptr = value->next; value->next = NULL; return value; } void destroy( DATA * a ) { available_count_++; a->next = free_ptr; free_ptr = a; } protected: DATA * free_ptr; std::vector< DATA* > data; uint32_t available_count_; }; //NOTE: These dont clean up the strings... you need to do that your self. // For us the chunk handles that. struct StringBuffer { public: explicit StringBuffer(unsigned int N ) { buf_ = new char[N]; size_ = N; inuse_ = 0; } struct in_use {} ; StringBuffer( char * buffer, unsigned int N, in_use ) { buf_ = buffer; size_ = N; inuse_ = N; } unsigned int available() const { return size_ - inuse_; } char * write( const char * s, unsigned int len ) { char * start = buf_ + inuse_; memcpy( start, s, len ); inuse_ += len; return start; } void destroy() { delete [] buf_; buf_=NULL;} protected: char * buf_; unsigned int size_; unsigned int inuse_; }; // The idea behind a document is that it can maintain free lists of the unused elements. // It can allocate more memory as required, // It can be merged into another document (merging the free lists correctly). class Chunk { public: Chunk() : arrays_(), dicts_(), strings_() {} ~Chunk() { for(unsigned int i=0; i<strings_.size(); ++i) { strings_[i].destroy(); } } //TODO: Shift this into an object containing the StringBuffers? char * create_raw_buffer( const char * b, unsigned int space_required ) { unsigned int i=0; for(i=0; i<strings_.size(); ++i) { if ( strings_[i].available() >= space_required ) { return strings_[i].write( b, space_required ); } } //Should use a minimum for this so that we get less fragmentation? strings_.push_back( StringBuffer( space_required ) ); return strings_.back().write( b, space_required ); } void add_array_page( ArrayEntry * entries, unsigned int N ) { arrays_.add_used_page(entries, N); } void add_dict_page( DictEntry * entries, unsigned int N ) { dicts_.add_used_page(entries, N); } void add_string_page( char * buffer, unsigned int L ) { strings_.push_back( StringBuffer(buffer,L, StringBuffer::in_use() ) ); } Pager<ArrayEntry>& arrays() { return arrays_; } Pager<DictEntry>& dicts() { return dicts_; } std::vector<StringBuffer>& strings() { return strings_; } protected: Pager<ArrayEntry> arrays_; Pager<DictEntry> dicts_; std::vector<StringBuffer> strings_; }; class Value { public: static Value as_value( Token * tok, Chunk * chunk ) { Value retval; assert(tok->type==Token::ValueToken); retval.tok_ = tok; retval.chunk_ = chunk; } static Value create_value( Token * tok, Chunk * chunk ) { //Assumes that whatever was there has been cleaned up Value retval; tok->type = Token::ValueToken; tok->dict.ptr = NULL; retval.tok_ = tok; retval.chunk_ = chunk; return retval; } template<typename T, typename W> bool set_numeric( const W & value ) { tok_->value.type_hint = ValueType::NumberHint; std::stringstream ss; ss<<value; std::string s = ss.str(); //Now allocate enough space for it. tok_->value.ptr = chunk_->create_raw_buffer( s.c_str(), s.size() ); tok_->value.size = s.size(); return true; } template<typename T, typename W> bool set_string( const W & value ) { tok_->value.type_hint = ValueType::StringHint; std::stringstream ss; ss<<value; std::string s = ss.str(); //Now allocate enough space for it. tok_->value.ptr = chunk_->create_raw_buffer( s.c_str(), s.size() ); tok_->value.size = s.size(); return true; } void set_raw_string( const std::string & s ) { tok_->value.type_hint = ValueType::StringHint; tok_->value.ptr = chunk_->create_raw_buffer( s.c_str(), s.size() ); tok_->value.size = s.size(); } void set_raw_cstring( const char * cstr ) { tok_->value.type_hint = ValueType::StringHint; size_t len = strlen(cstr); tok_->value.ptr = chunk_->create_raw_buffer( cstr, len ); tok_->value.size = len; } const Token * token() const { return tok_; } protected: Value() : tok_(NULL), chunk_(NULL) { } Token * tok_; Chunk * chunk_; }; template<typename T> struct json_helper; template<> struct json_helper<std::string> { static bool build( Token * tok, Chunk * chunk, const std::string & value ) { Value v = Value::create_value(tok,chunk); v.set_raw_string( value ); return true; } static bool from_json_value( const Token * tok, std::string * s ) { if(!tok || tok->type!=Token::ValueToken ) return false; if(tok->value.ptr) { *s = std::string( tok->value.ptr, tok->value.size); return true; } *s = ""; return true; } }; template<typename T> struct numeric_value_json_helper { static bool build( Token * tok, Chunk * chunk, T value ) { Value v = Value::create_value(tok,chunk); v.set_numeric<T>(value); return true; } static bool from_json_value( const Token * tok, T * v ) { if(!tok || tok->type!=Token::ValueToken ) return false; if( ! tok->value.ptr ) { *v = 0; } return utils::try_convert<T>( tok->value.ptr, tok->value.size, v ); } }; template<> struct json_helper<int> : public numeric_value_json_helper<int> {}; template<> struct json_helper<uint64_t> : public numeric_value_json_helper<uint64_t> {}; template<> struct json_helper<int64_t> : public numeric_value_json_helper<int64_t> {}; template<> struct json_helper<float> : public numeric_value_json_helper<float> {}; template<> struct json_helper<double> : public numeric_value_json_helper<double> {}; template<> struct json_helper<bool> { static bool build( Token * tok, Chunk * /* chunk */, bool value ) { if(value) { tok->type=Token::LiteralTrueToken; } else { tok->type=Token::LiteralFalseToken; } return true; } static bool from_json_value( const Token * token, bool * v ) { if( ! token ) return false; if( ! v ) return false; if( token->type == Token::LiteralTrueToken ) { *v = true; return true; } if( token->type == Token::LiteralFalseToken ) { *v = false; return true; } //Lets be lenient in what we accept .. a 0 is false and a 1 is true (same for "0" and "1"). if( (token->type == Token::ValueToken) && (token->value.size==1) ) { if( token->value.ptr[0] == '0' ) { *v = false; return true; } if( token->value.ptr[0] == '1' ) { *v = true; return true; } } return false; } }; class Dictionary { public: static Dictionary as_dict( Token * tok, Chunk * chunk ) { Dictionary retval; assert(tok->type==Token::DictToken); DictEntry * d = tok->dict.ptr; DictEntry * end = NULL; //Get the real end... while(d) { end = d; d = d->next; } retval.tok_ = tok; retval.chunk_ = chunk; retval.end_ = end; return retval; } static Dictionary create_dict( Token * tok, Chunk * chunk ) { //Assumes that whatever was there has been cleaned up Dictionary retval; tok->type = Token::DictToken; tok->dict.ptr = NULL; retval.tok_ = tok; retval.chunk_ = chunk; retval.end_ = NULL; return retval; } template<typename T, typename W> bool add( const std::string & key, const W & value ) { Token tok; if( ! json_helper<T>::build( &tok, chunk_, value ) ) { return false; } return add_token(key,tok); } bool add_token( const std::string & key, const Token & tok ) { DictEntry * dv = chunk_->dicts().create_value(); dv->next = NULL; Value key_v = Value::create_value( &dv->key_tok, chunk_ ); key_v.set_raw_string(key); dv->value_tok = tok; if( end_ ) { end_->next = dv; } else { tok_->dict.ptr = dv; } end_ = dv; return true; } DictEntry * add_child_raw() { DictEntry * dv = chunk_->dicts().create_value(); dv->next = NULL; if( end_ ) { end_->next = dv; } else { tok_->dict.ptr = dv; } end_ = dv; return dv; } DictEntry * add_child_raw( const std::string & key ) { DictEntry * dv = chunk_->dicts().create_value(); Value key_v = Value::create_value( &dv->key_tok, chunk_ ); key_v.set_raw_string(key); dv->next = NULL; if( end_ ) { end_->next = dv; } else { tok_->dict.ptr = dv; } end_ = dv; return dv; } template<typename T> bool get( const std::string & k, T * value ) { DictEntry * child = tok_->dict.ptr; while( child ) { //Is the childs key a string value if( child->key_tok.type == Token::ValueToken && child->key_tok.value.type_hint == ValueType::StringHint ) { if( std::string(child->key_tok.value.ptr, child->key_tok.value.size) == k ) { return json_helper<T>::from_json_value( &child->value_tok, value ); } } child = child->next; } return false; } template<typename T> T get_default( const std::string & k, const T & default_value ) { DictEntry * child = tok_->dict.ptr; while( child ) { //Is the childs key a string value if( child->key_tok.type == Token::ValueToken && child->key_tok.value.type_hint == ValueType::StringHint ) { if( std::string(child->key_tok.value.ptr, child->key_tok.value.size) == k ) { T rv; if( json_helper<T>::from_json_value( &child->value_tok, &rv ) ) { return rv; } } } child = child->next; } return default_value; } bool has_child( const std::string & k ) const { DictEntry * child = tok_->dict.ptr; while( child ) { //Is the childs key a string value if( child->key_tok.type == Token::ValueToken && child->key_tok.value.type_hint == ValueType::StringHint ) { if( std::string(child->key_tok.value.ptr, child->key_tok.value.size) == k ) { return true; } } child = child->next; } return false; } bool get_raw( const std::string & k, Token * token ) { DictEntry * child = tok_->dict.ptr; while( child ) { //Is the childs key a string value if( child->key_tok.type == Token::ValueToken && child->key_tok.value.type_hint == ValueType::StringHint ) { if( std::string(child->key_tok.value.ptr, child->key_tok.value.size) == k ) { *token = child->value_tok; return true; } } child = child->next; } return false; } const Token * token() const { return tok_; } protected: Dictionary() : tok_(NULL), chunk_(NULL), end_(NULL) { } Token * tok_; Chunk * chunk_; DictEntry * end_; }; class Dictionary_const { public: static Dictionary_const as_dict( const Token * tok ) { Dictionary_const retval; assert(tok->type==Token::DictToken); retval.tok_ = tok; return retval; } template<typename T> bool get( const std::string & k, T * value ) { DictEntry * child = tok_->dict.ptr; while( child ) { //Is the childs key a string value if( child->key_tok.type == Token::ValueToken && child->key_tok.value.type_hint == ValueType::StringHint ) { if( std::string(child->key_tok.value.ptr, child->key_tok.value.size) == k ) { return json_helper<T>::from_json_value( &child->value_tok, value ); } } child = child->next; } return false; } // This breaks the classes contract as someone could make changes // to the structures pointed to by the Token, but its the only way to // get a raw token out of these easily. bool get_raw( const std::string & k, Token * token ) { DictEntry * child = tok_->dict.ptr; while( child ) { //Is the childs key a string value if( child->key_tok.type == Token::ValueToken && child->key_tok.value.type_hint == ValueType::StringHint ) { if( std::string(child->key_tok.value.ptr, child->key_tok.value.size) == k ) { *token = child->value_tok; return true; } } child = child->next; } return false; } bool has_child( const std::string & k ) const { DictEntry * child = tok_->dict.ptr; while( child ) { //Is the childs key a string value if( child->key_tok.type == Token::ValueToken && child->key_tok.value.type_hint == ValueType::StringHint ) { if( std::string(child->key_tok.value.ptr, child->key_tok.value.size) == k ) { return true; } } child = child->next; } return false; } const Token * token() const { return tok_; } protected: Dictionary_const() : tok_(NULL) { } const Token * tok_; }; class Array { public: static Array as_array( Token * tok, Chunk * chunk ) { Array retval; assert(tok->type==Token::ArrayToken); ArrayEntry * a = tok->array.ptr; ArrayEntry * end = NULL; //Get the real end... while(a) { end = a; a = a->next; } retval.tok_ = tok; retval.chunk_ = chunk; retval.end_ = end; return retval; } static Array create_array( Token * tok, Chunk * chunk ) { //Assumes that whatever was there has been cleaned up Array retval; tok->type = Token::ArrayToken; tok->array.ptr = NULL; retval.tok_ = tok; retval.chunk_ = chunk; retval.end_ = NULL; return retval; } template<typename T, typename W> bool add( const W & value ) { //Get the spot for the token... ArrayEntry * array_entry = chunk_->arrays().create_value(); array_entry->next = NULL; if( ! json_helper<T>::build( &array_entry->tok, chunk_, value ) ) { chunk_->arrays().destroy( array_entry ); return false; } //Hook it int the array if( end_ ) { end_->next = array_entry; } else { tok_->array.ptr = array_entry; } end_ = array_entry; return true; } ArrayEntry * add_child_raw() { ArrayEntry * array_entry = chunk_->arrays().create_value(); array_entry->next = NULL; //Hook it int the array if( end_ ) { end_->next = array_entry; } else { tok_->array.ptr = array_entry; } end_ = array_entry; return array_entry; } const fastjson::Token * token() const { return tok_; } size_t length() const { fastjson::ArrayEntry * a = tok_->array.ptr; size_t retval = 0; //Get the real end... while(a) { ++retval; a = a->next; } return retval; } private: Array() : tok_(NULL), chunk_(NULL), end_(NULL) { } Token * tok_; Chunk * chunk_; ArrayEntry * end_; }; template< typename T > struct json_helper< std::vector<T> > { static bool build( Token * tok, Chunk * chunk, const std::vector<T> & v ) { Array a = Array::create_array( tok, chunk ); for( unsigned int i=0; i<v.size(); ++i) { a.add<T>( v[i] ); } return true; } static bool from_json_value( const Token * tok, std::vector<T> * data ) { if(!data) return false; if(!tok || tok->type!=Token::ArrayToken ) return false; std::vector<T> retval; ArrayEntry * child = tok->array.ptr; while(child) { retval.push_back(T()); if(! json_helper<T>::from_json_value( &child->tok, &retval.back() ) ) return false; child = child->next; } *data = retval; return true; } }; bool parse_string( const std::string & s, Token * tok, Chunk * chunk, unsigned int parse_mode, UserErrorCallback user_error_callback, void * user_data ); void clone_token( const Token * in_token, Token * out_token, Chunk * chunk ); } } namespace fastjson { namespace util { void set_string( Token * tok, dom::Chunk * chunk, const char * s ); } } #endif
mikeando/fastjson
include/fastjson/dom.h
C
bsd-3-clause
22,624
/* * Copyright (c) 2007, Mathieu Champlon * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met : * * . Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * . Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * . Neither the name of the copyright holders nor the names of the * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE THE COPYRIGHT * OWNERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "xeumeuleu_test_pch.h" #include <xeumeuleu/xml.hpp> // ----------------------------------------------------------------------------- // Name: reading_from_an_ximultistream_reads_from_first_stream // Created: MAT 2008-01-07 // ----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE( reading_from_an_ximultistream_reads_from_first_stream ) { xml::xistringstream xis1( "<root-1/>" ); xml::xistringstream xis2( "<root-2/>" ); xml::ximultistream xis( xis1, xis2 ); BOOST_CHECK_NO_THROW( xis >> xml::start( "root-1" ) ); } // ----------------------------------------------------------------------------- // Name: reading_from_an_ximultistream_reads_from_second_stream // Created: MAT 2008-01-07 // ----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE( reading_from_an_ximultistream_reads_from_second_stream ) { xml::xistringstream xis1( "<root-1/>" ); xml::xistringstream xis2( "<root-2/>" ); xml::ximultistream xis( xis1, xis2 ); BOOST_CHECK_NO_THROW( xis >> xml::start( "root-2" ) ); } // ----------------------------------------------------------------------------- // Name: reading_from_an_ximultistream_a_non_existing_node_throws // Created: MAT 2008-01-07 // ----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE( reading_from_an_ximultistream_a_non_existing_node_throws ) { xml::xistringstream xis1( "<root-1/>" ); xml::xistringstream xis2( "<root-2/>" ); xml::ximultistream xis( xis1, xis2 ); BOOST_CHECK_THROW( xis >> xml::start( "non-existing-node" ), xml::exception ); } // ----------------------------------------------------------------------------- // Name: reading_from_an_ximultistream_reads_attribute_from_first_stream // Created: MAT 2008-01-07 // ----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE( reading_from_an_ximultistream_reads_attribute_from_first_stream ) { xml::xistringstream xis1( "<root attribute='stream-1'/>" ); xml::xistringstream xis2( "<root/>" ); xml::ximultistream xis( xis1, xis2 ); xis >> xml::start( "root" ); BOOST_CHECK_EQUAL( "stream-1", xis.attribute< std::string >( "attribute" ) ); } // ----------------------------------------------------------------------------- // Name: reading_from_an_ximultistream_reads_attribute_from_second_stream // Created: MAT 2008-01-07 // ----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE( reading_from_an_ximultistream_reads_attribute_from_second_stream ) { xml::xistringstream xis1( "<root/>" ); xml::xistringstream xis2( "<root attribute='stream-2'/>" ); xml::ximultistream xis( xis1, xis2 ); xis >> xml::start( "root" ); BOOST_CHECK_EQUAL( "stream-2", xis.attribute< std::string >( "attribute" ) ); } // ----------------------------------------------------------------------------- // Name: reading_from_an_ximultistream_reads_attribute_with_first_stream_precedence // Created: MAT 2008-01-07 // ----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE( reading_from_an_ximultistream_reads_attribute_with_first_stream_precedence ) { xml::xistringstream xis1( "<root attribute='stream-1'/>" ); xml::xistringstream xis2( "<root attribute='stream-2'/>" ); xml::ximultistream xis( xis1, xis2 ); xis >> xml::start( "root" ); BOOST_CHECK_EQUAL( "stream-1", xis.attribute< std::string >( "attribute" ) ); } // ----------------------------------------------------------------------------- // Name: reading_from_an_ximultistream_a_non_existing_attribute_throws // Created: MAT 2008-01-07 // ----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE( reading_from_an_ximultistream_a_non_existing_attribute_throws ) { xml::xistringstream xis1( "<root/>" ); xml::xistringstream xis2( "<root/>" ); xml::ximultistream xis( xis1, xis2 ); xis >> xml::start( "root" ); BOOST_CHECK_THROW( xis.attribute< std::string >( "attribute" ), xml::exception ); } // ----------------------------------------------------------------------------- // Name: reading_from_an_ximultistream_a_non_existing_attribute_from_existing_branch_throws // Created: MAT 2008-01-07 // ----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE( reading_from_an_ximultistream_a_non_existing_attribute_from_existing_branch_throws ) { xml::xistringstream xis1( "<root-1/>" ); xml::xistringstream xis2( "<root-2/>" ); xml::ximultistream xis( xis1, xis2 ); xis >> xml::start( "root-1" ); BOOST_CHECK_THROW( xis.attribute< std::string >( "attribute" ), xml::exception ); } // ----------------------------------------------------------------------------- // Name: reading_from_an_ximultistream_from_first_branch_then_second_branch_is_transparent // Created: MAT 2008-01-07 // ----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE( reading_from_an_ximultistream_from_first_branch_then_second_branch_is_transparent ) { xml::xistringstream xis1( "<root-1 attribute-1='stream-1'/>" ); xml::xistringstream xis2( "<root-2 attribute-2='stream-2'/>" ); xml::ximultistream xis( xis1, xis2 ); std::string actual1, actual2; xis >> xml::start( "root-1" ) >> xml::attribute( "attribute-1", actual1 ) >> xml::end >> xml::start( "root-2" ) >> xml::attribute( "attribute-2", actual2 ); BOOST_CHECK_EQUAL( "stream-1", actual1 ); BOOST_CHECK_EQUAL( "stream-2", actual2 ); } // ----------------------------------------------------------------------------- // Name: reading_from_an_ximultistream_from_second_branch_does_not_change_stream_precedence // Created: MAT 2008-01-07 // ----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE( reading_from_an_ximultistream_from_second_branch_does_not_change_stream_precedence ) { xml::xistringstream xis1( "<root attribute='stream-1'/>" ); xml::xistringstream xis2( "<root attribute='stream-2'><element/></root>" ); xml::ximultistream xis( xis1, xis2 ); xis >> xml::start( "root" ) >> xml::start( "element" ) >> xml::end; BOOST_CHECK_EQUAL( "stream-1", xis.attribute< std::string >( "attribute" ) ); } // ----------------------------------------------------------------------------- // Name: an_ximultistream_can_be_wrapped_by_an_xisubstream // Created: MAT 2008-01-07 // ----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE( an_ximultistream_can_be_wrapped_by_an_xisubstream ) { xml::xistringstream xis1( "<root-1 attribute='stream-1'/>" ); xml::xistringstream xis2( "<root-2 attribute='stream-2'/>" ); xml::ximultistream xis( xis1, xis2 ); { xml::xisubstream xiss( xis ); xiss >> xml::start( "root-2" ); } xis >> xml::start( "root-1" ); BOOST_CHECK_EQUAL( "stream-1", xis.attribute< std::string >( "attribute" ) ); } // ----------------------------------------------------------------------------- // Name: an_ximultistream_can_be_wrapped_by_another_ximultistream // Created: MAT 2008-04-25 // ----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE( an_ximultistream_can_be_wrapped_by_another_ximultistream ) { xml::xistringstream xis1( "<root-1 attribute='stream-1'/>" ); xml::xistringstream xis2( "<root-2 attribute='stream-2'/>" ); xml::xistringstream xis3( "<root-3 attribute='stream-3'/>" ); xml::ximultistream xims( xis1, xis2 ); xml::ximultistream xis( xims, xis3 ); std::string actual1, actual2, actual3; xis >> xml::start( "root-1" ) >> xml::attribute( "attribute", actual1 ) >> xml::end >> xml::start( "root-2" ) >> xml::attribute( "attribute", actual2 ) >> xml::end >> xml::start( "root-3" ) >> xml::attribute( "attribute", actual3 ); BOOST_CHECK_EQUAL( "stream-1", actual1 ); BOOST_CHECK_EQUAL( "stream-2", actual2 ); BOOST_CHECK_EQUAL( "stream-3", actual3 ); } // ----------------------------------------------------------------------------- // Name: serializing_an_ximultistream_into_an_xostream_at_root_level_throws // Created: MAT 2008-11-22 // ----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE( serializing_an_ximultistream_into_an_xostream_at_root_level_merges_attributes ) { xml::xistringstream xis1( "<root/>" ); xml::xistringstream xis2( "<root/>" ); xml::ximultistream xims( xis1, xis2 ); xml::xostringstream xos; BOOST_CHECK_THROW( xos << xims, xml::exception ); } // ----------------------------------------------------------------------------- // Name: serializing_an_ximultistream_into_an_xostream_adds_both_stream_contents // Created: MAT 2008-11-22 // ----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE( serializing_an_ximultistream_into_an_xostream_adds_both_stream_contents ) { xml::xistringstream xis1( "<root-1/>" ); xml::xistringstream xis2( "<root-2/>" ); xml::ximultistream xims( xis1, xis2 ); xml::xostringstream xos; xos << xml::start( "root" ) << xims << xml::end; xml::xistringstream xis( xos.str() ); xis >> xml::start( "root" ) >> xml::start( "root-1" ) >> xml::end >> xml::start( "root-2" ); } // ----------------------------------------------------------------------------- // Name: an_ximultistream_can_be_buffered_by_an_xibufferstream // Created: MAT 2008-05-17 // ----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE( an_ximultistream_can_be_buffered_by_an_xibufferstream ) { xml::xistringstream xis1( "<root-1 attribute='stream-1'/>" ); xml::xistringstream xis2( "<root-2 attribute='stream-2'/>" ); xml::ximultistream xis( xis1, xis2 ); xml::xibufferstream xibs( xis ); std::string actual1, actual2; xibs >> xml::start( "root-1" ) >> xml::attribute( "attribute", actual1 ) >> xml::end >> xml::start( "root-2" ) >> xml::attribute( "attribute", actual2 ); BOOST_CHECK_EQUAL( "stream-1", actual1 ); BOOST_CHECK_EQUAL( "stream-2", actual2 ); } // ----------------------------------------------------------------------------- // Name: an_optional_attribute_not_found_in_first_stream_falls_back_to_the_second_stream // Created: MAT 2008-05-17 // ----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE( an_optional_attribute_not_found_in_first_stream_falls_back_to_the_second_stream ) { xml::xistringstream xis1( "<root/>" ); xml::xistringstream xis2( "<root attribute='stream-2'/>" ); xml::ximultistream xis( xis1, xis2 ); xml::xibufferstream xibs( xis ); std::string actual = "stream-1"; xibs >> xml::start( "root" ) >> xml::optional >>xml::attribute( "attribute", actual ); BOOST_CHECK_EQUAL( "stream-2", actual ); } // ----------------------------------------------------------------------------- // Name: an_optional_attribute_not_found_in_either_stream_is_valid // Created: MAT 2008-05-17 // ----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE( an_optional_attribute_not_found_in_either_stream_is_valid ) { xml::xistringstream xis1( "<root/>" ); xml::xistringstream xis2( "<root/>" ); xml::ximultistream xis( xis1, xis2 ); xml::xibufferstream xibs( xis ); std::string actual = "no attribute"; xibs >> xml::start( "root" ) >> xml::optional >>xml::attribute( "attribute", actual ); BOOST_CHECK_EQUAL( "no attribute", actual ); } // ----------------------------------------------------------------------------- // Name: an_optional_attribute_not_found_in_an_optional_sub_node_of_either_stream_is_valid // Created: MCO 2009-05-31 // ----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE( an_optional_attribute_not_found_in_an_optional_sub_node_of_either_stream_is_valid ) { xml::xistringstream xis1( "<root>" " <sub-node/>" "</root>" ); xml::xistringstream xis2( "<root/>" ); xml::ximultistream xis( xis1, xis2 ); std::string attribute; xis >> xml::start( "root" ) >> xml::optional >> xml::start( "sub-node" ) >> xml::optional >> xml::attribute( "non-existing-attribute", attribute ); }
mat007/xeumeuleu
src/tests/xeumeuleu_test/ximultistream_test.cpp
C++
bsd-3-clause
14,818
package com.xoba.smr; import java.io.PrintWriter; import java.io.StringReader; import java.io.StringWriter; import java.net.URI; import java.util.Collection; import java.util.Formatter; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Properties; import java.util.Set; import java.util.SortedSet; import java.util.TreeMap; import java.util.TreeSet; import org.apache.commons.codec.binary.Base64; import com.amazonaws.Request; import com.amazonaws.auth.AWSCredentials; import com.amazonaws.handlers.AbstractRequestHandler; import com.amazonaws.services.ec2.AmazonEC2; import com.amazonaws.services.ec2.AmazonEC2Client; import com.amazonaws.services.ec2.model.CreateTagsRequest; import com.amazonaws.services.ec2.model.Instance; import com.amazonaws.services.ec2.model.LaunchSpecification; import com.amazonaws.services.ec2.model.RequestSpotInstancesRequest; import com.amazonaws.services.ec2.model.RequestSpotInstancesResult; import com.amazonaws.services.ec2.model.RunInstancesRequest; import com.amazonaws.services.ec2.model.RunInstancesResult; import com.amazonaws.services.ec2.model.Tag; import com.amazonaws.services.s3.AmazonS3; import com.amazonaws.services.s3.AmazonS3Client; import com.amazonaws.services.simpledb.AmazonSimpleDB; import com.amazonaws.services.simpledb.AmazonSimpleDBClient; import com.amazonaws.services.sqs.AmazonSQS; import com.amazonaws.services.sqs.AmazonSQSClient; import com.amazonaws.services.sqs.model.SendMessageRequest; import com.xoba.util.ILogger; import com.xoba.util.LogFactory; import com.xoba.util.MraUtils; public class SimpleMapReduce { private static final ILogger logger = LogFactory.getDefault().create(); public static void launch(Properties config, Collection<String> inputSplitPrefixes, AmazonInstance ai, int machineCount) throws Exception { launch(config, inputSplitPrefixes, ai, machineCount, true); } public static void launch(Properties config, Collection<String> inputSplitPrefixes, AmazonInstance ai, int machineCount, boolean spotInstances) throws Exception { if (!config.containsKey(ConfigKey.JOB_ID.toString())) { config.put(ConfigKey.JOB_ID.toString(), MraUtils.md5Hash(new TreeMap<Object, Object>(config).toString()) .substring(0, 8)); } String id = config.getProperty(ConfigKey.JOB_ID.toString()); AWSCredentials aws = create(config); AmazonSimpleDB db = new AmazonSimpleDBClient(aws); AmazonSQS sqs = new AmazonSQSClient(aws); AmazonS3 s3 = new AmazonS3Client(aws); final String mapQueue = config.getProperty(ConfigKey.MAP_QUEUE.toString()); final String reduceQueue = config.getProperty(ConfigKey.REDUCE_QUEUE.toString()); final String dom = config.getProperty(ConfigKey.SIMPLEDB_DOM.toString()); final String mapInputBucket = config.getProperty(ConfigKey.MAP_INPUTS_BUCKET.toString()); final String shuffleBucket = config.getProperty(ConfigKey.SHUFFLE_BUCKET.toString()); final String reduceOutputBucket = config.getProperty(ConfigKey.REDUCE_OUTPUTS_BUCKET.toString()); final int hashCard = new Integer(config.getProperty(ConfigKey.HASH_CARDINALITY.toString())); s3.createBucket(reduceOutputBucket); final long inputSplitCount = inputSplitPrefixes.size(); for (String key : inputSplitPrefixes) { Properties p = new Properties(); p.setProperty("input", "s3://" + mapInputBucket + "/" + key); sqs.sendMessage(new SendMessageRequest(mapQueue, serialize(p))); } SimpleDbCommitter.commitNewAttribute(db, dom, "parameters", "splits", "" + inputSplitCount); SimpleDbCommitter.commitNewAttribute(db, dom, "parameters", "hashes", "" + hashCard); SimpleDbCommitter.commitNewAttribute(db, dom, "parameters", "done", "1"); for (String hash : getAllHashes(hashCard)) { Properties p = new Properties(); p.setProperty("input", "s3://" + shuffleBucket + "/" + hash); sqs.sendMessage(new SendMessageRequest(reduceQueue, serialize(p))); } if (machineCount == 1) { // run locally SMRDriver.main(new String[] { MraUtils.convertToHex(serialize(config).getBytes()) }); } else if (machineCount > 1) { // run in the cloud String userData = produceUserData(ai, config, new URI(config.getProperty(ConfigKey.RUNNABLE_JARFILE_URI.toString()))); logger.debugf("launching job with id %s:", id); System.out.println(userData); AmazonEC2 ec2 = new AmazonEC2Client(aws); if (spotInstances) { RequestSpotInstancesRequest sir = new RequestSpotInstancesRequest(); sir.setSpotPrice(new Double(ai.getPrice()).toString()); sir.setInstanceCount(machineCount); sir.setType("one-time"); LaunchSpecification spec = new LaunchSpecification(); spec.setImageId(ai.getDefaultAMI()); spec.setUserData(new String(new Base64().encode(userData.getBytes("US-ASCII")))); spec.setInstanceType(ai.getApiName()); sir.setLaunchSpecification(spec); RequestSpotInstancesResult result = ec2.requestSpotInstances(sir); logger.debugf("spot instance request result: %s", result); } else { RunInstancesRequest req = new RunInstancesRequest(ai.getDefaultAMI(), machineCount, machineCount); req.setClientToken(id); req.setInstanceType(ai.getApiName()); req.setInstanceInitiatedShutdownBehavior("terminate"); req.setUserData(new String(new Base64().encode(userData.getBytes("US-ASCII")))); RunInstancesResult resp = ec2.runInstances(req); logger.debugf("on demand reservation id: %s", resp.getReservation().getReservationId()); labelEc2Instance(ec2, resp, "smr-" + id); } } } public static void labelEc2Instance(AmazonEC2 ec2, RunInstancesResult resp, String title) throws Exception { int tries = 0; boolean done = false; while (tries++ < 3 && !done) { try { List<String> resources = new LinkedList<String>(); for (Instance i : resp.getReservation().getInstances()) { resources.add(i.getInstanceId()); } List<Tag> tags = new LinkedList<Tag>(); tags.add(new Tag("Name", title)); CreateTagsRequest ctr = new CreateTagsRequest(resources, tags); ec2.createTags(ctr); done = true; logger.debugf("set tag(s)"); } catch (Exception e) { logger.warnf("exception setting tags: %s", e); Thread.sleep(3000); } } } public static String produceUserData(AmazonInstance ai, Properties c, URI jarFileURI) throws Exception { StringWriter sw = new StringWriter(); LinuxLineConventionPrintWriter pw = new LinuxLineConventionPrintWriter(new PrintWriter(sw)); pw.println("#!/bin/sh"); pw.println("cd /root"); pw.println("chmod 777 /mnt"); pw.println("aptitude update"); Set<String> set = new TreeSet<String>(); set.add("openjdk-6-jdk"); set.add("wget"); if (set.size() > 0) { pw.print("aptitude install -y "); Iterator<String> it = set.iterator(); while (it.hasNext()) { String x = it.next(); pw.print(x); if (it.hasNext()) { pw.print(" "); } } pw.println(); } pw.printf("wget %s", jarFileURI); pw.println(); String[] parts = jarFileURI.getPath().split("/"); String jar = parts[parts.length - 1]; pw.printf("java -Xmx%.0fm -cp %s %s %s", 1000 * 0.8 * ai.getMemoryGB(), jar, SMRDriver.class.getName(), MraUtils.convertToHex(serialize(c).getBytes())); pw.println(); pw.println("poweroff"); pw.close(); return sw.toString(); } public static AmazonS3 getS3(AWSCredentials aws) { AmazonS3Client s3 = new AmazonS3Client(aws); s3.addRequestHandler(new AbstractRequestHandler() { @Override public void beforeRequest(Request<?> request) { request.addHeader("x-amz-request-payer", "requester"); } }); return s3; } public static String prefixedName(String p, String n) { return p + "-" + n; } public static AWSCredentials create(final Properties p) { return new AWSCredentials() { @Override public String getAWSSecretKey() { return p.getProperty(ConfigKey.AWS_SECRETKEY.toString()); } @Override public String getAWSAccessKeyId() { return p.getProperty(ConfigKey.AWS_KEYID.toString()); } }; } public static SortedSet<String> getAllHashes(long mod) { SortedSet<String> out = new TreeSet<String>(); for (long i = 0; i < mod; i++) { out.add(fmt(i, mod)); } return out; } public static String hash(byte[] key, long mod) { byte[] buf = MraUtils.md5HashBytesToBytes(key); long x = Math.abs(MraUtils.extractLongValue(buf)); return fmt(x % mod, mod); } private static String fmt(long x, long mod) { long places = Math.round(Math.ceil(Math.log10(mod))); if (places == 0) { places = 1; } return new Formatter().format("%0" + places + "d", x).toString(); } public static String serialize(Properties p) throws Exception { StringWriter sw = new StringWriter(); try { p.store(sw, "n/a"); } finally { sw.close(); } return sw.toString(); } public static Properties marshall(String s) throws Exception { Properties p = new Properties(); StringReader sr = new StringReader(s); try { p.load(sr); } finally { sr.close(); } return p; } }
mrallc/smr
code/src/com/xoba/smr/SimpleMapReduce.java
Java
bsd-3-clause
9,071
////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004-2021 musikcube team // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // * Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // * Neither the name of the author nor the names of other contributors may // be used to endorse or promote products derived from this software // without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // ////////////////////////////////////////////////////////////////////////////// #pragma once extern "C" { #pragma warning(push, 0) #include <microhttpd.h> #pragma warning(pop) } #include "Context.h" #include <condition_variable> #include <mutex> #include <vector> #if MHD_VERSION < 0x00097001 #define MHD_Result int #endif class HttpServer { public: HttpServer(Context& context); ~HttpServer(); bool Start(); bool Stop(); void Wait(); private: static MHD_Result HandleRequest( void *cls, struct MHD_Connection *connection, const char *url, const char *method, const char *version, const char *upload_data, size_t *upload_data_size, void **con_cls); static size_t HandleUnescape( void * cls, struct MHD_Connection *c, char *s); static int HandleAudioTrackRequest( HttpServer* server, MHD_Response*& response, MHD_Connection* connection, std::vector<std::string>& pathParts); static int HandleThumbnailRequest( HttpServer* server, MHD_Response*& response, MHD_Connection* connection, std::vector<std::string>& pathParts); struct MHD_Daemon *httpServer; Context& context; volatile bool running; std::condition_variable exitCondition; std::mutex exitMutex; };
clangen/musikcube
src/plugins/server/HttpServer.h
C
bsd-3-clause
3,204
<?php namespace app\controllers\user; use Yii; use dektrium\user\controllers\ProfileController as PController; use app\models\ProfileSearch; /** * UserInfoController implements the CRUD actions for UserInfo model. */ class ProfileController extends PController { /*public function behaviors() { return [ 'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ 'delete' => ['post'], ], ], ]; }*/ /** * Lists all UserInfo models. * @return mixed */ public function actionIndex() { $searchModel = new ProfileSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', [ 'searchModel' => $searchModel, 'dataProvider' => $dataProvider, ]); } /** * Displays a single UserInfo model. * @param integer $id * @return mixed */ /*public function actionView($id) { return $this->render('view', [ 'model' => $this->findModel($id), ]); }*/ /** * Creates a new UserInfo model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ /*public function actionCreate() { $model = new UserInfo(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->id]); } else { return $this->render('create', [ 'model' => $model, ]); } }*/ /** * Updates an existing UserInfo model. * If update is successful, the browser will be redirected to the 'view' page. * @param integer $id * @return mixed */ /*public function actionUpdate($id) { $model = $this->findModel($id); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->id]); } else { return $this->render('update', [ 'model' => $model, ]); } }*/ /** * Deletes an existing UserInfo model. * If deletion is successful, the browser will be redirected to the 'index' page. * @param integer $id * @return mixed */ /*public function actionDelete($id) { $this->findModel($id)->delete(); return $this->redirect(['index']); }*/ /** * Finds the UserInfo model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return UserInfo the loaded model * @throws NotFoundHttpException if the model cannot be found */ /*protected function findModel($id) { if (($model = UserInfo::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }*/ }
ASLANTORRET/rgktask
controllers/user/ProfileController.php
PHP
bsd-3-clause
3,088
#!/bin/bash NAME=realtimefec PROJ=fecreader # This doesn't use the feed, it tests the file downloads # This is everything to handle the files before the body rows are entered # After the body rows are entered, the exotic ones must be superceded source /projects/$NAME/virt/bin/activate # /projects/$NAME/src/$NAME/$PROJ/manage.py scrape_rss_filings /projects/$NAME/src/$NAME/$PROJ/manage.py find_new_filings /projects/$NAME/src/$NAME/$PROJ/manage.py download_new_filings /projects/$NAME/src/$NAME/$PROJ/manage.py enter_headers_from_new_filings /projects/$NAME/src/$NAME/$PROJ/manage.py set_new_filing_details /projects/$NAME/src/$NAME/$PROJ/manage.py mark_amended /projects/$NAME/src/$NAME/$PROJ/manage.py send_body_row_jobs /projects/$NAME/src/$NAME/$PROJ/manage.py remove_blacklisted
sunlightlabs/read_FEC
fecreader/cron/load_step_1_findfilings.sh
Shell
bsd-3-clause
788
#ifndef REGRESS_H #define REGRESS_H /* Macro to shorten code where a number is added to the current value of an * element in a matrix. */ #define addval(A, VAL, I, J) setval((A), (VAL) + val((A), (I), (J)), (I), (J)) typedef struct { double **array; int rows; int cols; } matrix; void DestroyMatrix(matrix*); matrix* CalcMinor(matrix*, int, int); double CalcDeterminant(matrix*); int nCols(matrix*); int nRows(matrix*); double val(matrix*, int, int); void setval(matrix*, double, int, int); matrix* CreateMatrix(int, int); matrix* mtxtrn(matrix*); matrix* mtxmul(matrix*, matrix*); matrix* CalcAdj(matrix*); matrix* CalcInv(matrix*); matrix* regress(matrix*, matrix*); matrix* polyfit(matrix*, matrix*, int); matrix* ParseMatrix(char*); matrix* linspace(double, double, int); void Map(matrix*, double (*func)(double)); void mtxprnt(matrix*); void mtxprntfile(matrix*, char*); #endif
mirrorscotty/material-data
test/comsol/drying/regress.h
C
bsd-3-clause
900
div#childtickets { border: 1px outset #996; border-radius: .5em; padding: 1em; } div#childtickets table.listing thead th { border: none; } div#childtickets table.listing tbody tr { border: none; } div#childtickets table.listing tbody td { border: none; padding: 0.1em 0.5em; }
silk/trac-childticketsplugin
childtickets/htdocs/css/childtickets.css
CSS
bsd-3-clause
309
----------------------------------------------------------------------------- -- | -- Module : Distribution.Client.Configure -- Copyright : (c) David Himmelstrup 2005, -- Duncan Coutts 2005 -- License : BSD-like -- -- Maintainer : [email protected] -- Portability : portable -- -- High level interface to configuring a package. ----------------------------------------------------------------------------- module Distribution.Client.Configure ( configure, ) where import Distribution.Client.Dependency import qualified Distribution.Client.InstallPlan as InstallPlan import Distribution.Client.InstallPlan (InstallPlan) import Distribution.Client.IndexUtils as IndexUtils ( getSourcePackages, getInstalledPackages ) import Distribution.Client.Setup ( ConfigExFlags(..), configureCommand, filterConfigureFlags ) import Distribution.Client.Types as Source import Distribution.Client.SetupWrapper ( setupWrapper, SetupScriptOptions(..), defaultSetupScriptOptions ) import Distribution.Client.Targets ( userToPackageConstraint ) import Distribution.Simple.Compiler ( CompilerId(..), Compiler(compilerId) , PackageDB(..), PackageDBStack ) import Distribution.Simple.Program (ProgramConfiguration ) import Distribution.Simple.Setup ( ConfigFlags(..), fromFlag, toFlag, flagToMaybe, fromFlagOrDefault ) import Distribution.Simple.PackageIndex (PackageIndex) import Distribution.Simple.Utils ( defaultPackageDesc ) import Distribution.Package ( Package(..), packageName, Dependency(..), thisPackageVersion ) import Distribution.PackageDescription.Parse ( readPackageDescription ) import Distribution.PackageDescription.Configuration ( finalizePackageDescription ) import Distribution.Version ( anyVersion, thisVersion ) import Distribution.Simple.Utils as Utils ( notice, info, debug, die ) import Distribution.System ( Platform, buildPlatform ) import Distribution.Verbosity as Verbosity ( Verbosity ) import Data.Monoid (Monoid(..)) -- | Configure the package found in the local directory configure :: Verbosity -> PackageDBStack -> [Repo] -> Compiler -> ProgramConfiguration -> ConfigFlags -> ConfigExFlags -> [String] -> IO () configure verbosity packageDBs repos comp conf configFlags configExFlags extraArgs = do installedPkgIndex <- getInstalledPackages verbosity comp packageDBs conf sourcePkgDb <- getSourcePackages verbosity repos progress <- planLocalPackage verbosity comp configFlags configExFlags installedPkgIndex sourcePkgDb notice verbosity "Resolving dependencies..." maybePlan <- foldProgress logMsg (return . Left) (return . Right) progress case maybePlan of Left message -> do info verbosity message setupWrapper verbosity (setupScriptOptions installedPkgIndex) Nothing configureCommand (const configFlags) extraArgs Right installPlan -> case InstallPlan.ready installPlan of [pkg@(ConfiguredPackage (SourcePackage _ _ (LocalUnpackedPackage _)) _ _ _)] -> configurePackage verbosity (InstallPlan.planPlatform installPlan) (InstallPlan.planCompiler installPlan) (setupScriptOptions installedPkgIndex) configFlags pkg extraArgs _ -> die $ "internal error: configure install plan should have exactly " ++ "one local ready package." where setupScriptOptions index = SetupScriptOptions { useCabalVersion = maybe anyVersion thisVersion (flagToMaybe (configCabalVersion configExFlags)), useCompiler = Just comp, -- Hack: we typically want to allow the UserPackageDB for finding the -- Cabal lib when compiling any Setup.hs even if we're doing a global -- install. However we also allow looking in a specific package db. usePackageDB = if UserPackageDB `elem` packageDBs then packageDBs else packageDBs ++ [UserPackageDB], usePackageIndex = if UserPackageDB `elem` packageDBs then Just index else Nothing, useProgramConfig = conf, useDistPref = fromFlagOrDefault (useDistPref defaultSetupScriptOptions) (configDistPref configFlags), useLoggingHandle = Nothing, useWorkingDir = Nothing } logMsg message rest = debug verbosity message >> rest -- | Make an 'InstallPlan' for the unpacked package in the current directory, -- and all its dependencies. -- planLocalPackage :: Verbosity -> Compiler -> ConfigFlags -> ConfigExFlags -> PackageIndex -> SourcePackageDb -> IO (Progress String String InstallPlan) planLocalPackage verbosity comp configFlags configExFlags installedPkgIndex (SourcePackageDb _ packagePrefs) = do pkg <- readPackageDescription verbosity =<< defaultPackageDesc verbosity let -- We create a local package and ask to resolve a dependency on it localPkg = SourcePackage { packageInfoId = packageId pkg, Source.packageDescription = pkg, packageSource = LocalUnpackedPackage "." } solver = fromFlag $ configSolver configExFlags testsEnabled = fromFlagOrDefault False $ configTests configFlags benchmarksEnabled = fromFlagOrDefault False $ configBenchmarks configFlags resolverParams = addPreferences -- preferences from the config file or command line [ PackageVersionPreference name ver | Dependency name ver <- configPreferences configExFlags ] . addConstraints -- version constraints from the config file or command line -- TODO: should warn or error on constraints that are not on direct deps -- or flag constraints not on the package in question. (map userToPackageConstraint (configExConstraints configExFlags)) . addConstraints -- package flags from the config file or command line [ PackageConstraintFlags (packageName pkg) (configConfigurationsFlags configFlags) ] . addConstraints -- '--enable-tests' and '--enable-benchmarks' constraints from -- command line [ PackageConstraintStanzas (packageName pkg) $ concat [ if testsEnabled then [TestStanzas] else [] , if benchmarksEnabled then [BenchStanzas] else [] ] ] $ standardInstallPolicy installedPkgIndex (SourcePackageDb mempty packagePrefs) [SpecificSourcePackage localPkg] return (resolveDependencies buildPlatform (compilerId comp) solver resolverParams) -- | Call an installer for an 'SourcePackage' but override the configure -- flags with the ones given by the 'ConfiguredPackage'. In particular the -- 'ConfiguredPackage' specifies an exact 'FlagAssignment' and exactly -- versioned package dependencies. So we ignore any previous partial flag -- assignment or dependency constraints and use the new ones. -- configurePackage :: Verbosity -> Platform -> CompilerId -> SetupScriptOptions -> ConfigFlags -> ConfiguredPackage -> [String] -> IO () configurePackage verbosity platform comp scriptOptions configFlags (ConfiguredPackage (SourcePackage _ gpkg _) flags stanzas deps) extraArgs = setupWrapper verbosity scriptOptions (Just pkg) configureCommand configureFlags extraArgs where configureFlags = filterConfigureFlags configFlags { configConfigurationsFlags = flags, configConstraints = map thisPackageVersion deps, configVerbosity = toFlag verbosity, configBenchmarks = toFlag (BenchStanzas `elem` stanzas), configTests = toFlag (TestStanzas `elem` stanzas) } pkg = case finalizePackageDescription flags (const True) platform comp [] (enableStanzas stanzas gpkg) of Left _ -> error "finalizePackageDescription ConfiguredPackage failed" Right (desc, _) -> desc
alphaHeavy/cabal
cabal-install/Distribution/Client/Configure.hs
Haskell
bsd-3-clause
8,529
/* * [The BSD 3-Clause License] * Copyright (c) 2015, Samuel Suffos * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this list * of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, this * list of conditions and the following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. Neither the name of the copyright holder nor the names of its contributors may be * used to endorse or promote products derived from this software without specific * prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * */ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Matlab.Nodes { [Serializable] public abstract class InnerNode : InternalNode { #region CONSTRUCTORS: protected InnerNode() : base() { return; } #endregion } }
samuel-suffos/matlab-parser
Matlab.Nodes/02 Node/02 Internal/02 Inner/00 Base/InnerNode.cs
C#
bsd-3-clause
2,008
#!/usr/bin/python import os # With the addition of Keystone, to use an openstack cloud you should # authenticate against keystone, which returns a **Token** and **Service # Catalog**. The catalog contains the endpoint for all services the # user/tenant has access to - including nova, glance, keystone, swift. # # *NOTE*: Using the 2.0 *auth api* does not mean that compute api is 2.0. We # will use the 1.1 *compute api* os.environ['OS_AUTH_URL'] = "https://keystone.rc.nectar.org.au:5000/v2.0/" # With the addition of Keystone we have standardized on the term **tenant** # as the entity that owns the resources. os.environ['OS_TENANT_ID'] = "123456789012345678901234567890" os.environ['OS_TENANT_NAME'] = "tenant_name" # In addition to the owning entity (tenant), openstack stores the entity # performing the action as the **user**. os.environ['OS_USERNAME'] = "[email protected]" # With Keystone you pass the keystone password. os.environ['OS_PASSWORD'] = "????????????????????"
wettenhj/mytardis-swift-uploader
openrc.py
Python
bsd-3-clause
994
<?php use yii\helpers\Html; use yii\widgets\ActiveForm; /** * @var yii\web\View $this * @var app\models\Image $model * @var yii\widgets\ActiveForm $form */ ?> <div class="image-form"> <?php $form = ActiveForm::begin(); ?> <?= $form->field($model, 'name')->textInput(['maxlength' => 50]) ?> <?= $form->field($model, 'location_shooting')->textInput(['maxlength' => 200]) ?> <?= $form->field($model, 'file')->textarea(['rows' => 6]) ?> <?= $form->field($model, 'upload_date')->textInput() ?> <div class="form-group"> <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> </div> <?php ActiveForm::end(); ?> </div>
novomirskoy/yii2gallery
views/image/_form.php
PHP
bsd-3-clause
754
miniature-ninja-agile-awesomeness ================================= Simply the best agile programme for time reporting ever built. This is a project made by students at Linköpings University. Contributions ================================= How to contribute This project uses git, and is currently hosted on Github at https://github.com/Magrit/miniature-ninja-agile-awesomeness Although a goal would be to have a perfect git history, multiple of the projects participants are not familiar with the complications of git. Something that can/will result in horrible git commits and amends. How to ================================= If you do not have git setup properly, please follow the following guides https://help.github.com/articles/set-up-git https://help.github.com/articles/generating-ssh-keys To fetch the repository to start developing ``` git clone [email protected]:Magrit/miniature-ninja-agile-awesomeness.git ``` In order to start your own branch for development. ``` git checkout -b <feature to work on> ``` Or fork through Githubs interface. Code Reviews ================================= Either ask to become a contributer, or send of a Pull Request. This is best done through the Github interface via your own branch/fork. Code reviews should be applied as Pull Requests through Github. This means that all features should be it's own branch which then will be merged into Master. Master should at all time be runnable, which means that all code reviews should be run before being merged into master. How to for branches ================================= The general workflow for code reviewing is the following. ``` git pull origin master git checkout <branch to work on> ``` <--All work is done--> ``` git commit -m "<Commit message>" git merge master ``` After all that is done, apply for the Pull Request through Githubs interface, tag relevant people you want to review. When the request has been granted, either you or the reviewer should be able to automatically merge the request through Githubs interface, if not, follow the following workflow. ``` git pull --all git checkout master git merge <branch to to merge> ``` <-- Fix the merge conflict --> ``` git commit -m "fixed merge conflict" git push origin master ``` License ================================= miniature-ninja-agile-awesomeness is licensed under the [BSD License](http://www.github.com/Magrit/miniature-ninja-agile-awesomeness/blob/master/LICENSE) Special considerations ================================= Even if something breakes, take a deep breath and contact one of the maintainers, or try to Google for the error and try to fix it on your own if it's manageable.
Magrit/miniature-ninja-agile-awesomeness
README.md
Markdown
bsd-3-clause
2,673
<?php /* Copyright (c) 2012, Silvercore Dev. (www.silvercoredev.com) Todos os direitos reservados. Ver o arquivo licenca.txt na raiz do BlackbirdIS para mais detalhes. */ session_start(); if (!isset($_SESSION["bis"]) || $_SESSION["bis"] != 1) { header("Location: index.php"); die(); } ?>
silvercoredev/BlackbirdIS
1.0/src/BlackbirdIS/admin/vsession.php
PHP
bsd-3-clause
319
require "rbconfig" require 'test/unit' require 'socket' require 'openssl' require 'puma/minissl' require 'puma/server' require 'net/https' class TestPumaServer < Test::Unit::TestCase def setup @port = 3212 @host = "127.0.0.1" @app = lambda { |env| [200, {}, [env['rack.url_scheme']]] } @events = Puma::Events.new STDOUT, STDERR @server = Puma::Server.new @app, @events if defined?(JRUBY_VERSION) @ssl_key = File.expand_path "../../examples/puma/keystore.jks", __FILE__ @ssl_cert = @ssl_key else @ssl_key = File.expand_path "../../examples/puma/puma_keypair.pem", __FILE__ @ssl_cert = File.expand_path "../../examples/puma/cert_puma.pem", __FILE__ end end def teardown @server.stop(true) end def test_url_scheme_for_https ctx = Puma::MiniSSL::Context.new ctx.key = @ssl_key ctx.cert = @ssl_cert ctx.verify_mode = Puma::MiniSSL::VERIFY_NONE @server.add_ssl_listener @host, @port, ctx @server.run http = Net::HTTP.new @host, @port http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE body = nil http.start do req = Net::HTTP::Get.new "/", {} http.request(req) do |rep| body = rep.body end end assert_equal "https", body end unless defined? JRUBY_VERSION def test_proper_stringio_body data = nil @server.app = proc do |env| data = env['rack.input'].read [200, {}, ["ok"]] end @server.add_tcp_listener @host, @port @server.run fifteen = "1" * 15 sock = TCPSocket.new @host, @port sock << "PUT / HTTP/1.0\r\nContent-Length: 30\r\n\r\n#{fifteen}" sleep 0.1 # important so that the previous data is sent as a packet sock << fifteen sock.read assert_equal "#{fifteen}#{fifteen}", data end def test_puma_socket body = "HTTP/1.1 750 Upgraded to Awesome\r\nDone: Yep!\r\n" @server.app = proc do |env| io = env['puma.socket'] io.write body io.close [-1, {}, []] end @server.add_tcp_listener @host, @port @server.run sock = TCPSocket.new @host, @port sock << "PUT / HTTP/1.0\r\n\r\nHello" assert_equal body, sock.read end def test_very_large_return giant = "x" * 2056610 @server.app = proc do |env| [200, {}, [giant]] end @server.add_tcp_listener @host, @port @server.run sock = TCPSocket.new @host, @port sock << "GET / HTTP/1.0\r\n\r\n" while true line = sock.gets break if line == "\r\n" end out = sock.read assert_equal giant.bytesize, out.bytesize end def test_respect_x_forwarded_proto @server.app = proc do |env| [200, {}, [env['SERVER_PORT']]] end @server.add_tcp_listener @host, @port @server.run req = Net::HTTP::Get.new("/") req['HOST'] = "example.com" req['X_FORWARDED_PROTO'] = "https" res = Net::HTTP.start @host, @port do |http| http.request(req) end assert_equal "443", res.body end def test_default_server_port @server.app = proc do |env| [200, {}, [env['SERVER_PORT']]] end @server.add_tcp_listener @host, @port @server.run req = Net::HTTP::Get.new("/") req['HOST'] = "example.com" res = Net::HTTP.start @host, @port do |http| http.request(req) end assert_equal "80", res.body end def test_HEAD_has_no_body @server.app = proc { |env| [200, {"Foo" => "Bar"}, ["hello"]] } @server.add_tcp_listener @host, @port @server.run sock = TCPSocket.new @host, @port sock << "HEAD / HTTP/1.0\r\n\r\n" data = sock.read assert_equal "HTTP/1.0 200 OK\r\nFoo: Bar\r\nContent-Length: 5\r\n\r\n", data end def test_GET_with_empty_body_has_sane_chunking @server.app = proc { |env| [200, {}, [""]] } @server.add_tcp_listener @host, @port @server.run sock = TCPSocket.new @host, @port sock << "HEAD / HTTP/1.0\r\n\r\n" data = sock.read assert_equal "HTTP/1.0 200 OK\r\nContent-Length: 0\r\n\r\n", data end def test_GET_with_no_body_has_sane_chunking @server.app = proc { |env| [200, {}, []] } @server.add_tcp_listener @host, @port @server.run sock = TCPSocket.new @host, @port sock << "HEAD / HTTP/1.0\r\n\r\n" data = sock.read assert_equal "HTTP/1.0 200 OK\r\n\r\n", data end def test_doesnt_print_backtrace_in_production @events = Puma::Events.strings @server = Puma::Server.new @app, @events @server.app = proc { |e| raise "don't leak me bro" } @server.leak_stack_on_error = false @server.add_tcp_listener @host, @port @server.run sock = TCPSocket.new @host, @port sock << "GET / HTTP/1.0\r\n\r\n" data = sock.read assert_not_match(/don't leak me bro/, data) assert_match(/HTTP\/1.0 500 Internal Server Error/, data) end def test_prints_custom_error @events = Puma::Events.strings re = lambda { |err| [302, {'Content-Type' => 'text', 'Location' => 'foo.html'}, ['302 found']] } @server = Puma::Server.new @app, @events, {lowlevel_error_handler: re} @server.app = proc { |e| raise "don't leak me bro" } @server.add_tcp_listener @host, @port @server.run sock = TCPSocket.new @host, @port sock << "GET / HTTP/1.0\r\n\r\n" data = sock.read assert_match(/HTTP\/1.0 302 Found/, data) end def test_custom_http_codes_10 @server.app = proc { |env| [449, {}, [""]] } @server.add_tcp_listener @host, @port @server.run sock = TCPSocket.new @host, @port sock << "GET / HTTP/1.0\r\n\r\n" data = sock.read assert_equal "HTTP/1.0 449 CUSTOM\r\nConnection: close\r\nContent-Length: 0\r\n\r\n", data end def test_custom_http_codes_11 @server.app = proc { |env| [449, {}, [""]] } @server.add_tcp_listener @host, @port @server.run sock = TCPSocket.new @host, @port sock << "GET / HTTP/1.1\r\n\r\n" data = sock.read assert_equal "HTTP/1.1 449 CUSTOM\r\nContent-Length: 0\r\n\r\n", data end def test_HEAD_returns_content_headers @server.app = proc { |env| [200, {"Content-Type" => "application/pdf", "Content-Length" => "4242"}, []] } @server.add_tcp_listener @host, @port @server.run sock = TCPSocket.new @host, @port sock << "HEAD / HTTP/1.0\r\n\r\n" data = sock.read assert_equal "HTTP/1.0 200 OK\r\nContent-Type: application/pdf\r\nContent-Length: 4242\r\n\r\n", data end def test_status_hook_fires_when_server_changes_states states = [] @events.register(:state) { |s| states << s } @server.app = proc { |env| [200, {}, [""]] } @server.add_tcp_listener @host, @port @server.run sock = TCPSocket.new @host, @port sock << "HEAD / HTTP/1.0\r\n\r\n" sock.read assert_equal [:booting, :running], states @server.stop(true) assert_equal [:booting, :running, :stop, :done], states end def test_timeout_in_data_phase @server.first_data_timeout = 2 @server.add_tcp_listener @host, @port @server.run client = TCPSocket.new @host, @port client << "POST / HTTP/1.1\r\nHost: test.com\r\nContent-Type: text/plain\r\nContent-Length: 5\r\n\r\n" data = client.gets assert_equal "HTTP/1.1 408 Request Timeout\r\n", data end end
allaire/puma
test/test_puma_server.rb
Ruby
bsd-3-clause
7,344
// Copyright 2020 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef ASH_COMPONENTS_PHONEHUB_FAKE_NOTIFICATION_ACCESS_MANAGER_H_ #define ASH_COMPONENTS_PHONEHUB_FAKE_NOTIFICATION_ACCESS_MANAGER_H_ #include "ash/components/phonehub/notification_access_manager.h" namespace ash { namespace phonehub { class FakeNotificationAccessManager : public NotificationAccessManager { public: explicit FakeNotificationAccessManager( AccessStatus access_status = AccessStatus::kAvailableButNotGranted); ~FakeNotificationAccessManager() override; using NotificationAccessManager::IsSetupOperationInProgress; void SetAccessStatusInternal(AccessStatus access_status) override; void SetNotificationSetupOperationStatus( NotificationAccessSetupOperation::Status new_status); // NotificationAccessManager: AccessStatus GetAccessStatus() const override; bool HasNotificationSetupUiBeenDismissed() const override; void DismissSetupRequiredUi() override; void ResetHasNotificationSetupUiBeenDismissed(); private: AccessStatus access_status_; bool has_notification_setup_ui_been_dismissed_ = false; }; } // namespace phonehub } // namespace ash // TODO(https://crbug.com/1164001): remove after the migration is finished. namespace chromeos { namespace phonehub { using ::ash::phonehub::FakeNotificationAccessManager; } } // namespace chromeos #endif // ASH_COMPONENTS_PHONEHUB_FAKE_NOTIFICATION_ACCESS_MANAGER_H_
ric2b/Vivaldi-browser
chromium/ash/components/phonehub/fake_notification_access_manager.h
C
bsd-3-clause
1,547
# -*- coding: utf-8 -*- from __future__ import absolute_import from .local import Local # noqa from .production import Production # noqa # This will make sure the app is always imported when # Django starts so that shared_task will use this app. from .celery import app as celery_app
HEG-Arc/Appagoo
appagoo/config/__init__.py
Python
bsd-3-clause
288
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef ASH_SYSTEM_AUDIO_TRAY_AUDIO_H_ #define ASH_SYSTEM_AUDIO_TRAY_AUDIO_H_ #include "ash/system/audio/audio_observer.h" #include "ash/system/tray/tray_image_item.h" #include "base/memory/scoped_ptr.h" namespace ash { namespace system { class TrayAudioDelegate; } namespace internal { namespace tray { class VolumeView; } class TrayAudio : public TrayImageItem, public AudioObserver { public: TrayAudio(SystemTray* system_tray, scoped_ptr<system::TrayAudioDelegate> audio_delegate); virtual ~TrayAudio(); protected: virtual void Update(); scoped_ptr<system::TrayAudioDelegate> audio_delegate_; tray::VolumeView* volume_view_; // True if VolumeView should be created for accelerator pop up; // Otherwise, it should be created for detailed view in ash tray bubble. bool pop_up_volume_view_; private: // Overridden from TrayImageItem. virtual bool GetInitialVisibility() OVERRIDE; // Overridden from SystemTrayItem. virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE; virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE; virtual void DestroyDefaultView() OVERRIDE; virtual void DestroyDetailedView() OVERRIDE; virtual bool ShouldHideArrow() const OVERRIDE; virtual bool ShouldShowShelf() const OVERRIDE; // Overridden from AudioObserver. virtual void OnOutputVolumeChanged() OVERRIDE; virtual void OnOutputMuteChanged() OVERRIDE; virtual void OnAudioNodesChanged() OVERRIDE; virtual void OnActiveOutputNodeChanged() OVERRIDE; virtual void OnActiveInputNodeChanged() OVERRIDE; DISALLOW_COPY_AND_ASSIGN(TrayAudio); }; } // namespace internal } // namespace ash #endif // ASH_SYSTEM_AUDIO_TRAY_AUDIO_H_
ChromiumWebApps/chromium
ash/system/audio/tray_audio.h
C
bsd-3-clause
1,910
module Text.OpenGL.Xml.ReadRegistry ( readRegistry, parseRegistry, PreProcess ) where import Prelude hiding ((.), id) import Control.Category import Text.OpenGL.Types import Text.OpenGL.Xml.Pickle() import Text.OpenGL.Xml.PreProcess import Text.XML.HXT.Core type PreProcess = Bool -- TODO RelaxNG validation readRegistry :: FilePath -> PreProcess -> IO (Either String Registry) readRegistry fp pp = do results <- runX ( readDocument readOpts fp >>> preProcess pp >>> parseRegistryArrow ) -- TODO: error handling return $ handleResults results where readOpts :: [SysConfig] readOpts = [withValidate no, withPreserveComment no] preProcess :: (ArrowChoice a, ArrowXml a) => PreProcess -> a XmlTree XmlTree preProcess pp = if pp then preProcessRegistry else id -- | TODO: make it work (doesn't work with the <?xml ?> header. parseRegistry :: String -> PreProcess -> Either String Registry parseRegistry str pp = handleResults $ runLA ( xread >>> preProcess pp >>> parseRegistryArrow ) str handleResults :: [Either String Registry] -> Either String Registry handleResults rs = case rs of [] -> Left "No parse" (_:_:_) -> Left "Multiple parse" [rc] -> rc parseRegistryArrow :: ArrowXml a => a XmlTree (Either String Registry) parseRegistryArrow = removeAllWhiteSpace >>> -- This processing is needed for the non IO case. removeAllComment >>> arr (unpickleDoc' xpickle)
Laar/opengl-xmlspec
src/Text/OpenGL/Xml/ReadRegistry.hs
Haskell
bsd-3-clause
1,468
// // CEDestinySDK.h // CEDestinySDK // // Created by Caleb Eades on 11/12/15. // Copyright (c) 2015 Caleb Eades. All rights reserved. // #import <UIKit/UIKit.h> //! Project version number for CEDestinySDK. FOUNDATION_EXPORT double CEDestinySDKVersionNumber; //! Project version string for CEDestinySDK. FOUNDATION_EXPORT const unsigned char CEDestinySDKVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <CEDestinySDK/PublicHeader.h> #import "CEDestinySDK.h"
caleb-eades/CEDestinySDK
CEDestinySDK/CEDestinySDK.h
C
bsd-3-clause
543
/** * History.js Core * @author Benjamin Arthur Lupton <[email protected]> * @copyright 2010-2011 Benjamin Arthur Lupton <[email protected]> * @license New BSD License <http://creativecommons.org/licenses/BSD/> */ (function(window,undefined){ "use strict"; // ======================================================================== // Initialise // Localise Globals var console = window.console||undefined, // Prevent a JSLint complain document = window.document, // Make sure we are using the correct document navigator = window.navigator, // Make sure we are using the correct navigator sessionStorage = false, // sessionStorage setTimeout = window.setTimeout, clearTimeout = window.clearTimeout, setInterval = window.setInterval, clearInterval = window.clearInterval, JSON = window.JSON, alert = window.alert, History = window.History = window.History||{}, // Public History Object history = window.history; // Old History Object // MooTools Compatibility JSON.stringify = JSON.stringify||JSON.encode; JSON.parse = JSON.parse||JSON.decode; try { sessionStorage = window.sessionStorage; // This will throw an exception in some browsers when cookies/localStorage are explicitly disabled (i.e. Chrome) sessionStorage.setItem('TEST', '1'); sessionStorage.removeItem('TEST'); } catch(e) { sessionStorage = false; } // Check Existence if ( typeof History.init !== 'undefined' ) { throw new Error('History.js Core has already been loaded...'); } // Initialise History History.init = function(){ // Check Load Status of Adapter if ( typeof History.Adapter === 'undefined' ) { return false; } // Check Load Status of Core if ( typeof History.initCore !== 'undefined' ) { History.initCore(); } // Check Load Status of HTML4 Support if ( typeof History.initHtml4 !== 'undefined' ) { History.initHtml4(); } // Return true return true; }; // ======================================================================== // Initialise Core // Initialise Core History.initCore = function(){ // Initialise if ( typeof History.initCore.initialized !== 'undefined' ) { // Already Loaded return false; } else { History.initCore.initialized = true; } // ==================================================================== // Options /** * History.options * Configurable options */ History.options = History.options||{}; /** * History.options.hashChangeInterval * How long should the interval be before hashchange checks */ History.options.hashChangeInterval = History.options.hashChangeInterval || 100; /** * History.options.safariPollInterval * How long should the interval be before safari poll checks */ History.options.safariPollInterval = History.options.safariPollInterval || 500; /** * History.options.doubleCheckInterval * How long should the interval be before we perform a double check */ History.options.doubleCheckInterval = History.options.doubleCheckInterval || 500; /** * History.options.storeInterval * How long should we wait between store calls */ History.options.storeInterval = History.options.storeInterval || 5000; /** * History.options.busyDelay * How long should we wait between busy events */ History.options.busyDelay = History.options.busyDelay || 250; /** * History.options.debug * If true will enable debug messages to be logged */ History.options.debug = History.options.debug || false; /** * History.options.initialTitle * What is the title of the initial state */ History.options.initialTitle = History.options.initialTitle || document.title; // ==================================================================== // Interval record /** * History.intervalList * List of intervals set, to be cleared when document is unloaded. */ History.intervalList = []; /** * History.clearAllIntervals * Clears all setInterval instances. */ History.clearAllIntervals = function(){ var i, il = History.intervalList; if (typeof il !== "undefined" && il !== null) { for (i = 0; i < il.length; i++) { clearInterval(il[i]); } History.intervalList = null; } }; // ==================================================================== // Debug /** * History.debug(message,...) * Logs the passed arguments if debug enabled */ History.debug = function(){ if ( (History.options.debug||false) ) { History.log.apply(History,arguments); } }; /** * History.log(message,...) * Logs the passed arguments */ History.log = function(){ // Prepare var consoleExists = !(typeof console === 'undefined' || typeof console.log === 'undefined' || typeof console.log.apply === 'undefined'), textarea = document.getElementById('log'), message, i,n, args,arg ; // Write to Console if ( consoleExists ) { args = Array.prototype.slice.call(arguments); message = args.shift(); if ( typeof console.debug !== 'undefined' ) { console.debug.apply(console,[message,args]); } else { console.log.apply(console,[message,args]); } } else { message = ("\n"+arguments[0]+"\n"); } // Write to log for ( i=1,n=arguments.length; i<n; ++i ) { arg = arguments[i]; if ( typeof arg === 'object' && typeof JSON !== 'undefined' ) { try { arg = JSON.stringify(arg); } catch ( Exception ) { // Recursive Object } } message += "\n"+arg+"\n"; } // Textarea if ( textarea ) { textarea.value += message+"\n-----\n"; textarea.scrollTop = textarea.scrollHeight - textarea.clientHeight; } // No Textarea, No Console else if ( !consoleExists ) { alert(message); } // Return true return true; }; // ==================================================================== // Emulated Status /** * History.getInternetExplorerMajorVersion() * Get's the major version of Internet Explorer * @return {integer} * @license Public Domain * @author Benjamin Arthur Lupton <[email protected]> * @author James Padolsey <https://gist.github.com/527683> */ History.getInternetExplorerMajorVersion = function(){ var result = History.getInternetExplorerMajorVersion.cached = (typeof History.getInternetExplorerMajorVersion.cached !== 'undefined') ? History.getInternetExplorerMajorVersion.cached : (function(){ var v = 3, div = document.createElement('div'), all = div.getElementsByTagName('i'); while ( (div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->') && all[0] ) {} return (v > 4) ? v : false; })() ; return result; }; /** * History.isInternetExplorer() * Are we using Internet Explorer? * @return {boolean} * @license Public Domain * @author Benjamin Arthur Lupton <[email protected]> */ History.isInternetExplorer = function(){ var result = History.isInternetExplorer.cached = (typeof History.isInternetExplorer.cached !== 'undefined') ? History.isInternetExplorer.cached : Boolean(History.getInternetExplorerMajorVersion()) ; return result; }; /** * History.emulated * Which features require emulating? */ History.emulated = { pushState: !Boolean( window.history && window.history.pushState && window.history.replaceState && !( (/ Mobile\/([1-7][a-z]|(8([abcde]|f(1[0-8]))))/i).test(navigator.userAgent) /* disable for versions of iOS before version 4.3 (8F190) */ || (/AppleWebKit\/5([0-2]|3[0-2])/i).test(navigator.userAgent) /* disable for the mercury iOS browser, or at least older versions of the webkit engine */ ) ), hashChange: Boolean( !(('onhashchange' in window) || ('onhashchange' in document)) || (History.isInternetExplorer() && History.getInternetExplorerMajorVersion() < 8) ) }; /** * History.enabled * Is History enabled? */ History.enabled = !History.emulated.pushState; /** * History.bugs * Which bugs are present */ History.bugs = { /** * Safari 5 and Safari iOS 4 fail to return to the correct state once a hash is replaced by a `replaceState` call * https://bugs.webkit.org/show_bug.cgi?id=56249 */ setHash: Boolean(!History.emulated.pushState && navigator.vendor === 'Apple Computer, Inc.' && /AppleWebKit\/5([0-2]|3[0-3])/.test(navigator.userAgent)), /** * Safari 5 and Safari iOS 4 sometimes fail to apply the state change under busy conditions * https://bugs.webkit.org/show_bug.cgi?id=42940 */ safariPoll: Boolean(!History.emulated.pushState && navigator.vendor === 'Apple Computer, Inc.' && /AppleWebKit\/5([0-2]|3[0-3])/.test(navigator.userAgent)), /** * MSIE 6 and 7 sometimes do not apply a hash even it was told to (requiring a second call to the apply function) */ ieDoubleCheck: Boolean(History.isInternetExplorer() && History.getInternetExplorerMajorVersion() < 8), /** * MSIE 6 requires the entire hash to be encoded for the hashes to trigger the onHashChange event */ hashEscape: Boolean(History.isInternetExplorer() && History.getInternetExplorerMajorVersion() < 7) }; /** * History.isEmptyObject(obj) * Checks to see if the Object is Empty * @param {Object} obj * @return {boolean} */ History.isEmptyObject = function(obj) { for ( var name in obj ) { return false; } return true; }; /** * History.cloneObject(obj) * Clones a object and eliminate all references to the original contexts * @param {Object} obj * @return {Object} */ History.cloneObject = function(obj) { var hash,newObj; if ( obj ) { hash = JSON.stringify(obj); newObj = JSON.parse(hash); } else { newObj = {}; } return newObj; }; History.extendObject = function(obj, extension) { for (var key in extension) { if (extension.hasOwnProperty(key)) { obj[key] = extension[key]; } } }; History.setSessionStorageItem = function(key, value) { try { sessionStorage.setItem(key, value); } catch(e) { try { // hack: Workaround for a bug seen on iPads. Sometimes the quota exceeded error comes up and simply // removing/resetting the storage can work. sessionStorage.removeItem(key); sessionStorage.setItem(key, value); } catch(e) { try { // no permissions or quota exceed if (e.name === 'QuotaExceededError' || e.name === 'NS_ERROR_DOM_QUOTA_REACHED') { History.Adapter.trigger(window, 'storageQuotaExceed'); sessionStorage.setItem(key, value); } } catch(e) { } } } } // ==================================================================== // URL Helpers /** * History.getRootUrl() * Turns "http://mysite.com/dir/page.html?asd" into "http://mysite.com" * @return {String} rootUrl */ History.getRootUrl = function(){ // Create var rootUrl = document.location.protocol+'//'+(document.location.hostname||document.location.host); if ( document.location.port||false ) { rootUrl += ':'+document.location.port; } rootUrl += '/'; // Return return rootUrl; }; /** * History.getBaseHref() * Fetches the `href` attribute of the `<base href="...">` element if it exists * @return {String} baseHref */ History.getBaseHref = function(){ // Create var baseElements = document.getElementsByTagName('base'), baseElement = null, baseHref = ''; // Test for Base Element if ( baseElements.length === 1 ) { // Prepare for Base Element baseElement = baseElements[0]; baseHref = baseElement.href.replace(/[^\/]+$/,''); } // Adjust trailing slash baseHref = baseHref.replace(/\/+$/,''); if ( baseHref ) baseHref += '/'; // Return return baseHref; }; /** * History.getBaseUrl() * Fetches the baseHref or basePageUrl or rootUrl (whichever one exists first) * @return {String} baseUrl */ History.getBaseUrl = function(){ // Create var baseUrl = History.getBaseHref()||History.getBasePageUrl()||History.getRootUrl(); // Return return baseUrl; }; /** * History.getPageUrl() * Fetches the URL of the current page * @return {String} pageUrl */ History.getPageUrl = function(){ // Fetch var State = History.getState(false,false), stateUrl = (State||{}).url||document.location.href, pageUrl; // Create pageUrl = stateUrl.replace(/\/+$/,'').replace(/[^\/]+$/,function(part,index,string){ return (/\./).test(part) ? part : part+'/'; }); // Return return pageUrl; }; /** * History.getBasePageUrl() * Fetches the Url of the directory of the current page * @return {String} basePageUrl */ History.getBasePageUrl = function(){ // Create var basePageUrl = document.location.href.replace(/[#\?].*/,'').replace(/[^\/]+$/,function(part,index,string){ return (/[^\/]$/).test(part) ? '' : part; }).replace(/\/+$/,'')+'/'; // Return return basePageUrl; }; /** * History.getFullUrl(url) * Ensures that we have an absolute URL and not a relative URL * @param {string} url * @param {Boolean} allowBaseHref * @return {string} fullUrl */ History.getFullUrl = function(url,allowBaseHref){ // Prepare var fullUrl = url, firstChar = url.substring(0,1); allowBaseHref = (typeof allowBaseHref === 'undefined') ? true : allowBaseHref; // Check if ( /[a-z]+\:\/\//.test(url) ) { // Full URL } else if ( firstChar === '/' ) { // Root URL fullUrl = History.getRootUrl()+url.replace(/^\/+/,''); } else if ( firstChar === '#' ) { // Anchor URL fullUrl = History.getPageUrl().replace(/#.*/,'')+url; } else if ( firstChar === '?' ) { // Query URL fullUrl = History.getPageUrl().replace(/[\?#].*/,'')+url; } else { // Relative URL if ( allowBaseHref ) { fullUrl = History.getBaseUrl()+url.replace(/^(\.\/)+/,''); } else { fullUrl = History.getBasePageUrl()+url.replace(/^(\.\/)+/,''); } // We have an if condition above as we do not want hashes // which are relative to the baseHref in our URLs // as if the baseHref changes, then all our bookmarks // would now point to different locations // whereas the basePageUrl will always stay the same } // Return return fullUrl.replace(/\#$/,''); }; /** * History.getShortUrl(url) * Ensures that we have a relative URL and not a absolute URL * @param {string} url * @return {string} url */ History.getShortUrl = function(url){ // Prepare var shortUrl = url, baseUrl = History.getBaseUrl(), rootUrl = History.getRootUrl(); // Trim baseUrl if ( History.emulated.pushState ) { // We are in a if statement as when pushState is not emulated // The actual url these short urls are relative to can change // So within the same session, we the url may end up somewhere different shortUrl = shortUrl.replace(baseUrl,''); } // Trim rootUrl shortUrl = shortUrl.replace(rootUrl,'/'); // Ensure we can still detect it as a state if ( History.isTraditionalAnchor(shortUrl) ) { shortUrl = './'+shortUrl; } // Clean It shortUrl = shortUrl.replace(/^(\.\/)+/g,'./').replace(/\#$/,''); // Return return shortUrl; }; // ==================================================================== // State Storage /** * History.store * The store for all session specific data */ History.store = {}; /** * History.idToState * 1-1: State ID to State Object */ History.idToState = History.idToState||{}; /** * History.stateToId * 1-1: State String to State ID */ History.stateToId = History.stateToId||{}; /** * History.urlToId * 1-1: State URL to State ID */ History.urlToId = History.urlToId||{}; /** * History.storedStates * Store the states in an array */ History.storedStates = History.storedStates||[]; /** * History.savedStates * Saved the states in an array */ History.savedStates = History.savedStates||[]; /** * History.noramlizeStore() * Noramlize the store by adding necessary values */ History.normalizeStore = function(){ History.store.idToState = History.store.idToState||{}; History.store.urlToId = History.store.urlToId||{}; History.store.stateToId = History.store.stateToId||{}; }; /** * History.getState() * Get an object containing the data, title and url of the current state * @param {Boolean} friendly * @param {Boolean} create * @return {Object} State */ History.getState = function(friendly,create){ // Prepare if ( typeof friendly === 'undefined' ) { friendly = true; } if ( typeof create === 'undefined' ) { create = true; } // Fetch var State = History.getLastSavedState(); // Create if ( !State && create ) { State = History.createStateObject(); } // Adjust if ( friendly ) { State = History.cloneObject(State); State.url = State.cleanUrl||State.url; } // Return return State; }; /** * History.getIdByState(State) * Gets a ID for a State * @param {State} newState * @return {String} id */ History.getIdByState = function(newState){ // Fetch ID var id = History.extractId(newState.url), lastSavedState, str; if ( !id ) { // Find ID via State String str = History.getStateString(newState); if ( typeof History.stateToId[str] !== 'undefined' ) { id = History.stateToId[str]; } else if ( typeof History.store.stateToId[str] !== 'undefined' ) { id = History.store.stateToId[str]; } else { id = sessionStorage ? sessionStorage.getItem('uniqId') : new Date().getTime(); if (id == undefined){ id = 0; } lastSavedState = History.getLastSavedState(); if (lastSavedState) { id = lastSavedState.id + 1; if (sessionStorage) { History.setSessionStorageItem('uniqId', id); } } else { // Generate a new ID while (true) { ++id; if (typeof History.idToState[id] === 'undefined' && typeof History.store.idToState[id] === 'undefined') { if (sessionStorage) { History.setSessionStorageItem('uniqId', id); } break; } } } // Apply the new State to the ID History.stateToId[str] = id; History.idToState[id] = newState; } } // Return ID return id; }; /** * History.normalizeState(State) * Expands a State Object * @param {object} State * @return {object} */ History.normalizeState = function(oldState){ // Variables var newState, dataNotEmpty; // Prepare if ( !oldState || (typeof oldState !== 'object') ) { oldState = {}; } // Check if ( typeof oldState.normalized !== 'undefined' ) { return oldState; } // Adjust if ( !oldState.data || (typeof oldState.data !== 'object') ) { oldState.data = {}; } // ---------------------------------------------------------------- // Create newState = {}; newState.normalized = true; newState.title = oldState.title||''; newState.url = History.getFullUrl(History.unescapeString(oldState.url||document.location.href)); newState.hash = History.getShortUrl(newState.url); newState.data = History.cloneObject(oldState.data); // Fetch ID newState.id = History.getIdByState(newState); // ---------------------------------------------------------------- // Clean the URL newState.cleanUrl = newState.url.replace(/\??\&_suid.*/,''); newState.url = newState.cleanUrl; // Check to see if we have more than just a url dataNotEmpty = !History.isEmptyObject(newState.data); // Apply if ( newState.title || dataNotEmpty ) { // Add ID to Hash newState.hash = History.getShortUrl(newState.url).replace(/\??\&_suid.*/,''); if ( !/\?/.test(newState.hash) ) { newState.hash += '?'; } newState.hash += '&_suid='+newState.id; } // Create the Hashed URL newState.hashedUrl = History.getFullUrl(newState.hash); // ---------------------------------------------------------------- // Update the URL if we have a duplicate if ( (History.emulated.pushState || History.bugs.safariPoll) && History.hasUrlDuplicate(newState) ) { newState.url = newState.hashedUrl; } // ---------------------------------------------------------------- // Return return newState; }; /** * History.createStateObject(data,title,url) * Creates a object based on the data, title and url state params * @param {object} data * @param {string} title * @param {string} url * @return {object} */ History.createStateObject = function(data,title,url){ // Hashify var State = { 'data': data, 'title': title, 'url': url }; // Expand the State State = History.normalizeState(State); // Return object return State; }; /** * History.getStateById(id) * Get a state by it's UID * @param {String} id */ History.getStateById = function(id){ // Prepare id = String(id); // Retrieve var State = History.idToState[id] || History.store.idToState[id] || undefined; // Return State return State; }; /** * Get a State's String * @param {State} passedState */ History.getStateString = function(passedState){ // Prepare var State, cleanedState, str; // Fetch State = History.normalizeState(passedState); // Clean cleanedState = { data: State.data, title: passedState.title, url: passedState.url }; // Fetch str = JSON.stringify(cleanedState); // Return return str; }; /** * Get a State's ID * @param {State} passedState * @return {String} id */ History.getStateId = function(passedState){ // Prepare var State, id; // Fetch State = History.normalizeState(passedState); // Fetch id = State.id; // Return return id; }; /** * History.getHashByState(State) * Creates a Hash for the State Object * @param {State} passedState * @return {String} hash */ History.getHashByState = function(passedState){ // Prepare var State, hash; // Fetch State = History.normalizeState(passedState); // Hash hash = State.hash; // Return return hash; }; /** * History.extractId(url_or_hash) * Get a State ID by it's URL or Hash * @param {string} url_or_hash * @return {string} id */ History.extractId = function ( url_or_hash ) { // Prepare var id,parts,url; // Extract parts = /(.*)\&_suid=([0-9]+)$/.exec(url_or_hash); url = parts ? (parts[1]||url_or_hash) : url_or_hash; id = parts ? String(parts[2]||'') : ''; // Return return id||false; }; /** * History.isTraditionalAnchor * Checks to see if the url is a traditional anchor or not * @param {String} url_or_hash * @return {Boolean} */ History.isTraditionalAnchor = function(url_or_hash){ // Check var isTraditional = !(/[\/\?\.]/.test(url_or_hash)); // Return return isTraditional; }; /** * History.extractState * Get a State by it's URL or Hash * @param {String} url_or_hash * @return {State|null} */ History.extractState = function(url_or_hash,create){ // Prepare var State = null, id, url; create = create||false; // Fetch SUID id = History.extractId(url_or_hash); if ( id ) { State = History.getStateById(id); } // Fetch SUID returned no State if ( !State ) { // Fetch URL url = History.getFullUrl(url_or_hash); // Check URL id = History.getIdByUrl(url)||false; if ( id ) { State = History.getStateById(id); } // Create State if ( !State && create && !History.isTraditionalAnchor(url_or_hash) ) { State = History.createStateObject(null,null,url); } } // Return return State; }; /** * History.getIdByUrl() * Get a State ID by a State URL */ History.getIdByUrl = function(url){ // Fetch var id = History.urlToId[url] || History.store.urlToId[url] || undefined; // Return return id; }; /** * History.getLastSavedState() * Get an object containing the data, title and url of the current state * @return {Object} State */ History.getLastSavedState = function(){ return History.savedStates[History.savedStates.length-1]||undefined; }; /** * History.getLastStoredState() * Get an object containing the data, title and url of the current state * @return {Object} State */ History.getLastStoredState = function(){ return History.storedStates[History.storedStates.length-1]||undefined; }; /** * History.hasUrlDuplicate * Checks if a Url will have a url conflict * @param {Object} newState * @return {Boolean} hasDuplicate */ History.hasUrlDuplicate = function(newState) { // Prepare var hasDuplicate = false, oldState; // Fetch oldState = History.extractState(newState.url); // Check hasDuplicate = oldState && oldState.id !== newState.id; // Return return hasDuplicate; }; /** * History.storeState * Store a State * @param {Object} newState * @return {Object} newState */ History.storeState = function(newState){ // Store the State History.urlToId[newState.url] = newState.id; // Push the State History.storedStates.push(History.cloneObject(newState)); // Return newState return newState; }; /** * History.isLastSavedState(newState) * Tests to see if the state is the last state * @param {Object} newState * @return {boolean} isLast */ History.isLastSavedState = function(newState){ // Prepare var isLast = false, newId, oldState, oldId; // Check if ( History.savedStates.length ) { newId = newState.id; oldState = History.getLastSavedState(); oldId = oldState.id; // Check isLast = (newId === oldId); } // Return return isLast; }; /** * History.saveState * Push a State * @param {Object} newState * @return {boolean} changed */ History.saveState = function(newState){ // Check Hash if ( History.isLastSavedState(newState) ) { return false; } // Push the State History.savedStates.push(History.cloneObject(newState)); // Return true return true; }; /** * History.getStateByIndex() * Gets a state by the index * @param {integer} index * @return {Object} */ History.getStateByIndex = function(index){ // Prepare var State = null; // Handle if ( typeof index === 'undefined' ) { // Get the last inserted State = History.savedStates[History.savedStates.length-1]; } else if ( index < 0 ) { // Get from the end State = History.savedStates[History.savedStates.length+index]; } else { // Get from the beginning State = History.savedStates[index]; } // Return State return State; }; // ==================================================================== // Hash Helpers /** * History.getHash() * Gets the current document hash * @return {string} */ History.getHash = function(){ var hash = History.unescapeHash(document.location.hash); return hash; }; /** * History.unescapeString() * Unescape a string * @param {String} str * @return {string} */ History.unescapeString = function(str){ // Prepare var result = str, tmp; // Unescape hash while ( true ) { tmp = window.unescape(result); if ( tmp === result ) { break; } result = tmp; } // Return result return result; }; /** * History.unescapeHash() * normalize and Unescape a Hash * @param {String} hash * @return {string} */ History.unescapeHash = function(hash){ // Prepare var result = History.normalizeHash(hash); // Unescape hash result = History.unescapeString(result); // Return result return result; }; /** * History.normalizeHash() * normalize a hash across browsers * @return {string} */ History.normalizeHash = function(hash){ // Prepare var result = hash.replace(/[^#]*#/,'').replace(/#.*/, ''); // Return result return result; }; /** * History.setHash(hash) * Sets the document hash * @param {string} hash * @return {History} */ History.setHash = function(hash,queue){ // Prepare var adjustedHash, State, pageUrl; // Handle Queueing if ( queue !== false && History.busy() ) { // Wait + Push to Queue //History.debug('History.setHash: we must wait', arguments); History.pushQueue({ scope: History, callback: History.setHash, args: arguments, queue: queue }); return false; } // Log //History.debug('History.setHash: called',hash); // Prepare adjustedHash = History.escapeHash(hash); // Make Busy + Continue History.busy(true); // Check if hash is a state State = History.extractState(hash,true); if ( State && !History.emulated.pushState ) { // Hash is a state so skip the setHash //History.debug('History.setHash: Hash is a state so skipping the hash set with a direct pushState call',arguments); // PushState History.pushState(State.data,State.title,State.url,false); } else if ( document.location.hash !== adjustedHash ) { // Hash is a proper hash, so apply it // Handle browser bugs if ( History.bugs.setHash ) { // Fix Safari Bug https://bugs.webkit.org/show_bug.cgi?id=56249 // Fetch the base page pageUrl = History.getPageUrl(); // Safari hash apply History.pushState(null,null,pageUrl+'#'+adjustedHash,false); } else { // Normal hash apply document.location.hash = adjustedHash; } } // Chain return History; }; /** * History.escape() * normalize and Escape a Hash * @return {string} */ History.escapeHash = function(hash){ // Prepare var result = History.normalizeHash(hash); // Escape hash result = window.escape(result); // IE6 Escape Bug if ( !History.bugs.hashEscape ) { // Restore common parts result = result .replace(/\%21/g,'!') .replace(/\%26/g,'&') .replace(/\%3D/g,'=') .replace(/\%3F/g,'?'); } // Return result return result; }; /** * History.getHashByUrl(url) * Extracts the Hash from a URL * @param {string} url * @return {string} url */ History.getHashByUrl = function(url){ // Extract the hash var hash = String(url) .replace(/([^#]*)#?([^#]*)#?(.*)/, '$2') ; // Unescape hash hash = History.unescapeHash(hash); // Return hash return hash; }; /** * History.setTitle(title) * Applies the title to the document * @param {State} newState * @return {Boolean} */ History.setTitle = function(newState){ // Prepare var title = newState.title, firstState; // Initial if ( !title ) { firstState = History.getStateByIndex(0); if ( firstState && firstState.url === newState.url ) { title = firstState.title||History.options.initialTitle; } } // Apply try { document.getElementsByTagName('title')[0].innerHTML = title.replace('<','&lt;').replace('>','&gt;').replace(' & ',' &amp; '); } catch ( Exception ) { } document.title = title; // Chain return History; }; // ==================================================================== // Queueing /** * History.queues * The list of queues to use * First In, First Out */ History.queues = []; /** * History.busy(value) * @param {boolean} value [optional] * @return {boolean} busy */ History.busy = function(value){ // Apply if ( typeof value !== 'undefined' ) { //History.debug('History.busy: changing ['+(History.busy.flag||false)+'] to ['+(value||false)+']', History.queues.length); History.busy.flag = value; } // Default else if ( typeof History.busy.flag === 'undefined' ) { History.busy.flag = false; } // Queue if ( !History.busy.flag ) { // Execute the next item in the queue clearTimeout(History.busy.timeout); var fireNext = function(){ var i, queue, item; if ( History.busy.flag ) return; for ( i=History.queues.length-1; i >= 0; --i ) { queue = History.queues[i]; if ( queue.length === 0 ) continue; item = queue.shift(); History.fireQueueItem(item); History.busy.timeout = setTimeout(fireNext,History.options.busyDelay); } }; History.busy.timeout = setTimeout(fireNext,History.options.busyDelay); } // Return return History.busy.flag; }; /** * History.busy.flag */ History.busy.flag = false; /** * History.fireQueueItem(item) * Fire a Queue Item * @param {Object} item * @return {Mixed} result */ History.fireQueueItem = function(item){ return item.callback.apply(item.scope||History,item.args||[]); }; /** * History.pushQueue(callback,args) * Add an item to the queue * @param {Object} item [scope,callback,args,queue] */ History.pushQueue = function(item){ // Prepare the queue History.queues[item.queue||0] = History.queues[item.queue||0]||[]; // Add to the queue History.queues[item.queue||0].push(item); // Chain return History; }; /** * History.queue (item,queue), (func,queue), (func), (item) * Either firs the item now if not busy, or adds it to the queue */ History.queue = function(item,queue){ // Prepare if ( typeof item === 'function' ) { item = { callback: item }; } if ( typeof queue !== 'undefined' ) { item.queue = queue; } // Handle if ( History.busy() ) { History.pushQueue(item); } else { History.fireQueueItem(item); } // Chain return History; }; /** * History.clearQueue() * Clears the Queue */ History.clearQueue = function(){ History.busy.flag = false; History.queues = []; return History; }; // ==================================================================== // IE Bug Fix /** * History.stateChanged * States whether or not the state has changed since the last double check was initialised */ History.stateChanged = false; /** * History.doubleChecker * Contains the timeout used for the double checks */ History.doubleChecker = false; /** * History.doubleCheckComplete() * Complete a double check * @return {History} */ History.doubleCheckComplete = function(){ // Update History.stateChanged = true; // Clear History.doubleCheckClear(); // Chain return History; }; /** * History.doubleCheckClear() * Clear a double check * @return {History} */ History.doubleCheckClear = function(){ // Clear if ( History.doubleChecker ) { clearTimeout(History.doubleChecker); History.doubleChecker = false; } // Chain return History; }; /** * History.doubleCheck() * Create a double check * @return {History} */ History.doubleCheck = function(tryAgain){ // Reset History.stateChanged = false; History.doubleCheckClear(); // Fix IE6,IE7 bug where calling history.back or history.forward does not actually change the hash (whereas doing it manually does) // Fix Safari 5 bug where sometimes the state does not change: https://bugs.webkit.org/show_bug.cgi?id=42940 if ( History.bugs.ieDoubleCheck ) { // Apply Check History.doubleChecker = setTimeout( function(){ History.doubleCheckClear(); if ( !History.stateChanged ) { //History.debug('History.doubleCheck: State has not yet changed, trying again', arguments); // Re-Attempt tryAgain(); } return true; }, History.options.doubleCheckInterval ); } // Chain return History; }; // ==================================================================== // Safari Bug Fix /** * History.safariStatePoll() * Poll the current state * @return {History} */ History.safariStatePoll = function(){ // Poll the URL // Get the Last State which has the new URL var urlState = History.extractState(document.location.href), newState; // Check for a difference if ( !History.isLastSavedState(urlState) ) { newState = urlState; } else { return; } // Check if we have a state with that url // If not create it if ( !newState ) { //History.debug('History.safariStatePoll: new'); newState = History.createStateObject(); } // Apply the New State //History.debug('History.safariStatePoll: trigger'); History.Adapter.trigger(window,'popstate'); // Chain return History; }; // ==================================================================== // State Aliases /** * History.back(queue) * Send the browser history back one item * @param {Integer} queue [optional] */ History.back = function(queue){ //History.debug('History.back: called', arguments); // Handle Queueing if ( queue !== false && History.busy() ) { // Wait + Push to Queue //History.debug('History.back: we must wait', arguments); History.pushQueue({ scope: History, callback: History.back, args: arguments, queue: queue }); return false; } // Make Busy + Continue History.busy(true); // Fix certain browser bugs that prevent the state from changing History.doubleCheck(function(){ History.back(false); }); // Go back history.go(-1); // End back closure return true; }; /** * History.forward(queue) * Send the browser history forward one item * @param {Integer} queue [optional] */ History.forward = function(queue){ //History.debug('History.forward: called', arguments); // Handle Queueing if ( queue !== false && History.busy() ) { // Wait + Push to Queue //History.debug('History.forward: we must wait', arguments); History.pushQueue({ scope: History, callback: History.forward, args: arguments, queue: queue }); return false; } // Make Busy + Continue History.busy(true); // Fix certain browser bugs that prevent the state from changing History.doubleCheck(function(){ History.forward(false); }); // Go forward history.go(1); // End forward closure return true; }; /** * History.go(index,queue) * Send the browser history back or forward index times * @param {Integer} queue [optional] */ History.go = function(index,queue){ //History.debug('History.go: called', arguments); // Prepare var i; // Handle if ( index > 0 ) { // Forward for ( i=1; i<=index; ++i ) { History.forward(queue); } } else if ( index < 0 ) { // Backward for ( i=-1; i>=index; --i ) { History.back(queue); } } else { throw new Error('History.go: History.go requires a positive or negative integer passed.'); } // Chain return History; }; // ==================================================================== // HTML5 State Support // Non-Native pushState Implementation if ( History.emulated.pushState ) { /* * Provide Skeleton for HTML4 Browsers */ // Prepare var emptyFunction = function(){}; History.pushState = History.pushState||emptyFunction; History.replaceState = History.replaceState||emptyFunction; } // History.emulated.pushState // Native pushState Implementation else { /* * Use native HTML5 History API Implementation */ /** * History.onPopState(event,extra) * Refresh the Current State */ History.onPopState = function(event,extra){ // Prepare var stateId = false, newState = false, currentHash, currentState; // Reset the double check History.doubleCheckComplete(); // Check for a Hash, and handle apporiatly currentHash = History.getHash(); if ( currentHash ) { // Expand Hash currentState = History.extractState(currentHash||document.location.href,true); if ( currentState ) { // We were able to parse it, it must be a State! // Let's forward to replaceState //History.debug('History.onPopState: state anchor', currentHash, currentState); History.replaceState(currentState.data, currentState.title, currentState.url, false); } else { // Traditional Anchor //History.debug('History.onPopState: traditional anchor', currentHash); History.Adapter.trigger(window,'anchorchange'); History.busy(false); } // We don't care for hashes History.expectedStateId = false; return false; } // Ensure stateId = History.Adapter.extractEventData('state',event,extra) || false; // Fetch State if ( stateId ) { // Vanilla: Back/forward button was used newState = History.getStateById(stateId); } else if ( History.expectedStateId ) { // Vanilla: A new state was pushed, and popstate was called manually newState = History.getStateById(History.expectedStateId); } else { // Initial State newState = History.extractState(document.location.href); } // The State did not exist in our store if ( !newState ) { // Regenerate the State newState = History.createStateObject(null,null,document.location.href); } // Clean History.expectedStateId = false; // Check if we are the same state if ( History.isLastSavedState(newState) ) { // There has been no change (just the page's hash has finally propagated) //History.debug('History.onPopState: no change', newState, History.savedStates); History.busy(false); return false; } // Store the State History.storeState(newState); History.saveState(newState); // Force update of the title History.setTitle(newState); // Fire Our Event History.Adapter.trigger(window,'statechange'); History.busy(false); // Return true return true; }; History.Adapter.bind(window,'popstate',History.onPopState); /** * History.pushState(data,title,url) * Add a new State to the history object, become it, and trigger onpopstate * We have to trigger for HTML4 compatibility * @param {object} data * @param {string} title * @param {string} url * @return {true} */ History.pushState = function(data,title,url,queue){ //History.debug('History.pushState: called', arguments); // Check the State if ( History.getHashByUrl(url) && History.emulated.pushState ) { throw new Error('History.js does not support states with fragement-identifiers (hashes/anchors).'); } // Handle Queueing if ( queue !== false && History.busy() ) { // Wait + Push to Queue //History.debug('History.pushState: we must wait', arguments); History.pushQueue({ scope: History, callback: History.pushState, args: arguments, queue: queue }); return false; } // Make Busy + Continue History.busy(true); // Create the newState var newState = History.createStateObject(data,title,url); // Check it if ( History.isLastSavedState(newState) ) { // Won't be a change History.busy(false); } else { //remove previously stored state, because it can be and can be non empty History.Adapter.trigger(window, 'stateremove', { stateId: newState.id }); // Store the newState History.storeState(newState); History.expectedStateId = newState.id; // Push the newState history.pushState(newState.id,newState.title,newState.url); // Fire HTML5 Event History.Adapter.trigger(window,'popstate'); } // End pushState closure return true; }; /** * History.replaceState(data,title,url) * Replace the State and trigger onpopstate * We have to trigger for HTML4 compatibility * @param {object} data * @param {string} title * @param {string} url * @param {object} queue * @param {boolean} createNewState * @return {true} */ History.replaceState = function(data,title,url,queue,createNewState){ //History.debug('History.replaceState: called', arguments); // Check the State if ( History.getHashByUrl(url) && History.emulated.pushState ) { throw new Error('History.js does not support states with fragement-identifiers (hashes/anchors).'); } // Handle Queueing if ( queue !== false && History.busy() ) { // Wait + Push to Queue //History.debug('History.replaceState: we must wait', arguments); History.pushQueue({ scope: History, callback: History.replaceState, args: arguments, queue: queue }); return false; } // Make Busy + Continue History.busy(true); // Create the newState var newState; if (createNewState) { data.rnd = new Date().getTime(); newState = History.createStateObject(data, title, url); } else { newState = History.getState(); newState.data = data; History.idToState[newState.id] = newState; History.extendObject(History.getLastSavedState(), newState); } // Check it if ( History.isLastSavedState(newState) ) { // Won't be a change History.busy(false); } else { // Store the newState History.storeState(newState); History.expectedStateId = newState.id; // Push the newState history.replaceState(newState.id,newState.title,newState.url); // Fire HTML5 Event History.Adapter.trigger(window,'popstate'); } // End replaceState closure return true; }; } // !History.emulated.pushState // ==================================================================== // Initialise /** * Load the Store */ if ( sessionStorage ) { // Fetch try { History.store = JSON.parse(/*LZString.decompress*/(sessionStorage.getItem('History.store')))||{}; } catch ( err ) { History.store = {}; } // Normalize History.normalizeStore(); } else { // Default Load History.store = {}; History.normalizeStore(); } /** * Clear Intervals on exit to prevent memory leaks */ History.Adapter.bind(window,"beforeunload",History.clearAllIntervals); History.Adapter.bind(window,"unload",History.clearAllIntervals); /** * Create the initial State */ History.saveState(History.storeState(History.extractState(document.location.href,true))); /** * Bind for Saving Store */ if ( sessionStorage ) { // When the page is closed History.onUnload = function(){ // Prepare var currentStore, item; // Fetch try { currentStore = JSON.parse(/*LZString.decompress*/(sessionStorage.getItem('History.store')))||{}; } catch ( err ) { currentStore = {}; } // Ensure currentStore.idToState = currentStore.idToState || {}; currentStore.urlToId = currentStore.urlToId || {}; currentStore.stateToId = currentStore.stateToId || {}; // Sync for ( item in History.idToState ) { if ( !History.idToState.hasOwnProperty(item) ) { continue; } currentStore.idToState[item] = History.idToState[item]; } for ( item in History.urlToId ) { if ( !History.urlToId.hasOwnProperty(item) ) { continue; } currentStore.urlToId[item] = History.urlToId[item]; } for ( item in History.stateToId ) { if ( !History.stateToId.hasOwnProperty(item) ) { continue; } currentStore.stateToId[item] = History.stateToId[item]; } var historyEntries = []; var maxHistoryEntriesCount = 10; //slice overweight entries for ( item in currentStore.idToState ) { if ( !currentStore.idToState.hasOwnProperty(item) ) { continue; } currentStore.idToState[item].entryId = item; historyEntries.push(currentStore.idToState[item]); } if (historyEntries.length > maxHistoryEntriesCount) { historyEntries.sort(function(e1, e2) { return e1.entryId - e2.entryId; }); var excludedEntries = historyEntries.slice(0, historyEntries.length - maxHistoryEntriesCount); for (var entryIndex = 0; entryIndex < excludedEntries.length; entryIndex++) { var entry = excludedEntries[entryIndex]; delete currentStore.idToState[entry.entryId]; for (var url in currentStore.urlToId ) { if (currentStore.urlToId.hasOwnProperty(url) && currentStore.urlToId[url] == entry.entryId) { delete currentStore.urlToId[url]; } } for (var state in currentStore.stateToId ) { if (currentStore.stateToId.hasOwnProperty(state) && currentStore.stateToId[state] == entry.entryId) { delete currentStore.stateToId[state]; } } History.Adapter.trigger(window, 'stateremove', { stateId: entry.entryId }); } } // Update History.store = currentStore; History.normalizeStore(); // Store History.setSessionStorageItem('History.store', /*LZString.compress*/(JSON.stringify(currentStore))); }; // For Internet Explorer History.intervalList.push(setInterval(History.onUnload,History.options.storeInterval)); // For Other Browsers History.Adapter.bind(window,'beforeunload',History.onUnload); History.Adapter.bind(window,'unload',History.onUnload); // Both are enabled for consistency } // Non-Native pushState Implementation if ( !History.emulated.pushState ) { // Be aware, the following is only for native pushState implementations // If you are wanting to include something for all browsers // Then include it above this if block /** * Setup Safari Fix */ if ( History.bugs.safariPoll ) { History.intervalList.push(setInterval(History.safariStatePoll, History.options.safariPollInterval)); } /** * Ensure Cross Browser Compatibility */ if ( navigator.vendor === 'Apple Computer, Inc.' || (navigator.appCodeName||'') === 'Mozilla' ) { /** * Fix Safari HashChange Issue */ // Setup Alias History.Adapter.bind(window,'hashchange',function(){ History.Adapter.trigger(window,'popstate'); }); // Initialise Alias if ( History.getHash() ) { History.Adapter.onDomLoad(function(){ History.Adapter.trigger(window,'hashchange'); }); } } } // !History.emulated.pushState }; // History.initCore // Try and Initialise History History.init(); })(window);
SkReD/history.js
scripts/uncompressed/history.js
JavaScript
bsd-3-clause
50,992
require 'spree_auto_invoice' require 'rails' module SpreeAutoInvoice class Railtie < Rails::Railtie rake_tasks do require '../tasks/spree_auto_invoice.rake' end end end
geekcups-team/spree_auto_invoice
lib/spree_auto_invoice/railtie.rb
Ruby
bsd-3-clause
188
<?php use librarys\helpers\utils\String; ?> <!-- 文章正文 下面部分 --> <div class="a_info neinf"> <div> <div class="a_rea a_hop"> <h2> <span><a href="http://jb.9939.com/article_list.shtml">更多文章>></a></span> 与“<font style="color:#F00"><?php echo String::cutString($title, 8, 1)?></font>”相似的文章 </h2> <ul class="a_prev"> <?php if (isset($relArticles['list']) && !empty($relArticles['list'])) { $leftRelArticles = array_splice($relArticles['list'], 0, 12); foreach ($leftRelArticles as $relArticle){ ?> <li> <a href="<?php echo '/article/'.date("Y/md", $relArticle["inputtime"]).'/'.$relArticle['id'].'.shtml' ; ?>" title="<?php echo $relArticle['title']; ?>"><?php echo $relArticle['title']; ?></a> </li> <?php } } ?> </ul> </div> </div> <div> <div class="a_rea a_hop inpc"> <h2> <span> <a href="http://ask.9939.com/asking/" class="inqu">我要提问</a> <a href="http://ask.9939.com/">更多问答>></a> </span> <img src="/images/pi_02.png"> </h2> <ul class="a_mon"> <?php if (isset($asks['list']) && !empty($asks['list'])) { foreach ($asks['list'] as $outerKey => $outerAsk){ ?> <li> <h3> <a href="<?php echo \yii\helpers\Url::to('@ask/id/' . $outerAsk['ask']['id']); ?>" title="<?php echo $outerAsk['ask']['title']; ?>"> <?php echo $outerAsk['ask']['title']; ?> </a> </h3> <p> <?php if (isset($outerAsk['answer']) && !empty($outerAsk['answer'])) { ?> <?php echo \librarys\helpers\utils\String::cutString($outerAsk['answer']['content'], 54); ?> <?php } ?> <a href="<?php echo \yii\helpers\Url::to('@ask/id/' . $outerAsk['ask']['id']); ?>">详细</a> </p> </li> <?php } } ?> </ul> </div> </div> <?php if (isset($disease) && !empty($disease)) { ?> <!--热门疾病--> <div class="a_rea a_hop inpc" style="background: none;"> <h2> <span> <?php if (isset($isSymptom) && $isSymptom == 1) { ?> <a href="/zhengzhuang/<?php echo $disease['pinyin_initial']; ?>/jiancha/">更多&gt;&gt;</a> <?php }else { ?> <a href="/<?php echo $disease['pinyin_initial']; ?>/lcjc/">更多&gt;&gt;</a> <?php } ?> </span> <img src="/images/reche.gif"> </h2> <div class="nipat"> <?php if (isset($isSymptom) && $isSymptom == 1){ ?> <h3><?php echo $disease['name']; ?><span>症状</span></h3> <p><?php echo String::cutString($disease['examine'], 100); ?> <a href="/zhengzhuang/<?php echo $disease['pinyin_initial']; ?>/jiancha/">详细</a> </p> <?php }else { ?> <h3><?php echo $disease['name']; ?><span>疾病</span></h3> <p><?php echo String::cutString($disease['inspect'], 100); ?> <a href="/<?php echo $disease['pinyin_initial']; ?>/lcjc/">详细</a> </p> <?php } ?> </div> </div> <?php } ?> <div class="a_rea a_hop inpc" style="background: none;"> <h2> <img src="/images/everb.gif"> </h2> <?php if (isset($disease) && !empty($disease)) { ?> <ul class="finin clearfix"> <?php if (isset($stillFind) && !empty($stillFind)) { foreach ($stillFind as $find){ ?> <li> <a href="http://jb.9939.com/so/<?php echo $find['pinyin']; ?>/" title="<?php echo $find['keywords']; ?>"> <?php echo $find['keywords']; ?> </a> </li> <?php } } ?> </ul> <?php } ?> </div> <!-- 图谱部分 Start --> <?php echo $this->render('detail_below_pic'); ?> <!-- 图谱部分 End --> </div>
VampireMe/admin-9939-com
frontend/views/article/detail_below.php
PHP
bsd-3-clause
5,416
// Copyright 2019 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "components/optimization_guide/hints_processing_util.h" #include "components/optimization_guide/proto/hint_cache.pb.h" #include "components/optimization_guide/proto/hints.pb.h" #include "components/optimization_guide/store_update_data.h" #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h" namespace optimization_guide { TEST(HintsProcessingUtilTest, FindPageHintForSubstringPagePattern) { proto::Hint hint1; // Page hint for "/one/" proto::PageHint* page_hint1 = hint1.add_page_hints(); page_hint1->set_page_pattern("foo.org/*/one/"); // Page hint for "two" proto::PageHint* page_hint2 = hint1.add_page_hints(); page_hint2->set_page_pattern("two"); // Page hint for "three.jpg" proto::PageHint* page_hint3 = hint1.add_page_hints(); page_hint3->set_page_pattern("three.jpg"); EXPECT_EQ(nullptr, FindPageHintForURL(GURL(""), &hint1)); EXPECT_EQ(nullptr, FindPageHintForURL(GURL("https://www.foo.org/"), &hint1)); EXPECT_EQ(nullptr, FindPageHintForURL(GURL("https://www.foo.org/one"), &hint1)); EXPECT_EQ(nullptr, FindPageHintForURL(GURL("https://www.foo.org/one/"), &hint1)); EXPECT_EQ(page_hint1, FindPageHintForURL(GURL("https://www.foo.org/pages/one/"), &hint1)); EXPECT_EQ(page_hint1, FindPageHintForURL(GURL("https://www.foo.org/pages/subpages/one/"), &hint1)); EXPECT_EQ(page_hint1, FindPageHintForURL( GURL("https://www.foo.org/pages/one/two"), &hint1)); EXPECT_EQ(page_hint1, FindPageHintForURL( GURL("https://www.foo.org/pages/one/two/three.jpg"), &hint1)); EXPECT_EQ(page_hint2, FindPageHintForURL( GURL("https://www.foo.org/pages/onetwo/three.jpg"), &hint1)); EXPECT_EQ(page_hint2, FindPageHintForURL(GURL("https://www.foo.org/one/two/three.jpg"), &hint1)); EXPECT_EQ(page_hint2, FindPageHintForURL(GURL("https://one.two.org"), &hint1)); EXPECT_EQ(page_hint3, FindPageHintForURL( GURL("https://www.foo.org/bar/three.jpg"), &hint1)); } TEST(HintsProcessingUtilTest, ConvertProtoEffectiveConnectionType) { EXPECT_EQ( ConvertProtoEffectiveConnectionType( proto::EffectiveConnectionType::EFFECTIVE_CONNECTION_TYPE_UNKNOWN), net::EffectiveConnectionType::EFFECTIVE_CONNECTION_TYPE_UNKNOWN); EXPECT_EQ( ConvertProtoEffectiveConnectionType( proto::EffectiveConnectionType::EFFECTIVE_CONNECTION_TYPE_OFFLINE), net::EffectiveConnectionType::EFFECTIVE_CONNECTION_TYPE_OFFLINE); EXPECT_EQ( ConvertProtoEffectiveConnectionType( proto::EffectiveConnectionType::EFFECTIVE_CONNECTION_TYPE_SLOW_2G), net::EffectiveConnectionType::EFFECTIVE_CONNECTION_TYPE_SLOW_2G); EXPECT_EQ(ConvertProtoEffectiveConnectionType( proto::EffectiveConnectionType::EFFECTIVE_CONNECTION_TYPE_2G), net::EffectiveConnectionType::EFFECTIVE_CONNECTION_TYPE_2G); EXPECT_EQ(ConvertProtoEffectiveConnectionType( proto::EffectiveConnectionType::EFFECTIVE_CONNECTION_TYPE_3G), net::EffectiveConnectionType::EFFECTIVE_CONNECTION_TYPE_3G); EXPECT_EQ(ConvertProtoEffectiveConnectionType( proto::EffectiveConnectionType::EFFECTIVE_CONNECTION_TYPE_4G), net::EffectiveConnectionType::EFFECTIVE_CONNECTION_TYPE_4G); } TEST(HintsProcessingUtilTest, IsValidURLForURLKeyedHints) { EXPECT_TRUE(IsValidURLForURLKeyedHint(GURL("https://blerg.com"))); EXPECT_TRUE(IsValidURLForURLKeyedHint(GURL("http://blerg.com"))); EXPECT_FALSE(IsValidURLForURLKeyedHint(GURL("file://blerg"))); EXPECT_FALSE(IsValidURLForURLKeyedHint(GURL("chrome://blerg"))); EXPECT_FALSE(IsValidURLForURLKeyedHint( GURL("https://username:[email protected]/"))); EXPECT_FALSE(IsValidURLForURLKeyedHint(GURL("https://localhost:5000"))); EXPECT_FALSE(IsValidURLForURLKeyedHint(GURL("https://192.168.1.1"))); } } // namespace optimization_guide
endlessm/chromium-browser
components/optimization_guide/hints_processing_util_unittest.cc
C++
bsd-3-clause
4,247
// Copyright (c) 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/ui/extensions/settings_api_bubble_helpers.h" #include <utility> #include "build/build_config.h" #include "chrome/browser/extensions/ntp_overridden_bubble_delegate.h" #include "chrome/browser/extensions/settings_api_bubble_delegate.h" #include "chrome/browser/extensions/settings_api_helpers.h" #include "chrome/browser/ui/browser_dialogs.h" #include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/extensions/extension_message_bubble_bridge.h" #include "chrome/browser/ui/extensions/extension_settings_overridden_dialog.h" #include "chrome/browser/ui/extensions/settings_overridden_params_providers.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/browser/ui/toolbar/toolbar_actions_bar.h" #include "chrome/browser/ui/ui_features.h" #include "chrome/common/extensions/manifest_handlers/settings_overrides_handler.h" #include "chrome/common/url_constants.h" #include "content/public/browser/browser_url_handler.h" #include "content/public/browser/navigation_entry.h" #include "extensions/common/constants.h" namespace extensions { namespace { // Whether the NTP post-install UI is enabled. By default, this is limited to // Windows, Mac, and ChromeOS, but can be overridden for testing. #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_CHROMEOS) bool g_ntp_post_install_ui_enabled = true; #else bool g_ntp_post_install_ui_enabled = false; #endif #if defined(OS_WIN) || defined(OS_MACOSX) void ShowSettingsApiBubble(SettingsApiOverrideType type, Browser* browser) { ToolbarActionsModel* model = ToolbarActionsModel::Get(browser->profile()); if (model->has_active_bubble()) return; std::unique_ptr<ExtensionMessageBubbleController> settings_api_bubble( new ExtensionMessageBubbleController( new SettingsApiBubbleDelegate(browser->profile(), type), browser)); if (!settings_api_bubble->ShouldShow()) return; settings_api_bubble->SetIsActiveBubble(); std::unique_ptr<ToolbarActionsBarBubbleDelegate> bridge( new ExtensionMessageBubbleBridge(std::move(settings_api_bubble))); browser->window()->GetExtensionsContainer()->ShowToolbarActionBubbleAsync( std::move(bridge)); } #endif } // namespace void SetNtpPostInstallUiEnabledForTesting(bool enabled) { g_ntp_post_install_ui_enabled = enabled; } void MaybeShowExtensionControlledHomeNotification(Browser* browser) { #if defined(OS_WIN) || defined(OS_MACOSX) ShowSettingsApiBubble(BUBBLE_TYPE_HOME_PAGE, browser); #endif } void MaybeShowExtensionControlledSearchNotification( content::WebContents* web_contents, AutocompleteMatch::Type match_type) { #if defined(OS_WIN) || defined(OS_MACOSX) if (!AutocompleteMatch::IsSearchType(match_type) || match_type == AutocompleteMatchType::SEARCH_OTHER_ENGINE) { return; } Browser* browser = chrome::FindBrowserWithWebContents(web_contents); if (!browser) return; if (base::FeatureList::IsEnabled( features::kExtensionSettingsOverriddenDialogs)) { base::Optional<ExtensionSettingsOverriddenDialog::Params> params = settings_overridden_params::GetSearchOverriddenParams( browser->profile()); if (!params) return; auto dialog = std::make_unique<ExtensionSettingsOverriddenDialog>( std::move(*params), browser->profile()); if (!dialog->ShouldShow()) return; chrome::ShowExtensionSettingsOverriddenDialog(std::move(dialog), browser); } else { ShowSettingsApiBubble(BUBBLE_TYPE_SEARCH_ENGINE, browser); } #endif } void MaybeShowExtensionControlledNewTabPage( Browser* browser, content::WebContents* web_contents) { if (!g_ntp_post_install_ui_enabled) return; // Acknowledge existing extensions if necessary. NtpOverriddenBubbleDelegate::MaybeAcknowledgeExistingNtpExtensions( browser->profile()); // Jump through a series of hoops to see if the web contents is pointing to // an extension-controlled NTP. // TODO(devlin): Some of this is redundant with the checks in the bubble/ // dialog. We should consolidate, but that'll be simpler once we only have // one UI option. In the meantime, extra checks don't hurt. content::NavigationEntry* entry = web_contents->GetController().GetVisibleEntry(); if (!entry) return; GURL active_url = entry->GetURL(); if (!active_url.SchemeIs(extensions::kExtensionScheme)) return; // Not a URL that we care about. // See if the current active URL matches a transformed NewTab URL. GURL ntp_url(chrome::kChromeUINewTabURL); content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( &ntp_url, web_contents->GetBrowserContext()); if (ntp_url != active_url) return; // Not being overridden by an extension. Profile* const profile = browser->profile(); ToolbarActionsModel* model = ToolbarActionsModel::Get(profile); if (model->has_active_bubble()) return; if (base::FeatureList::IsEnabled( features::kExtensionSettingsOverriddenDialogs)) { base::Optional<ExtensionSettingsOverriddenDialog::Params> params = settings_overridden_params::GetNtpOverriddenParams(profile); if (!params) return; auto dialog = std::make_unique<ExtensionSettingsOverriddenDialog>( std::move(*params), profile); if (!dialog->ShouldShow()) return; chrome::ShowExtensionSettingsOverriddenDialog(std::move(dialog), browser); return; } std::unique_ptr<ExtensionMessageBubbleController> ntp_overridden_bubble( new ExtensionMessageBubbleController( new NtpOverriddenBubbleDelegate(profile), browser)); if (!ntp_overridden_bubble->ShouldShow()) return; ntp_overridden_bubble->SetIsActiveBubble(); std::unique_ptr<ToolbarActionsBarBubbleDelegate> bridge( new ExtensionMessageBubbleBridge(std::move(ntp_overridden_bubble))); browser->window()->GetExtensionsContainer()->ShowToolbarActionBubbleAsync( std::move(bridge)); } } // namespace extensions
endlessm/chromium-browser
chrome/browser/ui/extensions/settings_api_bubble_helpers.cc
C++
bsd-3-clause
6,229
package org.broadinstitute.hellbender.engine; import org.broadinstitute.barclay.argparser.CommandLineProgramProperties; import org.broadinstitute.hellbender.cmdline.TestProgramGroup; /** * A Dummy / Placeholder class that can be used where a {@link GATKTool} is required. * DO NOT USE THIS FOR ANYTHING OTHER THAN TESTING. * THIS MUST BE IN THE ENGINE PACKAGE DUE TO SCOPE ON `features`! * Created by jonn on 9/19/18. */ @CommandLineProgramProperties( summary = "A dummy GATKTool to help test Funcotator.", oneLineSummary = "Dummy dumb dumb tool for testing.", programGroup = TestProgramGroup.class ) public final class DummyPlaceholderGatkTool extends GATKTool { public DummyPlaceholderGatkTool() { parseArgs(new String[]{}); onStartup(); } @Override public void traverse() { } @Override void initializeFeatures(){ features = new FeatureManager(this, FeatureDataSource.DEFAULT_QUERY_LOOKAHEAD_BASES, cloudPrefetchBuffer, cloudIndexPrefetchBuffer, referenceArguments.getReferencePath()); } }
magicDGS/gatk
src/test/java/org/broadinstitute/hellbender/engine/DummyPlaceholderGatkTool.java
Java
bsd-3-clause
1,099
// Standard system includes #include <assert.h> #include <errno.h> // -EINVAL, -ENODEV #include <netdb.h> // gethostbyname #include <sys/poll.h> #include <sys/types.h> // connect #include <sys/socket.h> // connect #include <trace.h> #define MY_TRACE_PREFIX "EthernetServer" extern "C" { #include "string.h" } #include "Ethernet.h" #include "EthernetClient.h" #include "EthernetServer.h" EthernetServer::EthernetServer(uint16_t port) { _port = port; _sock = -1; _init_ok = false; pclients = new EthernetClient[MAX_SOCK_NUM]; _pcli_inactivity_counter = new int[MAX_SOCK_NUM]; _scansock = 0; if (pclients == NULL){ trace_error("%s OOM condition", __func__); return; } for(int sock = 0; sock < MAX_SOCK_NUM; sock++){ _pcli_inactivity_counter[sock] = 0; pclients[sock].id = sock; } } EthernetServer::~EthernetServer() { if (pclients != NULL){ delete [] pclients; pclients = NULL; } if(_pcli_inactivity_counter != NULL){ delete [] _pcli_inactivity_counter; _pcli_inactivity_counter = NULL; } } void EthernetServer::begin() { int ret; extern int errno; _sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (_sock < 0){ trace_error("unable to open a TCP socket!"); return; } _sin.sin_addr.s_addr = INADDR_ANY; _sin.sin_family = AF_INET; _sin.sin_port = htons(_port); ret = bind(_sock, (struct sockaddr*)&_sin, sizeof(_sin)); if ( ret < 0){ trace_error("%s unable to bind port %d", __func__, _port); return; } //socket(sock, SnMR::TCP, _port, 0); ret = listen(_sock, MAX_SOCK_NUM); if ( ret < 0){ trace_error("%s unable to listen on port %d", __func__, _port); return; } for(int sock = 0; sock < MAX_SOCK_NUM; sock++) EthernetClass::_server_port[sock] = _port; // mark as available _init_ok = true; } static int _accept(int sock, struct sockaddr * psin, socklen_t * psize) { return accept(sock, psin, psize); } void EthernetServer::accept() { struct pollfd ufds; int ret = 0, size_val, success = 0; extern int errno; if (_sock == -1) return; ufds.fd = _sock; ufds.events = POLLIN; ufds.revents = 0; ret = poll(&ufds, 1, 0); if ( ret < 0 ){ trace_error("%s error on poll errno %d", __func__, errno); _sock = -1; close(_sock); return; } if(ufds.revents&POLLIN){ //trace_debug("%s in activity on socket %d - calling accept()", __func__, _sock); size_val = sizeof(_cli_sin); ret = _accept(_sock, (struct sockaddr*)&_cli_sin, (socklen_t*)&size_val); if ( ret < 0){ close(_sock); _sock = -1; trace_error("%s Fail to accept() sock %d port %d", __func__, _sock, _port); return; } for(int sock = 0; sock < MAX_SOCK_NUM && success == 0; sock++){ if (pclients[sock]._sock == -1){ pclients[sock]._sock = ret; pclients[sock]._pCloseServer = this; pclients[sock].connect_true = true; pclients[sock]._inactive_counter = &_pcli_inactivity_counter[sock]; success = 1; } } if ( success == 0 ){ trace_error("%s detect connect event - unable to allocate socket slot !", __func__); } } } EthernetClient EthernetServer::available() { accept(); // Scan for next connection - meaning don't return the same one each time for(int sock = 0; sock < MAX_SOCK_NUM; sock++){ if (pclients[sock]._sock != -1 && sock != _scansock){ //trace_debug("Returning socket entity %d socket %d", sock, pclients[sock]._sock); _scansock = sock; return pclients[sock]; } } // scan for any connection for(int sock = 0; sock < MAX_SOCK_NUM; sock++){ if (pclients[sock]._sock != -1){ //trace_debug("Returning socket entity %d socket %d", sock, pclients[sock]._sock); _scansock = sock; return pclients[sock]; } } //trace_debug("%s no client to return", __func__); _scansock = 0; return pclients[0]; } size_t EthernetServer::write(uint8_t b) { return write(&b, 1); } size_t EthernetServer::write(const uint8_t *buffer, size_t size) { size_t n = 0; //accept(); // This routine writes the given data to all current clients for(int sock = 0; sock < MAX_SOCK_NUM; sock++){ if (pclients[sock]._sock != -1){ n += pclients[sock].write(buffer, size); } } return n; } void EthernetServer::closeNotify(int idx) { if (idx < MAX_SOCK_NUM) pclients[idx]._sock = -1; }
ilc-opensource/io-js
target/device/libio/arduino/x86/libraries/Ethernet/EthernetServer.cpp
C++
bsd-3-clause
4,266
'use strict'; module.exports = function (Logger, $rootScope) { return { restrict: 'A', scope: { hasRank: '=' }, link: function ($scope, elem, attrs) { $rootScope.$watch('currentUser', function () { Logger.info('Checking for rank: ' + $scope.hasRank); if ($rootScope.currentUser && $rootScope.currentUser.rank >= $scope.hasRank) { elem.show(); } else { elem.hide(); } }); } }; };
e1528532/libelektra
src/tools/rest-frontend/resources/assets/js/directives/permission/HasRankDirective.js
JavaScript
bsd-3-clause
571
/* * Created on 02/04/2005 * * JRandTest package * * Copyright (c) 2005, Zur Aougav, [email protected] * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this list * of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, this * list of conditions and the following disclaimer in the documentation and/or * other materials provided with the distribution. * * Neither the name of the JRandTest nor the names of its contributors may be * used to endorse or promote products derived from this software without specific * prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package com.fasteasytrade.jrandtest.algo; import java.math.BigInteger; import java.util.Random; /** * QuadraidResidue1 Prng algorithm from NIST test package * <p> * Fix random p, prime, length 512 bits. * <p> * Fix random g, prime, length 512 bits. g < p. * <p> * Each prng iteration calculate g = g**2 mod p.<br> * The lowest 64 bits of g are the prng result. * * @author Zur Aougav */ public class QuadraticResidue1Prng extends Cipher { /** * n's length/num of bits */ public final int bit_length = 512; /** * prime (with probability < 2 ** -100). * <p> * Length of p is bit_length = 512 bits = 64 bytes. */ BigInteger p; /** * Initial g is a random prime (with probability < 2 ** -100) * <p> * Length of g is bit_length = 512 bits = 64 bytes. * <p> * g is the "state" of the prng. * <p> * g = take 64 lowr bits of ( g**2 mod n ). */ BigInteger g; /** * g0 is the "initial state" of the prng. * <p> * reset method set g to g0. */ BigInteger g0; QuadraticResidue1Prng() { setup(bit_length); } QuadraticResidue1Prng(int x) { if (x < bit_length) { setup(bit_length); } else { setup(x); } } QuadraticResidue1Prng(BigInteger p, BigInteger g) { this.p = p; this.g = g; g0 = g; } QuadraticResidue1Prng(BigInteger p, BigInteger g, BigInteger g0) { this.p = p; this.g = g; this.g0 = g0; } /** * Generate the key and seed for Quadratic Residue Prng. * <p> * Select random primes - p, g. g < p. * * @param len * length of p and g, num of bits. */ void setup(int len) { Random rand = new Random(); p = BigInteger.probablePrime(len, rand); g = BigInteger.probablePrime(len, rand); /** * if g >= p swap(g, p). */ if (g.compareTo(p) > -1) { BigInteger temp = g; g = p; p = temp; } /** * here for sure g < p */ g0 = g; } /** * calculate g**2 mod p and returns lowest 64 bits, long. * */ public long nextLong() { g = g.multiply(g).mod(p); /** * set g to 2 if g <= 1. */ if (g.compareTo(BigInteger.ONE) < 1) { g = BigInteger.valueOf(2); } return g.longValue(); } /** * Public key. * * @return p prime (with probability < 2 ** -100) */ public BigInteger getP() { return p; } /** * Secret key * * @return g prime (with probability < 2 ** -100) */ public BigInteger getG() { return g; } /** * Reset "state" of prng by setting g to g0 (initial g). * */ public void reset() { g = g0; } }
cryptopony/jrandtest
src/com/fasteasytrade/jrandtest/algo/QuadraticResidue1Prng.java
Java
bsd-3-clause
4,818
/* * Copyright (c) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "core/inspector/MainThreadDebugger.h" #include "bindings/core/v8/BindingSecurity.h" #include "bindings/core/v8/DOMWrapperWorld.h" #include "bindings/core/v8/ScriptController.h" #include "bindings/core/v8/SourceLocation.h" #include "bindings/core/v8/V8ErrorHandler.h" #include "bindings/core/v8/V8Node.h" #include "bindings/core/v8/V8Window.h" #include "bindings/core/v8/WorkerOrWorkletScriptController.h" #include "core/dom/ContainerNode.h" #include "core/dom/Document.h" #include "core/dom/Element.h" #include "core/dom/ExecutionContext.h" #include "core/dom/StaticNodeList.h" #include "core/events/ErrorEvent.h" #include "core/frame/Deprecation.h" #include "core/frame/FrameConsole.h" #include "core/frame/FrameHost.h" #include "core/frame/LocalDOMWindow.h" #include "core/frame/LocalFrame.h" #include "core/frame/Settings.h" #include "core/frame/UseCounter.h" #include "core/inspector/ConsoleMessage.h" #include "core/inspector/ConsoleMessageStorage.h" #include "core/inspector/IdentifiersFactory.h" #include "core/inspector/InspectedFrames.h" #include "core/inspector/InspectorTaskRunner.h" #include "core/timing/MemoryInfo.h" #include "core/workers/MainThreadWorkletGlobalScope.h" #include "core/xml/XPathEvaluator.h" #include "core/xml/XPathResult.h" #include "platform/UserGestureIndicator.h" #include "platform/inspector_protocol/Values.h" #include "platform/v8_inspector/public/V8Inspector.h" #include "wtf/PtrUtil.h" #include "wtf/ThreadingPrimitives.h" #include <memory> namespace blink { namespace { int frameId(LocalFrame* frame) { ASSERT(frame); return WeakIdentifierMap<LocalFrame>::identifier(frame); } Mutex& creationMutex() { DEFINE_THREAD_SAFE_STATIC_LOCAL(Mutex, mutex, (new Mutex)); return mutex; } LocalFrame* toFrame(ExecutionContext* context) { if (!context) return nullptr; if (context->isDocument()) return toDocument(context)->frame(); if (context->isMainThreadWorkletGlobalScope()) return toMainThreadWorkletGlobalScope(context)->frame(); return nullptr; } } MainThreadDebugger* MainThreadDebugger::s_instance = nullptr; MainThreadDebugger::MainThreadDebugger(v8::Isolate* isolate) : ThreadDebugger(isolate) , m_taskRunner(wrapUnique(new InspectorTaskRunner())) , m_paused(false) { MutexLocker locker(creationMutex()); ASSERT(!s_instance); s_instance = this; } MainThreadDebugger::~MainThreadDebugger() { MutexLocker locker(creationMutex()); ASSERT(s_instance == this); s_instance = nullptr; } void MainThreadDebugger::reportConsoleMessage(ExecutionContext* context, MessageSource source, MessageLevel level, const String& message, SourceLocation* location) { if (LocalFrame* frame = toFrame(context)) frame->console().reportMessageToClient(source, level, message, location); } int MainThreadDebugger::contextGroupId(ExecutionContext* context) { LocalFrame* frame = toFrame(context); return frame ? contextGroupId(frame) : 0; } void MainThreadDebugger::setClientMessageLoop(std::unique_ptr<ClientMessageLoop> clientMessageLoop) { ASSERT(!m_clientMessageLoop); ASSERT(clientMessageLoop); m_clientMessageLoop = std::move(clientMessageLoop); } void MainThreadDebugger::didClearContextsForFrame(LocalFrame* frame) { DCHECK(isMainThread()); if (frame->localFrameRoot() == frame) v8Inspector()->resetContextGroup(contextGroupId(frame)); } void MainThreadDebugger::contextCreated(ScriptState* scriptState, LocalFrame* frame, SecurityOrigin* origin) { ASSERT(isMainThread()); v8::HandleScope handles(scriptState->isolate()); DOMWrapperWorld& world = scriptState->world(); std::unique_ptr<protocol::DictionaryValue> auxData = protocol::DictionaryValue::create(); auxData->setBoolean("isDefault", world.isMainWorld()); auxData->setString("frameId", IdentifiersFactory::frameId(frame)); V8ContextInfo contextInfo(scriptState->context(), contextGroupId(frame), world.isIsolatedWorld() ? world.isolatedWorldHumanReadableName() : ""); if (origin) contextInfo.origin = origin->toRawString(); contextInfo.auxData = auxData->toJSONString(); contextInfo.hasMemoryOnConsole = scriptState->getExecutionContext()->isDocument(); v8Inspector()->contextCreated(contextInfo); } void MainThreadDebugger::contextWillBeDestroyed(ScriptState* scriptState) { v8::HandleScope handles(scriptState->isolate()); v8Inspector()->contextDestroyed(scriptState->context()); } void MainThreadDebugger::exceptionThrown(ExecutionContext* context, ErrorEvent* event) { LocalFrame* frame = nullptr; ScriptState* scriptState = nullptr; if (context->isDocument()) { frame = toDocument(context)->frame(); if (!frame) return; scriptState = event->world() ? ScriptState::forWorld(frame, *event->world()) : nullptr; } else if (context->isMainThreadWorkletGlobalScope()) { frame = toMainThreadWorkletGlobalScope(context)->frame(); if (!frame) return; scriptState = toMainThreadWorkletGlobalScope(context)->scriptController()->getScriptState(); } else { NOTREACHED(); } frame->console().reportMessageToClient(JSMessageSource, ErrorMessageLevel, event->messageForConsole(), event->location()); const String16 defaultMessage = "Uncaught"; if (scriptState && scriptState->contextIsValid()) { ScriptState::Scope scope(scriptState); v8::Local<v8::Value> exception = V8ErrorHandler::loadExceptionFromErrorEventWrapper(scriptState, event, scriptState->context()->Global()); SourceLocation* location = event->location(); v8Inspector()->exceptionThrown(scriptState->context(), defaultMessage, exception, event->messageForConsole(), location->url(), location->lineNumber(), location->columnNumber(), location->takeStackTrace(), location->scriptId()); } } int MainThreadDebugger::contextGroupId(LocalFrame* frame) { LocalFrame* localFrameRoot = frame->localFrameRoot(); return frameId(localFrameRoot); } MainThreadDebugger* MainThreadDebugger::instance() { ASSERT(isMainThread()); V8PerIsolateData* data = V8PerIsolateData::from(V8PerIsolateData::mainThreadIsolate()); ASSERT(data->threadDebugger() && !data->threadDebugger()->isWorker()); return static_cast<MainThreadDebugger*>(data->threadDebugger()); } void MainThreadDebugger::interruptMainThreadAndRun(std::unique_ptr<InspectorTaskRunner::Task> task) { MutexLocker locker(creationMutex()); if (s_instance) { s_instance->m_taskRunner->appendTask(std::move(task)); s_instance->m_taskRunner->interruptAndRunAllTasksDontWait(s_instance->m_isolate); } } void MainThreadDebugger::runMessageLoopOnPause(int contextGroupId) { LocalFrame* pausedFrame = WeakIdentifierMap<LocalFrame>::lookup(contextGroupId); // Do not pause in Context of detached frame. if (!pausedFrame) return; ASSERT(pausedFrame == pausedFrame->localFrameRoot()); m_paused = true; if (UserGestureToken* token = UserGestureIndicator::currentToken()) token->setPauseInDebugger(); // Wait for continue or step command. if (m_clientMessageLoop) m_clientMessageLoop->run(pausedFrame); } void MainThreadDebugger::quitMessageLoopOnPause() { m_paused = false; if (m_clientMessageLoop) m_clientMessageLoop->quitNow(); } void MainThreadDebugger::muteMetrics(int contextGroupId) { LocalFrame* frame = WeakIdentifierMap<LocalFrame>::lookup(contextGroupId); if (frame && frame->host()) { frame->host()->useCounter().muteForInspector(); frame->host()->deprecation().muteForInspector(); } } void MainThreadDebugger::unmuteMetrics(int contextGroupId) { LocalFrame* frame = WeakIdentifierMap<LocalFrame>::lookup(contextGroupId); if (frame && frame->host()) { frame->host()->useCounter().unmuteForInspector(); frame->host()->deprecation().unmuteForInspector(); } } v8::Local<v8::Context> MainThreadDebugger::ensureDefaultContextInGroup(int contextGroupId) { LocalFrame* frame = WeakIdentifierMap<LocalFrame>::lookup(contextGroupId); ScriptState* scriptState = frame ? ScriptState::forMainWorld(frame) : nullptr; return scriptState ? scriptState->context() : v8::Local<v8::Context>(); } void MainThreadDebugger::beginEnsureAllContextsInGroup(int contextGroupId) { LocalFrame* frame = WeakIdentifierMap<LocalFrame>::lookup(contextGroupId); frame->settings()->setForceMainWorldInitialization(true); } void MainThreadDebugger::endEnsureAllContextsInGroup(int contextGroupId) { LocalFrame* frame = WeakIdentifierMap<LocalFrame>::lookup(contextGroupId); frame->settings()->setForceMainWorldInitialization(false); } bool MainThreadDebugger::canExecuteScripts(int contextGroupId) { LocalFrame* frame = WeakIdentifierMap<LocalFrame>::lookup(contextGroupId); return frame->script().canExecuteScripts(NotAboutToExecuteScript); } void MainThreadDebugger::resumeStartup(int contextGroupId) { LocalFrame* frame = WeakIdentifierMap<LocalFrame>::lookup(contextGroupId); if (m_clientMessageLoop) m_clientMessageLoop->resumeStartup(frame); } void MainThreadDebugger::consoleAPIMessage(int contextGroupId, V8ConsoleAPIType type, const String16& message, const String16& url, unsigned lineNumber, unsigned columnNumber, V8StackTrace* stackTrace) { LocalFrame* frame = WeakIdentifierMap<LocalFrame>::lookup(contextGroupId); if (!frame) return; if (type == V8ConsoleAPIType::kClear && frame->host()) frame->host()->consoleMessageStorage().clear(); std::unique_ptr<SourceLocation> location = SourceLocation::create(url, lineNumber, columnNumber, stackTrace ? stackTrace->clone() : nullptr, 0); frame->console().reportMessageToClient(ConsoleAPIMessageSource, consoleAPITypeToMessageLevel(type), message, location.get()); } v8::MaybeLocal<v8::Value> MainThreadDebugger::memoryInfo(v8::Isolate* isolate, v8::Local<v8::Context> context) { ExecutionContext* executionContext = toExecutionContext(context); ASSERT_UNUSED(executionContext, executionContext); ASSERT(executionContext->isDocument()); return toV8(MemoryInfo::create(), context->Global(), isolate); } void MainThreadDebugger::installAdditionalCommandLineAPI(v8::Local<v8::Context> context, v8::Local<v8::Object> object) { ThreadDebugger::installAdditionalCommandLineAPI(context, object); createFunctionProperty(context, object, "$", MainThreadDebugger::querySelectorCallback, "function $(selector, [startNode]) { [Command Line API] }"); createFunctionProperty(context, object, "$$", MainThreadDebugger::querySelectorAllCallback, "function $$(selector, [startNode]) { [Command Line API] }"); createFunctionProperty(context, object, "$x", MainThreadDebugger::xpathSelectorCallback, "function $x(xpath, [startNode]) { [Command Line API] }"); } static Node* secondArgumentAsNode(const v8::FunctionCallbackInfo<v8::Value>& info) { if (info.Length() > 1) { if (Node* node = V8Node::toImplWithTypeCheck(info.GetIsolate(), info[1])) return node; } ExecutionContext* executionContext = toExecutionContext(info.GetIsolate()->GetCurrentContext()); if (executionContext->isDocument()) return toDocument(executionContext); return nullptr; } void MainThreadDebugger::querySelectorCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { if (info.Length() < 1) return; String selector = toCoreStringWithUndefinedOrNullCheck(info[0]); if (selector.isEmpty()) return; Node* node = secondArgumentAsNode(info); if (!node || !node->isContainerNode()) return; ExceptionState exceptionState(ExceptionState::ExecutionContext, "$", "CommandLineAPI", info.Holder(), info.GetIsolate()); Element* element = toContainerNode(node)->querySelector(AtomicString(selector), exceptionState); if (exceptionState.throwIfNeeded()) return; if (element) info.GetReturnValue().Set(toV8(element, info.Holder(), info.GetIsolate())); else info.GetReturnValue().Set(v8::Null(info.GetIsolate())); } void MainThreadDebugger::querySelectorAllCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { if (info.Length() < 1) return; String selector = toCoreStringWithUndefinedOrNullCheck(info[0]); if (selector.isEmpty()) return; Node* node = secondArgumentAsNode(info); if (!node || !node->isContainerNode()) return; ExceptionState exceptionState(ExceptionState::ExecutionContext, "$$", "CommandLineAPI", info.Holder(), info.GetIsolate()); // toV8(elementList) doesn't work here, since we need a proper Array instance, not NodeList. StaticElementList* elementList = toContainerNode(node)->querySelectorAll(AtomicString(selector), exceptionState); if (exceptionState.throwIfNeeded() || !elementList) return; v8::Isolate* isolate = info.GetIsolate(); v8::Local<v8::Context> context = isolate->GetCurrentContext(); v8::Local<v8::Array> nodes = v8::Array::New(isolate, elementList->length()); for (size_t i = 0; i < elementList->length(); ++i) { Element* element = elementList->item(i); if (!nodes->Set(context, i, toV8(element, info.Holder(), info.GetIsolate())).FromMaybe(false)) return; } info.GetReturnValue().Set(nodes); } void MainThreadDebugger::xpathSelectorCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { if (info.Length() < 1) return; String selector = toCoreStringWithUndefinedOrNullCheck(info[0]); if (selector.isEmpty()) return; Node* node = secondArgumentAsNode(info); if (!node || !node->isContainerNode()) return; ExceptionState exceptionState(ExceptionState::ExecutionContext, "$x", "CommandLineAPI", info.Holder(), info.GetIsolate()); XPathResult* result = XPathEvaluator::create()->evaluate(selector, node, nullptr, XPathResult::kAnyType, ScriptValue(), exceptionState); if (exceptionState.throwIfNeeded() || !result) return; if (result->resultType() == XPathResult::kNumberType) { info.GetReturnValue().Set(toV8(result->numberValue(exceptionState), info.Holder(), info.GetIsolate())); } else if (result->resultType() == XPathResult::kStringType) { info.GetReturnValue().Set(toV8(result->stringValue(exceptionState), info.Holder(), info.GetIsolate())); } else if (result->resultType() == XPathResult::kBooleanType) { info.GetReturnValue().Set(toV8(result->booleanValue(exceptionState), info.Holder(), info.GetIsolate())); } else { v8::Isolate* isolate = info.GetIsolate(); v8::Local<v8::Context> context = isolate->GetCurrentContext(); v8::Local<v8::Array> nodes = v8::Array::New(isolate); size_t index = 0; while (Node* node = result->iterateNext(exceptionState)) { if (exceptionState.throwIfNeeded()) return; if (!nodes->Set(context, index++, toV8(node, info.Holder(), info.GetIsolate())).FromMaybe(false)) return; } info.GetReturnValue().Set(nodes); } exceptionState.throwIfNeeded(); } } // namespace blink
danakj/chromium
third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp
C++
bsd-3-clause
16,837
Spree.user_class.class_eval do belongs_to :supplier, class_name: 'Spree::Supplier', optional: true has_many :variants, through: :supplier def supplier? supplier.present? end def supplier_admin? spree_roles.map(&:name).include?("supplier_admin") end def market_maker? has_admin_role? end def has_admin_role? spree_roles.map(&:name).include?("admin") end end
boomerdigital/solidus_marketplace
app/models/spree/user_decorator.rb
Ruby
bsd-3-clause
400
# Possible discounts: # - Node (administer inline with nodes) # - Bulk amounts on nodes # - User # - Group of users # - Order (this is more-or-less a voucher) # - Shipping costs # Possible amounts: # - Percentage # - Fixed amount # Flag indicating if a discount can be combined with other discounts. # Boolean "offer" to include in list of offers. Default to true if discount is at node level. # Save all applied discounts when ordering in a ManyToMany relationship with Order.
bhell/jimi
jimi/jimi/price/models/discount.py
Python
bsd-3-clause
478
// Copyright © 2017 The CefSharp Authors. All rights reserved. // // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. using System; using System.Threading.Tasks; namespace CefSharp.Test { public static class WebBrowserTestExtensions { public static Task<LoadUrlAsyncResponse> LoadRequestAsync(this IWebBrowser browser, IRequest request) { if(request == null) { throw new ArgumentNullException("request"); } //If using .Net 4.6 then use TaskCreationOptions.RunContinuationsAsynchronously //and switch to tcs.TrySetResult below - no need for the custom extension method var tcs = new TaskCompletionSource<LoadUrlAsyncResponse>(TaskCreationOptions.RunContinuationsAsynchronously); EventHandler<LoadErrorEventArgs> loadErrorHandler = null; EventHandler<LoadingStateChangedEventArgs> loadingStateChangeHandler = null; loadErrorHandler = (sender, args) => { //Ignore Aborted //Currently invalid SSL certificates which aren't explicitly allowed //end up with CefErrorCode.Aborted, I've created the following PR //in the hopes of getting this fixed. //https://bitbucket.org/chromiumembedded/cef/pull-requests/373 if (args.ErrorCode == CefErrorCode.Aborted) { return; } //If LoadError was called then we'll remove both our handlers //as we won't need to capture LoadingStateChanged, we know there //was an error browser.LoadError -= loadErrorHandler; browser.LoadingStateChanged -= loadingStateChangeHandler; tcs.TrySetResult(new LoadUrlAsyncResponse(args.ErrorCode, -1)); }; loadingStateChangeHandler = (sender, args) => { //Wait for while page to finish loading not just the first frame if (!args.IsLoading) { var host = args.Browser.GetHost(); var navEntry = host?.GetVisibleNavigationEntry(); int statusCode = navEntry?.HttpStatusCode ?? -1; //By default 0 is some sort of error, we map that to -1 //so that it's clearer that something failed. if (statusCode == 0) { statusCode = -1; } browser.LoadingStateChanged -= loadingStateChangeHandler; //This is required when using a standard TaskCompletionSource //Extension method found in the CefSharp.Internals namespace tcs.TrySetResult(new LoadUrlAsyncResponse(CefErrorCode.None, statusCode)); } }; browser.LoadingStateChanged += loadingStateChangeHandler; browser.GetMainFrame().LoadRequest(request); return tcs.Task; } public static Task<bool> WaitForQUnitTestExeuctionToComplete(this IWebBrowser browser) { //If using .Net 4.6 then use TaskCreationOptions.RunContinuationsAsynchronously //and switch to tcs.TrySetResult below - no need for the custom extension method var tcs = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously); EventHandler<JavascriptMessageReceivedEventArgs> handler = null; handler = (sender, args) => { browser.JavascriptMessageReceived -= handler; dynamic msg = args.Message; //Wait for while page to finish loading not just the first frame if (msg.Type == "QUnitExecutionComplete") { var details = msg.Details; var total = (int)details.total; var passed = (int)details.passed; tcs.TrySetResult(total == passed); } else { tcs.TrySetException(new Exception("WaitForQUnitTestExeuctionToComplete - Incorrect Message Type")); } }; browser.JavascriptMessageReceived += handler; return tcs.Task; } } }
Livit/CefSharp
CefSharp.Test/WebBrowserTestExtensions.cs
C#
bsd-3-clause
4,472
<?php use yii\db\Migration; class m160407_113339_vraagenAndAwnserFixjes extends Migration { public function safeUp() { $this->alterColumn('vraag', 'text', 'blob'); $this->alterColumn('antwoord', 'text', 'blob'); } public function safeDown() { $this->alterColumn('vraag', 'text', 'string(128)'); $this->alterColumn('antwoord', 'text', 'string(128)'); } }
foxoffire33/testList
console/migrations/m160407_113339_vraagenAndAwnserFixjes.php
PHP
bsd-3-clause
414
#ifndef CTRL_PARTITION_H #define CTRL_PARTITION_H #include <wx/panel.h> //#include <wx/sizer.h> enum CTRL_STATE { S_IDLE, S_LEFT_SLIDER, S_RIGHT_SLIDER, S_MOVE }; class wxPartition : public wxPanel { static const int slider_width = 10; int slider_left_pos; int slider_right_pos; CTRL_STATE state; unsigned n_steps; wxMouseEvent mouse_old_pos; bool enabled; public: wxPartition(wxWindow *parent, wxWindowID winid = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString &name = wxPanelNameStr); void SetNumberOfSteps(unsigned n_steps){this->n_steps=n_steps;} unsigned GetNumberOfSteps(){return n_steps;} bool SetLeftSliderPos(unsigned pos); bool SetRightSliderPos(unsigned pos); unsigned GetLeftSliderPos(); unsigned GetRightSliderPos(); bool Enable(bool enable=true); void paintEvent(wxPaintEvent & evt); void paintNow(); void render(wxDC& dc); void mouseMoved(wxMouseEvent& event); void mouseDown(wxMouseEvent& event); void mouseReleased(wxMouseEvent& event); void mouseLeftWindow(wxMouseEvent& event); void mouseLeftDoubleClick(wxMouseEvent& event); DECLARE_EVENT_TABLE() }; #endif
Null665/partmod
wxGUI/ctrl_partition.h
C
bsd-3-clause
1,412
Title: Music API Server说明文档 Date: 2014-06-24 12:56 Update: 2014-07-02 20:36 Tags: 音乐服务, API 音乐服务的api通用接口,目前已支持的音乐服务: * 虾米 * 专辑 * 歌曲列表 * 精选集 * 网易云音乐 * 专辑 * 歌曲列表 * 歌单 仓库地址: [mawenbao/music-api-server](https://github.com/mawenbao/music-api-server) ## 安装(debian/ubuntu) 首先检查`GOPATH`变量是否正确设置,如果未设置,参考[这里](http://blog.atime.me/note/golang-summary.html#3867e350ebb33a487c4ac5f7787e1c29)进行设置。 # install redis-server sudo apt-get install redis-server # install redis driver for golang go get github.com/garyburd/redigo/redis # install music api server go get github.com/mawenbao/music-api-server # install init script sudo cp $GOPATH/src/github.com/mawenbao/music-api-server/tools/init-script /etc/init.d/music-api-server # set your GOPATH in init script sudo sed -i "s|/SET/YOUR/GOPATH/HERE|`echo $GOPATH`|" /etc/init.d/music-api-server sudo chmod +x /etc/init.d/music-api-server # start music api server sudo service music-api-server start # (optional) let music api server start on boot sudo update-rc.d music-api-server defaults # (optional) install logrotate config sudo cp $GOPATH/src/github.com/mawenbao/music-api-server/tools/logrotate-config /etc/logrotate.d/music-api-server ## 更新(debian/ubuntu) # update and restart music-api-server go get -u github.com/mawenbao/music-api-server sudo service music-api-server restart # flush redis cache redis-cli > flushall ## API ### Demo [http://app.atime.me/music-api-server/?p=xiami&t=songlist&i=20526,1772292423&c=abc123](http://app.atime.me/music-api-server/?p=xiami&t=songlist&i=20526,1772292423&c=abc123) ### 请求 GET http://localhost:9099/?p=xiami&t=songlist&i=20526,1772292423&c=abc123 * `localhost:9099`: 默认监听地址 * `p=xiami`: 音乐API提供商,目前支持: * 虾米(xiami) * 网易云音乐(netease) * `t=songlist`: 音乐类型 * songlist(xiami + netease): 歌曲列表,对应的id是半角逗号分隔的多个歌曲id * album(xiami + netease): 音乐专辑,对应的id为专辑id * collect(xiami): 虾米的精选集,对应的id为精选集id * playlist(netease): 网易云音乐的歌单,对应的id为歌单(playlist)id * `i=20526,1772292423`: 歌曲/专辑/精选集/歌单的id,歌曲列表类型可用半角逗号分割多个歌曲id * `c=abc123`: 使用jsonp方式返回数据,实际返回为`abc123({songs: ...});` ### 返回 { "status": "返回状态,ok为正常,failed表示出错并设置msg", "msg": "如果status为failed,这里会保存错误信息,否则不返回该字段", "songs": [ { "name": "歌曲名称", "url": "歌曲播放地址", "artists": "演唱者", "provider": "音乐提供商" "lrc_url": "歌词文件地址(可能没有)", } ] } 如果有`c=abc123`请求参数,则实际以[jsonp](http://en.wikipedia.org/wiki/JSONP)方式返回数据。 ## TODO 1. 更好的缓存策略 ## Thanks * [Wordpress Hermit Player](http://mufeng.me/hermit-for-wordpress.html) * [网易云音乐API分析](https://github.com/yanunon/NeteaseCloudMusic/wiki/%E7%BD%91%E6%98%93%E4%BA%91%E9%9F%B3%E4%B9%90API%E5%88%86%E6%9E%90)
mawenbao/pelican-blog-content
content/code/music-api-server-readme.md
Markdown
bsd-3-clause
3,530
<?php use SerializerKit\XmlSerializer; class XmlSerializerTest extends PHPUnit_Framework_TestCase { function test() { $xmls = new XmlSerializer; $string = $xmls->encode(array( 'title' => 'War and Peace', 'isbn' => 123123123, 'authors' => array( array( 'name' => 'First', 'email' => 'Email-1' ), array( 'name' => 'Second', 'email' => 'Email-2' ), ), )); ok( $string ); $data = $xmls->decode( $string ); ok( $data['title'] ); ok( $data['isbn'] ); ok( is_array($data['authors']) ); ok( $data['authors'][0] ); ok( $data['authors'][1] ); } }
c9s/php-SerializerKit
tests/XmlSerializerTest.php
PHP
bsd-3-clause
715
# Makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = sphinx-build PAPER = BUILDDIR = _build # User-friendly check for sphinx-build ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) endif # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest coverage gettext help: @echo "Please use \`make <target>' where <target> is one of" @echo " html to make standalone HTML files" @echo " dirhtml to make HTML files named index.html in directories" @echo " singlehtml to make a single large HTML file" @echo " pickle to make pickle files" @echo " json to make JSON files" @echo " htmlhelp to make HTML files and a HTML help project" @echo " qthelp to make HTML files and a qthelp project" @echo " applehelp to make an Apple Help Book" @echo " devhelp to make HTML files and a Devhelp project" @echo " epub to make an epub" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " latexpdf to make LaTeX files and run them through pdflatex" @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" @echo " text to make text files" @echo " man to make manual pages" @echo " texinfo to make Texinfo files" @echo " info to make Texinfo files and run them through makeinfo" @echo " gettext to make PO message catalogs" @echo " changes to make an overview of all changed/added/deprecated items" @echo " xml to make Docutils-native XML files" @echo " pseudoxml to make pseudoxml-XML files for display purposes" @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" @echo " coverage to run coverage check of the documentation (if enabled)" clean: rm -rf $(BUILDDIR)/* html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." dirhtml: $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." singlehtml: $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml @echo @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." pickle: $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle @echo @echo "Build finished; now you can process the pickle files." json: $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json @echo @echo "Build finished; now you can process the JSON files." htmlhelp: $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp @echo @echo "Build finished; now you can run HTML Help Workshop with the" \ ".hhp project file in $(BUILDDIR)/htmlhelp." qthelp: $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in $(BUILDDIR)/qthelp, like this:" @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Blinky.qhcp" @echo "To view the help file:" @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Blinky.qhc" applehelp: $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp @echo @echo "Build finished. The help book is in $(BUILDDIR)/applehelp." @echo "N.B. You won't be able to view it unless you put it in" \ "~/Library/Documentation/Help or install it in your application" \ "bundle." devhelp: $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp @echo @echo "Build finished." @echo "To view the help file:" @echo "# mkdir -p $$HOME/.local/share/devhelp/Blinky" @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Blinky" @echo "# devhelp" epub: $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub @echo @echo "Build finished. The epub file is in $(BUILDDIR)/epub." latex: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." @echo "Run \`make' in that directory to run these through (pdf)latex" \ "(use \`make latexpdf' here to do that automatically)." latexpdf: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through pdflatex..." $(MAKE) -C $(BUILDDIR)/latex all-pdf @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." latexpdfja: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through platex and dvipdfmx..." $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." text: $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text @echo @echo "Build finished. The text files are in $(BUILDDIR)/text." man: $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man @echo @echo "Build finished. The manual pages are in $(BUILDDIR)/man." texinfo: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." @echo "Run \`make' in that directory to run these through makeinfo" \ "(use \`make info' here to do that automatically)." info: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo "Running Texinfo files through makeinfo..." make -C $(BUILDDIR)/texinfo info @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." gettext: $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale @echo @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." changes: $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes @echo @echo "The overview file is in $(BUILDDIR)/changes." linkcheck: $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck @echo @echo "Link check complete; look for any errors in the above output " \ "or in $(BUILDDIR)/linkcheck/output.txt." doctest: $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest @echo "Testing of doctests in the sources finished, look at the " \ "results in $(BUILDDIR)/doctest/output.txt." coverage: $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage @echo "Testing of coverage in the sources finished, look at the " \ "results in $(BUILDDIR)/coverage/python.txt." xml: $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml @echo @echo "Build finished. The XML files are in $(BUILDDIR)/xml." pseudoxml: $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml @echo @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
smn/blinky
docs/Makefile
Makefile
bsd-3-clause
7,409
#![allow(missing_docs)] use downcast_rs::Downcast; use na::{DVector, RealField}; use ncollide::query::ContactId; use crate::detection::ColliderContactManifold; use crate::material::MaterialsCoefficientsTable; use crate::object::{BodyHandle, BodySet, ColliderHandle}; use crate::solver::{ConstraintSet, IntegrationParameters}; /// The modeling of a contact. pub trait ContactModel<N: RealField, Handle: BodyHandle, CollHandle: ColliderHandle>: Downcast + Send + Sync { /// Maximum number of velocity constraint to be generated for each contact. fn num_velocity_constraints( &self, manifold: &ColliderContactManifold<N, Handle, CollHandle>, ) -> usize; /// Generate all constraints for the given contact manifolds. fn constraints( &mut self, parameters: &IntegrationParameters<N>, material_coefficients: &MaterialsCoefficientsTable<N>, bodies: &dyn BodySet<N, Handle = Handle>, ext_vels: &DVector<N>, manifolds: &[ColliderContactManifold<N, Handle, CollHandle>], ground_j_id: &mut usize, j_id: &mut usize, jacobians: &mut [N], constraints: &mut ConstraintSet<N, Handle, CollHandle, ContactId>, ); /// Stores all the impulses found by the solver into a cache for warmstarting. fn cache_impulses(&mut self, constraints: &ConstraintSet<N, Handle, CollHandle, ContactId>); } impl_downcast!(ContactModel<N, Handle, CollHandle> where N: RealField, Handle: BodyHandle, CollHandle: ColliderHandle);
sebcrozet/nphysics
src/solver/contact_model.rs
Rust
bsd-3-clause
1,526
/** * @file * Money is a value object representing a monetary value. It does not use * floating point numbers, so it avoids rounding errors. * The only operation that may cause stray cents is split, it assures that no * cents vanish by distributing as evenly as possible among the parts it splits into. * * Money has no notion of currency, so working in a single currency -- no matter * which one -- is appropriate usage. * * In lack of better terminology, Money uses "dollars" and "cents". * * One dollar is assumed to be 100 cents. * * The cent number is guaranteed to be below 100. */ Module("Cactus.Data", function (m) { /** * @param natural dollars * @param natural cents * if > 100 then dollars are added until cents < 100. */ var Money = Class("Money", { has : { /** * @type int */ amount : null }, methods : { BUILD : function (dollars, cents) { var dollars = parseInt(dollars, 10); var cents = parseInt(cents, 10); if (dollars !== 0 && cents < 0) { throw new Error("Money: cents < 0"); } if (isNaN(dollars)) { throw new Error("Money: dollars is NaN"); } if (isNaN(cents)) { throw new Error("Money: cents is NaN"); } return { amount : dollars * 100 + (dollars < 0 ? -1 * cents : cents) }; }, /** * @return int */ _getAmount : function () { return this.amount; }, /** * @return natural */ getDollars : function () { if (this.amount < 0) { return Math.ceil(this.amount / 100); } else { return Math.floor(this.amount / 100); } }, /** * @return natural */ getCents : function () { if (this.amount < 0 && this.getDollars() === 0) { return this.amount % 100; } else { return Math.abs(this.amount % 100); } }, /** * The value with zero padded cents if < 100, and . used as the decimal * separator. * * @return string */ toString : function () { if (this.isNegative()) { if (this.gt(new Money(-1, 0))) { var cents = (-this.getCents()) < 10 ? "0" + (-this.getCents()) : (-this.getCents()); return "-0." + cents; } } var cents = this.getCents() < 10 ? "0" + this.getCents() : this.getCents(); return this.getDollars() + "." + cents; }, /** * @param Money money * @return Money */ add : function (money) { return Money._fromAmount(this._getAmount() + money._getAmount()); }, /** * @param Money money * @return Money */ sub : function (money) { return Money._fromAmount(this._getAmount() - money._getAmount()); }, /** * @param number multiplier * @return Money */ mult : function (multiplier) { return Money._fromAmount(this._getAmount() * multiplier); }, /** * @return Boolean */ isPositive : function () { return this._getAmount() > 0; }, /** * @return Boolean */ isNegative : function () { return this._getAmount() < 0; }, /** * @return Boolean */ isZero : function () { return this._getAmount() === 0; }, /** * @param Money money * @return Boolean */ equals : function (money) { return this._getAmount() === money._getAmount(); }, /** * @param Money money * @return Boolean */ gt : function (money) { return this._getAmount() > money._getAmount(); }, /** * @param Money money * @return Boolean */ lt : function (money) { return money.gt(this); }, /** * @param Money money * @return Money */ negate : function () { return Money._fromAmount(-this._getAmount()); }, /** * Splits the object into parts, the remaining cents are distributed from * the first element of the result and onward. * * @param int divisor * @return Array<Money> */ split : function (divisor) { var dividend = this._getAmount(); var quotient = Math.floor(dividend / divisor); var remainder = dividend - quotient * divisor; var res = []; var moneyA = Money._fromAmount(quotient + 1); var moneyB = Money._fromAmount(quotient); for (var i = 0; i < remainder; i++) { res.push(moneyA); } for (i = 0; i < divisor - remainder; i++) { res.push(moneyB); } return res; }, /** * @return Hash{ * dollars : int, * cents : int * } */ serialize : function () { return { dollars : this.getDollars(), cents : this.getCents() }; } } }); /** * @param String s * @return Money */ Money.fromString = function (s) { if (s === null) { throw new Error("Money.fromString: String was null."); } if (s === "") { throw new Error("Money.fromString: String was empty."); } if (!/^-?\d+(?:\.\d{2})?$/.test(s)) { throw new Error("Money.fromString: Invalid format, got: " + s); } var a = s.split("."); if (a.length === 1) { return new Money(parseInt(a[0], 10), 0); } else if (a.length === 2) { return new Money(parseInt(a[0], 10), parseInt(a[1], 10)); } else { throw new Error("Money:fromString: BUG: RegExp should have prevent this from happening."); } }; /** * @param int amount * @return Money */ Money._fromAmount = function (amount) { if (amount > 0) { return new Money(Math.floor(amount / 100), amount % 100); } else { return new Money(Math.ceil(amount / 100), Math.abs(amount) < 100 ? (amount % 100) : -(amount % 100)); } }; /** * @param Array<Money> ms * @return Money */ Money.sum = function (ms) { var sum = new Money(0, 0); for (var i = 0; i < ms.length; i++) { sum = sum.add(ms[i]); } return sum; }; m.Money = Money; });
bergmark/Cactus
module/Core/lib/Data/Money.js
JavaScript
bsd-3-clause
6,415
#include "Shape.h" #include "DynBase.h" //#include <iostream> using std::cout; using std::endl; Shape::~Shape() { cout << "~Shape ..." << endl; } void Circle::Draw() { cout << "Circle::Draw() ..." << endl; } Circle::~Circle() { cout << "~Circle ..." << endl; } void Square::Draw() { cout << "Square::Draw() ..." << endl; } Square::~Square() { cout << "~Square ..." << endl; } void Rectangle::Draw() { cout << "Rectangle::Draw() ..." << endl; } Rectangle::~Rectangle() { cout << "~Rectangle ..." << endl; } REGISTER_CLASS(Circle); REGISTER_CLASS(Square); REGISTER_CLASS(Rectangle); /*class CircleRegister { public: static void* NewInstance() { return new Rectangle; } private: static Register reg_; }; Register CircleRegister::reg_("Circle", CircleRegister::NewInstance);*/
lixinyancici/code-for-learning-cpp
cppbasic/Shape.cpp
C++
bsd-3-clause
796
// Copyright (c) Jupyter Development Team. // Distributed under the terms of the Modified BSD License. 'use strict'; import { IContentsModel } from 'jupyter-js-services'; import { Message } from 'phosphor-messaging'; import { PanelLayout } from 'phosphor-panel'; import { Widget } from 'phosphor-widget'; import { FileButtons } from './buttons'; import { BreadCrumbs } from './crumbs'; import { DirListing } from './listing'; import { FileBrowserModel } from './model'; import { FILE_BROWSER_CLASS, showErrorMessage } from './utils'; /** * The class name added to the filebrowser crumbs node. */ const CRUMBS_CLASS = 'jp-FileBrowser-crumbs'; /** * The class name added to the filebrowser buttons node. */ const BUTTON_CLASS = 'jp-FileBrowser-buttons'; /** * The class name added to the filebrowser listing node. */ const LISTING_CLASS = 'jp-FileBrowser-listing'; /** * The duration of auto-refresh in ms. */ const REFRESH_DURATION = 30000; /** * A widget which hosts a file browser. * * The widget uses the Jupyter Contents API to retreive contents, * and presents itself as a flat list of files and directories with * breadcrumbs. */ export class FileBrowserWidget extends Widget { /** * Construct a new file browser. * * @param model - The file browser view model. */ constructor(model: FileBrowserModel) { super(); this.addClass(FILE_BROWSER_CLASS); this._model = model; this._model.refreshed.connect(this._handleRefresh, this) this._crumbs = new BreadCrumbs(model); this._buttons = new FileButtons(model); this._listing = new DirListing(model); this._crumbs.addClass(CRUMBS_CLASS); this._buttons.addClass(BUTTON_CLASS); this._listing.addClass(LISTING_CLASS); let layout = new PanelLayout(); layout.addChild(this._crumbs); layout.addChild(this._buttons); layout.addChild(this._listing); this.layout = layout; } /** * Dispose of the resources held by the file browser. */ dispose() { this._model = null; this._crumbs = null; this._buttons = null; this._listing = null; super.dispose(); } /** * Get the model used by the file browser. * * #### Notes * This is a read-only property. */ get model(): FileBrowserModel { return this._model; } /** * Get the widget factory for the widget. */ get widgetFactory(): (model: IContentsModel) => Widget { return this._listing.widgetFactory; } /** * Set the widget factory for the widget. */ set widgetFactory(factory: (model: IContentsModel) => Widget) { this._listing.widgetFactory = factory; } /** * Change directory. */ cd(path: string): Promise<void> { return this._model.cd(path); } /** * Open the currently selected item(s). * * Changes to the first directory encountered. * Emits [[openRequested]] signals for files. */ open(): void { let foundDir = false; let items = this._model.sortedItems; for (let item of items) { if (!this._model.isSelected(item.name)) { continue; } if (item.type === 'directory' && !foundDir) { foundDir = true; this._model.open(item.name).catch(error => showErrorMessage(this, 'Open directory', error) ); } else { this.model.open(item.name); } } } /** * Create a new untitled file or directory in the current directory. */ newUntitled(type: string, ext?: string): Promise<IContentsModel> { return this.model.newUntitled(type, ext); } /** * Rename the first currently selected item. */ rename(): Promise<string> { return this._listing.rename(); } /** * Cut the selected items. */ cut(): void { this._listing.cut(); } /** * Copy the selected items. */ copy(): void { this._listing.copy(); } /** * Paste the items from the clipboard. */ paste(): Promise<void> { return this._listing.paste(); } /** * Delete the currently selected item(s). */ delete(): Promise<void> { return this._listing.delete(); } /** * Duplicate the currently selected item(s). */ duplicate(): Promise<void> { return this._listing.duplicate(); } /** * Download the currently selected item(s). */ download(): Promise<void> { return this._listing.download(); } /** * Shut down kernels on the applicable currently selected items. */ shutdownKernels(): Promise<void> { return this._listing.shutdownKernels(); } /** * Refresh the current directory. */ refresh(): Promise<void> { return this._model.refresh().catch( error => showErrorMessage(this, 'Refresh Error', error) ); } /** * Select next item. */ selectNext(): void { this._listing.selectNext(); } /** * Select previous item. */ selectPrevious(): void { this._listing.selectPrevious(); } /** * A message handler invoked on an `'after-attach'` message. */ protected onAfterAttach(msg: Message): void { super.onAfterAttach(msg); this.refresh(); } /** * A message handler invoked on an `'after-show'` message. */ protected onAfterShow(msg: Message): void { super.onAfterShow(msg); this.refresh(); } /** * Handle a model refresh. */ private _handleRefresh(): void { clearTimeout(this._timeoutId); this._timeoutId = setTimeout(() => this.refresh(), REFRESH_DURATION); } private _model: FileBrowserModel = null; private _crumbs: BreadCrumbs = null; private _buttons: FileButtons = null; private _listing: DirListing = null; private _timeoutId = -1; }
jupyter/jupyter-js-filebrowser
src/browser.ts
TypeScript
bsd-3-clause
5,682
<?php /** * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace ZendTest\Mvc\Controller\Plugin\TestAsset; use Zend\Authentication\Adapter\AdapterInterface; use Zend\Authentication\Result; class AuthenticationAdapter implements AdapterInterface { protected $identity; public function setIdentity($identity) { $this->identity = $identity; } public function authenticate() { return new Result(Result::SUCCESS, $this->identity); } }
mowema/verano
vendor/zendframework/zendframework/tests/ZendTest/Mvc/Controller/Plugin/TestAsset/AuthenticationAdapter.php
PHP
bsd-3-clause
761
<?php namespace app\models; use Yii; /** * This is the model class for table "solicitud_prestamo". * * @property integer $SPRE_ID * @property string $PE_RUT * @property string $SPRE_DESCRIPCION * @property string $SPRE_FECHA * @property string $SPRE_ESTADO * @property string $SPRE_TEXTO * * @property Persona $pERUT * @property SpreHeSolicita[] $spreHeSolicitas */ class SolicitudPrestamo extends \yii\db\ActiveRecord { /** * @inheritdoc */ public static function tableName() { return 'solicitud_prestamo'; } /** * @inheritdoc */ public function rules() { return [ [['PE_RUT'], 'required'], [['SPRE_FECHA'], 'safe'], [['SPRE_DESCRIPCION'], 'string'], [['PE_RUT'], 'string', 'max' => 12], [['SPRE_TITULO'], 'string', 'max' => 50], [['SPRE_ESTADO'], 'string', 'max' => 20] ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'SPRE_ID' => 'ID', 'PE_RUT' => 'Persona', 'SPRE_TITULO' => 'Título', 'SPRE_FECHA' => 'Fecha', 'SPRE_ESTADO' => 'Estado', 'SPRE_DESCRIPCION' => 'Descripción', ]; } /** * @return \yii\db\ActiveQuery */ public function getPERUT() { return $this->hasOne(Persona::className(), ['PE_RUT' => 'PE_RUT']); } /** * @return \yii\db\ActiveQuery */ public function getSpreHeSolicitas() { return $this->hasMany(SpreHeSolicita::className(), ['SPRE_ID' => 'SPRE_ID']); } }
malikeox/mymltda2
models/SolicitudPrestamo.php
PHP
bsd-3-clause
1,651
% File: api.pl % Purpose: prolog api for elf application % Author: Roger Evans % Version: 1.0 % Date: 21/12/2013 % % (c) Copyright 2013, University of Brighton % application api from prolog nimrodel(Model, Title, String) :- nimrodel(['-model', Model, '-title', Title, String]). nimrodel(Model, String) :- nimrodel(['-model', Model, String]). nimrodel(X) :- atom(X), !, nimrodel([X]). nimrodel(X) :- datr_query('nimrodel.MAIN', [arglist | X], _V). nimrodel_query(Index, Path) :- datr_theorem('nimrodel.STRING-QUERY', [Index | Path]).
rogerevansbrighton/nimrodel
nimrodel/api.pl
Perl
bsd-3-clause
604
@(message: String,books : List[models.Book], conditions : List[models.Condition], requests : List[models.CurrentRequest], bookSelected : Long , price : String ,conditionSelected : Long ) @implicitFieldConstructor = @{ helper.FieldConstructor(twitterBootstrapInput.render) } @main("My Requests") { <div class="container"> <div class="row main-features"> <br> <div class="span7"> <div class="well"> <h3>Create a Book Request</h3> @helper.form(action = routes.CurrentRequest.newRequest()) { <div class="span2"> <span class="label label-inverse">Book </span> </div> <div class="span4"> <select name="bookKey" name="bookKey" > @for(book <- books) { <option [email protected]() @if(bookSelected == book.getPrimaryKey()){selected}>@book.getTitle()</option> } </select> </div> <table class="table table-condensed table-striped"> <thead> <tr> <th> <span class="label label-info">Version </span> </th> <th> <span class="label label-info">ISBN </span> </th> <th> <span class="label label-info">Bookstore Price </span> </th> <th> <span class="label label-info">Cover </span> </th> <th></th> </tr> </thead> <tbody> <tr> @for(book <- books) { @if(bookSelected == book.getPrimaryKey()){ <td> <label> <b>@book.getEdition()</b> </label> </td> <td> <label> <b>@book.getIsbn()</b> </label> </td> <td> <label> <b>@book.getBookStorePrice()</b> </label> </td> <td> <img src="http://covers.openlibrary.org/b/isbn/@book.getIsbn()-S.jpg"> </td> }} </tr> </tbody> </table> <div class="span2"> <span class="label label-inverse">Condition</span> </div> <div class="span4"> <select name="conditionKey"> @for(condition <- conditions) { <option @if(conditionSelected == condition.getPrimaryKey()){ selected } [email protected]()>@condition.getName()</option> } </select> </div> <div class="span2"> <span class="label label-inverse">Price</span> </div> <div class="span3"> <input name="price" type="text" value="@price" class="input-medium"> <br> <br> </div> <br> <br> <div class="span5"> <input type="submit" class="btn btn-primary btn-large btn-block" id="newRequest" value="Create New Request" /> </div> } <br> <br> <br> <br> <br> <br> <br> </div> </div> <div class="span7"> <p> @message </p> </div> <div class="span7"> <table class="table table-condensed table-striped"> <thead> <tr> <th> <span class="label label-info">Book </span> </th> <th> <span class="label label-info">Condition </span> </th> <th> <span class="label label-info">Request Price </span> </th> <th></th> </tr> </thead> <tbody> @for(request <- requests) { <tr> <td> @request.getBook().getTitle() </td> <td> @request.getCondition().getName() </td> <td> <input type="text" [email protected]() class="input-medium"> </td> <td> <div class="btn-group"> <a class="btn btn-small btn-primary">Update</a> </div> </td> </tr> } </tbody> </table> @if(requests.size() ==0){ No Current Requests} </div> </div> </div> }
rward/BookSkateMate
app/views/myRequests.scala.html
HTML
bsd-3-clause
4,688
--- title: "8차 천일 결사 1차 백일 기도 정진 56일째" date: 2014-05-18 08:01:52 tags: - 8000th - 8-100th - 56th --- #수행일지 남에 마음에 노력하기 위한 저 자신을 봅니다. 어릴때 부모님 특히 엄마를 볼 수 있는 시간이 부족해서 전 사랑고파병이 있습니다. 그래서 누구든지 그 사람의 마음에 들기 위해서 무의식적으로 노력하고 있는 저를 봅니다. 이것을 알아차리니 이제 남의 마음에 들지 않기 위해서 노력하고 있는 저를 봅니다. 저는 양 극단을 헤메이고 있습니다. 부처님이 말씀하신 마음에 들기 위해서 노력할것도 마음에 들지 않기 위해서 노력하지도 않는 중도의 길을 가는것이 바른길임을 알고 바른 방향으로 수행 정진해 나가야 하겠습니다. 오늘도 모든 만물에 평화와 안녕이 깃들기를 기원합니다. 감사합니다.
ygpark2/docpad_test
src/documents/10000/2014/05/18/8_1_56.html.md
Markdown
bsd-3-clause
949
<?php namespace app\models; use app\models\query\ActionQuery; use app\models\query\CommentQuery; use Yii; use yii\db\ActiveRecord; /** * This is the model class for table "comment". * * @property integer $id * @property integer $action_id * @property string $content * * @property Action $action */ class Comment extends ActiveRecord { /** * @inheritdoc */ public static function tableName() { return 'comment'; } /** * @inheritdoc */ public function rules() { return [ [['action_id', 'content'], 'required'], [['action_id'], 'integer'], [['content'], 'string', 'max' => 255], [['action_id'], 'exist', 'skipOnError' => true, 'targetClass' => Action::className(), 'targetAttribute' => ['action_id' => 'id']], ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => Yii::t('app', 'ID'), 'action_id' => Yii::t('app', 'Action ID'), 'content' => Yii::t('app', 'Content'), ]; } /** * @return ActionQuery */ public function getAction() { return $this->hasOne(Action::className(), ['id' => 'action_id'])->inverseOf('comments'); } /** * @inheritdoc * @return CommentQuery the active query used by this AR class. */ public static function find() { return new CommentQuery(get_called_class()); } }
mixartemev/hd
models/Comment.php
PHP
bsd-3-clause
1,500
<!DOCTYPE html> <html lang='en'> <head> <title>Ligs and Pseudo Test</title> <link href="b.css" media="screen" rel="stylesheet" type="text/css" /> </head> <body> <p data-a="hello ">Hello world how are you today?</p> <p>This is a test of the use of ligatures to encode icons in a fun and cool way. Now you can insert graphics just through very simple text edditing, kind of like having emoticons!</p> <p>Sadly ligs aren't supported in IE before version 10!</p> <p>We will also test the <span aria-hidden="true" data-icon="heroku"> </span> for the CSS :before and :after pseudo elements</p> </body> </html>
dterei/Scraps
html/ligs/b.html
HTML
bsd-3-clause
638
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/net/sdch_dictionary_fetcher.h" #include "base/bind.h" #include "base/compiler_specific.h" #include "base/message_loop.h" #include "chrome/browser/profiles/profile.h" #include "content/public/common/url_fetcher.h" #include "net/base/load_flags.h" #include "net/url_request/url_request_context_getter.h" #include "net/url_request/url_request_status.h" SdchDictionaryFetcher::SdchDictionaryFetcher( net::URLRequestContextGetter* context) : ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)), task_is_pending_(false), context_(context) { DCHECK(CalledOnValidThread()); } SdchDictionaryFetcher::~SdchDictionaryFetcher() { DCHECK(CalledOnValidThread()); } // static void SdchDictionaryFetcher::Shutdown() { net::SdchManager::Shutdown(); } void SdchDictionaryFetcher::Schedule(const GURL& dictionary_url) { DCHECK(CalledOnValidThread()); // Avoid pushing duplicate copy onto queue. We may fetch this url again later // and get a different dictionary, but there is no reason to have it in the // queue twice at one time. if (!fetch_queue_.empty() && fetch_queue_.back() == dictionary_url) { net::SdchManager::SdchErrorRecovery( net::SdchManager::DICTIONARY_ALREADY_SCHEDULED_TO_DOWNLOAD); return; } if (attempted_load_.find(dictionary_url) != attempted_load_.end()) { net::SdchManager::SdchErrorRecovery( net::SdchManager::DICTIONARY_ALREADY_TRIED_TO_DOWNLOAD); return; } attempted_load_.insert(dictionary_url); fetch_queue_.push(dictionary_url); ScheduleDelayedRun(); } void SdchDictionaryFetcher::ScheduleDelayedRun() { if (fetch_queue_.empty() || current_fetch_.get() || task_is_pending_) return; MessageLoop::current()->PostDelayedTask(FROM_HERE, base::Bind(&SdchDictionaryFetcher::StartFetching, weak_factory_.GetWeakPtr()), base::TimeDelta::FromMilliseconds(kMsDelayFromRequestTillDownload)); task_is_pending_ = true; } void SdchDictionaryFetcher::StartFetching() { DCHECK(task_is_pending_); task_is_pending_ = false; DCHECK(context_.get()); current_fetch_.reset(content::URLFetcher::Create( fetch_queue_.front(), content::URLFetcher::GET, this)); fetch_queue_.pop(); current_fetch_->SetRequestContext(context_.get()); current_fetch_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES | net::LOAD_DO_NOT_SAVE_COOKIES); current_fetch_->Start(); } void SdchDictionaryFetcher::OnURLFetchComplete( const net::URLFetcher* source) { if ((200 == source->GetResponseCode()) && (source->GetStatus().status() == net::URLRequestStatus::SUCCESS)) { std::string data; source->GetResponseAsString(&data); net::SdchManager::Global()->AddSdchDictionary(data, source->GetURL()); } current_fetch_.reset(NULL); ScheduleDelayedRun(); }
robclark/chromium
chrome/browser/net/sdch_dictionary_fetcher.cc
C++
bsd-3-clause
3,016
<?php use yii\helpers\Html; use mdm\admin\models\Assignment; use backend\models\UserBackend; use yii\base\Object; $user = new UserBackend(); $list = UserBackend::find()->where([])->asArray()->all(); //print_r($list); //echo "<br>"; $euserId = ""; for($i=0;$i<count($list);$i++){ $tmpId = $list[$i]["id"]; $assign = new Assignment($tmpId); $test = $assign->getItems(); //print_r($test); //echo "<br>"; if(array_key_exists("企业管理员",$test["assigned"])){ $euserId = $tmpId; break; } } //echo "userId=".$euserId; /* @var $this \yii\web\View */ /* @var $content string */ if (Yii::$app->controller->action->id === 'login') { /** * Do not use this code in your template. Remove it. * Instead, use the code $this->layout = '//main-login'; in your controller. */ echo $this->render( 'main-login', ['content' => $content] ); } else { if (class_exists('backend\assets\AppAsset')) { backend\assets\AppAsset::register($this); } else { app\assets\AppAsset::register($this); } dmstr\web\AdminLteAsset::register($this); $directoryAsset = Yii::$app->assetManager->getPublishedUrl('@vendor/almasaeed2010/adminlte/dist'); ?> <?php $this->beginPage() ?> <!DOCTYPE html> <html lang="<?= Yii::$app->language ?>"> <head> <meta charset="<?= Yii::$app->charset ?>"/> <meta name="viewport" content="width=device-width, initial-scale=1"> <?= Html::csrfMetaTags() ?> <title><?= Html::encode($this->title) ?></title> <?php $this->head() ?> </head> <body class="hold-transition <?= \dmstr\helpers\AdminLteHelper::skinClass() ?> sidebar-mini"> <?php $this->beginBody() ?> <div class="wrapper"> <?= $this->render( 'header.php', ['directoryAsset' => $directoryAsset,'euserId'=>$euserId] ) ?> <?= $this->render( 'left.php', ['directoryAsset' => $directoryAsset,'euserId'=>$euserId] ) ?> <?= $this->render( 'content.php', ['content' => $content, 'directoryAsset' => $directoryAsset] ) ?> </div> <?php $this->endBody() ?> </body> </html> <?php $this->endPage() ?> <?php } ?>
201528013359030/partyqing2
backend/views/layouts/main.php
PHP
bsd-3-clause
2,292
C Copyright (c) 2007-2017 National Technology & Engineering Solutions of C Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with C NTESS, the U.S. Government retains certain rights in this software. C C Redistribution and use in source and binary forms, with or without C modification, are permitted provided that the following conditions are C met: C C * Redistributions of source code must retain the above copyright C notice, this list of conditions and the following disclaimer. C C * Redistributions in binary form must reproduce the above C copyright notice, this list of conditions and the following C disclaimer in the documentation and/or other materials provided C with the distribution. C C * Neither the name of NTESS nor the names of its C contributors may be used to endorse or promote products derived C from this software without specific prior written permission. C C THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS C "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT C LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR C A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT C OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, C SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT C LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, C DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY C THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT C (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE C OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. C C======================================================================== *DECK, SETON0 SUBROUTINE SETON0(ICONA,NELTN,SOLEA,SOLENA,IDBLK,XA,YA,ZA,ISTP, & ITT,iblk) C C ********************************************************************* C C Subroutine SETON0 extracts nodal values of shell element variables by C looping over each element and summing the value of the variable C in that element to each node in the connectivity list for that C element. Then the nodal summation of element variables is divided C by the number of elements that contributed to that node (resulting C in a nodal average of the element value.) This is done for the old C mesh elements and nodes to facilitate interpolation. C C Each element block must be processed independently in order to C avoid averaging element variables across material boundaries. C Note: the last set of DO loops acts over all nodes; to make sense C one element block must be completely processed before another C element block is sent into this subroutine. C C Calls subroutine VOL C c Called by MAPVAR C C ********************************************************************* C C ICONA mesh-A connectivity (1:nelnda,1:numeba) C NELTN number of elements tied to each node (1:nodesa) C SOLEA element variables (1:numeba,1:nvarel) C SOLENA element variables at nodes (1:nodesa,1:nvarel) C IDBLK current element block I.D. C XA,YA,ZA coordinates C XX,YY,ZZ vector of coordinates of nodes for an element C ISTP current time step C ITT truth table C iblk element block being processed (not ID) C C ********************************************************************* C include 'aexds1.blk' include 'aexds2.blk' include 'amesh.blk' include 'ebbyeb.blk' include 'ex2tp.blk' include 'tapes.blk' C DIMENSION ICONA(NELNDA,*), NELTN(*) DIMENSION SOLEA(NUMEBA,*), SOLENA(NODESA,NVAREL), ITT(NVAREL,*) DIMENSION XA(*), YA(*), ZA(*), XX(27), YY(27), ZZ(27) C C ********************************************************************* C NNODES = 4 DO 10 I = 1, NODESA NELTN(I) = 0 DO 10 J = 1, NVAREL SOLENA(I,J) = 0. 10 CONTINUE C DO 20 NEL = 1, NUMEBA DO 30 I = 1, NNODES C C number of elements associated with each node - used for C computing an average later on C NELTN(ICONA(I,NEL)) = NELTN(ICONA(I,NEL)) + 1 30 CONTINUE 20 CONTINUE C DO 40 IVAR = 1, NVAREL IF (ITT(IVAR,iblk) .EQ. 0)GO TO 40 CALL EXGEV(NTP2EX,ISTP,IVAR,IDBLK,NUMEBA,SOLEA(1,IVAR),IERR) C IF (NAMVAR(nvargp+IVAR)(1:6) .EQ. 'ELMASS') THEN C C replace element mass with nodal density for interpolation C DO 50 IEL = 1, NUMEBA DO 60 I = 1, NNODES XX(I) = XA(ICONA(I,IEL)) YY(I) = YA(ICONA(I,IEL)) ZZ(I) = ZA(ICONA(I,IEL)) 60 CONTINUE CALL VOL(ITYPE,XX,YY,ZZ,VOLUME) SOLEA(IEL,IVAR) = SOLEA(IEL,IVAR) / VOLUME 50 CONTINUE END IF C C accumulate element variables to nodes C DO 70 NEL = 1, NUMEBA DO 80 I = 1, NNODES SOLENA(ICONA(I,NEL),IVAR) = & SOLENA(ICONA(I,NEL),IVAR) + SOLEA(NEL,IVAR) 80 CONTINUE 70 CONTINUE C C divide by number of elements contributing to each node (average) C DO 90 I = 1, NODESA IF(NELTN(I) .NE. 0)THEN SOLENA(I,IVAR) = SOLENA(I,IVAR) / float(NELTN(I)) END IF 90 CONTINUE 40 CONTINUE RETURN END
nschloe/seacas
packages/seacas/libraries/mapvarlib/seton0.f
FORTRAN
bsd-3-clause
5,382
<!-- Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file for details. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. --> <div *ngIf="pending" class="btn spinner"> <material-spinner></material-spinner> </div> <material-button #yesButton *ngIf="!pending && yesDisplayed" class="btn btn-yes" [autoFocus]="yesAutoFocus" [raised]="yesRaised || raised" [class.highlighted]="yesHighlighted" [disabled]="yesDisabled || disabled" [attr.aria-label]="yesAriaLabel" [attr.aria-describedby]="yesAriaDescribedBy" (trigger)="onYes($event)"> {{yesText}} </material-button> <material-button #noButton *ngIf="!pending && noDisplayed" class="btn btn-no" [autoFocus]="noAutoFocus" [raised]="raised" [disabled]="noDisabled || disabled" [attr.aria-label]="noAriaLabel" [attr.aria-describedby]="noAriaDescribedBy" (trigger)="onNo($event)"> {{noText}} </material-button>
angulardart/angular_components
angular_components/lib/material_yes_no_buttons/material_yes_no_buttons.html
HTML
bsd-3-clause
1,245
package de.uni.freiburg.iig.telematik.wolfgang.properties.check; import javax.swing.JPanel; import javax.swing.JPopupMenu; import de.invation.code.toval.graphic.component.DisplayFrame; import de.invation.code.toval.graphic.util.SpringUtilities; import de.uni.freiburg.iig.telematik.sepia.petrinet.cpn.properties.cwn.CWNProperties; import de.uni.freiburg.iig.telematik.sepia.petrinet.properties.PropertyCheckingResult; import javax.swing.SpringLayout; public class CWNPropertyCheckView extends AbstractPropertyCheckView<CWNProperties> { private static final long serialVersionUID = -950169446391727139L; private PropertyCheckResultLabel lblStructure; private PropertyCheckResultLabel lblInOutPlaces; private PropertyCheckResultLabel lblConnectedness; private PropertyCheckResultLabel lblValidMarking; private PropertyCheckResultLabel lblCFDependency; private PropertyCheckResultLabel lblNoDeadTransitions; private PropertyCheckResultLabel lblCompletion; private PropertyCheckResultLabel lblOptionComplete; private PropertyCheckResultLabel lblBounded; @Override protected String getHeadline() { return "Colored WF Net Check"; } @Override protected void addSpecificFields(JPanel pnl) { lblStructure = new PropertyCheckResultLabel("\u2022 CWN Structure", PropertyCheckingResult.UNKNOWN); pnl.add(lblStructure); JPanel pnlStructureSub = new JPanel(new SpringLayout()); pnl.add(pnlStructureSub); lblInOutPlaces = new PropertyCheckResultLabel("\u2022 Valid InOut Places", PropertyCheckingResult.UNKNOWN); pnlStructureSub.add(lblInOutPlaces); lblConnectedness = new PropertyCheckResultLabel("\u2022 Strong Connectedness", PropertyCheckingResult.UNKNOWN); pnlStructureSub.add(lblConnectedness); lblValidMarking = new PropertyCheckResultLabel("\u2022 Valid Initial Marking", PropertyCheckingResult.UNKNOWN); pnlStructureSub.add(lblValidMarking); lblCFDependency = new PropertyCheckResultLabel("\u2022 Control Flow Dependency", PropertyCheckingResult.UNKNOWN); pnlStructureSub.add(lblCFDependency); SpringUtilities.makeCompactGrid(pnlStructureSub, pnlStructureSub.getComponentCount(), 1, 15, 0, 0, 0); pnl.add(new JPopupMenu.Separator()); lblBounded = new PropertyCheckResultLabel("\u2022 Is Bounded", PropertyCheckingResult.UNKNOWN); pnl.add(lblBounded); pnl.add(new JPopupMenu.Separator()); lblOptionComplete = new PropertyCheckResultLabel("\u2022 Option To Complete", PropertyCheckingResult.UNKNOWN); pnl.add(lblOptionComplete); pnl.add(new JPopupMenu.Separator()); lblCompletion = new PropertyCheckResultLabel("\u2022 Proper Completion", PropertyCheckingResult.UNKNOWN); pnl.add(lblCompletion); pnl.add(new JPopupMenu.Separator()); lblNoDeadTransitions = new PropertyCheckResultLabel("\u2022 No Dead Transitions", PropertyCheckingResult.UNKNOWN); pnl.add(lblNoDeadTransitions); } @Override public void resetFieldContent() { super.updateFieldContent(null, null); lblStructure.updatePropertyCheckingResult(PropertyCheckingResult.UNKNOWN); lblInOutPlaces.updatePropertyCheckingResult(PropertyCheckingResult.UNKNOWN); lblConnectedness.updatePropertyCheckingResult(PropertyCheckingResult.UNKNOWN); lblValidMarking.updatePropertyCheckingResult(PropertyCheckingResult.UNKNOWN); lblCFDependency.updatePropertyCheckingResult(PropertyCheckingResult.UNKNOWN); lblBounded.updatePropertyCheckingResult(PropertyCheckingResult.UNKNOWN); lblOptionComplete.updatePropertyCheckingResult(PropertyCheckingResult.UNKNOWN); lblCompletion.updatePropertyCheckingResult(PropertyCheckingResult.UNKNOWN); lblNoDeadTransitions.updatePropertyCheckingResult(PropertyCheckingResult.UNKNOWN); } @Override public void updateFieldContent(CWNProperties checkResult, Exception exception) { super.updateFieldContent(checkResult, exception); lblStructure.updatePropertyCheckingResult(checkResult.hasCWNStructure); lblInOutPlaces.updatePropertyCheckingResult(checkResult.validInOutPlaces); lblConnectedness.updatePropertyCheckingResult(checkResult.strongConnectedness); lblValidMarking.updatePropertyCheckingResult(checkResult.validInitialMarking); lblCFDependency.updatePropertyCheckingResult(checkResult.controlFlowDependency); lblBounded.updatePropertyCheckingResult(checkResult.isBounded); lblOptionComplete.updatePropertyCheckingResult(checkResult.optionToCompleteAndProperCompletion); lblCompletion.updatePropertyCheckingResult(checkResult.optionToCompleteAndProperCompletion); lblNoDeadTransitions.updatePropertyCheckingResult(checkResult.noDeadTransitions); } public static void main(String[] args) { CWNPropertyCheckView view = new CWNPropertyCheckView(); view.setUpGui(); view.updateFieldContent(new CWNProperties(), null); new DisplayFrame(view, true); } }
iig-uni-freiburg/WOLFGANG
src/de/uni/freiburg/iig/telematik/wolfgang/properties/check/CWNPropertyCheckView.java
Java
bsd-3-clause
5,138
/* * Zorbage: an algebraic data hierarchy for use in numeric processing. * * Copyright (c) 2016-2021 Barry DeZonia All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this list * of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, this * list of conditions and the following disclaimer in the documentation and/or other * materials provided with the distribution. * * Neither the name of the <copyright holder> nor the names of its contributors may * be used to endorse or promote products derived from this software without specific * prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. */ package nom.bdezonia.zorbage.algorithm; import java.math.BigDecimal; import java.math.MathContext; import nom.bdezonia.zorbage.algebra.Addition; import nom.bdezonia.zorbage.algebra.Algebra; import nom.bdezonia.zorbage.algebra.Conjugate; import nom.bdezonia.zorbage.algebra.Invertible; import nom.bdezonia.zorbage.algebra.Multiplication; import nom.bdezonia.zorbage.algebra.RealConstants; import nom.bdezonia.zorbage.algebra.SetComplex; import nom.bdezonia.zorbage.algebra.Trigonometric; import nom.bdezonia.zorbage.algebra.Unity; import nom.bdezonia.zorbage.datasource.IndexedDataSource; /** * * @author Barry DeZonia * */ public class InvFFT { // do not instantiate private InvFFT() {} /** * * @param <T> * @param <U> * @param <V> * @param <W> * @param cmplxAlg * @param realAlg * @param a * @param b */ public static <T extends Algebra<T,U> & Addition<U> & Multiplication<U> & Conjugate<U>, U extends SetComplex<W>, V extends Algebra<V,W> & Trigonometric<W> & RealConstants<W> & Unity<W> & Multiplication<W> & Addition<W> & Invertible<W>, W> void compute(T cmplxAlg, V realAlg, IndexedDataSource<U> a,IndexedDataSource<U> b) { long aSize = a.size(); long bSize = b.size(); if (aSize != FFT.enclosingPowerOf2(aSize)) throw new IllegalArgumentException("input size is not a power of 2"); if (aSize != bSize) throw new IllegalArgumentException("output size does not match input size"); U one_over_n = cmplxAlg.construct((BigDecimal.ONE.divide(BigDecimal.valueOf(aSize), new MathContext(100))).toString()); nom.bdezonia.zorbage.algorithm.Conjugate.compute(cmplxAlg, a, b); FFT.compute(cmplxAlg, realAlg, b, b); nom.bdezonia.zorbage.algorithm.Conjugate.compute(cmplxAlg, b, b); Scale.compute(cmplxAlg, one_over_n, b, b); } }
bdezonia/zorbage
src/main/java/nom/bdezonia/zorbage/algorithm/InvFFT.java
Java
bsd-3-clause
3,423
import matplotlib.pyplot as plt import numpy as np import scalpplot from scalpplot import plot_scalp from positions import POS_10_5 from scipy import signal def plot_timeseries(frames, time=None, offset=None, color='k', linestyle='-'): frames = np.asarray(frames) if offset == None: offset = np.max(np.std(frames, axis=0)) * 3 if time == None: time = np.arange(frames.shape[0]) plt.plot(time, frames - np.mean(frames, axis=0) + np.arange(frames.shape[1]) * offset, color=color, ls=linestyle) def plot_scalpgrid(scalps, sensors, locs=POS_10_5, width=None, clim=None, cmap=None, titles=None): ''' Plots a grid with scalpplots. Scalps contains the different scalps in the rows, sensors contains the names for the columns of scalps, locs is a dict that maps the sensor-names to locations. Width determines the width of the grid that contains the plots. Cmap selects a colormap, for example plt.cm.RdBu_r is very useful for AUC-ROC plots. Clim is a list containing the minimim and maximum value mapped to a color. Titles is an optional list with titles for each subplot. Returns a list with subplots for further manipulation. ''' scalps = np.asarray(scalps) assert scalps.ndim == 2 nscalps = scalps.shape[0] subplots = [] if not width: width = int(min(8, np.ceil(np.sqrt(nscalps)))) height = int(np.ceil(nscalps/float(width))) if not clim: clim = [np.min(scalps), np.max(scalps)] plt.clf() for i in range(nscalps): subplots.append(plt.subplot(height, width, i + 1)) plot_scalp(scalps[i], sensors, locs, clim=clim, cmap=cmap) if titles: plt.title(titles[i]) # plot colorbar next to last scalp bb = plt.gca().get_position() plt.colorbar(cax=plt.axes([bb.xmax + bb.width/10, bb.ymin, bb.width/10, bb.height]), ticks=np.linspace(clim[0], clim[1], 5).round(2)) return subplots
breuderink/psychic
psychic/plots.py
Python
bsd-3-clause
1,878
package main import ( "encoding/json" "fmt" "log" "time" "github.com/boltdb/bolt" ) type Entry struct { Id string `json:"id"` Url string `json:"url"` Subreddit string `json:"subreddit"` } //InitDB initializes the BoltDB instance and loads in the database file. func InitDB() { var err error db, err = bolt.Open("data.db", 0600, &bolt.Options{Timeout: 1 * time.Second}) CheckErr(err, "InitDB() - Open Database", true) err = db.Update(func(tx *bolt.Tx) error { var err error _, err = tx.CreateBucketIfNotExists([]byte("to_handle")) if err != nil { return fmt.Errorf("create bucket: %s", err) } _, err = tx.CreateBucketIfNotExists([]byte("handled")) if err != nil { return fmt.Errorf("create bucket: %s", err) } _, err = tx.CreateBucketIfNotExists([]byte("credentials")) if err != nil { return fmt.Errorf("create bucket: %s", err) } return nil }) CheckErr(err, "InitDB() - Create Buckets", true) } //CloseDB closes the BoltDB database safely during the shutdown cleanup. func CloseDB() { fmt.Print("Closing database...") db.Close() fmt.Println("Done!") fmt.Println("Goodbye! <3") } //ReadCreds reads the credential bucket from BotlDB. func ReadCreds() { var user, pass []byte err := db.Update(func(tx *bolt.Tx) error { b := tx.Bucket([]byte("credentials")) u := b.Get([]byte("user")) p := b.Get([]byte("pass")) if u != nil && p != nil { user = make([]byte, len(u)) pass = make([]byte, len(p)) copy(user, u) copy(pass, p) } return nil }) CheckErr(err, "ReadCreds() - Read Database", true) username = string(user) password = string(pass) if username == "" || password == "" { log.Fatalln("Fatal Error: One or more stored credentials are missing, cannot continue without credentials!") } } //UpdateCreds takes the current credentials and inserts them into //the BoltDB database. func UpdateCreds(user, pass string) { err := db.Update(func(tx *bolt.Tx) error { b := tx.Bucket([]byte("credentials")) err := b.Put([]byte("user"), []byte(user)) if err != nil { return err } err = b.Put([]byte("pass"), []byte(pass)) return err }) CheckErr(err, "UpdateCreds() - Write Database", true) } //ClearCreds removes the stores credentials from the database. func ClearCreds() { err := db.Update(func(tx *bolt.Tx) error { err := tx.DeleteBucket([]byte("credentials")) if err != nil { return err } _, err = tx.CreateBucketIfNotExists([]byte("credentials")) return err }) CheckErr(err, "ClearCreds() - Delete Bucket", true) } //ClearDB removes all entires from the BotlDB database. func ClearDB() { ClearCreds() err := db.Update(func(tx *bolt.Tx) error { err := tx.DeleteBucket([]byte("to_handle")) if err != nil { return err } err = tx.DeleteBucket([]byte("handled")) if err != nil { return err } _, err = tx.CreateBucketIfNotExists([]byte("to_handle")) if err != nil { return err } _, err = tx.CreateBucketIfNotExists([]byte("handled")) return err }) CheckErr(err, "ClearDB() - Delete Bucket", true) } //KeyExists checks if a given key exists within the given BoltDB bucket. func KeyExists(id, bucket string) bool { exists := false err := db.View(func(tx *bolt.Tx) error { b := tx.Bucket([]byte(bucket)) v := b.Get([]byte(id)) exists = v != nil return nil }) CheckErr(err, "KeyExists() - Read Database", true) return exists } //HandleLater takes the id (reddit thing_id) of a submission that the //bot has determined to be offending, and adds it to the bucket of //posts to be handled in the future. func HandleLater(entry Entry) { bytes, err := json.Marshal(entry) if !CheckErr(err, "HandleLater() - Marshal JSON", false) { err := db.Update(func(tx *bolt.Tx) error { b := tx.Bucket([]byte("to_handle")) err := b.Put([]byte(entry.Id), bytes) return err }) CheckErr(err, "HandleLater() - Add ID", true) } } //AddToHandled adds the id (reddit thing_id) to the BoltDB handled bucket. func AddToHandled(id string) { err := db.Update(func(tx *bolt.Tx) error { b := tx.Bucket([]byte("handled")) err := b.Put([]byte(id), []byte("")) return err }) CheckErr(err, "AddToHandled() - Add 'handled' ID", true) err = db.Update(func(tx *bolt.Tx) error { b := tx.Bucket([]byte("to_handle")) err := b.Delete([]byte(id)) return err }) CheckErr(err, "AddToHandled() - Delete 'to_handle' ID", true) } func FetchFromQueue() *Entry { var val []byte needhandle := false err := db.Update(func(tx *bolt.Tx) error { b := tx.Bucket([]byte("to_handle")) c := b.Cursor() k, v := c.First() if k != nil { needhandle = true val = make([]byte, len(v)) copy(val, v) } return nil }) CheckErr(err, "FetchFromQueue() - Read Database", true) if needhandle { log.Printf("Handling one post: %s\n", val) entry := &Entry{} json.Unmarshal(val, entry) return entry } return nil } //PrintList reads all of the data from the specified BoltDB bucket //and lists it out to the console. func PrintList(bucket string) { db.View(func(tx *bolt.Tx) error { b := tx.Bucket([]byte(bucket)) c := b.Cursor() for k, v := c.First(); k != nil; k, v = c.Next() { fmt.Printf("key=%s, value=%s\n", k, v) } return nil }) }
Term1nal/gifvbot
db.go
GO
bsd-3-clause
5,499
@import url(http://fonts.useso.com/css?family=Raleway:200,500,700,800); @font-face { font-family: 'icomoon'; src:url('../fonts/icomoon.eot?yrquyl'); src:url('../fonts/icomoon.eot?#iefixyrquyl') format('embedded-opentype'), url('../fonts/icomoon.woff?yrquyl') format('woff'), url('../fonts/icomoon.ttf?yrquyl') format('truetype'), url('../fonts/icomoon.svg?yrquyl#icomoon') format('svg'); font-weight: normal; font-style: normal; } [class^="icon-"], [class*=" icon-"] { font-family: 'icomoon'; speak: none; font-style: normal; font-weight: normal; font-variant: normal; text-transform: none; line-height: 1; /* Better Font Rendering =========== */ -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } body, html { font-size: 100%; padding: 0; margin: 0;} /* Reset */ *, *:after, *:before { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } /* Clearfix hack by Nicolas Gallagher: http://nicolasgallagher.com/micro-clearfix-hack/ */ .clearfix:before, .clearfix:after { content: " "; display: table; } .clearfix:after { clear: both; } body{ background: #f9f7f6; color: #404d5b; font-weight: 500; font-size: 1.05em; font-family: "Segoe UI", "Lucida Grande", Helvetica, Arial, "Microsoft YaHei", FreeSans, Arimo, "Droid Sans", "wenquanyi micro hei", "Hiragino Sans GB", "Hiragino Sans GB W3", "FontAwesome", sans-serif; } a{color: #2fa0ec;text-decoration: none;outline: none;} a:hover,a:focus{color:#74777b;}; .htmleaf-container{ margin: 0 auto; text-align: center; overflow: hidden; } .htmleaf-content { font-size: 150%; padding: 3em 0; } .htmleaf-content h2 { margin: 0 0 2em; opacity: 0.1; } .htmleaf-content p { margin: 1em 0; padding: 5em 0 0 0; font-size: 0.65em; } .bgcolor-1 { background: #f0efee; } .bgcolor-2 { background: #f9f9f9; } .bgcolor-3 { background: #e8e8e8; }/*light grey*/ .bgcolor-4 { background: #2f3238; color: #fff; }/*Dark grey*/ .bgcolor-5 { background: #df6659; color: #521e18; }/*pink1*/ .bgcolor-6 { background: #2fa8ec; }/*sky blue*/ .bgcolor-7 { background: #d0d6d6; }/*White tea*/ .bgcolor-8 { background: #3d4444; color: #fff; }/*Dark grey2*/ .bgcolor-9 { background: #ef3f52; color: #fff;}/*pink2*/ .bgcolor-10{ background: #64448f; color: #fff;}/*Violet*/ .bgcolor-11{ background: #3755ad; color: #fff;}/*dark blue*/ .bgcolor-12{ background: #3498DB; color: #fff;}/*light blue*/ /* Header */ .htmleaf-header{ padding: 3em 190px 4em; letter-spacing: -1px; text-align: center; } .htmleaf-header h1 { font-weight: 600; font-size: 2em; line-height: 1; margin-bottom: 0; /*text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);*/ } .htmleaf-header h1 span { font-family: "Segoe UI", "Lucida Grande", Helvetica, Arial, "Microsoft YaHei", FreeSans, Arimo, "Droid Sans", "wenquanyi micro hei", "Hiragino Sans GB", "Hiragino Sans GB W3", "FontAwesome", sans-serif; display: block; font-size: 60%; font-weight: 400; padding: 0.8em 0 0.5em 0; color: #c3c8cd; } /*nav*/ .htmleaf-demo a{color: #1d7db1;text-decoration: none;} .htmleaf-demo{width: 100%;padding-bottom: 1.2em;} .htmleaf-demo a{display: inline-block;margin: 0.5em;padding: 0.6em 1em;border: 3px solid #1d7db1;font-weight: 700;} .htmleaf-demo a:hover{opacity: 0.6;} .htmleaf-demo a.current{background:#1d7db1;color: #fff; } /* Top Navigation Style */ .htmleaf-links { position: relative; display: inline-block; white-space: nowrap; font-size: 1.5em; text-align: center; } .htmleaf-links::after { position: absolute; top: 0; left: 50%; margin-left: -1px; width: 2px; height: 100%; background: #dbdbdb; content: ''; -webkit-transform: rotate3d(0,0,1,22.5deg); transform: rotate3d(0,0,1,22.5deg); } .htmleaf-icon { display: inline-block; margin: 0.5em; padding: 0em 0; width: 1.5em; text-decoration: none; } .htmleaf-icon span { display: none; } .htmleaf-icon:before { margin: 0 5px; text-transform: none; font-weight: normal; font-style: normal; font-variant: normal; font-family: 'icomoon'; line-height: 1; speak: none; -webkit-font-smoothing: antialiased; } /* footer */ .htmleaf-footer{width: 100%;padding-top: 10px;} .htmleaf-small{font-size: 0.8em;} .center{text-align: center;} /* icomoon */ .icon-home:before { content: "\e600"; } .icon-pacman:before { content: "\e623"; } .icon-users2:before { content: "\e678"; } .icon-bug:before { content: "\e699"; } .icon-eye:before { content: "\e610"; } .icon-eye-blocked:before { content: "\e611"; } .icon-eye2:before { content: "\e612"; } .icon-arrow-up-left3:before { content: "\e72f"; } .icon-arrow-up3:before { content: "\e730"; } .icon-arrow-up-right3:before { content: "\e731"; } .icon-arrow-right3:before { content: "\e732"; } .icon-arrow-down-right3:before { content: "\e733"; } .icon-arrow-down3:before { content: "\e734"; } .icon-arrow-down-left3:before { content: "\e735"; } .icon-arrow-left3:before { content: "\e736"; } @media screen and (max-width: 50em) { .htmleaf-header { padding: 3em 10% 4em; } .htmleaf-header h1 { font-size:2em; } } @media screen and (max-width: 40em) { .htmleaf-header h1 { font-size: 1.5em; } } @media screen and (max-width: 30em) { .htmleaf-header h1 { font-size:1.2em; } }
smartMao/Library-Management-System
web/css/dropDownGlobal/default.css
CSS
bsd-3-clause
5,505
package eu.monnetproject.sim.entity; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Properties; import eu.monnetproject.util.Logger; import eu.monnetproject.label.LabelExtractor; import eu.monnetproject.label.LabelExtractorFactory; import eu.monnetproject.lang.Language; import eu.monnetproject.ontology.Entity; import eu.monnetproject.sim.EntitySimilarityMeasure; import eu.monnetproject.sim.StringSimilarityMeasure; import eu.monnetproject.sim.string.Levenshtein; import eu.monnetproject.sim.token.TokenBagOfWordsCosine; import eu.monnetproject.sim.util.Functions; import eu.monnetproject.sim.util.SimilarityUtils; import eu.monnetproject.tokenizer.FairlyGoodTokenizer; import eu.monnetproject.translatorimpl.Translator; import eu.monnetproject.util.Logging; /** * Levenshtein similarity. * Intralingual aggregation: average * Interlingual aggregation: maximum * * @author Dennis Spohr * */ public class MaximumAverageLevenshtein implements EntitySimilarityMeasure { private Logger log = Logging.getLogger(this); private final String name = this.getClass().getName(); private LabelExtractorFactory lef; private LabelExtractor lex = null; private Collection<Language> languages = Collections.emptySet(); private StringSimilarityMeasure measure; private boolean includePuns = false; private Translator translator; public MaximumAverageLevenshtein(LabelExtractorFactory lef) { this.lef = lef; this.measure = new Levenshtein(); this.translator = new Translator(); } public void configure(Properties properties) { this.languages = SimilarityUtils.getLanguages(properties.getProperty("languages", "")); for (Language lang : this.languages) { log.info("Requested language: "+lang); } this.includePuns = SimilarityUtils.getIncludePuns(properties.getProperty("include_puns", "false")); } @Override public double getScore(Entity srcEntity, Entity tgtEntity) { if (this.lex == null) { this.lex = this.lef.getExtractor(SimilarityUtils.determineLabelProperties(srcEntity, tgtEntity), true, false); } if (this.languages.size() < 1) { log.warning("No languages specified in config file."); this.languages = SimilarityUtils.determineLanguages(srcEntity, tgtEntity); String langs = ""; for (Language lang : languages) { langs += lang.getName()+", "; } try { log.warning("Using "+langs.substring(0, langs.lastIndexOf(","))+"."); } catch (Exception e) { log.severe("No languages in source and target ontology."); } } Map<Language, Collection<String>> srcMap = null; Map<Language, Collection<String>> tgtMap = null; if (includePuns) { srcMap = SimilarityUtils.getLabelsIncludingPuns(srcEntity,lex); tgtMap = SimilarityUtils.getLabelsIncludingPuns(tgtEntity,lex); } else { srcMap = SimilarityUtils.getLabelsExcludingPuns(srcEntity,lex); tgtMap = SimilarityUtils.getLabelsExcludingPuns(tgtEntity,lex); } List<Double> intralingualScores = new ArrayList<Double>(); for (Language language : this.languages) { Collection<String> srcLabels = srcMap.get(language); Collection<String> tgtLabels = tgtMap.get(language); if (srcLabels == null) { if (translator == null) { log.warning("Can't match in "+language+" because "+srcEntity.getURI()+" has no labels in "+language+" and no translator is available."); continue; } srcLabels = SimilarityUtils.getTranslatedLabels(srcEntity,language,translator,lex); } if (tgtLabels == null) { if (translator == null) { log.warning("Can't match in "+language+" because "+tgtEntity.getURI()+" has no labels in "+language+" and no translator is available."); continue; } tgtLabels = SimilarityUtils.getTranslatedLabels(tgtEntity,language,translator,lex); } double[] scores = new double[srcLabels.size()*tgtLabels.size()]; int index = 0; for (String srcLabel : srcLabels) { for (String tgtLabel : tgtLabels) { scores[index++] = measure.getScore(srcLabel, tgtLabel); } } intralingualScores.add(Functions.mean(scores)); } if (intralingualScores.size() < 1) return 0.; double[] intralingualScoresArray = new double[intralingualScores.size()]; for (int i = 0; i < intralingualScores.size(); i++) { intralingualScoresArray[i] = intralingualScores.get(i); } return Functions.max(intralingualScoresArray); } @Override public String getName() { return this.name; } }
monnetproject/coal
nlp.sim/src/main/java/eu/monnetproject/sim/entity/MaximumAverageLevenshtein.java
Java
bsd-3-clause
4,639
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="robots" content="all,follow"> <meta name="googlebot" content="index,follow,snippet,archive"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Universal - All In 1 Template</title> <meta name="keywords" content=""> <link href='http://fonts.googleapis.com/css?family=Roboto:400,100,100italic,300,300italic,500,700,800' rel='stylesheet' type='text/css'> <!-- Bootstrap and Font Awesome css --> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css"> <!-- Css animations --> <link href="css/animate.css" rel="stylesheet"> <!-- Theme stylesheet, if possible do not edit this stylesheet --> <link href="css/style.default.css" rel="stylesheet" id="theme-stylesheet"> <!-- Custom stylesheet - for your changes --> <link href="css/custom.css" rel="stylesheet"> <!-- Responsivity for older IE --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> <!-- Favicon and apple touch icons--> <link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon" /> <link rel="apple-touch-icon" href="img/apple-touch-icon.png" /> <link rel="apple-touch-icon" sizes="57x57" href="img/apple-touch-icon-57x57.png" /> <link rel="apple-touch-icon" sizes="72x72" href="img/apple-touch-icon-72x72.png" /> <link rel="apple-touch-icon" sizes="76x76" href="img/apple-touch-icon-76x76.png" /> <link rel="apple-touch-icon" sizes="114x114" href="img/apple-touch-icon-114x114.png" /> <link rel="apple-touch-icon" sizes="120x120" href="img/apple-touch-icon-120x120.png" /> <link rel="apple-touch-icon" sizes="144x144" href="img/apple-touch-icon-144x144.png" /> <link rel="apple-touch-icon" sizes="152x152" href="img/apple-touch-icon-152x152.png" /> <!-- owl carousel css --> <link href="css/owl.carousel.css" rel="stylesheet"> <link href="css/owl.theme.css" rel="stylesheet"> </head> <body> <div id="all"> <header> <!-- *** TOP *** _________________________________________________________ --> <div id="top"> <div class="container"> <div class="row"> <div class="col-xs-5 contact"> <p class="hidden-sm hidden-xs">Contact us on +420 777 555 333 or [email protected].</p> <p class="hidden-md hidden-lg"><a href="#" data-animate-hover="pulse"><i class="fa fa-phone"></i></a> <a href="#" data-animate-hover="pulse"><i class="fa fa-envelope"></i></a> </p> </div> <div class="col-xs-7"> <div class="social"> <a href="#" class="external facebook" data-animate-hover="pulse"><i class="fa fa-facebook"></i></a> <a href="#" class="external gplus" data-animate-hover="pulse"><i class="fa fa-google-plus"></i></a> <a href="#" class="external twitter" data-animate-hover="pulse"><i class="fa fa-twitter"></i></a> <a href="#" class="email" data-animate-hover="pulse"><i class="fa fa-envelope"></i></a> </div> <div class="login"> <a href="#" data-toggle="modal" data-target="#login-modal"><i class="fa fa-sign-in"></i> <span class="hidden-xs text-uppercase">Sign in</span></a> <a href="customer-register.html"><i class="fa fa-user"></i> <span class="hidden-xs text-uppercase">Sign up</span></a> </div> </div> </div> </div> </div> <!-- *** TOP END *** --> <!-- *** NAVBAR *** _________________________________________________________ --> <div class="navbar-affixed-top" data-spy="affix" data-offset-top="200"> <div class="navbar navbar-default yamm" role="navigation" id="navbar"> <div class="container"> <div class="navbar-header"> <a class="navbar-brand home" href="index.html"> <img src="img/logo.png" alt="Universal logo" class="hidden-xs hidden-sm"> <img src="img/logo-small.png" alt="Universal logo" class="visible-xs visible-sm"><span class="sr-only">Universal - go to homepage</span> </a> <div class="navbar-buttons"> <button type="button" class="navbar-toggle btn-template-main" data-toggle="collapse" data-target="#navigation"> <span class="sr-only">Toggle navigation</span> <i class="fa fa-align-justify"></i> </button> </div> </div> <!--/.navbar-header --> <div class="navbar-collapse collapse" id="navigation"> <ul class="nav navbar-nav navbar-right"> <li class="dropdown active"> <a href="javascript: void(0)" class="dropdown-toggle" data-toggle="dropdown">Home <b class="caret"></b></a> <ul class="dropdown-menu"> <li><a href="index.html">Option 1: Default Page</a> </li> <li><a href="index2.html">Option 2: Application</a> </li> <li><a href="index3.html">Option 3: Startup</a> </li> <li><a href="index4.html">Option 4: Agency</a> </li> <li><a href="index5.html">Option 5: Portfolio</a> </li> </ul> </li> <li class="dropdown use-yamm yamm-fw"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Features<b class="caret"></b></a> <ul class="dropdown-menu"> <li> <div class="yamm-content"> <div class="row"> <div class="col-sm-6"> <img src="img/template-easy-customize.png" class="img-responsive hidden-xs" alt=""> </div> <div class="col-sm-3"> <h5>Shortcodes</h5> <ul> <li><a href="template-accordions.html">Accordions</a> </li> <li><a href="template-alerts.html">Alerts</a> </li> <li><a href="template-buttons.html">Buttons</a> </li> <li><a href="template-content-boxes.html">Content boxes</a> </li> <li><a href="template-blocks.html">Horizontal blocks</a> </li> <li><a href="template-pagination.html">Pagination</a> </li> <li><a href="template-tabs.html">Tabs</a> </li> <li><a href="template-typography.html">Typography</a> </li> </ul> </div> <div class="col-sm-3"> <h5>Header variations</h5> <ul> <li><a href="template-header-default.html">Default sticky header</a> </li> <li><a href="template-header-nosticky.html">No sticky header</a> </li> <li><a href="template-header-light.html">Light header</a> </li> </ul> </div> </div> </div> </li> </ul> </li> <li class="dropdown use-yamm yamm-fw"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Portfolio <b class="caret"></b></a> <ul class="dropdown-menu"> <li> <div class="yamm-content"> <div class="row"> <div class="col-sm-6"> <img src="img/template-homepage.png" class="img-responsive hidden-xs" alt=""> </div> <div class="col-sm-3"> <h5>Portfolio</h5> <ul> <li><a href="portfolio-2.html">2 columns</a> </li> <li><a href="portfolio-no-space-2.html">2 columns with negative space</a> </li> <li><a href="portfolio-3.html">3 columns</a> </li> <li><a href="portfolio-no-space-3.html">3 columns with negative space</a> </li> <li><a href="portfolio-4.html">4 columns</a> </li> <li><a href="portfolio-no-space-4.html">4 columns with negative space</a> </li> <li><a href="portfolio-detail.html">Portfolio - detail</a> </li> <li><a href="portfolio-detail-2.html">Portfolio - detail 2</a> </li> </ul> </div> <div class="col-sm-3"> <h5>About</h5> <ul> <li><a href="about.html">About us</a> </li> <li><a href="team.html">Our team</a> </li> <li><a href="team-member.html">Team member</a> </li> <li><a href="services.html">Services</a> </li> </ul> <h5>Marketing</h5> <ul> <li><a href="packages.html">Packages</a> </li> </ul> </div> </div> </div> </li> </ul> </li> <!-- ========== FULL WIDTH MEGAMENU ================== --> <li class="dropdown use-yamm yamm-fw"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-delay="200">All Pages <b class="caret"></b></a> <ul class="dropdown-menu"> <li> <div class="yamm-content"> <div class="row"> <div class="col-sm-3"> <h5>Home</h5> <ul> <li><a href="index.html">Option 1: Default Page</a> </li> <li><a href="index2.html">Option 2: Application</a> </li> <li><a href="index3.html">Option 3: Startup</a> </li> <li><a href="index4.html">Option 4: Agency</a> </li> <li><a href="index5.html">Option 5: Portfolio</a> </li> </ul> <h5>About</h5> <ul> <li><a href="about.html">About us</a> </li> <li><a href="team.html">Our team</a> </li> <li><a href="team-member.html">Team member</a> </li> <li><a href="services.html">Services</a> </li> </ul> <h5>Marketing</h5> <ul> <li><a href="packages.html">Packages</a> </li> </ul> </div> <div class="col-sm-3"> <h5>Portfolio</h5> <ul> <li><a href="portfolio-2.html">2 columns</a> </li> <li><a href="portfolio-no-space-2.html">2 columns with negative space</a> </li> <li><a href="portfolio-3.html">3 columns</a> </li> <li><a href="portfolio-no-space-3.html">3 columns with negative space</a> </li> <li><a href="portfolio-4.html">4 columns</a> </li> <li><a href="portfolio-no-space-4.html">4 columns with negative space</a> </li> <li><a href="portfolio-detail.html">Portfolio - detail</a> </li> <li><a href="portfolio-detail-2.html">Portfolio - detail 2</a> </li> </ul> <h5>User pages</h5> <ul> <li><a href="customer-register.html">Register / login</a> </li> <li><a href="customer-orders.html">Orders history</a> </li> <li><a href="customer-order.html">Order history detail</a> </li> <li><a href="customer-wishlist.html">Wishlist</a> </li> <li><a href="customer-account.html">Customer account / change password</a> </li> </ul> </div> <div class="col-sm-3"> <h5>Shop</h5> <ul> <li><a href="shop-category.html">Category - sidebar right</a> </li> <li><a href="shop-category-left.html">Category - sidebar left</a> </li> <li><a href="shop-category-full.html">Category - full width</a> </li> <li><a href="shop-detail.html">Product detail</a> </li> </ul> <h5>Shop - order process</h5> <ul> <li><a href="shop-basket.html">Shopping cart</a> </li> <li><a href="shop-checkout1.html">Checkout - step 1</a> </li> <li><a href="shop-checkout2.html">Checkout - step 2</a> </li> <li><a href="shop-checkout3.html">Checkout - step 3</a> </li> <li><a href="shop-checkout4.html">Checkout - step 4</a> </li> </ul> </div> <div class="col-sm-3"> <h5>Contact</h5> <ul> <li><a href="contact.html">Contact</a> </li> <li><a href="contact2.html">Contact - version 2</a> </li> <li><a href="contact3.html">Contact - version 3</a> </li> </ul> <h5>Pages</h5> <ul> <li><a href="text.html">Text page</a> </li> <li><a href="text-left.html">Text page - left sidebar</a> </li> <li><a href="text-full.html">Text page - full width</a> </li> <li><a href="faq.html">FAQ</a> </li> <li><a href="404.html">404 page</a> </li> </ul> <h5>Blog</h5> <ul> <li><a href="blog.html">Blog listing big</a> </li> <li><a href="blog-medium.html">Blog listing medium</a> </li> <li><a href="blog-small.html">Blog listing small</a> </li> <li><a href="blog-post.html">Blog Post</a> </li> </ul> </div> </div> </div> <!-- /.yamm-content --> </li> </ul> </li> <!-- ========== FULL WIDTH MEGAMENU END ================== --> <li class="dropdown"> <a href="javascript: void(0)" class="dropdown-toggle" data-toggle="dropdown">Contact <b class="caret"></b></a> <ul class="dropdown-menu"> <li><a href="contact.html">Contact option 1</a> </li> <li><a href="contact2.html">Contact option 2</a> </li> <li><a href="contact3.html">Contact option 3</a> </li> </ul> </li> </ul> </div> <!--/.nav-collapse --> <div class="collapse clearfix" id="search"> <form class="navbar-form" role="search"> <div class="input-group"> <input type="text" class="form-control" placeholder="Search"> <span class="input-group-btn"> <button type="submit" class="btn btn-template-main"><i class="fa fa-search"></i></button> </span> </div> </form> </div> <!--/.nav-collapse --> </div> </div> <!-- /#navbar --> </div> <!-- *** NAVBAR END *** --> </header> <!-- *** LOGIN MODAL *** _________________________________________________________ --> <div class="modal fade" id="login-modal" tabindex="-1" role="dialog" aria-labelledby="Login" aria-hidden="true"> <div class="modal-dialog modal-sm"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> <h4 class="modal-title" id="Login">Customer login</h4> </div> <div class="modal-body"> <form action="customer-orders.html" method="post"> <div class="form-group"> <input type="text" class="form-control" id="email_modal" placeholder="email"> </div> <div class="form-group"> <input type="password" class="form-control" id="password_modal" placeholder="password"> </div> <p class="text-center"> <button class="btn btn-template-main"><i class="fa fa-sign-in"></i> Log in</button> </p> </form> <p class="text-center text-muted">Not registered yet?</p> <p class="text-center text-muted"><a href="customer-register.html"><strong>Register now</strong></a>! It is easy and done in 1&nbsp;minute and gives you access to special discounts and much more!</p> </div> </div> </div> </div> <!-- *** LOGIN MODAL END *** --> <div id="heading-breadcrumbs"> <div class="container"> <div class="row"> <div class="col-md-7"> <h1>Portfolio item detail</h1> </div> <div class="col-md-5"> <ul class="breadcrumb"> <li><a href="index.html">Home</a> </li> <li><a href="portfolio-2.html">Portfolio</a> </li> <li>Portfolio item detail</li> </ul> </div> </div> </div> </div> <div id="content"> <div class="container"> <section class="no-mb"> <div class="row"> <div class="col-md-12"> <p class="lead">Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p> </div> </div> </section> <section> <div class="project owl-carousel"> <div class="item"> <img src="img/main-slider1.jpg" alt="" class="img-responsive"> </div> <div class="item"> <img class="img-responsive" src="img/main-slider2.jpg" alt=""> </div> <div class="item"> <img class="img-responsive" src="img/main-slider3.jpg" alt=""> </div> <div class="item"> <img class="img-responsive" src="img/main-slider4.jpg" alt=""> </div> </div> <!-- /.project owl-slider --> </section> <section> <div class="row portfolio-project"> <div class="col-md-8"> <div class="heading"> <h3>Project description</h3> </div> <p>Bringing unlocked me an striking ye perceive. Mr by wound hours oh happy. Me in resolution pianoforte continuing we. Most my no spot felt by no. He he in forfeited furniture sweetness he arranging. Me tedious so to behaved written account ferrars moments. Too objection for elsewhere her preferred allowance her. Marianne shutters mr steepest to me. Up mr ignorant produced distance although is sociable blessing. Ham whom call all lain like.</p> <p>To sorry world an at do spoil along. Incommode he depending do frankness remainder to. Edward day almost active him friend thirty piqued. People as period twenty my extent as. Set was better abroad ham plenty secure had horses. Admiration has sir decisively excellence say everything inhabiting acceptance. Sooner settle add put you sudden him.</p> </div> <div class="col-md-4 project-more"> <div class="heading"> <h3>More</h3> </div> <h4>Client</h4> <p>Pietro Filippi</p> <h4>Services</h4> <p>Consulting, Webdesign, Print</p> <h4>Technologies</h4> <p>PHP, HipHop, Break-dance</p> <h4>Dates</h4> <p>10/2013 - 06/2014</p> </div> </div> </section> <section> <div class="row portfolio"> <div class="col-md-12"> <div class="heading"> <h3>Related projects</h3> </div> </div> <div class="col-sm-6 col-md-3"> <div class="box-image"> <div class="image"> <img src="img/portfolio-1.jpg" alt="" class="img-responsive"> </div> <div class="bg"></div> <div class="name"> <h3><a href="portfolio-detail.html">Portfolio box-image</a></h3> </div> <div class="text"> <p class="buttons"> <a href="portfolio-detail.html" class="btn btn-template-transparent-primary">View</a> <a href="#" class="btn btn-template-transparent-primary">Website</a> </p> </div> </div> <!-- /.box-image --> </div> <div class="col-sm-6 col-md-3"> <div class="box-image"> <div class="image"> <img src="img/portfolio-2.jpg" alt="" class="img-responsive"> </div> <div class="bg"></div> <div class="name"> <h3><a href="portfolio-detail.html">Portfolio box-image</a></h3> </div> <div class="text"> <p class="buttons"> <a href="portfolio-detail.html" class="btn btn-template-transparent-primary">View</a> <a href="#" class="btn btn-template-transparent-primary">Website</a> </p> </div> </div> <!-- /.box-image --> </div> <div class="col-sm-6 col-md-3"> <div class="box-image"> <div class="image"> <img src="img/portfolio-3.jpg" alt="" class="img-responsive"> </div> <div class="bg"></div> <div class="name"> <h3><a href="portfolio-detail.html">Portfolio box-image</a></h3> </div> <div class="text"> <p class="buttons"> <a href="portfolio-detail.html" class="btn btn-template-transparent-primary">View</a> <a href="#" class="btn btn-template-transparent-primary">Website</a> </p> </div> </div> <!-- /.box-image --> </div> <div class="col-sm-6 col-md-3"> <div class="box-image"> <div class="image"> <img src="img/portfolio-4.jpg" alt="" class="img-responsive"> </div> <div class="bg"></div> <div class="name"> <h3><a href="portfolio-detail.html">Portfolio box-image</a></h3> </div> <div class="text"> <p class="buttons"> <a href="portfolio-detail.html" class="btn btn-template-transparent-primary">View</a> <a href="#" class="btn btn-template-transparent-primary">Website</a> </p> </div> </div> <!-- /.box-image --> </div> </div> </section> </div> <!-- /.container --> </div> <!-- /#content --> <!-- *** GET IT *** _________________________________________________________ --> <div id="get-it"> <div class="container"> <div class="col-md-8 col-sm-12"> <h3>Do you want cool website like this one?</h3> </div> <div class="col-md-4 col-sm-12"> <a href="#" class="btn btn-template-transparent-primary">Buy this template now</a> </div> </div> </div> <!-- *** GET IT END *** --> <!-- *** FOOTER *** _________________________________________________________ --> <footer id="footer"> <div class="container"> <div class="col-md-3 col-sm-6"> <h4>About us</h4> <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p> <hr> <h4>Join our monthly newsletter</h4> <form> <div class="input-group"> <input type="text" class="form-control"> <span class="input-group-btn"> <button class="btn btn-default" type="button"><i class="fa fa-send"></i></button> </span> </div> <!-- /input-group --> </form> <hr class="hidden-md hidden-lg hidden-sm"> </div> <!-- /.col-md-3 --> <div class="col-md-3 col-sm-6"> <h4>Blog</h4> <div class="blog-entries"> <div class="item same-height-row clearfix"> <div class="image same-height-always"> <a href="#"> <img class="img-responsive" src="img/detailsquare.jpg" alt=""> </a> </div> <div class="name same-height-always"> <h5><a href="#">Blog post name</a></h5> </div> </div> <div class="item same-height-row clearfix"> <div class="image same-height-always"> <a href="#"> <img class="img-responsive" src="img/detailsquare.jpg" alt=""> </a> </div> <div class="name same-height-always"> <h5><a href="#">Blog post name</a></h5> </div> </div> <div class="item same-height-row clearfix"> <div class="image same-height-always"> <a href="#"> <img class="img-responsive" src="img/detailsquare.jpg" alt=""> </a> </div> <div class="name same-height-always"> <h5><a href="#">Very very long blog post name</a></h5> </div> </div> </div> <hr class="hidden-md hidden-lg"> </div> <!-- /.col-md-3 --> <div class="col-md-3 col-sm-6"> <h4>Contact</h4> <p><strong>Universal Ltd.</strong> <br>13/25 New Avenue <br>Newtown upon River <br>45Y 73J <br>England <br> <strong>Great Britain</strong> </p> <a href="contact.html" class="btn btn-small btn-template-main">Go to contact page</a> <hr class="hidden-md hidden-lg hidden-sm"> </div> <!-- /.col-md-3 --> <div class="col-md-3 col-sm-6"> <h4>Photostream</h4> <div class="photostream"> <div> <a href="#"> <img src="img/detailsquare.jpg" class="img-responsive" alt="#"> </a> </div> <div> <a href="#"> <img src="img/detailsquare2.jpg" class="img-responsive" alt="#"> </a> </div> <div> <a href="#"> <img src="img/detailsquare3.jpg" class="img-responsive" alt="#"> </a> </div> <div> <a href="#"> <img src="img/detailsquare3.jpg" class="img-responsive" alt="#"> </a> </div> <div> <a href="#"> <img src="img/detailsquare2.jpg" class="img-responsive" alt="#"> </a> </div> <div> <a href="#"> <img src="img/detailsquare.jpg" class="img-responsive" alt="#"> </a> </div> </div> </div> <!-- /.col-md-3 --> </div> <!-- /.container --> </footer> <!-- /#footer --> <!-- *** FOOTER END *** --> <!-- *** COPYRIGHT *** _________________________________________________________ --> <div id="copyright"> <div class="container"> <div class="col-md-12"> <p class="pull-left">&copy; 2015. Your company / name goes here</p> <p class="pull-right">Template by <a href="http://www.bootstrapious.com">Bootstrap Templates</a> with support from <a href="http://kakusei.cz">Věci do vašeho domova</a> <!-- Not removing these links is part of the licence conditions of the template. Thanks for understanding :) --> </p> </div> </div> </div> <!-- /#copyright --> <!-- *** COPYRIGHT END *** --> </div> <!-- /#all --> <!-- #### JAVASCRIPT FILES ### --> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <script> window.jQuery || document.write('<script src="js/jquery-1.11.0.min.js"><\/script>') </script> <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script> <script src="js/jquery.cookie.js"></script> <script src="js/waypoints.min.js"></script> <script src="js/jquery.counterup.min.js"></script> <script src="js/jquery.parallax-1.1.3.js"></script> <script src="js/front.js"></script> <!-- owl carousel --> <script src="js/owl.carousel.min.js"></script> </body> </html>
manachyn/imshop
themes/imshop/vendors/universal/portfolio-detail.html
HTML
bsd-3-clause
45,512
/* -- MAGMA (version 1.5.0-beta3) -- Univ. of Tennessee, Knoxville Univ. of California, Berkeley Univ. of Colorado, Denver @date July 2014 @generated from zgels_gpu.cpp normal z -> d, Fri Jul 18 17:34:16 2014 */ #include "common_magma.h" /** Purpose ------- Solves the overdetermined, least squares problem min || A*X - C || using the QR factorization A. The underdetermined problem (m < n) is not currently handled. Arguments --------- @param[in] trans magma_trans_t - = MagmaNoTrans: the linear system involves A. Only TRANS=MagmaNoTrans is currently handled. @param[in] m INTEGER The number of rows of the matrix A. M >= 0. @param[in] n INTEGER The number of columns of the matrix A. M >= N >= 0. @param[in] nrhs INTEGER The number of columns of the matrix C. NRHS >= 0. @param[in,out] dA DOUBLE_PRECISION array on the GPU, dimension (LDA,N) On entry, the M-by-N matrix A. On exit, A is overwritten by details of its QR factorization as returned by DGEQRF. @param[in] ldda INTEGER The leading dimension of the array A, LDDA >= M. @param[in,out] dB DOUBLE_PRECISION array on the GPU, dimension (LDDB,NRHS) On entry, the M-by-NRHS matrix C. On exit, the N-by-NRHS solution matrix X. @param[in] lddb INTEGER The leading dimension of the array dB. LDDB >= M. @param[out] hwork (workspace) DOUBLE_PRECISION array, dimension MAX(1,LWORK). On exit, if INFO = 0, HWORK(1) returns the optimal LWORK. @param[in] lwork INTEGER The dimension of the array HWORK, LWORK >= (M - N + NB)*(NRHS + NB) + NRHS*NB, where NB is the blocksize given by magma_get_dgeqrf_nb( M ). \n If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the HWORK array, returns this value as the first entry of the HWORK array. @param[out] info INTEGER - = 0: successful exit - < 0: if INFO = -i, the i-th argument had an illegal value @ingroup magma_dgels_driver ********************************************************************/ extern "C" magma_int_t magma_dgels_gpu( magma_trans_t trans, magma_int_t m, magma_int_t n, magma_int_t nrhs, double *dA, magma_int_t ldda, double *dB, magma_int_t lddb, double *hwork, magma_int_t lwork, magma_int_t *info) { double *dT; double *tau; magma_int_t k; magma_int_t nb = magma_get_dgeqrf_nb(m); magma_int_t lwkopt = (m - n + nb)*(nrhs + nb) + nrhs*nb; int lquery = (lwork == -1); hwork[0] = MAGMA_D_MAKE( (double)lwkopt, 0. ); *info = 0; /* For now, N is the only case working */ if ( trans != MagmaNoTrans ) *info = -1; else if (m < 0) *info = -2; else if (n < 0 || m < n) /* LQ is not handle for now*/ *info = -3; else if (nrhs < 0) *info = -4; else if (ldda < max(1,m)) *info = -6; else if (lddb < max(1,m)) *info = -8; else if (lwork < lwkopt && ! lquery) *info = -10; if (*info != 0) { magma_xerbla( __func__, -(*info) ); return *info; } else if (lquery) return *info; k = min(m,n); if (k == 0) { hwork[0] = MAGMA_D_ONE; return *info; } /* * Allocate temporary buffers */ int ldtwork = ( 2*k + ((n+31)/32)*32 )*nb; if (nb < nrhs) ldtwork = ( 2*k + ((n+31)/32)*32 )*nrhs; if (MAGMA_SUCCESS != magma_dmalloc( &dT, ldtwork )) { *info = MAGMA_ERR_DEVICE_ALLOC; return *info; } magma_dmalloc_cpu( &tau, k ); if ( tau == NULL ) { magma_free( dT ); *info = MAGMA_ERR_HOST_ALLOC; return *info; } magma_dgeqrf_gpu( m, n, dA, ldda, tau, dT, info ); if ( *info == 0 ) { magma_dgeqrs_gpu( m, n, nrhs, dA, ldda, tau, dT, dB, lddb, hwork, lwork, info ); } magma_free( dT ); magma_free_cpu(tau); return *info; }
EmergentOrder/magma
src/dgels_gpu.cpp
C++
bsd-3-clause
4,392
<?php use AudioDidact\GlobalFunctions; /** * Returns Pug rendered HTML for the User page, either view or edit * * @param $webID string webID of the user's page to be rendered * @param $edit boolean true if the user is logged in and viewing their own page * @param null|string $verifyEmail null or string if the user is trying to verify their email address * @return string HTML of User's page from Pug */ function makeUserPage($webID, $edit, $verifyEmail = null){ $dal = GlobalFunctions::getDAL(); $user = $dal->getUserByWebID($webID); if($user == null){ echo "<script type=\"text/javascript\">alert(\"Invalid User!\");window.location = \"/" . SUBDIR . "\";</script>"; exit(); } if($edit){ $title = "User Page | $webID | Edit"; } else{ $title = "User Page | $webID"; } $emailVerify = 0; if($verifyEmail != null && !$user->isEmailVerified()){ $result = $user->verifyEmailVerificationCode($verifyEmail); // If the email verification code is correct, update the user information if($result){ $user->setEmailVerified(1); $user->setEmailVerificationCodes([]); $dal->updateUser($user); $emailVerify = 1; } else{ $emailVerify = 2; } } $userData = ["privateFeed" => $user->isPrivateFeed(), "fName" => $user->getFname(), "lName" => $user->getLname(), "gender" => $user->getGender(), "webID" => $user->getWebID(), "username" => $user->getUsername(), "email" => $user->getEmail(), "feedLength" => $user->getFeedLength(), "feedDetails" => $user->getFeedDetails() ]; $episodeData = []; if($edit || $userData["privateFeed"] == 0){ $items = $dal->getFeed($user); for($x = 0; $x < $user->getFeedLength() && isset($items[$x]); $x++){ /** @var \AudioDidact\Video $i */ $i = $items[$x]; $descr = $i->getDesc(); // Limit description to 3 lines initially $words = explode("\n", $descr, 4); if(count($words) > 3){ $words[3] = "<p id='" . $i->getId() . "' style='display:none;'>" . trim($words[3]) . " </p></p>"; $words[4] = "<a onclick='$(\"#" . $i->getId() . "\").show();'>Continue Reading...</a>"; } $descr = implode("\n", $words); $descr = mb_ereg_replace('(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.%-=#~\@!]*(\?\S+)?)?)?)', '<a href="\\1" target="_blank">\\1</a>', $descr); $descr = nl2br($descr); $thumb = LOCAL_URL . DOWNLOAD_PATH . '/' . $i->getThumbnailFilename(); $episodeFile = LOCAL_URL . DOWNLOAD_PATH . '/' . $i->getFilename() . $i->getFileExtension(); $episodeData[] = ["title" => $i->getTitle(), "author" => $i->getAuthor(), "id" => $i->getId(), "description" => $descr, "thumbnail" => $thumb, "episodeFile" => $episodeFile, "isVideo" => $i->isIsVideo()]; } } $options = ["edit" => $edit, "episodes" => $episodeData, "emailverify" => $emailVerify, "pageUser" => $userData, "stats" => generateStatistics($user)]; return GlobalFunctions::generatePug("views/userPage.pug", $title, $options); } /** * Returns Array with informative statistics about all videos in the feed * * @param \AudioDidact\User $user * @return array */ function generateStatistics(\AudioDidact\User $user){ $dal = GlobalFunctions::getDAL(); $stats = []; $feed = $dal->getFullFeedHistory($user); $stats["numVids"] = count($feed); $time = 0; foreach($feed as $v){ /** @var \AudioDidact\Video $v */ $time += $v->getDuration(); } $timeConversion = GlobalFunctions::secondsToTime($time); $timeList = []; foreach($timeConversion as $unit => $value){ if($value > 0){ $timeList[] = $value . " " . GlobalFunctions::pluralize($unit, $value); } } $stats["totalTime"] = GlobalFunctions::arrayToCommaSeparatedString($timeList); return $stats; }
md100play/AudioDidact
src/userPageGenerator.php
PHP
bsd-3-clause
3,652
{% for reply in replies %} <div class="cell reply from_{{ reply.member_num }}"> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr> <td width="48" valign="top"> <a href="/member/{{ reply.created_by }}">{{ reply.member|avatar:"normal"|safe }}</a> </td> <td width="10"></td> <td width="auto" valign="top"> <div class="fr" id="reply_{{ reply.num }}_buttons"> <strong> <small class="snow">#{{ forloop.counter }} - {{ reply.created|timesince }} ago &nbsp; <img src="/static/img/reply.png" align="absmiddle" border="0" alt="回复 {{ reply.member.username }}" onclick="replyOne('{{ reply.member.username }}')" class="clickable" /> <span class="ops"></span> </small> </strong> </div> <div class="sep3"></div> <strong> <a href="/member/{{ reply.created_by }}" class="dark">{{ reply.created_by }}</a> </strong> {% if reply.source %} <span class="snow">&nbsp; via {{ reply.source }}</span> {% endif %} <div class="sep5"></div> {% autoescape off %} <div class="content reply_content">{{ reply.content|imgly|mentions|gist|linebreaksbr|bleachify }}</div> {% endautoescape %} </td> </table> <script> replies_keys[({{ forloop.counter }} - 1)] = '{{ reply.key }}'; replies_ids[({{ forloop.counter }} - 1)] = '{{ reply.num }}'; {% if reply.parent %} replies_parents[({{ forloop.counter }} - 1)] = 1; {% else %} replies_parents[({{ forloop.counter }} - 1)] = 0; {% endif %} </script> </div> {% endfor %}
cwyark/v2ex
src/template/portion/topic_replies.html
HTML
bsd-3-clause
1,795
/*! * \file dcxtab.cpp * \brief blah * * blah * * \author David Legault ( clickhere at scriptsdb dot org ) * \version 1.0 * * \b Revisions * * © ScriptsDB.org - 2006 */ #include "defines.h" #include "Classes/dcxtab.h" #include "Classes/dcxdialog.h" /*! * \brief Constructor * * \param ID Control ID * \param p_Dialog Parent DcxDialog Object * \param mParentHwnd Parent Window Handle * \param rc Window Rectangle * \param styles Window Style Tokenized List */ DcxTab::DcxTab( UINT ID, DcxDialog * p_Dialog, HWND mParentHwnd, RECT * rc, TString & styles ) : DcxControl(ID, p_Dialog) , m_bClosable(false) , m_bGradient(false) { LONG Styles = 0, ExStyles = 0; BOOL bNoTheme = FALSE; this->parseControlStyles( styles, &Styles, &ExStyles, &bNoTheme ); this->m_Hwnd = CreateWindowEx( ExStyles | WS_EX_CONTROLPARENT, DCX_TABCTRLCLASS, NULL, WS_CHILD | Styles, rc->left, rc->top, rc->right - rc->left, rc->bottom - rc->top, mParentHwnd, (HMENU) ID, GetModuleHandle(NULL), NULL); if (!IsWindow(this->m_Hwnd)) throw "Unable To Create Window"; if ( bNoTheme ) Dcx::UXModule.dcxSetWindowTheme( this->m_Hwnd , L" ", L" " ); /* HWND hHwndTip = TabCtrl_GetToolTips( this->m_Hwnd ); if ( IsWindow( hHwndTip ) ) { TOOLINFO ti; ZeroMemory( &ti, sizeof( TOOLINFO ) ); ti.cbSize = sizeof( TOOLINFO ); ti.uFlags = TTF_SUBCLASS | TTF_IDISHWND; ti.hwnd = mParentHwnd; ti.uId = (UINT) this->m_Hwnd; ti.lpszText = LPSTR_TEXTCALLBACK; SendMessage( hHwndTip, TTM_ADDTOOL, (WPARAM) 0, (LPARAM) &ti ); } */ //if (p_Dialog->getToolTip() != NULL) { // if (styles.istok("tooltips")) { // this->m_ToolTipHWND = p_Dialog->getToolTip(); // TabCtrl_SetToolTips(this->m_Hwnd,this->m_ToolTipHWND); // //AddToolTipToolInfo(this->m_ToolTipHWND, this->m_Hwnd); // } //} this->setControlFont( GetStockFont( DEFAULT_GUI_FONT ), FALSE ); this->registreDefaultWindowProc( ); SetProp( this->m_Hwnd, "dcx_cthis", (HANDLE) this ); } /*! * \brief blah * * blah */ DcxTab::~DcxTab( ) { ImageList_Destroy( this->getImageList( ) ); int n = 0, nItems = TabCtrl_GetItemCount( this->m_Hwnd ); while ( n < nItems ) { this->deleteLParamInfo( n ); ++n; } this->unregistreDefaultWindowProc( ); } /*! * \brief blah * * blah */ void DcxTab::parseControlStyles( TString & styles, LONG * Styles, LONG * ExStyles, BOOL * bNoTheme ) { unsigned int i = 1, numtok = styles.numtok( ); //*ExStyles = WS_EX_CONTROLPARENT; while ( i <= numtok ) { if ( styles.gettok( i ) == "vertical" ) *Styles |= TCS_VERTICAL; else if ( styles.gettok( i ) == "bottom" ) *Styles |= TCS_BOTTOM; else if ( styles.gettok( i ) == "right" ) *Styles |= TCS_RIGHT; else if ( styles.gettok( i ) == "fixedwidth" ) *Styles |= TCS_FIXEDWIDTH; else if ( styles.gettok( i ) == "buttons" ) *Styles |= TCS_BUTTONS; else if ( styles.gettok( i ) == "flat" ) *Styles |= TCS_FLATBUTTONS; else if ( styles.gettok( i ) == "hot" ) *Styles |= TCS_HOTTRACK; else if ( styles.gettok( i ) == "multiline" ) *Styles |= TCS_MULTILINE; else if ( styles.gettok( i ) == "rightjustify" ) *Styles |= TCS_RIGHTJUSTIFY; else if ( styles.gettok( i ) == "scrollopposite" ) *Styles |= TCS_SCROLLOPPOSITE; //else if ( styles.gettok( i ) == "tooltips" ) // *Styles |= TCS_TOOLTIPS; else if ( styles.gettok( i ) == "flatseps" ) *ExStyles |= TCS_EX_FLATSEPARATORS; else if (styles.gettok(i) == "closable") { this->m_bClosable = true; *Styles |= TCS_OWNERDRAWFIXED; } else if ( styles.gettok( i ) == "gradient" ) this->m_bGradient = true; i++; } this->parseGeneralControlStyles( styles, Styles, ExStyles, bNoTheme ); } /*! * \brief $xdid Parsing Function * * \param input [NAME] [ID] [PROP] (OPTIONS) * \param szReturnValue mIRC Data Container * * \return > void */ void DcxTab::parseInfoRequest( TString & input, char * szReturnValue ) { int numtok = input.numtok( ); TString prop(input.gettok( 3 )); if ( prop == "text" && numtok > 3 ) { int nItem = input.gettok( 4 ).to_int( ) - 1; if ( nItem > -1 && nItem < TabCtrl_GetItemCount( this->m_Hwnd ) ) { TCITEM tci; ZeroMemory( &tci, sizeof( TCITEM ) ); tci.mask = TCIF_TEXT; tci.pszText = szReturnValue; tci.cchTextMax = MIRC_BUFFER_SIZE_CCH; TabCtrl_GetItem( this->m_Hwnd, nItem, &tci ); return; } } else if ( prop == "num" ) { wnsprintf( szReturnValue, MIRC_BUFFER_SIZE_CCH, "%d", TabCtrl_GetItemCount( this->m_Hwnd ) ); return; } // [NAME] [ID] [PROP] [N] else if ( prop == "icon" && numtok > 3 ) { int iTab = input.gettok( 4 ).to_int( ) - 1; if ( iTab > -1 && iTab < TabCtrl_GetItemCount( this->m_Hwnd ) ) { TCITEM tci; ZeroMemory( &tci, sizeof( TCITEM ) ); tci.mask = TCIF_IMAGE; TabCtrl_GetItem( this->m_Hwnd, iTab, &tci ); wnsprintf( szReturnValue, MIRC_BUFFER_SIZE_CCH, "%d", tci.iImage + 1 ); return; } } else if ( prop == "sel" ) { int nItem = TabCtrl_GetCurSel( this->m_Hwnd ); if ( nItem > -1 && nItem < TabCtrl_GetItemCount( this->m_Hwnd ) ) { wnsprintf( szReturnValue, MIRC_BUFFER_SIZE_CCH, "%d", nItem + 1 ); return; } } else if ( prop == "seltext" ) { int nItem = TabCtrl_GetCurSel( this->m_Hwnd ); if ( nItem > -1 && nItem < TabCtrl_GetItemCount( this->m_Hwnd ) ) { TCITEM tci; ZeroMemory( &tci, sizeof( TCITEM ) ); tci.mask = TCIF_TEXT; tci.pszText = szReturnValue; tci.cchTextMax = MIRC_BUFFER_SIZE_CCH; TabCtrl_GetItem( this->m_Hwnd, nItem, &tci ); return; } } else if ( prop == "childid" && numtok > 3 ) { int nItem = input.gettok( 4 ).to_int( ) - 1; if ( nItem > -1 && nItem < TabCtrl_GetItemCount( this->m_Hwnd ) ) { TCITEM tci; ZeroMemory( &tci, sizeof( TCITEM ) ); tci.mask = TCIF_PARAM; TabCtrl_GetItem( this->m_Hwnd, nItem, &tci ); LPDCXTCITEM lpdtci = (LPDCXTCITEM) tci.lParam; DcxControl * c = this->m_pParentDialog->getControlByHWND( lpdtci->mChildHwnd ); if ( c != NULL ) wnsprintf( szReturnValue, MIRC_BUFFER_SIZE_CCH, "%d", c->getUserID( ) ); return; } } // [NAME] [ID] [PROP] else if (prop == "mouseitem") { TCHITTESTINFO tchi; tchi.flags = TCHT_ONITEM; GetCursorPos(&tchi.pt); MapWindowPoints(NULL, this->m_Hwnd, &tchi.pt, 1); int tab = TabCtrl_HitTest(this->m_Hwnd, &tchi); wnsprintf(szReturnValue, MIRC_BUFFER_SIZE_CCH, "%d", tab +1); return; } else if ( this->parseGlobalInfoRequest( input, szReturnValue ) ) return; szReturnValue[0] = 0; } /*! * \brief blah * * blah */ void DcxTab::parseCommandRequest( TString & input ) { XSwitchFlags flags(input.gettok(3)); int numtok = input.numtok( ); // xdid -r [NAME] [ID] [SWITCH] if (flags['r']) { int n = 0; TCITEM tci; int nItems = TabCtrl_GetItemCount(this->m_Hwnd); while (n < nItems) { ZeroMemory(&tci, sizeof(TCITEM)); tci.mask = TCIF_PARAM; if (TabCtrl_GetItem(this->m_Hwnd, n, &tci)) { LPDCXTCITEM lpdtci = (LPDCXTCITEM) tci.lParam; if (lpdtci != NULL && lpdtci->mChildHwnd != NULL && IsWindow(lpdtci->mChildHwnd)) { DestroyWindow(lpdtci->mChildHwnd); delete lpdtci; } } ++n; } TabCtrl_DeleteAllItems(this->m_Hwnd); } // xdid -a [NAME] [ID] [SWITCH] [N] [ICON] [TEXT][TAB][ID] [CONTROL] [X] [Y] [W] [H] (OPTIONS)[TAB](TOOLTIP) if ( flags['a'] && numtok > 4 ) { TCITEM tci; ZeroMemory( &tci, sizeof( TCITEM ) ); tci.mask = TCIF_IMAGE | TCIF_PARAM; TString data(input.gettok( 1, TSTAB ).trim()); TString control_data; if ( input.numtok( TSTAB ) > 1 ) control_data = input.gettok( 2, TSTAB ).trim(); TString tooltip; if ( input.numtok( TSTAB ) > 2 ) tooltip = input.gettok( 3, -1, TSTAB ).trim(); int nIndex = data.gettok( 4 ).to_int( ) - 1; if ( nIndex == -1 ) nIndex += TabCtrl_GetItemCount( this->m_Hwnd ) + 1; tci.iImage = data.gettok( 5 ).to_int( ) - 1; // Extra params LPDCXTCITEM lpdtci = new DCXTCITEM; if (lpdtci == NULL) { this->showError(NULL, "-a", "Unable To Create Control, Unable to Allocate Memory"); return; } lpdtci->tsTipText = tooltip; tci.lParam = (LPARAM) lpdtci; // Itemtext TString itemtext; if ( data.numtok( ) > 5 ) { itemtext = data.gettok( 6, -1 ); tci.mask |= TCIF_TEXT; if (this->m_bClosable) itemtext += " "; tci.pszText = itemtext.to_chr( ); } if ( control_data.numtok( ) > 5 ) { UINT ID = mIRC_ID_OFFSET + (UINT)control_data.gettok( 1 ).to_int( ); if ( ID > mIRC_ID_OFFSET - 1 && !IsWindow( GetDlgItem( this->m_pParentDialog->getHwnd( ), ID ) ) && this->m_pParentDialog->getControlByID( ID ) == NULL ) { try { DcxControl * p_Control = DcxControl::controlFactory(this->m_pParentDialog,ID,control_data,2, CTLF_ALLOW_TREEVIEW | CTLF_ALLOW_LISTVIEW | CTLF_ALLOW_RICHEDIT | CTLF_ALLOW_DIVIDER | CTLF_ALLOW_PANEL | CTLF_ALLOW_TAB | CTLF_ALLOW_REBAR | CTLF_ALLOW_WEBCTRL | CTLF_ALLOW_EDIT | CTLF_ALLOW_IMAGE | CTLF_ALLOW_LIST ,this->m_Hwnd); if ( p_Control != NULL ) { lpdtci->mChildHwnd = p_Control->getHwnd( ); this->m_pParentDialog->addControl( p_Control ); } } catch ( char *err ) { this->showErrorEx(NULL, "-a", "Unable To Create Control %d (%s)", ID - mIRC_ID_OFFSET, err); } } else this->showErrorEx(NULL, "-a", "Control with ID \"%d\" already exists", ID - mIRC_ID_OFFSET ); } TabCtrl_InsertItem( this->m_Hwnd, nIndex, &tci ); this->activateSelectedTab( ); } // xdid -c [NAME] [ID] [SWITCH] [N] else if ( flags['c'] && numtok > 3 ) { int nItem = input.gettok( 4 ).to_int( ) - 1; if ( nItem > -1 && nItem < TabCtrl_GetItemCount( this->m_Hwnd ) ) { TabCtrl_SetCurSel( this->m_Hwnd, nItem ); this->activateSelectedTab( ); } } // xdid -d [NAME] [ID] [SWITCH] [N] else if ( flags['d'] && numtok > 3 ) { int nItem = input.gettok( 4 ).to_int( ) - 1; // if a valid item to delete if ( nItem > -1 && nItem < TabCtrl_GetItemCount( this->m_Hwnd ) ) { int curSel = TabCtrl_GetCurSel(this->m_Hwnd); TCITEM tci; ZeroMemory( &tci, sizeof( TCITEM ) ); tci.mask = TCIF_PARAM; if (TabCtrl_GetItem(this->m_Hwnd, nItem, &tci)) { LPDCXTCITEM lpdtci = (LPDCXTCITEM) tci.lParam; if ( lpdtci != NULL && lpdtci->mChildHwnd != NULL && IsWindow( lpdtci->mChildHwnd ) ) { DestroyWindow( lpdtci->mChildHwnd ); delete lpdtci; } } TabCtrl_DeleteItem( this->m_Hwnd, nItem ); // select the next tab item if its the current one if (curSel == nItem) { if (nItem < TabCtrl_GetItemCount(this->m_Hwnd)) TabCtrl_SetCurSel(this->m_Hwnd, nItem); else TabCtrl_SetCurSel(this->m_Hwnd, nItem -1); this->activateSelectedTab( ); } } } // xdid -l [NAME] [ID] [SWITCH] [N] [ICON] else if ( flags['l'] && numtok > 4 ) { int nItem = input.gettok( 4 ).to_int( ) - 1; int nIcon = input.gettok( 5 ).to_int( ) - 1; if ( nItem > -1 && nItem < TabCtrl_GetItemCount( this->m_Hwnd ) ) { TCITEM tci; ZeroMemory( &tci, sizeof( TCITEM ) ); tci.mask = TCIF_IMAGE; tci.iImage = nIcon; TabCtrl_SetItem( this->m_Hwnd, nItem, &tci ); } } // xdid -m [NAME] [ID] [SWITCH] [X] [Y] else if ( flags['m'] && numtok > 4 ) { int X = input.gettok( 4 ).to_int( ); int Y = input.gettok( 5 ).to_int( ); TabCtrl_SetItemSize( this->m_Hwnd, X, Y ); } // This it to avoid an invalid flag message. // xdid -r [NAME] [ID] [SWITCH] else if ( flags['r'] ) { } // xdid -t [NAME] [ID] [SWITCH] [N] (text) else if ( flags['t'] && numtok > 3 ) { int nItem = input.gettok( 4 ).to_int( ) - 1; if ( nItem > -1 && nItem < TabCtrl_GetItemCount( this->m_Hwnd ) ) { TString itemtext; TCITEM tci; ZeroMemory( &tci, sizeof( TCITEM ) ); tci.mask = TCIF_TEXT; if ( numtok > 4 ) itemtext = input.gettok( 5, -1 ).trim(); tci.pszText = itemtext.to_chr( ); TabCtrl_SetItem( this->m_Hwnd, nItem, &tci ); } } // xdid -v [DNAME] [ID] [SWITCH] [N] [POS] else if (flags['v'] && numtok > 4) { int nItem = input.gettok(4).to_int(); int pos = input.gettok(5).to_int(); BOOL adjustDelete = FALSE; if (nItem == pos) return; else if ((nItem < 1) || (nItem > TabCtrl_GetItemCount(this->m_Hwnd))) return; else if ((pos < 1) || (pos > TabCtrl_GetItemCount(this->m_Hwnd))) return; // does the nItem index get shifted after we insert if (nItem > pos) adjustDelete = TRUE; // decrement coz of 0-index nItem--; // get the item we're moving char* text = new char[MIRC_BUFFER_SIZE_CCH]; TCITEM tci; ZeroMemory(&tci, sizeof(TCITEM)); tci.pszText = text; tci.cchTextMax = MIRC_BUFFER_SIZE_CCH; tci.mask = TCIF_IMAGE | TCIF_PARAM | TCIF_TEXT | TCIF_STATE; TabCtrl_GetItem(this->m_Hwnd, nItem, &tci); // insert it into the new position TabCtrl_InsertItem(this->m_Hwnd, pos, &tci); // remove the old tab item TabCtrl_DeleteItem(this->m_Hwnd, (adjustDelete ? nItem +1 : nItem)); delete [] text; } // xdid -w [NAME] [ID] [SWITCH] [FLAGS] [INDEX] [FILENAME] else if (flags['w'] && numtok > 5) { HIMAGELIST himl; HICON icon; TString flag(input.gettok( 4 )); int index = input.gettok( 5 ).to_int(); TString filename(input.gettok(6, -1)); if ((himl = this->getImageList()) == NULL) { himl = this->createImageList(); if (himl) this->setImageList(himl); } icon = dcxLoadIcon(index, filename, false, flag); ImageList_AddIcon(himl, icon); DestroyIcon(icon); } // xdid -y [NAME] [ID] [SWITCH] [+FLAGS] else if ( flags['y'] ) { ImageList_Destroy( this->getImageList( ) ); } else this->parseGlobalCommandRequest( input, flags ); } /*! * \brief blah * * blah */ HIMAGELIST DcxTab::getImageList( ) { return TabCtrl_GetImageList( this->m_Hwnd ); } /*! * \brief blah * * blah */ void DcxTab::setImageList( HIMAGELIST himl ) { TabCtrl_SetImageList( this->m_Hwnd, himl ); } /*! * \brief blah * * blah */ HIMAGELIST DcxTab::createImageList( ) { return ImageList_Create( 16, 16, ILC_COLOR32|ILC_MASK, 1, 0 ); } /*! * \brief blah * * blah */ void DcxTab::deleteLParamInfo( const int nItem ) { TCITEM tci; ZeroMemory( &tci, sizeof( TCITEM ) ); tci.mask = TCIF_PARAM; if ( TabCtrl_GetItem( this->m_Hwnd, nItem, &tci ) ) { LPDCXTCITEM lpdtci = (LPDCXTCITEM) tci.lParam; if ( lpdtci != NULL ) delete lpdtci; } } /*! * \brief blah * * blah */ void DcxTab::activateSelectedTab( ) { int nTab = TabCtrl_GetItemCount( this->m_Hwnd ); int nSel = TabCtrl_GetCurSel( this->m_Hwnd ); if ( nTab > 0 ) { RECT tabrect, rc; GetWindowRect( this->m_Hwnd, &tabrect ); TabCtrl_AdjustRect( this->m_Hwnd, FALSE, &tabrect ); GetWindowRect( this->m_Hwnd, &rc ); OffsetRect( &tabrect, -rc.left, -rc.top ); /* char data[500]; wnsprintf( data, 500, "WRECT %d %d %d %d - ARECT %d %d %d %d", rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, tabrect.left, tabrect.top, tabrect.right-tabrect.left, tabrect.bottom-tabrect.top ); mIRCError( data ); */ TCITEM tci; ZeroMemory( &tci, sizeof( TCITEM ) ); tci.mask = TCIF_PARAM; HDWP hdwp = BeginDeferWindowPos( 0 ); while ( nTab-- ) { TabCtrl_GetItem( this->m_Hwnd, nTab, &tci ); LPDCXTCITEM lpdtci = (LPDCXTCITEM) tci.lParam; if ( lpdtci->mChildHwnd != NULL && IsWindow( lpdtci->mChildHwnd ) ) { if ( nTab == nSel ) { hdwp = DeferWindowPos( hdwp, lpdtci->mChildHwnd, NULL, tabrect.left, tabrect.top, tabrect.right-tabrect.left, tabrect.bottom-tabrect.top, SWP_SHOWWINDOW | SWP_NOZORDER | SWP_NOOWNERZORDER ); } else { hdwp = DeferWindowPos( hdwp, lpdtci->mChildHwnd, NULL, 0, 0, 0, 0, SWP_HIDEWINDOW | SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOREDRAW | SWP_NOACTIVATE | SWP_NOOWNERZORDER ); } } } EndDeferWindowPos( hdwp ); } } void DcxTab::getTab(int index, LPTCITEM tcItem) { TabCtrl_GetItem(this->m_Hwnd, index, tcItem); } int DcxTab::getTabCount() { return TabCtrl_GetItemCount(this->m_Hwnd); } void DcxTab::GetCloseButtonRect(const RECT& rcItem, RECT& rcCloseButton) { // ---------- //rcCloseButton.top = rcItem.top + 2; //rcCloseButton.bottom = rcCloseButton.top + (m_iiCloseButton.rcImage.bottom - m_iiCloseButton.rcImage.top); //rcCloseButton.right = rcItem.right - 2; //rcCloseButton.left = rcCloseButton.right - (m_iiCloseButton.rcImage.right - m_iiCloseButton.rcImage.left); // ---------- rcCloseButton.top = rcItem.top + 2; rcCloseButton.bottom = rcCloseButton.top + (16); rcCloseButton.right = rcItem.right - 2; rcCloseButton.left = rcCloseButton.right - (16); // ---------- } TString DcxTab::getStyles(void) { TString styles(__super::getStyles()); DWORD ExStyles, Styles; Styles = GetWindowStyle(this->m_Hwnd); ExStyles = GetWindowExStyle(this->m_Hwnd); if (Styles & TCS_VERTICAL) styles.addtok("vertical", " "); if (Styles & TCS_BOTTOM) styles.addtok("bottom", " "); if (Styles & TCS_RIGHT) styles.addtok("right", " "); if (Styles & TCS_FIXEDWIDTH) styles.addtok("fixedwidth", " "); if (Styles & TCS_RIGHT) styles.addtok("buttons", " "); if (Styles & TCS_BUTTONS) styles.addtok("flat", " "); if (Styles & TCS_FLATBUTTONS) styles.addtok("flat", " "); if (Styles & TCS_HOTTRACK) styles.addtok("hot", " "); if (Styles & TCS_MULTILINE) styles.addtok("multiline", " "); if (Styles & TCS_RIGHTJUSTIFY) styles.addtok("rightjustify", " "); if (Styles & TCS_SCROLLOPPOSITE) styles.addtok("scrollopposite", " "); if (ExStyles & TCS_EX_FLATSEPARATORS) styles.addtok("flatseps", " "); if (this->m_bClosable) styles.addtok("closable", " "); if (this->m_bGradient) styles.addtok("gradient", " "); return styles; } void DcxTab::toXml(TiXmlElement * xml) { if (xml == NULL) return; __super::toXml(xml); int count = this->getTabCount(); char buf[MIRC_BUFFER_SIZE_CCH]; TCITEM tci; for (int i = 0; i < count; i++) { tci.cchTextMax = MIRC_BUFFER_SIZE_CCH -1; tci.pszText = buf; tci.mask |= TCIF_TEXT; if(TabCtrl_GetItem(this->m_Hwnd, i, &tci)) { LPDCXTCITEM lpdtci = (LPDCXTCITEM) tci.lParam; if (lpdtci != NULL) { DcxControl * ctrl = this->m_pParentDialog->getControlByHWND(lpdtci->mChildHwnd); if (ctrl != NULL) { TiXmlElement * ctrlxml = ctrl->toXml(); // we need to remove hidden style here TString styles(ctrlxml->Attribute("styles")); if (styles.len() > 0) { styles.remtok("hidden", 1); if (styles.len() > 0) ctrlxml->SetAttribute("styles", styles.to_chr()); else ctrlxml->RemoveAttribute("styles"); } if (tci.mask & TCIF_TEXT) ctrlxml->SetAttribute("caption", tci.pszText); xml->LinkEndChild(ctrlxml); } } } } } /*! * \brief blah * * blah */ LRESULT DcxTab::ParentMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bParsed) { switch (uMsg) { case WM_NOTIFY : { LPNMHDR hdr = (LPNMHDR) lParam; if (!hdr) break; switch (hdr->code) { case NM_RCLICK: { if (this->m_pParentDialog->getEventMask() & DCX_EVENT_CLICK) { TCHITTESTINFO tchi; tchi.flags = TCHT_ONITEM; GetCursorPos(&tchi.pt); MapWindowPoints(NULL, this->m_Hwnd, &tchi.pt, 1); int tab = TabCtrl_HitTest(this->m_Hwnd, &tchi); TabCtrl_GetCurSel(this->m_Hwnd); if (tab != -1) this->execAliasEx("%s,%d,%d", "rclick", this->getUserID(), tab +1); } bParsed = TRUE; break; } case NM_CLICK: { if (this->m_pParentDialog->getEventMask() & DCX_EVENT_CLICK) { int tab = TabCtrl_GetCurFocus(this->m_Hwnd); //int tab = TabCtrl_GetCurSel(this->m_Hwnd); if (tab != -1) { if (this->m_bClosable) { RECT rcCloseButton, rc; POINT pt; GetCursorPos(&pt); MapWindowPoints(NULL,this->m_Hwnd, &pt, 1); TabCtrl_GetItemRect(this->m_Hwnd, tab, &rc); GetCloseButtonRect(rc, rcCloseButton); if (PtInRect(&rcCloseButton, pt)) { this->execAliasEx("%s,%d,%d", "closetab", this->getUserID(), tab +1); break; } } this->execAliasEx("%s,%d,%d", "sclick", this->getUserID(), tab +1); } } } // fall through. case TCN_SELCHANGE: { this->activateSelectedTab(); bParsed = TRUE; } break; } break; } // Original source based on code from eMule 0.47 source code available at http://www.emule-project.net case WM_DRAWITEM: { if (!m_bClosable) break; DRAWITEMSTRUCT *idata = (DRAWITEMSTRUCT *)lParam; if ((idata == NULL) || (!IsWindow(idata->hwndItem))) break; //DcxControl *c_this = (DcxControl *) GetProp(idata->hwndItem, "dcx_cthis"); //if (c_this == NULL) // break; RECT rect; int nTabIndex = idata->itemID; if (nTabIndex < 0) break; CopyRect(&rect, &idata->rcItem); // if themes are active use them. // call default WndProc(), DrawThemeParentBackgroundUx() is only temporary DcxControl::DrawCtrlBackground(idata->hDC, this, &rect); //DrawThemeParentBackgroundUx(this->m_Hwnd, idata->hDC, &rect); //CopyRect(&rect, &idata->rcItem); if (this->m_bGradient) { if (this->m_clrBackText == -1) // Gives a nice silver/gray gradient XPopupMenuItem::DrawGradient(idata->hDC, &rect, GetSysColor(COLOR_BTNHIGHLIGHT), GetSysColor(COLOR_BTNFACE), TRUE); else XPopupMenuItem::DrawGradient(idata->hDC, &rect, GetSysColor(COLOR_BTNHIGHLIGHT), this->m_clrBackText, TRUE); } rect.left += 1+ GetSystemMetrics(SM_CXEDGE); // move in past border. // TODO: (twig) Ook can u take a look at this plz? string stuff isnt my forte TString label((UINT)MIRC_BUFFER_SIZE_CCH); TC_ITEM tci; tci.mask = TCIF_TEXT | TCIF_IMAGE | TCIF_STATE; tci.pszText = label.to_chr(); tci.cchTextMax = MIRC_BUFFER_SIZE_CCH; tci.dwStateMask = TCIS_HIGHLIGHTED; if (!TabCtrl_GetItem(this->getHwnd(), nTabIndex, &tci)) { this->showError(NULL, "DcxTab Fatal Error", "Invalid item"); break; } // fill the rect so it appears to "merge" with the tab page content //if (!dcxIsThemeActive()) //FillRect(idata->hDC, &rect, GetSysColorBrush(COLOR_BTNFACE)); // set transparent so text background isnt annoying int iOldBkMode = SetBkMode(idata->hDC, TRANSPARENT); // Draw icon on left side if the item has an icon if (tci.iImage != -1) { ImageList_DrawEx( this->getImageList(), tci.iImage, idata->hDC, rect.left, rect.top, 0, 0, CLR_NONE, CLR_NONE, ILD_TRANSPARENT ); IMAGEINFO ii; ImageList_GetImageInfo( this->getImageList(), tci.iImage, &ii); rect.left += (ii.rcImage.right - ii.rcImage.left); } // Draw 'Close button' at right side if (m_bClosable) { RECT rcCloseButton; GetCloseButtonRect(rect, rcCloseButton); // Draw systems close button ? or do you want a custom close button? DrawFrameControl(idata->hDC, &rcCloseButton, DFC_CAPTION, DFCS_CAPTIONCLOSE | DFCS_FLAT | DFCS_TRANSPARENT); //MoveToEx( idata->hDC, rcCloseButton.left, rcCloseButton.top, NULL ); //LineTo( idata->hDC, rcCloseButton.right, rcCloseButton.bottom ); //MoveToEx( idata->hDC, rcCloseButton.right, rcCloseButton.top, NULL ); //LineTo( idata->hDC, rcCloseButton.left, rcCloseButton.bottom ); rect.right = rcCloseButton.left - 2; } COLORREF crOldColor = 0; if (tci.dwState & TCIS_HIGHLIGHTED) crOldColor = SetTextColor(idata->hDC, GetSysColor(COLOR_HIGHLIGHTTEXT)); rect.top += 1+ GetSystemMetrics(SM_CYEDGE); //4; //DrawText(idata->hDC, label.to_chr(), label.len(), &rect, DT_SINGLELINE | DT_TOP | DT_NOPREFIX); // allow mirc formatted text. //mIRC_DrawText(idata->hDC, label, &rect, DT_SINGLELINE | DT_TOP | DT_NOPREFIX, false, this->m_bUseUTF8); //if (!this->m_bCtrlCodeText) { // if (this->m_bShadowText) // dcxDrawShadowText(idata->hDC, label.to_wchr(this->m_bUseUTF8), label.wlen(),&rect, DT_WORD_ELLIPSIS | DT_LEFT | DT_TOP | DT_SINGLELINE, GetTextColor(idata->hDC), 0, 5, 5); // else // DrawTextW( idata->hDC, label.to_wchr(this->m_bUseUTF8), label.wlen( ), &rect, DT_WORD_ELLIPSIS | DT_LEFT | DT_TOP | DT_SINGLELINE ); //} //else // mIRC_DrawText( idata->hDC, label, &rect, DT_WORD_ELLIPSIS | DT_LEFT | DT_TOP | DT_SINGLELINE, this->m_bShadowText, this->m_bUseUTF8); this->ctrlDrawText(idata->hDC, label, &rect, DT_WORD_ELLIPSIS | DT_LEFT | DT_TOP | DT_SINGLELINE); if (tci.dwState & TCIS_HIGHLIGHTED) SetTextColor(idata->hDC, crOldColor); SetBkMode(idata->hDC, iOldBkMode); break; } } return 0L; } LRESULT DcxTab::PostMessage( UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL & bParsed ) { LRESULT lRes = 0L; switch( uMsg ) { case WM_CONTEXTMENU: case WM_LBUTTONUP: break; case WM_NOTIFY : { LPNMHDR hdr = (LPNMHDR) lParam; if (!hdr) break; //if (hdr->hwndFrom == this->m_ToolTipHWND) { // switch(hdr->code) { // case TTN_GETDISPINFO: // { // LPNMTTDISPINFO di = (LPNMTTDISPINFO)lParam; // di->lpszText = this->m_tsToolTip.to_chr(); // di->hinst = NULL; // bParsed = TRUE; // } // break; // case TTN_LINKCLICK: // { // bParsed = TRUE; // this->execAliasEx("%s,%d", "tooltiplink", this->getUserID()); // } // break; // default: // break; // } //} if (IsWindow(hdr->hwndFrom)) { DcxControl *c_this = (DcxControl *) GetProp(hdr->hwndFrom,"dcx_cthis"); if (c_this != NULL) lRes = c_this->ParentMessage(uMsg, wParam, lParam, bParsed); } } break; case WM_HSCROLL: case WM_VSCROLL: case WM_COMMAND: { if (IsWindow((HWND) lParam)) { DcxControl *c_this = (DcxControl *) GetProp((HWND) lParam,"dcx_cthis"); if (c_this != NULL) lRes = c_this->ParentMessage(uMsg, wParam, lParam, bParsed); } } break; case WM_DELETEITEM: { DELETEITEMSTRUCT *idata = (DELETEITEMSTRUCT *)lParam; if ((idata != NULL) && (IsWindow(idata->hwndItem))) { DcxControl *c_this = (DcxControl *) GetProp(idata->hwndItem,"dcx_cthis"); if (c_this != NULL) lRes = c_this->ParentMessage(uMsg, wParam, lParam, bParsed); } } break; case WM_MEASUREITEM: { HWND cHwnd = GetDlgItem(this->m_Hwnd, wParam); if (IsWindow(cHwnd)) { DcxControl *c_this = (DcxControl *) GetProp(cHwnd,"dcx_cthis"); if (c_this != NULL) lRes = c_this->ParentMessage(uMsg, wParam, lParam, bParsed); } } break; case WM_SIZE: { this->activateSelectedTab( ); if (this->m_pParentDialog->getEventMask() & DCX_EVENT_SIZE) this->execAliasEx("%s,%d", "sizing", this->getUserID( ) ); } break; case WM_ERASEBKGND: { if (this->isExStyle(WS_EX_TRANSPARENT)) this->DrawParentsBackground((HDC)wParam); else DcxControl::DrawCtrlBackground((HDC) wParam,this); bParsed = TRUE; return TRUE; } break; case WM_PAINT: { if (!this->m_bAlphaBlend) break; PAINTSTRUCT ps; HDC hdc; hdc = BeginPaint( this->m_Hwnd, &ps ); bParsed = TRUE; // Setup alpha blend if any. LPALPHAINFO ai = this->SetupAlphaBlend(&hdc); lRes = CallWindowProc( this->m_DefaultWindowProc, this->m_Hwnd, uMsg, (WPARAM) hdc, lParam ); this->FinishAlphaBlend(ai); EndPaint( this->m_Hwnd, &ps ); } break; //case WM_CLOSE: // { // if (GetKeyState(VK_ESCAPE) != 0) // don't allow the window to close if escape is pressed. Needs looking into for a better method. // bParsed = TRUE; // } // break; case WM_DESTROY: { delete this; bParsed = TRUE; } break; default: lRes = this->CommonMessage( uMsg, wParam, lParam, bParsed); break; } return lRes; }
dlsocool/dcx
Classes/dcxtab.cpp
C++
bsd-3-clause
29,210
package uk.ac.soton.ecs.comp3204.l3; import java.awt.Component; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.GridBagLayout; import java.io.IOException; import javax.swing.JPanel; import org.openimaj.content.slideshow.Slide; import org.openimaj.content.slideshow.SlideshowApplication; import org.openimaj.data.dataset.VFSGroupDataset; import org.openimaj.image.DisplayUtilities.ImageComponent; import org.openimaj.image.FImage; import org.openimaj.image.ImageUtilities; import uk.ac.soton.ecs.comp3204.l3.FaceDatasetDemo.FaceDatasetProvider; import uk.ac.soton.ecs.comp3204.utils.Utils; import uk.ac.soton.ecs.comp3204.utils.annotations.Demonstration; /** * Visualise mean-centered face images * * @author Jonathon Hare ([email protected]) * */ @Demonstration(title = "Mean-centred faces demo") public class MeanCenteredFacesDemo implements Slide { @Override public Component getComponent(int width, int height) throws IOException { final VFSGroupDataset<FImage> dataset = FaceDatasetProvider.getDataset(); final FImage mean = dataset.getRandomInstance().fill(0f); for (final FImage i : dataset) { mean.addInplace(i); } mean.divideInplace(dataset.numInstances()); final JPanel outer = new JPanel(); outer.setOpaque(false); outer.setPreferredSize(new Dimension(width, height)); outer.setLayout(new GridBagLayout()); final JPanel base = new JPanel(); base.setOpaque(false); base.setPreferredSize(new Dimension(width, height - 50)); base.setLayout(new FlowLayout()); for (int i = 0; i < 60; i++) { final FImage img = dataset.getRandomInstance().subtract(mean).normalise(); final ImageComponent ic = new ImageComponent(true, false); ic.setAllowPanning(false); ic.setAllowZoom(false); ic.setShowPixelColours(false); ic.setShowXYPosition(false); ic.setImage(ImageUtilities.createBufferedImageForDisplay(img)); base.add(ic); } outer.add(base); return outer; } @Override public void close() { // do nothing } public static void main(String[] args) throws IOException { new SlideshowApplication(new MeanCenteredFacesDemo(), 1024, 768, Utils.BACKGROUND_IMAGE); } }
jonhare/COMP3204
app/src/main/java/uk/ac/soton/ecs/comp3204/l3/MeanCenteredFacesDemo.java
Java
bsd-3-clause
2,176
package com.salesforce.dva.argus.service.mq.kafka; import com.fasterxml.jackson.databind.JavaType; import java.io.Serializable; import java.util.List; public interface Consumer { <T extends Serializable> List<T> dequeueFromBuffer(String topic, Class<T> type, int timeout, int limit); <T extends Serializable> List<T> dequeueFromBuffer(String topic, JavaType type, int timeout, int limit); void shutdown(); }
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/service/mq/kafka/Consumer.java
Java
bsd-3-clause
424
# -*- encoding: binary -*- require "./test/exec" require "tmpdir" require "fileutils" require "net/http" module TestFreshSetup include TestExec def setup setup_mogilefs end def setup_mogilefs(plugins = nil) @test_host = "127.0.0.1" setup_mogstored @tracker = TCPServer.new(@test_host, 0) @tracker_port = @tracker.addr[1] @dbname = Tempfile.new(["mogfresh", ".sqlite3"]) @mogilefsd_conf = Tempfile.new(["mogilefsd", "conf"]) @mogilefsd_pid = Tempfile.new(["mogilefsd", "pid"]) cmd = %w(mogdbsetup --yes --type=SQLite --dbname) << @dbname.path x!(*cmd) @mogilefsd_conf.puts "db_dsn DBI:SQLite:#{@dbname.path}" @mogilefsd_conf.write <<EOF conf_port #@tracker_port listen #@test_host pidfile #{@mogilefsd_pid.path} replicate_jobs 1 fsck_jobs 1 query_jobs 1 mogstored_stream_port #{@mogstored_mgmt_port} node_timeout 10 EOF @mogilefsd_conf.flush @trackers = @hosts = [ "#@test_host:#@tracker_port" ] @tracker.close x!("mogilefsd", "--daemon", "--config=#{@mogilefsd_conf.path}") wait_for_port @tracker_port @admin = MogileFS::Admin.new(:hosts => @hosts) 50.times do break if File.size(@mogstored_pid.path) > 0 sleep 0.1 end end def wait_for_port(port) tries = 50 begin TCPSocket.new(@test_host, port).close return rescue sleep 0.1 end while (tries -= 1) > 0 raise "#@test_host:#{port} never became ready" end def test_admin_setup_new_host_and_devices assert_equal [], @admin.get_hosts args = { :ip => @test_host, :port => @mogstored_http_port } @admin.create_host("me", args) yield_for_monitor_update { @admin.get_hosts.empty? or break } hosts = @admin.get_hosts assert_equal 1, hosts.size host = @admin.get_hosts[0] assert_equal "me", host["hostname"] assert_equal @mogstored_http_port, host["http_port"] assert_nil host["http_get_port"] assert_equal @test_host, host["hostip"] assert_kind_of Integer, host["hostid"] assert_equal hosts, @admin.get_hosts(host["hostid"]) assert_equal [], @admin.get_devices end def test_replicate_now assert_equal({"count" => 0}, @admin.replicate_now) end def test_clear_cache assert_nil @admin.clear_cache end def test_create_update_delete_class domain = "rbmogtest#{Time.now.strftime('%Y%m%d%H%M%S')}.#{uuid}" @admin.create_domain(domain) yield_for_monitor_update { @admin.get_domains.include?(domain) and break } assert_nothing_raised do @admin.create_class(domain, "klassy", 1) end assert_raises(MogileFS::Backend::ClassExistsError) do @admin.create_class(domain, "klassy", 1) end assert_nothing_raised do @admin.update_class(domain, "klassy", :mindevcount => 1, :replpolicy => "MultipleHosts(1)") end tmp = nil yield_for_monitor_update do tmp = @admin.get_domains[domain]["klassy"] break if tmp && tmp["replpolicy"] == "MultipleHosts(1)" end assert tmp, "domain did not show up" assert_equal 1, tmp["mindevcount"] assert_equal "MultipleHosts(1)", tmp["replpolicy"] assert_nothing_raised { @admin.update_class(domain, "klassy", 2) } ensure @admin.delete_class(domain, "klassy") rescue nil end def add_host_device_domain assert_equal [], @admin.get_hosts args = { :ip => @test_host, :port => @mogstored_http_port } args[:status] = "alive" @admin.create_host("me", args) assert File.directory?("#@docroot/dev1") assert File.directory?("#@docroot/dev2") yield_for_monitor_update { @admin.get_hosts.empty? or break } me = @admin.get_hosts.find { |x| x["hostname"] == "me" } assert_instance_of Hash, me, me.inspect assert_kind_of Integer, me["hostid"], me assert_equal true, @admin.create_device(me["hostid"], 1) yield_for_monitor_update { @admin.get_devices.empty? or break } wait_for_usage_file "dev1" assert_equal true, @admin.create_device("me", 2) wait_for_usage_file "dev2" # MogileFS::Server 2.60+ shows reject_bad_md5 monitor status dev = @admin.get_devices[0] if dev.include?("reject_bad_md5") assert [true, false].include?(dev["reject_bad_md5"]) end out = err = nil tries = 0 begin out.close! if out err.close! if err status, out, err = mogadm("check") assert status.success?, status.inspect if (tries += 1) > 100 warn err.read puts out.read raise "mogadm failed" end sleep 0.1 end until out.read =~ /write?able/ domain = "rbmogtest.#$$" @admin.create_domain(domain) yield_for_monitor_update { @admin.get_domains.include?(domain) and break } @domain = domain end def test_device_file_add add_host_device_domain client = MogileFS::MogileFS.new :hosts => @hosts, :domain => @domain r, w = IO.pipe thr = Thread.new do (0..9).each do |i| sleep 0.05 w.write("#{i}\n") end w.close :ok end assert_equal 20, client.store_file("pipe", nil, r) assert_equal :ok, thr.value r.close assert_equal "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n", client.get_file_data("pipe") end def teardown_mogilefs if @mogstored_pid pid = File.read(@mogstored_pid.path).to_i Process.kill(:TERM, pid) if pid > 0 end if @mogilefsd_pid s = TCPSocket.new(@test_host, @tracker_port) s.write "!shutdown\r\n" s.close end FileUtils.rmtree(@docroot) end def wait_for_usage_file(device) uri = URI("http://#@test_host:#@mogstored_http_port/#{device}/usage") res = nil 100.times do res = Net::HTTP.get_response(uri) if Net::HTTPOK === res puts res.body if $DEBUG return end puts res.inspect if $DEBUG sleep 0.1 end raise "#{uri} failed to appear: #{res.inspect}" end def setup_mogstored @docroot = Dir.mktmpdir(["mogfresh", "docroot"]) Dir.mkdir("#@docroot/dev1") Dir.mkdir("#@docroot/dev2") @mogstored_mgmt = TCPServer.new(@test_host, 0) @mogstored_http = TCPServer.new(@test_host, 0) @mogstored_mgmt_port = @mogstored_mgmt.addr[1] @mogstored_http_port = @mogstored_http.addr[1] @mogstored_conf = Tempfile.new(["mogstored", "conf"]) @mogstored_pid = Tempfile.new(["mogstored", "pid"]) @mogstored_conf.write <<EOF pidfile = #{@mogstored_pid.path} maxconns = 1000 httplisten = #@test_host:#{@mogstored_http_port} mgmtlisten = #@test_host:#{@mogstored_mgmt_port} docroot = #@docroot EOF @mogstored_conf.flush @mogstored_mgmt.close @mogstored_http.close x!("mogstored", "--daemon", "--config=#{@mogstored_conf.path}") wait_for_port @mogstored_mgmt_port wait_for_port @mogstored_http_port end end
drasch/mogilefs-client
test/fresh.rb
Ruby
bsd-3-clause
6,811
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('setlist', '0012_remove_show_leg'), ] operations = [ migrations.CreateModel( name='Show2', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('venue', models.ForeignKey(to='setlist.Venue', to_field='id')), ('tour', models.ForeignKey(to='setlist.Tour', to_field='id')), ('date', models.DateField(db_index=True)), ('setlist', models.TextField(default=b'', blank=True)), ('notes', models.TextField(default=b'', blank=True)), ('source', models.TextField(default=b'', blank=True)), ], options={ }, bases=(models.Model,), ), ]
tylereaves/26md
setlist/migrations/0013_show2.py
Python
bsd-3-clause
970
{-# Language OverloadedStrings #-} module XMonad.Actions.XHints.Render where import XMonad hiding (drawString) import Data.Text (Text) import qualified Data.Text as T import Foreign.C import Graphics.X11.Xlib.Types import qualified Data.Text.Foreign as TF import qualified Data.ByteString as BS import Codec.Binary.UTF8.String mkUnmanagedWindow :: Display -> Screen -> Window -> Position -> Position -> Dimension -> Dimension -> IO Window mkUnmanagedWindow d s rw x y w h = do let visual = defaultVisualOfScreen s attrmask = cWOverrideRedirect allocaSetWindowAttributes $ \attributes -> do set_override_redirect attributes True createWindow d rw x y w h 0 (defaultDepthOfScreen s) inputOutput visual attrmask attributes newHintWindow :: Display -> IO (Window,GC) newHintWindow dpy = do let win = defaultRootWindow dpy blk = blackPixel dpy $ defaultScreen dpy wht = whitePixel dpy $ defaultScreen dpy scn = defaultScreenOfDisplay dpy (_,_,_,_,_,x,y,_) <- queryPointer dpy win nw <- createSimpleWindow dpy win (fromIntegral x) (fromIntegral y) 2 2 1 blk wht mapWindow dpy nw gc <- createGC dpy nw return (nw,gc)
netogallo/XHints
src/XMonad/Actions/XHints/Render.hs
Haskell
bsd-3-clause
1,227
// An object that encapsulates everything we need to run a 'find' // operation, encoded in the REST API format. var Parse = require('parse/node').Parse; import { default as FilesController } from './Controllers/FilesController'; // restOptions can include: // skip // limit // order // count // include // keys // redirectClassNameForKey function RestQuery(config, auth, className, restWhere = {}, restOptions = {}) { this.config = config; this.auth = auth; this.className = className; this.restWhere = restWhere; this.response = null; this.findOptions = {}; if (!this.auth.isMaster) { this.findOptions.acl = this.auth.user ? [this.auth.user.id] : null; if (this.className == '_Session') { if (!this.findOptions.acl) { throw new Parse.Error(Parse.Error.INVALID_SESSION_TOKEN, 'This session token is invalid.'); } this.restWhere = { '$and': [this.restWhere, { 'user': { __type: 'Pointer', className: '_User', objectId: this.auth.user.id } }] }; } } this.doCount = false; // The format for this.include is not the same as the format for the // include option - it's the paths we should include, in order, // stored as arrays, taking into account that we need to include foo // before including foo.bar. Also it should dedupe. // For example, passing an arg of include=foo.bar,foo.baz could lead to // this.include = [['foo'], ['foo', 'baz'], ['foo', 'bar']] this.include = []; for (var option in restOptions) { switch(option) { case 'keys': this.keys = new Set(restOptions.keys.split(',')); this.keys.add('objectId'); this.keys.add('createdAt'); this.keys.add('updatedAt'); break; case 'count': this.doCount = true; break; case 'skip': case 'limit': this.findOptions[option] = restOptions[option]; break; case 'order': var fields = restOptions.order.split(','); var sortMap = {}; for (var field of fields) { if (field[0] == '-') { sortMap[field.slice(1)] = -1; } else { sortMap[field] = 1; } } this.findOptions.sort = sortMap; break; case 'include': var paths = restOptions.include.split(','); var pathSet = {}; for (var path of paths) { // Add all prefixes with a .-split to pathSet var parts = path.split('.'); for (var len = 1; len <= parts.length; len++) { pathSet[parts.slice(0, len).join('.')] = true; } } this.include = Object.keys(pathSet).sort((a, b) => { return a.length - b.length; }).map((s) => { return s.split('.'); }); break; case 'redirectClassNameForKey': this.redirectKey = restOptions.redirectClassNameForKey; this.redirectClassName = null; break; default: throw new Parse.Error(Parse.Error.INVALID_JSON, 'bad option: ' + option); } } } // A convenient method to perform all the steps of processing a query // in order. // Returns a promise for the response - an object with optional keys // 'results' and 'count'. // TODO: consolidate the replaceX functions RestQuery.prototype.execute = function() { return Promise.resolve().then(() => { return this.buildRestWhere(); }).then(() => { return this.runFind(); }).then(() => { return this.runCount(); }).then(() => { return this.handleInclude(); }).then(() => { return this.response; }); }; RestQuery.prototype.buildRestWhere = function() { return Promise.resolve().then(() => { return this.getUserAndRoleACL(); }).then(() => { return this.redirectClassNameForKey(); }).then(() => { return this.validateClientClassCreation(); }).then(() => { return this.replaceSelect(); }).then(() => { return this.replaceDontSelect(); }).then(() => { return this.replaceInQuery(); }).then(() => { return this.replaceNotInQuery(); }); } // Uses the Auth object to get the list of roles, adds the user id RestQuery.prototype.getUserAndRoleACL = function() { if (this.auth.isMaster || !this.auth.user) { return Promise.resolve(); } return this.auth.getUserRoles().then((roles) => { roles.push(this.auth.user.id); this.findOptions.acl = roles; return Promise.resolve(); }); }; // Changes the className if redirectClassNameForKey is set. // Returns a promise. RestQuery.prototype.redirectClassNameForKey = function() { if (!this.redirectKey) { return Promise.resolve(); } // We need to change the class name based on the schema return this.config.database.redirectClassNameForKey( this.className, this.redirectKey).then((newClassName) => { this.className = newClassName; this.redirectClassName = newClassName; }); }; // Validates this operation against the allowClientClassCreation config. RestQuery.prototype.validateClientClassCreation = function() { let sysClass = ['_User', '_Installation', '_Role', '_Session', '_Product']; if (this.config.allowClientClassCreation === false && !this.auth.isMaster && sysClass.indexOf(this.className) === -1) { return this.config.database.collectionExists(this.className).then((hasClass) => { if (hasClass === true) { return Promise.resolve(); } throw new Parse.Error(Parse.Error.OPERATION_FORBIDDEN, 'This user is not allowed to access ' + 'non-existent class: ' + this.className); }); } else { return Promise.resolve(); } }; // Replaces a $inQuery clause by running the subquery, if there is an // $inQuery clause. // The $inQuery clause turns into an $in with values that are just // pointers to the objects returned in the subquery. RestQuery.prototype.replaceInQuery = function() { var inQueryObject = findObjectWithKey(this.restWhere, '$inQuery'); if (!inQueryObject) { return; } // The inQuery value must have precisely two keys - where and className var inQueryValue = inQueryObject['$inQuery']; if (!inQueryValue.where || !inQueryValue.className) { throw new Parse.Error(Parse.Error.INVALID_QUERY, 'improper usage of $inQuery'); } var subquery = new RestQuery( this.config, this.auth, inQueryValue.className, inQueryValue.where); return subquery.execute().then((response) => { var values = []; for (var result of response.results) { values.push({ __type: 'Pointer', className: inQueryValue.className, objectId: result.objectId }); } delete inQueryObject['$inQuery']; if (Array.isArray(inQueryObject['$in'])) { inQueryObject['$in'] = inQueryObject['$in'].concat(values); } else { inQueryObject['$in'] = values; } // Recurse to repeat return this.replaceInQuery(); }); }; // Replaces a $notInQuery clause by running the subquery, if there is an // $notInQuery clause. // The $notInQuery clause turns into a $nin with values that are just // pointers to the objects returned in the subquery. RestQuery.prototype.replaceNotInQuery = function() { var notInQueryObject = findObjectWithKey(this.restWhere, '$notInQuery'); if (!notInQueryObject) { return; } // The notInQuery value must have precisely two keys - where and className var notInQueryValue = notInQueryObject['$notInQuery']; if (!notInQueryValue.where || !notInQueryValue.className) { throw new Parse.Error(Parse.Error.INVALID_QUERY, 'improper usage of $notInQuery'); } var subquery = new RestQuery( this.config, this.auth, notInQueryValue.className, notInQueryValue.where); return subquery.execute().then((response) => { var values = []; for (var result of response.results) { values.push({ __type: 'Pointer', className: notInQueryValue.className, objectId: result.objectId }); } delete notInQueryObject['$notInQuery']; if (Array.isArray(notInQueryObject['$nin'])) { notInQueryObject['$nin'] = notInQueryObject['$nin'].concat(values); } else { notInQueryObject['$nin'] = values; } // Recurse to repeat return this.replaceNotInQuery(); }); }; // Replaces a $select clause by running the subquery, if there is a // $select clause. // The $select clause turns into an $in with values selected out of // the subquery. // Returns a possible-promise. RestQuery.prototype.replaceSelect = function() { var selectObject = findObjectWithKey(this.restWhere, '$select'); if (!selectObject) { return; } // The select value must have precisely two keys - query and key var selectValue = selectObject['$select']; // iOS SDK don't send where if not set, let it pass if (!selectValue.query || !selectValue.key || typeof selectValue.query !== 'object' || !selectValue.query.className || Object.keys(selectValue).length !== 2) { throw new Parse.Error(Parse.Error.INVALID_QUERY, 'improper usage of $select'); } var subquery = new RestQuery( this.config, this.auth, selectValue.query.className, selectValue.query.where); return subquery.execute().then((response) => { var values = []; for (var result of response.results) { values.push(result[selectValue.key]); } delete selectObject['$select']; if (Array.isArray(selectObject['$in'])) { selectObject['$in'] = selectObject['$in'].concat(values); } else { selectObject['$in'] = values; } // Keep replacing $select clauses return this.replaceSelect(); }) }; // Replaces a $dontSelect clause by running the subquery, if there is a // $dontSelect clause. // The $dontSelect clause turns into an $nin with values selected out of // the subquery. // Returns a possible-promise. RestQuery.prototype.replaceDontSelect = function() { var dontSelectObject = findObjectWithKey(this.restWhere, '$dontSelect'); if (!dontSelectObject) { return; } // The dontSelect value must have precisely two keys - query and key var dontSelectValue = dontSelectObject['$dontSelect']; if (!dontSelectValue.query || !dontSelectValue.key || typeof dontSelectValue.query !== 'object' || !dontSelectValue.query.className || Object.keys(dontSelectValue).length !== 2) { throw new Parse.Error(Parse.Error.INVALID_QUERY, 'improper usage of $dontSelect'); } var subquery = new RestQuery( this.config, this.auth, dontSelectValue.query.className, dontSelectValue.query.where); return subquery.execute().then((response) => { var values = []; for (var result of response.results) { values.push(result[dontSelectValue.key]); } delete dontSelectObject['$dontSelect']; if (Array.isArray(dontSelectObject['$nin'])) { dontSelectObject['$nin'] = dontSelectObject['$nin'].concat(values); } else { dontSelectObject['$nin'] = values; } // Keep replacing $dontSelect clauses return this.replaceDontSelect(); }) }; // Returns a promise for whether it was successful. // Populates this.response with an object that only has 'results'. RestQuery.prototype.runFind = function() { return this.config.database.find( this.className, this.restWhere, this.findOptions).then((results) => { if (this.className == '_User') { for (var result of results) { delete result.password; } } this.config.filesController.expandFilesInObject(this.config, results); if (this.keys) { var keySet = this.keys; results = results.map((object) => { var newObject = {}; for (var key in object) { if (keySet.has(key)) { newObject[key] = object[key]; } } return newObject; }); } if (this.redirectClassName) { for (var r of results) { r.className = this.redirectClassName; } } this.response = {results: results}; }); }; // Returns a promise for whether it was successful. // Populates this.response.count with the count RestQuery.prototype.runCount = function() { if (!this.doCount) { return; } this.findOptions.count = true; delete this.findOptions.skip; delete this.findOptions.limit; return this.config.database.find( this.className, this.restWhere, this.findOptions).then((c) => { this.response.count = c; }); }; // Augments this.response with data at the paths provided in this.include. RestQuery.prototype.handleInclude = function() { if (this.include.length == 0) { return; } var pathResponse = includePath(this.config, this.auth, this.response, this.include[0]); if (pathResponse.then) { return pathResponse.then((newResponse) => { this.response = newResponse; this.include = this.include.slice(1); return this.handleInclude(); }); } else if (this.include.length > 0) { this.include = this.include.slice(1); return this.handleInclude(); } return pathResponse; }; // Adds included values to the response. // Path is a list of field names. // Returns a promise for an augmented response. function includePath(config, auth, response, path) { var pointers = findPointers(response.results, path); if (pointers.length == 0) { return response; } var className = null; var objectIds = {}; for (var pointer of pointers) { if (className === null) { className = pointer.className; } else { if (className != pointer.className) { throw new Parse.Error(Parse.Error.INVALID_JSON, 'inconsistent type data for include'); } } objectIds[pointer.objectId] = true; } if (!className) { throw new Parse.Error(Parse.Error.INVALID_JSON, 'bad pointers'); } // Get the objects for all these object ids var where = {'objectId': {'$in': Object.keys(objectIds)}}; var query = new RestQuery(config, auth, className, where); return query.execute().then((includeResponse) => { var replace = {}; for (var obj of includeResponse.results) { obj.__type = 'Object'; obj.className = className; if(className == "_User"){ delete obj.sessionToken; } replace[obj.objectId] = obj; } var resp = { results: replacePointers(response.results, path, replace) }; if (response.count) { resp.count = response.count; } return resp; }); } // Object may be a list of REST-format object to find pointers in, or // it may be a single object. // If the path yields things that aren't pointers, this throws an error. // Path is a list of fields to search into. // Returns a list of pointers in REST format. function findPointers(object, path) { if (object instanceof Array) { var answer = []; for (var x of object) { answer = answer.concat(findPointers(x, path)); } return answer; } if (typeof object !== 'object') { throw new Parse.Error(Parse.Error.INVALID_QUERY, 'can only include pointer fields'); } if (path.length == 0) { if (object.__type == 'Pointer') { return [object]; } throw new Parse.Error(Parse.Error.INVALID_QUERY, 'can only include pointer fields'); } var subobject = object[path[0]]; if (!subobject) { return []; } return findPointers(subobject, path.slice(1)); } // Object may be a list of REST-format objects to replace pointers // in, or it may be a single object. // Path is a list of fields to search into. // replace is a map from object id -> object. // Returns something analogous to object, but with the appropriate // pointers inflated. function replacePointers(object, path, replace) { if (object instanceof Array) { return object.map((obj) => replacePointers(obj, path, replace)); } if (typeof object !== 'object') { return object; } if (path.length == 0) { if (object.__type == 'Pointer') { return replace[object.objectId]; } return object; } var subobject = object[path[0]]; if (!subobject) { return object; } var newsub = replacePointers(subobject, path.slice(1), replace); var answer = {}; for (var key in object) { if (key == path[0]) { answer[key] = newsub; } else { answer[key] = object[key]; } } return answer; } // Finds a subobject that has the given key, if there is one. // Returns undefined otherwise. function findObjectWithKey(root, key) { if (typeof root !== 'object') { return; } if (root instanceof Array) { for (var item of root) { var answer = findObjectWithKey(item, key); if (answer) { return answer; } } } if (root && root[key]) { return root; } for (var subkey in root) { var answer = findObjectWithKey(root[subkey], key); if (answer) { return answer; } } } module.exports = RestQuery;
aneeshd16/parse-server
src/RestQuery.js
JavaScript
bsd-3-clause
17,157