code
stringlengths
3
1.01M
repo_name
stringlengths
5
116
path
stringlengths
3
311
language
stringclasses
30 values
license
stringclasses
15 values
size
int64
3
1.01M
MultiCAS === [![Latest Version on Packagist][ico-version]][link-packagist] [![Software License][ico-license]](LICENSE.md) [![Build Status][ico-travis]][link-travis] [![Total Downloads][ico-downloads]][link-downloads] Multi CAS server SSO authentication in Laravel 5.x this version base on xavrsl/cas v1.2.5 Compatible with the original version usage,thank author. this version only use on multi diffent domain cas server in same project ## Installation Require this package in your composer.json and run composer update. For Laravel 5: composer require liyunde/laravel5-multi-cas After updating composer, add the ServiceProvider to the providers array: For Laravel 5: config/app.php ```php MultiCas\CasServiceProvider::class, ``` As well as the Facade : ```php 'Cas' => MultiCas\Facades\Cas::class, ``` Then publish the package's config using one of those methods : For Laravel 5 : ``` $ php artisan vendor:publish ``` Configuration == Configuration should be pretty straightforward for anyone who's ever used the phpCAS client. Using the .env file will allow you to have different environments without even touching the cas.php config file. I've added the possibility to easily turn your application into a CAS Proxy, a CAS Service or both. You only need to set the cas_proxy setting to true (if you need to proxy services) and set the cas_service to whatever proxy you want to allow (this is all explained in the config file). A new config variable (cas_pretend_user) available in the release allows you to pretend to be a selected CAS user. The idea came with the usage of laravel homestead. My application was running on a private network, on a fake domain. The CAS server was not able to redirect to that application. So activating the CAS plugin on that application was not possible, but I needed a user id to query my LDAP and allow/disallow the user in my application. You only need to give it a user id and the application will act just as if you ware logged in with that CAS user. Usage == Authenticate against the CAS server. This should be called before trying to retrieve the CAS user id. ```php Cas::authenticate(); OR Cas::default()->authenticate(); ``` Then get the current user id this way : ```php Cas::getCurrentUser(); OR Cas::user(); Cas::default()->user(); ```
liyunde/laravel5-multi-cas
README.md
Markdown
mit
2,333
--- layout: post title: "Welcome to Williamsburg!" date: 2014-08-29 14:34:25 categories: jekyll update tags: image: /assets/article_images/2014-08-29-welcome-to-jekyll/desktop.jpg --- You’ll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `jekyll serve --watch`, which launches a web server and auto-regenerates your site when a file is updated. To add new posts, simply add a file in the `_posts` directory that follows the convention `YYYY-MM-DD-name-of-post.ext` and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works. Jekyll also offers powerful support for code snippets: {% highlight ruby %} def print_hi(name) puts "Hi, #{name}" end print_hi('Tom') #=> prints 'Hi, Tom' to STDOUT. {% endhighlight %} Check out the [Jekyll docs][jekyll] for more info on how to get the most out of Jekyll. File all bugs/feature requests at [Jekyll’s GitHub repo][jekyll-gh]. If you have questions, you can ask them on [Jekyll’s dedicated Help repository][jekyll-help]. {% highlight js %} <footer class="site-footer"> <a class="subscribe" href="{{ "/feed.xml" | prepend: site.baseurl }}"> <span class="tooltip"> <i class="fa fa-rss"></i> Subscribe!</span></a> <div class="inner">a <section class="copyright">All content copyright <a href="mailto:{{ site.email}}">{{ site.name }}</a> &copy; {{ site.time | date: '%Y' }} &bull; All rights reserved.</section> <section class="poweredby">Made with <a href="http://jekyllrb.com"> Jekyll</a></section> </div> </footer> {% endhighlight %} [jekyll]: http://jekyllrb.com [jekyll-gh]: https://github.com/jekyll/jekyll [jekyll-help]: https://github.com/jekyll/jekyll-help
NorthBrooklynAirBnB/northbrooklynairbnb.github.com
_posts/2014-08-29-welcome-to-jekyll.markdown
Markdown
mit
1,839
{{/* Pages Widget */}} {{/* Initialise */}} {{ $ := .root }} {{ $st := .page }} {{ $items_type := $st.Params.content.page_type | default "post" }} {{ $items_offset := $st.Params.content.offset | default 0 }} {{ $items_count := $st.Params.content.count }} {{ if eq $items_count 0 }} {{ $items_count = 65535 }} {{ else }} {{ $items_count = $items_count | default 5 }} {{ end }} {{ $items_sort := $st.Params.content.order | default "desc" }} {{/* Query */}} {{ $query := where site.RegularPages "Type" $items_type }} {{ $archive_page := site.GetPage "Section" $items_type }} {{/* Filters */}} {{ if $st.Params.content.filters.tag }} {{ $archive_page = site.GetPage (printf "tags/%s" (urlize $st.Params.content.filters.tag)) }} {{ $query = $query | intersect $archive_page.Pages }} {{ end }} {{ if $st.Params.content.filters.category }} {{ $archive_page = site.GetPage (printf "categories/%s" (urlize $st.Params.content.filters.category)) }} {{ $query = $query | intersect $archive_page.Pages }} {{ end }} {{ if $st.Params.content.filters.publication_type }} {{ $archive_page = site.GetPage (printf "publication_types/%s" $st.Params.content.filters.publication_type) }} {{ $query = $query | intersect $archive_page.Pages }} {{ end }} {{ if $st.Params.content.filters.author }} {{ $archive_page = site.GetPage (printf "authors/%s" (urlize $st.Params.content.filters.author)) }} {{ $query = $query | intersect $archive_page.Pages }} {{ end }} {{ if $st.Params.content.filters.exclude_featured }} {{ $query = where $query "Params.featured" "!=" true }} {{ end }} {{ if $st.Params.content.filters.exclude_past }} {{ $query = where $query "Date" ">=" now }} {{ end }} {{ if $st.Params.content.filters.exclude_future }} {{ $query = where $query "Date" "<" now }} {{ end }} {{ $count := len $query }} {{/* Sort */}} {{ $sort_by := "Date" }} {{ $query = sort $query $sort_by $items_sort }} {{/* Offset and Limit */}} {{ if gt $items_offset 0 }} {{ $query = first $items_count (after $items_offset $query) }} {{ else }} {{ $query = first $items_count $query }} {{ end }} {{/* Localisation */}} {{ $i18n := "" }} {{ if eq $items_type "post" }} {{ $i18n = "more_posts" }} {{ else if eq $items_type "talk" }} {{ $i18n = "more_talks" }} {{ else if eq $items_type "publication" }} {{ $i18n = "more_publications" }} {{ else }} {{ $i18n = "more_pages" }} {{ end }} <div class="row"> <div class="col-12 col-lg-4 section-heading"> <h1>{{ with $st.Title }}{{ . | markdownify | emojify }}{{ end }}</h1> {{ with $st.Params.subtitle }}<p>{{ . | markdownify | emojify }}</p>{{ end }} </div> <div class="col-12 col-lg-8"> {{ with $st.Content }}{{ . }}{{ end }} {{ range $post := $query }} {{ if eq $st.Params.design.view 1 }} {{ partial "li_list" . }} {{ else if eq $st.Params.design.view 3 }} {{ partial "li_card" . }} {{ else if eq $st.Params.design.view 4 | and (eq $items_type "publication") }} {{ partial "li_citation" . }} {{ else }} {{ partial "li_compact" . }} {{ end }} {{end}} {{ if gt $count $items_count }} <div class="see-all"> <a href="{{ $archive_page.RelPermalink }}"> {{ i18n $i18n | default "See all" }} <i class="fas fa-angle-right"></i> </a> </div> {{ end }} </div> </div>
docmanny/docmanny.github.io
themes/hugo-academic/layouts/partials/widgets/pages.html
HTML
mit
3,349
const Sequelize = require('sequelize'), connection = require('./sequelize.js'); const attributes = { id: { type: Sequelize.UUID, primaryKey: true, defaultValue: Sequelize.UUIDV4 }, username: { type: Sequelize.STRING, allowNull: false, unique: true, validate: { is: /^[a-z0-9\_\-]+$/i, len: [2,15] } }, email: { type: Sequelize.STRING, unique: true, validate: { isEmail: true } }, displayName: { type: Sequelize.STRING, allowNull: false, }, bio: { type: Sequelize.STRING }, location: { type: Sequelize.STRING }, avatar: { type: Sequelize.STRING }, password: { type: Sequelize.STRING }, title: { type: Sequelize.STRING }, salt: { type: Sequelize.STRING }, createdAt: { type: Sequelize.DATE, defaultValue: Sequelize.NOW } }; const options = { freezeTableName: true, toJSON: function () { var values = Object.assign({}, this.get()); // Killing unneded values for our http response. delete values.email; delete values.password; delete values.salt; delete values.createdAt; delete values.updatedAt; return values; } } const User = connection.define('users', attributes, options); module.exports = User;
WikiWebOrg/wikiweb-dot-org
app/model/user.js
JavaScript
mit
1,284
package iurii.job.interview.cracking; import java.util.ArrayList; import java.util.List; import java.util.Stack; /** * Stacks and Queues */ public class CrackingCodingInterview3 { /** * 3.1 implement 3 stacks using one array. * This can be done in two ways. * 1) just divide array into 3 equal part (we do not know how stacks can be used). * 2) have pointers to previous blocks. each stack can grow while there are free space. * Problem appears when pop() operations are done and we do not track which blocks are free. * Extra array O(n) can be used to track free blocks. * <p> * Implementation with three equal */ public static class ArrayThreeStack { private int[] array = new int[99]; private int[] head = new int[3]; { head[0] = 0; head[1] = 33; head[2] = 66; } public void push(int stackNumber, int number) { array[head[stackNumber]++] = number; } public int pop(int stackNumber) { if (array.length / 3 * stackNumber > head[stackNumber] - 1) { throw new IllegalStateException(); } return array[--head[stackNumber]]; } } /** * 3.2 Implement stack to support min() operation. * Will use additional stack which will be used for adding value if it is min than the head * On pop operation we will pop from second stack * if min is poped. So head of the stack will contain correct min */ public static class MinStack extends Stack<Integer> { /** * */ private static final long serialVersionUID = -373249160326880405L; private Stack<Integer> minStack = new Stack<Integer>(); @Override public Integer push(Integer value) { if (value <= min()) { minStack.push(value); } return super.push(value); } @Override public Integer pop() { int popValue = super.pop(); if (popValue == minStack.peek()) { minStack.pop(); } return popValue; } public Integer min() { if (minStack.isEmpty()) { return Integer.MAX_VALUE; } else { return minStack.peek(); } } } /** * 3.3 implement Stack of stacks */ public static class SetOfStacks { private List<Stack<Integer>> stacks = new ArrayList<Stack<Integer>>(); private final int capacity; public SetOfStacks(int capacity) { this.capacity = capacity; } public Integer push(Integer value) { Stack<Integer> stack = getCurrentStack(); if (stack == null || stack.size() == capacity) { stack = new Stack<>(); stacks.add(stack); } return stack.push(value); } public Integer pop() { Stack<Integer> stack = getCurrentStack(); if (stack.isEmpty()) { stacks.remove(stack); stack = getCurrentStack(); } return stack.pop(); } private Stack<Integer> getCurrentStack() { if (stacks.isEmpty()) { return null; } else { return stacks.get(stacks.size() - 1); } } } /** * 3.4 implement Hanoi towers */ public static class Tower { private Stack<Integer> tower = new Stack<Integer>(); private final int index; public Tower(int index) { this.index = index; } public int index() { return index; } public void add(int d) { if (!tower.isEmpty() && tower.peek() < d) { throw new IllegalStateException(); } tower.push(d); } public void moveTopTo(Tower t) { t.add(tower.pop()); } public void moveDisks(int n, Tower destination, Tower buffer) { if (n > 0) { moveDisks(n - 1, buffer, destination); moveTopTo(destination); buffer.moveDisks(n - 1, destination, this); } } } /** * 3.5 Implement Queue using two stacks * * https://www.youtube.com/watch?v=m7ZYJkvWwlE * * https://www.glassdoor.com/Interview * /How-to-implement-a-queue-simply-using-two-stacks-and-how-to-implement-a-highly-efficient-queue-using-two-stacks-QTN_41158.htm * * */ public static class MyQueueBasedOnTwoStacks { private Stack<Integer> inbound = new Stack<Integer>(); private Stack<Integer> outbound = new Stack<Integer>(); public Integer push(Integer el) { inbound.push(el); return el; } public Integer pop() { if (outbound.isEmpty()) { while (!inbound.isEmpty()) { outbound.push(inbound.pop()); } } return outbound.pop(); } public Integer peek() { if (outbound.isEmpty()) { while (!inbound.isEmpty()) { outbound.push(inbound.pop()); } } return outbound.peek(); } public int size() { return inbound.size() + outbound.size(); } } /** * 3.5.1 Implement Queue using only one stack (+ Function call stack) * * https://www.youtube.com/watch?v=m7ZYJkvWwlE */ public static class MyQueueBasedOnOneStack { private Stack<Integer> inbound = new Stack<Integer>(); public Integer push(Integer el) { inbound.push(el); return el; } public Integer pop() { if (inbound.size() == 1) { return inbound.pop(); } else { Integer value = inbound.pop(); Integer result = pop(); inbound.push(value); return result; } } public Integer peek() { if (inbound.size() == 1) { return inbound.peek(); } else { Integer value = inbound.pop(); Integer result = peek(); inbound.push(value); return result; } } public int size() { return inbound.size(); } } /** * 3.6 Sort Stack using peek, pop, push, isEmpty. O(n^2) time no extra memory. */ public static Stack<Integer> sort(Stack<Integer> source) { Stack<Integer> result = new Stack<Integer>(); while (!source.isEmpty()) { Integer el = source.pop(); while (!result.isEmpty() && result.peek() < el) { source.push(result.pop()); } result.push(el); } return result; } }
Iurii-Dziuban/algorithms
src/main/java/iurii/job/interview/cracking/CrackingCodingInterview3.java
Java
mit
7,097
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="sl-SI"> <head profile="http://gmpg.org/xfn/11"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Dajte svoje namizje v souporabo</title> <link rel="stylesheet" type="text/css" href="../vodnik_1404.css"> <link rel="stylesheet" type="text/css" > <script type="text/javascript" src="jquery.js"></script><script type="text/javascript" src="jquery.syntax.js"></script><script type="text/javascript" src="yelp.js"></script> </head> <body><div id="wrapper" class="hfeed"> <div id="header"> <div id="branding"> <div id="blog-title"><span><a rel="home" title="Ubuntu Slovenija | Uradna spletna stran slovenske skupnosti Linux distribucije Ubuntu" href="https://www.ubuntu.si/">Ubuntu Slovenija | Uradna spletna stran slovenske skupnosti Linux distribucije Ubuntu</a></span></div> <h1 id="blog-description"></h1> </div> <div id="access"><div id="loco-header-menu"><ul id="primary-header-menu"><li class="widget-container widget_nav_menu" id="nav_menu-3"><div class="menu-glavni-meni-container"><ul class="menu" id="menu-glavni-meni"> <li id="menu-item-15" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-15"><a href="/">Novice</a></li> <li id="menu-item-16" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-16"><a href="/punbb/">Forum</a></li> <li id="menu-item-19" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-19"><a href="http://www.ubuntu.si/wordpress/kaj-je-ubuntu/">Kaj je Ubuntu?</a></li> <li id="menu-item-20" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-20"><a href="http://www.ubuntu.si/wordpress/pogosta_vprasanja/">Pogosta vprašanja</a></li> <li id="menu-item-17" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-17"><a href="http://www.ubuntu.si/wordpress/skupnost/">Skupnost</a></li> <li id="menu-item-18" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-18"><a href="http://www.ubuntu.si/wordpress/povezave/">Povezave</a></li> </ul></div></li></ul></div></div> </div> <div id="main"><div id="container"><div id="content"> <!-- Piwik Image Tracker --><img src="https://piwik-ubuntusi.rhcloud.com/piwik.php?idsite=1&amp;rec=1" style="border:0" alt="" /><!-- End Piwik --> </script> <div class="trails"><div class="trail"> <a class="trail" href="index.html" title="Namizni vodnik Ubuntu"><span class="media media-image"><img src="figures/ubuntu-logo.png" height="16" width="16" alt="Pomoč"></span> Namizni vodnik Ubuntu</a> » <a class="trail" href="net.html" title="Omreženje, splet, pošta in klepet">Omreženje, splet, pošta in klepet</a> » <a class="trail" href="sharing.html" title="Souporaba">Souporaba</a> » </div></div> <div class="hgroup"><h1 class="title"><span class="title">Dajte svoje namizje v souporabo</span></h1></div> <div class="region"> <div class="contents"> <p class="p">Drugim lahko pustite, da si iz drugega računalnika s programom, ki lahko spremlja namizje, ogledujejo in nadzirajo vaše namizje. Da dovolite drugim, da dostopajo do vašega namizja, nastavite <span class=" app">Deljenje namizja</span> in možnosti varnosti.</p> <div class="steps"><div class="inner"><div class="region"><ol class="steps"> <li class="steps"><p class="p">V <span class=" gui">pregledni plošči</span> odprite <span class=" app">Souporaba namizja</span></p></li> <li class="steps"><p class="p">Če želite, da lahko drugi delajo z vašim namizje, omogoči možnosti <span class=" gui">Dovoli drugim uporabnikom ogled mojega namizja</span>. To pomeni, da se bodo drugi ljudje lahko povezali z vašim računalnikom.</p></li> <li class="steps"><p class="p">Da bi drugim pustili delo z vašim namizjem, omogočite možnost <span class=" gui">Drugim uporabnikom dovoli nadzor mojega namizja</span>. To bo morda drugi osebi dovolilo premik vaše miške, poganjanje programov in brskanje med datotekami na računalniku, odvisno od varnostnih nastavitev, ki jih trenutno uporabljate.</p></li> </ol></div></div></div> </div> <div id="security" class="sect"><div class="inner"> <div class="hgroup"><h2 class="title"><span class="title">Varnost</span></h2></div> <div class="region"><div class="contents"> <p class="p">Pomembno je, da dobro premislite, kaj vsaka možnost varnosti pomeni, preden jo spremenite.</p> <div class="terms"><div class="inner"><div class="region"><dl class="terms"> <dt class="terms">Potrdite dostop do vašega računalnika</dt> <dd class="terms"> <p class="p">Če želite izbrati ali želite nekomu omogočiti dostop do svojega namizja, izberite <span class=" gui">Potrditi morate vsak dostop do tega računalnika</span>. V primeru da to možnost onemogočite, ne boste vprašani ali želite nekomu dovoliti povezavo s svojim računalnikom.</p> <div class="note note-tip" title="Namig"><div class="inner"><div class="region"><div class="contents"><p class="p">Ta možnost je privzeto omogočena</p></div></div></div></div> </dd> <dt class="terms">Omogoči geslo</dt> <dd class="terms"> <p class="p">Če želite, da morajo drugi ljudje za povezavo z vašim namizjem vnesti geslo, izberite <span class=" gui">Zahtevaj, da uporabnik vnese to geslo</span>. Če te možnosti ne uporabite, si lahko kdorkoli poskusi ogledati vaše namizje.</p> <div class="note note-tip" title="Namig"><div class="inner"><div class="region"><div class="contents"><p class="p">Ta možnost je privzeto onemogočena, vendar je pametno, da jo omogočite in nastavite varno geslo.</p></div></div></div></div> </dd> <dt class="terms">Dovolite drugim dostop do svojega namizja preko Interneta</dt> <dd class="terms"> <p class="p">V primeru da vaš usmerjevalnik podpira Protokol UPnP Internet Gateway Device in je omogočen, lahko drugim ljudem, ki niso na vašem krajevnem omrežju, dovolite ogled vašega namizja. Za omogočitev tega izberite <span class=" gui">Samodejno nastavi usmerjevalnik UPnP za odprtje in posredovanje vrat</span>. Namesto tega lahko svoj usmerjevalnik nastavite ročno.</p> <div class="note note-tip" title="Namig"><div class="inner"><div class="region"><div class="contents"><p class="p">Ta možnost je privzeto onemogočena.</p></div></div></div></div> </dd> </dl></div></div></div> </div></div> </div></div> <div id="notification-icon" class="sect"><div class="inner"> <div class="hgroup"><h2 class="title"><span class="title">Pokaži ikono obvestilnega področja</span></h2></div> <div class="region"><div class="contents"> <p class="p">Da bi lahko prekinili povezavo z nekom, ki si ogleduje vaše namizje, morate to možnost omogočiti. V primeru da izberete <span class=" gui">Vedno</span>, bo ta iona vedno vidna ne glede na to ali si kdo ogleduje vaše namizje ali ne.</p> <div class="note note-warning" title="Opozorilo"><div class="inner"><div class="region"><div class="contents"><p class="p">Če onemogočite to možnost, obstaja možnost, ki je odvisna od nastavitev varnosti, da se bo nekdo brez vaše vednosti povezal na vaše namizje.</p></div></div></div></div> </div></div> </div></div> <div class="sect sect-links"> <div class="hgroup"></div> <div class="contents"><div class="links seealsolinks"><div class="inner"> <div class="title"><h2><span class="title">Več podrobnosti</span></h2></div> <div class="region"><ul><li class="links "> <a href="sharing.html" title="Souporaba">Souporaba</a><span class="desc"> — <span class=" link"><a href="sharing-desktop.html" title="Dajte svoje namizje v souporabo">Souporaba namizja</a></span></span> </li></ul></div> </div></div></div> </div> </div> <div class="clear"></div> </div></div></div> <div id="footer"><img src="https://piwik-ubuntusi.rhcloud.com/piwik.php?idsite=1amp;rec=1" style="border:0"><div id="siteinfo"><p>Material v tem dokumentu je na voljo pod prosto licenco. To je prevod dokumentacije Ubuntu, ki jo je sestavila <a href="https://wiki.ubuntu.com/DocumentationTeam">Ubuntu dokumentacijska ekpa za Ubuntu</a>. V slovenščino jo je prevedla skupina <a href="https://wiki.lugos.si/slovenjenje:ubuntu">Ubuntu prevajalcev</a>. Za poročanje napak v prevodih v tej dokumentaciji ali Ubuntuju pošljite sporočilo na <a href="mailto:ubuntu-l10n-slv@lists.ubuntu.com?subject=Prijava%20napak%20v%20prevodih">dopisni seznam</a>.</p></div></div> </div></body> </html>
ubuntu-si/ubuntu.si
vodnik/12.04/sharing-desktop.html
HTML
mit
8,337
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Documentation</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <base href="../"> <link rel="icon" href="images/favicon.ico"/> <link rel="stylesheet" href="css/normalize.css"> <link rel="stylesheet" href="css/base.css"> <link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600;700&display=swap" rel="stylesheet"> <link rel="stylesheet" href="css/template.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" /> <script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script> <script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/js/all.min.js" integrity="sha256-0vuk8LXoyrmCjp1f0O300qo1M75ZQyhH9X3J6d+scmk=" crossorigin="anonymous"></script> <script src="js/search.js"></script> <script defer src="js/searchIndex.js"></script> </head> <body id="top"> <header class="phpdocumentor-header phpdocumentor-section"> <h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">Documentation</a></h1> <input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" /> <label class="phpdocumentor-header__menu-icon" for="menu-button"> <i class="fas fa-bars"></i> </label> <section data-search-form class="phpdocumentor-search"> <label> <span class="visually-hidden">Search for</span> <svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg"> <circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/> <line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/> </svg> <input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled /> </label> </section> <nav class="phpdocumentor-topnav"> <ul class="phpdocumentor-topnav__menu"> </ul> </nav> </header> <main class="phpdocumentor"> <div class="phpdocumentor-section"> <input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" /> <label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button"> Menu </label> <aside class="phpdocumentor-column -four phpdocumentor-sidebar"> <section class="phpdocumentor-sidebar__category"> <h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2> <h4 class="phpdocumentor-sidebar__root-namespace"><a href="namespaces/unitconverter.html"><abbr title="\UnitConverter">UnitConverter</abbr></a></h4> <ul class="phpdocumentor-list"> <li><a href="namespaces/unitconverter-calculator.html"><abbr title="\UnitConverter\Calculator">Calculator</abbr></a></li> <li><a href="namespaces/unitconverter-exception.html"><abbr title="\UnitConverter\Exception">Exception</abbr></a></li> <li><a href="namespaces/unitconverter-registry.html"><abbr title="\UnitConverter\Registry">Registry</abbr></a></li> <li><a href="namespaces/unitconverter-support.html"><abbr title="\UnitConverter\Support">Support</abbr></a></li> <li><a href="namespaces/unitconverter-unit.html"><abbr title="\UnitConverter\Unit">Unit</abbr></a></li> </ul> </section> <section class="phpdocumentor-sidebar__category"> <h2 class="phpdocumentor-sidebar__category-header">Reports</h2> <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3> <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3> <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3> </section> <section class="phpdocumentor-sidebar__category"> <h2 class="phpdocumentor-sidebar__category-header">Indices</h2> <h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3> </section> </aside> <div class="phpdocumentor-column -eight phpdocumentor-content"> <ul class="phpdocumentor-breadcrumbs"> </ul> <article class="phpdocumentor-element -file"> <h2 class="phpdocumentor-content__title">ToHands.php</h2> <h3 id="interfaces_class_traits"> Interfaces, Classes and Traits <a href="#interfaces_class_traits" class="headerlink"><i class="fas fa-link"></i></a> </h3> <dl class="phpdocumentor-table-of-contents"> <dt class="phpdocumentor-table-of-contents__entry -class"><a href="classes/UnitConverter-Calculator-Formula-Length-AstronomicalUnit-ToHands.html"><abbr title="\UnitConverter\Calculator\Formula\Length\AstronomicalUnit\ToHands">ToHands</abbr></a></dt> <dd>Formula to convert astronomial unit values to hands.</dd> </dl> </article> <section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden"> <section class="phpdocumentor-search-results__dialog"> <header class="phpdocumentor-search-results__header"> <h2 class="phpdocumentor-search-results__title">Search results</h2> <button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button> </header> <section class="phpdocumentor-search-results__body"> <ul class="phpdocumentor-search-results__entries"></ul> </section> </section> </section> </div> </div> <a href="files/src-calculator-formula-length-astronomicalunit-tohands.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a> </main> <script> cssVars({}); </script> </body> </html>
jordanbrauer/unit-converter
docs/files/src-calculator-formula-length-astronomicalunit-tohands.html
HTML
mit
6,454
Symfony Standard Editionss ======================== Welcome to the Symfony Standard Edition - a fully-functional Symfony2 application that you can use as the skeleton for your new applications. This document contains information on how to download, install, and start using Symfony. For a more detailed explanation, see the [Installation][1] chapter of the Symfony Documentation. 1) Installing the Standard Edition ---------------------------------- When it comes to installing the Symfony Standard Edition, you have the following options. ### Use Composer (*recommended*) As Symfony uses [Composer][2] to manage its dependencies, the recommended way to create a new project is to use it. If you don't have Composer yet, download it following the instructions on http://getcomposer.org/ or just run the following command: curl -s http://getcomposer.org/installer | php Then, use the `create-project` command to generate a new Symfony application: php composer.phar create-project symfony/framework-standard-edition path/to/install Composer will install Symfony and all its dependencies under the `path/to/install` directory. ### Download an Archive File To quickly test Symfony, you can also download an [archive][3] of the Standard Edition and unpack it somewhere under your web server root directory. If you downloaded an archive "without vendors", you also need to install all the necessary dependencies. Download composer (see above) and run the following command: php composer.phar install 2) Checking your System Configuration ------------------------------------- Before starting coding, make sure that your local system is properly configured for Symfony. Execute the `check.php` script from the command line: php app/check.php The script returns a status code of `0` if all mandatory requirements are met, `1` otherwise. Access the `config.php` script from a browser: http://localhost/path/to/symfony/app/web/config.php If you get any warnings or recommendations, fix them before moving on. 3) Browsing the Demo Application -------------------------------- Congratulations! You're now ready to use Symfony. From the `config.php` page, click the "Bypass configuration and go to the Welcome page" link to load up your first Symfony page. You can also use a web-based configurator by clicking on the "Configure your Symfony Application online" link of the `config.php` page. To see a real-live Symfony page in action, access the following page: web/app_dev.php/demo/hello/Fabien 4) Getting started with Symfony ------------------------------- This distribution is meant to be the starting point for your Symfony applications, but it also contains some sample code that you can learn from and play with. A great way to start learning Symfony is via the [Quick Tour][4], which will take you through all the basic features of Symfony2. Once you're feeling good, you can move onto reading the official [Symfony2 book][5]. A default bundle, `AcmeDemoBundle`, shows you Symfony2 in action. After playing with it, you can remove it by following these steps: * delete the `src/Acme` directory; * remove the routing entry referencing AcmeDemoBundle in `app/config/routing_dev.yml`; * remove the AcmeDemoBundle from the registered bundles in `app/AppKernel.php`; * remove the `web/bundles/acmedemo` directory; * remove the `security.providers`, `security.firewalls.login` and `security.firewalls.secured_area` entries in the `security.yml` file or tweak the security configuration to fit your needs. What's inside? --------------- The Symfony Standard Edition is configured with the following defaults: * Twig is the only configured template engine; * Doctrine ORM/DBAL is configured; * Swiftmailer is configured; * Annotations for everything are enabled. It comes pre-configured with the following bundles: * **FrameworkBundle** - The core Symfony framework bundle * [**SensioFrameworkExtraBundle**][6] - Adds several enhancements, including template and routing annotation capability * [**DoctrineBundle**][7] - Adds support for the Doctrine ORM * [**TwigBundle**][8] - Adds support for the Twig templating engine * [**SecurityBundle**][9] - Adds security by integrating Symfony's security component * [**SwiftmailerBundle**][10] - Adds support for Swiftmailer, a library for sending emails * [**MonologBundle**][11] - Adds support for Monolog, a logging library * [**AsseticBundle**][12] - Adds support for Assetic, an asset processing library * **WebProfilerBundle** (in dev/test env) - Adds profiling functionality and the web debug toolbar * **SensioDistributionBundle** (in dev/test env) - Adds functionality for configuring and working with Symfony distributions * [**SensioGeneratorBundle**][13] (in dev/test env) - Adds code generation capabilities * **AcmeDemoBundle** (in dev/test env) - A demo bundle with some example code All libraries and bundles included in the Symfony Standard Edition are released under the MIT or BSD license. Enjoy! [1]: http://symfony.com/doc/2.3/book/installation.html [2]: http://getcomposer.org/ [3]: http://symfony.com/download [4]: http://symfony.com/doc/2.3/quick_tour/the_big_picture.html [5]: http://symfony.com/doc/2.3/index.html [6]: http://symfony.com/doc/2.3/bundles/SensioFrameworkExtraBundle/index.html [7]: http://symfony.com/doc/2.3/book/doctrine.html [8]: http://symfony.com/doc/2.3/book/templating.html [9]: http://symfony.com/doc/2.3/book/security.html [10]: http://symfony.com/doc/2.3/cookbook/email.html [11]: http://symfony.com/doc/2.3/cookbook/logging/monolog.html [12]: http://symfony.com/doc/2.3/cookbook/assetic/asset_management.html [13]: http://symfony.com/doc/2.3/bundles/SensioGeneratorBundle/index.html
engineer-itpnu/hotell
README.md
Markdown
mit
5,845
var searchData= [ ['lib_2ehpp',['lib.hpp',['../lib_8hpp.html',1,'']]], ['lib_5f8hpp_2ejs',['lib_8hpp.js',['../lib__8hpp_8js.html',1,'']]] ];
bhargavipatel/808X_VO
docs/html/search/files_a.js
JavaScript
mit
145
--- layout: single title: "Prynth lives!" author_name: "Ivan Franco" author_profile: true --- The Prynth site is now live. This is a work in progress so be patient with any missing information. I promise to try to keep it fresh and updated. To stay tuned there's RSS or Facebook links located at the footer.
prynth/prynth.github.io
_posts/2016-09-20-scdmi-site-live.md
Markdown
mit
309
{% extends "WebsiteBundle:Default:index.html.twig" %} {% block title %} <title>{{ partner.pessoa.nome }} - Parceiros - WTIS</title> {% endblock %} {% block metas %} {% set metaPageTopic = 'Wtis Soluções em Tecnologia e Marketing para Web' %} {% set metaPageClassification = 'Wtis Soluções em Tecnologia e Marketing para Web' %} {{ parent() }} <meta name="description" content="{{ partner.pessoa.nome }} é um parceiro credenciado WTIS e pode nos representar em nossos produtos e serviços" /> <meta property="og:title" content="Parceiros Wtis: {{ partner.pessoa.nome }}" /> <meta property="og:description" content="{{ partner.pessoa.nome }} é um parceiro credenciado WTIS e pode nos representar em nossos produtos e serviços" /> <meta property="og:url" content="{{ url(app.request.get('_route'), {slug:app.request.get('slug')}) }}" /> <meta property="og:image" content="{{ app.request.uriForPath('/images/facebook_s.gif') | replace({'/app_dev.php': ''}) }}" /> <meta property="og:phone_number" content="{{ telefoneComercial }}"> {% endblock %} {% block stylesheets %} {{ parent() }} <link href="{{ asset('css/page.partner.css') }}" rel="stylesheet"> {% endblock %} {% block javascripts %} {{ parent() }} <script src="{{ asset('js/pages/partner.js') }}"></script> {% endblock %} {% block body %} <div class="content partner"> <div class="partner-header-bg"> <div class="center-1156"> <div class="fcontent"> {% set arrNomeParceiro = partner.pessoa.nome|split(' ') %} {% set i=0 %} <h1>{% for nome in arrNomeParceiro %}{% set i=i+1 %}{{ (i is divisible by(2) ? '<strong>'~nome~'</strong> ' : nome~' ')|raw }}{% endfor %}</h1> <span>São parceiros como este que fazem a <strong>WTIS</strong> crescer cada dia mais com qualidade e excelência, expandindo nossos ideais para todo o país.</span> <div class="atendimento-opcoes"><a href="{{ path('contato') }}"><strong>Seja você também nosso parceiro</strong> e tenha à sua disposição uma gama de produtos, serviços e soluções prontas para você vender para seus clientes.</a></div> </div> </div> </div> <section id="map"> {{ partner.map|raw }} </section> <section id="gama" class="center-1156"> <h1><strong>{{ partner.pessoa.nome }}</strong> é um parceiro <strong>credenciado WTIS</strong> e pode nos representar nos seguintes produtos e serviços</h1> <ul> {% set i=0 %} {% for produto in partner.servicos %} {% set i=i+1 %} <li data-sr="enter {{ i is divisible by(2) ? 'right' : 'left' }} bottom, and hustle 100px wait 0.{{ (i*2) }}s"> <img src="{{ asset('images/produtos/'~produto.id~'.jpg') }}" alt="{{ produto.nome }}"> <h2>{{ produto.nome }}</h2> <span>{{ produto.descricao }} <a href="{{ produto.url }}" class="link-img">Conheça</a></span> </li> {% if i==4 %}{% set i=0 %}{% endif %} {% endfor %} </ul> <div class="clearfloat"></div> </section> <section id="enderecos" class="center-1156"> <h1>Endereços</h1> <table class="table table-price"> <thead> <tr> <th class="item">Cidade</th> <th class="descricao">Endereço</th> <th class="preco">Contato</th> </tr> </thead> <tbody> {% for endereco in partner.pessoa.enderecos %} {% if endereco.tipoFinalidadeEndereco.descricao=='Principal' %} <tr> <td>{{ endereco.municipio.nome }}, {{ endereco.municipio.uf.nome }}</td> <td>{{ endereco.logradouro }} {{ endereco.complemento }}, {{ endereco.numero }}, {{ endereco.bairro }}. CEP: {{ endereco.cep }}</td> <td>{% set telefone = endereco.pessoa.telefoneByRefer(endereco.id) %}+{{ telefone.areaCode }} ({{ telefone.ddd }}) {{ telefone.telefone }}</td> </tr> {% endif %} {% endfor %} </tbody> </table> </section> <section id="contato" class="center-full cinza dform-contato no-bg"> <div class="center-1156"> <h1>Fale com {{ partner.pessoa.nome }}</h1> <div class="form center-full"> <div class="preload bg-overlay"><div class="preload-div absolute-center"></div></div> <form name="partnerForm" id="partnerForm" class="m1" data-parsley-validate> <label for="i-contato-produto" class="i-contato-produto clearboth"> <span>Produto/Serviço de interesse</span> <select name="i-contato-produto" id="i-contato-produto" class="sm sm-default form-extra" tabindex="1" data-nome="Produto" data-sigla="produto" data-valor="0"> <option value="0" data-noselectable="1">Selecione</option> {% for produto in partner.servicos %} <option>{{ produto.nome }}</option> {% endfor %} </select> </label> <label for="i-contato-filial" class="filial"> <span>Filial</span> <select name="i-contato-filial" id="i-contato-plataforma" class="sm sm-default form-extra" data-nome="Filial" data-sigla="filial" data-valor="0"> {% for endereco in partner.pessoa.enderecos %} <option>{{ endereco.municipio.nome }}, {{ endereco.municipio.uf.nome }}</option> {% endfor %} </select> </label> <label for="i-contato-nome" class="nome clearboth"> <span>Seu nome</span> <input type="text" name="i-contato-nome" id="i-contato-nome" class="input-default" required="required"> </label> <label for="i-contato-email" class="email"> <span>Email</span> <input type="email" name="i-contato-email" id="i-contato-email" class="input-default" required="required"> </label> <label for="i-contato-telefone" class="telefonefixo clearboth"> <span>Telefone fixo</span> <input type="tel" name="i-contato-telefone" id="i-contato-telefone" class="input-default phoneMask" placeholder="DDD + Número"> </label> <label for="i-contato-celular" class="celular"> <span>Celular</span> <input type="tel" name="i-contato-celular" id="i-contato-celular" class="input-default phoneMask" placeholder="DDD + Número"> </label> <label for="i-contato-newsletter" class="newsletter full clearboth"> <input type="checkbox" name="i-contato-newsletter" id="i-contato-newsletter" value="1"> Assine nossa newsletter e receba novidades em seu email </label> <label for="i-contato-mensagem" class="text-right"> <span>Mensagem</span> <textarea maxlength="300" id="i-contato-mensagem" name="i-contato-mensagem" cols="60" rows="5" class="input-textarea"></textarea> <div class="description">máx. 800</div> </label> <div class="clearfloat"></div> <div class="atendimento-opcoes"> <a href="#meligue" class="link-img phone meligue-modal" data-toggle="modal" data-target="#meLigueModal" data-product="Fábrica de Software">Nós ligamos para você<i></i></a> <a href="#chat" class="link-img chat init-chat">Fale conosco via chat<i></i></a> </div> <div class="result"> <input type="hidden" name="i-contato-partner" id="i-contato-partner" class="form-extra" tabindex="1" data-nome="Partner" data-sigla="partner" data-valor="0" value="{{ partner.id }}"> <button type="submit" class="button10 min-radius verde no-icon submit-button">Enviar<i class="glyphicon glyphicon-envelope"></i></button> </div> </form> </div> </div> </section> </div> {% endblock %}
wtis/website
src/WebsiteBundle/Resources/views/Partner/partner.view.html
HTML
mit
8,651
package edu.neu.ccs.cs5004.assignment10; import java.util.List; /** * Represents the main controller of the text document processor. * Created by yanxu on 4/2/17. */ class MainController { /** * Given the command line arguments, checks the validity of the arguments, * if the arguments if valid, process the document and generate the output. * The name of the output contains the name of the original file plus * "_update". * @param args command line arguments * @throws IllegalArgumentException if the arguments are invalid */ void control(String[] args) throws IllegalArgumentException { if (args.length > 1) { throw new IllegalArgumentException( "You should only provide the name of the document"); } if (args.length == 0) { throw new IllegalArgumentException( "You need provide the name of the document"); } FileParser parser = FileParser.create(); List<String> input = parser.parse(args[0]); DocumentProcessor processor = DocumentProcessor.create(); List<String> output = processor.process(input); OutputGenerator generator = new OutputGenerator(); generator.generateOutput(output, args[0] + "_update"); } }
magic-stone/Markdown-Document-Processor
src/main/java/edu/neu/ccs/cs5004/assignment10/MainController.java
Java
mit
1,219
# -*- coding: utf-8 from __future__ import unicode_literals, absolute_import from django.conf.urls import url, include from unach_photo_server.urls import urlpatterns as unach_photo_server_urls urlpatterns = [ url(r'^', include(unach_photo_server_urls, namespace='unach_photo_server')), ]
javierhuerta/unach-photo-server
tests/urls.py
Python
mit
296
# A flashcard web application driven by a machine learning model. Trained on multiple PSLC datasets. Built with python Lentil and Sci-kit packages primarily.
josephtey/Flask-MachineLearning-Flashcards
README.md
Markdown
mit
160
# Œ 700 ‰ --- jYqsrI mhlw 5 Gru 3 <> siqgur pRswid ] koeI jwnY kvnu eIhw jig mIqu ] ijsu hoie ik®pwlu soeI ibiD bUJY qw kI inrml rIiq ]1] rhwau ] mwq ipqw binqw suq bMDp iest mIq Aru BweI ] pUrb jnm ky imly sMjogI AMqih ko n shweI ]1] mukiq mwl kink lwl hIrw mn rMjn kI mwieAw ] hw hw krm ibhwnI AvDih qw mih sMqoKu n pwieAw ]2] hsiq rQ AsÍ pvn qyj DxI BUmn cqurWgw ] sMig n cwilE ien mih kCUAY aUiT isDwieE nWgw ]3] hir ky sMq ipRA pRIqm pRB ky qw kY hir hir gweIAY ] nwnk eIhw suKu AwgY muK aUjl sMig sMqn kY pweIAY ]4]1] jYqsrI mhlw 5 Gru 3 dupdyy <> siqgur pRswid ] dyhu sMdysro khIAau ipRA khIAau ] ibsmu BeI mY bhu ibiD sunqy khhu suhwgin shIAau ]1] rhwau ] ko khqo sB bwhir bwhir ko khqo sB mhIAau ] brnu n dIsY ichnu n lKIAY suhwgin swiq buJhIAau ]1] srb invwsI Git Git vwsI lypu nhI AlphIAau ] nwnku khq sunhu ry logw sMq rsn ko bshIAau ]2]1]2] jYqsrI mÚ 5 ] DIrau suin DIrau pRB kau ]1] rhwau ] jIA pRwn mnu qnu sBu Arpau nIrau pyiK pRB kau nIrau ]1] bysumwr byAMqu bf dwqw mnih ghIrau pyiK pRB kau ]2] jo cwhau soeI soeI pwvau Awsw mnsw pUrau jip pRB kau ]3] gur pRswid nwnk min visAw dUiK n kbhU JUrau buiJ pRB kau ]4]2]3] jYqsrI mhlw 5 ] loVIdVw swjnu myrw ] Gir Gir mMgl gwvhu nIky Git Git iqsih bsyrw ]1] rhwau ] sUiK ArwDnu dUiK ArwDnu ibsrY n kwhU byrw ] nwmu jpq koit sU r aujwrw ibnsY Brmu AMDyrw ]1] Qwin Qnµqir sBnI jweI jo dIsY so qyrw ] sMqsMig pwvY jo nwnk iqsu bhuir n hoeI hY Pyrw ]2]3]4] ####
bogas04/SikhJS
assets/docs/md/SGGS/Ang 700.md
Markdown
mit
1,427
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>cats-in-zfc: 4 m 6 s 🏆</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[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]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.7.2 / cats-in-zfc - 8.7.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> cats-in-zfc <small> 8.7.0 <span class="label label-success">4 m 6 s 🏆</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-02-20 14:01:21 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-02-20 14:01:21 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-num base Num library distributed with the OCaml compiler base-threads base base-unix base camlp5 7.14 Preprocessor-pretty-printer of OCaml conf-findutils 1 Virtual package relying on findutils conf-perl 2 Virtual package relying on perl coq 8.7.2 Formal proof management system num 0 The Num library for arbitrary-precision integer and rational arithmetic ocaml 4.04.2 The OCaml compiler (virtual package) ocaml-base-compiler 4.04.2 Official 4.04.2 release ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.3 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;Hugo.Herbelin@inria.fr&quot; homepage: &quot;https://github.com/coq-contribs/cats-in-zfc&quot; license: &quot;LGPL 2.1&quot; build: [make &quot;-j%{jobs}%&quot;] install: [make &quot;install&quot;] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/CatsInZFC&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.7&quot; &amp; &lt; &quot;8.8~&quot;} ] tags: [ &quot;keyword: set theory&quot; &quot;keyword: ordinal numbers&quot; &quot;keyword: cardinal numbers&quot; &quot;keyword: category theory&quot; &quot;keyword: functors&quot; &quot;keyword: natural transformation&quot; &quot;keyword: limit&quot; &quot;keyword: colimit&quot; &quot;category: Mathematics/Logic/Set theory&quot; &quot;category: Mathematics/Category Theory&quot; &quot;date: 2004-10-10&quot; ] authors: [ &quot;Carlos Simpson &lt;carlos@math.unice.fr&gt; [http://math.unice.fr/~carlos/]&quot; ] bug-reports: &quot;https://github.com/coq-contribs/cats-in-zfc/issues&quot; dev-repo: &quot;git+https://github.com/coq-contribs/cats-in-zfc.git&quot; synopsis: &quot;Category theory in ZFC&quot; description: &quot;&quot;&quot; In a ZFC-like environment augmented by reference to the ambient type theory, we develop some basic set theory, ordinals, cardinals and transfinite induction, and category theory including functors, natural transformations, limits and colimits, functor categories, and the theorem that functor_cat a b has (co)limits if b does.&quot;&quot;&quot; flags: light-uninstall url { src: &quot;https://github.com/coq-contribs/cats-in-zfc/archive/v8.7.0.tar.gz&quot; checksum: &quot;md5=18d7413ca833b8f80cff49d9415e730e&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install 🏜️</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-cats-in-zfc.8.7.0 coq.8.7.2</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam list; echo; ulimit -Sv 4000000; timeout 4h opam install -y --deps-only coq-cats-in-zfc.8.7.0 coq.8.7.2</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>13 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam list; echo; ulimit -Sv 16000000; timeout 4h opam install -y -v coq-cats-in-zfc.8.7.0 coq.8.7.2</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>4 m 6 s</dd> </dl> <h2>Installation size</h2> <p>Total: 8 M</p> <ul> <li>412 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/little_cat.vo</code></li> <li>391 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/limits.vo</code></li> <li>358 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/little_cat.glob</code></li> <li>338 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/order.vo</code></li> <li>288 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/cat_examples.vo</code></li> <li>269 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/colimits.vo</code></li> <li>259 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/cat_examples.glob</code></li> <li>247 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/fmachine.vo</code></li> <li>243 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/transfinite.glob</code></li> <li>228 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/functions.glob</code></li> <li>226 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/notation.vo</code></li> <li>220 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/order.glob</code></li> <li>213 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/colimits.glob</code></li> <li>203 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/transfinite.vo</code></li> <li>192 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/fc_limits.glob</code></li> <li>187 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/fmachine.glob</code></li> <li>184 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/category.vo</code></li> <li>172 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/functions.vo</code></li> <li>163 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/nat_trans.vo</code></li> <li>162 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/limits.glob</code></li> <li>159 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/nat_trans.glob</code></li> <li>156 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/fiprod.glob</code></li> <li>153 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/fiprod.vo</code></li> <li>146 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/fc_limits.vo</code></li> <li>143 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/category.glob</code></li> <li>131 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/functor.vo</code></li> <li>130 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/set_theory.glob</code></li> <li>128 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/functor_cat.vo</code></li> <li>126 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/equalizer.glob</code></li> <li>126 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/equalizer.vo</code></li> <li>116 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/functor.glob</code></li> <li>112 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/set_theory.vo</code></li> <li>97 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/notation.glob</code></li> <li>87 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/functor_cat.glob</code></li> <li>86 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/ordinal.vo</code></li> <li>82 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/little_cat.v</code></li> <li>82 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/ordinal.glob</code></li> <li>77 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/cat_examples.v</code></li> <li>62 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/transfinite.v</code></li> <li>60 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/colimits.v</code></li> <li>57 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/order.v</code></li> <li>56 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/tactics.vo</code></li> <li>53 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/cardinal.vo</code></li> <li>53 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/functions.v</code></li> <li>45 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/universe.vo</code></li> <li>45 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/limits.v</code></li> <li>44 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/fmachine.v</code></li> <li>41 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/fc_limits.v</code></li> <li>40 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/nat_trans.v</code></li> <li>38 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/fiprod.v</code></li> <li>32 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/equalizer.v</code></li> <li>31 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/axioms.vo</code></li> <li>29 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/category.v</code></li> <li>28 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/set_theory.v</code></li> <li>26 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/universe.glob</code></li> <li>26 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/functor.v</code></li> <li>25 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/functor_cat.v</code></li> <li>24 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/cardinal.glob</code></li> <li>23 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/notation.v</code></li> <li>23 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/ordinal.v</code></li> <li>10 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/axioms.glob</code></li> <li>10 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/tactics.glob</code></li> <li>10 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/cardinal.v</code></li> <li>9 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/tactics.v</code></li> <li>7 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/universe.v</code></li> <li>4 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/CatsInZFC/axioms.v</code></li> </ul> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq-cats-in-zfc.8.7.0</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
coq-bench/coq-bench.github.io
clean/Linux-x86_64-4.04.2-2.0.5/released/8.7.2/cats-in-zfc/8.7.0.html
HTML
mit
14,919
<?php namespace Cdn\View\Helper; use Zend\View\Helper\AbstractHelper; use Zend\Stdlib\Exception\InvalidArgumentException; use Zend\Uri\Http as HttpUri; class Link extends AbstractHelper { /** * Enable state * @var boolean */ protected $enabled; /** * Cdn config, array of server config * @var array */ protected $config; protected $servers = array(); protected $nameServer = 'servers'; protected $src; /** * Current server id used * @var integer */ protected static $serverId; /** * * @var string */ protected static $lastCommit; /** * Construct the cdn helper * * @param array $config */ public function __construct() { return $this; } public function setConfig(array $config) { if (empty($config)) { throw new InvalidArgumentException('Cdn config must be not empty'); } $this->config = $config; $this->setupParams(); return $this; } /** * Get enable state * @return boolean */ public function getEnabled() { return $this->enabled; } /** * Set enable state * @param boolean $enabled */ public function setEnabled($enabled) { $this->enabled = $enabled; } /** * Usage of image view helper * @param string $src * @return Image */ public function __invoke($src = null) { if (null === $src) { return $this; } $this->src = $src; return $this->cdn(); } protected function checkCdn() { if (!$this->enabled) { return $this->src; } if (!is_string($this->src)) { throw new InvalidArgumentException('Source image must be a string'); } if (!isset($this->servers[static::$serverId])) { throw new \Exception("No se encuentra el Haystack Mencionado",500); } } /** * Get cdn link * @param string $src */ public function cdn() { $this->checkCdn(); return $this->processUrl(); } protected function processUrl() { $config = $this->servers[static::$serverId]; $uri = new HttpUri($this->src); if ($uri->getHost()) { return $uri->toString(); } $uri->setScheme($config->scheme); $uri->setPort($config->port); $uri->setHost($config->host); $uri->setQuery(static::$lastCommit); return $uri->toString(); } protected function setupParams() { if(!$this->config){ throw new \Exception("No Existe Configuración", 500); } $this->enabled = true; if(isset($this->config['link_helper']['enabled'])){ $this->enabled = $this->config['link_helper']['enabled']; } $this->servers = array(); foreach ($this->config[$this->nameServer] as $server) { if (!is_array($server)) { throw new InvalidArgumentException('server config must be an array of server arrays'); } $this->servers[] = (object) $server; } static::$serverId = 0; static::$lastCommit = $this->getLastCommit(); } /** * * @todo upgrade codigo * @return string */ public function getUrl() { $uri = new HttpUri(); $config = $this->servers[static::$serverId]; $uri->setScheme($config->scheme); $uri->setPort($config->port); $uri->setHost($config->host); return $uri->toString(); } public function getLastCommit() { $lc_file = ROOT_PATH . '/last_commit'; if (is_readable($lc_file)) { if (!isset(static::$lastCommit)) { static::$lastCommit = trim(file_get_contents($lc_file)); } } return static::$lastCommit; } }
ZrtLab/Cdn
src/src/Cdn/View/Helper/Link.php
PHP
mit
4,005
<div class="commune_descr limited"> <p> Hannaches est un village géographiquement positionné dans le département de l'Oise en Picardie. Elle comptait 124 habitants en 2008.</p> <p>À proximité de Hannaches sont localisées les villes de <a href="{{VLROOT}}/immobilier/buicourt_60114/">Buicourt</a> située à 4&nbsp;km, 139 habitants, <a href="{{VLROOT}}/immobilier/blacourt_60073/">Blacourt</a> située à 5&nbsp;km, 478 habitants, <a href="{{VLROOT}}/immobilier/villembray_60677/">Villembray</a> à 5&nbsp;km, 241 habitants, <a href="{{VLROOT}}/immobilier/gerberoy_60271/">Gerberoy</a> située à 4&nbsp;km, 95 habitants, <a href="{{VLROOT}}/immobilier/wambez_60699/">Wambez</a> à 4&nbsp;km, 154 habitants, <a href="{{VLROOT}}/immobilier/villers-sur-auchy_60687/">Villers-sur-Auchy</a> localisée à 1&nbsp;km, 334 habitants, entre autres. De plus, Hannaches est située à seulement 21&nbsp;km de <a href="{{VLROOT}}/immobilier/beauvais_60057/">Beauvais</a>.</p> <p>Si vous pensez emmenager à Hannaches, vous pourrez aisément trouver une maison à vendre. </p> <p>Le nombre d'habitations, à Hannaches, se décomposait en 2011 en trois appartements et 73 maisons soit un marché relativement équilibré.</p> </div>
donaldinou/frontend
src/Viteloge/CoreBundle/Resources/descriptions/60296.html
HTML
mit
1,244
--- tags: perl layout: post title: "Perl Message Queue" --- <p>I posted a message about message queues in perl to clpm but no newsgroup response. A couple interesting items via email, but that's it. So the <a href="http://www.advogato.org/proj/PerlMQ/">PerlMQ</a> project now exists on sourceforge. Of course, there's nothing <b>there</b> yet, but there's a mailing list and the pressure for me to make sense of the pages of notes and many ideas I have running around right now :-) <p>I'm not sure how long I can continue to do consulting work in addition to real work and having a life (or trying, anyway). We're soon going to have to get heavy duty into design at real work and then a brief (2-3 week) blitzkrieg of stored procedure -&gt; session bean (likely) translation so we can let it germinate for a bit and see what we've got. At least life is interesting... <p><em>(Originally posted <a href="http://www.advogato.org/person/cwinters/diary.html?start=40">elsewhere</a>)</em></p>
cwinters/cwinters.github.io
_posts/2001-02-15-perl_message_queue.md
Markdown
mit
1,013
<html> <head> <title>TestNG: Default test</title> <link href="../testng.css" rel="stylesheet" type="text/css" /> <link href="../my-testng.css" rel="stylesheet" type="text/css" /> <style type="text/css"> .log { display: none;} .stack-trace { display: none;} </style> <script type="text/javascript"> <!-- function flip(e) { current = e.style.display; if (current == 'block') { e.style.display = 'none'; return 0; } else { e.style.display = 'block'; return 1; } } function toggleBox(szDivId, elem, msg1, msg2) { var res = -1; if (document.getElementById) { res = flip(document.getElementById(szDivId)); } else if (document.all) { // this is the way old msie versions work res = flip(document.all[szDivId]); } if(elem) { if(res == 0) elem.innerHTML = msg1; else elem.innerHTML = msg2; } } function toggleAllBoxes() { if (document.getElementsByTagName) { d = document.getElementsByTagName('div'); for (i = 0; i < d.length; i++) { if (d[i].className == 'log') { flip(d[i]); } } } } // --> </script> </head> <body> <h2 align='center'>Default test</h2><table border='1' align="center"> <tr> <td>Tests passed/Failed/Skipped:</td><td>0/1/0</td> </tr><tr> <td>Started on:</td><td>Tue Mar 08 16:14:27 CST 2011</td> </tr> <tr><td>Total time:</td><td>0 seconds (134 ms)</td> </tr><tr> <td>Included groups:</td><td></td> </tr><tr> <td>Excluded groups:</td><td></td> </tr> </table><p/> <small><i>(Hover the method name to see the test class name)</i></small><p/> <table width='100%' border='1' class='invocation-failed'> <tr><td colspan='4' align='center'><b>FAILED TESTS</b></td></tr> <tr><td><b>Test method</b></td> <td width="30%"><b>Exception</b></td> <td width="10%"><b>Time (seconds)</b></td> <td><b>Instance</b></td> </tr> <tr> <td title='com.nec.test.testjava.MainTest.simpleCalc()'><b>simpleCalc</b><br>Test class: com.nec.test.testjava.MainTest</td> <td><div><pre>java.lang.RuntimeException: Test not implemented at com.nec.test.testjava.MainTest.simpleCalc(MainTest.java:9) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:74) at org.testng.internal.Invoker.invokeMethod(Invoker.java:673) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:846) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1170) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109) at org.testng.TestRunner.runWorkers(TestRunner.java:1147) at org.testng.TestRunner.privateRun(TestRunner.java:749) at org.testng.TestRunner.run(TestRunner.java:600) at org.testng.SuiteRunner.runTest(SuiteRunner.java:317) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:312) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:274) at org.testng.SuiteRunner.run(SuiteRunner.java:223) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1039) at org.testng.TestNG.runSuitesLocally(TestNG.java:964) at org.testng.TestNG.run(TestNG.java:900) at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:110) at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:205) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:174) </pre></div><a href='#' onClick='toggleBox("stack-trace1584946533", this, "Click to show all stack frames", "Click to hide stack frames")'>Click to show all stack frames</a> <div class='stack-trace' id='stack-trace1584946533'><pre>java.lang.RuntimeException: Test not implemented at com.nec.test.testjava.MainTest.simpleCalc(MainTest.java:9) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:74) at org.testng.internal.Invoker.invokeMethod(Invoker.java:673) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:846) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1170) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109) at org.testng.TestRunner.runWorkers(TestRunner.java:1147) at org.testng.TestRunner.privateRun(TestRunner.java:749) at org.testng.TestRunner.run(TestRunner.java:600) at org.testng.SuiteRunner.runTest(SuiteRunner.java:317) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:312) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:274) at org.testng.SuiteRunner.run(SuiteRunner.java:223) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1039) at org.testng.TestNG.runSuitesLocally(TestNG.java:964) at org.testng.TestNG.run(TestNG.java:900) at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:110) at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:205) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:174) </pre></div></td> <td>0</td> <td>com.nec.test.testjava.MainTest@4229ab3e</td></tr> </table><p> </body> </html>
quchunguang/test
testjava/testjava/test-output/Default suite/Default test.html
HTML
mit
5,781
#!/bin/bash set -e curl -Lo "openssl.tar.xz" "https://github.com/Skycoder42/ci-builds/releases/download/${OPENSSL_VERSION}/openssl_${OPENSSL_VERSION}_${PLATFORM}.tar.xz" tar -xf openssl.tar.xz rm -f openssl.tar.xz
Skycoder42/SeasonProxer
gui/quick/openssl/get_openssl.sh
Shell
mit
215
class Admin::AdminController < ApplicationController layout "layouts/admin" end
haldun/myweb
app/controllers/admin/admin_controller.rb
Ruby
mit
81
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>The Startup Scholarship</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content="The Startup Scholarship is a unique 9-week summer program in Lisbon, Portugal, in collaboration with the Kairos Society Portugal, that allows selected applicants to experience an internship at a fast pace growing Startup in Lisbon, an entrepreneurship summer classes program with invited professors from top business and engineering Universities in Portugal and a full immersion in the Startup community in Lisbon, with networking sessions, events and exclusive access throughout the program period."> <meta name="author" content="Rui Costa, Startup Scholarship CTO"> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-41906894-1', 'startupscholarship.org'); ga('send', 'pageview'); </script> <link rel="icon" type="image/png" href="favicon.png"> <!-- Le styles --> <link href="css/bootstrap.css" rel="stylesheet"> <link href="css/bootstrap-responsive.css" rel="stylesheet"> <link href="css/style.css" rel="stylesheet"> <!-- Les Fonts --> <link href='http://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'> <link href="http://fonts.googleapis.com/css?family=Droid+Sans" rel="stylesheet" type="text/css"> <link rel="stylesheet" href="css/font-awesome.min.css"> <!-- HTML5 shim, for IE6-8 support of HTML5 elements --> <!--[if lt IE 9]> <script src="js/html5shiv.js"></script> <![endif]--> <!-- Fav and touch icons --> <link rel="apple-touch-icon-precomposed" sizes="144x144" href="ico/apple-touch-icon-144-precomposed.png"> <link rel="apple-touch-icon-precomposed" sizes="114x114" href="ico/apple-touch-icon-114-precomposed.png"> <link rel="apple-touch-icon-precomposed" sizes="72x72" href="ico/apple-touch-icon-72-precomposed.png"> <link rel="apple-touch-icon-precomposed" href="ico/apple-touch-icon-57-precomposed.png"> <link rel="shortcut icon" href="ico/favicon.png"> </head> <body> <!-- NAVBAR ================================================== --> <div id="siteinfo"> <a href="http://www.facebook.com/TheStartupScholarship"><img style="margin-bottom:10px"src="img/face.png"></a> <a href="http://www.twitter.com/startupscholars"><img style="margin-bottom:10px" src="img/twit.png"></a> <a href="https://plus.google.com/u/0/108490869727422385814"><img src="img/plus.png"></a> </div> <div class='my-sticky-element'> <div class="navbar"> <header class="large"> <ul class="nav"> <li class="active"><a href="index.html#Program">The Program</a></li> <li><a href="">Partners</a></li> <li><a href="about.html">About Us</a></li> <li> <center><a href="index.html"><img class="logo" src="img/tss_white.png"></a></center></li> <li><a href="faq.html">FAQ</a></li> <li><a class="anchorLink" href="#sponsors">Sponsors</a></li> <li><a href="scholars.html">Scholars 2013</a></li> </ul> </header> </div> </div> <center> </center> <div class="container" id="Program" style="margin-top:140px "> <div class="row" style="border-top-style: solid; border-top-width: 10px; border-top-color: rgb(27,165,74); "> <center><h1 style="color:rgb(27,165,74)">Startup Scholarship Partners</h1> </center> <div class="span12"> <center><h3>Fast-growing startups. Accomplished lecturers. Pioneering organizations</h3></center> <p>Meet the partners that make this program a reality. We selected some of the best Startups in Portugal offering high-quality internships, we invited some of the most accomplished professors and professionals in the fields of engineering and management and collaborated with leading entrepreneurial organizations.</p> </div> <center><h3>Learn More</h3> <div class="span4"><a class="anchorLink" href="#startups"><img style="width:200px" src="img/elements/Internship.png"></a><h3>Startups</h3></div> <div class="span4"><a class="anchorLink" href="#summerSchool"><img style="width:200px" src="img/elements/SummerSchool.png"></a><h3>Universities</h3></div> <div class="span4"><a class="anchorLink" href="#community"><img style="width:200px" src="img/elements/CommunityImmersion.png"></a><h3>Community Partners</h3></div> </center> </div> <!-- STARTUPS BLOCK --> <div class="row" id="startups" style="padding-top:95px;background:rgb(27,165,74); margin-top:30px" > <center> <h1 style="color:#FFF">Startups</h1> <div class="span12" style="color:#FFF"> </div> <div class="span12" style="margin-bottom:30px"> <center> <div class="span3" style="margin-left:30px"> <div class="card-wrapper2 hover"> <div class="card2"> <div class="front2 face2"> <img alt="" src="img/Startups/Uniplaces_a.png"> </div> <div class="back2 face2 center" style="background-image: url('img/Startups/Uniplaces_b.png')"> </div> </div> </div> </div> <div class="span3" style="margin-left:0px"> <div class="card-wrapper2 hover"> <div class="card2"> <div class="front2 face2"> <img alt="" src="img/Startups/CrowdProcess_a.png"> </div> <div class="back2 face2 center" style="background-image: url('img/Startups/CrowdProcess_b.png')"> </div> </div> </div> </div> <div class="span3" style="margin-left:0px"> <div class="card-wrapper2 hover"> <div class="card2"> <div class="front2 face2"> <img alt="" src="img/Startups/Zaask_a.png"> </div> <div class="back2 face2 center" style="background-image: url('img/Startups/Zaask_b.png')"> </div> </div> </div> </div> <div class="span3" style="margin-left:0px"> <div class="card-wrapper2 hover"> <div class="card2"> <div class="front2 face2"> <img alt="" src="img/Startups/Mobitto_a.png"> </div> <div class="back2 face2 center" style="background-image: url('img/Startups/Mobitto_b.png')"> </div> </div> </div> </div> <div class="span3" style="margin-left:30px"> <div class="card-wrapper2 hover"> <div class="card2"> <div class="front2 face2"> <img alt="" src="img/Startups/Emove_a.png"> </div> <div class="back2 face2 center" style="background-image: url('img/Startups/EMOVE_b.png')"> </div> </div> </div> </div> <div class="span3" style="margin-left:0px"> <div class="card-wrapper2 hover"> <div class="card2"> <div class="front2 face2"> <img alt="" src="img/Startups/ConsultaClick_a.png"> </div> <div class="back2 face2 center" style="background-image: url('img/Startups/ConsultaClick_b.png')"> </div> </div> </div> </div> <div class="span3" style="margin-left:0px"> <div class="card-wrapper2 hover"> <div class="card2"> <div class="front2 face2"> <img alt="" src="img/Startups/FNYHoW_a.png"> </div> <div class="back2 face2 center" style="background-image: url('img/Startups/FNYHoW_b.png')"> </div> </div> </div> </div> <div class="span3" style="margin-left:0px"> <div class="card-wrapper2 hover"> <div class="card2"> <div class="front2 face2"> <img alt="" src="img/Startups/LunaCloud_a.png"> </div> <div class="back2 face2 center" style="background-image: url('img/Startups/LunaCloud_b.png')"> </div> </div> </div> </div> <div class="span3" style="margin-left:30px"> <div class="card-wrapper2 hover"> <div class="card2"> <div class="front2 face2"> <img alt="" src="img/Startups/Origama_a.png"> </div> <div class="back2 face2 center" style="background-image: url('img/Startups/Origama_b.png')"> </div> </div> </div> </div> <div class="span3" style="margin-left:0px"> <div class="card-wrapper2 hover"> <div class="card2"> <div class="front2 face2"> <img alt="" src="img/Startups/Prodsmart_a.png"> </div> <div class="back2 face2 center" style="background-image: url('img/Startups/Prodsmart_b.png')"> </div> </div> </div> </div> <div class="span3" style="margin-left:0px"> <div class="card-wrapper2 hover"> <div class="card2"> <div class="front2 face2"> <img alt="" src="img/Startups/Seeders_a.png"> </div> <div class="back2 face2 center" style="background-image: url('img/Startups/Seeders_b.png')"> </div> </div> </div> </div> <div class="span3" style="margin-left:0px"> <div class="card-wrapper2 hover"> <div class="card2"> <div class="front2 face2"> <img alt="" src="img/Startups/TableAndFriends_a.png"> </div> <div class="back2 face2 center" style="background-image: url('img/Startups/TableAndFriends_b.png')"> </div> </div> </div> </div> <div class="span3" style="margin-left:30px"> <div class="card-wrapper2 hover"> <div class="card2"> <div class="front2 face2"> <img alt="" src="img/Startups/UmamiBox_a.png"> </div> <div class="back2 face2 center" style="background-image: url('img/Startups/UmamiBox_b.png')"> </div> </div> </div> </div> <div class="span3" style="margin-left:0px"> <div class="card-wrapper2 hover"> <div class="card2"> <div class="front2 face2"> <img alt="" src="img/Startups/WeGoOut_a.png"> </div> <div class="back2 face2 center" style="background-image: url('img/Startups/WeGoOut_b.png')"> </div> </div> </div> </div> <div class="span3" style="margin-left:0px"> <div class="card-wrapper2 hover"> <div class="card2"> <div class="front2 face2"> <img alt="" src="img/Startups/Whistle_a.png"> </div> <div class="back2 face2 center" style="background-image: url('img/Startups/Whistle_b.png')"> </div> </div> </div> </div> </div> </div> <!-- UNIVERSITIES BLOCK --> <div class="row" id="summerSchool" style="padding-top:95px;background:rgb(27,165,74); margin-top:30px" > <center> <h1 style="color:#FFF">Universities</h1> <div class="span12" style="color:#FFF"> </div> <div class="span12" style="margin-bottom:30px;"> <div class="span4" style="margin-left:0px;"> <img style="width:200px" src="img/Universidades/white/cat.png"> </div> <div class="span4" style="margin-left:0px"> <img style="width:200px" src="img/Universidades/white/nova.png"> </div> <div class="span4" style="margin-left:0px"> <img style="width:200px" src="img/Universidades/white/ist.png"> </div> <div class="span12" style="margin-left:0px"> <h2 style="color:#FFF">Professors</h2> </div> <div class="span12" > <div class="span3" style="margin-left:0px"> <div class="card-wrapper2 hover"> <div class="card2"> <div class="front2 face2"> <img alt="" src="img/Professores/Castellaneta_a.png"> </div> <div class="back2 face2 center" style="background-image: url('img/Professores/Castellaneta_b.png')"> </div> </div> </div> </div> <div class="span3" style="margin-left:0px"> <div class="card-wrapper2 hover"> <div class="card2"> <div class="front2 face2"> <img alt="" src="img/Professores/JoseFranca_a.png"> </div> <div class="back2 face2 center" style="background-image: url('img/Professores/JoseFranca_b.png')"> </div> </div> </div> </div> <div class="span3" style="margin-left:0px"> <div class="card-wrapper2 hover"> <div class="card2"> <div class="front2 face2"> <img alt="" src="img/Professores/JoseGuerreiro_a.png"> </div> <div class="back2 face2 center" style="background-image: url('img/Professores/JoseGuerreiro_b.png')"> </div> </div> </div> </div> <div class="span3" style="margin-left:0px"> <div class="card-wrapper2 hover"> <div class="card2"> <div class="front2 face2"> <img alt="" src="img/Professores/ManuelForjaz_a.png"> </div> <div class="back2 face2 center" style="background-image: url('img/Professores/ManuelForjaz_b.png')"> </div> </div> </div> </div> <div class="span3" style="margin-left:0px"> </div> <div class="span3" style="margin-left:0px"> <div class="card-wrapper2 hover"> <div class="card2"> <div class="front2 face2"> <img alt="" src="img/Professores/PauloCarreira_a.png"> </div> <div class="back2 face2 center" style="background-image: url('img/Professores/PauloCarreira_b.png')"> </div> </div> </div> </div> <div class="span3" style="margin-left:0px"> <div class="card-wrapper2 hover"> <div class="card2"> <div class="front2 face2"> <img alt="" src="img/Professores/PauloPinho_a.png"> </div> <div class="back2 face2 center" style="background-image: url('img/Professores/PauloPinho_b.png')"> </div> </div> </div> </div> <div class="span3" style="margin-left:0px"> <div class="card-wrapper2 hover"> <div class="card2"> <div class="front2 face2"> <img alt="" src="img/Professores/SergioGoncalves_a.png"> </div> <div class="back2 face2 center" style="background-image: url('img/Professores/SergioGoncalves_b.png')"> </div> </div> </div> </div> </div> </div> </center> </div> <!-- COMMUNITY BLOCK --> <div class="row" id="community" style="padding-top:95px; background:rgb(27,165,74); margin-top:30px" > <center> <h1 style="color:#FFF">Community</h1> <div class="span12" style="color:#FFF"> </div> <div class="span12" style="margin-bottom:30px;"> <div class="span3" style="margin-left:0px"> <div class="card-wrapper2 hover"> <div class="card2"> <div class="front2 face2"> <img alt="" src="img/Organizacoes/BET_a.png"> </div> <div class="back2 face2 center" style="background-image: url('img/Organizacoes/BET_b.png')"> </div> </div> </div> <p style="margin-top:10px"> <a href="http://www.betcatolica.org/"><i class="icon-external-link icon-3x"></i> </a></p> </div> <div class="span3" style="margin-left:0px"> <div class="card-wrapper2 hover"> <div class="card2"> <div class="front2 face2"> <img alt="" src="img/Organizacoes/BUSII_a.png"> </div> <div class="back2 face2 center" style="background-image: url('img/Organizacoes/BUSII_b.png')"> </div> </div> </div> <p style="margin-top:10px"> <a href="http://busii.pt/"><i class="icon-external-link icon-3x"></i> </a></p> </div> <div class="span3" style="margin-left:0px"> <div class="card-wrapper2 hover"> <div class="card2"> <div class="front2 face2"> <img alt="" src="img/Organizacoes/EntrepreneursBreak_a.png"> </div> <div class="back2 face2 center" style="background-image: url('img/Organizacoes/EntrepreneursBreak_b.png')"> </div> </div> </div> <p style="margin-top:10px"> <a href="http://entrepreneursbreak.com/"><i class="icon-external-link icon-3x"></i> </a></p> </div> <div class="span3" style="margin-left:0px"> <div class="card-wrapper2 hover"> <div class="card2"> <div class="front2 face2"> <img alt="" src="img/Organizacoes/StartupLisboa_a.png"> </div> <div class="back2 face2 center" style="background-image: url('img/Organizacoes/StartupLisboa_b.png')"> </div> </div> </div> <p style="margin-top:10px"> <a href="http://startuplisboa.com/"><i class="icon-external-link icon-3x"></i> </a></p> </div> <div class="span3" style="margin-left:0px"> <div class="card-wrapper2 hover"> <div class="card2"> <div class="front2 face2"> <img alt="" src="img/Organizacoes/StartupPirates_a.png"> </div> <div class="back2 face2 center" style="background-image: url('img/Organizacoes/StartupPirates_b.png')"> </div> </div> </div> <p style="margin-top:10px"> <a href="http://www.startuppirates.org/"><i class="icon-external-link icon-3x"></i> </a></p> </div> <div class="span3" style="margin-left:0px"> <div class="card-wrapper2 hover"> <div class="card2"> <div class="front2 face2"> <img alt="" src="img/Organizacoes/FabricaDeStartups_a.png"> </div> <div class="back2 face2 center" style="background-image: url('img/Organizacoes/FabricaDeStartups_b.png')"> </div> </div> </div> <p style="margin-top:10px"> <a href="http://fabricadestartups.com/"><i class="icon-external-link icon-3x"></i> </a></p> </div> <div class="span3" style="margin-left:0px"> <div class="card-wrapper2 hover"> <div class="card2"> <div class="front2 face2"> <img alt="" src="img/Organizacoes/phpLX_a.png"> </div> <div class="back2 face2 center" style="background-image: url('img/Organizacoes/phpLX_b.png')"> </div> </div> </div> <p style="margin-top:10px"> <a href="http://phplx.net/"><i class="icon-external-link icon-3x"></i> </a></p> </div> </div> <div class="span12"> <center> <h1 style="color:#FFF">Speakers</h1> </div> <div style="color:#FFF; margin-bottom:30px" class="span12" > <div class="span3" style="margin-left:0px"> <img style="width:200px" src="img/Speakers/DGomes.png"> <h3 style="margin-bottom:0px">Daniel Gomes</h3> <a href="http://www.linkedin.com/profile/view?id=26799788"><i class="icon-linkedin-sign icon-3x"></i></a> </div> <div class="span3" style="margin-left: 0px"> <img style="width:200px" src="img/Speakers/JoaquimSerafim.png"> <h3 style="margin-bottom:0px">Joaquim Serafim</h3> <a href="http://www.linkedin.com/profile/view?id=42420442"><i class="icon-linkedin-sign icon-3x"></i></a> </div> <div class="span3" style="margin-left: 0px"> <img style="width:200px" src="img/Speakers/JVasques.png"> <h3 style="margin-bottom:0px">João Vasques</h3> <a href="http://www.linkedin.com/profile/view?id=31883838"><i class="icon-linkedin-sign icon-3x"></i></a> </div> </div> </center> </div> </div> <div class="sponsors"> <div class="container" id="sponsors" style="padding-top:50px"> <div class="row"> </br> <center><h1 style="color:#FFF">Sponsors & Partners</h1> </br> <div class="span12"><a href="http://www.ies.org.pt/"target="_blank"><img style="width:200px" src="img/Sponsors/IES_white.png" onmouseover="this.src='img/Sponsors/IES.png'" onmouseout="this.src='img/Sponsors/IES_white.png'" ></a></div> <div class="span4"><a href="http://startuplisboa.com/"target="_blank"><img src="img/Sponsors/startuplisboa_white.png" onmouseover="this.src='img/Sponsors/startuplisboa.png'" onmouseout="this.src='img/Sponsors/startuplisboa_white.png'" ></a></div> <div class="span4"><a href="http://www.cm-lisboa.pt/"target="_blank"><img src="img/Sponsors/cml_white.png" onmouseover="this.src='img/Sponsors/cml.png'" onmouseout="this.src='img/Sponsors/cml_white.png'" ></a></div> <div class="span4"><a href="http://kairossociety.pt/" target="_blank"><img src="img/Sponsors/ksp_white.png" onmouseover="this.src='img/Sponsors/ksp.png'" onmouseout="this.src='img/Sponsors/ksp_white.png'" ></a></div> </div> <div class="row" style="margin-top:40px; margin-bottom:30px"> <div class="span3"><a href="http://www.best.eu.org/"target="_blank"><img src="img/Sponsors/best_white.png" onmouseover="this.src='img/Sponsors/best.png'" onmouseout="this.src='img/Sponsors/best_white.png'" ></a></div> <div class="span3"><a href="http://www.ieee-ist.org/"target="_blank"><img src="img/Sponsors/ieeeist_white.png" onmouseover="this.src='img/Sponsors/ieeeist.png'" onmouseout="this.src='img/Sponsors/ieeeist_white.png'"></a></div> <div class="span3"><a href=""><img src="img/Sponsors/gsa_white.png" onmouseover="this.src='img/Sponsors/gsa.png'" onmouseout="this.src='img/Sponsors/gsa_white.png'" ></a></div> <div class="span3"><a href="http://beta-i.pt/"target="_blank"><img src="img/Sponsors/BETAi_white.png" onmouseover="this.src='img/Sponsors/BETAi.png'" onmouseout="this.src='img/Sponsors/BETAi_white.png'" ></a></div> </div> <div class="row" style="margin-top:40px; margin-bottom:30px"> <div class="span6"><a href="http://next.uniplaces.com/"target="_blank"><center><img style="width:200px" src="img/Sponsors/Uniplaces_white.png" onmouseover="this.src='img/Sponsors/Uniplaces.png'" onmouseout="this.src='img/Sponsors/Uniplaces_white.png'"></a></center></div> <div class="span6"><a href="http://www.lumyi.com/" target="_blank"><center><img style="width:200px" src="img/Sponsors/lumyi_white.png" onmouseover="this.src='img/Sponsors/lumyi.png'" onmouseout="this.src='img/Sponsors/lumyi_white.png'"></a></center></div> </center> </div> </div> </div> <!-- FOOTER --> <footer> </br> <center> <div class="container"> <div class="row"> <div class="span3"><h2>Social Media</h2> </br> <a href="http://www.facebook.com/TheStartupScholarship"><i style="margin-right:40px;"class="icon-facebook icon-4x"></i></a> <a href="http://www.twitter.com/startupscholars"><i style="margin-right:40px;" class="icon-twitter icon-4x"></i></a> <a href="https://plus.google.com/u/0/108490869727422385814"><i class="icon-google-plus icon-4x"></i></a> </div> <div class="span2"><h2>Press</h2> <h4><a href="TheStartupScholarshipPressRelease.pdf">Download Press Pack</a></h4> For more information contact us to <a href="mailto:press@startupscholarship.org ">press@startupscholarship.org </a> </div> <div class="span3"> <img style="width:250px" src="img/tss_white.png"></div> <div class="span3"><h2>Newsletter</h2> If you want to receive news and updates about our awesome program enter your e-mail address below. </br> <form style="margin-top:20px" action="https://docs.google.com/forms/d/1k_7KT5XnkGRNkSfkTOg5nR1vWRxxe92EQWBX5brIpnE/formResponse" method="POST" id="ss-form" target="_self" onsubmit=""><ol style="margin: 0;padding-left: 0"> <div class="ss-form-question errorbox-good"> <div dir="ltr" class="ss-item ss-text"><div class="ss-form-entry"><label class="ss-q-item-label" for="entry_497969024"><div class="ss-q-title"> </div> <div class="ss-q-help ss-secondary-text" dir="ltr"></div></label> <input style="width:250px" type="text" name="entry.497969024" value="" class="ss-q-short" id="entry_497969024" dir="auto"> </div></div></div> <input type="hidden" name="draftResponse" value="[] "> <input type="hidden" name="pageHistory" value="0"> <div class="ss-item ss-navigate"><div class="ss-form-entry" dir="ltr"> <input type="submit" name="submit" value="Submit" id="ss-submit"></div></div></ol></form> </div> </div> </div> <!-- Container --> </center> </footer> </div><!-- /.container --> </div> <!-- Le javascript ================================================== --> <!-- Placed at the end of the document so the pages load faster --> <!-- Sticky Menu to the top --> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script> <script src="js/waypoints.js" type="text/javascript"></script> <script src="js/waypoints-sticky.js"></script> <script src="js/jquery.anchor.js"></script> <script type="text/javascript" src="js/jquery.flippy.js"></script> <script src="js/navbarTSS.js" type="text/javascript"></script> <script src="js/bootstrap-transition.js"></script> <script src="js/bootstrap-alert.js"></script> <script src="js/bootstrap-modal.js"></script> <script src="js/bootstrap-dropdown.js"></script> <script src="js/bootstrap-scrollspy.js"></script> <script src="js/bootstrap-tab.js"></script> <script src="js/bootstrap-tooltip.js"></script> <script src="js/bootstrap-popover.js"></script> <script src="js/bootstrap-button.js"></script> <script src="js/bootstrap-collapse.js"></script> <script src="js/bootstrap-carousel.js"></script> <script src="js/bootstrap-typeahead.js"></script> <script> !function ($) { $(function(){ // carousel demo $('#myCarousel').carousel() }) }(window.jQuery) </script> </body> </html>
diasdavid/startupscholarship.org
public/partners.html
HTML
mit
28,464
// Generated by CoffeeScript 1.8.0 module.exports = (function(_this) { return function(stream, stdout, stderr) { var count, type; type = null; count = 0; return stream.on('readable', function() { var header, payload; while (true) { while (count > 0) { payload = stream.read(1); if (payload == null) { return; } count--; if (type === 2) { stderr.write(payload); } else { stdout.write(payload); } } header = stream.read(8); if (header == null) { return; } type = header.readUInt8(0); count = header.readUInt32BE(4); } }); }; })(this);
metocean/ducke-modem
src/demuxstream.js
JavaScript
mit
747
#include "editaddressdialog.h" #include "ui_editaddressdialog.h" #include "addresstablemodel.h" #include "guiutil.h" #include <QDataWidgetMapper> #include <QMessageBox> EditAddressDialog::EditAddressDialog(Mode mode, QWidget *parent) : QDialog(parent), ui(new Ui::EditAddressDialog), mapper(0), mode(mode), model(0) { ui->setupUi(this); GUIUtil::setupAddressWidget(ui->addressEdit, this); switch(mode) { case NewReceivingAddress: setWindowTitle(tr("New receiving address")); ui->addressEdit->setEnabled(false); break; case NewSendingAddress: setWindowTitle(tr("New sending address")); break; case EditReceivingAddress: setWindowTitle(tr("Edit receiving address")); ui->addressEdit->setEnabled(false); break; case EditSendingAddress: setWindowTitle(tr("Edit sending address")); break; } mapper = new QDataWidgetMapper(this); mapper->setSubmitPolicy(QDataWidgetMapper::ManualSubmit); } EditAddressDialog::~EditAddressDialog() { delete ui; } void EditAddressDialog::setModel(AddressTableModel *model) { this->model = model; if(!model) return; mapper->setModel(model); mapper->addMapping(ui->labelEdit, AddressTableModel::Label); mapper->addMapping(ui->addressEdit, AddressTableModel::Address); } void EditAddressDialog::loadRow(int row) { mapper->setCurrentIndex(row); } bool EditAddressDialog::saveCurrentRow() { if(!model) return false; switch(mode) { case NewReceivingAddress: case NewSendingAddress: address = model->addRow( mode == NewSendingAddress ? AddressTableModel::Send : AddressTableModel::Receive, ui->labelEdit->text(), ui->addressEdit->text()); break; case EditReceivingAddress: case EditSendingAddress: if(mapper->submit()) { address = ui->addressEdit->text(); } break; } return !address.isEmpty(); } void EditAddressDialog::accept() { if(!model) return; if(!saveCurrentRow()) { switch(model->getEditStatus()) { case AddressTableModel::OK: // Failed with unknown reason. Just reject. break; case AddressTableModel::NO_CHANGES: // No changes were made during edit operation. Just reject. break; case AddressTableModel::INVALID_ADDRESS: QMessageBox::warning(this, windowTitle(), tr("The entered address \"%1\" is not a valid Aphrodite address.").arg(ui->addressEdit->text()), QMessageBox::Ok, QMessageBox::Ok); break; case AddressTableModel::DUPLICATE_ADDRESS: QMessageBox::warning(this, windowTitle(), tr("The entered address \"%1\" is already in the address book.").arg(ui->addressEdit->text()), QMessageBox::Ok, QMessageBox::Ok); break; case AddressTableModel::WALLET_UNLOCK_FAILURE: QMessageBox::critical(this, windowTitle(), tr("Could not unlock wallet."), QMessageBox::Ok, QMessageBox::Ok); break; case AddressTableModel::KEY_GENERATION_FAILURE: QMessageBox::critical(this, windowTitle(), tr("New key generation failed."), QMessageBox::Ok, QMessageBox::Ok); break; } return; } QDialog::accept(); } QString EditAddressDialog::getAddress() const { return address; } void EditAddressDialog::setAddress(const QString &address) { this->address = address; ui->addressEdit->setText(address); }
Aphroditecoin/Aphrodite-
src/qt/editaddressdialog.cpp
C++
mit
3,733
package actionlist.implementation; import java.util.Iterator; import com.badlogic.gdx.utils.Array; /** * @author meisteroff */ public class ActionList extends Action { private final Array<Action> actions = new Array<Action>(); private final Array<Action> previous = new Array<Action>(); public ActionList(boolean blocking) { super(blocking); } @Override public void prepare() { } @Override public void cleanup() { } @Override public void update() { for (Iterator<Action> it = actions.iterator(); it.hasNext();) { Action action = it.next(); attemptPrepare(action); action.update(); if (action.finished()) { action.cleanup(); previous.removeValue(action, true); it.remove(); } if (action.blocking) { break; } } } @Override public boolean finished() { return actions.size == 0; } public void add(Action action) { actions.add(action); } public boolean isFirst(Action action) { if (actions.size == 0) { return false; } return actions.get(0) == action; } private void attemptPrepare(Action action) { for (Action a : previous) { if (a == action) { return; } } action.prepare(); previous.add(action); } }
meisteroff/Schmiedebuch
src/actionlist/implementation/ActionList.java
Java
mit
1,212
#pragma warning disable 1591 //------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ [assembly: global::Android.Runtime.ResourceDesignerAttribute("FairlayDotNetClient.AndroidSample.Resource", IsApplication=true)] namespace FairlayDotNetClient.AndroidSample { [System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")] public partial class Resource { static Resource() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } public static void UpdateIdValues() { } public partial class Attribute { static Attribute() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } private Attribute() { } } public partial class Id { // aapt resource value: 0x7f050004 public const int balanceLabel = 2131034116; // aapt resource value: 0x7f050000 public const int categorySpinner = 2131034112; // aapt resource value: 0x7f050003 public const int clickBalanceButton = 2131034115; // aapt resource value: 0x7f050001 public const int clickMarketsButton = 2131034113; // aapt resource value: 0x7f050002 public const int marketsList = 2131034114; static Id() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } private Id() { } } public partial class Layout { // aapt resource value: 0x7f030000 public const int Main = 2130903040; // aapt resource value: 0x7f030001 public const int MarketItem = 2130903041; static Layout() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } private Layout() { } } public partial class Mipmap { // aapt resource value: 0x7f020000 public const int Icon = 2130837504; static Mipmap() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } private Mipmap() { } } public partial class String { // aapt resource value: 0x7f040003 public const int app_name = 2130968579; // aapt resource value: 0x7f040002 public const int click_balance = 2130968578; // aapt resource value: 0x7f040001 public const int click_markets = 2130968577; // aapt resource value: 0x7f040000 public const int select_category = 2130968576; static String() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } private String() { } } } } #pragma warning restore 1591
Fairlay/FairlayDotNetClient
AndroidSample/Resources/Resource.Designer.cs
C#
mit
2,830
<?php declare(strict_types = 1); use Phinx\Migration\AbstractMigration; class RemoveUnnecessaryDepartmentColumn extends AbstractMigration { public function up() { $this->execute("ALTER TABLE `tickets` DROP COLUMN `department`;"); } public function down() { $this->execute("ALTER TABLE `tickets` ADD COLUMN `department` BINARY(16) NULL DEFAULT NULL AFTER `status`;"); } }
jschreuder/SpotDesk
migrations/20170429231859_remove_unnecessary_department_column.php
PHP
mit
414
header { background-color: #1F3F69; height: 70px; } .logo { padding-left: 10px; padding-top: 18px; } .logo-text { color: #FFF; font-size: 24px; } .logo-img { margin-top: -10px; margin-right: 10px; } .wrapper { background-color: #EEE; height: 100%; min-height: 100vh; } .app-box { } #pre-text-label { display: block; text-align: center; margin-top: 20px; } .text-box { margin: 20px auto; width: 95%; } .highlighted { background-color: #EEFF69; } .submit-btn { display: block; margin: 0 auto; } .result-box { } #paragraph-result { margin: 20px auto; width: 95%; background-color: #FFF; padding: 10px; border: 1px solid #ccc; border-radius: 4px; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075); box-shadow: inset 0 1px 1px rgba(0,0,0,.075); -webkit-transition: border-color ease-in-out .15s,-webkit-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; }
AndrewKishino/palindrome-highlighter
css/styles.css
CSS
mit
1,049
# Ember Owner Test Utils [![Build Status](https://travis-ci.org/rondale-sc/ember-owner-test-utils.svg?branch=master)](https://travis-ci.org/rondale-sc/ember-owner-test-utils) [![Ember Observer Score](https://emberobserver.com/badges/ember-owner-test-utils.svg)](https://emberobserver.com/addons/ember-owner-test-utils) This is an addon that is intended to provide an easy mechanism to access and override Ember owner APIs. # Installation `ember install ember-owner-test-utils` # Usage ## Register I find this is most useful for dealin with services that hit the network. It allows you to declaratively specify what a given registration is responsible for inside the test file itself. At the top of your `acceptance|integration|unit` test import the `register` helper with the following line: ```js import { register } from 'ember-owner-test-utils/test-support/register'; ``` Then from within any place that has a test context (ie inside a `beforeEach` or `test`) you may set a new registration with the following: ```js test('it calls foo on the foo service', function(assert){ assert.expect(1); register(this, 'service:foo', Ember.Service.extend({ foo() { assert.ok(true); } })); visit('/thing'); click('.foo-button-that-triggers-expected-service'); }); ``` This signature can be used in all forms of Ember tests. ## Playing Make Believe You can even use it to make a registration on a component that never existed. Like so: ```js // See here for more of the test: // https://github.com/rondale-sc/ember-owner-test-utils/blob/master/tests/integration/my-component-test.js test('allows the registration of components', function(assert) { assert.expect(1); register(this, 'template:components/my-component', hbs`<button class="do-it" {{ action 'foo' }}>GO!</button>`); register(this, 'component:my-component', Component.extend({ actions: { foo() { assert.ok(true); } } }) ); this.render(hbs`{{my-component}}`); this.$('button').click(); }); ``` Hat tip (🎩) to [ember-route-action-helper](https://github.com/DockYard/ember-route-action-helper) on this one. This is very useful for testing complex interactions without needing to create unnecessary files in your addon's dummy folder. ### Thanks Special thanks to @rwjblue for help with 1.13.13 support. Was a difficult thing to track down. :beers: If you'd like to hear @cowboyd and myself talk about this in more depth you can check it out at this episode of ember weekend: [Ember Weekend: Bug Integrat](https://emberweekend.com/episodes/bug-integrat)
rondale-sc/ember-owner-test-utils
README.md
Markdown
mit
2,594
#------------------------------------------------------------------------- # Name - processall.sh # Desc - The program processes files (some genral steps) in serial order # Author - Ranjit Kumar (ranjit58@gmail.com) #------------------------------------------------------------------------- # Run the program as # processall.sh RUN_NAME # Example : processall.sh R16 # READING PATH for RAW data RUN_NAME="$1" echo -e "\nEntering into directory ${RUN_NAME}_analysis ...\n" if [ ! -e ${RUN_NAME}_analysis ] then echo -e "ERROR : FOLDER containing the run analysis ${RUN_NAME}_analysis is not found" echo -e "\nPlease run the program as \nprocessall.sh RUN_NAME" echo -e "\nTerminating the program...\n" exit fi cat <<EOF >process.job #$ -S /bin/bash #$ -cwd #$ -N process #$ -l h_rt=24:00:00,s_rt=24:00:00,vf=4G #$ -M rkumar@uab.edu #$ -m eas # Enter into run folder cd ${RUN_NAME}_analysis for i in * do cd \$i mkdir ANALYSIS cd ANALYSIS quality_check_before.sh ../FORWARD/ ../REVERSE/ merge_reads_F_R.sh ../FORWARD/ ../REVERSE/ prepare_merge_fastq.sh TEMP/ merge_fastq.sh Paired_Filelist.txt 250 250 15 200 quality_filter_single.sh MERGED_FASTQ 250 80 20 quality_check_filterdata.sh filtered_fastq rm -r TEMP/ cd .. cd .. done EOF
QWRAP/QWRAPv2
processall.sh
Shell
mit
1,288
require 'spec_helper' require 'guard/listeners/polling' describe Guard::Polling do it_should_behave_like "a listener that reacts to #on_change" it_should_behave_like "a listener scoped to a specific directory" end
johnbintz/guard
spec/guard/listeners/polling_spec.rb
Ruby
mit
221
#!/bin/bash echo "Setting remote access for agent $1" export ROS_MASTER_URI=http://192.168.$1.11:11311 echo "ROS_MASTER_URI is set to" $ROS_MASTER_URI
NASLab/GroundROS
setRemote.sh
Shell
mit
151
# mpgconvert [![Build Status](https://travis-ci.org/attila/mpgconvert.svg?branch=master)](https://travis-ci.org/attila/mpgconvert) [![Coverage Status](https://coveralls.io/repos/github/attila/mpgconvert/badge.svg?branch=master)](https://coveralls.io/github/attila/mpgconvert?branch=master) Convert fuel consumption between mpg and l/100km in Node.js The module currently supports conversions between miles per imperial gallon (mpg) and litres per 100 km. ## Installation The project is published to the npm registry, install it via your favourite package manager for node: ```bash npm i mpgconvert ``` If you wish to use it as a handy tool in your command line, install it globally ```bash npm i -g mpgconvert ``` ## Usage ### As a module The module has two separate functions exported for conversions. ```javascript const { mpg, l100km } = require('mpgconvert') mpg(38) // 7.433711924989639 l100km(7.2) // 45.561460185420366 ``` ### Command line The package installs a command line executable named `mpgc`. ```text Usage: mpgc <command> [value] Commands: mpg [value] Convert fuel consumption from mpg to l/100km [aliases: m] l100km [value] Convert fuel consumption from l/100km to mpg [aliases: l] Options: --version Show version number [boolean] -h, --help Show help [boolean] ``` Examples: ```bash $ mpgc m 48 5.885021940616797 $ mpgc l 5.85 48.287359512753206 ``` ## Planned features * Conversion to and from in US mpg
attila/mpgconvert
README.md
Markdown
mit
1,555
# othello CGI-based Othello Server, for a classroom competition.
simsong/othello
README.md
Markdown
mit
65
require 'test_helper' class ListPolicyTest < ActiveSupport::TestCase def setup @list = lists :one @member = members :one @current_context = CurrentContext.new @member.user, @member.group, @member end # test exceptions test "should raise NotGroupMemberError when user is not part of group" do member = nil current_context = CurrentContext.new users(:one), groups(:one), member assert_raise GroupBasePolicy::NotGroupMemberError do ListPolicy.new(current_context, @list) end end # test update? and create? test "grants update access to list's creator" do @list.creator = @member assert ListPolicy.new(@current_context, @list).update? assert ListPolicy.new(@current_context, @list).edit? end test "denies update access when not list's creator" do @list.creator = members :two refute ListPolicy.new(@current_context, @list).update? refute ListPolicy.new(@current_context, @list).edit? end # test destroy? test "grants destroy access to list's creator" do @list.creator = @member assert ListPolicy.new(@current_context, @list).destroy? end test "denies destroy access when not list's creator" do @list.creator = members :two refute ListPolicy.new(@current_context, @list).destroy? end # test permitted_attributes test "permit only: title, expiration_date, visibility, description" do permitted = ListPolicy.new(@current_context, @list).permitted_attributes assert_equal %i(title expiration_date visibility description), permitted end end
lrosskamp/makealist-public
test/policies/list_policy_test.rb
Ruby
mit
1,575
<div class="col-md-8 mainlist"> <form> <div class="col-md-2 text-right itemcreatebutton" ng-click="createAlbum()"> <span class="glyphicon glyphicon-plus"></span><span ng-if="listLarge">&nbsp;&nbsp;{{ 'create' | translate }}</span> </div> <div class="col-md-6 itemsearch"> <input type="text" class="form-control listitem-search" id="filter" ng-model="filter" placeholder="{{ 'search' | translate }}"> </div> <div class="col-md-2 text-right itemcreatebutton" ng-click="searchAlbums()"> <span class="glyphicon glyphicon-search"></span><span ng-if="listLarge">&nbsp;&nbsp;{{ 'search' | translate }}</span> </div> <div class="col-md-2 text-right itemcreatebutton" ng-click="orderList()"> <span class="glyphicon glyphicon-sort"></span><span ng-if="listLarge">&nbsp;&nbsp;{{ 'order' | translate }}</span> </div> </form> <div ng-repeat="album in albums" ng-include="'app/views/album/albumdetails.html'"></div> </div> <div class="itempanel"> <div ui-view /> </div>
msansm1/medek-server
src/main/webapp/app/views/album/albumslist.html
HTML
mit
1,011
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. namespace Microsoft.Azure.Management.Search.Fluent { using Microsoft.Azure.Management.ResourceManager.Fluent.Core; using Microsoft.Azure.Management.Search.Fluent.Models; /// <summary> /// Response containing the primary and secondary admin API keys for a given Azure Search service. /// </summary> ///GENTHASH:Y29tLm1pY3Jvc29mdC5henVyZS5tYW5hZ2VtZW50LnNlYXJjaC5pbXBsZW1lbnRhdGlvbi5BZG1pbktleXNJbXBs internal partial class AdminKeysImpl : Wrapper<Models.AdminKeyResultInner>, IAdminKeys { ///GENMHASH:052932D87146B729CFA163215691D8ED:C74FC4D6E498F9E2004ADD70A6234833 public string SecondaryKey() { return this.Inner.SecondaryKey; } ///GENMHASH:C08411FE38E7175FDAEA4BFB98A59684:1D4DDF365F268ADBDFBA007915D77856 internal AdminKeysImpl(AdminKeyResultInner innerObject) : base(innerObject) { } ///GENMHASH:0B1F8FBCA0C4DFB5EA228CACB374C6C2:33E9AB1CE55380EB0803102474306E91 public string PrimaryKey() { return this.Inner.PrimaryKey; } } }
hovsepm/azure-libraries-for-net
src/ResourceManagement/Search/AdminKeysImpl.cs
C#
mit
1,260
/* ** GENEREATED FILE - DO NOT MODIFY ** */ package com.wilutions.mslib.office.impl; import com.wilutions.com.*; @SuppressWarnings("all") @CoClass(guid="{C09B8C5B-A463-DB41-5DAE-69E7A5F7FCBC}") public class OfficeDataSourceObjectImpl extends Dispatch implements com.wilutions.mslib.office.OfficeDataSourceObject { @DeclDISPID(1) public String getConnectString() throws ComException { final Object obj = this._dispatchCall(1,"ConnectString", DISPATCH_PROPERTYGET,null); if (obj == null) return null; return (String)obj; } @DeclDISPID(1) public void setConnectString(final String value) throws ComException { assert(value != null); this._dispatchCall(1,"ConnectString", DISPATCH_PROPERTYPUT,value); } @DeclDISPID(2) public String getTable() throws ComException { final Object obj = this._dispatchCall(2,"Table", DISPATCH_PROPERTYGET,null); if (obj == null) return null; return (String)obj; } @DeclDISPID(2) public void setTable(final String value) throws ComException { assert(value != null); this._dispatchCall(2,"Table", DISPATCH_PROPERTYPUT,value); } @DeclDISPID(3) public String getDataSource() throws ComException { final Object obj = this._dispatchCall(3,"DataSource", DISPATCH_PROPERTYGET,null); if (obj == null) return null; return (String)obj; } @DeclDISPID(3) public void setDataSource(final String value) throws ComException { assert(value != null); this._dispatchCall(3,"DataSource", DISPATCH_PROPERTYPUT,value); } @DeclDISPID(4) public IDispatch getColumns() throws ComException { final Object obj = this._dispatchCall(4,"Columns", DISPATCH_PROPERTYGET,null); if (obj == null) return null; return (IDispatch)obj; } @DeclDISPID(5) public Integer getRowCount() throws ComException { final Object obj = this._dispatchCall(5,"RowCount", DISPATCH_PROPERTYGET,null); if (obj == null) return null; return (Integer)obj; } @DeclDISPID(6) public IDispatch getFilters() throws ComException { final Object obj = this._dispatchCall(6,"Filters", DISPATCH_PROPERTYGET,null); if (obj == null) return null; return (IDispatch)obj; } @DeclDISPID(1610743817) public Integer Move(final com.wilutions.mslib.office.MsoMoveRow MsoMoveRow, final Integer RowNbr) throws ComException { assert(MsoMoveRow != null); assert(RowNbr != null); final Object obj = this._dispatchCall(1610743817,"Move", DISPATCH_METHOD,null,MsoMoveRow.value,RowNbr); if (obj == null) return null; return (Integer)obj; } @DeclDISPID(1610743818) public void Open(final String bstrSrc, final String bstrConnect, final String bstrTable, final Integer fOpenExclusive, final Integer fNeverPrompt) throws ComException { assert(bstrSrc != null); assert(bstrConnect != null); assert(bstrTable != null); assert(fOpenExclusive != null); assert(fNeverPrompt != null); this._dispatchCall(1610743818,"Open", DISPATCH_METHOD,null,bstrSrc,bstrConnect,bstrTable,fOpenExclusive,fNeverPrompt); } @DeclDISPID(1610743819) public void SetSortOrder(final String SortField1, final Boolean SortAscending1, final String SortField2, final Boolean SortAscending2, final String SortField3, final Boolean SortAscending3) throws ComException { assert(SortField1 != null); assert(SortAscending1 != null); assert(SortField2 != null); assert(SortAscending2 != null); assert(SortField3 != null); assert(SortAscending3 != null); this._dispatchCall(1610743819,"SetSortOrder", DISPATCH_METHOD,null,SortField1,SortAscending1,SortField2,SortAscending2,SortField3,SortAscending3); } @DeclDISPID(1610743820) public void ApplyFilter() throws ComException { this._dispatchCall(1610743820,"ApplyFilter", DISPATCH_METHOD,null); } public OfficeDataSourceObjectImpl(String progId) throws ComException { super(progId, "{000C1530-0000-0000-C000-000000000046}"); } protected OfficeDataSourceObjectImpl(long ndisp) { super(ndisp); } public String toString() { return "[OfficeDataSourceObjectImpl" + super.toString() + "]"; } }
wolfgangimig/joa
java/joa/src-gen/com/wilutions/mslib/office/impl/OfficeDataSourceObjectImpl.java
Java
mit
4,182
<!DOCTYPE html> <html class="theme-next mist use-motion" lang=""> <head> <meta charset="UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"/> <meta name="theme-color" content="#222"> <meta http-equiv="Cache-Control" content="no-transform" /> <meta http-equiv="Cache-Control" content="no-siteapp" /> <link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" /> <link href="/css/main.css?v=6.3.0" rel="stylesheet" type="text/css" /> <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=6.3.0"> <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=6.3.0"> <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=6.3.0"> <link rel="mask-icon" href="/images/logo.svg?v=6.3.0" color="#222"> <script type="text/javascript" id="hexo.configurations"> var NexT = window.NexT || {}; var CONFIG = { root: '/', scheme: 'Mist', version: '6.3.0', sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false}, fancybox: false, fastclick: false, lazyload: false, tabs: true, motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}, algolia: { applicationID: '', apiKey: '', indexName: '', hits: {"per_page":10}, labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"} } }; </script> <meta property="og:type" content="website"> <meta property="og:title" content="Hexo"> <meta property="og:url" content="http://yoursite.com/archives/2018/08/index.html"> <meta property="og:site_name" content="Hexo"> <meta property="og:locale" content="default"> <meta name="twitter:card" content="summary"> <meta name="twitter:title" content="Hexo"> <link rel="canonical" href="http://yoursite.com/archives/2018/08/"/> <script type="text/javascript" id="page.configurations"> CONFIG.page = { sidebar: "", }; </script> <title>Archive | Hexo</title> <noscript> <style type="text/css"> .use-motion .motion-element, .use-motion .brand, .use-motion .menu-item, .sidebar-inner, .use-motion .post-block, .use-motion .pagination, .use-motion .comments, .use-motion .post-header, .use-motion .post-body, .use-motion .collection-title { opacity: initial; } .use-motion .logo, .use-motion .site-title, .use-motion .site-subtitle { opacity: initial; top: initial; } .use-motion { .logo-line-before i { left: initial; } .logo-line-after i { right: initial; } } </style> </noscript> </head> <body itemscope itemtype="http://schema.org/WebPage" lang="default"> <div class="container sidebar-position-left page-archive"> <div class="headband"></div> <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="header-inner"><div class="site-brand-wrapper"> <div class="site-meta "> <div class="custom-logo-site-title"> <a href="/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <span class="site-title">Hexo</span> <span class="logo-line-after"><i></i></span> </a> </div> </div> <div class="site-nav-toggle"> <button aria-label="Toggle navigation bar"> <span class="btn-bar"></span> <span class="btn-bar"></span> <span class="btn-bar"></span> </button> </div> </div> <nav class="site-nav"> <ul id="menu" class="menu"> <li class="menu-item menu-item-home"> <a href="/" rel="section"> <i class="menu-item-icon fa fa-fw fa-home"></i> <br />Home</a> </li> <li class="menu-item menu-item-archives menu-item-active"> <a href="/archives/" rel="section"> <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />Archives</a> </li> </ul> </nav> </div> </header> <main id="main" class="main"> <div class="main-inner"> <div class="content-wrap"> <div id="content" class="content"> <div class="post-block archive"> <div id="posts" class="posts-collapse"> <span class="archive-move-on"></span> <span class="archive-page-counter"> Um..! 2 posts in total. Keep on posting. </span> <div class="collection-title"> <h1 class="archive-year" id="archive-year-2018">2018</h1> </div> <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <h2 class="post-title"> <a class="post-title-link" href="/2018/08/21/Linux下搜狗输入法无法显示候选框/" itemprop="url"> <span itemprop="name">Linux下搜狗输入法无法显示候选框</span> </a> </h2> <div class="post-meta"> <time class="post-time" itemprop="dateCreated" datetime="2018-08-21T11:53:30+08:00" content="2018-08-21" > 08-21 </time> </div> </header> </article> <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <h2 class="post-title"> <a class="post-title-link" href="/2018/08/20/hello-world/" itemprop="url"> <span itemprop="name">Hello World</span> </a> </h2> <div class="post-meta"> <time class="post-time" itemprop="dateCreated" datetime="2018-08-20T11:39:19+08:00" content="2018-08-20" > 08-20 </time> </div> </header> </article> </div> </div> </div> </div> <div class="sidebar-toggle"> <div class="sidebar-toggle-line-wrap"> <span class="sidebar-toggle-line sidebar-toggle-line-first"></span> <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span> <span class="sidebar-toggle-line sidebar-toggle-line-last"></span> </div> </div> <aside id="sidebar" class="sidebar"> <div class="sidebar-inner"> <section class="site-overview-wrap sidebar-panel sidebar-panel-active"> <div class="site-overview"> <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <p class="site-author-name" itemprop="name">John Doe</p> <p class="site-description motion-element" itemprop="description"></p> </div> <nav class="site-state motion-element"> <div class="site-state-item site-state-posts"> <a href="/archives/"> <span class="site-state-item-count">2</span> <span class="site-state-item-name">posts</span> </a> </div> <div class="site-state-item site-state-tags"> <span class="site-state-item-count">1</span> <span class="site-state-item-name">tags</span> </div> </nav> </div> </section> </div> </aside> </div> </main> <footer id="footer" class="footer"> <div class="footer-inner"> <div class="copyright">&copy; <span itemprop="copyrightYear">2018</span> <span class="with-love" id="animate"> <i class="fa fa-user"></i> </span> <span class="author" itemprop="copyrightHolder">John Doe</span> </div> <div class="powered-by">Powered by <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> v3.7.1</div> <span class="post-meta-divider">|</span> <div class="theme-info">Theme – <a class="theme-link" target="_blank" href="https://theme-next.org">NexT.Mist</a> v6.3.0</div> </div> </footer> <div class="back-to-top"> <i class="fa fa-arrow-up"></i> </div> </div> <script type="text/javascript"> if (Object.prototype.toString.call(window.Promise) !== '[object Function]') { window.Promise = null; } </script> <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script> <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script> <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script> <script type="text/javascript" src="/js/src/utils.js?v=6.3.0"></script> <script type="text/javascript" src="/js/src/motion.js?v=6.3.0"></script> <script type="text/javascript" src="/js/src/bootstrap.js?v=6.3.0"></script> </body> </html>
zhenchaozhu/zhenchaozhu.github.io
archives/2018/08/index.html
HTML
mit
10,275
#include <string.h> #include "basic.h" #include "files.h" #include "fills.h" #include "list.h" #include "minunit.h" #include "traverse.h" #include "util.h" #include "yama.h" int tests_run; int verbose; #define RECORDS 4 static char *test_history() { YAMA *yama = yama_new(); yama_item *items[RECORDS]; fill_update(yama, items, RECORDS); mu_assert("First doesn't have previous version", yama_before(items[0], items[0]) == NULL); yama_item *updated = items[1]; yama_item *old = yama_before(updated, updated); mu_assert("Does have previous version", old != NULL); mu_assert("x", strncmp(payload(old), "x", size(old)) == 0); mu_assert("No older entry", yama_before(updated, old) == NULL); yama_release(yama); return NULL; } static char *test_longer_history() { YAMA *yama = yama_new(); int i = 0; yama_item *item = yama_add(yama, (char *) &i, sizeof(i)); for (i = 1; i < RECORDS; i++) item = yama_edit(item, (char *) &i, sizeof(i)); yama_item *first = yama_latest(yama); for (item = first; item; item = yama_before(item, first)) { i--; mu_assert("Size is correct", size(item) == sizeof(i)); mu_assert("Contents are correct", memcmp(payload(item), &i, size(item)) == 0); } mu_assert("That was last in history", i == 0); mu_assert("Just one record", yama_previous(first) == NULL); yama_release(yama); return NULL; } static char *run_all_tests() { mu_run_test(test_file_create); mu_run_test(test_file_read_write); mu_run_test(test_traverse, sequential_fill); mu_run_test(test_traverse, striped_fill); mu_run_test(test_traverse, fill_update); mu_run_test(list_tests); mu_run_test(basic_tests); mu_run_test(test_history); mu_run_test(test_longer_history); return NULL; } int main(int argc, char *argv[]) { if (argc > 1 && strncmp(argv[1], "-v", 2) == 0) sscanf(argv[1]+2, "%d", &verbose); char *result = run_all_tests(); if (result == NULL) printf("All %d tests passed\n", tests_run); else printf("FAIL: %s\n", result); return result != NULL; }
aragaer/libyama
test/main.c
C
mit
2,051
package org.codehaus.xfire.util.stax; import javax.xml.namespace.NamespaceContext; import javax.xml.namespace.QName; import javax.xml.stream.Location; import javax.xml.stream.XMLStreamConstants; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; /** * An XMLStreamReader which keeps track of the depth where we are. * * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse </a> * @since Nov 4, 2004 */ public class DepthXMLStreamReader implements XMLStreamReader { XMLStreamReader reader; private int depth = 0; public DepthXMLStreamReader(XMLStreamReader reader) { this.reader = reader; } public int getDepth() { return depth; } public void close() throws XMLStreamException { reader.close(); } public int getAttributeCount() { return reader.getAttributeCount(); } public String getAttributeLocalName(int arg0) { return reader.getAttributeLocalName(arg0); } public QName getAttributeName(int arg0) { return reader.getAttributeName(arg0); } public String getAttributeNamespace(int arg0) { return reader.getAttributeNamespace(arg0); } public String getAttributePrefix(int arg0) { return reader.getAttributePrefix(arg0); } public String getAttributeType(int arg0) { return reader.getAttributeType(arg0); } public String getAttributeValue(int arg0) { return reader.getAttributeValue(arg0); } public String getAttributeValue(String arg0, String arg1) { return reader.getAttributeValue(arg0, arg1); } public String getCharacterEncodingScheme() { return reader.getCharacterEncodingScheme(); } public String getElementText() throws XMLStreamException { depth--; return reader.getElementText(); } public String getEncoding() { return reader.getEncoding(); } public int getEventType() { return reader.getEventType(); } public String getLocalName() { return reader.getLocalName(); } public Location getLocation() { return reader.getLocation(); } public QName getName() { return reader.getName(); } public NamespaceContext getNamespaceContext() { return reader.getNamespaceContext(); } public int getNamespaceCount() { return reader.getNamespaceCount(); } public String getNamespacePrefix(int arg0) { return reader.getNamespacePrefix(arg0); } public String getNamespaceURI() { return reader.getNamespaceURI(); } public String getNamespaceURI(int arg0) { return reader.getNamespaceURI(arg0); } public String getNamespaceURI(String arg0) { return reader.getNamespaceURI(arg0); } public String getPIData() { return reader.getPIData(); } public String getPITarget() { return reader.getPITarget(); } public String getPrefix() { return reader.getPrefix(); } public Object getProperty(String arg0) throws IllegalArgumentException { return reader.getProperty(arg0); } public String getText() { return reader.getText(); } public char[] getTextCharacters() { return reader.getTextCharacters(); } public int getTextCharacters(int arg0, char[] arg1, int arg2, int arg3) throws XMLStreamException { return reader.getTextCharacters(arg0, arg1, arg2, arg3); } public int getTextLength() { return reader.getTextLength(); } public int getTextStart() { return reader.getTextStart(); } public String getVersion() { return reader.getVersion(); } public boolean hasName() { return reader.hasName(); } public boolean hasNext() throws XMLStreamException { return reader.hasNext(); } public boolean hasText() { return reader.hasText(); } public boolean isAttributeSpecified(int arg0) { return reader.isAttributeSpecified(arg0); } public boolean isCharacters() { return reader.isCharacters(); } public boolean isEndElement() { return reader.isEndElement(); } public boolean isStandalone() { return reader.isStandalone(); } public boolean isStartElement() { return reader.isStartElement(); } public boolean isWhiteSpace() { return reader.isWhiteSpace(); } public int next() throws XMLStreamException { int next = reader.next(); if ( next == START_ELEMENT ) { depth++; } else if ( next == END_ELEMENT ) { depth--; } return next; } public int nextTag() throws XMLStreamException { int eventType = next(); while ((eventType == XMLStreamConstants.CHARACTERS && isWhiteSpace()) || (eventType == XMLStreamConstants.CDATA && isWhiteSpace()) // skip whitespace || eventType == XMLStreamConstants.SPACE || eventType == XMLStreamConstants.PROCESSING_INSTRUCTION || eventType == XMLStreamConstants.COMMENT) { eventType = next(); } if (eventType != XMLStreamConstants.START_ELEMENT && eventType != XMLStreamConstants.END_ELEMENT) { throw new XMLStreamException("expected start or end tag", getLocation()); } return eventType; } public void require(int arg0, String arg1, String arg2) throws XMLStreamException { reader.require(arg0, arg1, arg2); } public boolean standaloneSet() { return reader.standaloneSet(); } public int hashCode() { return reader.hashCode(); } public boolean equals(Object arg0) { return reader.equals(arg0); } public String toString() { return reader.toString(); } }
eduardodaluz/xfire
xfire-core/src/main/org/codehaus/xfire/util/stax/DepthXMLStreamReader.java
Java
mit
6,285
/* +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ | Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.zend.com/license/2_00.txt. | | If you did not receive a copy of the Zend license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@zend.com so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Zeev Suraski <zeev@zend.com> | +----------------------------------------------------------------------+ */ /* $Id$ */ #include "zend.h" #include "zend_qsort.h" #include "zend_API.h" #include "zend_ini.h" #include "zend_alloc.h" #include "zend_operators.h" #include "zend_strtod.h" static HashTable *registered_zend_ini_directives; #define NO_VALUE_PLAINTEXT "no value" #define NO_VALUE_HTML "<i>no value</i>" /* * hash_apply functions */ static int zend_remove_ini_entries(zend_ini_entry *ini_entry, int *module_number TSRMLS_DC) /* {{{ */ { if (ini_entry->module_number == *module_number) { return 1; } else { return 0; } } /* }}} */ static int zend_restore_ini_entry_cb(zend_ini_entry *ini_entry, int stage TSRMLS_DC) /* {{{ */ { int result = FAILURE; if (ini_entry->modified) { if (ini_entry->on_modify) { zend_try { /* even if on_modify bails out, we have to continue on with restoring, since there can be allocated variables that would be freed on MM shutdown and would lead to memory corruption later ini entry is modified again */ result = ini_entry->on_modify(ini_entry, ini_entry->orig_value, ini_entry->orig_value_length, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC); } zend_end_try(); } if (stage == ZEND_INI_STAGE_RUNTIME && result == FAILURE) { /* runtime failure is OK */ return 1; } if (ini_entry->value != ini_entry->orig_value) { efree(ini_entry->value); } ini_entry->value = ini_entry->orig_value; ini_entry->value_length = ini_entry->orig_value_length; ini_entry->modifiable = ini_entry->orig_modifiable; ini_entry->modified = 0; ini_entry->orig_value = NULL; ini_entry->orig_value_length = 0; ini_entry->orig_modifiable = 0; } return 0; } /* }}} */ static int zend_restore_ini_entry_wrapper(zend_ini_entry **ini_entry TSRMLS_DC) /* {{{ */ { zend_restore_ini_entry_cb(*ini_entry, ZEND_INI_STAGE_DEACTIVATE TSRMLS_CC); return 1; } /* }}} */ /* * Startup / shutdown */ ZEND_API int zend_ini_startup(TSRMLS_D) /* {{{ */ { registered_zend_ini_directives = (HashTable *) malloc(sizeof(HashTable)); EG(ini_directives) = registered_zend_ini_directives; EG(modified_ini_directives) = NULL; EG(error_reporting_ini_entry) = NULL; if (zend_hash_init_ex(registered_zend_ini_directives, 100, NULL, NULL, 1, 0) == FAILURE) { return FAILURE; } return SUCCESS; } /* }}} */ ZEND_API int zend_ini_shutdown(TSRMLS_D) /* {{{ */ { zend_hash_destroy(EG(ini_directives)); free(EG(ini_directives)); return SUCCESS; } /* }}} */ ZEND_API int zend_ini_global_shutdown(TSRMLS_D) /* {{{ */ { zend_hash_destroy(registered_zend_ini_directives); free(registered_zend_ini_directives); return SUCCESS; } /* }}} */ ZEND_API int zend_ini_deactivate(TSRMLS_D) /* {{{ */ { if (EG(modified_ini_directives)) { zend_hash_apply(EG(modified_ini_directives), (apply_func_t) zend_restore_ini_entry_wrapper TSRMLS_CC); zend_hash_destroy(EG(modified_ini_directives)); FREE_HASHTABLE(EG(modified_ini_directives)); EG(modified_ini_directives) = NULL; } return SUCCESS; } /* }}} */ #ifdef ZTS ZEND_API int zend_copy_ini_directives(TSRMLS_D) /* {{{ */ { zend_ini_entry ini_entry; EG(modified_ini_directives) = NULL; EG(error_reporting_ini_entry) = NULL; EG(ini_directives) = (HashTable *) malloc(sizeof(HashTable)); if (zend_hash_init_ex(EG(ini_directives), registered_zend_ini_directives->nNumOfElements, NULL, NULL, 1, 0) == FAILURE) { return FAILURE; } zend_hash_copy(EG(ini_directives), registered_zend_ini_directives, NULL, &ini_entry, sizeof(zend_ini_entry)); return SUCCESS; } /* }}} */ #endif static int ini_key_compare(const void *a, const void *b TSRMLS_DC) /* {{{ */ { const Bucket *f; const Bucket *s; f = *((const Bucket **) a); s = *((const Bucket **) b); if (f->nKeyLength == 0 && s->nKeyLength == 0) { /* both numeric */ return ZEND_NORMALIZE_BOOL(f->nKeyLength - s->nKeyLength); } else if (f->nKeyLength == 0) { /* f is numeric, s is not */ return -1; } else if (s->nKeyLength == 0) { /* s is numeric, f is not */ return 1; } else { /* both strings */ return zend_binary_strcasecmp(f->arKey, f->nKeyLength, s->arKey, s->nKeyLength); } } /* }}} */ ZEND_API void zend_ini_sort_entries(TSRMLS_D) /* {{{ */ { zend_hash_sort(EG(ini_directives), zend_qsort, ini_key_compare, 0 TSRMLS_CC); } /* }}} */ /* * Registration / unregistration */ ZEND_API int zend_register_ini_entries(const zend_ini_entry *ini_entry, int module_number TSRMLS_DC) /* {{{ */ {//lux: zend ini const zend_ini_entry *p = ini_entry; zend_ini_entry *hashed_ini_entry; zval default_value; HashTable *directives = registered_zend_ini_directives; zend_bool config_directive_success = 0; #ifdef ZTS /* if we are called during the request, eg: from dl(), * then we should not touch the global directives table, * and should update the per-(request|thread) version instead. * This solves two problems: one is that ini entries for dl()'d * extensions will now work, and the second is that updating the * global hash here from dl() is not mutex protected and can * lead to death. */ if (directives != EG(ini_directives)) { directives = EG(ini_directives); } #endif while (p->name) { config_directive_success = 0; if (zend_hash_add(directives, p->name, p->name_length, (void*)p, sizeof(zend_ini_entry), (void **) &hashed_ini_entry) == FAILURE) { zend_unregister_ini_entries(module_number TSRMLS_CC); return FAILURE; } hashed_ini_entry->module_number = module_number; if ((zend_get_configuration_directive(p->name, p->name_length, &default_value)) == SUCCESS) { if (!hashed_ini_entry->on_modify || hashed_ini_entry->on_modify(hashed_ini_entry, Z_STRVAL(default_value), Z_STRLEN(default_value), hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, ZEND_INI_STAGE_STARTUP TSRMLS_CC) == SUCCESS) { hashed_ini_entry->value = Z_STRVAL(default_value); hashed_ini_entry->value_length = Z_STRLEN(default_value); config_directive_success = 1; } } if (!config_directive_success && hashed_ini_entry->on_modify) { hashed_ini_entry->on_modify(hashed_ini_entry, hashed_ini_entry->value, hashed_ini_entry->value_length, hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, ZEND_INI_STAGE_STARTUP TSRMLS_CC); } p++; } return SUCCESS; } /* }}} */ ZEND_API void zend_unregister_ini_entries(int module_number TSRMLS_DC) /* {{{ */ { zend_hash_apply_with_argument(registered_zend_ini_directives, (apply_func_arg_t) zend_remove_ini_entries, (void *) &module_number TSRMLS_CC); } /* }}} */ #ifdef ZTS static int zend_ini_refresh_cache(zend_ini_entry *p, int stage TSRMLS_DC) /* {{{ */ { if (p->on_modify) { p->on_modify(p, p->value, p->value_length, p->mh_arg1, p->mh_arg2, p->mh_arg3, stage TSRMLS_CC); } return 0; } /* }}} */ ZEND_API void zend_ini_refresh_caches(int stage TSRMLS_DC) /* {{{ */ { zend_hash_apply_with_argument(EG(ini_directives), (apply_func_arg_t) zend_ini_refresh_cache, (void *)(zend_intptr_t) stage TSRMLS_CC); } /* }}} */ #endif ZEND_API int zend_alter_ini_entry(char *name, uint name_length, char *new_value, uint new_value_length, int modify_type, int stage) /* {{{ */ { TSRMLS_FETCH(); return zend_alter_ini_entry_ex(name, name_length, new_value, new_value_length, modify_type, stage, 0 TSRMLS_CC); } /* }}} */ ZEND_API int zend_alter_ini_entry_ex(char *name, uint name_length, char *new_value, uint new_value_length, int modify_type, int stage, int force_change TSRMLS_DC) /* {{{ */ { zend_ini_entry *ini_entry; char *duplicate; zend_bool modifiable; zend_bool modified; if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry) == FAILURE) { return FAILURE; } modifiable = ini_entry->modifiable; modified = ini_entry->modified; if (stage == ZEND_INI_STAGE_ACTIVATE && modify_type == ZEND_INI_SYSTEM) { ini_entry->modifiable = ZEND_INI_SYSTEM; } if (!force_change) { if (!(ini_entry->modifiable & modify_type)) { return FAILURE; } } if (!EG(modified_ini_directives)) { ALLOC_HASHTABLE(EG(modified_ini_directives)); zend_hash_init(EG(modified_ini_directives), 8, NULL, NULL, 0); } if (!modified) { ini_entry->orig_value = ini_entry->value; ini_entry->orig_value_length = ini_entry->value_length; ini_entry->orig_modifiable = modifiable; ini_entry->modified = 1; zend_hash_add(EG(modified_ini_directives), name, name_length, &ini_entry, sizeof(zend_ini_entry*), NULL); } duplicate = estrndup(new_value, new_value_length); if (!ini_entry->on_modify || ini_entry->on_modify(ini_entry, duplicate, new_value_length, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC) == SUCCESS) { if (modified && ini_entry->orig_value != ini_entry->value) { /* we already changed the value, free the changed value */ efree(ini_entry->value); } ini_entry->value = duplicate; ini_entry->value_length = new_value_length; } else { efree(duplicate); return FAILURE; } return SUCCESS; } /* }}} */ ZEND_API int zend_restore_ini_entry(char *name, uint name_length, int stage) /* {{{ */ { zend_ini_entry *ini_entry; TSRMLS_FETCH(); if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry) == FAILURE || (stage == ZEND_INI_STAGE_RUNTIME && (ini_entry->modifiable & ZEND_INI_USER) == 0)) { return FAILURE; } if (EG(modified_ini_directives)) { if (zend_restore_ini_entry_cb(ini_entry, stage TSRMLS_CC) == 0) { zend_hash_del(EG(modified_ini_directives), name, name_length); } else { return FAILURE; } } return SUCCESS; } /* }}} */ ZEND_API int zend_ini_register_displayer(char *name, uint name_length, void (*displayer)(zend_ini_entry *ini_entry, int type)) /* {{{ */ { zend_ini_entry *ini_entry; if (zend_hash_find(registered_zend_ini_directives, name, name_length, (void **) &ini_entry) == FAILURE) { return FAILURE; } ini_entry->displayer = displayer; return SUCCESS; } /* }}} */ /* * Data retrieval */ ZEND_API long zend_ini_long(char *name, uint name_length, int orig) /* {{{ */ { zend_ini_entry *ini_entry; TSRMLS_FETCH(); if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry) == SUCCESS) { if (orig && ini_entry->modified) { return (ini_entry->orig_value ? strtol(ini_entry->orig_value, NULL, 0) : 0); } else { return (ini_entry->value ? strtol(ini_entry->value, NULL, 0) : 0); } } return 0; } /* }}} */ ZEND_API double zend_ini_double(char *name, uint name_length, int orig) /* {{{ */ { zend_ini_entry *ini_entry; TSRMLS_FETCH(); if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry) == SUCCESS) { if (orig && ini_entry->modified) { return (double) (ini_entry->orig_value ? zend_strtod(ini_entry->orig_value, NULL) : 0.0); } else { return (double) (ini_entry->value ? zend_strtod(ini_entry->value, NULL) : 0.0); } } return 0.0; } /* }}} */ ZEND_API char *zend_ini_string_ex(char *name, uint name_length, int orig, zend_bool *exists) /* {{{ */ { zend_ini_entry *ini_entry; TSRMLS_FETCH(); if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry) == SUCCESS) { if (exists) { *exists = 1; } if (orig && ini_entry->modified) { return ini_entry->orig_value; } else { return ini_entry->value; } } else { if (exists) { *exists = 0; } return NULL; } } /* }}} */ ZEND_API char *zend_ini_string(char *name, uint name_length, int orig) /* {{{ */ { zend_bool exists = 1; char *return_value; return_value = zend_ini_string_ex(name, name_length, orig, &exists); if (!exists) { return NULL; } else if (!return_value) { return_value = ""; } return return_value; } /* }}} */ #if TONY_20070307 static void zend_ini_displayer_cb(zend_ini_entry *ini_entry, int type) /* {{{ */ { if (ini_entry->displayer) { ini_entry->displayer(ini_entry, type); } else { char *display_string; uint display_string_length; if (type == ZEND_INI_DISPLAY_ORIG && ini_entry->modified) { if (ini_entry->orig_value) { display_string = ini_entry->orig_value; display_string_length = ini_entry->orig_value_length; } else { if (zend_uv.html_errors) { display_string = NO_VALUE_HTML; display_string_length = sizeof(NO_VALUE_HTML) - 1; } else { display_string = NO_VALUE_PLAINTEXT; display_string_length = sizeof(NO_VALUE_PLAINTEXT) - 1; } } } else if (ini_entry->value && ini_entry->value[0]) { display_string = ini_entry->value; display_string_length = ini_entry->value_length; } else { if (zend_uv.html_errors) { display_string = NO_VALUE_HTML; display_string_length = sizeof(NO_VALUE_HTML) - 1; } else { display_string = NO_VALUE_PLAINTEXT; display_string_length = sizeof(NO_VALUE_PLAINTEXT) - 1; } } ZEND_WRITE(display_string, display_string_length); } } /* }}} */ #endif ZEND_INI_DISP(zend_ini_boolean_displayer_cb) /* {{{ */ { int value, tmp_value_len; char *tmp_value; if (type == ZEND_INI_DISPLAY_ORIG && ini_entry->modified) { tmp_value = (ini_entry->orig_value ? ini_entry->orig_value : NULL ); tmp_value_len = ini_entry->orig_value_length; } else if (ini_entry->value) { tmp_value = ini_entry->value; tmp_value_len = ini_entry->value_length; } else { tmp_value = NULL; tmp_value_len = 0; } if (tmp_value) { if (tmp_value_len == 4 && strcasecmp(tmp_value, "true") == 0) { value = 1; } else if (tmp_value_len == 3 && strcasecmp(tmp_value, "yes") == 0) { value = 1; } else if (tmp_value_len == 2 && strcasecmp(tmp_value, "on") == 0) { value = 1; } else { value = atoi(tmp_value); } } else { value = 0; } if (value) { ZEND_PUTS("On"); } else { ZEND_PUTS("Off"); } } /* }}} */ ZEND_INI_DISP(zend_ini_color_displayer_cb) /* {{{ */ { char *value; if (type == ZEND_INI_DISPLAY_ORIG && ini_entry->modified) { value = ini_entry->orig_value; } else if (ini_entry->value) { value = ini_entry->value; } else { value = NULL; } if (value) { if (zend_uv.html_errors) { zend_printf("<font style=\"color: %s\">%s</font>", value, value); } else { ZEND_PUTS(value); } } else { if (zend_uv.html_errors) { ZEND_PUTS(NO_VALUE_HTML); } else { ZEND_PUTS(NO_VALUE_PLAINTEXT); } } } /* }}} */ ZEND_INI_DISP(display_link_numbers) /* {{{ */ { char *value; if (type == ZEND_INI_DISPLAY_ORIG && ini_entry->modified) { value = ini_entry->orig_value; } else if (ini_entry->value) { value = ini_entry->value; } else { value = NULL; } if (value) { if (atoi(value) == -1) { ZEND_PUTS("Unlimited"); } else { zend_printf("%s", value); } } } /* }}} */ /* Standard message handlers */ ZEND_API ZEND_INI_MH(OnUpdateBool) /* {{{ */ { zend_bool *p; #ifndef ZTS char *base = (char *) mh_arg2; #else char *base; base = (char *) ts_resource(*((int *) mh_arg2)); #endif p = (zend_bool *) (base+(size_t) mh_arg1); if (new_value_length == 2 && strcasecmp("on", new_value) == 0) { *p = (zend_bool) 1; } else if (new_value_length == 3 && strcasecmp("yes", new_value) == 0) { *p = (zend_bool) 1; } else if (new_value_length == 4 && strcasecmp("true", new_value) == 0) { *p = (zend_bool) 1; } else { *p = (zend_bool) atoi(new_value); } return SUCCESS; } /* }}} */ ZEND_API ZEND_INI_MH(OnUpdateLong) /* {{{ */ { long *p; #ifndef ZTS char *base = (char *) mh_arg2; #else char *base; base = (char *) ts_resource(*((int *) mh_arg2)); #endif p = (long *) (base+(size_t) mh_arg1); *p = zend_atol(new_value, new_value_length); return SUCCESS; } /* }}} */ ZEND_API ZEND_INI_MH(OnUpdateLongGEZero) /* {{{ */ { long *p, tmp; #ifndef ZTS char *base = (char *) mh_arg2; #else char *base; base = (char *) ts_resource(*((int *) mh_arg2)); #endif tmp = zend_atol(new_value, new_value_length); if (tmp < 0) { return FAILURE; } p = (long *) (base+(size_t) mh_arg1); *p = tmp; return SUCCESS; } /* }}} */ ZEND_API ZEND_INI_MH(OnUpdateReal) /* {{{ */ { double *p; #ifndef ZTS char *base = (char *) mh_arg2; #else char *base; base = (char *) ts_resource(*((int *) mh_arg2)); #endif p = (double *) (base+(size_t) mh_arg1); *p = zend_strtod(new_value, NULL); return SUCCESS; } /* }}} */ ZEND_API ZEND_INI_MH(OnUpdateString) /* {{{ */ { char **p; #ifndef ZTS char *base = (char *) mh_arg2; #else char *base; base = (char *) ts_resource(*((int *) mh_arg2)); #endif p = (char **) (base+(size_t) mh_arg1); *p = new_value; return SUCCESS; } /* }}} */ ZEND_API ZEND_INI_MH(OnUpdateStringUnempty) /* {{{ */ { char **p; #ifndef ZTS char *base = (char *) mh_arg2; #else char *base; base = (char *) ts_resource(*((int *) mh_arg2)); #endif if (new_value && !new_value[0]) { return FAILURE; } p = (char **) (base+(size_t) mh_arg1); *p = new_value; return SUCCESS; } /* }}} */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * indent-tabs-mode: t * End: */
lunaczp/learning
language/c/testPhpSrc/php-5.6.17/Zend/zend_ini.c
C
mit
18,021
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Class template basic_filter_factory</title> <link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> <link rel="home" href="../../index.html" title="Chapter 1. Boost.Log v2"> <link rel="up" href="../../utilities.html#header.boost.log.utility.setup.filter_parser_hpp" title="Header &lt;boost/log/utility/setup/filter_parser.hpp&gt;"> <link rel="prev" href="add_file_log.html" title="Function template add_file_log"> <link rel="next" href="filter_factory.html" title="Struct template filter_factory"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <table cellpadding="2" width="100%"><tr><td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td></tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="add_file_log.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../utilities.html#header.boost.log.utility.setup.filter_parser_hpp"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="filter_factory.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a> </div> <div class="refentry"> <a name="boost.log.basic_filter_factory"></a><div class="titlepage"></div> <div class="refnamediv"> <h2><span class="refentrytitle">Class template basic_filter_factory</span></h2> <p>boost::log::basic_filter_factory</p> </div> <h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2> <div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../utilities.html#header.boost.log.utility.setup.filter_parser_hpp" title="Header &lt;boost/log/utility/setup/filter_parser.hpp&gt;">boost/log/utility/setup/filter_parser.hpp</a>&gt; </span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> CharT<span class="special">,</span> <span class="keyword">typename</span> AttributeValueT<span class="special">&gt;</span> <span class="keyword">class</span> <a class="link" href="basic_filter_factory.html" title="Class template basic_filter_factory">basic_filter_factory</a> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">log</span><span class="special">::</span><span class="identifier">filter_factory</span><span class="special">&lt;</span> <span class="identifier">CharT</span> <span class="special">&gt;</span> <span class="special">{</span> <span class="keyword">public</span><span class="special">:</span> <span class="comment">// types</span> <span class="keyword">typedef</span> <span class="identifier">AttributeValueT</span> <a name="boost.log.basic_filter_factory.value_type"></a><span class="identifier">value_type</span><span class="special">;</span> <span class="comment">// The type(s) of the attribute value expected. </span> <span class="keyword">typedef</span> <span class="identifier">base_type</span><span class="special">::</span><span class="identifier">string_type</span> <a name="boost.log.basic_filter_factory.string_type"></a><span class="identifier">string_type</span><span class="special">;</span> <span class="comment">// <a class="link" href="basic_filter_factory.html#idm45961915497040-bb">public member functions</a></span> <span class="keyword">virtual</span> <span class="identifier">filter</span> <a class="link" href="basic_filter_factory.html#idm45961915496480-bb"><span class="identifier">on_exists_test</span></a><span class="special">(</span><span class="identifier">attribute_name</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span> <span class="keyword">virtual</span> <span class="identifier">filter</span> <a class="link" href="basic_filter_factory.html#idm45961915494208-bb"><span class="identifier">on_equality_relation</span></a><span class="special">(</span><span class="identifier">attribute_name</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">string_type</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span> <span class="keyword">virtual</span> <span class="identifier">filter</span> <a class="link" href="basic_filter_factory.html#idm45961915491264-bb"><span class="identifier">on_inequality_relation</span></a><span class="special">(</span><span class="identifier">attribute_name</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">string_type</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span> <span class="keyword">virtual</span> <span class="identifier">filter</span> <a class="link" href="basic_filter_factory.html#idm45961915488320-bb"><span class="identifier">on_less_relation</span></a><span class="special">(</span><span class="identifier">attribute_name</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">string_type</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span> <span class="keyword">virtual</span> <span class="identifier">filter</span> <a class="link" href="basic_filter_factory.html#idm45961915485392-bb"><span class="identifier">on_greater_relation</span></a><span class="special">(</span><span class="identifier">attribute_name</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">string_type</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span> <span class="keyword">virtual</span> <span class="identifier">filter</span> <a class="link" href="basic_filter_factory.html#idm45961915482448-bb"><span class="identifier">on_less_or_equal_relation</span></a><span class="special">(</span><span class="identifier">attribute_name</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">string_type</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span> <span class="keyword">virtual</span> <span class="identifier">filter</span> <a class="link" href="basic_filter_factory.html#idm45961915479488-bb"><span class="identifier">on_greater_or_equal_relation</span></a><span class="special">(</span><span class="identifier">attribute_name</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">string_type</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span> <span class="keyword">virtual</span> <span class="identifier">filter</span> <a class="link" href="basic_filter_factory.html#idm45961915476528-bb"><span class="identifier">on_custom_relation</span></a><span class="special">(</span><span class="identifier">attribute_name</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">string_type</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">string_type</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span> <span class="keyword">virtual</span> <span class="identifier">value_type</span> <a class="link" href="basic_filter_factory.html#idm45961915472896-bb"><span class="identifier">parse_argument</span></a><span class="special">(</span><span class="identifier">string_type</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span> <span class="special">}</span><span class="special">;</span></pre></div> <div class="refsect1"> <a name="idm46846445284688"></a><h2>Description</h2> <p>The base class for filter factories. The class defines default implementations for most filter expressions. In order to be able to construct filters, the attribute value type must support reading from a stream. Also, the default filters will rely on relational operators for the type, so these operators must also be defined. </p> <div class="refsect2"> <a name="idm46846445283680"></a><h3> <a name="idm45961915497040-bb"></a><code class="computeroutput">basic_filter_factory</code> public member functions</h3> <div class="orderedlist"><ol class="orderedlist" type="1"> <li class="listitem"> <pre class="literallayout"><span class="keyword">virtual</span> <span class="identifier">filter</span> <a name="idm45961915496480-bb"></a><span class="identifier">on_exists_test</span><span class="special">(</span><span class="identifier">attribute_name</span> <span class="keyword">const</span> <span class="special">&amp;</span> name<span class="special">)</span><span class="special">;</span></pre> <p>The callback for filter for the attribute existence test </p> </li> <li class="listitem"> <pre class="literallayout"><span class="keyword">virtual</span> <span class="identifier">filter</span> <a name="idm45961915494208-bb"></a><span class="identifier">on_equality_relation</span><span class="special">(</span><span class="identifier">attribute_name</span> <span class="keyword">const</span> <span class="special">&amp;</span> name<span class="special">,</span> <span class="identifier">string_type</span> <span class="keyword">const</span> <span class="special">&amp;</span> arg<span class="special">)</span><span class="special">;</span></pre> <p>The callback for equality relation filter </p> </li> <li class="listitem"> <pre class="literallayout"><span class="keyword">virtual</span> <span class="identifier">filter</span> <a name="idm45961915491264-bb"></a><span class="identifier">on_inequality_relation</span><span class="special">(</span><span class="identifier">attribute_name</span> <span class="keyword">const</span> <span class="special">&amp;</span> name<span class="special">,</span> <span class="identifier">string_type</span> <span class="keyword">const</span> <span class="special">&amp;</span> arg<span class="special">)</span><span class="special">;</span></pre> <p>The callback for inequality relation filter </p> </li> <li class="listitem"> <pre class="literallayout"><span class="keyword">virtual</span> <span class="identifier">filter</span> <a name="idm45961915488320-bb"></a><span class="identifier">on_less_relation</span><span class="special">(</span><span class="identifier">attribute_name</span> <span class="keyword">const</span> <span class="special">&amp;</span> name<span class="special">,</span> <span class="identifier">string_type</span> <span class="keyword">const</span> <span class="special">&amp;</span> arg<span class="special">)</span><span class="special">;</span></pre> <p>The callback for less relation filter </p> </li> <li class="listitem"> <pre class="literallayout"><span class="keyword">virtual</span> <span class="identifier">filter</span> <a name="idm45961915485392-bb"></a><span class="identifier">on_greater_relation</span><span class="special">(</span><span class="identifier">attribute_name</span> <span class="keyword">const</span> <span class="special">&amp;</span> name<span class="special">,</span> <span class="identifier">string_type</span> <span class="keyword">const</span> <span class="special">&amp;</span> arg<span class="special">)</span><span class="special">;</span></pre> <p>The callback for greater relation filter </p> </li> <li class="listitem"> <pre class="literallayout"><span class="keyword">virtual</span> <span class="identifier">filter</span> <a name="idm45961915482448-bb"></a><span class="identifier">on_less_or_equal_relation</span><span class="special">(</span><span class="identifier">attribute_name</span> <span class="keyword">const</span> <span class="special">&amp;</span> name<span class="special">,</span> <span class="identifier">string_type</span> <span class="keyword">const</span> <span class="special">&amp;</span> arg<span class="special">)</span><span class="special">;</span></pre> <p>The callback for less or equal relation filter </p> </li> <li class="listitem"> <pre class="literallayout"><span class="keyword">virtual</span> <span class="identifier">filter</span> <a name="idm45961915479488-bb"></a><span class="identifier">on_greater_or_equal_relation</span><span class="special">(</span><span class="identifier">attribute_name</span> <span class="keyword">const</span> <span class="special">&amp;</span> name<span class="special">,</span> <span class="identifier">string_type</span> <span class="keyword">const</span> <span class="special">&amp;</span> arg<span class="special">)</span><span class="special">;</span></pre> <p>The callback for greater or equal relation filter </p> </li> <li class="listitem"> <pre class="literallayout"><span class="keyword">virtual</span> <span class="identifier">filter</span> <a name="idm45961915476528-bb"></a><span class="identifier">on_custom_relation</span><span class="special">(</span><span class="identifier">attribute_name</span> <span class="keyword">const</span> <span class="special">&amp;</span> name<span class="special">,</span> <span class="identifier">string_type</span> <span class="keyword">const</span> <span class="special">&amp;</span> rel<span class="special">,</span> <span class="identifier">string_type</span> <span class="keyword">const</span> <span class="special">&amp;</span> arg<span class="special">)</span><span class="special">;</span></pre> <p>The callback for custom relation filter </p> </li> <li class="listitem"> <pre class="literallayout"><span class="keyword">virtual</span> <span class="identifier">value_type</span> <a name="idm45961915472896-bb"></a><span class="identifier">parse_argument</span><span class="special">(</span><span class="identifier">string_type</span> <span class="keyword">const</span> <span class="special">&amp;</span> arg<span class="special">)</span><span class="special">;</span></pre> <p>The function parses the argument value for a binary relation </p> </li> </ol></div> </div> </div> </div> <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> <td align="left"></td> <td align="right"><div class="copyright-footer">Copyright © 2007-2021 Andrey Semashev<p> Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>). </p> </div></td> </tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="add_file_log.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../utilities.html#header.boost.log.utility.setup.filter_parser_hpp"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="filter_factory.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a> </div> </body> </html>
davehorton/drachtio-server
deps/boost_1_77_0/libs/log/doc/html/boost/log/basic_filter_factory.html
HTML
mit
16,141
import axios from 'axios'; import MockAdapter from 'axios-mock-adapter'; import { createContext } from '../../common'; import {deleteDroplet} from './delete-droplet'; import * as MOCK from './delete-droplet.mock'; describe('droplet', () => { const DROPLET_ID = 123; const URL = `/droplets/${DROPLET_ID}`; const TOKEN = process.env.TEST_TOKEN as string; const mock = new MockAdapter(axios); mock.onDelete(URL).reply( MOCK.response.headers.status, undefined, MOCK.response.headers, ); const context = createContext({ axios, token: TOKEN, }); beforeEach(() => { mock.resetHistory(); }); describe('delete-droplet', () => { it('should be a fn', () => { expect(typeof deleteDroplet).toBe('function'); }); it('should return a fn', () => { expect(typeof deleteDroplet(context)).toBe('function'); }); it('should return a valid response', async () => { const _deleteDroplet = deleteDroplet(context); const response = await _deleteDroplet({droplet_id: DROPLET_ID}); Object.assign(response, {request: mock.history.delete[0]}); /// validate response schema expect(typeof response).toBe('object'); expect(typeof response.headers).toBe('object'); expect(typeof response.request).toBe('object'); expect(typeof response.status).toBe('number'); /// validate request const {request} = response; expect(request.baseURL + request.url).toBe(context.endpoint + URL); expect(request.method).toBe('delete'); expect(request.headers).toMatchObject(MOCK.request.headers); expect(request.data).toBeUndefined(); /// validate headers const {headers, status} = response; expect(headers).toMatchObject(MOCK.response.headers); expect(status).toBe(MOCK.response.headers.status); }); }); });
pjpimentel/dots
src/droplet/delete-droplet/delete-droplet.spec.ts
TypeScript
mit
1,849
/** * Created by sam on 17/1/2. */ "use strict"; const mongoose = require('mongoose'); const SystemConfig = require('./config'); const { exceptionLogger: ExceptionLogger, dbMongoLogger : MongoLogger } = require('./logger'); const ProcessExitError = require('./error').ProcessExitError; const mongoConfig = SystemConfig.getSection('datasources/mongod'); exports.connect = function connect() { var port = mongoConfig.port; var connectArgs = [mongoConfig.host, mongoConfig.name || 'planer']; // port if (port) connectArgs.push(port); let user = mongoConfig.user; let pass = mongoConfig.pwd || mongoConfig.password; if (pass != null) { pass = pass.toString(); } if (user == null || pass == null) { MongoLogger.warn({ user: user, pass: pass }, 'try to connect mongo db without authentication, it is not safe enough and may cause commands execute failed! Make sure that this is expected behavior!') } // options connectArgs.push({ auth: true, user: user, pass: pass }); // callback connectArgs.push(function(err) { if (err) { let processExitError = new ProcessExitError({ cause: err }, 'process exit because of mongo connection failed'); ExceptionLogger.error(processExitError); process.exit(1); } }); // 配置有效性的校验交给mongoose 来完成 return mongoose.connect.apply(mongoose, connectArgs); };
SamHwang1990/planer
libs/connect_client/mongod.js
JavaScript
mit
1,441
function execute(sender, commandName, action, ...) Player(sender):addScriptOnce("cmd/fighter.lua", action, ...) return 0, "", "" end function getDescription() return "Adds fighters to players hangar." end function getHelp() return "Adds fighters to players hangar. Usage:\n/fighter add <weapon> [rarity] [material] [tech]\n" end
AvorionCommands/avorion-scripts
scripts/commands/fighter.lua
Lua
mit
335
sf-tools =================== This is fork of [**forcedotcom-builder**](https://github.com/jonathanrico/forcedotcom-builder) Force.com builder for atom.io This builder provides a simple wrapper for the ANT Migration tool provided by Salesforce, allows you to run your build.xml ant targets. ![sf-tools](screenshots/overview.gif "sf-tools") ## Features: - Generate a new Force.com project structure - Retrieve & Deploy force.com projects straight from Atom - Create new Apex Classes, VF pages/components and Custom Labels - Deploy single or multiple files - Deploy only Apex Classes or Visualforce pages - Create Custom Labels from Text Selection
mrveress/sf-tools
README.md
Markdown
mit
653
# clusterbrake A project which uses Handbrake to automatically transcode video files in a cluster. ### This project is abandoned and superseded by [clustercode](https://github.com/BrainDoctor/clustercode) ## Who is it for Well, * if you have some automatic downloaders like Couchpotato or Sickrage/Sickbeard, * and you like to keep a nice and clean video library, * you have some sort of server or NAS that can do things unattended * you don't like the idea of on-the-fly transcoding of some other Home media player software then this might be for you. ## What does it? It picks video files from a watch folder and transcodes them into a new format based on a template. Transcoding does not happen with this software, but instead relies on a 3rd party software like handbrake or ffmpeg # Features * Watch folder for automatic encoding. All files will have a unified output format * Multiple Machines (Nodes) can encode. They will distribute the jobs so that no node encodes the same file as another one. A shared storage is needed for that feature (e.g. NFS, GlusterFS, CIFS, etc). Buy some Raspberry Pi's and happily transcode your library ;) * Templates for transcoder settings * A Docker image for easy install and setup. * File-based configuration (at least for now). No database needed. * Constraints for a single Node. Following constraints are available: * Time-Window: E.g. Only transcode during the night * File size: If a video is very big, a Raspberry Pi might take a very long time. Leave the job for another server with more processing power. # Project status This project is abandoned and superseded by [clustercode](https://github.com/BrainDoctor/clustercode). No bugfixes, updates whatsoever will happen to clusterbrake, at least from my side. # How exactly does it work? Head over to the wiki and see the default workflow for yourself.
BrainDoctor/clusterbrake
README.md
Markdown
mit
1,866
~function () { /** * Create a new player. */ function Player(params) { params || (params = {}); for (var key in params) this[key] = params[key]; _createAnimation(this); _createMesh(this); _setThirdPersonCamera(this); this.score = 0; this.target = this.mesh.position.clone(); } Player.prototype.run = function () { this.anim.play("run"); } /** * Update the player at each frame. * @param delta The delta time between this frame and * the previous one. */ Player.prototype.update = function (delta) { this.anim.update(delta * 1000); if (THREE.Input.isKeyDown('leftArrow')) _moveLeft(this); if (THREE.Input.isKeyDown('rightArrow')) _moveRight(this); this.mesh.position.lerp(this.target, delta * 10); if (this.isInvinsible()) { this.invinsibleDelay -= delta; this.mesh.visible = ~~(this.invinsibleDelay * 10) % 2; } else this.mesh.visible = true; } /** * Check collision between the player and another entity. */ Player.prototype.hit = function (entity) { var d = entity.mesh.position.z + 35 - this.mesh.position.z; return d >= 0 && d <= 50 && entity.mesh.position.x === this.target.x; } /** * Return true if the player is in invisible mode. */ Player.prototype.isInvinsible = function () { return this.invinsibleDelay > 0; } /** * Increase player score. */ Player.prototype.increaseScore = function () { this.score++; } /** * Decrease player lifes. */ Player.prototype.decreaseLifes = function () { if (this.isInvinsible()) return ; this.lifes--; this.invinsibleDelay = 2; } /** * Translate the player to the left. */ var _moveLeft = function (self) { if (self.target.x === -50) return ; self.target.x -= 50; } /** * Translate the player to the right. */ var _moveRight = function (self) { if (self.target.x === 50) return ; self.target.x += 50; } /** * Create the player sprite animation. */ var _createAnimation = function (self) { var texture = new THREE.ImageUtils.loadTexture("resources/mario.png"); self.anim = new THREE.SpriteAnimation({ texture: texture, tilesHorizontal: 6, tilesVertical: 4, numberOfTiles: 24, delay: 42 }); self.anim.add("idle", {from: 22, to: 22}); self.anim.add("run", {from: 18, to: 23}); self.anim.play("idle"); } /** * Create the player mesh. */ var _createMesh = function (self) { var material = new THREE.MeshBasicMaterial({ map: self.anim.texture }); material.transparent = true; self.mesh = new THREE.Mesh( new THREE.PlaneGeometry(50, 50), material ); self.mesh.position.y += 25; self.mesh.position.z += 25; self.scene.add(self.mesh); } /** * Attach a third person camera to the player. */ var _setThirdPersonCamera = function (self) { self.controls = new THREE.ThirdPersonControls({ camera: self.camera, target: self.mesh, lerp: 0.05, offset: new THREE.Vector3(0, 90, 200), moveSpeed: 0, // on block les mouvements contraints: new THREE.Vector2(1, 1) // et les rotations }); self.camera.position.set(5000, 4000, 5000); } window.Player = Player; }();
jeremt/RunnerBMA
scripts/Player.js
JavaScript
mit
3,122
<?php /* :posicion:show.html.twig */ class __TwigTemplate_e7e12512fd8a30ab8adb1ff0b29848a5a9cd7341e0ee62a7a591e78cbc0a0e8a extends Twig_Template { public function __construct(Twig_Environment $env) { parent::__construct($env); // line 1 $this->parent = $this->loadTemplate("base.html.twig", ":posicion:show.html.twig", 1); $this->blocks = array( 'body' => array($this, 'block_body'), ); } protected function doGetParent(array $context) { return "base.html.twig"; } protected function doDisplay(array $context, array $blocks = array()) { $this->parent->display($context, array_merge($this->blocks, $blocks)); } // line 3 public function block_body($context, array $blocks = array()) { // line 4 echo " <h1>Posicion</h1> <table> <tbody> <tr> <th>Posnoticia</th> <td>"; // line 10 echo twig_escape_filter($this->env, $this->getAttribute((isset($context["posicion"]) ? $context["posicion"] : null), "posNoticia", array()), "html", null, true); echo "</td> </tr> <tr> <th>Posnoticiainterna</th> <td>"; // line 14 echo twig_escape_filter($this->env, $this->getAttribute((isset($context["posicion"]) ? $context["posicion"] : null), "posNoticiainterna", array()), "html", null, true); echo "</td> </tr> <tr> <th>Posdestacado</th> <td>"; // line 18 echo twig_escape_filter($this->env, $this->getAttribute((isset($context["posicion"]) ? $context["posicion"] : null), "posDestacado", array()), "html", null, true); echo "</td> </tr> <tr> <th>Posvideo</th> <td>"; // line 22 echo twig_escape_filter($this->env, $this->getAttribute((isset($context["posicion"]) ? $context["posicion"] : null), "posVideo", array()), "html", null, true); echo "</td> </tr> <tr> <th>Posestadistica</th> <td>"; // line 26 echo twig_escape_filter($this->env, $this->getAttribute((isset($context["posicion"]) ? $context["posicion"] : null), "posEstadistica", array()), "html", null, true); echo "</td> </tr> <tr> <th>Posenlace</th> <td>"; // line 30 echo twig_escape_filter($this->env, $this->getAttribute((isset($context["posicion"]) ? $context["posicion"] : null), "posEnlace", array()), "html", null, true); echo "</td> </tr> <tr> <th>Id</th> <td>"; // line 34 echo twig_escape_filter($this->env, $this->getAttribute((isset($context["posicion"]) ? $context["posicion"] : null), "id", array()), "html", null, true); echo "</td> </tr> </tbody> </table> <ul> <li> <a href=\""; // line 41 echo $this->env->getExtension('routing')->getPath("posicion_index"); echo "\">Back to the list</a> </li> <li> <a href=\""; // line 44 echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("posicion_edit", array("id" => $this->getAttribute((isset($context["posicion"]) ? $context["posicion"] : null), "id", array()))), "html", null, true); echo "\">Edit</a> </li> <li> "; // line 47 echo $this->env->getExtension('form')->renderer->renderBlock((isset($context["delete_form"]) ? $context["delete_form"] : null), 'form_start'); echo " <input type=\"submit\" value=\"Delete\"> "; // line 49 echo $this->env->getExtension('form')->renderer->renderBlock((isset($context["delete_form"]) ? $context["delete_form"] : null), 'form_end'); echo " </li> </ul> "; } public function getTemplateName() { return ":posicion:show.html.twig"; } public function isTraitable() { return false; } public function getDebugInfo() { return array ( 108 => 49, 103 => 47, 97 => 44, 91 => 41, 81 => 34, 74 => 30, 67 => 26, 60 => 22, 53 => 18, 46 => 14, 39 => 10, 31 => 4, 28 => 3, 11 => 1,); } } /* {% extends 'base.html.twig' %}*/ /* */ /* {% block body %}*/ /* <h1>Posicion</h1>*/ /* */ /* <table>*/ /* <tbody>*/ /* <tr>*/ /* <th>Posnoticia</th>*/ /* <td>{{ posicion.posNoticia }}</td>*/ /* </tr>*/ /* <tr>*/ /* <th>Posnoticiainterna</th>*/ /* <td>{{ posicion.posNoticiainterna }}</td>*/ /* </tr>*/ /* <tr>*/ /* <th>Posdestacado</th>*/ /* <td>{{ posicion.posDestacado }}</td>*/ /* </tr>*/ /* <tr>*/ /* <th>Posvideo</th>*/ /* <td>{{ posicion.posVideo }}</td>*/ /* </tr>*/ /* <tr>*/ /* <th>Posestadistica</th>*/ /* <td>{{ posicion.posEstadistica }}</td>*/ /* </tr>*/ /* <tr>*/ /* <th>Posenlace</th>*/ /* <td>{{ posicion.posEnlace }}</td>*/ /* </tr>*/ /* <tr>*/ /* <th>Id</th>*/ /* <td>{{ posicion.id }}</td>*/ /* </tr>*/ /* </tbody>*/ /* </table>*/ /* */ /* <ul>*/ /* <li>*/ /* <a href="{{ path('posicion_index') }}">Back to the list</a>*/ /* </li>*/ /* <li>*/ /* <a href="{{ path('posicion_edit', { 'id': posicion.id }) }}">Edit</a>*/ /* </li>*/ /* <li>*/ /* {{ form_start(delete_form) }}*/ /* <input type="submit" value="Delete">*/ /* {{ form_end(delete_form) }}*/ /* </li>*/ /* </ul>*/ /* {% endblock %}*/ /* */
mwveliz/sitio
app/prod/cache/twig/ce/ced520151dab74a216181884502077008348cb17443831f80ff4f03ef9fc0c9c.php
PHP
mit
6,143
--- layout: post title: This is Only a Marvelous Test for Word Wrapping and Layout categories: review img: cm_lets_python.jpg label: Material --- Deep Learning Resources * ....
rheartpython/cisw
_posts.bkup/0003-01-01-test.markdown
Markdown
mit
180
module NetforumEnterprise VERSION = '2.4.1'.freeze end
blueskybroadcast/netforum_enterprise
lib/netforum_enterprise/version.rb
Ruby
mit
57
7.0-alpha3:8c1bce8cc9d7b1f8cc04c02e81bda0e7596f5729dfac9c527e733e157971a037 7.0-alpha4:8c1bce8cc9d7b1f8cc04c02e81bda0e7596f5729dfac9c527e733e157971a037 7.0-alpha5:8c1bce8cc9d7b1f8cc04c02e81bda0e7596f5729dfac9c527e733e157971a037 7.0-alpha6:8c1bce8cc9d7b1f8cc04c02e81bda0e7596f5729dfac9c527e733e157971a037 7.0-alpha7:8c1bce8cc9d7b1f8cc04c02e81bda0e7596f5729dfac9c527e733e157971a037 7.0-beta1:8c1bce8cc9d7b1f8cc04c02e81bda0e7596f5729dfac9c527e733e157971a037 7.0-beta2:8c1bce8cc9d7b1f8cc04c02e81bda0e7596f5729dfac9c527e733e157971a037 7.0-beta3:326c5b0d2004b4dd8ae0623ce8de1ee609387f6e8ab437e06a801d6e92689bdb 7.1:a35b30688eac45f6b77d9e0d5a61f1c04bda7a5cff630eb63f72fd565737135a 7.2:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.3:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.4:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.5:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.6:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.7:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.8:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.9:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.10:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.11:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.12:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.13:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.14:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.15:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.16:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.17:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.18:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.19:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.20:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.21:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.22:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.23:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.24:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.25:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.26:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.27:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.28:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.29:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.30:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.31:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.32:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.33:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.34:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.35:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.36:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.37:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.38:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.39:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.40:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.41:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.42:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.43:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.44:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.50:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.51:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.52:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.53:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.54:fca21daa7fd1c05f1874241aeb1ac9d1e30ebf507e763000507e6d56dc89d2d0 7.0:bfd7b1d70ecc46e93abcf3b4af503c21ae7b65001456263d6bde9c5101cf5ea5
GoZOo/Drupaloscopy
hashs-database/hashs/misc___ui___jquery.ui.accordion.css
CSS
mit
4,095
body,html { background-color: rgb(249,209,212); height:auto; } .width970 { width: 970px; } .main-header { height:60px; width:100%; line-height:60px; color:#fff; font-family:"Microsoft yahei"; font-size:24px; background-color:rgb(240,145,146); } .main-footer { width:100%; line-height:60px; background-color: rgb(240,145,146); color:#fff; } .main-content { color:rgb(240,145,146); display:table-cell; text-align:center; vertical-align:middle; } .text16 { font-size:16px; } .line-height-32 { line-height:32px; } /*resume*/ .resume-header { border-bottom:2px solid #ddd; } a.resume-back-home:link { color: #fff; } a.resume-back-home:visited { color: #fff; } a.resume-back-home:hover { color: #eee; } a.resume-back-home:active { color: #fff; } .resume-content { margin-top:20px; margin-botton:20px; } .min-width-72 { min-width:72px; }
ruiluoxie/ruiluoxie.github.io
stylesheets/style.css
CSS
mit
948
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <title>BoostBook element postconditions</title> <link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.76.1"> <link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset"> <link rel="up" href="../../reference.html" title="Reference"> <link rel="prev" href="macroname.html" title="BoostBook element macroname"> <link rel="next" href="compile-test.html" title="BoostBook element compile-test"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <table cellpadding="2" width="100%"><tr> <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td> <td align="center"><a href="../../../../index.html">Home</a></td> <td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td> <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> <td align="center"><a href="../../../../more/index.htm">More</a></td> </tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="macroname.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../reference.html"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="compile-test.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a> </div> <div class="refentry"> <a name="boostbook.dtd.postconditions"></a><div class="titlepage"></div> <div class="refnamediv"> <h2><span class="refentrytitle"> BoostBook element <code class="sgmltag-element">postconditions</code></span></h2> <p>postconditions &#8212; Conditions that must hold after the function returns</p> </div> <h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2> <div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv">postconditions ::= (ANY) </div> <div class="refsection"> <a name="idp514469728"></a><h2>Attributes</h2> <div class="informaltable"><table class="table"> <colgroup> <col> <col> <col> <col> </colgroup> <thead><tr> <th>Name</th> <th>Type</th> <th>Value</th> <th>Purpose</th> </tr></thead> <tbody> <tr> <td>last-revision</td> <td>#IMPLIED</td> <td>CDATA</td> <td>Set to $Date$ to keep "last revised" information in sync with CVS changes</td> </tr> <tr> <td>id</td> <td>#IMPLIED</td> <td>CDATA</td> <td>A global identifier for this element</td> </tr> <tr> <td>xml:base</td> <td>#IMPLIED</td> <td>CDATA</td> <td>Implementation detail used by XIncludes</td> </tr> </tbody> </table></div> </div> </div> <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> <td align="left"></td> <td align="right"><div class="copyright-footer">Copyright &#169; 2003-2005 Douglas Gregor<p>Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>). </p> </div></td> </tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="macroname.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../reference.html"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="compile-test.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a> </div> </body> </html>
calvinfarias/IC2015-2
BOOST/boost_1_61_0/doc/html/boostbook/dtd/postconditions.html
HTML
mit
3,963
"use strict"; /* exported deleteGroupOnClick */ function deleteGroupOnClick(event) { var name = ""; for(var i = 0; i < GROUPS.length; i++) { if(GROUPS[i].id === getAttribute(event, "id")) { name = GROUPS[i].name break; } } var aq = new ActionQueue([new Action(CONFIG.apiuri + "/group/" + encodeURIComponent(getAttribute(event, "id")), "DELETE")]); dialog("Opravdu si přejete smazat skupinu \"" + name + "\"?", "Ano", aq.closeDispatch, "Ne", function(){history.back();}); history.pushState({"sidePanel": "open"}, "title", "/admin/groups"); refreshLogin(); }
GenaBitu/OdyMaterialy
src/admin/js/actions/deleteGroup.js
JavaScript
mit
580
<?php namespace OpenDominion\Listeners; use Illuminate\Events\Dispatcher; interface SubscriberInterface { public function subscribe(Dispatcher $events); }
Kender2/OpenDominion
src/Listeners/SubscriberInterface.php
PHP
mit
162
jQuery(document).ready( function (){ $('#ingresar').click( function () { var $usuario = $('input[name=usuario]'); var $pass = $('input[name=pass]'); //alert($usuario.val() + "-" + $pass.val()); //----// if ($usuario.val()=='') { $('#usuario').attr('required', true); document.getElementById("usuario").style.border="2px solid red"; document.getElementById("usuario").focus(); return false; } else { $('#usuario').attr('required', false); document.getElementById("usuario").style.border="2px solid green"; } //----// if ($pass.val()=='') { $("#pass").attr('undefined', true); document.getElementById("pass").style.border="2px solid red"; document.getElementById("pass").focus(); return false; } else { $("#pass").attr('required', false); document.getElementById("pass").style.border="2px solid green"; } //----// var data = "usuario=" + $usuario.val() + "&pass=" + $pass.val(); $.ajax( { type: "POST", url: "validar.php", data: data, dataType: "html", cache: false, success: function (data) { $('#tip').fadeIn(1000); $('#tip').fadeOut(4000); $('#tip').html(data); } } ); return false; } ); } );
Kunai11/municipalidad
admin-panel/js/tips/login.js
JavaScript
mit
1,955
import { templates } from "./templates"; import { tools } from "./tools"; import { DB, STORE, DBVERSION, OptionTypes, m } from "./schema"; import { store } from "./storage"; import { controls } from "./controls"; import { routing } from "./routing"; import { web } from "./web"; import { lists } from "./lists"; import { forms } from "./forms"; declare const Awesomplete; export function onready(callback: Function, appName?: string) { document.addEventListener("DOMContentLoaded", function (e) { templates.master.loadMaster(document.documentElement.outerHTML).then(() => { let proms = []; document.querySelectorAll("[data-m-include]").each((idx: number, elem: Element) => { let prom = templates.load(elem.attribute("data-m-include")).then(result => { if (elem.attribute("data-m-type") != null && elem.attribute("data-m-type") == "markdown") { (<HTMLElement>elem).innerHTML = templates.markdown.toHTML(result); (<HTMLElement>elem).show(); } else { (<HTMLElement>elem).innerHTML = result; } }); proms.push(prom); }); Promise.all(proms).then(() => { document.querySelectorAll("[data-m-type='markdown']").each((idx: number, elem: Element) => { if (elem.attribute("data-m-include") == null) { (<HTMLElement>elem).innerHTML = templates.markdown.toHTML((<HTMLElement>elem).innerHTML); (<HTMLElement>elem).show(); } }); let root: string = routing.getApplicationRoot(document.documentElement.outerHTML); appName = (appName != null) ? appName : routing.getApplicationName(document.documentElement.outerHTML); let iDB = (appName == null) ? DB : `${DB}.${appName.lower()}`; let iDBStore = (appName == null) ? STORE : `${STORE}.${appName.lower()}`; let storage = new store(iDB, DBVERSION, iDBStore); storage.init().then((result) => { return storage.getItem("metron.config", "value"); }).then((result) => { if (result != null) { m.config = JSON.parse(<string><any>result); m.globals.firstLoad = true; if (callback != null) { callback(e); } } else { new Promise((resolve, reject) => { web.loadJSON(`${root}/metron.json`, (configData: JSON) => { for (let obj in configData) { if (m.config[obj] == null) { m.config[obj] = configData[obj]; } } m.config["config.baseURL"] = `${document.location.protocol}//${document.location.host}`; storage.init().then((result) => { return storage.setItem("metron.config", JSON.stringify(m.config)); }).then((result) => { resolve(configData); }).catch((rs) => { console.log(`Error: Failed to access storage. ${rs}`); }); }); }).then(() => { m.globals.firstLoad = true; if (callback != null) { callback(e); } }).catch((rsn) => { console.log(`Error: Promise execution failed! ${rsn}`); }); } }).catch((reason) => { console.log(`Error: Failed to access storage. ${reason}`); }); }); }).catch(() => { console.log("Failed to check for master page."); }); }); } export function load(re: RegExp, func: Function | { n: string, func: Function }): void { let n, f; if(typeof func == "object") { n = func.n; f = func.func; } else { f = func; } let h = () => { if(n !== undefined) { let p = document.querySelector("[data-m-type='pivot']"); if(p !== undefined) { controls.getPivot(p.attribute("data-m-page")).exact(n); } } f(); }; routing.add(re, h); } export function ifQuerystring(callback: Function): void { let qs: string = <string><any>web.querystring(); if (qs != "") { let parameters = tools.formatOptions(qs, OptionTypes.QUERYSTRING); if (callback != null) { callback(parameters); } } } export function loadOptionalFunctionality(): void { if (typeof Awesomplete !== undefined) { document.querySelectorAll("[data-m-autocomplete]").each((idx: number, elem: Element) => { let endpoint = elem.attribute("data-m-autocomplete"); let url: string = (endpoint.toLowerCase().startsWith("http")) ? endpoint : routing.getAPIURL(endpoint); let awesome = new Awesomplete(elem, { minChars: 1, sort: false, maxItems: 15, replace: function (item) { if (elem.attribute("data-m-search-hidden-store") != null && elem.attribute("data-m-search-hidden-store") != '') { this.input.value = item.label; (<HTMLInputElement>document.querySelector(`#${elem.attribute("data-m-search-hidden-store")}`)).val(item.value); (<HTMLInputElement>document.querySelector(`#${elem.attribute("data-m-search-hidden-store")}`)).dispatchEvent(new Event("change")); } else { this.input.value = item.value; } } }); elem.removeEvent("keyup").addEvent("keyup", function (e) { web.get(`${url}${web.querystringify({ IsActive: true, Search: this.val() })}`, null, null, "json", (result) => { let list = []; if (result != null) { for (var a in result) { if (result.hasOwnProperty(a)) { if (result[a][elem.attribute("data-m-search-text")] != null) { var item = { label: result[a][elem.attribute("data-m-search-text")], value: result[a][elem.attribute("data-m-search-value")] }; list.push(item); } } } awesome.list = list; } }); }); }); } } window.onhashchange = function () { if (!m.globals.hashLoadedFromApplication) { let hasPivoted = false; let section = document.querySelector("[data-m-type='pivot']"); if (section != null) { let page = section.attribute("data-m-page"); if (page != null) { let p = controls.getPivot(page); p.previous(); hasPivoted = true; } } if (!hasPivoted) { window.location.reload(false); } } m.globals.hashLoadedFromApplication = false; } onready((e: Event) => { function recursePivot(elem: Element): void { if (elem != null) { elem.show(); let route = elem.attribute("data-m-page"); let pivot = elem.up("[data-m-type='pivot']"); let pivotPageName = pivot.attribute("data-m-page"); elem.up("[data-m-type='pivot']").querySelectorAll("[data-m-segment='pivot-item']").each((idx: number, el: Element) => { if(el.up("[data-m-type='pivot']").attribute("data-m-page") === pivotPageName) { if (el.attribute("data-m-page") != route) { el.hide(); } } }); let parent = elem.parent().up("[data-m-segment='pivot-item']"); if(parent != null) { recursePivot(parent); } } } let wantsAutoload: boolean = ((document.querySelector("[data-m-autoload]") != null) && (document.querySelector("[data-m-autoload]").attribute("data-m-autoload") == "true")); document.querySelectorAll("[data-m-state='hide']").each((idx: number, elem: Element) => { elem.hide(); }); controls.pivots.bindAll(() => { let route = routing.getRouteName(); if (route != null) { let page = document.querySelector(`[data-m-segment='pivot-item'][data-m-page="${route}"]`); recursePivot(page); } loadOptionalFunctionality(); if (wantsAutoload) { lists.bindAll(() => { forms.bindAll(() => { controls.polyfill(); }); }); } }); });
metronical/metron
src/framework.ts
TypeScript
mit
9,465
<?php /** * Locale data for 'kaj'. * * This file is automatically generated by yiic cldr command. * * © 1991-2007 Unicode, Inc. All rights reserved. * Distributed under the Terms of Use in http://www.unicode.org/copyright.html. * * @copyright 2008-2013 Yii Software LLC (http://www.yiiframework.com/license/) */ return array ( 'version' => '5798', 'numberSymbols' => array ( 'alias' => '', 'decimal' => '.', 'group' => ',', 'list' => ';', 'percentSign' => '%', 'plusSign' => '+', 'minusSign' => '-', 'exponential' => 'E', 'perMille' => '‰', 'infinity' => '∞', 'nan' => 'NaN', ), 'decimalFormat' => '#,##0.###', 'scientificFormat' => '#E0', 'percentFormat' => '#,##0%', 'currencyFormat' => '¤ #,##0.00', 'currencySymbols' => array ( 'AUD' => 'AU$', 'BRL' => 'R$', 'CAD' => 'CA$', 'CNY' => 'CN¥', 'EUR' => '€', 'GBP' => '£', 'HKD' => 'HK$', 'ILS' => '₪', 'INR' => '₹', 'JPY' => 'JP¥', 'KRW' => '₩', 'MXN' => 'MX$', 'NZD' => 'NZ$', 'THB' => '฿', 'TWD' => 'NT$', 'USD' => 'US$', 'VND' => '₫', 'XAF' => 'FCFA', 'XCD' => 'EC$', 'XOF' => 'CFA', 'XPF' => 'CFPF', 'NGN' => '₦', ), 'monthNames' => array ( 'wide' => array ( 1 => 'Hywan A̱yrnig', 2 => 'Hywan A̱hwa', 3 => 'Hywan A̱tat', 4 => 'Hywan A̱naai', 5 => 'Hywan A̱pfwon', 6 => 'Hywan A̱kitat', 7 => 'Hywan A̱tyirin', 8 => 'Hywan A̱ninai', 9 => 'Hywan A̱kumviriyin', 10 => 'Hywan Swak', 11 => 'Hywan Swak B\'a̱yrnig', 12 => 'Hywan Swak B\'a̱hwa', ), 'abbreviated' => array ( 1 => 'A̱yr', 2 => 'A̱hw', 3 => 'A̱ta', 4 => 'A̱na', 5 => 'A̱pf', 6 => 'A̱ki', 7 => 'A̱ty', 8 => 'A̱ni', 9 => 'A̱ku', 10 => 'Swa', 11 => 'Sby', 12 => 'Sbh', ), ), 'monthNamesSA' => array ( 'narrow' => array ( 1 => '1', 2 => '2', 3 => '3', 4 => '4', 5 => '5', 6 => '6', 7 => '7', 8 => '8', 9 => '9', 10 => '10', 11 => '11', 12 => '12', ), ), 'weekDayNames' => array ( 'wide' => array ( 0 => 'Ladi', 1 => 'Lintani', 2 => 'Talata', 3 => 'Larba', 4 => 'Lamit', 5 => 'Juma', 6 => 'Asabar', ), 'abbreviated' => array ( 0 => 'Lad', 1 => 'Lin', 2 => 'Tal', 3 => 'Lar', 4 => 'Lam', 5 => 'Jum', 6 => 'Asa', ), ), 'weekDayNamesSA' => array ( 'narrow' => array ( 0 => '1', 1 => '2', 2 => '3', 3 => '4', 4 => '5', 5 => '6', 6 => '7', ), ), 'eraNames' => array ( 'abbreviated' => array ( 0 => 'G.M.', 1 => 'M.', ), 'wide' => array ( 0 => 'Gabanin Miladi', 1 => 'Miladi', ), 'narrow' => array ( 0 => 'G.M.', 1 => 'M.', ), ), 'dateFormats' => array ( 'full' => 'EEEE, y MMMM dd', 'long' => 'y MMMM d', 'medium' => 'y MMM d', 'short' => 'yy/MM/dd', ), 'timeFormats' => array ( 'full' => 'HH:mm:ss zzzz', 'long' => 'HH:mm:ss z', 'medium' => 'HH:mm:ss', 'short' => 'HH:mm', ), 'dateTimeFormat' => '{1} {0}', 'amName' => 'A.M.', 'pmName' => 'P.M.', 'orientation' => 'ltr', 'pluralRules' => array ( 0 => 'n==1', 1 => 'true', ), );
ProfilerTeam/Profiler
protected/vendors/yii/i18n/data/kaj.php
PHP
mit
3,539
#ifndef GITSUBMODULE_H #define GITSUBMODULE_H // generated from class_header.h #include <nan.h> #include <string> extern "C" { #include <git2.h> } #include "../include/submodule.h" #include "../include/repository.h" #include "../include/oid.h" #include "../include/buf.h" #include "../include/submodule_update_options.h" // Forward declaration. struct git_submodule { }; using namespace node; using namespace v8; class GitSubmodule : public ObjectWrap { public: static Persistent<Function> constructor_template; static void InitializeComponent (Handle<v8::Object> target); git_submodule *GetValue(); git_submodule **GetRefValue(); void ClearValue(); static Handle<v8::Value> New(void *raw, bool selfFreeing); bool selfFreeing; private: GitSubmodule(git_submodule *raw, bool selfFreeing); ~GitSubmodule(); static NAN_METHOD(JSNewFunction); static NAN_METHOD(AddFinalize); struct AddSetupBaton { int error_code; const git_error* error; git_submodule * out; git_repository * repo; const char * url; const char * path; int use_gitlink; }; class AddSetupWorker : public NanAsyncWorker { public: AddSetupWorker( AddSetupBaton *_baton, NanCallback *callback ) : NanAsyncWorker(callback) , baton(_baton) {}; ~AddSetupWorker() {}; void Execute(); void HandleOKCallback(); private: AddSetupBaton *baton; }; static NAN_METHOD(AddSetup); static NAN_METHOD(AddToIndex); static NAN_METHOD(Branch); static NAN_METHOD(FetchRecurseSubmodules); static NAN_METHOD(Free); static NAN_METHOD(HeadId); static NAN_METHOD(Ignore); static NAN_METHOD(IndexId); static NAN_METHOD(Init); struct LookupBaton { int error_code; const git_error* error; git_submodule * out; git_repository * repo; const char * name; }; class LookupWorker : public NanAsyncWorker { public: LookupWorker( LookupBaton *_baton, NanCallback *callback ) : NanAsyncWorker(callback) , baton(_baton) {}; ~LookupWorker() {}; void Execute(); void HandleOKCallback(); private: LookupBaton *baton; }; static NAN_METHOD(Lookup); static NAN_METHOD(Name); static NAN_METHOD(Open); static NAN_METHOD(Owner); static NAN_METHOD(Path); static NAN_METHOD(Reload); static NAN_METHOD(ReloadAll); struct RepoInitBaton { int error_code; const git_error* error; git_repository * out; const git_submodule * sm; int use_gitlink; }; class RepoInitWorker : public NanAsyncWorker { public: RepoInitWorker( RepoInitBaton *_baton, NanCallback *callback ) : NanAsyncWorker(callback) , baton(_baton) {}; ~RepoInitWorker() {}; void Execute(); void HandleOKCallback(); private: RepoInitBaton *baton; }; static NAN_METHOD(RepoInit); struct ResolveUrlBaton { int error_code; const git_error* error; git_buf * out; git_repository * repo; const char * url; }; class ResolveUrlWorker : public NanAsyncWorker { public: ResolveUrlWorker( ResolveUrlBaton *_baton, NanCallback *callback ) : NanAsyncWorker(callback) , baton(_baton) {}; ~ResolveUrlWorker() {}; void Execute(); void HandleOKCallback(); private: ResolveUrlBaton *baton; }; static NAN_METHOD(ResolveUrl); static NAN_METHOD(Save); static NAN_METHOD(SetFetchRecurseSubmodules); static NAN_METHOD(SetIgnore); static NAN_METHOD(SetUpdate); static NAN_METHOD(SetUrl); static NAN_METHOD(Sync); static NAN_METHOD(Update); static NAN_METHOD(UpdateStrategy); static NAN_METHOD(Url); static NAN_METHOD(WdId); git_submodule *raw; }; #endif
jiumx60rus/grishyGhost
node_modules/nodegit/include/submodule.h
C
mit
4,302
describe('Bikini.BikiniStore', function() { var TEST = { data : { firstName: 'Max', sureName: 'Mustermann', age: 33 } }; it('creating bikini store', function() { assert.isString(serverUrl, 'Server url is defined.'); assert.isFunction(Bikini.BikiniStore, 'Bikini.BikiniStore is defined'); TEST.store = Bikini.BikiniStore.design({ useLocalStore: true, useSocketNotify: false }); assert.isObject(TEST.store, 'store successfully created.'); }); it('creating collection', function() { assert.isFunction(Bikini.Collection, 'Bikini.Collection is defined'); TEST.TestModel = Bikini.Model.extend({ idAttribute: '_id', entity: { name: 'test', fields: { _id: { type: Bikini.DATA.TYPE.STRING, required: YES, index: YES }, sureName: { name: 'USERNAME', type: Bikini.DATA.TYPE.STRING, required: YES, index: YES }, firstName: { type: Bikini.DATA.TYPE.STRING, length: 200 }, age: { type: Bikini.DATA.TYPE.INTEGER } } } }); assert.isFunction(TEST.TestModel, 'TestModel model successfully extended.'); TEST.url = serverUrl+'/bikini/test/'; TEST.TestsModelCollection = Bikini.Collection.extend({ model: TEST.TestModel, url: TEST.url, store: TEST.store, options: { sort: { sureName: 1 }, fields: { USERNAME: 1, sureName: 1, firstName: 1, age : 1 }, query: { age : { $gte : 25 } } } }); assert.isFunction(TEST.TestsModelCollection, 'Test collection successfully extended.'); TEST.Tests = TEST.TestsModelCollection.create(); assert.isObject(TEST.Tests, 'Test collection successfully created.'); assert.equal(TEST.Tests.store, TEST.store, 'Test collection has the correct store.'); var url = TEST.Tests.getUrl(); assert.ok(url !== TEST.url, 'The base url has been extended.'); assert.equal(url.indexOf(TEST.url), 0, 'the new url starts with the set url.'); assert.ok(url.indexOf('query=')>0, 'query is part of the url.'); assert.ok(url.indexOf('fields=')>0, 'fields is part of the url.'); assert.ok(url.indexOf('sort=')>0, 'sort is part of the url.'); // try to clean everything TEST.store.clear(TEST.Tests); }); it('create record', function(done) { TEST.Tests.create(TEST.data, { success: function(model) { assert.isObject(model, 'new record created successfully.'); TEST.id = model.id; assert.ok(TEST.id, 'new record has an id.'); done(); }, error: function() { assert.ok(false, 'new record created successfully.'); done(); } } ); }); it('read record', function() { var model = TEST.Tests.get(TEST.id); assert.ok(model, "record found"); assert.equal(model.get('firstName'), TEST.data.firstName, "found record has the correct 'firstname' value"); assert.equal(model.get('sureName'), TEST.data.sureName, "found record has the correct 'sureName' value"); assert.equal(model.get('age'), TEST.data.age, "found record has the correct 'age' value"); }); it('fetching data with new model', function(done) { TEST.TestModel2 = Bikini.Model.extend({ url : TEST.url, idAttribute: '_id', store: TEST.store, entity: { name: 'test' } }); var data = { _id: TEST.id }; var model = TEST.TestModel2.create(data); assert.isObject(model, "new model created"); assert.ok(_.isEqual(model.attributes, data), "new model holds correct data attributes"); model.fetch({ success: function() { assert.ok(true, 'model has been fetched.'); assert.equal(model.get('firstName'), TEST.data.firstName, "found record has the correct 'firstname' value"); assert.equal(model.get('USERNAME'), TEST.data.sureName, "found record has the correct 'USERNAME' value"); assert.equal(model.get('age'), TEST.data.age, "found record has the correct 'age' value"); done(); }, error: function(error) { assert.ok(false, 'model has been fetched.'); done(); } }) }); it('fetching collection', function(done) { TEST.Tests.reset(); assert.equal(TEST.Tests.length, 0, 'reset has cleared the collection.'); TEST.Tests.fetch({ success: function(collection) { assert.isObject(TEST.Tests.get(TEST.id), 'The model is still there'); done(); }, error: function() { assert.ok(false, 'Test collection fetched successfully.'); done(); } }); }); it('read record', function() { var model = TEST.Tests.get(TEST.id); assert.ok(model, "record found"); assert.equal(model.get('firstName'), TEST.data.firstName, "found record has the correct 'firstname' value"); assert.equal(model.get('sureName'), TEST.data.sureName, "found record has the correct 'sureName' value"); assert.equal(model.get('age'), TEST.data.age, "found record has the correct 'age' value"); }); it('delete record', function(done) { var model = TEST.Tests.get(TEST.id); assert.isObject(model, 'model found in collection'); assert.equal(model.id, TEST.id, 'model has the correct id'); model.destroy( { success: function(model) { assert.ok(true, 'record has been deleted.'); done(); }, error: function() { assert.ok(false, 'record has been deleted.'); done(); } }); }); it('cleanup records bikini', function(done) { if (TEST.Tests.length === 0) { done(); } else { var model, hasError = false, isDone = false; while ((model = TEST.Tests.first()) && !hasError) { model.destroy({ success: function() { if (TEST.Tests.length == 0 && !isDone) { isDone = true; assert.equal(TEST.Tests.length, 0, 'collection is empty'); done(); } }, error: function() { hasError = isDone = true; assert.ok(false, 'cleanup records bikini error'); done(); } }); } } }); });
mwaylabs/bikini
test/data/test.bikini.js
JavaScript
mit
7,186
// Source : https://leetcode.com/problems/range-sum-query-mutable/ // Author : Yijing Bai // Date : 2016-01-15 /********************************************************************************** * * Given an integer array nums, find the sum of the elements between indices i and j (i * ≤ j), inclusive. * * The update(i, val) function modifies nums by updating the element at index i to val. * * Example: * * Given nums = [1, 3, 5] * * sumRange(0, 2) -> 9 * update(1, 2) * sumRange(0, 2) -> 8 * * Note: * * The array is only modifiable by the update function. * You may assume the number of calls to update and sumRange function is distributed * evenly. * **********************************************************************************/ class NumArray { public: struct SegTreeNode { int start, end; SegTreeNode *left, *right; int sum; SegTreeNode(int s, int e) : start(s), end(e), left(NULL), right(NULL) {} }; SegTreeNode* build(vector<int>& nums, int start, int end) { if (start > end) return NULL; SegTreeNode* node = new SegTreeNode(start, end); if (start == end) { node->sum = nums[start]; } else { int mid = start + (end - start) / 2; node->left = build(nums, start, mid); node->right = build(nums, mid + 1, end); node->sum = node->left->sum + node->right->sum; } return node; } void update(SegTreeNode* root, int pos, int val) { if (root->start == root->end) { root->sum = val; return; } int mid = root->start + (root->end - root->start) / 2; if (pos <= mid) { update(root->left, pos, val); } else { update(root->right, pos, val); } root->sum = root->left->sum + root->right->sum; } int sumRange(SegTreeNode* root, int start, int end) { if (root->end == end && root->start == start) { return root->sum; } int mid = root->start + (root->end - root->start) / 2; if (end <= mid) { return sumRange(root->left, start, end); } else if (start >= mid + 1) { return sumRange(root->right, start, end); } else { return sumRange(root->right, mid + 1, end) + sumRange(root->left, start, mid); } } NumArray(vector<int> &nums) { root = build(nums, 0, nums.size() - 1); } void update(int i, int val) { update(root, i, val); } int sumRange(int i, int j) { return sumRange(root, i, j); } private: SegTreeNode *root; }; // Your NumArray object will be instantiated and called as such: // NumArray numArray(nums); // numArray.sumRange(0, 1); // numArray.update(1, 10); // numArray.sumRange(1, 2);
yijingbai/LeetCode
Design/RangeSumQueryMutable/RangeSumQueryMutable.cpp
C++
mit
2,874
--- layout: page title: Cliffs Solutions Trade Fair date: 2016-05-24 author: Julia Kelly tags: weekly links, java status: published summary: Mauris ac metus malesuada enim viverra pharetra id et orci. banner: images/banner/office-01.jpg booking: startDate: 12/12/2018 endDate: 12/13/2018 ctyhocn: YNGCFHX groupCode: CSTF published: true --- Donec a magna at velit laoreet consectetur. Praesent vel diam orci. Sed id est nec justo cursus rutrum ut nec magna. Donec varius egestas tellus non aliquet. Nunc ultrices risus a consequat malesuada. In hac habitasse platea dictumst. Duis quis euismod orci, vel luctus risus. In at neque lorem. Maecenas volutpat tortor magna, non vehicula ipsum vehicula vitae. Duis eleifend non metus posuere maximus. Donec et nisl vitae ipsum auctor eleifend. In tempus pretium nisi non sagittis. Fusce ut neque dolor. Nam consectetur arcu lobortis nulla iaculis, sit amet facilisis ex sollicitudin. * Vivamus sit amet urna tincidunt, efficitur magna non, malesuada turpis * Phasellus eu lectus vel neque luctus accumsan. Donec rhoncus massa vitae tortor tempor, vel sollicitudin arcu tempor. Duis sapien mi, lacinia et lacus eu, iaculis iaculis risus. Aliquam erat volutpat. Mauris laoreet dui ut purus molestie feugiat. Etiam enim ante, eleifend sit amet cursus non, aliquam non enim. Curabitur sagittis vulputate neque nec tempus. Suspendisse posuere viverra suscipit. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Quisque augue mi, sagittis ut lacus ac, euismod bibendum enim. Nulla accumsan tempor ligula, vitae ultrices ante posuere eget. Donec sodales ultricies maximus. Quisque consequat diam urna, ut eleifend nulla tristique id. Suspendisse potenti. Curabitur nec finibus sem, lacinia pulvinar justo. Donec purus orci, tincidunt in nibh id, vulputate feugiat mauris. Fusce ullamcorper pellentesque diam, suscipit fermentum erat placerat ac. Vivamus elementum tellus a feugiat accumsan. Fusce vitae nisl finibus, accumsan nunc et, fermentum lacus. Donec in libero consectetur, sagittis magna sit amet, bibendum purus.
KlishGroup/prose-pogs
pogs/Y/YNGCFHX/CSTF/index.md
Markdown
mit
2,113
(function () { 'use strict'; var url = $('.cart-item-selector').data('variant-action'), stockMessage = $("#stockMessage"), totalPrice = $('#totalPrice'), selectedSKUID = $('#selectedVariantID'); $('.js-variant-selector').change(function () { var id = $(this).val(); updateVariantSelection(id); }); function updateVariantSelection(variantId) { $.post(url, { variantID: variantId }, function (data) { stockMessage.text(data.stockMessage); totalPrice.text(data.totalPrice); selectedSKUID.val(variantId); }); } }());
Kentico/Mvc
samples/LearningKit/Scripts/variantSelector.js
JavaScript
mit
636
package demo.dp.b.bridge; /** * The ConcreteImplementor */ public class TextImpMac implements TextImp { public TextImpMac() { } public void DrawTextImp() { System.out.println("The text has a Mac style !"); } }
myid999/dpdemo
src/main/java/demo/dp/b/bridge/TextImpMac.java
Java
mit
246
# laradiner-di-ioc-sample Laradiner 讀書會 DI 及 IoC 示範程式碼
shengyou/laradiner-di-ioc-example
README.md
Markdown
mit
73
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.9.1"/> <title>V8 API Reference Guide for io.js v1.6.0 - v1.6.1: v8::Debug::ClientData Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { init_search(); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">V8 API Reference Guide for io.js v1.6.0 - v1.6.1 </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.9.1 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li><a href="examples.html"><span>Examples</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="namespacev8.html">v8</a></li><li class="navelem"><a class="el" href="classv8_1_1_debug.html">Debug</a></li><li class="navelem"><a class="el" href="classv8_1_1_debug_1_1_client_data.html">ClientData</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="classv8_1_1_debug_1_1_client_data-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">v8::Debug::ClientData Class Reference</div> </div> </div><!--header--> <div class="contents"> <p><code>#include &lt;<a class="el" href="v8-debug_8h_source.html">v8-debug.h</a>&gt;</code></p> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>A client object passed to the <a class="el" href="namespacev8.html">v8</a> debugger whose ownership will be taken by it. <a class="el" href="namespacev8.html">v8</a> is always responsible for deleting the object. </p> </div><hr/>The documentation for this class was generated from the following file:<ul> <li>deps/v8/include/<a class="el" href="v8-debug_8h_source.html">v8-debug.h</a></li> </ul> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Tue Aug 11 2015 23:49:28 for V8 API Reference Guide for io.js v1.6.0 - v1.6.1 by &#160;<a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.9.1 </small></address> </body> </html>
v8-dox/v8-dox.github.io
22793da/html/classv8_1_1_debug_1_1_client_data.html
HTML
mit
5,129
![Icon](http://i.imgur.com/r6KLIJa.png?1) # ProGet.Net [![Build status](https://ci.appveyor.com/api/projects/status/wo54xvvft6bcf3wr?svg=true)](https://ci.appveyor.com/project/lvermeulen/proget-net) [![license](https://img.shields.io/github/license/lvermeulen/pullinghook.svg?maxAge=2592000)](https://github.com/lvermeulen/proget.net/blob/master/LICENSE) [![NuGet](https://img.shields.io/nuget/vpre/proget.net.svg?maxAge=2592000)](https://www.nuget.org/packages/proget.net/) [![Coverage Status](https://coveralls.io/repos/github/lvermeulen/ProGet.Net/badge.svg?branch=master)](https://coveralls.io/github/lvermeulen/ProGet.Net?branch=master) [![codecov](https://codecov.io/gh/lvermeulen/proget.net/branch/master/graph/badge.svg)](https://codecov.io/gh/lvermeulen/proget.net) ![](https://img.shields.io/badge/.net-4.5.2-yellowgreen.svg) ![](https://img.shields.io/badge/netstandard-1.4-yellowgreen.svg) ProGet.Net is a C# client for [Inedo ProGet](https://inedo.com/proget). ## Features: * [X] Universal feed API * [X] Package promotion API * [X] Native API * [X] BowerPackages * [X] Configuration * [X] Connectors * [X] Dashboards * [X] DockerBlobs * [X] DockerImages * [X] EventOccurrences * [X] EventTypes * [X] Executions * [X] FeedAdapters * [X] FeedPackageFilters * [X] FeedRetentionRules * [X] Feeds * [X] IndexingServers * [X] LogMessages * [X] MavenArtifacts * [X] NpmConnectors * [X] NpmFeeds * [X] NpmPackages * [X] NuGetPackages * [X] NuGetPackagesV2 * [X] Packages * [X] ProGetPackages * [X] ScheduledTasks * [X] Security * [X] Users
lvermeulen/ProGet.Net
README.md
Markdown
mit
1,948
var inherits = require('inherits') var Stream = require('stream') function Leveler(fn) { Stream.call(this) this.readable = this.writable = true this.points = 0 this.reached = Object.create(null) this.level = 0 this.fn = fn || function(x) { return Math.floor(Math.floor(25 + Math.sqrt(625 + 100 * x)) / 50) } this.on('levelup', this.levelup.bind(this)) } inherits(Leveler, Stream) module.exports = function(opts) { return new Leveler(opts) }; module.exports.Leveler = Leveler Leveler.prototype.write = function(points) { this.points += parseFloat(points) var level = this.fn(this.points) if (level !== false) this.levelup(level) } Leveler.prototype.end = function(points) { this.write(points || 0) } Leveler.prototype.levelup = function(level) { if (this.reached[level]) return false this.reached[level] = this.points this.level = level this.emit('data', level) }
shama/leveler
index.js
JavaScript
mit
906
# encoding: UTF-8 # Author:: Akira FUNAI # Copyright:: Copyright (c) 2009 Akira FUNAI class Bike::Storage::Temp < Bike::Storage def self.available? true end def persistent? false end def val(id = nil) @val ||= {} id ? @val[id] : @val end def build(v) @val = v self end def clear @val = {} self end def store(id, v, ext = :unused) if new_id?(id, v) old_id = id id = new_id v return if val[id] # duplicate id move(old_id, id) unless old_id == :new_id end val[id] = v id end def delete(id) @val.delete id id end def move(old_id, new_id) rex = /\A#{old_id}/ val.keys.each {|id| if id =~ rex to_id = id.sub(rex, new_id) @val[to_id] = @val.delete id end } new_id end private def _select_by_id(conds) val.keys & Array(conds[:id]) end def _select_by_d(conds) rex_d = /^#{conds[:d]}/ val.keys.select {|id| id[rex_d] } end def _select_all(conds) val.keys end end
afunai/bike
lib/_storage/temp.rb
Ruby
mit
1,057
# -*- coding: utf-8 -*- # Generated by Django 1.9.9 on 2016-09-04 23:50 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('courses', '0013_auto_20160903_0212'), ] operations = [ migrations.RenameField( model_name='section', old_name='approachable_rating', new_name='cached_approachable_rating', ), migrations.RenameField( model_name='section', old_name='competency_rating', new_name='cached_competency_rating', ), migrations.RenameField( model_name='section', old_name='difficulty_rating', new_name='cached_difficulty_rating', ), migrations.RenameField( model_name='section', old_name='engagement_rating', new_name='cached_engagement_rating', ), migrations.RenameField( model_name='section', old_name='enthusiasm_rating', new_name='cached_enthusiasm_rating', ), migrations.RenameField( model_name='section', old_name='lecturing_rating', new_name='cached_lecturing_rating', ), migrations.RenameField( model_name='section', old_name='rating', new_name='cached_rating', ), migrations.RenameField( model_name='section', old_name='useful_rating', new_name='cached_useful_rating', ), ]
aspc/mainsite
aspc/courses/migrations/0014_auto_20160904_2350.py
Python
mit
1,605
/* * Copyright (c) 2003, 2013 Magnus Lind. * * This software is provided 'as-is', without any express or implied warranty. * In no event will the authors be held liable for any damages arising from * the use of this software. * * Permission is granted to anyone to use this software, alter it and re- * distribute it freely for any non-commercial, non-profit purpose subject to * the following restrictions: * * 1. The origin of this software must not be misrepresented; you must not * claim that you wrote the original software. If you use this software in a * product, an acknowledgment in the product documentation would be * appreciated but is not required. * * 2. Altered source versions must be plainly marked as such, and must not * be misrepresented as being the original software. * * 3. This notice may not be removed or altered from any distribution. * * 4. The names of this software and/or it's copyright holders may not be * used to endorse or promote products derived from this software without * specific prior written permission. * */ #include <string.h> #include <stdlib.h> #include "bprg.h" #include "vec.h" #include "log.h" /* data */ #define TOK_DATA '\x83' /* line numbers */ #define TOK_GOTO '\x89' #define TOK_RUN '\x8A' #define TOK_GOSUB '\x8D' #define TOK_REM '\x8F' #define TOK_LIST '\x9B' #define TOK_TO '\xA4' #define TOK_THEN '\xA7' #define TOK_GO '\xCB' #define TOKSTR_NUMBER "\x89\x8A\x8D\x8F\x9B\xA7\xCB" struct goto_fixup { unsigned char *where; int old_line; int from_line; }; struct goto_target { int old_line; int new_line; }; struct renumber_ctx { struct vec fixups[1]; struct vec targets[1]; struct vec_iterator i[1]; struct goto_fixup *fixup; int line; int step; int mode; }; static int goto_target_cb_cmp(const void *a, const void *b) { int val = 0; struct goto_target *a1 = (struct goto_target*)a; struct goto_target *b1 = (struct goto_target*)b; if (a1->old_line < b1->old_line) { val = -1; } else if (a1->old_line > b1->old_line) { val = 1; } return val; } static void goto_fixup_add(struct bprg_ctx *ctx, struct renumber_ctx *rctx, int line, char **p) { struct goto_fixup fixup[1]; struct goto_target target[1]; unsigned short number; char *n; char *n1; n = *p; do { /* eat spaces */ while(*n == ' ') ++n; n1 = n; if(*n == '\0') break; number = strtol(n, &n1, 10); if (n == n1) { if(n[-1] != TOK_THEN) { /* error, should not happen */ LOG(LOG_VERBOSE, ("can't convert $%02X at line %d \"%s\" to line number\n", *n, line, n)); } break; } /* register the goto into the fixup vec */ fixup->where = (unsigned char *)n; fixup->old_line = number; fixup->from_line = line; LOG(LOG_VERBOSE, ("adding fixup line %d\n", line)); vec_push(rctx->fixups, fixup); target->old_line = number; target->new_line = -1; vec_insert_uniq(rctx->targets, goto_target_cb_cmp, &target, NULL); /* always add a reverse mapping is not optimal * but an optimal approach would include graph traversal.. */ target->old_line = line; target->new_line = -1; vec_insert_uniq(rctx->targets, goto_target_cb_cmp, &target, NULL); n = n1; /* eat spaces */ while(*n == ' ') ++n; if(*n != ',') break; /* *n == ',' here */ ++n; } while (1); *p = n; } static void goto_scan(struct bprg_ctx *ctx, struct renumber_ctx *rctx) { struct bprg_iterator i[1]; struct brow *b; bprg_get_iterator(ctx, i); while(bprg_iterator_next(i, &b)) { const char *accept[3] = {TOKSTR_NUMBER "\"", "\"", ""}; int line; char *p; int quote = 0; LOG(LOG_DUMP, ("scanning line \"%s\"\n", b->row + 4)); p = (char*)b->row; line = (unsigned char)p[2] | ((unsigned char)p[3] << 8); /* skip link and number */ p += 4; while ((p = strpbrk(p, accept[quote])) != NULL) { char tok = *(p++); switch (tok) { case '\"': /* toggle quote mode */ quote ^= 1; break; case TOK_REM: /* skip this line, the rest is an rem statement */ LOG(LOG_DUMP, ("skipping rem\n")); quote = 2; break; case TOK_GO: while (*p == ' ') ++p; if(*p != TOK_TO) { LOG(LOG_WARNING, ("found GO without TO, skipping\n")); break; } ++p; goto_fixup_add(ctx, rctx, line, &p); break; case TOK_GOSUB: LOG(LOG_DUMP, ("found gosub on line %d\n", line)); default: /* we found a basic token that uses line numbers */ goto_fixup_add(ctx, rctx, line, &p); break; } } } } static int renumber1_cb_line_mutate(const unsigned char *in, /* IN */ unsigned char *mem, /* IN/OUT */ unsigned short *pos, /* IN/OUT */ void *priv) /* IN/OUT */ { struct renumber_ctx *rctx; struct goto_target target_key[1]; struct goto_target *target; int start; int i; int line; rctx = priv; /* prepare target key */ target_key->old_line = in[2] | (in[3] << 8); /* update targets vector with the new line number */ target = vec_find2(rctx->targets, goto_target_cb_cmp, target_key); line = 0; if(target != NULL || rctx->mode == 0) { line = rctx->line; } if(target != NULL) { target->new_line = line; } LOG(LOG_DUMP, ("renumbering line %d to %d (target %p)\n", target_key->old_line, line, (void*)target)); if(target != NULL || rctx->mode == 0) { /* update line number for next line */ rctx->line += rctx->step; } start = *pos; i = 0; /* copy link */ mem[start + i++] = *(in++); mem[start + i++] = *(in++); /* skip number */ i += 2; in += 2; /* copy line including terminating '\0' */ while((mem[start + i++] = *in++) != '\0'); *pos = start + i; /* the actual renumbering of this row */ mem[start + 2] = line; mem[start + 3] = line >> 8; return 0; } static int renumber2_cb_line_mutate(const unsigned char *in, /* IN */ unsigned char *mem, /* IN/OUT */ unsigned short *pos, /* IN/OUT */ void *priv) /* IN/OUT */ { struct renumber_ctx *rctx; int start; int i; unsigned char c; rctx = priv; start = *pos; i = 0; /* skip link */ i += 2; in += 2; /* copy number */ mem[start + i++] = *(in++); mem[start + i++] = *(in++); /* copy line including terminating '\0' */ do { if (rctx->fixup != NULL && rctx->fixup->where == in) { /* hoaa, fixup reference */ struct goto_target target_key[1]; struct goto_target *target; LOG(LOG_DUMP, ("found fixup goto %u at %p\n", rctx->fixup->old_line, in)); target_key->old_line = rctx->fixup->old_line; target = vec_find2(rctx->targets, goto_target_cb_cmp, target_key); if(target == NULL) { LOG(LOG_ERROR, ("found fixup has no target \n")); exit(1); } if(target->new_line == -1) { LOG(LOG_WARNING, ("warning at line %d: nonexisting line %d " "is renumbered to %d\n", rctx->fixup->from_line, target->old_line, target->new_line)); } /* write new line number */ i += sprintf((char*)mem + start + i, "%d", target->new_line); /* skip old in input */ strtol((char*)in, (void*)&in, 10); /* set where to next fixup */ rctx->fixup = vec_iterator_next(rctx->i); } /* copy byte normally */ c = *(in++); mem[start + i++] = c; } while(c != '\0'); /* set link properly */ mem[start] = start + i; mem[start + 1] = (start + i) >> 8; *pos = start + i; /* success */ return 0; } void bprg_renumber(struct bprg_ctx *ctx, int start, int step, int mode) { struct renumber_ctx rctx[1]; vec_init(rctx->fixups, sizeof(struct goto_fixup)); vec_init(rctx->targets, sizeof(struct goto_target)); goto_scan(ctx, rctx); rctx->line = start; rctx->step = step; rctx->mode = mode; /* just renumber the lines */ bprg_lines_mutate(ctx, renumber1_cb_line_mutate, rctx); vec_get_iterator(rctx->fixups, rctx->i); rctx->fixup = vec_iterator_next(rctx->i); /* now fixup line references */ bprg_lines_mutate(ctx, renumber2_cb_line_mutate, rctx); vec_free(rctx->targets, NULL); vec_free(rctx->targets, NULL); } static int rem_cb_line_mutate(const unsigned char *in, /* IN */ unsigned char *mem, /* IN/OUT */ unsigned short *pos, /* IN/OUT */ void *priv) /* IN/OUT */ { int start; int i; char c; int quote; int data; int line; struct renumber_ctx *rctx; rctx = priv; start = *pos; i = 0; /* skip link */ i += 2; in += 2; /* copy number */ line = *(in++); line |= (*(in++) << 8); mem[start + i++] = line; mem[start + i++] = (line >> 8); /* copy line including terminating '\0' */ quote = 0; data = 0; do { c = *(in++); switch(c) { case ' ': if(quote) break; /* in data statements we can only ignore unquoted spaces * if they come immediately after a comma or the DATA token*/ if(data && mem[start + i - 1] != ',' && (char)mem[start + i - 1] != TOK_DATA) { break; } /* skip this byte */ continue; break; case ':': if(quote) break; data = 0; break; case '\"': quote ^= 1; break; case TOK_DATA: data = 1; break; case TOK_REM: if(quote) break; if(i == 4) { /* rem at the beginning of a line */ struct goto_target target_key[1]; struct goto_target *target; target_key->old_line = line; target = vec_find2(rctx->targets, goto_target_cb_cmp, target_key); if(target == NULL) { /* skip this line entirely */ return 0; } /* line is a got target, we can't remove it but * we can remove the rem text */ mem[start + i++] = c; } else if(i > 4 && mem[start + i - 1] == ':') { --i; } c = '\0'; break; } mem[start + i++] = c; } while(c != '\0'); /* set link properly */ mem[start] = start + i; mem[start + 1] = (start + i) >> 8; *pos = start + i; /* success */ return 0; } void bprg_rem_remove(struct bprg_ctx *ctx) { struct renumber_ctx rctx[1]; vec_init(rctx->fixups, sizeof(struct goto_fixup)); vec_init(rctx->targets, sizeof(struct goto_target)); goto_scan(ctx, rctx); bprg_lines_mutate(ctx, rem_cb_line_mutate, rctx); vec_free(rctx->targets, NULL); vec_free(rctx->fixups, NULL); }
maxim-zhao/bmp2tilecompressors
compressors/exomizer/src/bprg_renumber.c
C
mit
12,424
--- layout: post title: "Django学习之进阶--model的多继承" categories: [Tech] excerpt: django中model多继承的方法 tags: - django --- ### 事情起因
single-thread/single-thread.github.io
_posts/django/2017-06-06-Django学习之进阶--model的多重继承.md
Markdown
mit
167
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>paco: Not compatible 👼</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[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]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.11.1 / paco - 3.0.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> paco <small> 3.0.0 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2021-10-19 05:32:36 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2021-10-19 05:32:36 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils coq 8.11.1 Formal proof management system num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic ocaml 4.07.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.07.1 Official release 4.07.1 ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.1 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; name: &quot;coq-paco&quot; version: &quot;3.0.0&quot; maintainer: &quot;paco@sf.snu.ac.kr&quot; synopsis: &quot;Coq library implementing parameterized coinduction&quot; homepage: &quot;https://github.com/snu-sf/paco/&quot; dev-repo: &quot;git+https://github.com/snu-sf/paco.git&quot; bug-reports: &quot;https://github.com/snu-sf/paco/issues/&quot; authors: [ &quot;Chung-Kil Hur &lt;gil.hur@sf.snu.ac.kr&gt;&quot; &quot;Georg Neis &lt;neis@mpi-sws.org&gt;&quot; &quot;Derek Dreyer &lt;dreyer@mpi-sws.org&gt;&quot; &quot;Viktor Vafeiadis &lt;viktor@mpi-sws.org&gt;&quot; &quot;Minki Cho &lt;minki.cho@sf.snu.ac.kr&gt;&quot; ] license: &quot;BSD-3&quot; build: [make &quot;-C&quot; &quot;src&quot; &quot;all&quot; &quot;-j%{jobs}%&quot;] install: [make &quot;-C&quot; &quot;src&quot; &quot;-f&quot; &quot;Makefile.coq&quot; &quot;install&quot;] remove: [&quot;rm&quot; &quot;-r&quot; &quot;-f&quot; &quot;%{lib}%/coq/user-contrib/Paco&quot;] depends: [ &quot;coq&quot; {&gt;= &quot;8.6&quot; &amp; &lt; &quot;8.10&quot;} ] tags: [ &quot;date:2019-03-25&quot; &quot;category:Computer Science/Programming Languages/Formal Definitions and Theory&quot; &quot;category:Mathematics/Logic&quot; &quot;keyword:co-induction&quot; &quot;keyword:simulation&quot; &quot;keyword:parameterized greatest fixed point&quot; ] url { http: &quot;https://github.com/snu-sf/paco/archive/v3.0.0.tar.gz&quot; checksum: &quot;3d67b9f416d61263e26f296e6fc4f564&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install 🏜️</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-paco.3.0.0 coq.8.11.1</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.11.1). The following dependencies couldn&#39;t be met: - coq-paco -&gt; coq &lt; 8.10 -&gt; ocaml &lt; 4.06.0 base of this switch (use `--unlock-base&#39; to force) Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-paco.3.0.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
coq-bench/coq-bench.github.io
clean/Linux-x86_64-4.07.1-2.0.6/released/8.11.1/paco/3.0.0.html
HTML
mit
7,125
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>ext-lib: Not compatible</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[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]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / extra-dev</a></li> <li class="active"><a href="">dev / ext-lib - 0.9.7</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> ext-lib <small> 0.9.7 <span class="label label-info">Not compatible</span> </small> </h1> <p><em><script>document.write(moment("2019-11-30 21:22:11 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2019-11-30 21:22:11 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils conf-m4 1 Virtual package relying on m4 coq dev Formal proof management system num 1.3 The legacy Num library for arbitrary-precision integer and rational arithmetic ocaml 4.09.0 The OCaml compiler (virtual package) ocaml-base-compiler 4.09.0 Official release 4.09.0 ocaml-config 1 OCaml Switch Configuration ocamlfind 1.8.1 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;gmalecha@gmail.com&quot; homepage: &quot;https://github.com/coq-community/coq-ext-lib&quot; dev-repo: &quot;git+https://github.com/coq-community/coq-ext-lib.git#8.5&quot; bug-reports: &quot;https://github.com/coq-community/coq-ext-lib/issues&quot; authors: [&quot;Gregory Malecha&quot;] license: &quot;BSD&quot; build: [ [make &quot;-j%{jobs}%&quot;] ] install: [ [make &quot;install&quot;] ] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.7&quot; &amp; &lt; &quot;8.9~&quot;} ] synopsis: &quot;A basic library of basic Coq datatypes, definitions, theorems, and&quot; description: &quot;tactics meant to extend the standard library.&quot; url { src: &quot;https://github.com/coq-community/coq-ext-lib/archive/v0.9.7.tar.gz&quot; checksum: &quot;md5=930e4b98ca7fec8a4ed977958d688f0c&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-ext-lib.0.9.7 coq.dev</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is dev). The following dependencies couldn&#39;t be met: - coq-ext-lib -&gt; coq &lt; 8.9~ -&gt; ocaml &lt; 4.06.0 base of this switch (use `--unlock-base&#39; to force) Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-ext-lib.0.9.7</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> <small>Sources are on <a href="https://github.com/coq-bench">GitHub</a>. © Guillaume Claret.</small> </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
coq-bench/coq-bench.github.io
clean/Linux-x86_64-4.09.0-2.0.5/extra-dev/dev/ext-lib/0.9.7.html
HTML
mit
6,542
from tornado.web import RequestHandler class BaseHandler(RequestHandler): def initialize(self): _settings = self.application.settings self.db = self.application.db #self.redis = _settings["redis"] self.log = _settings["log"]
code-shoily/tornado-cljs
handlers/base.py
Python
mit
264
from django.contrib import admin from django.db import models from pagedown.widgets import AdminPagedownWidget from .models import Faq, Category class FaqAdmin(admin.ModelAdmin): formfield_overrides = { models.TextField: {'widget': AdminPagedownWidget}, } fieldsets = [ ('Faq', {'fields': ['question', 'answer', 'category']}) ] list_display = ('question', 'created', 'modified') list_filter = ['created', 'modified'] search_fields = ['question', 'answer'] ordering = ['-created'] def save_model(self, request, obj, form, change): obj.author = request.user obj.save() class CategoryAdmin(admin.ModelAdmin): fieldsets = [ ('Category', {'fields': ['title']}) ] list_display = ('title', 'slug') search_fields = ['title'] admin.site.register(Faq, FaqAdmin) admin.site.register(Category, CategoryAdmin)
ildoc/homeboard
faqs/admin.py
Python
mit
900
=head1 NAME GeodSolve -- perform geodesic calculations =head1 SYNOPSIS B<GeodSolve> [ B<-i> | B<-l> I<lat1> I<lon1> I<azi1> ] [ B<-a> ] [ B<-e> I<a> I<f> ] B<-u> ] [ B<-d> | B<-:> ] [ B<-w> ] [ B<-b> ] [ B<-f> ] [ B<-p> I<prec> ] [ B<-E> ] [ B<--comment-delimiter> I<commentdelim> ] [ B<--version> | B<-h> | B<--help> ] [ B<--input-file> I<infile> | B<--input-string> I<instring> ] [ B<--line-separator> I<linesep> ] [ B<--output-file> I<outfile> ] =head1 DESCRIPTION The shortest path between two points on the ellipsoid at (I<lat1>, I<lon1>) and (I<lat2>, I<lon2>) is called the geodesic. Its length is I<s12> and the geodesic from point 1 to point 2 has forward azimuths I<azi1> and I<azi2> at the two end points. B<GeodSolve> operates in one of three modes: =over =item 1. By default, B<GeodSolve> accepts lines on the standard input containing I<lat1> I<lon1> I<azi1> I<s12> and prints I<lat2> I<lon2> I<azi2> on standard output. This is the direct geodesic calculation. =item 2. Command line arguments B<-l> I<lat1> I<lon1> I<azi1> specify a geodesic line. B<GeodSolve> then accepts a sequence of I<s12> values (one per line) on standard input and prints I<lat2> I<lon2> I<azi2> for each. This generates a sequence of points on a single geodesic. =item 3. With the B<-i> command line argument, B<GeodSolve> performs the inverse geodesic calculation. It reads lines containing I<lat1> I<lon1> I<lat2> I<lon2> and prints the corresponding values of I<azi1> I<azi2> I<s12>. =back =head1 OPTIONS =over =item B<-i> perform an inverse geodesic calculation (see 3 above). =item B<-l> line mode (see 2 above); generate a sequence of points along the geodesic specified by I<lat1> I<lon1> I<azi1>. The B<-w> flag can be used to swap the default order of the 2 geographic coordinates, provided that it appears before B<-l>. =item B<-a> arc mode; on input I<and> output I<s12> is replaced by I<a12> the arc length (in degrees) on the auxiliary sphere. See L</AUXILIARY SPHERE>. =item B<-e> specify the ellipsoid via I<a> I<f>; the equatorial radius is I<a> and the flattening is I<f>. Setting I<f> = 0 results in a sphere. Specify I<f> E<lt> 0 for a prolate ellipsoid. A simple fraction, e.g., 1/297, is allowed for I<f>. (Also, if I<f> E<gt> 1, the flattening is set to 1/I<f>.) By default, the WGS84 ellipsoid is used, I<a> = 6378137 m, I<f> = 1/298.257223563. =item B<-u> unroll the longitude. Normally, on output longitudes are reduced to lie in [-180deg,180deg). However with this option, the returned longitude I<lon2> is "unrolled" so that I<lon2> - I<lon1> indicates how often and in what sense the geodesic has encircled the earth. Use the B<-f> option, to get both longitudes printed. =item B<-d> output angles as degrees, minutes, seconds instead of decimal degrees. =item B<-:> like B<-d>, except use : as a separator instead of the d, ', and " delimiters. =item B<-w> on input and output, longitude precedes latitude (except that, on input, this can be overridden by a hemisphere designator, I<N>, I<S>, I<E>, I<W>). =item B<-b> report the I<back> azimuth at point 2 instead of the forward azimuth. =item B<-f> full output; each line of output consists of 12 quantities: I<lat1> I<lon1> I<azi1> I<lat2> I<lon2> I<azi2> I<s12> I<a12> I<m12> I<M12> I<M21> I<S12>. I<a12> is described in L</AUXILIARY SPHERE>. The four quantities I<m12>, I<M12>, I<M21>, and I<S12> are described in L</ADDITIONAL QUANTITIES>. =item B<-p> set the output precision to I<prec> (default 3); I<prec> is the precision relative to 1 m. See L</PRECISION>. =item B<-E> use "exact" algorithms (based on elliptic integrals) for the geodesic calculations. These are more accurate than the (default) series expansions for |I<f>| E<gt> 0.02. =item B<--comment-delimiter> set the comment delimiter to I<commentdelim> (e.g., "#" or "//"). If set, the input lines will be scanned for this delimiter and, if found, the delimiter and the rest of the line will be removed prior to processing and subsequently appended to the output line (separated by a space). =item B<--version> print version and exit. =item B<-h> print usage and exit. =item B<--help> print full documentation and exit. =item B<--input-file> read input from the file I<infile> instead of from standard input; a file name of "-" stands for standard input. =item B<--input-string> read input from the string I<instring> instead of from standard input. All occurrences of the line separator character (default is a semicolon) in I<instring> are converted to newlines before the reading begins. =item B<--line-separator> set the line separator character to I<linesep>. By default this is a semicolon. =item B<--output-file> write output to the file I<outfile> instead of to standard output; a file name of "-" stands for standard output. =back =head1 INPUT B<GeodSolve> measures all angles in degrees and all lengths (I<s12>) in meters, and all areas (I<S12>) in meters^2. On input angles (latitude, longitude, azimuth, arc length) can be as decimal degrees or degrees, minutes, seconds. For example, C<40d30>, C<40d30'>, C<40:30>, C<40.5d>, and C<40.5> are all equivalent. By default, latitude precedes longitude for each point (the B<-w> flag switches this convention); however on input either may be given first by appending (or prepending) I<N> or I<S> to the latitude and I<E> or I<W> to the longitude. Azimuths are measured clockwise from north; however this may be overridden with I<E> or I<W>. For details on the allowed formats for angles, see the C<GEOGRAPHIC COORDINATES> section of GeoConvert(1). =head1 AUXILIARY SPHERE Geodesics on the ellipsoid can be transferred to the I<auxiliary sphere> on which the distance is measured in terms of the arc length I<a12> (measured in degrees) instead of I<s12>. In terms of I<a12>, 180 degrees is the distance from one equator crossing to the next or from the minimum latitude to the maximum latitude. Geodesics with I<a12> E<gt> 180 degrees do not correspond to shortest paths. With the B<-a> flag, I<s12> (on both input and output) is replaced by I<a12>. The B<-a> flag does I<not> affect the full output given by the B<-f> flag (which always includes both I<s12> and I<a12>). =head1 ADDITIONAL QUANTITIES The B<-f> flag reports four additional quantities. The reduced length of the geodesic, I<m12>, is defined such that if the initial azimuth is perturbed by dI<azi1> (radians) then the second point is displaced by I<m12> dI<azi1> in the direction perpendicular to the geodesic. I<m12> is given in meters. On a curved surface the reduced length obeys a symmetry relation, I<m12> + I<m21> = 0. On a flat surface, we have I<m12> = I<s12>. I<M12> and I<M21> are geodesic scales. If two geodesics are parallel at point 1 and separated by a small distance I<dt>, then they are separated by a distance I<M12> I<dt> at point 2. I<M21> is defined similarly (with the geodesics being parallel to one another at point 2). I<M12> and I<M21> are dimensionless quantities. On a flat surface, we have I<M12> = I<M21> = 1. If points 1, 2, and 3 lie on a single geodesic, then the following addition rules hold: s13 = s12 + s23, a13 = a12 + a23, S13 = S12 + S23, m13 = m12 M23 + m23 M21, M13 = M12 M23 - (1 - M12 M21) m23 / m12, M31 = M32 M21 - (1 - M23 M32) m12 / m23. Finally, I<S12> is the area between the geodesic from point 1 to point 2 and the equator; i.e., it is the area, measured counter-clockwise, of the geodesic quadrilateral with corners (I<lat1>,I<lon1>), (0,I<lon1>), (0,I<lon2>), and (I<lat2>,I<lon2>). It is given in meters^2. =head1 PRECISION I<prec> gives precision of the output with I<prec> = 0 giving 1 m precision, I<prec> = 3 giving 1 mm precision, etc. I<prec> is the number of digits after the decimal point for lengths. For decimal degrees, the number of digits after the decimal point is I<prec> + 5. For DMS (degree, minute, seconds) output, the number of digits after the decimal point in the seconds component is I<prec> + 1. The minimum value of I<prec> is 0 and the maximum is 10. =head1 ERRORS An illegal line of input will print an error message to standard output beginning with C<ERROR:> and causes B<GeodSolve> to return an exit code of 1. However, an error does not cause B<GeodSolve> to terminate; following lines will be converted. =head1 ACCURACY Using the (default) series solution, GeodSolve is accurate to about 15 nm (15 nanometers) for the WGS84 ellipsoid. The approximate maximum error (expressed as a distance) for an ellipsoid with the same major radius as the WGS84 ellipsoid and different values of the flattening is |f| error 0.01 25 nm 0.02 30 nm 0.05 10 um 0.1 1.5 mm 0.2 300 mm If B<-E> is specified, GeodSolve is accurate to about 40 nm (40 nanometers) for the WGS84 ellipsoid. The approximate maximum error (expressed as a distance) for an ellipsoid with a quarter meridian of 10000 km and different values of the I<a/b> = 1 - I<f> is 1-f error (nm) 1/128 387 1/64 345 1/32 269 1/16 210 1/8 115 1/4 69 1/2 36 1 15 2 25 4 96 8 318 16 985 32 2352 64 6008 128 19024 =head1 MULTIPLE SOLUTIONS The shortest distance returned for the inverse problem is (obviously) uniquely defined. However, in a few special cases there are multiple azimuths which yield the same shortest distance. Here is a catalog of those cases: =over =item I<lat1> = -I<lat2> (with neither point at a pole) If I<azi1> = I<azi2>, the geodesic is unique. Otherwise there are two geodesics and the second one is obtained by setting [I<azi1>,I<azi2>] = [I<azi2>,I<azi1>], [I<M12>,I<M21>] = [I<M21>,I<M12>], I<S12> = -I<S12>. (This occurs when the longitude difference is near +/-180 for oblate ellipsoids.) =item I<lon2> = I<lon1> +/- 180 (with neither point at a pole) If I<azi1> = 0 or +/-180, the geodesic is unique. Otherwise there are two geodesics and the second one is obtained by setting [I<azi1>,I<azi2>] = [-I<azi1>,-I<azi2>], I<S12> = -I<S12>. (This occurs when I<lat2> is near -I<lat1> for prolate ellipsoids.) =item Points 1 and 2 at opposite poles There are infinitely many geodesics which can be generated by setting [I<azi1>,I<azi2>] = [I<azi1>,I<azi2>] + [I<d>,-I<d>], for arbitrary I<d>. (For spheres, this prescription applies when points 1 and 2 are antipodal.) =item I<s12> = 0 (coincident points) There are infinitely many geodesics which can be generated by setting [I<azi1>,I<azi2>] = [I<azi1>,I<azi2>] + [I<d>,I<d>], for arbitrary I<d>. =back =head1 EXAMPLES Route from JFK Airport to Singapore Changi Airport: echo 40:38:23N 073:46:44W 01:21:33N 103:59:22E | GeodSolve -i -: -p 0 003:18:29.9 177:29:09.2 15347628 Waypoints on the route at intervals of 2000km: for ((i = 0; i <= 16; i += 2)); do echo ${i}000000;done | GeodSolve -l 40:38:23N 073:46:44W 003:18:29.9 -: -p 0 40:38:23.0N 073:46:44.0W 003:18:29.9 58:34:45.1N 071:49:36.7W 004:48:48.8 76:22:28.4N 065:32:17.8W 010:41:38.4 84:50:28.0N 075:04:39.2E 150:55:00.9 67:26:20.3N 098:00:51.2E 173:27:20.3 49:33:03.2N 101:06:52.6E 176:07:54.3 31:34:16.5N 102:30:46.3E 177:03:08.4 13:31:56.0N 103:26:50.7E 177:24:55.0 04:32:05.7S 104:14:48.7E 177:28:43.6 =head1 SEE ALSO GeoConvert(1). An online version of this utility is availbable at L<http://geographiclib.sourceforge.net/cgi-bin/GeodSolve>. The algorithms are described in C. F. F. Karney, I<Algorithms for geodesics>, J. Geodesy 87, 43-55 (2013); DOI: L<https://dx.doi.org/10.1007/s00190-012-0578-z>; addenda: L<http://geographiclib.sf.net/geod-addenda.html>. The Wikipedia page, Geodesics on an ellipsoid, L<https://en.wikipedia.org/wiki/Geodesics_on_an_ellipsoid>. =head1 AUTHOR B<GeodSolve> was written by Charles Karney. =head1 HISTORY B<GeodSolve> was added to GeographicLib, L<http://geographiclib.sf.net>, in 2009-03. Prior to version 1.30, it was called B<Geod>. (The name was changed to avoid a conflict with the B<geod> utility in I<proj.4>.)
ObjSal/GeographicLib
man/GeodSolve.pod
Perl
mit
12,153
class Rubygem < ActiveRecord::Base include Pacecar has_many :owners, :through => :ownerships, :source => :user has_many :ownerships, :dependent => :destroy has_many :subscribers, :through => :subscriptions, :source => :user has_many :subscriptions has_many :versions, :dependent => :destroy do def latest self.find(:first) end end has_one :linkset, :dependent => :destroy validates_presence_of :name validates_uniqueness_of :name named_scope :with_versions, :conditions => ["versions_count > 0"] named_scope :with_one_version, :conditions => ["versions_count = 1"] named_scope :search, lambda { |query| { :conditions => ["upper(name) like upper(:query) or upper(versions.description) like upper(:query)", {:query => "%#{query}%"}], :include => [:versions], :order => "name asc" } } def validate if name =~ /^[\d]+$/ errors.add "Name must include at least one letter." elsif name =~ /[^\d\w_\-\.]/ errors.add "Name can only include letters, numbers, dashes, and underscores." end end def self.total_count with_versions.count end def self.latest(limit=5) with_one_version.by_created_at(:desc).limited(limit) end def self.downloaded(limit=5) with_versions.by_downloads(:desc).limited(limit) end def hosted? !versions.count.zero? end def rubyforge_project versions.find(:first, :conditions => "rubyforge_project is not null").try(:rubyforge_project) end def unowned? ownerships.find_by_approved(true).blank? end def owned_by?(user) ownerships.find_by_user_id(user.id).try(:approved) if user end def to_s versions.latest.try(:to_title) || name end def to_json {:name => name, :downloads => downloads, :version => versions.latest.number, :authors => versions.latest.authors, :info => versions.latest.info, :rubyforge_project => rubyforge_project}.to_json end def to_param name end def with_downloads "#{name} (#{downloads})" end def pushable? new_record? || versions_count.zero? end def build_ownership(user) ownerships.build(:user => user, :approved => true) if pushable? end def update_versions!(version, spec) version.update_attributes_from_gem_specification!(spec) end def update_dependencies!(version, spec) version.dependencies.delete_all spec.dependencies.each do |dependency| version.dependencies.create_from_gem_dependency!(dependency) end end def update_linkset!(spec) self.linkset ||= Linkset.new self.linkset.update_attributes_from_gem_specification!(spec) self.linkset.save! end def update_attributes_from_gem_specification!(version, spec) self.save! update_versions! version, spec update_dependencies! version, spec update_linkset! spec end def reorder_versions numbers = self.reload.versions.sort.reverse.map(&:number).uniq self.versions.each do |version| Version.without_callbacks(:reorder_versions) do version.update_attribute(:position, numbers.index(version.number)) end end end def find_or_initialize_version_from_spec(spec) version = self.versions.find_or_initialize_by_number_and_platform(spec.version.to_s, spec.original_platform.to_s) version.rubygem = self version end end
technoweenie/gemcutter
app/models/rubygem.rb
Ruby
mit
3,424
/* Move down content because we have a fixed navbar that is 50px tall */ body { padding-top: 50px; padding-bottom: 20px; } .base-page { margin-top: 20px; }
romaricdrigon/OrchestraBundle
Resources/public/css/base.css
CSS
mit
168
using PlayerIOClient; namespace CupCake.Messages.Receive { /// <summary> /// Occurs when the server sends information pertaining to low-level functions like (a) you were kicked or (b) the room /// is full or (c) rate limit exceeded. /// </summary> public class InfoReceiveEvent : ReceiveEvent { /// <summary> /// Initializes a new instance of the <see cref="InfoReceiveEvent" /> class. /// </summary> /// <param name="message">The message.</param> public InfoReceiveEvent(Message message) : base(message) { this.Title = message.GetString(0); this.Text = message.GetString(1); } /// <summary> /// Gets or sets the text. /// </summary> /// <value>The text.</value> public string Text { get; set; } /// <summary> /// Gets or sets the title. /// </summary> /// <value>The title.</value> public string Title { get; set; } } }
Yonom/CupCake
CupCake.Messages/Receive/InfoReceiveEvent.cs
C#
mit
1,043
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using AppStudio.Common; using AppStudio.Common.Actions; using AppStudio.Common.Commands; using AppStudio.Common.Navigation; using AppStudio.DataProviders; using AppStudio.DataProviders.Flickr; using AppStudio.DataProviders.Rss; using AppStudio.DataProviders.Menu; using AppStudio.DataProviders.Html; using AppStudio.DataProviders.LocalStorage; using DenominationCalculator.Sections; namespace DenominationCalculator.ViewModels { public class MainViewModel : ObservableBase { public MainViewModel(int visibleItems) { PageTitle = "Denomination Calculator"; MyFlickrAlbum = new ListViewModel<FlickrDataConfig, FlickrSchema>(new MyFlickrAlbumConfig(), visibleItems); MyBlog = new ListViewModel<RssDataConfig, RssSchema>(new MyBlogConfig(), visibleItems); MyFavoriteMusic = new ListViewModel<LocalStorageDataConfig, MenuSchema>(new MyFavoriteMusicConfig()); AboutMe = new ListViewModel<LocalStorageDataConfig, HtmlSchema>(new AboutMeConfig(), visibleItems); Actions = new List<ActionInfo>(); if (GetViewModels().Any(vm => !vm.HasLocalData)) { Actions.Add(new ActionInfo { Command = new RelayCommand(Refresh), Style = ActionKnownStyles.Refresh, Name = "RefreshButton", ActionType = ActionType.Primary }); } } public string PageTitle { get; set; } public ListViewModel<FlickrDataConfig, FlickrSchema> MyFlickrAlbum { get; private set; } public ListViewModel<RssDataConfig, RssSchema> MyBlog { get; private set; } public ListViewModel<LocalStorageDataConfig, MenuSchema> MyFavoriteMusic { get; private set; } public ListViewModel<LocalStorageDataConfig, HtmlSchema> AboutMe { get; private set; } public RelayCommand<INavigable> SectionHeaderClickCommand { get { return new RelayCommand<INavigable>(item => { NavigationService.NavigateTo(item); }); } } public DateTime? LastUpdated { get { return GetViewModels().Select(vm => vm.LastUpdated) .OrderByDescending(d => d).FirstOrDefault(); } } public List<ActionInfo> Actions { get; private set; } public bool HasActions { get { return Actions != null && Actions.Count > 0; } } public async Task LoadDataAsync() { var loadDataTasks = GetViewModels().Select(vm => vm.LoadDataAsync()); await Task.WhenAll(loadDataTasks); OnPropertyChanged("LastUpdated"); } private async void Refresh() { var refreshDataTasks = GetViewModels() .Where(vm => !vm.HasLocalData) .Select(vm => vm.LoadDataAsync(true)); await Task.WhenAll(refreshDataTasks); OnPropertyChanged("LastUpdated"); } private IEnumerable<DataViewModelBase> GetViewModels() { yield return MyFlickrAlbum; yield return MyBlog; yield return MyFavoriteMusic; yield return AboutMe; } } }
tiksn/Denomination-Calculator
Code/DenominationCalculator.W10/ViewModels/MainViewModel.cs
C#
mit
3,595
--- redirect_to: - http://tech.hbc.com/2015-01-20-video-why-engineers-should-work-with-the-dark.html layout:: post title: 'Video: "Why Engineers Should Work with the ‘Dark Side’ of Tech"' date: '2015-01-20T15:04:00-05:00' tags: - Gilt - Gilt Groupe - Gilt Tech - Gilttech - Talks - Tech Talks - NYC - Events - Meetups - Tech - Software Engineering - Justin Riservato - Susan Thomas - Myron Miller - Andrew Chen - Agile - Agile Development - Program management - PMO - Project Management - Product Management - Gilt Product - Slideshow - video tumblr_url: http://tech.gilt.com/post/108665617184/video-why-engineers-should-work-with-the-dark --- <p><iframe frameborder="0" height="360" src="//www.youtube.com/embed/7kRBapwdy9w" width="640"></iframe></p> <p>On Thursday, Gilt’s Director of Program Management Justin Riservato, Director of Product Andrew Chen, Senior Business Systems Manager Susan Thomas, and Senior Program Manager Myron Miller presented “Get Stuff Done Faster: Why Engineers Should Work with the &lsquo;Dark Side&rsquo; of Tech. They shared the differences between program managers, business analysts and product managers, and demonstrated how they make Gilt engineers’ work lives easier and more fulfilling. Watch the video above to relive the magic! Then check out their slidedeck below:</p> <p><iframe frameborder="0" height="470px" marginheight="0" marginwidth="0" scrolling="no" src="http://www.slideshare.net/LappleApple/slideshelf" width="615px"></iframe></p>
gilt/tech-blog
_posts/tumblr/2015-01-20-video-why-engineers-should-work-with-the-dark.html
HTML
mit
1,494
using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; namespace Enigmation { class Enigmation { static void Main(string[] args) { Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; string input = Console.ReadLine(); bool brackets = false; bool isNumber = false; string operation = "add"; string lastOperation = "add"; double bracketsResult = 0.0; double result = 0.0; double curNumber = 0.0; int i = 0; while (input[i] != '=') { switch (input[i]) { case '(': brackets = true; isNumber = false; lastOperation = operation; break; case ')': brackets = false; isNumber = false; switch (lastOperation) { case "add": result += bracketsResult; break; case "sub": result -= bracketsResult; break; case "multiply": result *= bracketsResult; break; case "module": result %= bracketsResult; break; } bracketsResult = 0; if (input[i + 1] == '=') { i++; continue; } break; case '+': operation = "add"; isNumber = false; break; case '-': operation = "sub"; isNumber = false; break; case '*': operation = "multiply"; isNumber = false; break; case '%': operation = "module"; isNumber = false; break; default: curNumber = double.Parse(input[i].ToString()); isNumber = true; break; } if (isNumber == false) { i++; continue; } if (brackets) { if (i > 0 && input[i - 1] == '(') { bracketsResult = curNumber; i++; continue; } switch (operation) { case "add": bracketsResult += curNumber; break; case "sub": bracketsResult -= curNumber; break; case "multiply": bracketsResult *= curNumber; break; case "module": bracketsResult %= curNumber; break; } } else { switch (operation) { case "add": result += curNumber; break; case "sub": result -= curNumber; break; case "multiply": result *= curNumber; break; case "module": result %= curNumber; break; } } i++; } Console.WriteLine("{0:F3}", result); } } }
ilian1902/BGcoder-C-1-exam
C#1 - 2013 2014/Telerik Academy Exam 1 @ 6 December 2013 Evening/03.Enigmanation/Enigmanation.cs
C#
mit
4,517
![pt-BR Pluralization Service - Logo][logo] # pt-BR Pluralization Service [![NuGet](https://img.shields.io/nuget/v/PluralizationServices.svg)](https://www.nuget.org/packages/PluralizationServices/) [![NuGet](https://img.shields.io/nuget/dt/PluralizationServices.svg)](https://www.nuget.org/packages/PluralizationServices/) [![License: MIT](http://img.shields.io/badge/license-MIT-blue.svg)](LICENSE.txt) pt-BR Pluralizer. ## Installing / Getting started ``` bash # Install package $ dotnet add package PluralizationServices ``` ## Developing ### Built With - [.NET Core](https://docs.microsoft.com/en-us/dotnet/core/) - [C#](https://docs.microsoft.com/en-us/dotnet/csharp/) ### Pre requisites Download and install: - [.NET Core SDK](https://www.microsoft.com/net/download) ### Setting up Dev ``` bash # Clone this repository $ git clone https://github.com/kibiluzbad/PtBrPluralizationService.git # Go into the repository $ cd PtBrPluralizationService # Install Cake $ dotnet tool install Cake.Tool --version 0.35.0 ``` ### Building ``` bash $ dotnet cake ``` or ``` bash $ dotnet build ``` ### Testing ``` bash $ dotnet cake ``` or ``` bash $ dotnet test ``` ## Licensing The code is available under the [MIT license](LICENSE.txt). [logo]: docs/logo.png "pt-BR Pluralization Service - Logo"
kibiluzbad/PtBrPluralizationService
README.md
Markdown
mit
1,320
{-# LANGUAGE GeneralizedNewtypeDeriving #-} module Simulation.Node.Service.Http ( HttpService , Service , Routes (..) , activate , as , toSnapRoutes , selfStore , basePrefix , module Snap.Core ) where import Control.Applicative (Applicative, Alternative, (<$>)) import Control.Monad (MonadPlus) import Control.Monad.Reader (ReaderT, MonadIO, runReaderT) import Control.Monad.Reader.Class (MonadReader, ask) import Control.Monad.CatchIO (MonadCatchIO) import qualified Data.ByteString.Char8 as BS import Snap.Core import Snap.Http.Server import System.FilePath ((</>)) -- | The HttpService monad. newtype HttpService a = HttpService { extractHttpService :: ReaderT HttpServiceApiParam Snap a } deriving ( Functor, Applicative, Alternative, Monad , MonadPlus, MonadReader HttpServiceApiParam , MonadIO, MonadCatchIO, MonadSnap ) -- | Record with api parameters for the execution of the HttpService monad. data HttpServiceApiParam = HttpServiceApiParam { selfStore_ :: !FilePath , basePrefix_ :: !String} deriving Show -- | A type describing a service's route mapping between an url and -- a handler for the request. newtype Routes a = Routes [ (BS.ByteString, HttpService a) ] -- | A type describing a prepared service, ready to install. newtype Service a = Service [ (BS.ByteString, HttpService a, String) ] -- | Activate the http services, at the given port, in the current -- thread. activate :: Int -> [Service ()] -> IO () activate port services = do let config = setPort port defaultConfig routes = toSnapRoutes services httpServe config $ route routes -- | Convert a set of routes and a prefix to a proper service. as :: Routes a -> BS.ByteString -> Service a as (Routes xs) prefix = let prefix' = prefix `BS.snoc` '/' in Service $ map (\(url, action) -> (prefix' `BS.append` url, action, BS.unpack prefix')) xs -- | Convert a list of installments to a list of proper snap -- routes. The HttpService monad will be evaluated down to the snap -- monad in this step. toSnapRoutes :: [Service a] -> [(BS.ByteString, Snap a)] toSnapRoutes = concatMap (\(Service xs') -> map toSnap xs') -- | Fetch own's self store position in the file system (relative to -- current working directory). E.g. if the service's name is foo the -- selfStore will return httpServices/foo/ as the directory where -- static data for the service can be stored. selfStore :: HttpService FilePath selfStore = selfStore_ <$> ask -- | Fetch own's base prefix url. This is to be used for any kind of -- linking to resources inside the own service to that the service -- name always become the prefix in the url. basePrefix :: HttpService String basePrefix = basePrefix_ <$> ask -- | Run an HttpService in the Snap monad. runHttpService :: HttpService a -> HttpServiceApiParam -> Snap a runHttpService action = runReaderT (extractHttpService action) toSnap :: (BS.ByteString, HttpService a, String) -> (BS.ByteString, Snap a) toSnap (url, action, prefix) = (url, runHttpService action makeParam) where makeParam :: HttpServiceApiParam makeParam = HttpServiceApiParam ("httpServices" </> prefix) ('/':prefix)
kosmoskatten/programmable-endpoint
src/Simulation/Node/Service/Http.hs
Haskell
mit
3,288
//================================================================================================= /*! // \file blaze/math/shims/Invert.h // \brief Header file for the invert shim // // Copyright (C) 2012-2020 Klaus Iglberger - All Rights Reserved // // This file is part of the Blaze library. You can redistribute it and/or modify it under // the terms of the New (Revised) BSD License. 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 names of the Blaze development group 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. */ //================================================================================================= #ifndef _BLAZE_MATH_SHIMS_INVERT_H_ #define _BLAZE_MATH_SHIMS_INVERT_H_ //************************************************************************************************* // Includes //************************************************************************************************* #include <blaze/math/shims/Pow2.h> #include <blaze/system/Inline.h> #include <blaze/util/Assert.h> #include <blaze/util/Complex.h> #include <blaze/util/EnableIf.h> #include <blaze/util/typetraits/IsIntegral.h> namespace blaze { //================================================================================================= // // INV SHIMS // //================================================================================================= //************************************************************************************************* /*!\brief Inverting the given integral value. // \ingroup math_shims // // \param a The integral value to be inverted. // \return The inverse of the given value. // // The \a inv shim represents an abstract interface for inverting a value/object of any given // data type. For integral values this results in \f$ \frac{1}{a} \f$. // // \note A division by zero is only checked by an user assert. */ template< typename T, EnableIf_t< IsIntegral_v<T> >* = nullptr > BLAZE_ALWAYS_INLINE constexpr double inv( T a ) noexcept { BLAZE_USER_ASSERT( a != T(0), "Division by zero detected" ); return ( 1.0 / a ); } //************************************************************************************************* //************************************************************************************************* /*!\brief Inverting the given single precision value. // \ingroup math_shims // // \param a The single precision value to be inverted. // \return The inverse of the given value. // // The \a inv shim represents an abstract interface for inverting a value/object of any given // data type. For single precision floating point values this results in \f$ \frac{1}{a} \f$. // // \note A division by zero is only checked by an user assert. */ BLAZE_ALWAYS_INLINE constexpr float inv( float a ) noexcept { BLAZE_USER_ASSERT( a != 0.0F, "Division by zero detected" ); return ( 1.0F / a ); } //************************************************************************************************* //************************************************************************************************* /*!\brief Inverting the given double precision value. // \ingroup math_shims // // \param a The double precision value to be inverted. // \return The inverse of the given value. // // The \a inv shim represents an abstract interface for inverting a value/object of any given // data type. For double precision floating point values this results in \f$ \frac{1}{a} \f$. // // \note A division by zero is only checked by an user assert. */ BLAZE_ALWAYS_INLINE constexpr double inv( double a ) noexcept { BLAZE_USER_ASSERT( a != 0.0, "Division by zero detected" ); return ( 1.0 / a ); } //************************************************************************************************* //************************************************************************************************* /*!\brief Inverting the given extended precision value. // \ingroup math_shims // // \param a The extended precision value to be inverted. // \return The inverse of the given value. // // The \a inv shim represents an abstract interface for inverting a value/object of any given // data type. For extended precision floating point values this results in \f$ \frac{1}{a} \f$. // // \note A division by zero is only checked by an user assert. */ BLAZE_ALWAYS_INLINE constexpr long double inv( long double a ) noexcept { BLAZE_USER_ASSERT( a != 0.0L, "Division by zero detected" ); return ( 1.0L / a ); } //************************************************************************************************* //************************************************************************************************* /*!\brief Inverting the given single precision complex number. // \ingroup math_shims // // \param a The single precision complex number to be inverted. // \return The inverse of the given value. // // The \a inv shim represents an abstract interface for inverting a value/object of any given // data type. For a single precision floating point complex number \f$ z = x + yi \f$ this // results in \f$ \frac{\overline{z}}{x^2+y^2} \f$. // // \note A division by zero is only checked by an user assert. */ BLAZE_ALWAYS_INLINE constexpr complex<float> inv( const complex<float>& a ) noexcept { const float abs( pow2( real(a) ) + pow2( imag(a) ) ); BLAZE_USER_ASSERT( abs != 0.0F, "Division by zero detected" ); const float iabs( 1.0F / abs ); return complex<float>( iabs*real(a), -iabs*imag(a) ); } //************************************************************************************************* //************************************************************************************************* /*!\brief Inverting the given double precision complex number. // \ingroup math_shims // // \param a The double precision complex number to be inverted. // \return The inverse of the given value. // // The \a inv shim represents an abstract interface for inverting a value/object of any given // data type. For a double precision floating point complex number \f$ z = x + yi \f$ this // results in \f$ \frac{\overline{z}}{x^2+y^2} \f$. // // \note A division by zero is only checked by an user assert. */ BLAZE_ALWAYS_INLINE constexpr complex<double> inv( const complex<double>& a ) noexcept { const double abs( pow2( real(a) ) + pow2( imag(a) ) ); BLAZE_USER_ASSERT( abs != 0.0, "Division by zero detected" ); const double iabs( 1.0 / abs ); return complex<double>( iabs*real(a), -iabs*imag(a) ); } //************************************************************************************************* //************************************************************************************************* /*!\brief Inverting the given extended precision complex number. // \ingroup math_shims // // \param a The extended precision complex number to be inverted. // \return The inverse of the given value. // // The \a inv shim represents an abstract interface for inverting a value/object of any given // data type. For an extended precision floating point complex number \f$ z = x + yi \f$ this // results in \f$ \frac{\overline{z}}{x^2+y^2} \f$. // // \note A division by zero is only checked by an user assert. */ BLAZE_ALWAYS_INLINE constexpr complex<long double> inv( const complex<long double>& a ) noexcept { const long double abs( pow2( real(a) ) + pow2( imag(a) ) ); BLAZE_USER_ASSERT( abs != 0.0L, "Division by zero detected" ); const long double iabs( 1.0L / abs ); return complex<long double>( iabs*real(a), -iabs*imag(a) ); } //************************************************************************************************* //================================================================================================= // // INVERT SHIMS // //================================================================================================= //************************************************************************************************* /*!\brief In-place inversion of the given single precision value. // \ingroup math_shims // // \param a The single precision value to be inverted. // \return The inverse of the given value. // // The \a invert shim represents an abstract interface for inverting a value/object of any // given data type in-place. For single precision floating point values this results in // \f$ \frac{1}{a} \f$. // // \note A division by zero is only checked by an user assert. */ BLAZE_ALWAYS_INLINE void invert( float& a ) noexcept { a = inv( a ); } //************************************************************************************************* //************************************************************************************************* /*!\brief In-place inversion of the given double precision value. // \ingroup math_shims // // \param a The double precision value to be inverted. // \return The inverse of the given value. // // The \a invert shim represents an abstract interface for inverting a value/object of any // given data type in-place. For double precision floating point values this results in // \f$ \frac{1}{a} \f$. // // \note A division by zero is only checked by an user assert. */ BLAZE_ALWAYS_INLINE void invert( double& a ) noexcept { a = inv( a ); } //************************************************************************************************* //************************************************************************************************* /*!\brief In-place inversion of the given extended precision value. // \ingroup math_shims // // \param a The extended precision value to be inverted. // \return The inverse of the given value. // // The \a invert shim represents an abstract interface for inverting a value/object of any // given data type in-place. For extended precision floating point values this results in // \f$ \frac{1}{a} \f$. // // \note A division by zero is only checked by an user assert. */ BLAZE_ALWAYS_INLINE void invert( long double& a ) noexcept { a = inv( a ); } //************************************************************************************************* //************************************************************************************************* /*!\brief In-place inversion of the given single precision complex number. // \ingroup math_shims // // \param a The single precision complex number to be inverted. // \return The inverse of the given value. // // The \a invert shim represents an abstract interface for inverting a value/object of any given // data type in-place. For a single precision floating point complex number \f$ z = x + yi \f$ // this results in \f$ \frac{\overline{z}}{x^2+y^2} \f$. // // \note A division by zero is only checked by an user assert. */ BLAZE_ALWAYS_INLINE void invert( complex<float>& a ) noexcept { a = inv( a ); } //************************************************************************************************* //************************************************************************************************* /*!\brief In-place inversion of the given double precision complex number. // \ingroup math_shims // // \param a The double precision complex number to be inverted. // \return The inverse of the given value. // // The \a invert shim represents an abstract interface for inverting a value/object of any given // data type in-place. For a double precision floating point complex number \f$ z = x + yi \f$ // this results in \f$ \frac{\overline{z}}{x^2+y^2} \f$. // // \note A division by zero is only checked by an user assert. */ BLAZE_ALWAYS_INLINE void invert( complex<double>& a ) noexcept { a = inv( a ); } //************************************************************************************************* //************************************************************************************************* /*!\brief In-place inversion of the given extended precision complex number. // \ingroup math_shims // // \param a The extended precision complex number to be inverted. // \return The inverse of the given value. // // The \a invert shim represents an abstract interface for inverting a value/object of any given // data type in-place. For an extended precision floating point complex number \f$ z = x + yi \f$ // this results in \f$ \frac{\overline{z}}{x^2+y^2} \f$. // // \note A division by zero is only checked by an user assert. */ BLAZE_ALWAYS_INLINE void invert( complex<long double>& a ) noexcept { a = inv( a ); } //************************************************************************************************* } // namespace blaze #endif
camillescott/boink
include/goetia/sketches/sketch/vec/blaze/blaze/math/shims/Invert.h
C
mit
14,000
@font-face { font-family: "Top Secret"; src: url("/font/Top_Secret.ttf"); } body { background: #f9e5e5; color: #FFD700; font-family: "Top Secret"; text-align: center; font-size: 10px; } .board { background: #bbbda0; margin: 0 auto; padding: 8px; width: 472px; height: 472px; } h1 { font-family :Verdana; font-size: 90px; color: #3f4f5b; } p { font-family: Verdana; font-size: 40px; color: #3f4f5b; } .cell { width: 100px; float: left; border: 1px solid black; border-radius: 10px; height: 100px; margin: 7px; font-size: 2em; } .cell div { margin-top: 28px; background-color: black; border-radius: 10px; } .val-2000 { background-image: url(https://fbcdn-sphotos-b-a.akamaihd.net/hphotos-ak-xfa1/v/t1.0-9/316598_10152325207030526_1229182166_n.jpg?oh=2ba13b76f54094a7296c6d8843c68b5c&oe=54ACE234&__gda__=1422311483_0dd1e012451994a5aee2758d281bbe57); background-size: 100%; } .cell.val-2000 div { margin-top: 0px; } .val-4000 { background-image: url(https://scontent-b.xx.fbcdn.net/hphotos-xap1/v/t1.0-9/154456_10152574592430450_3459627286972976748_n.jpg?oh=f745f12b75389cfc06bbf1c565f841ff&oe=54B96457); background-size: 100%; } .cell.val-4000 div { margin-top: 72px; } .val-8000 { background-image: url(https://fbcdn-sphotos-c-a.akamaihd.net/hphotos-ak-xaf1/v/t1.0-9/527412_10150753616880450_353606984_n.jpg?oh=d18422d68944e3520f58c2360c832f16&oe=54C9D2C4&__gda__=1422084887_376ab23c7035432daab09d72af0c7a7d); background-repeat:no-repeat; background-size: 130%; } .cell.val-8000 div { margin-top: 72px; border-top-right-radius: 0px; border-top-left-radius: 0px; } .val-16000 { background-image: url(https://scontent-a.xx.fbcdn.net/hphotos-xpa1/v/t1.0-9/10292137_10152243136655829_2495828220804489430_n.jpg?oh=44a9aad91fde80180ce177e8b5726422&oe=54CB2C1E); background-size: 105%; } .cell.val-16000 div { margin-top: 0px; } .val-32000 { background-image: url(https://fbcdn-sphotos-h-a.akamaihd.net/hphotos-ak-xpa1/v/t1.0-9/1069156_10153080266165473_31627183_n.jpg?oh=33bb903190f4204b80ac52fb7d989bff&oe=54B954D8&__gda__=1421658940_c6e3937afccf71e60c07410f841a72da); background-size: 100%; } .cell.val-32000 div { margin-top: 72px; } .val-64000 { background-image: url(https://fbcdn-sphotos-b-a.akamaihd.net/hphotos-ak-frc3/v/t1.0-9/941929_10152835394960473_1297637321_n.jpg?oh=9b128f1ad50930fd89f55f594612c89d&oe=54AFCF37&__gda__=1421444218_04101eb327f91aba30d4e939d0d0b275); background-repeat:no-repeat; background-size: 100%; } .cell.val-64000 div { margin-top: 72px; } .val-128000 { background-image: url(https://fbcdn-sphotos-f-a.akamaihd.net/hphotos-ak-xaf1/v/t1.0-9/10401074_86543025374_6510_n.jpg?oh=95dbdf0321a58ed70ed90553670dc87c&oe=54C43EC2&__gda__=1422333578_78092755a4f3c03d023f2ba2e7a0a548); background-size: 100%; } .cell.val-128000 div { margin-top: 72px; } .val-256000 { background-image: url(https://fbcdn-sphotos-d-a.akamaihd.net/hphotos-ak-xpa1/v/t1.0-9/10580166_10152568661785733_2008724494209770456_n.jpg?oh=b9ddd0d1fb16ba111ae0791ec2cdc1e3&oe=54C38995&__gda__=1422469507_faba478e25421302f1b41d726578d79c); background-size: 100%; } .cell.val-256000 div { margin-top: 0px; } .val-512000 { background-image: url(https://fbcdn-sphotos-g-a.akamaihd.net/hphotos-ak-xpf1/v/t1.0-9/10344775_10152427582665491_7095589419506048709_n.jpg?oh=9310332d09b7d0eb828d658f5920a457&oe=54B83C03&__gda__=1421470844_4ce6f176e24ce0c0b1e639379b5d7595); background-repeat:no-repeat; background-size: 120%; } .cell.val-512000 div { margin-top: 72px; } .val-1024000 { background-image: url(https://fbcdn-sphotos-a-a.akamaihd.net/hphotos-ak-xaf1/v/t1.0-9/543000_10150769827440871_896134399_n.jpg?oh=f4c092a5c32d9a43751d7caa16a02f4f&oe=54BDE7E7&__gda__=1422346804_4c0b2f146e7015fdbf0f4a4d124ea692); background-repeat:no-repeat; background-size: 100%; } .cell.val-1024000 div { margin-top: 72px; border-top-right-radius: 0px; border-top-left-radius: 0px; } .val-2048000 { background-image: url(http://www.x-pm.com/share/associe/img_big/2.jpg); background-size: 100%; } .cell.val-2048000 div { margin-top: 72px; }
sgomezdekset/8402
css/main.css
CSS
mit
4,164
#include "guiutil.h" #include "bitcoinaddressvalidator.h" #include "walletmodel.h" #include "bitcoinunits.h" #include "util.h" #include "init.h" #include "base58.h" #include <QString> #include <QDateTime> #include <QDoubleValidator> #include <QFont> #include <QLineEdit> #include <QUrl> #include <QTextDocument> // For Qt::escape #include <QAbstractItemView> #include <QApplication> #include <QClipboard> #include <QFileDialog> #include <QDesktopServices> #include <QThread> #include <boost/filesystem.hpp> #include <boost/filesystem/fstream.hpp> #ifdef WIN32 #ifdef _WIN32_WINNT #undef _WIN32_WINNT #endif #define _WIN32_WINNT 0x0501 #ifdef _WIN32_IE #undef _WIN32_IE #endif #define _WIN32_IE 0x0501 #define WIN32_LEAN_AND_MEAN 1 #ifndef NOMINMAX #define NOMINMAX #endif #include "shlwapi.h" #include "shlobj.h" #include "shellapi.h" #endif namespace GUIUtil { QString dateTimeStr(const QDateTime &date) { return date.date().toString(Qt::SystemLocaleShortDate) + QString(" ") + date.toString("hh:mm"); } QString dateTimeStr(qint64 nTime) { return dateTimeStr(QDateTime::fromTime_t((qint32)nTime)); } QFont bitcoinAddressFont() { QFont font("Monospace"); font.setStyleHint(QFont::TypeWriter); return font; } void setupAddressWidget(QLineEdit *widget, QWidget *parent) { widget->setMaxLength(BitcoinAddressValidator::MaxAddressLength); widget->setValidator(new BitcoinAddressValidator(parent)); widget->setFont(bitcoinAddressFont()); } void setupAmountWidget(QLineEdit *widget, QWidget *parent) { QDoubleValidator *amountValidator = new QDoubleValidator(parent); amountValidator->setDecimals(8); amountValidator->setBottom(0.0); widget->setValidator(amountValidator); widget->setAlignment(Qt::AlignRight|Qt::AlignVCenter); } bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out) { if(uri.scheme() != QString("Tigercoin")) return false; // check if the address is valid CBitcoinAddress addressFromUri(uri.path().toStdString()); if (!addressFromUri.IsValid()) return false; SendCoinsRecipient rv; rv.address = uri.path(); rv.amount = 0; QList<QPair<QString, QString> > items = uri.queryItems(); for (QList<QPair<QString, QString> >::iterator i = items.begin(); i != items.end(); i++) { bool fShouldReturnFalse = false; if (i->first.startsWith("req-")) { i->first.remove(0, 4); fShouldReturnFalse = true; } if (i->first == "label") { rv.label = i->second; fShouldReturnFalse = false; } else if (i->first == "amount") { if(!i->second.isEmpty()) { if(!BitcoinUnits::parse(BitcoinUnits::BTC, i->second, &rv.amount)) { return false; } } fShouldReturnFalse = false; } if (fShouldReturnFalse) return false; } if(out) { *out = rv; } return true; } bool parseBitcoinURI(QString uri, SendCoinsRecipient *out) { // Convert Tigercoin:// to Tigercoin: // // Cannot handle this later, TGCause Tigercoin:// will cause Qt to see the part after // as host, // which will lowercase it (and thus invalidate the address). if(uri.startsWith("Tigercoin://")) { uri.replace(0, 11, "Tigercoin:"); } QUrl uriInstance(uri); return parseBitcoinURI(uriInstance, out); } QString HtmlEscape(const QString& str, bool fMultiLine) { QString escaped = Qt::escape(str); if(fMultiLine) { escaped = escaped.replace("\n", "<br>\n"); } return escaped; } QString HtmlEscape(const std::string& str, bool fMultiLine) { return HtmlEscape(QString::fromStdString(str), fMultiLine); } void copyEntryData(QAbstractItemView *view, int column, int role) { if(!view || !view->selectionModel()) return; QModelIndexList selection = view->selectionModel()->selectedRows(column); if(!selection.isEmpty()) { // Copy first item QApplication::clipboard()->setText(selection.at(0).data(role).toString()); } } QString getSaveFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedSuffixOut) { QString selectedFilter; QString myDir; if(dir.isEmpty()) // Default to user documents location { myDir = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation); } else { myDir = dir; } QString result = QFileDialog::getSaveFileName(parent, caption, myDir, filter, &selectedFilter); /* Extract first suffix from filter pattern "Description (*.TGC)" or "Description (*.TGC *.bar ...) */ QRegExp filter_re(".* \\(\\*\\.(.*)[ \\)]"); QString selectedSuffix; if(filter_re.exactMatch(selectedFilter)) { selectedSuffix = filter_re.cap(1); } /* Add suffix if needed */ QFileInfo info(result); if(!result.isEmpty()) { if(info.suffix().isEmpty() && !selectedSuffix.isEmpty()) { /* No suffix specified, add selected suffix */ if(!result.endsWith(".")) result.append("."); result.append(selectedSuffix); } } /* Return selected suffix if asked to */ if(selectedSuffixOut) { *selectedSuffixOut = selectedSuffix; } return result; } Qt::ConnectionType blockingGUIThreadConnection() { if(QThread::currentThread() != QCoreApplication::instance()->thread()) { return Qt::BlockingQueuedConnection; } else { return Qt::DirectConnection; } } bool checkPoint(const QPoint &p, const QWidget *w) { QWidget *atW = qApp->widgetAt(w->mapToGlobal(p)); if (!atW) return false; return atW->topLevelWidget() == w; } bool isObscured(QWidget *w) { return !(checkPoint(QPoint(0, 0), w) && checkPoint(QPoint(w->width() - 1, 0), w) && checkPoint(QPoint(0, w->height() - 1), w) && checkPoint(QPoint(w->width() - 1, w->height() - 1), w) && checkPoint(QPoint(w->width() / 2, w->height() / 2), w)); } void openDebugLogfile() { boost::filesystem::path pathDebug = GetDataDir() / "debug.log"; /* Open debug.log with the associated application */ if (boost::filesystem::exists(pathDebug)) QDesktopServices::openUrl(QUrl::fromLocalFile(QString::fromStdString(pathDebug.string()))); } ToolTipToRichTextFilter::ToolTipToRichTextFilter(int size_threshold, QObject *parent) : QObject(parent), size_threshold(size_threshold) { } bool ToolTipToRichTextFilter::eventFilter(QObject *obj, QEvent *evt) { if(evt->type() == QEvent::ToolTipChange) { QWidget *widget = static_cast<QWidget*>(obj); QString tooltip = widget->toolTip(); if(tooltip.size() > size_threshold && !tooltip.startsWith("<qt/>") && !Qt::mightBeRichText(tooltip)) { // Prefix <qt/> to make sure Qt detects this as rich text // Escape the current message as HTML and replace \n by <br> tooltip = "<qt/>" + HtmlEscape(tooltip, true); widget->setToolTip(tooltip); return true; } } return QObject::eventFilter(obj, evt); } #ifdef WIN32 boost::filesystem::path static StartupShortcutPath() { return GetSpecialFolderPath(CSIDL_STARTUP) / "Tigercoin.lnk"; } bool GetStartOnSystemStartup() { // check for Tigercoin.lnk return boost::filesystem::exists(StartupShortcutPath()); } bool SetStartOnSystemStartup(bool fAutoStart) { // If the shortcut exists already, remove it for updating boost::filesystem::remove(StartupShortcutPath()); if (fAutoStart) { CoInitialize(NULL); // Get a pointer to the IShellLink interface. IShellLink* psl = NULL; HRESULT hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, reinterpret_cast<void**>(&psl)); if (SUCCEEDED(hres)) { // Get the current executable path TCHAR pszExePath[MAX_PATH]; GetModuleFileName(NULL, pszExePath, sizeof(pszExePath)); TCHAR pszArgs[5] = TEXT("-min"); // Set the path to the shortcut target psl->SetPath(pszExePath); PathRemoveFileSpec(pszExePath); psl->SetWorkingDirectory(pszExePath); psl->SetShowCmd(SW_SHOWMINNOACTIVE); psl->SetArguments(pszArgs); // Query IShellLink for the IPersistFile interface for // saving the shortcut in persistent storage. IPersistFile* ppf = NULL; hres = psl->QueryInterface(IID_IPersistFile, reinterpret_cast<void**>(&ppf)); if (SUCCEEDED(hres)) { WCHAR pwsz[MAX_PATH]; // Ensure that the string is ANSI. MultiByteToWideChar(CP_ACP, 0, StartupShortcutPath().string().c_str(), -1, pwsz, MAX_PATH); // Save the link by calling IPersistFile::Save. hres = ppf->Save(pwsz, TRUE); ppf->Release(); psl->Release(); CoUninitialize(); return true; } psl->Release(); } CoUninitialize(); return false; } return true; } #elif defined(LINUX) // Follow the Desktop Application Autostart Spec: // http://standards.freedesktop.org/autostart-spec/autostart-spec-latest.html boost::filesystem::path static GetAutostartDir() { namespace fs = boost::filesystem; char* pszConfigHome = getenv("XDG_CONFIG_HOME"); if (pszConfigHome) return fs::path(pszConfigHome) / "autostart"; char* pszHome = getenv("HOME"); if (pszHome) return fs::path(pszHome) / ".config" / "autostart"; return fs::path(); } boost::filesystem::path static GetAutostartFilePath() { return GetAutostartDir() / "Tigercoin.desktop"; } bool GetStartOnSystemStartup() { boost::filesystem::ifstream optionFile(GetAutostartFilePath()); if (!optionFile.good()) return false; // Scan through file for "Hidden=true": std::string line; while (!optionFile.eof()) { getline(optionFile, line); if (line.find("Hidden") != std::string::npos && line.find("true") != std::string::npos) return false; } optionFile.close(); return true; } bool SetStartOnSystemStartup(bool fAutoStart) { if (!fAutoStart) boost::filesystem::remove(GetAutostartFilePath()); else { char pszExePath[MAX_PATH+1]; memset(pszExePath, 0, sizeof(pszExePath)); if (readlink("/proc/self/exe", pszExePath, sizeof(pszExePath)-1) == -1) return false; boost::filesystem::create_directories(GetAutostartDir()); boost::filesystem::ofstream optionFile(GetAutostartFilePath(), std::ios_base::out|std::ios_base::trunc); if (!optionFile.good()) return false; // Write a Tigercoin.desktop file to the autostart directory: optionFile << "[Desktop Entry]\n"; optionFile << "Type=Application\n"; optionFile << "Name=Tigercoin\n"; optionFile << "Exec=" << pszExePath << " -min\n"; optionFile << "Terminal=false\n"; optionFile << "Hidden=false\n"; optionFile.close(); } return true; } #else // TODO: OSX startup stuff; see: // https://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPSystemStartup/Articles/CustomLogin.html bool GetStartOnSystemStartup() { return false; } bool SetStartOnSystemStartup(bool fAutoStart) { return false; } #endif HelpMessageBox::HelpMessageBox(QWidget *parent) : QMessageBox(parent) { header = tr("Tigercoin-qt") + " " + tr("version") + " " + QString::fromStdString(FormatFullVersion()) + "\n\n" + tr("Usage:") + "\n" + " Tigercoin-qt [" + tr("command-line options") + "] " + "\n"; coreOptions = QString::fromStdString(HelpMessage()); uiOptions = tr("UI options") + ":\n" + " -lang=<lang> " + tr("Set language, for example \"de_DE\" (default: system locale)") + "\n" + " -min " + tr("Start minimized") + "\n" + " -splash " + tr("Show splash screen on startup (default: 1)") + "\n"; setWindowTitle(tr("Tigercoin-qt")); setTextFormat(Qt::PlainText); // setMinimumWidth is ignored for QMessageBox so put in nonbreaking spaces to make it wider. setText(header + QString(QChar(0x2003)).repeated(50)); setDetailedText(coreOptions + "\n" + uiOptions); } void HelpMessageBox::printToConsole() { // On other operating systems, the expected action is to print the message to the console. QString strUsage = header + "\n" + coreOptions + "\n" + uiOptions; fprintf(stderr, "%s", strUsage.toStdString().c_str()); } void HelpMessageBox::showOrPrint() { #if defined(WIN32) // On windows, show a message box, as there is no stderr/stdout in windowed applications exec(); #else // On other operating systems, print help text to console printToConsole(); #endif } } // namespace GUIUtil
tgcion/code-Tigercon
src/qt/guiutil.cpp
C++
mit
13,505
package hu.bme.mit.inf.gs.dsl.validators.collectiontypesinthearchitecture; import java.util.Arrays; import org.eclipse.viatra2.emf.incquery.runtime.api.IPatternMatch; import org.eclipse.viatra2.emf.incquery.runtime.api.impl.BasePatternMatch; import org.eclipse.viatra2.patternlanguage.core.patternLanguage.Pattern; /** * Pattern-specific match representation of the CollectionTypesInTheArchitecture pattern, * to be used in conjunction with CollectionTypesInTheArchitectureMatcher. * * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. * Each instance is a (possibly partial) substitution of pattern parameters, * usable to represent a match of the pattern in the result of a query, * or to specify the bound (fixed) input parameters when issuing a query. * * @see CollectionTypesInTheArchitectureMatcher * @see CollectionTypesInTheArchitectureProcessor * */ public final class CollectionTypesInTheArchitectureMatch extends BasePatternMatch implements IPatternMatch { private Object fT; private static String[] parameterNames = {"T"}; public CollectionTypesInTheArchitectureMatch(final Object pT) { this.fT = pT; } @Override public Object get(final String parameterName) { if ("T".equals(parameterName)) return this.fT; return null; } public Object getT() { return this.fT; } @Override public boolean set(final String parameterName, final Object newValue) { if ("T".equals(parameterName) && newValue instanceof java.lang.Object) { this.fT = (java.lang.Object) newValue; return true; } return false; } public void setT(final Object pT) { this.fT = pT; } @Override public String patternName() { return "CollectionTypesInTheArchitecture"; } @Override public String[] parameterNames() { return CollectionTypesInTheArchitectureMatch.parameterNames; } @Override public Object[] toArray() { return new Object[]{fT}; } @Override public String prettyPrint() { StringBuilder result = new StringBuilder(); result.append("\"T\"=" + prettyPrintValue(fT) + "\n"); return result.toString(); } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((fT == null) ? 0 : fT.hashCode()); return result; } @Override public boolean equals(final Object obj) { if (this == obj) return true; if (obj == null) return false; if (!(obj instanceof IPatternMatch)) return false; IPatternMatch otherSig = (IPatternMatch) obj; if (!pattern().equals(otherSig.pattern())) return false; if (!CollectionTypesInTheArchitectureMatch.class.equals(obj.getClass())) return Arrays.deepEquals(toArray(), otherSig.toArray()); CollectionTypesInTheArchitectureMatch other = (CollectionTypesInTheArchitectureMatch) obj; if (fT == null) {if (other.fT != null) return false;} else if (!fT.equals(other.fT)) return false; return true; } @Override public Pattern pattern() { return CollectionTypesInTheArchitectureMatcher.FACTORY.getPattern(); } }
darvasd/gsoaarchitect
hu.bme.mit.inf.gs.dsl.validators/src-gen/hu/bme/mit/inf/gs/dsl/validators/collectiontypesinthearchitecture/CollectionTypesInTheArchitectureMatch.java
Java
mit
3,371
# frozen_string_literal: true class Name < AbstractModel # Changes the name, and creates parents as necessary. Throws a RuntimeError # with error message if unsuccessful in any way. Returns nothing. *UNSAVED*!! # # *NOTE*: It does not save the changes to itself, but if it has to create or # update any parents (and caller has requested it), _those_ do get saved. # def change_text_name(in_text_name, in_author, in_rank, save_parents = false) in_str = Name.clean_incoming_string("#{in_text_name} #{in_author}") parse = Name.parse_name(in_str, rank: in_rank, deprecated: deprecated) if !parse || parse.rank != in_rank raise(:runtime_invalid_for_rank.t(rank: :"rank_#{in_rank.to_s.downcase}", name: in_str)) end if parse.parent_name && !Name.find_by_text_name(parse.parent_name) parents = Name.find_or_create_name_and_parents(parse.parent_name) if parents.last.nil? raise(:runtime_unable_to_create_name.t(name: parse.parent_name)) elsif save_parents parents.each { |n| n.save if n&.new_record? } end end self.attributes = parse.params end # Changes author. Updates formatted names, as well. *UNSAVED*!! # # name.change_author('New Author') # name.save # def change_author(new_author) return if rank == :Group new_author2 = new_author.blank? ? "" : " " + new_author self.author = new_author.to_s self.search_name = text_name + new_author2 self.sort_name = Name.format_sort_name(text_name, new_author) self.display_name = Name.format_autonym(text_name, new_author, rank, deprecated) end # Changes deprecated status. Updates formatted names, as well. *UNSAVED*!! # # name.change_deprecated(true) # name.save # def change_deprecated(deprecated) # remove existing boldness name = display_name.gsub(/\*\*([^*]+)\*\*/, '\1') unless deprecated # add new boldness name.gsub!(/(__[^_]+__)/, '**\1**') self.correct_spelling = nil end self.display_name = name self.deprecated = deprecated # synonym.choose_accepted_name if synonym end # Mark this name as "misspelled", make sure it is deprecated, record what the # correct spelling should be, make sure it is NOT deprecated, and make sure # it is a synonym of this name. Saves any changes it needs to make to the # correct spelling, but only saves the changes to this name if you ask it to. def mark_misspelled(target_name, save = false) return if deprecated && misspelling && correct_spelling == target_name self.misspelling = true self.correct_spelling = target_name change_deprecated(true) merge_synonyms(target_name) target_name.clear_misspelled(:save) if target_name.is_misspelling? save_with_log(:log_name_deprecated, other: target_name.display_name) \ if save change_misspelled_consensus_names end # Mark this name as "not misspelled", and saves the changes if you ask it to. def clear_misspelled(save = false) return unless misspelling || correct_spelling was = correct_spelling.display_name self.misspelling = false self.correct_spelling = nil save_with_log(:log_name_unmisspelled, other: was) if save end # Super quick and low-level update to make sure no observation names are # misspellings. def change_misspelled_consensus_names Observation.connection.execute(%( UPDATE observations SET name_id = #{correct_spelling_id} WHERE name_id = #{id} )) end end
JoeCohen/mushroom-observer
app/models/name/change.rb
Ruby
mit
3,612
package com.mapbox.geojson; import androidx.annotation.Keep; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonToken; import com.google.gson.stream.JsonWriter; import com.mapbox.geojson.exception.GeoJsonException; import java.io.IOException; import java.util.ArrayList; import java.util.List; /** * Type Adapter to serialize/deserialize List&lt;List&lt;List&lt;Point&gt;&gt;&gt; into/from * four dimentional double array. * * @since 4.6.0 */ @Keep class ListofListofListOfPointCoordinatesTypeAdapter extends BaseCoordinatesTypeAdapter<List<List<List<Point>>>> { @Override public void write(JsonWriter out, List<List<List<Point>>> points) throws IOException { if (points == null) { out.nullValue(); return; } out.beginArray(); for (List<List<Point>> listOfListOfPoints : points) { out.beginArray(); for (List<Point> listOfPoints : listOfListOfPoints) { out.beginArray(); for (Point point : listOfPoints) { writePoint(out, point); } out.endArray(); } out.endArray(); } out.endArray(); } @Override public List<List<List<Point>>> read(JsonReader in) throws IOException { if (in.peek() == JsonToken.NULL) { throw new NullPointerException(); } if (in.peek() == JsonToken.BEGIN_ARRAY) { in.beginArray(); List<List<List<Point>>> listOfListOflistOfPoints = new ArrayList<>(); while (in.peek() == JsonToken.BEGIN_ARRAY) { in.beginArray(); List<List<Point>> listOfListOfPoints = new ArrayList<>(); while (in.peek() == JsonToken.BEGIN_ARRAY) { in.beginArray(); List<Point> listOfPoints = new ArrayList<>(); while (in.peek() == JsonToken.BEGIN_ARRAY) { listOfPoints.add(readPoint(in)); } in.endArray(); listOfListOfPoints.add(listOfPoints); } in.endArray(); listOfListOflistOfPoints.add(listOfListOfPoints); } in.endArray(); return listOfListOflistOfPoints; } throw new GeoJsonException("coordinates should be array of array of array of double"); } }
mapbox/mapbox-java
services-geojson/src/main/java/com/mapbox/geojson/ListofListofListOfPointCoordinatesTypeAdapter.java
Java
mit
2,195
// // MasterViewController.h // WeatherWorld // // Created by Pol Quintana on 4/11/14. // Copyright (c) 2014 Pol Quintana. All rights reserved. // #import <UIKit/UIKit.h> #import "CoreDataPoweredTableViewController.h" @interface MasterViewController : CoreDataPoweredTableViewController @end
suxinde2009/SXD_iOS_Toys
Learning_materials/MagicalRecord_Demos_From_Github/iOS---WeatherWorld--master/WeatherWorld/Controller/MasterViewController.h
C
mit
301
<!DOCTYPE html> <!--[if lt IE 9]><html class="no-js lt-ie9" lang="en" dir="ltr"><![endif]--> <!--[if gt IE 8]><!--> <html class="no-js" lang="en" dir="ltr"> <!--<![endif]--> <!-- Usage: /eic/site/ccc-rec.nsf/tpl-eng/template-1col.html?Open&id=3 (optional: ?Open&page=filename.html&id=x) --> <!-- Created: ; Product Code: 536; Server: stratnotes2.ic.gc.ca --> <head> <!-- Title begins / Début du titre --> <title> Simply Amish Furniture Gallery - Complete profile - Canadian Company Capabilities - Industries and Business - Industry Canada </title> <!-- Title ends / Fin du titre --> <!-- Meta-data begins / Début des métadonnées --> <meta charset="utf-8" /> <meta name="dcterms.language" title="ISO639-2" content="eng" /> <meta name="dcterms.title" content="" /> <meta name="description" content="" /> <meta name="dcterms.description" content="" /> <meta name="dcterms.type" content="report, data set" /> <meta name="dcterms.subject" content="businesses, industry" /> <meta name="dcterms.subject" content="businesses, industry" /> <meta name="dcterms.issued" title="W3CDTF" content="" /> <meta name="dcterms.modified" title="W3CDTF" content="" /> <meta name="keywords" content="" /> <meta name="dcterms.creator" content="" /> <meta name="author" content="" /> <meta name="dcterms.created" title="W3CDTF" content="" /> <meta name="dcterms.publisher" content="" /> <meta name="dcterms.audience" title="icaudience" content="" /> <meta name="dcterms.spatial" title="ISO3166-1" content="" /> <meta name="dcterms.spatial" title="gcgeonames" content="" /> <meta name="dcterms.format" content="HTML" /> <meta name="dcterms.identifier" title="ICsiteProduct" content="536" /> <!-- EPI-11240 --> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- MCG-202 --> <meta content="width=device-width,initial-scale=1" name="viewport"> <!-- EPI-11567 --> <meta name = "format-detection" content = "telephone=no"> <!-- EPI-12603 --> <meta name="robots" content="noarchive"> <!-- EPI-11190 - Webtrends --> <script> var startTime = new Date(); startTime = startTime.getTime(); </script> <!--[if gte IE 9 | !IE ]><!--> <link href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/favicon.ico" rel="icon" type="image/x-icon"> <link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/wet-boew.min.css"> <!--<![endif]--> <link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/theme.min.css"> <!--[if lt IE 9]> <link href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/favicon.ico" rel="shortcut icon" /> <link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/ie8-wet-boew.min.css" /> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/js/ie8-wet-boew.min.js"></script> <![endif]--> <!--[if lte IE 9]> <![endif]--> <noscript><link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/noscript.min.css" /></noscript> <!-- Google Tag Manager DO NOT REMOVE OR MODIFY - NE PAS SUPPRIMER OU MODIFIER --> <script>dataLayer1 = [];</script> <!-- End Google Tag Manager --> <!-- EPI-11235 --> <link rel="stylesheet" href="/eic/home.nsf/css/add_WET_4-0_Canada_Apps.css"> <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet"> <link href="/app/ccc/srch/css/print.css" media="print" rel="stylesheet" type="text/css" /> </head> <body class="home" vocab="http://schema.org/" typeof="WebPage"> <!-- EPIC HEADER BEGIN --> <!-- Google Tag Manager DO NOT REMOVE OR MODIFY - NE PAS SUPPRIMER OU MODIFIER --> <noscript><iframe title="Google Tag Manager" src="//www.googletagmanager.com/ns.html?id=GTM-TLGQ9K" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer1'?'&l='+l:'';j.async=true;j.src='//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer1','GTM-TLGQ9K');</script> <!-- End Google Tag Manager --> <!-- EPI-12801 --> <span typeof="Organization"><meta property="legalName" content="Department_of_Industry"></span> <ul id="wb-tphp"> <li class="wb-slc"> <a class="wb-sl" href="#wb-cont">Skip to main content</a> </li> <li class="wb-slc visible-sm visible-md visible-lg"> <a class="wb-sl" href="#wb-info">Skip to "About this site"</a> </li> </ul> <header role="banner"> <div id="wb-bnr" class="container"> <section id="wb-lng" class="visible-md visible-lg text-right"> <h2 class="wb-inv">Language selection</h2> <div class="row"> <div class="col-md-12"> <ul class="list-inline mrgn-bttm-0"> <li><a href="nvgt.do?V_TOKEN=1492319103366&V_SEARCH.docsCount=3&V_DOCUMENT.docRank=42302&V_SEARCH.docsStart=42301&V_SEARCH.command=navigate&V_SEARCH.resultsJSP=/prfl.do&lang=fra&redirectUrl=/app/scr/imbs/ccc/rgstrtn/rgstr.sec?_flId?_flxKy=e1s1&amp;estblmntNo=234567041301&amp;profileId=61&amp;_evId=bck&amp;lang=eng&amp;V_SEARCH.showStricts=false&amp;prtl=1&amp;_flId?_flId?_flxKy=e1s1" title="Français" lang="fr">Français</a></li> </ul> </div> </div> </section> <div class="row"> <div class="brand col-xs-8 col-sm-9 col-md-6"> <a href="http://www.canada.ca/en/index.html"><object type="image/svg+xml" tabindex="-1" data="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/sig-blk-en.svg"></object><span class="wb-inv"> Government of Canada</span></a> </div> <section class="wb-mb-links col-xs-4 col-sm-3 visible-sm visible-xs" id="wb-glb-mn"> <h2>Search and menus</h2> <ul class="list-inline text-right chvrn"> <li><a href="#mb-pnl" title="Search and menus" aria-controls="mb-pnl" class="overlay-lnk" role="button"><span class="glyphicon glyphicon-search"><span class="glyphicon glyphicon-th-list"><span class="wb-inv">Search and menus</span></span></span></a></li> </ul> <div id="mb-pnl"></div> </section> <!-- Site Search Removed --> </div> </div> <nav role="navigation" id="wb-sm" class="wb-menu visible-md visible-lg" data-trgt="mb-pnl" data-ajax-fetch="//cdn.canada.ca/gcweb-cdn-dev/sitemenu/sitemenu-en.html" typeof="SiteNavigationElement"> <h2 class="wb-inv">Topics menu</h2> <div class="container nvbar"> <div class="row"> <ul class="list-inline menu"> <li><a href="https://www.canada.ca/en/services/jobs.html">Jobs</a></li> <li><a href="http://www.cic.gc.ca/english/index.asp">Immigration</a></li> <li><a href="https://travel.gc.ca/">Travel</a></li> <li><a href="https://www.canada.ca/en/services/business.html">Business</a></li> <li><a href="https://www.canada.ca/en/services/benefits.html">Benefits</a></li> <li><a href="http://healthycanadians.gc.ca/index-eng.php">Health</a></li> <li><a href="https://www.canada.ca/en/services/taxes.html">Taxes</a></li> <li><a href="https://www.canada.ca/en/services.html">More services</a></li> </ul> </div> </div> </nav> <!-- EPIC BODY BEGIN --> <nav role="navigation" id="wb-bc" class="" property="breadcrumb"> <h2 class="wb-inv">You are here:</h2> <div class="container"> <div class="row"> <ol class="breadcrumb"> <li><a href="/eic/site/icgc.nsf/eng/home" title="Home">Home</a></li> <li><a href="/eic/site/icgc.nsf/eng/h_07063.html" title="Industries and Business">Industries and Business</a></li> <li><a href="/eic/site/ccc-rec.nsf/tpl-eng/../eng/home" >Canadian Company Capabilities</a></li> </ol> </div> </div> </nav> </header> <main id="wb-cont" role="main" property="mainContentOfPage" class="container"> <!-- End Header --> <!-- Begin Body --> <!-- Begin Body Title --> <!-- End Body Title --> <!-- Begin Body Head --> <!-- End Body Head --> <!-- Begin Body Content --> <br> <!-- Complete Profile --> <!-- Company Information above tabbed area--> <input id="showMore" type="hidden" value='more'/> <input id="showLess" type="hidden" value='less'/> <h1 id="wb-cont"> Company profile - Canadian Company Capabilities </h1> <div class="profileInfo hidden-print"> <ul class="list-inline"> <li><a href="cccSrch.do?lang=eng&profileId=&prtl=1&key.hitsPerPage=25&searchPage=%252Fapp%252Fccc%252Fsrch%252FcccBscSrch.do%253Flang%253Deng%2526amp%253Bprtl%253D1%2526amp%253Btagid%253D&V_SEARCH.scopeCategory=CCC.Root&V_SEARCH.depth=1&V_SEARCH.showStricts=false&V_SEARCH.sortSpec=title+asc&amp;rstBtn.x=" class="btn btn-link">New Search</a>&nbsp;|</li> <li><form name="searchForm" method="post" action="/app/ccc/srch/bscSrch.do"> <input type="hidden" name="lang" value="eng" /> <input type="hidden" name="profileId" value="" /> <input type="hidden" name="prtl" value="1" /> <input type="hidden" name="searchPage" value="%2Fapp%2Fccc%2Fsrch%2FcccBscSrch.do%3Flang%3Deng%26amp%3Bprtl%3D1%26amp%3Btagid%3D" /> <input type="hidden" name="V_SEARCH.scopeCategory" value="CCC.Root" /> <input type="hidden" name="V_SEARCH.depth" value="1" /> <input type="hidden" name="V_SEARCH.showStricts" value="false" /> <input id="repeatSearchBtn" class="btn btn-link" type="submit" value="Return to search results" /> </form></li> <li>|&nbsp;<a href="nvgt.do?V_SEARCH.docsStart=42300&amp;V_DOCUMENT.docRank=42301&amp;V_SEARCH.docsCount=3&amp;lang=eng&amp;prtl=1&amp;sbPrtl=&amp;profile=cmpltPrfl&amp;V_TOKEN=1492319109160&amp;V_SEARCH.command=navigate&amp;V_SEARCH.resultsJSP=%2fprfl.do&amp;estblmntNo=234567152600&amp;profileId=&amp;key.newSearchLabel=">Previous Company</a></li> <li>|&nbsp;<a href="nvgt.do?V_SEARCH.docsStart=42302&amp;V_DOCUMENT.docRank=42303&amp;V_SEARCH.docsCount=3&amp;lang=eng&amp;prtl=1&amp;sbPrtl=&amp;profile=cmpltPrfl&amp;V_TOKEN=1492319109160&amp;V_SEARCH.command=navigate&amp;V_SEARCH.resultsJSP=%2fprfl.do&amp;estblmntNo=234567121053&amp;profileId=&amp;key.newSearchLabel=">Next Company</a></li> </ul> </div> <details> <summary>Third-Party Information Liability Disclaimer</summary> <p>Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.</p> </details> <h2> Simply Amish Furniture Gallery </h2> <div class="row"> <div class="col-md-5"> <h2 class="h5 mrgn-bttm-0">Legal/Operating Name:</h2> <p>Simply Amish Furniture Gallery</p> <div class="mrgn-tp-md"></div> <p class="mrgn-bttm-0" ><a href="http://www.simplyamish.ca" target="_blank" title="Website URL">http://www.simplyamish.ca</a></p> <p><a href="mailto:simplyamishofvancouverisland@gmail.com" title="simplyamishofvancouverisland@gmail.com">simplyamishofvancouverisland@gmail.com</a></p> </div> <div class="col-md-4 mrgn-sm-sm"> <h2 class="h5 mrgn-bttm-0">Mailing Address:</h2> <address class="mrgn-bttm-md"> 253 Finholm St N<br/> PARKSVILLE, British Columbia<br/> V9P 1H3 <br/> </address> <h2 class="h5 mrgn-bttm-0">Location Address:</h2> <address class="mrgn-bttm-md"> 253 Finholm St N<br/> PARKSVILLE, British Columbia<br/> V9P 1H3 <br/> </address> <p class="mrgn-bttm-0"><abbr title="Telephone">Tel.</abbr>: (250) 248-9999 </p> <p class="mrgn-bttm-lg"><abbr title="Facsimile">Fax</abbr>: </p> </div> <div class="col-md-3 mrgn-tp-md"> </div> </div> <div class="row mrgn-tp-md mrgn-bttm-md"> <div class="col-md-12"> <h2 class="wb-inv">Company Profile</h2> <br> Quality, Amish built, solid hardwood furniture is our specialty. We are a local, family owned, furniture store featuring handcrafted Amish furniture for every room of your home. Whether you are searching for a new dining room table for your next family gathering or to update your bedroom furniture, we have the custom furniture options to meet your needs. <br> <br>Stop in our custom Amish furniture store today, for the quality and style hardwood furniture you deserve.<br> </div> </div> <!-- <div class="wb-tabs ignore-session update-hash wb-eqht-off print-active"> --> <div class="wb-tabs ignore-session"> <div class="tabpanels"> <details id="details-panel1"> <summary> Full profile </summary> <!-- Tab 1 --> <h2 class="wb-invisible"> Full profile </h2> <!-- Contact Information --> <h3 class="page-header"> Contact information </h3> <section class="container-fluid"> <div class="row mrgn-tp-lg"> <div class="col-md-3"> <strong> Lisa Loewens </strong></div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Title: </strong> </div> <div class="col-md-7"> <!--if client gender is not null or empty we use gender based job title--> Owner </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (250) 465-8769 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Email: </strong> </div> <div class="col-md-7"> simplyamishofvancouverisland@gmail.com </div> </div> </section> <p class="mrgn-tp-lg text-right small hidden-print"> <a href="#wb-cont">top of page</a> </p> <!-- Company Description --> <h3 class="page-header"> Company description </h3> <section class="container-fluid"> <div class="row"> <div class="col-md-5"> <strong> Country of Ownership: </strong> </div> <div class="col-md-7"> Canada &nbsp; </div> </div> <div class="row"> <div class="col-md-5"> <strong> Year Established: </strong> </div> <div class="col-md-7"> 2007 </div> </div> <div class="row"> <div class="col-md-5"> <strong> Exporting: </strong> </div> <div class="col-md-7"> No &nbsp; </div> </div> <div class="row"> <div class="col-md-5"> <strong> Primary Industry (NAICS): </strong> </div> <div class="col-md-7"> 442110 - Furniture Stores </div> </div> <div class="row"> <div class="col-md-5"> <strong> Primary Business Activity: </strong> </div> <div class="col-md-7"> Retail &nbsp; </div> </div> </section> <!-- Products / Services / Licensing --> <h3 class="page-header"> Product / Service / Licensing </h3> <section class="container-fluid"> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> Furniture<br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-12"> furniture,amish furniture,custom furniture,wood furniture,bedroom furniture,dining room furniture, kitchen furniture,living room furniture,children&#39;s furniture,office furniture,outdoor furniture,beds,dressers,nightstands,chests,mirrors,tables,chairs,cribs,entertainment centers,couch,sofa,loveseat,recliner,desk,filing cabinets,desk chairs,rocker,woods,stains,hardware,fabrics,custom designed furniture,custom staining,custom finishing,custom upholstery<br> <br> </div> </div> </section> <p class="mrgn-tp-lg text-right small hidden-print"> <a href="#wb-cont">top of page</a> </p> <!-- Technology Profile --> <!-- Market Profile --> <!-- Sector Information --> <details class="mrgn-tp-md mrgn-bttm-md"> <summary> Third-Party Information Liability Disclaimer </summary> <p> Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements. </p> </details> </details> <details id="details-panel2"> <summary> Contacts </summary> <h2 class="wb-invisible"> Contact information </h2> <!-- Contact Information --> <section class="container-fluid"> <div class="row mrgn-tp-lg"> <div class="col-md-3"> <strong> Lisa Loewens </strong></div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Title: </strong> </div> <div class="col-md-7"> <!--if client gender is not null or empty we use gender based job title--> Owner </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (250) 465-8769 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Email: </strong> </div> <div class="col-md-7"> simplyamishofvancouverisland@gmail.com </div> </div> </section> </details> <details id="details-panel3"> <summary> Description </summary> <h2 class="wb-invisible"> Company description </h2> <section class="container-fluid"> <div class="row"> <div class="col-md-5"> <strong> Country of Ownership: </strong> </div> <div class="col-md-7"> Canada &nbsp; </div> </div> <div class="row"> <div class="col-md-5"> <strong> Year Established: </strong> </div> <div class="col-md-7"> 2007 </div> </div> <div class="row"> <div class="col-md-5"> <strong> Exporting: </strong> </div> <div class="col-md-7"> No &nbsp; </div> </div> <div class="row"> <div class="col-md-5"> <strong> Primary Industry (NAICS): </strong> </div> <div class="col-md-7"> 442110 - Furniture Stores </div> </div> <div class="row"> <div class="col-md-5"> <strong> Primary Business Activity: </strong> </div> <div class="col-md-7"> Retail &nbsp; </div> </div> </section> </details> <details id="details-panel4"> <summary> Products, services and licensing </summary> <h2 class="wb-invisible"> Product / Service / Licensing </h2> <section class="container-fluid"> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> Furniture<br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-12"> furniture,amish furniture,custom furniture,wood furniture,bedroom furniture,dining room furniture, kitchen furniture,living room furniture,children&#39;s furniture,office furniture,outdoor furniture,beds,dressers,nightstands,chests,mirrors,tables,chairs,cribs,entertainment centers,couch,sofa,loveseat,recliner,desk,filing cabinets,desk chairs,rocker,woods,stains,hardware,fabrics,custom designed furniture,custom staining,custom finishing,custom upholstery<br> <br> </div> </div> </section> </details> </div> </div> <div class="row"> <div class="col-md-12 text-right"> Last Update Date 2014-11-24 </div> </div> <!-- - Artifact ID: CBW - IMBS - CCC Search WAR - Group ID: ca.gc.ic.strategis.imbs.ccc.search - Version: 3.26 - Built-By: bamboo - Build Timestamp: 2017-03-02T21:29:28Z --> <!-- End Body Content --> <!-- Begin Body Foot --> <!-- End Body Foot --> <!-- END MAIN TABLE --> <!-- End body --> <!-- Begin footer --> <div class="row pagedetails"> <div class="col-sm-5 col-xs-12 datemod"> <dl id="wb-dtmd"> <dt class=" hidden-print">Date Modified:</dt> <dd class=" hidden-print"> <span><time>2017-03-02</time></span> </dd> </dl> </div> <div class="clear visible-xs"></div> <div class="col-sm-4 col-xs-6"> </div> <div class="col-sm-3 col-xs-6 text-right"> </div> <div class="clear visible-xs"></div> </div> </main> <footer role="contentinfo" id="wb-info"> <nav role="navigation" class="container wb-navcurr"> <h2 class="wb-inv">About government</h2> <!-- EPIC FOOTER BEGIN --> <!-- EPI-11638 Contact us --> <ul class="list-unstyled colcount-sm-2 colcount-md-3"> <li><a href="http://www.ic.gc.ca/eic/site/icgc.nsf/eng/h_07026.html#pageid=E048-H00000&amp;from=Industries">Contact us</a></li> <li><a href="https://www.canada.ca/en/government/dept.html">Departments and agencies</a></li> <li><a href="https://www.canada.ca/en/government/publicservice.html">Public service and military</a></li> <li><a href="https://www.canada.ca/en/news.html">News</a></li> <li><a href="https://www.canada.ca/en/government/system/laws.html">Treaties, laws and regulations</a></li> <li><a href="https://www.canada.ca/en/transparency/reporting.html">Government-wide reporting</a></li> <li><a href="http://pm.gc.ca/eng">Prime Minister</a></li> <li><a href="https://www.canada.ca/en/government/system.html">How government works</a></li> <li><a href="http://open.canada.ca/en/">Open government</a></li> </ul> </nav> <div class="brand"> <div class="container"> <div class="row"> <nav class="col-md-10 ftr-urlt-lnk"> <h2 class="wb-inv">About this site</h2> <ul> <li><a href="https://www.canada.ca/en/social.html">Social media</a></li> <li><a href="https://www.canada.ca/en/mobile.html">Mobile applications</a></li> <li><a href="http://www1.canada.ca/en/newsite.html">About Canada.ca</a></li> <li><a href="http://www.ic.gc.ca/eic/site/icgc.nsf/eng/h_07033.html">Terms and conditions</a></li> <li><a href="http://www.ic.gc.ca/eic/site/icgc.nsf/eng/h_07033.html#p1">Privacy</a></li> </ul> </nav> <div class="col-xs-6 visible-sm visible-xs tofpg"> <a href="#wb-cont">Top of Page <span class="glyphicon glyphicon-chevron-up"></span></a> </div> <div class="col-xs-6 col-md-2 text-right"> <object type="image/svg+xml" tabindex="-1" role="img" data="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/wmms-blk.svg" aria-label="Symbol of the Government of Canada"></object> </div> </div> </div> </div> </footer> <!--[if gte IE 9 | !IE ]><!--> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/js/wet-boew.min.js"></script> <!--<![endif]--> <!--[if lt IE 9]> <script src="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/js/ie8-wet-boew2.min.js"></script> <![endif]--> <script src="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/js/theme.min.js"></script> <!-- EPI-10519 --> <span class="wb-sessto" data-wb-sessto='{"inactivity": 1800000, "reactionTime": 180000, "sessionalive": 1800000, "logouturl": "/app/ccc/srch/cccSrch.do?lang=eng&prtl=1"}'></span> <script src="/eic/home.nsf/js/jQuery.externalOpensInNewWindow.js"></script> <!-- EPI-11190 - Webtrends --> <script src="/eic/home.nsf/js/webtrends.js"></script> <script>var endTime = new Date();</script> <noscript> <div><img alt="" id="DCSIMG" width="1" height="1" src="//wt-sdc.ic.gc.ca/dcs6v67hwe0ei7wsv8g9fv50d_3k6i/njs.gif?dcsuri=/nojavascript&amp;WT.js=No&amp;WT.tv=9.4.0&amp;dcssip=www.ic.gc.ca"/></div> </noscript> <!-- /Webtrends --> <!-- JS deps --> <script src="/eic/home.nsf/js/jquery.imagesloaded.js"></script> <!-- EPI-11262 - Util JS --> <script src="/eic/home.nsf/js/_WET_4-0_utils_canada.min.js"></script> <!-- EPI-11383 --> <script src="/eic/home.nsf/js/jQuery.icValidationErrors.js"></script> <span style="display:none;" id='app-info' data-project-groupid='' data-project-artifactid='' data-project-version='' data-project-build-timestamp='' data-issue-tracking='' data-scm-sha1='' data-scm-sha1-abbrev='' data-scm-branch='' data-scm-commit-date=''></span> </body></html> <!-- End Footer --> <!-- - Artifact ID: CBW - IMBS - CCC Search WAR - Group ID: ca.gc.ic.strategis.imbs.ccc.search - Version: 3.26 - Built-By: bamboo - Build Timestamp: 2017-03-02T21:29:28Z -->
GoC-Spending/data-corporations
html/234567152601.html
HTML
mit
34,870
/*! * jQuery JavaScript Library v1.10.2 * http://jquery.com/ * * Includes Sizzle.js * http://sizzlejs.com/ * * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2013-07-03T13:48Z */ (function(window, undefined) { // Can't do this because several apps including ASP.NET trace // the stack via arguments.caller.callee and Firefox dies if // you try to trace through "use strict" call chains. (#13335) // Support: Firefox 18+ //"use strict"; var // The deferred used on DOM ready readyList, // A central reference to the root jQuery(document) rootjQuery, // Support: IE<10 // For `typeof xmlNode.method` instead of `xmlNode.method !== undefined` core_strundefined = typeof undefined, // Use the correct document accordingly with window argument (sandbox) location = window.location, document = window.document, docElem = document.documentElement, // Map over jQuery in case of overwrite _jQuery = window.jQuery, // Map over the $ in case of overwrite _$ = window.$, // [[Class]] -> type pairs class2type = {}, // List of deleted data cache ids, so we can reuse them core_deletedIds = [], core_version = "1.10.2", // Save a reference to some core methods core_concat = core_deletedIds.concat, core_push = core_deletedIds.push, core_slice = core_deletedIds.slice, core_indexOf = core_deletedIds.indexOf, core_toString = class2type.toString, core_hasOwn = class2type.hasOwnProperty, core_trim = core_version.trim, // Define a local copy of jQuery jQuery = function(selector, context) { // The jQuery object is actually just the init constructor 'enhanced' return new jQuery.fn.init(selector, context, rootjQuery); }, // Used for matching numbers core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, // Used for splitting on whitespace core_rnotwhite = /\S+/g, // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE) rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, // A simple way to check for HTML strings // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) // Strict HTML recognition (#11290: must start with <) rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, // Match a standalone tag rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, // JSON RegExp rvalidchars = /^[\],:{}\s]*$/, rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g, // Matches dashed string for camelizing rmsPrefix = /^-ms-/, rdashAlpha = /-([\da-z])/gi, // Used by jQuery.camelCase as callback to replace() fcamelCase = function(all, letter) { return letter.toUpperCase(); }, // The ready event handler completed = function(event) { // readyState === "complete" is good enough for us to call the dom ready in oldIE if (document.addEventListener || event.type === "load" || document.readyState === "complete") { detach(); jQuery.ready(); } }, // Clean-up method for dom ready events detach = function() { if (document.addEventListener) { document.removeEventListener("DOMContentLoaded", completed, false); window.removeEventListener("load", completed, false); } else { document.detachEvent("onreadystatechange", completed); window.detachEvent("onload", completed); } }; jQuery.fn = jQuery.prototype = { // The current version of jQuery being used jquery: core_version, constructor: jQuery, init: function(selector, context, rootjQuery) { var match, elem; // HANDLE: $(""), $(null), $(undefined), $(false) if (!selector) { return this; } // Handle HTML strings if (typeof selector === "string") { if (selector.charAt(0) === "<" && selector.charAt(selector.length - 1) === ">" && selector.length >= 3) { // Assume that strings that start and end with <> are HTML and skip the regex check match = [null, selector, null]; } else { match = rquickExpr.exec(selector); } // Match html or make sure no context is specified for #id if (match && (match[1] || !context)) { // HANDLE: $(html) -> $(array) if (match[1]) { context = context instanceof jQuery ? context[0] : context; // scripts is true for back-compat jQuery.merge(this, jQuery.parseHTML( match[1], context && context.nodeType ? context.ownerDocument || context : document, true)); // HANDLE: $(html, props) if (rsingleTag.test(match[1]) && jQuery.isPlainObject(context)) { for (match in context) { // Properties of context are called as methods if possible if (jQuery.isFunction(this[match])) { this[match](context[match]); // ...and otherwise set as attributes } else { this.attr(match, context[match]); } } } return this; // HANDLE: $(#id) } else { elem = document.getElementById(match[2]); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if (elem && elem.parentNode) { // Handle the case where IE and Opera return items // by name instead of ID if (elem.id !== match[2]) { return rootjQuery.find(selector); } // Otherwise, we inject the element directly into the jQuery object this.length = 1; this[0] = elem; } this.context = document; this.selector = selector; return this; } // HANDLE: $(expr, $(...)) } else if (!context || context.jquery) { return (context || rootjQuery).find(selector); // HANDLE: $(expr, context) // (which is just equivalent to: $(context).find(expr) } else { return this.constructor(context).find(selector); } // HANDLE: $(DOMElement) } else if (selector.nodeType) { this.context = this[0] = selector; this.length = 1; return this; // HANDLE: $(function) // Shortcut for document ready } else if (jQuery.isFunction(selector)) { return rootjQuery.ready(selector); } if (selector.selector !== undefined) { this.selector = selector.selector; this.context = selector.context; } return jQuery.makeArray(selector, this); }, // Start with an empty selector selector: "", // The default length of a jQuery object is 0 length: 0, toArray: function() { return core_slice.call(this); }, // Get the Nth element in the matched element set OR // Get the whole matched element set as a clean array get: function(num) { return num == null ? // Return a 'clean' array this.toArray() : // Return just the object (num < 0 ? this[this.length + num] : this[num]); }, // Take an array of elements and push it onto the stack // (returning the new matched element set) pushStack: function(elems) { // Build a new jQuery matched element set var ret = jQuery.merge(this.constructor(), elems); // Add the old object onto the stack (as a reference) ret.prevObject = this; ret.context = this.context; // Return the newly-formed element set return ret; }, // Execute a callback for every element in the matched set. // (You can seed the arguments with an array of args, but this is // only used internally.) each: function(callback, args) { return jQuery.each(this, callback, args); }, ready: function(fn) { // Add the callback jQuery.ready.promise().done(fn); return this; }, slice: function() { return this.pushStack(core_slice.apply(this, arguments)); }, first: function() { return this.eq(0); }, last: function() { return this.eq(-1); }, eq: function(i) { var len = this.length, j = +i + (i < 0 ? len : 0); return this.pushStack(j >= 0 && j < len ? [this[j]] : []); }, map: function(callback) { return this.pushStack(jQuery.map(this, function(elem, i) { return callback.call(elem, i, elem); })); }, end: function() { return this.prevObject || this.constructor(null); }, // For internal use only. // Behaves like an Array's method, not like a jQuery method. push: core_push, sort: [].sort, splice: [].splice }; // Give the init function the jQuery prototype for later instantiation jQuery.fn.init.prototype = jQuery.fn; jQuery.extend = jQuery.fn.extend = function() { var src, copyIsArray, copy, name, options, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = false; // Handle a deep copy situation if (typeof target === "boolean") { deep = target; target = arguments[1] || {}; // skip the boolean and the target i = 2; } // Handle case when target is a string or something (possible in deep copy) if (typeof target !== "object" && !jQuery.isFunction(target)) { target = {}; } // extend jQuery itself if only one argument is passed if (length === i) { target = this; --i; } for (; i < length; i++) { // Only deal with non-null/undefined values if ((options = arguments[i]) != null) { // Extend the base object for (name in options) { src = target[name]; copy = options[name]; // Prevent never-ending loop if (target === copy) { continue; } // Recurse if we're merging plain objects or arrays if (deep && copy && (jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)))) { if (copyIsArray) { copyIsArray = false; clone = src && jQuery.isArray(src) ? src : []; } else { clone = src && jQuery.isPlainObject(src) ? src : {}; } // Never move original objects, clone them target[name] = jQuery.extend(deep, clone, copy); // Don't bring in undefined values } else if (copy !== undefined) { target[name] = copy; } } } } // Return the modified object return target; }; jQuery.extend({ // Unique for each copy of jQuery on the page // Non-digits removed to match rinlinejQuery expando: "jQuery" + (core_version + Math.random()).replace(/\D/g, ""), noConflict: function(deep) { if (window.$ === jQuery) { window.$ = _$; } if (deep && window.jQuery === jQuery) { window.jQuery = _jQuery; } return jQuery; }, // Is the DOM ready to be used? Set to true once it occurs. isReady: false, // A counter to track how many items to wait for before // the ready event fires. See #6781 readyWait: 1, // Hold (or release) the ready event holdReady: function(hold) { if (hold) { jQuery.readyWait++; } else { jQuery.ready(true); } }, // Handle when the DOM is ready ready: function(wait) { // Abort if there are pending holds or we're already ready if (wait === true ? --jQuery.readyWait : jQuery.isReady) { return; } // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). if (!document.body) { return setTimeout(jQuery.ready); } // Remember that the DOM is ready jQuery.isReady = true; // If a normal DOM Ready event fired, decrement, and wait if need be if (wait !== true && --jQuery.readyWait > 0) { return; } // If there are functions bound, to execute readyList.resolveWith(document, [jQuery]); // Trigger any bound ready events if (jQuery.fn.trigger) { jQuery(document).trigger("ready").off("ready"); } }, // See test/unit/core.js for details concerning isFunction. // Since version 1.3, DOM methods and functions like alert // aren't supported. They return false on IE (#2968). isFunction: function(obj) { return jQuery.type(obj) === "function"; }, isArray: Array.isArray || function(obj) { return jQuery.type(obj) === "array"; }, isWindow: function(obj) { /* jshint eqeqeq: false */ return obj != null && obj == obj.window; }, isNumeric: function(obj) { return !isNaN(parseFloat(obj)) && isFinite(obj); }, type: function(obj) { if (obj == null) { return String(obj); } return typeof obj === "object" || typeof obj === "function" ? class2type[core_toString.call(obj)] || "object" : typeof obj; }, isPlainObject: function(obj) { var key; // Must be an Object. // Because of IE, we also have to check the presence of the constructor property. // Make sure that DOM nodes and window objects don't pass through, as well if (!obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow(obj)) { return false; } try { // Not own constructor property must be Object if (obj.constructor && !core_hasOwn.call(obj, "constructor") && !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf")) { return false; } } catch (e) { // IE8,9 Will throw exceptions on certain host objects #9897 return false; } // Support: IE<9 // Handle iteration over inherited properties before own properties. if (jQuery.support.ownLast) { for (key in obj) { return core_hasOwn.call(obj, key); } } // Own properties are enumerated firstly, so to speed up, // if last one is own, then all properties are own. for (key in obj) {} return key === undefined || core_hasOwn.call(obj, key); }, isEmptyObject: function(obj) { var name; for (name in obj) { return false; } return true; }, error: function(msg) { throw new Error(msg); }, // data: string of html // context (optional): If specified, the fragment will be created in this context, defaults to document // keepScripts (optional): If true, will include scripts passed in the html string parseHTML: function(data, context, keepScripts) { if (!data || typeof data !== "string") { return null; } if (typeof context === "boolean") { keepScripts = context; context = false; } context = context || document; var parsed = rsingleTag.exec(data), scripts = !keepScripts && []; // Single tag if (parsed) { return [context.createElement(parsed[1])]; } parsed = jQuery.buildFragment([data], context, scripts); if (scripts) { jQuery(scripts).remove(); } return jQuery.merge([], parsed.childNodes); }, parseJSON: function(data) { // Attempt to parse using the native JSON parser first if (window.JSON && window.JSON.parse) { return window.JSON.parse(data); } if (data === null) { return data; } if (typeof data === "string") { // Make sure leading/trailing whitespace is removed (IE can't handle it) data = jQuery.trim(data); if (data) { // Make sure the incoming data is actual JSON // Logic borrowed from http://json.org/json2.js if (rvalidchars.test(data.replace(rvalidescape, "@") .replace(rvalidtokens, "]") .replace(rvalidbraces, ""))) { return (new Function("return " + data))(); } } } jQuery.error("Invalid JSON: " + data); }, // Cross-browser xml parsing parseXML: function(data) { var xml, tmp; if (!data || typeof data !== "string") { return null; } try { if (window.DOMParser) { // Standard tmp = new DOMParser(); xml = tmp.parseFromString(data, "text/xml"); } else { // IE xml = new ActiveXObject("Microsoft.XMLDOM"); xml.async = "false"; xml.loadXML(data); } } catch (e) { xml = undefined; } if (!xml || !xml.documentElement || xml.getElementsByTagName("parsererror").length) { jQuery.error("Invalid XML: " + data); } return xml; }, noop: function() {}, // Evaluates a script in a global context // Workarounds based on findings by Jim Driscoll // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context globalEval: function(data) { if (data && jQuery.trim(data)) { // We use execScript on Internet Explorer // We use an anonymous function so that context is window // rather than jQuery in Firefox (window.execScript || function(data) { window["eval"].call(window, data); })(data); } }, // Convert dashed to camelCase; used by the css and data modules // Microsoft forgot to hump their vendor prefix (#9572) camelCase: function(string) { return string.replace(rmsPrefix, "ms-").replace(rdashAlpha, fcamelCase); }, nodeName: function(elem, name) { return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); }, // args is for internal usage only each: function(obj, callback, args) { var value, i = 0, length = obj.length, isArray = isArraylike(obj); if (args) { if (isArray) { for (; i < length; i++) { value = callback.apply(obj[i], args); if (value === false) { break; } } } else { for (i in obj) { value = callback.apply(obj[i], args); if (value === false) { break; } } } // A special, fast, case for the most common use of each } else { if (isArray) { for (; i < length; i++) { value = callback.call(obj[i], i, obj[i]); if (value === false) { break; } } } else { for (i in obj) { value = callback.call(obj[i], i, obj[i]); if (value === false) { break; } } } } return obj; }, // Use native String.trim function wherever possible trim: core_trim && !core_trim.call("\uFEFF\xA0") ? function(text) { return text == null ? "" : core_trim.call(text); } : // Otherwise use our own trimming functionality function(text) { return text == null ? "" : (text + "").replace(rtrim, ""); }, // results is for internal usage only makeArray: function(arr, results) { var ret = results || []; if (arr != null) { if (isArraylike(Object(arr))) { jQuery.merge(ret, typeof arr === "string" ? [arr] : arr); } else { core_push.call(ret, arr); } } return ret; }, inArray: function(elem, arr, i) { var len; if (arr) { if (core_indexOf) { return core_indexOf.call(arr, elem, i); } len = arr.length; i = i ? i < 0 ? Math.max(0, len + i) : i : 0; for (; i < len; i++) { // Skip accessing in sparse arrays if (i in arr && arr[i] === elem) { return i; } } } return -1; }, merge: function(first, second) { var l = second.length, i = first.length, j = 0; if (typeof l === "number") { for (; j < l; j++) { first[i++] = second[j]; } } else { while (second[j] !== undefined) { first[i++] = second[j++]; } } first.length = i; return first; }, grep: function(elems, callback, inv) { var retVal, ret = [], i = 0, length = elems.length; inv = !! inv; // Go through the array, only saving the items // that pass the validator function for (; i < length; i++) { retVal = !! callback(elems[i], i); if (inv !== retVal) { ret.push(elems[i]); } } return ret; }, // arg is for internal usage only map: function(elems, callback, arg) { var value, i = 0, length = elems.length, isArray = isArraylike(elems), ret = []; // Go through the array, translating each of the items to their if (isArray) { for (; i < length; i++) { value = callback(elems[i], i, arg); if (value != null) { ret[ret.length] = value; } } // Go through every key on the object, } else { for (i in elems) { value = callback(elems[i], i, arg); if (value != null) { ret[ret.length] = value; } } } // Flatten any nested arrays return core_concat.apply([], ret); }, // A global GUID counter for objects guid: 1, // Bind a function to a context, optionally partially applying any // arguments. proxy: function(fn, context) { var args, proxy, tmp; if (typeof context === "string") { tmp = fn[context]; context = fn; fn = tmp; } // Quick check to determine if target is callable, in the spec // this throws a TypeError, but we will just return undefined. if (!jQuery.isFunction(fn)) { return undefined; } // Simulated bind args = core_slice.call(arguments, 2); proxy = function() { return fn.apply(context || this, args.concat(core_slice.call(arguments))); }; // Set the guid of unique handler to the same of original handler, so it can be removed proxy.guid = fn.guid = fn.guid || jQuery.guid++; return proxy; }, // Multifunctional method to get and set values of a collection // The value/s can optionally be executed if it's a function access: function(elems, fn, key, value, chainable, emptyGet, raw) { var i = 0, length = elems.length, bulk = key == null; // Sets many values if (jQuery.type(key) === "object") { chainable = true; for (i in key) { jQuery.access(elems, fn, i, key[i], true, emptyGet, raw); } // Sets one value } else if (value !== undefined) { chainable = true; if (!jQuery.isFunction(value)) { raw = true; } if (bulk) { // Bulk operations run against the entire set if (raw) { fn.call(elems, value); fn = null; // ...except when executing function values } else { bulk = fn; fn = function(elem, key, value) { return bulk.call(jQuery(elem), value); }; } } if (fn) { for (; i < length; i++) { fn(elems[i], key, raw ? value : value.call(elems[i], i, fn(elems[i], key))); } } } return chainable ? elems : // Gets bulk ? fn.call(elems) : length ? fn(elems[0], key) : emptyGet; }, now: function() { return (new Date()).getTime(); }, // A method for quickly swapping in/out CSS properties to get correct calculations. // Note: this method belongs to the css module but it's needed here for the support module. // If support gets modularized, this method should be moved back to the css module. swap: function(elem, options, callback, args) { var ret, name, old = {}; // Remember the old values, and insert the new ones for (name in options) { old[name] = elem.style[name]; elem.style[name] = options[name]; } ret = callback.apply(elem, args || []); // Revert the old values for (name in options) { elem.style[name] = old[name]; } return ret; } }); jQuery.ready.promise = function(obj) { if (!readyList) { readyList = jQuery.Deferred(); // Catch cases where $(document).ready() is called after the browser event has already occurred. // we once tried to use readyState "interactive" here, but it caused issues like the one // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 if (document.readyState === "complete") { // Handle it asynchronously to allow scripts the opportunity to delay ready setTimeout(jQuery.ready); // Standards-based browsers support DOMContentLoaded } else if (document.addEventListener) { // Use the handy event callback document.addEventListener("DOMContentLoaded", completed, false); // A fallback to window.onload, that will always work window.addEventListener("load", completed, false); // If IE event model is used } else { // Ensure firing before onload, maybe late but safe also for iframes document.attachEvent("onreadystatechange", completed); // A fallback to window.onload, that will always work window.attachEvent("onload", completed); // If IE and not a frame // continually check to see if the document is ready var top = false; try { top = window.frameElement == null && document.documentElement; } catch (e) {} if (top && top.doScroll) { (function doScrollCheck() { if (!jQuery.isReady) { try { // Use the trick by Diego Perini // http://javascript.nwbox.com/IEContentLoaded/ top.doScroll("left"); } catch (e) { return setTimeout(doScrollCheck, 50); } // detach all dom ready events detach(); // and execute any waiting functions jQuery.ready(); } })(); } } } return readyList.promise(obj); }; // Populate the class2type map jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { class2type["[object " + name + "]"] = name.toLowerCase(); }); function isArraylike(obj) { var length = obj.length, type = jQuery.type(obj); if (jQuery.isWindow(obj)) { return false; } if (obj.nodeType === 1 && length) { return true; } return type === "array" || type !== "function" && (length === 0 || typeof length === "number" && length > 0 && (length - 1) in obj); } // All jQuery objects should point back to these rootjQuery = jQuery(document); /*! * Sizzle CSS Selector Engine v1.10.2 * http://sizzlejs.com/ * * Copyright 2013 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2013-07-03 */ (function(window, undefined) { var i, support, cachedruns, Expr, getText, isXML, compile, outermostContext, sortInput, // Local document vars setDocument, document, docElem, documentIsHTML, rbuggyQSA, rbuggyMatches, matches, contains, // Instance-specific data expando = "sizzle" + -(new Date()), preferredDoc = window.document, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), hasDuplicate = false, sortOrder = function(a, b) { if (a === b) { hasDuplicate = true; return 0; } return 0; }, // General-purpose constants strundefined = typeof undefined, MAX_NEGATIVE = 1 << 31, // Instance methods hasOwn = ({}).hasOwnProperty, arr = [], pop = arr.pop, push_native = arr.push, push = arr.push, slice = arr.slice, // Use a stripped-down indexOf if we can't use a native one indexOf = arr.indexOf || function(elem) { var i = 0, len = this.length; for (; i < len; i++) { if (this[i] === elem) { return i; } } return -1; }, booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", // Regular expressions // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace whitespace = "[\\x20\\t\\r\\n\\f]", // http://www.w3.org/TR/css3-syntax/#characters characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", // Loosely modeled on CSS identifier characters // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier identifier = characterEncoding.replace("w", "w#"), // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + "*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", // Prefer arguments quoted, // then not containing pseudos/brackets, // then attribute selectors/non-parenthetical expressions, // then anything else // These preferences are here to reduce the number of selectors // needing tokenize in the PSEUDO preFilter pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace(3, 8) + ")*)|.*)\\)|)", // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter rtrim = new RegExp("^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g"), rcomma = new RegExp("^" + whitespace + "*," + whitespace + "*"), rcombinators = new RegExp("^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*"), rsibling = new RegExp(whitespace + "*[+~]"), rattributeQuotes = new RegExp("=" + whitespace + "*([^\\]'\"]*)" + whitespace + "*\\]", "g"), rpseudo = new RegExp(pseudos), ridentifier = new RegExp("^" + identifier + "$"), matchExpr = { "ID": new RegExp("^#(" + characterEncoding + ")"), "CLASS": new RegExp("^\\.(" + characterEncoding + ")"), "TAG": new RegExp("^(" + characterEncoding.replace("w", "w*") + ")"), "ATTR": new RegExp("^" + attributes), "PSEUDO": new RegExp("^" + pseudos), "CHILD": new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i"), "bool": new RegExp("^(?:" + booleans + ")$", "i"), // For use in libraries implementing .is() // We use this for POS matching in `select` "needsContext": new RegExp("^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i") }, rnative = /^[^{]+\{\s*\[native \w/, // Easily-parseable/retrievable ID or TAG or CLASS selectors rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rescape = /'|\\/g, // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters runescape = new RegExp("\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig"), funescape = function(_, escaped, escapedWhitespace) { var high = "0x" + escaped - 0x10000; // NaN means non-codepoint // Support: Firefox // Workaround erroneous numeric interpretation of +"0x" return high !== high || escapedWhitespace ? escaped : // BMP codepoint high < 0 ? String.fromCharCode(high + 0x10000) : // Supplemental Plane codepoint (surrogate pair) String.fromCharCode(high >> 10 | 0xD800, high & 0x3FF | 0xDC00); }; // Optimize for push.apply( _, NodeList ) try { push.apply( (arr = slice.call(preferredDoc.childNodes)), preferredDoc.childNodes); // Support: Android<4.0 // Detect silently failing push.apply arr[preferredDoc.childNodes.length].nodeType; } catch (e) { push = { apply: arr.length ? // Leverage slice if possible function(target, els) { push_native.apply(target, slice.call(els)); } : // Support: IE<9 // Otherwise append directly function(target, els) { var j = target.length, i = 0; // Can't trust NodeList.length while ((target[j++] = els[i++])) {} target.length = j - 1; } }; } function Sizzle(selector, context, results, seed) { var match, elem, m, nodeType, // QSA vars i, groups, old, nid, newContext, newSelector; if ((context ? context.ownerDocument || context : preferredDoc) !== document) { setDocument(context); } context = context || document; results = results || []; if (!selector || typeof selector !== "string") { return results; } if ((nodeType = context.nodeType) !== 1 && nodeType !== 9) { return []; } if (documentIsHTML && !seed) { // Shortcuts if ((match = rquickExpr.exec(selector))) { // Speed-up: Sizzle("#ID") if ((m = match[1])) { if (nodeType === 9) { elem = context.getElementById(m); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if (elem && elem.parentNode) { // Handle the case where IE, Opera, and Webkit return items // by name instead of ID if (elem.id === m) { results.push(elem); return results; } } else { return results; } } else { // Context is not a document if (context.ownerDocument && (elem = context.ownerDocument.getElementById(m)) && contains(context, elem) && elem.id === m) { results.push(elem); return results; } } // Speed-up: Sizzle("TAG") } else if (match[2]) { push.apply(results, context.getElementsByTagName(selector)); return results; // Speed-up: Sizzle(".CLASS") } else if ((m = match[3]) && support.getElementsByClassName && context.getElementsByClassName) { push.apply(results, context.getElementsByClassName(m)); return results; } } // QSA path if (support.qsa && (!rbuggyQSA || !rbuggyQSA.test(selector))) { nid = old = expando; newContext = context; newSelector = nodeType === 9 && selector; // qSA works strangely on Element-rooted queries // We can work around this by specifying an extra ID on the root // and working up from there (Thanks to Andrew Dupont for the technique) // IE 8 doesn't work on object elements if (nodeType === 1 && context.nodeName.toLowerCase() !== "object") { groups = tokenize(selector); if ((old = context.getAttribute("id"))) { nid = old.replace(rescape, "\\$&"); } else { context.setAttribute("id", nid); } nid = "[id='" + nid + "'] "; i = groups.length; while (i--) { groups[i] = nid + toSelector(groups[i]); } newContext = rsibling.test(selector) && context.parentNode || context; newSelector = groups.join(","); } if (newSelector) { try { push.apply(results, newContext.querySelectorAll(newSelector)); return results; } catch (qsaError) {} finally { if (!old) { context.removeAttribute("id"); } } } } } // All others return select(selector.replace(rtrim, "$1"), context, results, seed); } /** * Create key-value caches of limited size * @returns {Function(string, Object)} Returns the Object data after storing it on itself with * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) * deleting the oldest entry */ function createCache() { var keys = []; function cache(key, value) { // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) if (keys.push(key += " ") > Expr.cacheLength) { // Only keep the most recent entries delete cache[keys.shift()]; } return (cache[key] = value); } return cache; } /** * Mark a function for special use by Sizzle * @param {Function} fn The function to mark */ function markFunction(fn) { fn[expando] = true; return fn; } /** * Support testing using an element * @param {Function} fn Passed the created div and expects a boolean result */ function assert(fn) { var div = document.createElement("div"); try { return !!fn(div); } catch (e) { return false; } finally { // Remove from its parent by default if (div.parentNode) { div.parentNode.removeChild(div); } // release memory in IE div = null; } } /** * Adds the same handler for all of the specified attrs * @param {String} attrs Pipe-separated list of attributes * @param {Function} handler The method that will be applied */ function addHandle(attrs, handler) { var arr = attrs.split("|"), i = attrs.length; while (i--) { Expr.attrHandle[arr[i]] = handler; } } /** * Checks document order of two siblings * @param {Element} a * @param {Element} b * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b */ function siblingCheck(a, b) { var cur = b && a, diff = cur && a.nodeType === 1 && b.nodeType === 1 && (~b.sourceIndex || MAX_NEGATIVE) - (~a.sourceIndex || MAX_NEGATIVE); // Use IE sourceIndex if available on both nodes if (diff) { return diff; } // Check if b follows a if (cur) { while ((cur = cur.nextSibling)) { if (cur === b) { return -1; } } } return a ? 1 : -1; } /** * Returns a function to use in pseudos for input types * @param {String} type */ function createInputPseudo(type) { return function(elem) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === type; }; } /** * Returns a function to use in pseudos for buttons * @param {String} type */ function createButtonPseudo(type) { return function(elem) { var name = elem.nodeName.toLowerCase(); return (name === "input" || name === "button") && elem.type === type; }; } /** * Returns a function to use in pseudos for positionals * @param {Function} fn */ function createPositionalPseudo(fn) { return markFunction(function(argument) { argument = +argument; return markFunction(function(seed, matches) { var j, matchIndexes = fn([], seed.length, argument), i = matchIndexes.length; // Match elements found at the specified indexes while (i--) { if (seed[(j = matchIndexes[i])]) { seed[j] = !(matches[j] = seed[j]); } } }); }); } /** * Detect xml * @param {Element|Object} elem An element or a document */ isXML = Sizzle.isXML = function(elem) { // documentElement is verified for cases where it doesn't yet exist // (such as loading iframes in IE - #4833) var documentElement = elem && (elem.ownerDocument || elem).documentElement; return documentElement ? documentElement.nodeName !== "HTML" : false; }; // Expose support vars for convenience support = Sizzle.support = {}; /** * Sets document-related variables once based on the current document * @param {Element|Object} [doc] An element or document object to use to set the document * @returns {Object} Returns the current document */ setDocument = Sizzle.setDocument = function(node) { var doc = node ? node.ownerDocument || node : preferredDoc, parent = doc.defaultView; // If no document and documentElement is available, return if (doc === document || doc.nodeType !== 9 || !doc.documentElement) { return document; } // Set our document document = doc; docElem = doc.documentElement; // Support tests documentIsHTML = !isXML(doc); // Support: IE>8 // If iframe document is assigned to "document" variable and if iframe has been reloaded, // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936 // IE6-8 do not support the defaultView property so parent will be undefined if (parent && parent.attachEvent && parent !== parent.top) { parent.attachEvent("onbeforeunload", function() { setDocument(); }); } /* Attributes ---------------------------------------------------------------------- */ // Support: IE<8 // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans) support.attributes = assert(function(div) { div.className = "i"; return !div.getAttribute("className"); }); /* getElement(s)By* ---------------------------------------------------------------------- */ // Check if getElementsByTagName("*") returns only elements support.getElementsByTagName = assert(function(div) { div.appendChild(doc.createComment("")); return !div.getElementsByTagName("*").length; }); // Check if getElementsByClassName can be trusted support.getElementsByClassName = assert(function(div) { div.innerHTML = "<div class='a'></div><div class='a i'></div>"; // Support: Safari<4 // Catch class over-caching div.firstChild.className = "i"; // Support: Opera<10 // Catch gEBCN failure to find non-leading classes return div.getElementsByClassName("i").length === 2; }); // Support: IE<10 // Check if getElementById returns elements by name // The broken getElementById methods don't pick up programatically-set names, // so use a roundabout getElementsByName test support.getById = assert(function(div) { docElem.appendChild(div).id = expando; return !doc.getElementsByName || !doc.getElementsByName(expando).length; }); // ID find and filter if (support.getById) { Expr.find["ID"] = function(id, context) { if (typeof context.getElementById !== strundefined && documentIsHTML) { var m = context.getElementById(id); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 return m && m.parentNode ? [m] : []; } }; Expr.filter["ID"] = function(id) { var attrId = id.replace(runescape, funescape); return function(elem) { return elem.getAttribute("id") === attrId; }; }; } else { // Support: IE6/7 // getElementById is not reliable as a find shortcut delete Expr.find["ID"]; Expr.filter["ID"] = function(id) { var attrId = id.replace(runescape, funescape); return function(elem) { var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); return node && node.value === attrId; }; }; } // Tag Expr.find["TAG"] = support.getElementsByTagName ? function(tag, context) { if (typeof context.getElementsByTagName !== strundefined) { return context.getElementsByTagName(tag); } } : function(tag, context) { var elem, tmp = [], i = 0, results = context.getElementsByTagName(tag); // Filter out possible comments if (tag === "*") { while ((elem = results[i++])) { if (elem.nodeType === 1) { tmp.push(elem); } } return tmp; } return results; }; // Class Expr.find["CLASS"] = support.getElementsByClassName && function(className, context) { if (typeof context.getElementsByClassName !== strundefined && documentIsHTML) { return context.getElementsByClassName(className); } }; /* QSA/matchesSelector ---------------------------------------------------------------------- */ // QSA and matchesSelector support // matchesSelector(:active) reports false when true (IE9/Opera 11.5) rbuggyMatches = []; // qSa(:focus) reports false when true (Chrome 21) // We allow this because of a bug in IE8/9 that throws an error // whenever `document.activeElement` is accessed on an iframe // So, we allow :focus to pass through QSA all the time to avoid the IE error // See http://bugs.jquery.com/ticket/13378 rbuggyQSA = []; if ((support.qsa = rnative.test(doc.querySelectorAll))) { // Build QSA regex // Regex strategy adopted from Diego Perini assert(function(div) { // Select is set to empty string on purpose // This is to test IE's treatment of not explicitly // setting a boolean content attribute, // since its presence should be enough // http://bugs.jquery.com/ticket/12359 div.innerHTML = "<select><option selected=''></option></select>"; // Support: IE8 // Boolean attributes and "value" are not treated correctly if (!div.querySelectorAll("[selected]").length) { rbuggyQSA.push("\\[" + whitespace + "*(?:value|" + booleans + ")"); } // Webkit/Opera - :checked should return selected option elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked // IE8 throws error here and will not see later tests if (!div.querySelectorAll(":checked").length) { rbuggyQSA.push(":checked"); } }); assert(function(div) { // Support: Opera 10-12/IE8 // ^= $= *= and empty values // Should not select anything // Support: Windows 8 Native Apps // The type attribute is restricted during .innerHTML assignment var input = doc.createElement("input"); input.setAttribute("type", "hidden"); div.appendChild(input).setAttribute("t", ""); if (div.querySelectorAll("[t^='']").length) { rbuggyQSA.push("[*^$]=" + whitespace + "*(?:''|\"\")"); } // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) // IE8 throws error here and will not see later tests if (!div.querySelectorAll(":enabled").length) { rbuggyQSA.push(":enabled", ":disabled"); } // Opera 10-11 does not throw on post-comma invalid pseudos div.querySelectorAll("*,:x"); rbuggyQSA.push(",.*:"); }); } if ((support.matchesSelector = rnative.test((matches = docElem.webkitMatchesSelector || docElem.mozMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector)))) { assert(function(div) { // Check to see if it's possible to do matchesSelector // on a disconnected node (IE 9) support.disconnectedMatch = matches.call(div, "div"); // This should fail with an exception // Gecko does not error, returns false instead matches.call(div, "[s!='']:x"); rbuggyMatches.push("!=", pseudos); }); } rbuggyQSA = rbuggyQSA.length && new RegExp(rbuggyQSA.join("|")); rbuggyMatches = rbuggyMatches.length && new RegExp(rbuggyMatches.join("|")); /* Contains ---------------------------------------------------------------------- */ // Element contains another // Purposefully does not implement inclusive descendent // As in, an element does not contain itself contains = rnative.test(docElem.contains) || docElem.compareDocumentPosition ? function(a, b) { var adown = a.nodeType === 9 ? a.documentElement : a, bup = b && b.parentNode; return a === bup || !! (bup && bup.nodeType === 1 && ( adown.contains ? adown.contains(bup) : a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16)); } : function(a, b) { if (b) { while ((b = b.parentNode)) { if (b === a) { return true; } } } return false; }; /* Sorting ---------------------------------------------------------------------- */ // Document order sorting sortOrder = docElem.compareDocumentPosition ? function(a, b) { // Flag for duplicate removal if (a === b) { hasDuplicate = true; return 0; } var compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition(b); if (compare) { // Disconnected nodes if (compare & 1 || (!support.sortDetached && b.compareDocumentPosition(a) === compare)) { // Choose the first element that is related to our preferred document if (a === doc || contains(preferredDoc, a)) { return -1; } if (b === doc || contains(preferredDoc, b)) { return 1; } // Maintain original order return sortInput ? (indexOf.call(sortInput, a) - indexOf.call(sortInput, b)) : 0; } return compare & 4 ? -1 : 1; } // Not directly comparable, sort on existence of method return a.compareDocumentPosition ? -1 : 1; } : function(a, b) { var cur, i = 0, aup = a.parentNode, bup = b.parentNode, ap = [a], bp = [b]; // Exit early if the nodes are identical if (a === b) { hasDuplicate = true; return 0; // Parentless nodes are either documents or disconnected } else if (!aup || !bup) { return a === doc ? -1 : b === doc ? 1 : aup ? -1 : bup ? 1 : sortInput ? (indexOf.call(sortInput, a) - indexOf.call(sortInput, b)) : 0; // If the nodes are siblings, we can do a quick check } else if (aup === bup) { return siblingCheck(a, b); } // Otherwise we need full lists of their ancestors for comparison cur = a; while ((cur = cur.parentNode)) { ap.unshift(cur); } cur = b; while ((cur = cur.parentNode)) { bp.unshift(cur); } // Walk down the tree looking for a discrepancy while (ap[i] === bp[i]) { i++; } return i ? // Do a sibling check if the nodes have a common ancestor siblingCheck(ap[i], bp[i]) : // Otherwise nodes in our document sort first ap[i] === preferredDoc ? -1 : bp[i] === preferredDoc ? 1 : 0; }; return doc; }; Sizzle.matches = function(expr, elements) { return Sizzle(expr, null, null, elements); }; Sizzle.matchesSelector = function(elem, expr) { // Set document vars if needed if ((elem.ownerDocument || elem) !== document) { setDocument(elem); } // Make sure that attribute selectors are quoted expr = expr.replace(rattributeQuotes, "='$1']"); if (support.matchesSelector && documentIsHTML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && (!rbuggyQSA || !rbuggyQSA.test(expr))) { try { var ret = matches.call(elem, expr); // IE 9's matchesSelector returns false on disconnected nodes if (ret || support.disconnectedMatch || // As well, disconnected nodes are said to be in a document // fragment in IE 9 elem.document && elem.document.nodeType !== 11) { return ret; } } catch (e) {} } return Sizzle(expr, document, null, [elem]).length > 0; }; Sizzle.contains = function(context, elem) { // Set document vars if needed if ((context.ownerDocument || context) !== document) { setDocument(context); } return contains(context, elem); }; Sizzle.attr = function(elem, name) { // Set document vars if needed if ((elem.ownerDocument || elem) !== document) { setDocument(elem); } var fn = Expr.attrHandle[name.toLowerCase()], // Don't get fooled by Object.prototype properties (jQuery #13807) val = fn && hasOwn.call(Expr.attrHandle, name.toLowerCase()) ? fn(elem, name, !documentIsHTML) : undefined; return val === undefined ? support.attributes || !documentIsHTML ? elem.getAttribute(name) : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null : val; }; Sizzle.error = function(msg) { throw new Error("Syntax error, unrecognized expression: " + msg); }; /** * Document sorting and removing duplicates * @param {ArrayLike} results */ Sizzle.uniqueSort = function(results) { var elem, duplicates = [], j = 0, i = 0; // Unless we *know* we can detect duplicates, assume their presence hasDuplicate = !support.detectDuplicates; sortInput = !support.sortStable && results.slice(0); results.sort(sortOrder); if (hasDuplicate) { while ((elem = results[i++])) { if (elem === results[i]) { j = duplicates.push(i); } } while (j--) { results.splice(duplicates[j], 1); } } return results; }; /** * Utility function for retrieving the text value of an array of DOM nodes * @param {Array|Element} elem */ getText = Sizzle.getText = function(elem) { var node, ret = "", i = 0, nodeType = elem.nodeType; if (!nodeType) { // If no nodeType, this is expected to be an array for (; (node = elem[i]); i++) { // Do not traverse comment nodes ret += getText(node); } } else if (nodeType === 1 || nodeType === 9 || nodeType === 11) { // Use textContent for elements // innerText usage removed for consistency of new lines (see #11153) if (typeof elem.textContent === "string") { return elem.textContent; } else { // Traverse its children for (elem = elem.firstChild; elem; elem = elem.nextSibling) { ret += getText(elem); } } } else if (nodeType === 3 || nodeType === 4) { return elem.nodeValue; } // Do not include comment or processing instruction nodes return ret; }; Expr = Sizzle.selectors = { // Can be adjusted by the user cacheLength: 50, createPseudo: markFunction, match: matchExpr, attrHandle: {}, find: {}, relative: { ">": { dir: "parentNode", first: true }, " ": { dir: "parentNode" }, "+": { dir: "previousSibling", first: true }, "~": { dir: "previousSibling" } }, preFilter: { "ATTR": function(match) { match[1] = match[1].replace(runescape, funescape); // Move the given value to match[3] whether quoted or unquoted match[3] = (match[4] || match[5] || "").replace(runescape, funescape); if (match[2] === "~=") { match[3] = " " + match[3] + " "; } return match.slice(0, 4); }, "CHILD": function(match) { /* matches from matchExpr["CHILD"] 1 type (only|nth|...) 2 what (child|of-type) 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 4 xn-component of xn+y argument ([+-]?\d*n|) 5 sign of xn-component 6 x of xn-component 7 sign of y-component 8 y of y-component */ match[1] = match[1].toLowerCase(); if (match[1].slice(0, 3) === "nth") { // nth-* requires argument if (!match[3]) { Sizzle.error(match[0]); } // numeric x and y parameters for Expr.filter.CHILD // remember that false/true cast respectively to 0/1 match[4] = +(match[4] ? match[5] + (match[6] || 1) : 2 * (match[3] === "even" || match[3] === "odd")); match[5] = +((match[7] + match[8]) || match[3] === "odd"); // other types prohibit arguments } else if (match[3]) { Sizzle.error(match[0]); } return match; }, "PSEUDO": function(match) { var excess, unquoted = !match[5] && match[2]; if (matchExpr["CHILD"].test(match[0])) { return null; } // Accept quoted arguments as-is if (match[3] && match[4] !== undefined) { match[2] = match[4]; // Strip excess characters from unquoted arguments } else if (unquoted && rpseudo.test(unquoted) && // Get excess from tokenize (recursively) (excess = tokenize(unquoted, true)) && // advance to the next closing parenthesis (excess = unquoted.indexOf(")", unquoted.length - excess) - unquoted.length)) { // excess is a negative index match[0] = match[0].slice(0, excess); match[2] = unquoted.slice(0, excess); } // Return only captures needed by the pseudo filter method (type and argument) return match.slice(0, 3); } }, filter: { "TAG": function(nodeNameSelector) { var nodeName = nodeNameSelector.replace(runescape, funescape).toLowerCase(); return nodeNameSelector === "*" ? function() { return true; } : function(elem) { return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; }; }, "CLASS": function(className) { var pattern = classCache[className + " "]; return pattern || (pattern = new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)")) && classCache(className, function(elem) { return pattern.test(typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || ""); }); }, "ATTR": function(name, operator, check) { return function(elem) { var result = Sizzle.attr(elem, name); if (result == null) { return operator === "!="; } if (!operator) { return true; } result += ""; return operator === "=" ? result === check : operator === "!=" ? result !== check : operator === "^=" ? check && result.indexOf(check) === 0 : operator === "*=" ? check && result.indexOf(check) > -1 : operator === "$=" ? check && result.slice(-check.length) === check : operator === "~=" ? (" " + result + " ").indexOf(check) > -1 : operator === "|=" ? result === check || result.slice(0, check.length + 1) === check + "-" : false; }; }, "CHILD": function(type, what, argument, first, last) { var simple = type.slice(0, 3) !== "nth", forward = type.slice(-4) !== "last", ofType = what === "of-type"; return first === 1 && last === 0 ? // Shortcut for :nth-*(n) function(elem) { return !!elem.parentNode; } : function(elem, context, xml) { var cache, outerCache, node, diff, nodeIndex, start, dir = simple !== forward ? "nextSibling" : "previousSibling", parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType; if (parent) { // :(first|last|only)-(child|of-type) if (simple) { while (dir) { node = elem; while ((node = node[dir])) { if (ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1) { return false; } } // Reverse direction for :only-* (if we haven't yet done so) start = dir = type === "only" && !start && "nextSibling"; } return true; } start = [forward ? parent.firstChild : parent.lastChild]; // non-xml :nth-child(...) stores cache data on `parent` if (forward && useCache) { // Seek `elem` from a previously-cached index outerCache = parent[expando] || (parent[expando] = {}); cache = outerCache[type] || []; nodeIndex = cache[0] === dirruns && cache[1]; diff = cache[0] === dirruns && cache[2]; node = nodeIndex && parent.childNodes[nodeIndex]; while ((node = ++nodeIndex && node && node[dir] || // Fallback to seeking `elem` from the start (diff = nodeIndex = 0) || start.pop())) { // When found, cache indexes on `parent` and break if (node.nodeType === 1 && ++diff && node === elem) { outerCache[type] = [dirruns, nodeIndex, diff]; break; } } // Use previously-cached element index if available } else if (useCache && (cache = (elem[expando] || (elem[expando] = {}))[type]) && cache[0] === dirruns) { diff = cache[1]; // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) } else { // Use the same loop as above to seek `elem` from the start while ((node = ++nodeIndex && node && node[dir] || (diff = nodeIndex = 0) || start.pop())) { if ((ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1) && ++diff) { // Cache the index of each encountered element if (useCache) { (node[expando] || (node[expando] = {}))[type] = [dirruns, diff]; } if (node === elem) { break; } } } } // Incorporate the offset, then check against cycle size diff -= last; return diff === first || (diff % first === 0 && diff / first >= 0); } }; }, "PSEUDO": function(pseudo, argument) { // pseudo-class names are case-insensitive // http://www.w3.org/TR/selectors/#pseudo-classes // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters // Remember that setFilters inherits from pseudos var args, fn = Expr.pseudos[pseudo] || Expr.setFilters[pseudo.toLowerCase()] || Sizzle.error("unsupported pseudo: " + pseudo); // The user may use createPseudo to indicate that // arguments are needed to create the filter function // just as Sizzle does if (fn[expando]) { return fn(argument); } // But maintain support for old signatures if (fn.length > 1) { args = [pseudo, pseudo, "", argument]; return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase()) ? markFunction(function(seed, matches) { var idx, matched = fn(seed, argument), i = matched.length; while (i--) { idx = indexOf.call(seed, matched[i]); seed[idx] = !(matches[idx] = matched[i]); } }) : function(elem) { return fn(elem, 0, args); }; } return fn; } }, pseudos: { // Potentially complex pseudos "not": markFunction(function(selector) { // Trim the selector passed to compile // to avoid treating leading and trailing // spaces as combinators var input = [], results = [], matcher = compile(selector.replace(rtrim, "$1")); return matcher[expando] ? markFunction(function(seed, matches, context, xml) { var elem, unmatched = matcher(seed, null, xml, []), i = seed.length; // Match elements unmatched by `matcher` while (i--) { if ((elem = unmatched[i])) { seed[i] = !(matches[i] = elem); } } }) : function(elem, context, xml) { input[0] = elem; matcher(input, null, xml, results); return !results.pop(); }; }), "has": markFunction(function(selector) { return function(elem) { return Sizzle(selector, elem).length > 0; }; }), "contains": markFunction(function(text) { return function(elem) { return (elem.textContent || elem.innerText || getText(elem)).indexOf(text) > -1; }; }), // "Whether an element is represented by a :lang() selector // is based solely on the element's language value // being equal to the identifier C, // or beginning with the identifier C immediately followed by "-". // The matching of C against the element's language value is performed case-insensitively. // The identifier C does not have to be a valid language name." // http://www.w3.org/TR/selectors/#lang-pseudo "lang": markFunction(function(lang) { // lang value must be a valid identifier if (!ridentifier.test(lang || "")) { Sizzle.error("unsupported lang: " + lang); } lang = lang.replace(runescape, funescape).toLowerCase(); return function(elem) { var elemLang; do { if ((elemLang = documentIsHTML ? elem.lang : elem.getAttribute("xml:lang") || elem.getAttribute("lang"))) { elemLang = elemLang.toLowerCase(); return elemLang === lang || elemLang.indexOf(lang + "-") === 0; } } while ((elem = elem.parentNode) && elem.nodeType === 1); return false; }; }), // Miscellaneous "target": function(elem) { var hash = window.location && window.location.hash; return hash && hash.slice(1) === elem.id; }, "root": function(elem) { return elem === docElem; }, "focus": function(elem) { return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !! (elem.type || elem.href || ~elem.tabIndex); }, // Boolean properties "enabled": function(elem) { return elem.disabled === false; }, "disabled": function(elem) { return elem.disabled === true; }, "checked": function(elem) { // In CSS3, :checked should return both checked and selected elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked var nodeName = elem.nodeName.toLowerCase(); return (nodeName === "input" && !! elem.checked) || (nodeName === "option" && !! elem.selected); }, "selected": function(elem) { // Accessing this property makes selected-by-default // options in Safari work properly if (elem.parentNode) { elem.parentNode.selectedIndex; } return elem.selected === true; }, // Contents "empty": function(elem) { // http://www.w3.org/TR/selectors/#empty-pseudo // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)), // not comment, processing instructions, or others // Thanks to Diego Perini for the nodeName shortcut // Greater than "@" means alpha characters (specifically not starting with "#" or "?") for (elem = elem.firstChild; elem; elem = elem.nextSibling) { if (elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4) { return false; } } return true; }, "parent": function(elem) { return !Expr.pseudos["empty"](elem); }, // Element/input types "header": function(elem) { return rheader.test(elem.nodeName); }, "input": function(elem) { return rinputs.test(elem.nodeName); }, "button": function(elem) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === "button" || name === "button"; }, "text": function(elem) { var attr; // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) // use getAttribute instead to test this case return elem.nodeName.toLowerCase() === "input" && elem.type === "text" && ((attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type); }, // Position-in-collection "first": createPositionalPseudo(function() { return [0]; }), "last": createPositionalPseudo(function(matchIndexes, length) { return [length - 1]; }), "eq": createPositionalPseudo(function(matchIndexes, length, argument) { return [argument < 0 ? argument + length : argument]; }), "even": createPositionalPseudo(function(matchIndexes, length) { var i = 0; for (; i < length; i += 2) { matchIndexes.push(i); } return matchIndexes; }), "odd": createPositionalPseudo(function(matchIndexes, length) { var i = 1; for (; i < length; i += 2) { matchIndexes.push(i); } return matchIndexes; }), "lt": createPositionalPseudo(function(matchIndexes, length, argument) { var i = argument < 0 ? argument + length : argument; for (; --i >= 0;) { matchIndexes.push(i); } return matchIndexes; }), "gt": createPositionalPseudo(function(matchIndexes, length, argument) { var i = argument < 0 ? argument + length : argument; for (; ++i < length;) { matchIndexes.push(i); } return matchIndexes; }) } }; Expr.pseudos["nth"] = Expr.pseudos["eq"]; // Add button/input type pseudos for (i in { radio: true, checkbox: true, file: true, password: true, image: true }) { Expr.pseudos[i] = createInputPseudo(i); } for (i in { submit: true, reset: true }) { Expr.pseudos[i] = createButtonPseudo(i); } // Easy API for creating new setFilters function setFilters() {} setFilters.prototype = Expr.filters = Expr.pseudos; Expr.setFilters = new setFilters(); function tokenize(selector, parseOnly) { var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[selector + " "]; if (cached) { return parseOnly ? 0 : cached.slice(0); } soFar = selector; groups = []; preFilters = Expr.preFilter; while (soFar) { // Comma and first run if (!matched || (match = rcomma.exec(soFar))) { if (match) { // Don't consume trailing commas as valid soFar = soFar.slice(match[0].length) || soFar; } groups.push(tokens = []); } matched = false; // Combinators if ((match = rcombinators.exec(soFar))) { matched = match.shift(); tokens.push({ value: matched, // Cast descendant combinators to space type: match[0].replace(rtrim, " ") }); soFar = soFar.slice(matched.length); } // Filters for (type in Expr.filter) { if ((match = matchExpr[type].exec(soFar)) && (!preFilters[type] || (match = preFilters[type](match)))) { matched = match.shift(); tokens.push({ value: matched, type: type, matches: match }); soFar = soFar.slice(matched.length); } } if (!matched) { break; } } // Return the length of the invalid excess // if we're just parsing // Otherwise, throw an error or return tokens return parseOnly ? soFar.length : soFar ? Sizzle.error(selector) : // Cache the tokens tokenCache(selector, groups).slice(0); } function toSelector(tokens) { var i = 0, len = tokens.length, selector = ""; for (; i < len; i++) { selector += tokens[i].value; } return selector; } function addCombinator(matcher, combinator, base) { var dir = combinator.dir, checkNonElements = base && dir === "parentNode", doneName = done++; return combinator.first ? // Check against closest ancestor/preceding element function(elem, context, xml) { while ((elem = elem[dir])) { if (elem.nodeType === 1 || checkNonElements) { return matcher(elem, context, xml); } } } : // Check against all ancestor/preceding elements function(elem, context, xml) { var data, cache, outerCache, dirkey = dirruns + " " + doneName; // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching if (xml) { while ((elem = elem[dir])) { if (elem.nodeType === 1 || checkNonElements) { if (matcher(elem, context, xml)) { return true; } } } } else { while ((elem = elem[dir])) { if (elem.nodeType === 1 || checkNonElements) { outerCache = elem[expando] || (elem[expando] = {}); if ((cache = outerCache[dir]) && cache[0] === dirkey) { if ((data = cache[1]) === true || data === cachedruns) { return data === true; } } else { cache = outerCache[dir] = [dirkey]; cache[1] = matcher(elem, context, xml) || cachedruns; if (cache[1] === true) { return true; } } } } } }; } function elementMatcher(matchers) { return matchers.length > 1 ? function(elem, context, xml) { var i = matchers.length; while (i--) { if (!matchers[i](elem, context, xml)) { return false; } } return true; } : matchers[0]; } function condense(unmatched, map, filter, context, xml) { var elem, newUnmatched = [], i = 0, len = unmatched.length, mapped = map != null; for (; i < len; i++) { if ((elem = unmatched[i])) { if (!filter || filter(elem, context, xml)) { newUnmatched.push(elem); if (mapped) { map.push(i); } } } } return newUnmatched; } function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) { if (postFilter && !postFilter[expando]) { postFilter = setMatcher(postFilter); } if (postFinder && !postFinder[expando]) { postFinder = setMatcher(postFinder, postSelector); } return markFunction(function(seed, results, context, xml) { var temp, i, elem, preMap = [], postMap = [], preexisting = results.length, // Get initial elements from seed or context elems = seed || multipleContexts(selector || "*", context.nodeType ? [context] : context, []), // Prefilter to get matcher input, preserving a map for seed-results synchronization matcherIn = preFilter && (seed || !selector) ? condense(elems, preMap, preFilter, context, xml) : elems, matcherOut = matcher ? // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, postFinder || (seed ? preFilter : preexisting || postFilter) ? // ...intermediate processing is necessary [] : // ...otherwise use results directly results : matcherIn; // Find primary matches if (matcher) { matcher(matcherIn, matcherOut, context, xml); } // Apply postFilter if (postFilter) { temp = condense(matcherOut, postMap); postFilter(temp, [], context, xml); // Un-match failing elements by moving them back to matcherIn i = temp.length; while (i--) { if ((elem = temp[i])) { matcherOut[postMap[i]] = !(matcherIn[postMap[i]] = elem); } } } if (seed) { if (postFinder || preFilter) { if (postFinder) { // Get the final matcherOut by condensing this intermediate into postFinder contexts temp = []; i = matcherOut.length; while (i--) { if ((elem = matcherOut[i])) { // Restore matcherIn since elem is not yet a final match temp.push((matcherIn[i] = elem)); } } postFinder(null, (matcherOut = []), temp, xml); } // Move matched elements from seed to results to keep them synchronized i = matcherOut.length; while (i--) { if ((elem = matcherOut[i]) && (temp = postFinder ? indexOf.call(seed, elem) : preMap[i]) > -1) { seed[temp] = !(results[temp] = elem); } } } // Add elements to results, through postFinder if defined } else { matcherOut = condense( matcherOut === results ? matcherOut.splice(preexisting, matcherOut.length) : matcherOut); if (postFinder) { postFinder(null, results, matcherOut, xml); } else { push.apply(results, matcherOut); } } }); } function matcherFromTokens(tokens) { var checkContext, matcher, j, len = tokens.length, leadingRelative = Expr.relative[tokens[0].type], implicitRelative = leadingRelative || Expr.relative[" "], i = leadingRelative ? 1 : 0, // The foundational matcher ensures that elements are reachable from top-level context(s) matchContext = addCombinator(function(elem) { return elem === checkContext; }, implicitRelative, true), matchAnyContext = addCombinator(function(elem) { return indexOf.call(checkContext, elem) > -1; }, implicitRelative, true), matchers = [function(elem, context, xml) { return (!leadingRelative && (xml || context !== outermostContext)) || ( (checkContext = context).nodeType ? matchContext(elem, context, xml) : matchAnyContext(elem, context, xml)); }]; for (; i < len; i++) { if ((matcher = Expr.relative[tokens[i].type])) { matchers = [addCombinator(elementMatcher(matchers), matcher)]; } else { matcher = Expr.filter[tokens[i].type].apply(null, tokens[i].matches); // Return special upon seeing a positional matcher if (matcher[expando]) { // Find the next relative operator (if any) for proper handling j = ++i; for (; j < len; j++) { if (Expr.relative[tokens[j].type]) { break; } } return setMatcher( i > 1 && elementMatcher(matchers), i > 1 && toSelector( // If the preceding token was a descendant combinator, insert an implicit any-element `*` tokens.slice(0, i - 1).concat({ value: tokens[i - 2].type === " " ? "*" : "" })).replace(rtrim, "$1"), matcher, i < j && matcherFromTokens(tokens.slice(i, j)), j < len && matcherFromTokens((tokens = tokens.slice(j))), j < len && toSelector(tokens)); } matchers.push(matcher); } } return elementMatcher(matchers); } function matcherFromGroupMatchers(elementMatchers, setMatchers) { // A counter to specify which element is currently being matched var matcherCachedRuns = 0, bySet = setMatchers.length > 0, byElement = elementMatchers.length > 0, superMatcher = function(seed, context, xml, results, expandContext) { var elem, j, matcher, setMatched = [], matchedCount = 0, i = "0", unmatched = seed && [], outermost = expandContext != null, contextBackup = outermostContext, // We must always have either seed elements or context elems = seed || byElement && Expr.find["TAG"]("*", expandContext && context.parentNode || context), // Use integer dirruns iff this is the outermost matcher dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1); if (outermost) { outermostContext = context !== document && context; cachedruns = matcherCachedRuns; } // Add elements passing elementMatchers directly to results // Keep `i` a string if there are no elements so `matchedCount` will be "00" below for (; (elem = elems[i]) != null; i++) { if (byElement && elem) { j = 0; while ((matcher = elementMatchers[j++])) { if (matcher(elem, context, xml)) { results.push(elem); break; } } if (outermost) { dirruns = dirrunsUnique; cachedruns = ++matcherCachedRuns; } } // Track unmatched elements for set filters if (bySet) { // They will have gone through all possible matchers if ((elem = !matcher && elem)) { matchedCount--; } // Lengthen the array for every element, matched or not if (seed) { unmatched.push(elem); } } } // Apply set filters to unmatched elements matchedCount += i; if (bySet && i !== matchedCount) { j = 0; while ((matcher = setMatchers[j++])) { matcher(unmatched, setMatched, context, xml); } if (seed) { // Reintegrate element matches to eliminate the need for sorting if (matchedCount > 0) { while (i--) { if (!(unmatched[i] || setMatched[i])) { setMatched[i] = pop.call(results); } } } // Discard index placeholder values to get only actual matches setMatched = condense(setMatched); } // Add matches to results push.apply(results, setMatched); // Seedless set matches succeeding multiple successful matchers stipulate sorting if (outermost && !seed && setMatched.length > 0 && (matchedCount + setMatchers.length) > 1) { Sizzle.uniqueSort(results); } } // Override manipulation of globals by nested matchers if (outermost) { dirruns = dirrunsUnique; outermostContext = contextBackup; } return unmatched; }; return bySet ? markFunction(superMatcher) : superMatcher; } compile = Sizzle.compile = function(selector, group /* Internal Use Only */ ) { var i, setMatchers = [], elementMatchers = [], cached = compilerCache[selector + " "]; if (!cached) { // Generate a function of recursive functions that can be used to check each element if (!group) { group = tokenize(selector); } i = group.length; while (i--) { cached = matcherFromTokens(group[i]); if (cached[expando]) { setMatchers.push(cached); } else { elementMatchers.push(cached); } } // Cache the compiled function cached = compilerCache(selector, matcherFromGroupMatchers(elementMatchers, setMatchers)); } return cached; }; function multipleContexts(selector, contexts, results) { var i = 0, len = contexts.length; for (; i < len; i++) { Sizzle(selector, contexts[i], results); } return results; } function select(selector, context, results, seed) { var i, tokens, token, type, find, match = tokenize(selector); if (!seed) { // Try to minimize operations if there is only one group if (match.length === 1) { // Take a shortcut and set the context if the root selector is an ID tokens = match[0] = match[0].slice(0); if (tokens.length > 2 && (token = tokens[0]).type === "ID" && support.getById && context.nodeType === 9 && documentIsHTML && Expr.relative[tokens[1].type]) { context = (Expr.find["ID"](token.matches[0].replace(runescape, funescape), context) || [])[0]; if (!context) { return results; } selector = selector.slice(tokens.shift().value.length); } // Fetch a seed set for right-to-left matching i = matchExpr["needsContext"].test(selector) ? 0 : tokens.length; while (i--) { token = tokens[i]; // Abort if we hit a combinator if (Expr.relative[(type = token.type)]) { break; } if ((find = Expr.find[type])) { // Search, expanding context for leading sibling combinators if ((seed = find( token.matches[0].replace(runescape, funescape), rsibling.test(tokens[0].type) && context.parentNode || context))) { // If seed is empty or no tokens remain, we can return early tokens.splice(i, 1); selector = seed.length && toSelector(tokens); if (!selector) { push.apply(results, seed); return results; } break; } } } } } // Compile and execute a filtering function // Provide `match` to avoid retokenization if we modified the selector above compile(selector, match)( seed, context, !documentIsHTML, results, rsibling.test(selector)); return results; } // One-time assignments // Sort stability support.sortStable = expando.split("").sort(sortOrder).join("") === expando; // Support: Chrome<14 // Always assume duplicates if they aren't passed to the comparison function support.detectDuplicates = hasDuplicate; // Initialize against the default document setDocument(); // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) // Detached nodes confoundingly follow *each other* support.sortDetached = assert(function(div1) { // Should return 1, but returns 4 (following) return div1.compareDocumentPosition(document.createElement("div")) & 1; }); // Support: IE<8 // Prevent attribute/property "interpolation" // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx if (!assert(function(div) { div.innerHTML = "<a href='#'></a>"; return div.firstChild.getAttribute("href") === "#"; })) { addHandle("type|href|height|width", function(elem, name, isXML) { if (!isXML) { return elem.getAttribute(name, name.toLowerCase() === "type" ? 1 : 2); } }); } // Support: IE<9 // Use defaultValue in place of getAttribute("value") if (!support.attributes || !assert(function(div) { div.innerHTML = "<input/>"; div.firstChild.setAttribute("value", ""); return div.firstChild.getAttribute("value") === ""; })) { addHandle("value", function(elem, name, isXML) { if (!isXML && elem.nodeName.toLowerCase() === "input") { return elem.defaultValue; } }); } // Support: IE<9 // Use getAttributeNode to fetch booleans when getAttribute lies if (!assert(function(div) { return div.getAttribute("disabled") == null; })) { addHandle(booleans, function(elem, name, isXML) { var val; if (!isXML) { return (val = elem.getAttributeNode(name)) && val.specified ? val.value : elem[name] === true ? name.toLowerCase() : null; } }); } jQuery.find = Sizzle; jQuery.expr = Sizzle.selectors; jQuery.expr[":"] = jQuery.expr.pseudos; jQuery.unique = Sizzle.uniqueSort; jQuery.text = Sizzle.getText; jQuery.isXMLDoc = Sizzle.isXML; jQuery.contains = Sizzle.contains; })(window); // String to Object options format cache var optionsCache = {}; // Convert String-formatted options into Object-formatted ones and store in cache function createOptions(options) { var object = optionsCache[options] = {}; jQuery.each(options.match(core_rnotwhite) || [], function(_, flag) { object[flag] = true; }); return object; } /* * Create a callback list using the following parameters: * * options: an optional list of space-separated options that will change how * the callback list behaves or a more traditional option object * * By default a callback list will act like an event callback list and can be * "fired" multiple times. * * Possible options: * * once: will ensure the callback list can only be fired once (like a Deferred) * * memory: will keep track of previous values and will call any callback added * after the list has been fired right away with the latest "memorized" * values (like a Deferred) * * unique: will ensure a callback can only be added once (no duplicate in the list) * * stopOnFalse: interrupt callings when a callback returns false * */ jQuery.Callbacks = function(options) { // Convert options from String-formatted to Object-formatted if needed // (we check in cache first) options = typeof options === "string" ? (optionsCache[options] || createOptions(options)) : jQuery.extend({}, options); var // Flag to know if list is currently firing firing, // Last fire value (for non-forgettable lists) memory, // Flag to know if list was already fired fired, // End of the loop when firing firingLength, // Index of currently firing callback (modified by remove if needed) firingIndex, // First callback to fire (used internally by add and fireWith) firingStart, // Actual callback list list = [], // Stack of fire calls for repeatable lists stack = !options.once && [], // Fire callbacks fire = function(data) { memory = options.memory && data; fired = true; firingIndex = firingStart || 0; firingStart = 0; firingLength = list.length; firing = true; for (; list && firingIndex < firingLength; firingIndex++) { if (list[firingIndex].apply(data[0], data[1]) === false && options.stopOnFalse) { memory = false; // To prevent further calls using add break; } } firing = false; if (list) { if (stack) { if (stack.length) { fire(stack.shift()); } } else if (memory) { list = []; } else { self.disable(); } } }, // Actual Callbacks object self = { // Add a callback or a collection of callbacks to the list add: function() { if (list) { // First, we save the current length var start = list.length; (function add(args) { jQuery.each(args, function(_, arg) { var type = jQuery.type(arg); if (type === "function") { if (!options.unique || !self.has(arg)) { list.push(arg); } } else if (arg && arg.length && type !== "string") { // Inspect recursively add(arg); } }); })(arguments); // Do we need to add the callbacks to the // current firing batch? if (firing) { firingLength = list.length; // With memory, if we're not firing then // we should call right away } else if (memory) { firingStart = start; fire(memory); } } return this; }, // Remove a callback from the list remove: function() { if (list) { jQuery.each(arguments, function(_, arg) { var index; while ((index = jQuery.inArray(arg, list, index)) > -1) { list.splice(index, 1); // Handle firing indexes if (firing) { if (index <= firingLength) { firingLength--; } if (index <= firingIndex) { firingIndex--; } } } }); } return this; }, // Check if a given callback is in the list. // If no argument is given, return whether or not list has callbacks attached. has: function(fn) { return fn ? jQuery.inArray(fn, list) > -1 : !! (list && list.length); }, // Remove all callbacks from the list empty: function() { list = []; firingLength = 0; return this; }, // Have the list do nothing anymore disable: function() { list = stack = memory = undefined; return this; }, // Is it disabled? disabled: function() { return !list; }, // Lock the list in its current state lock: function() { stack = undefined; if (!memory) { self.disable(); } return this; }, // Is it locked? locked: function() { return !stack; }, // Call all callbacks with the given context and arguments fireWith: function(context, args) { if (list && (!fired || stack)) { args = args || []; args = [context, args.slice ? args.slice() : args]; if (firing) { stack.push(args); } else { fire(args); } } return this; }, // Call all the callbacks with the given arguments fire: function() { self.fireWith(this, arguments); return this; }, // To know if the callbacks have already been called at least once fired: function() { return !!fired; } }; return self; }; jQuery.extend({ Deferred: function(func) { var tuples = [ // action, add listener, listener list, final state ["resolve", "done", jQuery.Callbacks("once memory"), "resolved"], ["reject", "fail", jQuery.Callbacks("once memory"), "rejected"], ["notify", "progress", jQuery.Callbacks("memory")] ], state = "pending", promise = { state: function() { return state; }, always: function() { deferred.done(arguments).fail(arguments); return this; }, then: function( /* fnDone, fnFail, fnProgress */ ) { var fns = arguments; return jQuery.Deferred(function(newDefer) { jQuery.each(tuples, function(i, tuple) { var action = tuple[0], fn = jQuery.isFunction(fns[i]) && fns[i]; // deferred[ done | fail | progress ] for forwarding actions to newDefer deferred[tuple[1]](function() { var returned = fn && fn.apply(this, arguments); if (returned && jQuery.isFunction(returned.promise)) { returned.promise() .done(newDefer.resolve) .fail(newDefer.reject) .progress(newDefer.notify); } else { newDefer[action + "With"](this === promise ? newDefer.promise() : this, fn ? [returned] : arguments); } }); }); fns = null; }).promise(); }, // Get a promise for this deferred // If obj is provided, the promise aspect is added to the object promise: function(obj) { return obj != null ? jQuery.extend(obj, promise) : promise; } }, deferred = {}; // Keep pipe for back-compat promise.pipe = promise.then; // Add list-specific methods jQuery.each(tuples, function(i, tuple) { var list = tuple[2], stateString = tuple[3]; // promise[ done | fail | progress ] = list.add promise[tuple[1]] = list.add; // Handle state if (stateString) { list.add(function() { // state = [ resolved | rejected ] state = stateString; // [ reject_list | resolve_list ].disable; progress_list.lock }, tuples[i ^ 1][2].disable, tuples[2][2].lock); } // deferred[ resolve | reject | notify ] deferred[tuple[0]] = function() { deferred[tuple[0] + "With"](this === deferred ? promise : this, arguments); return this; }; deferred[tuple[0] + "With"] = list.fireWith; }); // Make the deferred a promise promise.promise(deferred); // Call given func if any if (func) { func.call(deferred, deferred); } // All done! return deferred; }, // Deferred helper when: function(subordinate /* , ..., subordinateN */ ) { var i = 0, resolveValues = core_slice.call(arguments), length = resolveValues.length, // the count of uncompleted subordinates remaining = length !== 1 || (subordinate && jQuery.isFunction(subordinate.promise)) ? length : 0, // the master Deferred. If resolveValues consist of only a single Deferred, just use that. deferred = remaining === 1 ? subordinate : jQuery.Deferred(), // Update function for both resolve and progress values updateFunc = function(i, contexts, values) { return function(value) { contexts[i] = this; values[i] = arguments.length > 1 ? core_slice.call(arguments) : value; if (values === progressValues) { deferred.notifyWith(contexts, values); } else if (!(--remaining)) { deferred.resolveWith(contexts, values); } }; }, progressValues, progressContexts, resolveContexts; // add listeners to Deferred subordinates; treat others as resolved if (length > 1) { progressValues = new Array(length); progressContexts = new Array(length); resolveContexts = new Array(length); for (; i < length; i++) { if (resolveValues[i] && jQuery.isFunction(resolveValues[i].promise)) { resolveValues[i].promise() .done(updateFunc(i, resolveContexts, resolveValues)) .fail(deferred.reject) .progress(updateFunc(i, progressContexts, progressValues)); } else { --remaining; } } } // if we're not waiting on anything, resolve the master if (!remaining) { deferred.resolveWith(resolveContexts, resolveValues); } return deferred.promise(); } }); jQuery.support = (function(support) { var all, a, input, select, fragment, opt, eventName, isSupported, i, div = document.createElement("div"); // Setup div.setAttribute("className", "t"); div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; // Finish early in limited (non-browser) environments all = div.getElementsByTagName("*") || []; a = div.getElementsByTagName("a")[0]; if (!a || !a.style || !all.length) { return support; } // First batch of tests select = document.createElement("select"); opt = select.appendChild(document.createElement("option")); input = div.getElementsByTagName("input")[0]; a.style.cssText = "top:1px;float:left;opacity:.5"; // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) support.getSetAttribute = div.className !== "t"; // IE strips leading whitespace when .innerHTML is used support.leadingWhitespace = div.firstChild.nodeType === 3; // Make sure that tbody elements aren't automatically inserted // IE will insert them into empty tables support.tbody = !div.getElementsByTagName("tbody").length; // Make sure that link elements get serialized correctly by innerHTML // This requires a wrapper element in IE support.htmlSerialize = !! div.getElementsByTagName("link").length; // Get the style information from getAttribute // (IE uses .cssText instead) support.style = /top/.test(a.getAttribute("style")); // Make sure that URLs aren't manipulated // (IE normalizes it by default) support.hrefNormalized = a.getAttribute("href") === "/a"; // Make sure that element opacity exists // (IE uses filter instead) // Use a regex to work around a WebKit issue. See #5145 support.opacity = /^0.5/.test(a.style.opacity); // Verify style float existence // (IE uses styleFloat instead of cssFloat) support.cssFloat = !! a.style.cssFloat; // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere) support.checkOn = !! input.value; // Make sure that a selected-by-default option has a working selected property. // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) support.optSelected = opt.selected; // Tests for enctype support on a form (#6743) support.enctype = !! document.createElement("form").enctype; // Makes sure cloning an html5 element does not cause problems // Where outerHTML is undefined, this still works support.html5Clone = document.createElement("nav").cloneNode(true).outerHTML !== "<:nav></:nav>"; // Will be defined later support.inlineBlockNeedsLayout = false; support.shrinkWrapBlocks = false; support.pixelPosition = false; support.deleteExpando = true; support.noCloneEvent = true; support.reliableMarginRight = true; support.boxSizingReliable = true; // Make sure checked status is properly cloned input.checked = true; support.noCloneChecked = input.cloneNode(true).checked; // Make sure that the options inside disabled selects aren't marked as disabled // (WebKit marks them as disabled) select.disabled = true; support.optDisabled = !opt.disabled; // Support: IE<9 try { delete div.test; } catch (e) { support.deleteExpando = false; } // Check if we can trust getAttribute("value") input = document.createElement("input"); input.setAttribute("value", ""); support.input = input.getAttribute("value") === ""; // Check if an input maintains its value after becoming a radio input.value = "t"; input.setAttribute("type", "radio"); support.radioValue = input.value === "t"; // #11217 - WebKit loses check when the name is after the checked attribute input.setAttribute("checked", "t"); input.setAttribute("name", "t"); fragment = document.createDocumentFragment(); fragment.appendChild(input); // Check if a disconnected checkbox will retain its checked // value of true after appended to the DOM (IE6/7) support.appendChecked = input.checked; // WebKit doesn't clone checked state correctly in fragments support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked; // Support: IE<9 // Opera does not clone events (and typeof div.attachEvent === undefined). // IE9-10 clones events bound via attachEvent, but they don't trigger with .click() if (div.attachEvent) { div.attachEvent("onclick", function() { support.noCloneEvent = false; }); div.cloneNode(true).click(); } // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event) // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) for (i in { submit: true, change: true, focusin: true }) { div.setAttribute(eventName = "on" + i, "t"); support[i + "Bubbles"] = eventName in window || div.attributes[eventName].expando === false; } div.style.backgroundClip = "content-box"; div.cloneNode(true).style.backgroundClip = ""; support.clearCloneStyle = div.style.backgroundClip === "content-box"; // Support: IE<9 // Iteration over object's inherited properties before its own. for (i in jQuery(support)) { break; } support.ownLast = i !== "0"; // Run tests that need a body at doc ready jQuery(function() { var container, marginDiv, tds, divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;", body = document.getElementsByTagName("body")[0]; if (!body) { // Return for frameset docs that don't have a body return; } container = document.createElement("div"); container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px"; body.appendChild(container).appendChild(div); // Support: IE8 // Check if table cells still have offsetWidth/Height when they are set // to display:none and there are still other visible table cells in a // table row; if so, offsetWidth/Height are not reliable for use when // determining if an element has been hidden directly using // display:none (it is still safe to use offsets if a parent element is // hidden; don safety goggles and see bug #4512 for more information). div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>"; tds = div.getElementsByTagName("td"); tds[0].style.cssText = "padding:0;margin:0;border:0;display:none"; isSupported = (tds[0].offsetHeight === 0); tds[0].style.display = ""; tds[1].style.display = "none"; // Support: IE8 // Check if empty table cells still have offsetWidth/Height support.reliableHiddenOffsets = isSupported && (tds[0].offsetHeight === 0); // Check box-sizing and margin behavior. div.innerHTML = ""; div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;"; // Workaround failing boxSizing test due to offsetWidth returning wrong value // with some non-1 values of body zoom, ticket #13543 jQuery.swap(body, body.style.zoom != null ? { zoom: 1 } : {}, function() { support.boxSizing = div.offsetWidth === 4; }); // Use window.getComputedStyle because jsdom on node.js will break without it. if (window.getComputedStyle) { support.pixelPosition = (window.getComputedStyle(div, null) || {}).top !== "1%"; support.boxSizingReliable = (window.getComputedStyle(div, null) || { width: "4px" }).width === "4px"; // Check if div with explicit width and no margin-right incorrectly // gets computed margin-right based on width of container. (#3333) // Fails in WebKit before Feb 2011 nightlies // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right marginDiv = div.appendChild(document.createElement("div")); marginDiv.style.cssText = div.style.cssText = divReset; marginDiv.style.marginRight = marginDiv.style.width = "0"; div.style.width = "1px"; support.reliableMarginRight = !parseFloat((window.getComputedStyle(marginDiv, null) || {}).marginRight); } if (typeof div.style.zoom !== core_strundefined) { // Support: IE<8 // Check if natively block-level elements act like inline-block // elements when setting their display to 'inline' and giving // them layout div.innerHTML = ""; div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1"; support.inlineBlockNeedsLayout = (div.offsetWidth === 3); // Support: IE6 // Check if elements with layout shrink-wrap their children div.style.display = "block"; div.innerHTML = "<div></div>"; div.firstChild.style.width = "5px"; support.shrinkWrapBlocks = (div.offsetWidth !== 3); if (support.inlineBlockNeedsLayout) { // Prevent IE 6 from affecting layout for positioned elements #11048 // Prevent IE from shrinking the body in IE 7 mode #12869 // Support: IE<8 body.style.zoom = 1; } } body.removeChild(container); // Null elements to avoid leaks in IE container = div = tds = marginDiv = null; }); // Null elements to avoid leaks in IE all = select = fragment = opt = a = input = null; return support; })({}); var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, rmultiDash = /([A-Z])/g; function internalData(elem, name, data, pvt /* Internal Use Only */ ) { if (!jQuery.acceptData(elem)) { return; } var ret, thisCache, internalKey = jQuery.expando, // We have to handle DOM nodes and JS objects differently because IE6-7 // can't GC object references properly across the DOM-JS boundary isNode = elem.nodeType, // Only DOM nodes need the global jQuery cache; JS object data is // attached directly to the object so GC can occur automatically cache = isNode ? jQuery.cache : elem, // Only defining an ID for JS objects if its cache already exists allows // the code to shortcut on the same path as a DOM node with no cache id = isNode ? elem[internalKey] : elem[internalKey] && internalKey; // Avoid doing any more work than we need to when trying to get data on an // object that has no data at all if ((!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string") { return; } if (!id) { // Only DOM nodes need a new unique ID for each element since their data // ends up in the global cache if (isNode) { id = elem[internalKey] = core_deletedIds.pop() || jQuery.guid++; } else { id = internalKey; } } if (!cache[id]) { // Avoid exposing jQuery metadata on plain JS objects when the object // is serialized using JSON.stringify cache[id] = isNode ? {} : { toJSON: jQuery.noop }; } // An object can be passed to jQuery.data instead of a key/value pair; this gets // shallow copied over onto the existing cache if (typeof name === "object" || typeof name === "function") { if (pvt) { cache[id] = jQuery.extend(cache[id], name); } else { cache[id].data = jQuery.extend(cache[id].data, name); } } thisCache = cache[id]; // jQuery data() is stored in a separate object inside the object's internal data // cache in order to avoid key collisions between internal data and user-defined // data. if (!pvt) { if (!thisCache.data) { thisCache.data = {}; } thisCache = thisCache.data; } if (data !== undefined) { thisCache[jQuery.camelCase(name)] = data; } // Check for both converted-to-camel and non-converted data property names // If a data property was specified if (typeof name === "string") { // First Try to find as-is property data ret = thisCache[name]; // Test for null|undefined property data if (ret == null) { // Try to find the camelCased property ret = thisCache[jQuery.camelCase(name)]; } } else { ret = thisCache; } return ret; } function internalRemoveData(elem, name, pvt) { if (!jQuery.acceptData(elem)) { return; } var thisCache, i, isNode = elem.nodeType, // See jQuery.data for more information cache = isNode ? jQuery.cache : elem, id = isNode ? elem[jQuery.expando] : jQuery.expando; // If there is already no cache entry for this object, there is no // purpose in continuing if (!cache[id]) { return; } if (name) { thisCache = pvt ? cache[id] : cache[id].data; if (thisCache) { // Support array or space separated string names for data keys if (!jQuery.isArray(name)) { // try the string as a key before any manipulation if (name in thisCache) { name = [name]; } else { // split the camel cased version by spaces unless a key with the spaces exists name = jQuery.camelCase(name); if (name in thisCache) { name = [name]; } else { name = name.split(" "); } } } else { // If "name" is an array of keys... // When data is initially created, via ("key", "val") signature, // keys will be converted to camelCase. // Since there is no way to tell _how_ a key was added, remove // both plain key and camelCase key. #12786 // This will only penalize the array argument path. name = name.concat(jQuery.map(name, jQuery.camelCase)); } i = name.length; while (i--) { delete thisCache[name[i]]; } // If there is no data left in the cache, we want to continue // and let the cache object itself get destroyed if (pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache)) { return; } } } // See jQuery.data for more information if (!pvt) { delete cache[id].data; // Don't destroy the parent cache unless the internal data object // had been the only thing left in it if (!isEmptyDataObject(cache[id])) { return; } } // Destroy the cache if (isNode) { jQuery.cleanData([elem], true); // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) /* jshint eqeqeq: false */ } else if (jQuery.support.deleteExpando || cache != cache.window) { /* jshint eqeqeq: true */ delete cache[id]; // When all else fails, null } else { cache[id] = null; } } jQuery.extend({ cache: {}, // The following elements throw uncatchable exceptions if you // attempt to add expando properties to them. noData: { "applet": true, "embed": true, // Ban all objects except for Flash (which handle expandos) "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" }, hasData: function(elem) { elem = elem.nodeType ? jQuery.cache[elem[jQuery.expando]] : elem[jQuery.expando]; return !!elem && !isEmptyDataObject(elem); }, data: function(elem, name, data) { return internalData(elem, name, data); }, removeData: function(elem, name) { return internalRemoveData(elem, name); }, // For internal use only. _data: function(elem, name, data) { return internalData(elem, name, data, true); }, _removeData: function(elem, name) { return internalRemoveData(elem, name, true); }, // A method for determining if a DOM node can handle the data expando acceptData: function(elem) { // Do not set data on non-element because it will not be cleared (#8335). if (elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9) { return false; } var noData = elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]; // nodes accept data unless otherwise specified; rejection can be conditional return !noData || noData !== true && elem.getAttribute("classid") === noData; } }); jQuery.fn.extend({ data: function(key, value) { var attrs, name, data = null, i = 0, elem = this[0]; // Special expections of .data basically thwart jQuery.access, // so implement the relevant behavior ourselves // Gets all values if (key === undefined) { if (this.length) { data = jQuery.data(elem); if (elem.nodeType === 1 && !jQuery._data(elem, "parsedAttrs")) { attrs = elem.attributes; for (; i < attrs.length; i++) { name = attrs[i].name; if (name.indexOf("data-") === 0) { name = jQuery.camelCase(name.slice(5)); dataAttr(elem, name, data[name]); } } jQuery._data(elem, "parsedAttrs", true); } } return data; } // Sets multiple values if (typeof key === "object") { return this.each(function() { jQuery.data(this, key); }); } return arguments.length > 1 ? // Sets one value this.each(function() { jQuery.data(this, key, value); }) : // Gets one value // Try to fetch any internally stored data first elem ? dataAttr(elem, key, jQuery.data(elem, key)) : null; }, removeData: function(key) { return this.each(function() { jQuery.removeData(this, key); }); } }); function dataAttr(elem, key, data) { // If nothing was found internally, try to fetch any // data from the HTML5 data-* attribute if (data === undefined && elem.nodeType === 1) { var name = "data-" + key.replace(rmultiDash, "-$1").toLowerCase(); data = elem.getAttribute(name); if (typeof data === "string") { try { data = data === "true" ? true : data === "false" ? false : data === "null" ? null : // Only convert to a number if it doesn't change the string + data + "" === data ? +data : rbrace.test(data) ? jQuery.parseJSON(data) : data; } catch (e) {} // Make sure we set the data so it isn't changed later jQuery.data(elem, key, data); } else { data = undefined; } } return data; } // checks a cache object for emptiness function isEmptyDataObject(obj) { var name; for (name in obj) { // if the public data object is empty, the private is still empty if (name === "data" && jQuery.isEmptyObject(obj[name])) { continue; } if (name !== "toJSON") { return false; } } return true; } jQuery.extend({ queue: function(elem, type, data) { var queue; if (elem) { type = (type || "fx") + "queue"; queue = jQuery._data(elem, type); // Speed up dequeue by getting out quickly if this is just a lookup if (data) { if (!queue || jQuery.isArray(data)) { queue = jQuery._data(elem, type, jQuery.makeArray(data)); } else { queue.push(data); } } return queue || []; } }, dequeue: function(elem, type) { type = type || "fx"; var queue = jQuery.queue(elem, type), startLength = queue.length, fn = queue.shift(), hooks = jQuery._queueHooks(elem, type), next = function() { jQuery.dequeue(elem, type); }; // If the fx queue is dequeued, always remove the progress sentinel if (fn === "inprogress") { fn = queue.shift(); startLength--; } if (fn) { // Add a progress sentinel to prevent the fx queue from being // automatically dequeued if (type === "fx") { queue.unshift("inprogress"); } // clear up the last queue stop function delete hooks.stop; fn.call(elem, next, hooks); } if (!startLength && hooks) { hooks.empty.fire(); } }, // not intended for public consumption - generates a queueHooks object, or returns the current one _queueHooks: function(elem, type) { var key = type + "queueHooks"; return jQuery._data(elem, key) || jQuery._data(elem, key, { empty: jQuery.Callbacks("once memory").add(function() { jQuery._removeData(elem, type + "queue"); jQuery._removeData(elem, key); }) }); } }); jQuery.fn.extend({ queue: function(type, data) { var setter = 2; if (typeof type !== "string") { data = type; type = "fx"; setter--; } if (arguments.length < setter) { return jQuery.queue(this[0], type); } return data === undefined ? this : this.each(function() { var queue = jQuery.queue(this, type, data); // ensure a hooks for this queue jQuery._queueHooks(this, type); if (type === "fx" && queue[0] !== "inprogress") { jQuery.dequeue(this, type); } }); }, dequeue: function(type) { return this.each(function() { jQuery.dequeue(this, type); }); }, // Based off of the plugin by Clint Helfers, with permission. // http://blindsignals.com/index.php/2009/07/jquery-delay/ delay: function(time, type) { time = jQuery.fx ? jQuery.fx.speeds[time] || time : time; type = type || "fx"; return this.queue(type, function(next, hooks) { var timeout = setTimeout(next, time); hooks.stop = function() { clearTimeout(timeout); }; }); }, clearQueue: function(type) { return this.queue(type || "fx", []); }, // Get a promise resolved when queues of a certain type // are emptied (fx is the type by default) promise: function(type, obj) { var tmp, count = 1, defer = jQuery.Deferred(), elements = this, i = this.length, resolve = function() { if (!(--count)) { defer.resolveWith(elements, [elements]); } }; if (typeof type !== "string") { obj = type; type = undefined; } type = type || "fx"; while (i--) { tmp = jQuery._data(elements[i], type + "queueHooks"); if (tmp && tmp.empty) { count++; tmp.empty.add(resolve); } } resolve(); return defer.promise(obj); } }); var nodeHook, boolHook, rclass = /[\t\r\n\f]/g, rreturn = /\r/g, rfocusable = /^(?:input|select|textarea|button|object)$/i, rclickable = /^(?:a|area)$/i, ruseDefault = /^(?:checked|selected)$/i, getSetAttribute = jQuery.support.getSetAttribute, getSetInput = jQuery.support.input; jQuery.fn.extend({ attr: function(name, value) { return jQuery.access(this, jQuery.attr, name, value, arguments.length > 1); }, removeAttr: function(name) { return this.each(function() { jQuery.removeAttr(this, name); }); }, prop: function(name, value) { return jQuery.access(this, jQuery.prop, name, value, arguments.length > 1); }, removeProp: function(name) { name = jQuery.propFix[name] || name; return this.each(function() { // try/catch handles cases where IE balks (such as removing a property on window) try { this[name] = undefined; delete this[name]; } catch (e) {} }); }, addClass: function(value) { var classes, elem, cur, clazz, j, i = 0, len = this.length, proceed = typeof value === "string" && value; if (jQuery.isFunction(value)) { return this.each(function(j) { jQuery(this).addClass(value.call(this, j, this.className)); }); } if (proceed) { // The disjunction here is for better compressibility (see removeClass) classes = (value || "").match(core_rnotwhite) || []; for (; i < len; i++) { elem = this[i]; cur = elem.nodeType === 1 && (elem.className ? (" " + elem.className + " ").replace(rclass, " ") : " "); if (cur) { j = 0; while ((clazz = classes[j++])) { if (cur.indexOf(" " + clazz + " ") < 0) { cur += clazz + " "; } } elem.className = jQuery.trim(cur); } } } return this; }, removeClass: function(value) { var classes, elem, cur, clazz, j, i = 0, len = this.length, proceed = arguments.length === 0 || typeof value === "string" && value; if (jQuery.isFunction(value)) { return this.each(function(j) { jQuery(this).removeClass(value.call(this, j, this.className)); }); } if (proceed) { classes = (value || "").match(core_rnotwhite) || []; for (; i < len; i++) { elem = this[i]; // This expression is here for better compressibility (see addClass) cur = elem.nodeType === 1 && (elem.className ? (" " + elem.className + " ").replace(rclass, " ") : ""); if (cur) { j = 0; while ((clazz = classes[j++])) { // Remove *all* instances while (cur.indexOf(" " + clazz + " ") >= 0) { cur = cur.replace(" " + clazz + " ", " "); } } elem.className = value ? jQuery.trim(cur) : ""; } } } return this; }, toggleClass: function(value, stateVal) { var type = typeof value; if (typeof stateVal === "boolean" && type === "string") { return stateVal ? this.addClass(value) : this.removeClass(value); } if (jQuery.isFunction(value)) { return this.each(function(i) { jQuery(this).toggleClass(value.call(this, i, this.className, stateVal), stateVal); }); } return this.each(function() { if (type === "string") { // toggle individual class names var className, i = 0, self = jQuery(this), classNames = value.match(core_rnotwhite) || []; while ((className = classNames[i++])) { // check each className given, space separated list if (self.hasClass(className)) { self.removeClass(className); } else { self.addClass(className); } } // Toggle whole class name } else if (type === core_strundefined || type === "boolean") { if (this.className) { // store className if set jQuery._data(this, "__className__", this.className); } // If the element has a class name or if we're passed "false", // then remove the whole classname (if there was one, the above saved it). // Otherwise bring back whatever was previously saved (if anything), // falling back to the empty string if nothing was stored. this.className = this.className || value === false ? "" : jQuery._data(this, "__className__") || ""; } }); }, hasClass: function(selector) { var className = " " + selector + " ", i = 0, l = this.length; for (; i < l; i++) { if (this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf(className) >= 0) { return true; } } return false; }, val: function(value) { var ret, hooks, isFunction, elem = this[0]; if (!arguments.length) { if (elem) { hooks = jQuery.valHooks[elem.type] || jQuery.valHooks[elem.nodeName.toLowerCase()]; if (hooks && "get" in hooks && (ret = hooks.get(elem, "value")) !== undefined) { return ret; } ret = elem.value; return typeof ret === "string" ? // handle most common string cases ret.replace(rreturn, "") : // handle cases where value is null/undef or number ret == null ? "" : ret; } return; } isFunction = jQuery.isFunction(value); return this.each(function(i) { var val; if (this.nodeType !== 1) { return; } if (isFunction) { val = value.call(this, i, jQuery(this).val()); } else { val = value; } // Treat null/undefined as ""; convert numbers to string if (val == null) { val = ""; } else if (typeof val === "number") { val += ""; } else if (jQuery.isArray(val)) { val = jQuery.map(val, function(value) { return value == null ? "" : value + ""; }); } hooks = jQuery.valHooks[this.type] || jQuery.valHooks[this.nodeName.toLowerCase()]; // If set returns undefined, fall back to normal setting if (!hooks || !("set" in hooks) || hooks.set(this, val, "value") === undefined) { this.value = val; } }); } }); jQuery.extend({ valHooks: { option: { get: function(elem) { // Use proper attribute retrieval(#6932, #12072) var val = jQuery.find.attr(elem, "value"); return val != null ? val : elem.text; } }, select: { get: function(elem) { var value, option, options = elem.options, index = elem.selectedIndex, one = elem.type === "select-one" || index < 0, values = one ? null : [], max = one ? index + 1 : options.length, i = index < 0 ? max : one ? index : 0; // Loop through all the selected options for (; i < max; i++) { option = options[i]; // oldIE doesn't update selected after form reset (#2551) if ((option.selected || i === index) && // Don't return options that are disabled or in a disabled optgroup (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && (!option.parentNode.disabled || !jQuery.nodeName(option.parentNode, "optgroup"))) { // Get the specific value for the option value = jQuery(option).val(); // We don't need an array for one selects if (one) { return value; } // Multi-Selects return an array values.push(value); } } return values; }, set: function(elem, value) { var optionSet, option, options = elem.options, values = jQuery.makeArray(value), i = options.length; while (i--) { option = options[i]; if ((option.selected = jQuery.inArray(jQuery(option).val(), values) >= 0)) { optionSet = true; } } // force browsers to behave consistently when non-matching value is set if (!optionSet) { elem.selectedIndex = -1; } return values; } } }, attr: function(elem, name, value) { var hooks, ret, nType = elem.nodeType; // don't get/set attributes on text, comment and attribute nodes if (!elem || nType === 3 || nType === 8 || nType === 2) { return; } // Fallback to prop when attributes are not supported if (typeof elem.getAttribute === core_strundefined) { return jQuery.prop(elem, name, value); } // All attributes are lowercase // Grab necessary hook if one is defined if (nType !== 1 || !jQuery.isXMLDoc(elem)) { name = name.toLowerCase(); hooks = jQuery.attrHooks[name] || (jQuery.expr.match.bool.test(name) ? boolHook : nodeHook); } if (value !== undefined) { if (value === null) { jQuery.removeAttr(elem, name); } else if (hooks && "set" in hooks && (ret = hooks.set(elem, value, name)) !== undefined) { return ret; } else { elem.setAttribute(name, value + ""); return value; } } else if (hooks && "get" in hooks && (ret = hooks.get(elem, name)) !== null) { return ret; } else { ret = jQuery.find.attr(elem, name); // Non-existent attributes return null, we normalize to undefined return ret == null ? undefined : ret; } }, removeAttr: function(elem, value) { var name, propName, i = 0, attrNames = value && value.match(core_rnotwhite); if (attrNames && elem.nodeType === 1) { while ((name = attrNames[i++])) { propName = jQuery.propFix[name] || name; // Boolean attributes get special treatment (#10870) if (jQuery.expr.match.bool.test(name)) { // Set corresponding property to false if (getSetInput && getSetAttribute || !ruseDefault.test(name)) { elem[propName] = false; // Support: IE<9 // Also clear defaultChecked/defaultSelected (if appropriate) } else { elem[jQuery.camelCase("default-" + name)] = elem[propName] = false; } // See #9699 for explanation of this approach (setting first, then removal) } else { jQuery.attr(elem, name, ""); } elem.removeAttribute(getSetAttribute ? name : propName); } } }, attrHooks: { type: { set: function(elem, value) { if (!jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input")) { // Setting the type on a radio button after the value resets the value in IE6-9 // Reset value to default in case type is set after value during creation var val = elem.value; elem.setAttribute("type", value); if (val) { elem.value = val; } return value; } } } }, propFix: { "for": "htmlFor", "class": "className" }, prop: function(elem, name, value) { var ret, hooks, notxml, nType = elem.nodeType; // don't get/set properties on text, comment and attribute nodes if (!elem || nType === 3 || nType === 8 || nType === 2) { return; } notxml = nType !== 1 || !jQuery.isXMLDoc(elem); if (notxml) { // Fix name and attach hooks name = jQuery.propFix[name] || name; hooks = jQuery.propHooks[name]; } if (value !== undefined) { return hooks && "set" in hooks && (ret = hooks.set(elem, value, name)) !== undefined ? ret : (elem[name] = value); } else { return hooks && "get" in hooks && (ret = hooks.get(elem, name)) !== null ? ret : elem[name]; } }, propHooks: { tabIndex: { get: function(elem) { // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ // Use proper attribute retrieval(#12072) var tabindex = jQuery.find.attr(elem, "tabindex"); return tabindex ? parseInt(tabindex, 10) : rfocusable.test(elem.nodeName) || rclickable.test(elem.nodeName) && elem.href ? 0 : -1; } } } }); // Hooks for boolean attributes boolHook = { set: function(elem, value, name) { if (value === false) { // Remove boolean attributes when set to false jQuery.removeAttr(elem, name); } else if (getSetInput && getSetAttribute || !ruseDefault.test(name)) { // IE<8 needs the *property* name elem.setAttribute(!getSetAttribute && jQuery.propFix[name] || name, name); // Use defaultChecked and defaultSelected for oldIE } else { elem[jQuery.camelCase("default-" + name)] = elem[name] = true; } return name; } }; jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g), function(i, name) { var getter = jQuery.expr.attrHandle[name] || jQuery.find.attr; jQuery.expr.attrHandle[name] = getSetInput && getSetAttribute || !ruseDefault.test(name) ? function(elem, name, isXML) { var fn = jQuery.expr.attrHandle[name], ret = isXML ? undefined : /* jshint eqeqeq: false */ (jQuery.expr.attrHandle[name] = undefined) != getter(elem, name, isXML) ? name.toLowerCase() : null; jQuery.expr.attrHandle[name] = fn; return ret; } : function(elem, name, isXML) { return isXML ? undefined : elem[jQuery.camelCase("default-" + name)] ? name.toLowerCase() : null; }; }); // fix oldIE attroperties if (!getSetInput || !getSetAttribute) { jQuery.attrHooks.value = { set: function(elem, value, name) { if (jQuery.nodeName(elem, "input")) { // Does not return so that setAttribute is also used elem.defaultValue = value; } else { // Use nodeHook if defined (#1954); otherwise setAttribute is fine return nodeHook && nodeHook.set(elem, value, name); } } }; } // IE6/7 do not support getting/setting some attributes with get/setAttribute if (!getSetAttribute) { // Use this for any attribute in IE6/7 // This fixes almost every IE6/7 issue nodeHook = { set: function(elem, value, name) { // Set the existing or create a new attribute node var ret = elem.getAttributeNode(name); if (!ret) { elem.setAttributeNode( (ret = elem.ownerDocument.createAttribute(name))); } ret.value = value += ""; // Break association with cloned elements by also using setAttribute (#9646) return name === "value" || value === elem.getAttribute(name) ? value : undefined; } }; jQuery.expr.attrHandle.id = jQuery.expr.attrHandle.name = jQuery.expr.attrHandle.coords = // Some attributes are constructed with empty-string values when not defined function(elem, name, isXML) { var ret; return isXML ? undefined : (ret = elem.getAttributeNode(name)) && ret.value !== "" ? ret.value : null; }; jQuery.valHooks.button = { get: function(elem, name) { var ret = elem.getAttributeNode(name); return ret && ret.specified ? ret.value : undefined; }, set: nodeHook.set }; // Set contenteditable to false on removals(#10429) // Setting to empty string throws an error as an invalid value jQuery.attrHooks.contenteditable = { set: function(elem, value, name) { nodeHook.set(elem, value === "" ? false : value, name); } }; // Set width and height to auto instead of 0 on empty string( Bug #8150 ) // This is for removals jQuery.each(["width", "height"], function(i, name) { jQuery.attrHooks[name] = { set: function(elem, value) { if (value === "") { elem.setAttribute(name, "auto"); return value; } } }; }); } // Some attributes require a special call on IE // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx if (!jQuery.support.hrefNormalized) { // href/src property should get the full normalized URL (#10299/#12915) jQuery.each(["href", "src"], function(i, name) { jQuery.propHooks[name] = { get: function(elem) { return elem.getAttribute(name, 4); } }; }); } if (!jQuery.support.style) { jQuery.attrHooks.style = { get: function(elem) { // Return undefined in the case of empty string // Note: IE uppercases css property names, but if we were to .toLowerCase() // .cssText, that would destroy case senstitivity in URL's, like in "background" return elem.style.cssText || undefined; }, set: function(elem, value) { return (elem.style.cssText = value + ""); } }; } // Safari mis-reports the default selected property of an option // Accessing the parent's selectedIndex property fixes it if (!jQuery.support.optSelected) { jQuery.propHooks.selected = { get: function(elem) { var parent = elem.parentNode; if (parent) { parent.selectedIndex; // Make sure that it also works with optgroups, see #5701 if (parent.parentNode) { parent.parentNode.selectedIndex; } } return null; } }; } jQuery.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function() { jQuery.propFix[this.toLowerCase()] = this; }); // IE6/7 call enctype encoding if (!jQuery.support.enctype) { jQuery.propFix.enctype = "encoding"; } // Radios and checkboxes getter/setter jQuery.each(["radio", "checkbox"], function() { jQuery.valHooks[this] = { set: function(elem, value) { if (jQuery.isArray(value)) { return (elem.checked = jQuery.inArray(jQuery(elem).val(), value) >= 0); } } }; if (!jQuery.support.checkOn) { jQuery.valHooks[this].get = function(elem) { // Support: Webkit // "" is returned instead of "on" if a value isn't specified return elem.getAttribute("value") === null ? "on" : elem.value; }; } }); var rformElems = /^(?:input|select|textarea)$/i, rkeyEvent = /^key/, rmouseEvent = /^(?:mouse|contextmenu)|click/, rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; function returnTrue() { return true; } function returnFalse() { return false; } function safeActiveElement() { try { return document.activeElement; } catch (err) {} } /* * Helper functions for managing events -- not part of the public interface. * Props to Dean Edwards' addEvent library for many of the ideas. */ jQuery.event = { global: {}, add: function(elem, types, handler, data, selector) { var tmp, events, t, handleObjIn, special, eventHandle, handleObj, handlers, type, namespaces, origType, elemData = jQuery._data(elem); // Don't attach events to noData or text/comment nodes (but allow plain objects) if (!elemData) { return; } // Caller can pass in an object of custom data in lieu of the handler if (handler.handler) { handleObjIn = handler; handler = handleObjIn.handler; selector = handleObjIn.selector; } // Make sure that the handler has a unique ID, used to find/remove it later if (!handler.guid) { handler.guid = jQuery.guid++; } // Init the element's event structure and main handler, if this is the first if (!(events = elemData.events)) { events = elemData.events = {}; } if (!(eventHandle = elemData.handle)) { eventHandle = elemData.handle = function(e) { // Discard the second event of a jQuery.event.trigger() and // when an event is called after a page has unloaded return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ? jQuery.event.dispatch.apply(eventHandle.elem, arguments) : undefined; }; // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events eventHandle.elem = elem; } // Handle multiple events separated by a space types = (types || "").match(core_rnotwhite) || [""]; t = types.length; while (t--) { tmp = rtypenamespace.exec(types[t]) || []; type = origType = tmp[1]; namespaces = (tmp[2] || "").split(".").sort(); // There *must* be a type, no attaching namespace-only handlers if (!type) { continue; } // If event changes its type, use the special event handlers for the changed type special = jQuery.event.special[type] || {}; // If selector defined, determine special event api type, otherwise given type type = (selector ? special.delegateType : special.bindType) || type; // Update special based on newly reset type special = jQuery.event.special[type] || {}; // handleObj is passed to all event handlers handleObj = jQuery.extend({ type: type, origType: origType, data: data, handler: handler, guid: handler.guid, selector: selector, needsContext: selector && jQuery.expr.match.needsContext.test(selector), namespace: namespaces.join(".") }, handleObjIn); // Init the event handler queue if we're the first if (!(handlers = events[type])) { handlers = events[type] = []; handlers.delegateCount = 0; // Only use addEventListener/attachEvent if the special events handler returns false if (!special.setup || special.setup.call(elem, data, namespaces, eventHandle) === false) { // Bind the global event handler to the element if (elem.addEventListener) { elem.addEventListener(type, eventHandle, false); } else if (elem.attachEvent) { elem.attachEvent("on" + type, eventHandle); } } } if (special.add) { special.add.call(elem, handleObj); if (!handleObj.handler.guid) { handleObj.handler.guid = handler.guid; } } // Add to the element's handler list, delegates in front if (selector) { handlers.splice(handlers.delegateCount++, 0, handleObj); } else { handlers.push(handleObj); } // Keep track of which events have ever been used, for event optimization jQuery.event.global[type] = true; } // Nullify elem to prevent memory leaks in IE elem = null; }, // Detach an event or set of events from an element remove: function(elem, types, handler, selector, mappedTypes) { var j, handleObj, tmp, origCount, t, events, special, handlers, type, namespaces, origType, elemData = jQuery.hasData(elem) && jQuery._data(elem); if (!elemData || !(events = elemData.events)) { return; } // Once for each type.namespace in types; type may be omitted types = (types || "").match(core_rnotwhite) || [""]; t = types.length; while (t--) { tmp = rtypenamespace.exec(types[t]) || []; type = origType = tmp[1]; namespaces = (tmp[2] || "").split(".").sort(); // Unbind all events (on this namespace, if provided) for the element if (!type) { for (type in events) { jQuery.event.remove(elem, type + types[t], handler, selector, true); } continue; } special = jQuery.event.special[type] || {}; type = (selector ? special.delegateType : special.bindType) || type; handlers = events[type] || []; tmp = tmp[2] && new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)"); // Remove matching events origCount = j = handlers.length; while (j--) { handleObj = handlers[j]; if ((mappedTypes || origType === handleObj.origType) && (!handler || handler.guid === handleObj.guid) && (!tmp || tmp.test(handleObj.namespace)) && (!selector || selector === handleObj.selector || selector === "**" && handleObj.selector)) { handlers.splice(j, 1); if (handleObj.selector) { handlers.delegateCount--; } if (special.remove) { special.remove.call(elem, handleObj); } } } // Remove generic event handler if we removed something and no more handlers exist // (avoids potential for endless recursion during removal of special event handlers) if (origCount && !handlers.length) { if (!special.teardown || special.teardown.call(elem, namespaces, elemData.handle) === false) { jQuery.removeEvent(elem, type, elemData.handle); } delete events[type]; } } // Remove the expando if it's no longer used if (jQuery.isEmptyObject(events)) { delete elemData.handle; // removeData also checks for emptiness and clears the expando if empty // so use it instead of delete jQuery._removeData(elem, "events"); } }, trigger: function(event, data, elem, onlyHandlers) { var handle, ontype, cur, bubbleType, special, tmp, i, eventPath = [elem || document], type = core_hasOwn.call(event, "type") ? event.type : event, namespaces = core_hasOwn.call(event, "namespace") ? event.namespace.split(".") : []; cur = tmp = elem = elem || document; // Don't do events on text and comment nodes if (elem.nodeType === 3 || elem.nodeType === 8) { return; } // focus/blur morphs to focusin/out; ensure we're not firing them right now if (rfocusMorph.test(type + jQuery.event.triggered)) { return; } if (type.indexOf(".") >= 0) { // Namespaced trigger; create a regexp to match event type in handle() namespaces = type.split("."); type = namespaces.shift(); namespaces.sort(); } ontype = type.indexOf(":") < 0 && "on" + type; // Caller can pass in a jQuery.Event object, Object, or just an event type string event = event[jQuery.expando] ? event : new jQuery.Event(type, typeof event === "object" && event); // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) event.isTrigger = onlyHandlers ? 2 : 3; event.namespace = namespaces.join("."); event.namespace_re = event.namespace ? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null; // Clean up the event in case it is being reused event.result = undefined; if (!event.target) { event.target = elem; } // Clone any incoming data and prepend the event, creating the handler arg list data = data == null ? [event] : jQuery.makeArray(data, [event]); // Allow special events to draw outside the lines special = jQuery.event.special[type] || {}; if (!onlyHandlers && special.trigger && special.trigger.apply(elem, data) === false) { return; } // Determine event propagation path in advance, per W3C events spec (#9951) // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) if (!onlyHandlers && !special.noBubble && !jQuery.isWindow(elem)) { bubbleType = special.delegateType || type; if (!rfocusMorph.test(bubbleType + type)) { cur = cur.parentNode; } for (; cur; cur = cur.parentNode) { eventPath.push(cur); tmp = cur; } // Only add window if we got to document (e.g., not plain obj or detached DOM) if (tmp === (elem.ownerDocument || document)) { eventPath.push(tmp.defaultView || tmp.parentWindow || window); } } // Fire handlers on the event path i = 0; while ((cur = eventPath[i++]) && !event.isPropagationStopped()) { event.type = i > 1 ? bubbleType : special.bindType || type; // jQuery handler handle = (jQuery._data(cur, "events") || {})[event.type] && jQuery._data(cur, "handle"); if (handle) { handle.apply(cur, data); } // Native handler handle = ontype && cur[ontype]; if (handle && jQuery.acceptData(cur) && handle.apply && handle.apply(cur, data) === false) { event.preventDefault(); } } event.type = type; // If nobody prevented the default action, do it now if (!onlyHandlers && !event.isDefaultPrevented()) { if ((!special._default || special._default.apply(eventPath.pop(), data) === false) && jQuery.acceptData(elem)) { // Call a native DOM method on the target with the same name name as the event. // Can't use an .isFunction() check here because IE6/7 fails that test. // Don't do default actions on window, that's where global variables be (#6170) if (ontype && elem[type] && !jQuery.isWindow(elem)) { // Don't re-trigger an onFOO event when we call its FOO() method tmp = elem[ontype]; if (tmp) { elem[ontype] = null; } // Prevent re-triggering of the same event, since we already bubbled it above jQuery.event.triggered = type; try { elem[type](); } catch (e) { // IE<9 dies on focus/blur to hidden element (#1486,#12518) // only reproducible on winXP IE8 native, not IE9 in IE8 mode } jQuery.event.triggered = undefined; if (tmp) { elem[ontype] = tmp; } } } } return event.result; }, dispatch: function(event) { // Make a writable jQuery.Event from the native event object event = jQuery.event.fix(event); var i, ret, handleObj, matched, j, handlerQueue = [], args = core_slice.call(arguments), handlers = (jQuery._data(this, "events") || {})[event.type] || [], special = jQuery.event.special[event.type] || {}; // Use the fix-ed jQuery.Event rather than the (read-only) native event args[0] = event; event.delegateTarget = this; // Call the preDispatch hook for the mapped type, and let it bail if desired if (special.preDispatch && special.preDispatch.call(this, event) === false) { return; } // Determine handlers handlerQueue = jQuery.event.handlers.call(this, event, handlers); // Run delegates first; they may want to stop propagation beneath us i = 0; while ((matched = handlerQueue[i++]) && !event.isPropagationStopped()) { event.currentTarget = matched.elem; j = 0; while ((handleObj = matched.handlers[j++]) && !event.isImmediatePropagationStopped()) { // Triggered event must either 1) have no namespace, or // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). if (!event.namespace_re || event.namespace_re.test(handleObj.namespace)) { event.handleObj = handleObj; event.data = handleObj.data; ret = ((jQuery.event.special[handleObj.origType] || {}).handle || handleObj.handler) .apply(matched.elem, args); if (ret !== undefined) { if ((event.result = ret) === false) { event.preventDefault(); event.stopPropagation(); } } } } } // Call the postDispatch hook for the mapped type if (special.postDispatch) { special.postDispatch.call(this, event); } return event.result; }, handlers: function(event, handlers) { var sel, handleObj, matches, i, handlerQueue = [], delegateCount = handlers.delegateCount, cur = event.target; // Find delegate handlers // Black-hole SVG <use> instance trees (#13180) // Avoid non-left-click bubbling in Firefox (#3861) if (delegateCount && cur.nodeType && (!event.button || event.type !== "click")) { /* jshint eqeqeq: false */ for (; cur != this; cur = cur.parentNode || this) { /* jshint eqeqeq: true */ // Don't check non-elements (#13208) // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) if (cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click")) { matches = []; for (i = 0; i < delegateCount; i++) { handleObj = handlers[i]; // Don't conflict with Object.prototype properties (#13203) sel = handleObj.selector + " "; if (matches[sel] === undefined) { matches[sel] = handleObj.needsContext ? jQuery(sel, this).index(cur) >= 0 : jQuery.find(sel, this, null, [cur]).length; } if (matches[sel]) { matches.push(handleObj); } } if (matches.length) { handlerQueue.push({ elem: cur, handlers: matches }); } } } } // Add the remaining (directly-bound) handlers if (delegateCount < handlers.length) { handlerQueue.push({ elem: this, handlers: handlers.slice(delegateCount) }); } return handlerQueue; }, fix: function(event) { if (event[jQuery.expando]) { return event; } // Create a writable copy of the event object and normalize some properties var i, prop, copy, type = event.type, originalEvent = event, fixHook = this.fixHooks[type]; if (!fixHook) { this.fixHooks[type] = fixHook = rmouseEvent.test(type) ? this.mouseHooks : rkeyEvent.test(type) ? this.keyHooks : {}; } copy = fixHook.props ? this.props.concat(fixHook.props) : this.props; event = new jQuery.Event(originalEvent); i = copy.length; while (i--) { prop = copy[i]; event[prop] = originalEvent[prop]; } // Support: IE<9 // Fix target property (#1925) if (!event.target) { event.target = originalEvent.srcElement || document; } // Support: Chrome 23+, Safari? // Target should not be a text node (#504, #13143) if (event.target.nodeType === 3) { event.target = event.target.parentNode; } // Support: IE<9 // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) event.metaKey = !! event.metaKey; return fixHook.filter ? fixHook.filter(event, originalEvent) : event; }, // Includes some event props shared by KeyEvent and MouseEvent props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), fixHooks: {}, keyHooks: { props: "char charCode key keyCode".split(" "), filter: function(event, original) { // Add which for key events if (event.which == null) { event.which = original.charCode != null ? original.charCode : original.keyCode; } return event; } }, mouseHooks: { props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), filter: function(event, original) { var body, eventDoc, doc, button = original.button, fromElement = original.fromElement; // Calculate pageX/Y if missing and clientX/Y available if (event.pageX == null && original.clientX != null) { eventDoc = event.target.ownerDocument || document; doc = eventDoc.documentElement; body = eventDoc.body; event.pageX = original.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0); event.pageY = original.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0); } // Add relatedTarget, if necessary if (!event.relatedTarget && fromElement) { event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; } // Add which for click: 1 === left; 2 === middle; 3 === right // Note: button is not normalized, so don't use it if (!event.which && button !== undefined) { event.which = (button & 1 ? 1 : (button & 2 ? 3 : (button & 4 ? 2 : 0))); } return event; } }, special: { load: { // Prevent triggered image.load events from bubbling to window.load noBubble: true }, focus: { // Fire native event if possible so blur/focus sequence is correct trigger: function() { if (this !== safeActiveElement() && this.focus) { try { this.focus(); return false; } catch (e) { // Support: IE<9 // If we error on focus to hidden element (#1486, #12518), // let .trigger() run the handlers } } }, delegateType: "focusin" }, blur: { trigger: function() { if (this === safeActiveElement() && this.blur) { this.blur(); return false; } }, delegateType: "focusout" }, click: { // For checkbox, fire native event so checked state will be right trigger: function() { if (jQuery.nodeName(this, "input") && this.type === "checkbox" && this.click) { this.click(); return false; } }, // For cross-browser consistency, don't fire native .click() on links _default: function(event) { return jQuery.nodeName(event.target, "a"); } }, beforeunload: { postDispatch: function(event) { // Even when returnValue equals to undefined Firefox will still show alert if (event.result !== undefined) { event.originalEvent.returnValue = event.result; } } } }, simulate: function(type, elem, event, bubble) { // Piggyback on a donor event to simulate a different one. // Fake originalEvent to avoid donor's stopPropagation, but if the // simulated event prevents default then we do the same on the donor. var e = jQuery.extend( new jQuery.Event(), event, { type: type, isSimulated: true, originalEvent: {} }); if (bubble) { jQuery.event.trigger(e, null, elem); } else { jQuery.event.dispatch.call(elem, e); } if (e.isDefaultPrevented()) { event.preventDefault(); } } }; jQuery.removeEvent = document.removeEventListener ? function(elem, type, handle) { if (elem.removeEventListener) { elem.removeEventListener(type, handle, false); } } : function(elem, type, handle) { var name = "on" + type; if (elem.detachEvent) { // #8545, #7054, preventing memory leaks for custom events in IE6-8 // detachEvent needed property on element, by name of that event, to properly expose it to GC if (typeof elem[name] === core_strundefined) { elem[name] = null; } elem.detachEvent(name, handle); } }; jQuery.Event = function(src, props) { // Allow instantiation without the 'new' keyword if (!(this instanceof jQuery.Event)) { return new jQuery.Event(src, props); } // Event object if (src && src.type) { this.originalEvent = src; this.type = src.type; // Events bubbling up the document may have been marked as prevented // by a handler lower down the tree; reflect the correct value. this.isDefaultPrevented = (src.defaultPrevented || src.returnValue === false || src.getPreventDefault && src.getPreventDefault()) ? returnTrue : returnFalse; // Event type } else { this.type = src; } // Put explicitly provided properties onto the event object if (props) { jQuery.extend(this, props); } // Create a timestamp if incoming event doesn't have one this.timeStamp = src && src.timeStamp || jQuery.now(); // Mark it as fixed this[jQuery.expando] = true; }; // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html jQuery.Event.prototype = { isDefaultPrevented: returnFalse, isPropagationStopped: returnFalse, isImmediatePropagationStopped: returnFalse, preventDefault: function() { var e = this.originalEvent; this.isDefaultPrevented = returnTrue; if (!e) { return; } // If preventDefault exists, run it on the original event if (e.preventDefault) { e.preventDefault(); // Support: IE // Otherwise set the returnValue property of the original event to false } else { e.returnValue = false; } }, stopPropagation: function() { var e = this.originalEvent; this.isPropagationStopped = returnTrue; if (!e) { return; } // If stopPropagation exists, run it on the original event if (e.stopPropagation) { e.stopPropagation(); } // Support: IE // Set the cancelBubble property of the original event to true e.cancelBubble = true; }, stopImmediatePropagation: function() { this.isImmediatePropagationStopped = returnTrue; this.stopPropagation(); } }; // Create mouseenter/leave events using mouseover/out and event-time checks jQuery.each({ mouseenter: "mouseover", mouseleave: "mouseout" }, function(orig, fix) { jQuery.event.special[orig] = { delegateType: fix, bindType: fix, handle: function(event) { var ret, target = this, related = event.relatedTarget, handleObj = event.handleObj; // For mousenter/leave call the handler if related is outside the target. // NB: No relatedTarget if the mouse left/entered the browser window if (!related || (related !== target && !jQuery.contains(target, related))) { event.type = handleObj.origType; ret = handleObj.handler.apply(this, arguments); event.type = fix; } return ret; } }; }); // IE submit delegation if (!jQuery.support.submitBubbles) { jQuery.event.special.submit = { setup: function() { // Only need this for delegated form submit events if (jQuery.nodeName(this, "form")) { return false; } // Lazy-add a submit handler when a descendant form may potentially be submitted jQuery.event.add(this, "click._submit keypress._submit", function(e) { // Node name check avoids a VML-related crash in IE (#9807) var elem = e.target, form = jQuery.nodeName(elem, "input") || jQuery.nodeName(elem, "button") ? elem.form : undefined; if (form && !jQuery._data(form, "submitBubbles")) { jQuery.event.add(form, "submit._submit", function(event) { event._submit_bubble = true; }); jQuery._data(form, "submitBubbles", true); } }); // return undefined since we don't need an event listener }, postDispatch: function(event) { // If form was submitted by the user, bubble the event up the tree if (event._submit_bubble) { delete event._submit_bubble; if (this.parentNode && !event.isTrigger) { jQuery.event.simulate("submit", this.parentNode, event, true); } } }, teardown: function() { // Only need this for delegated form submit events if (jQuery.nodeName(this, "form")) { return false; } // Remove delegated handlers; cleanData eventually reaps submit handlers attached above jQuery.event.remove(this, "._submit"); } }; } // IE change delegation and checkbox/radio fix if (!jQuery.support.changeBubbles) { jQuery.event.special.change = { setup: function() { if (rformElems.test(this.nodeName)) { // IE doesn't fire change on a check/radio until blur; trigger it on click // after a propertychange. Eat the blur-change in special.change.handle. // This still fires onchange a second time for check/radio after blur. if (this.type === "checkbox" || this.type === "radio") { jQuery.event.add(this, "propertychange._change", function(event) { if (event.originalEvent.propertyName === "checked") { this._just_changed = true; } }); jQuery.event.add(this, "click._change", function(event) { if (this._just_changed && !event.isTrigger) { this._just_changed = false; } // Allow triggered, simulated change events (#11500) jQuery.event.simulate("change", this, event, true); }); } return false; } // Delegated event; lazy-add a change handler on descendant inputs jQuery.event.add(this, "beforeactivate._change", function(e) { var elem = e.target; if (rformElems.test(elem.nodeName) && !jQuery._data(elem, "changeBubbles")) { jQuery.event.add(elem, "change._change", function(event) { if (this.parentNode && !event.isSimulated && !event.isTrigger) { jQuery.event.simulate("change", this.parentNode, event, true); } }); jQuery._data(elem, "changeBubbles", true); } }); }, handle: function(event) { var elem = event.target; // Swallow native change events from checkbox/radio, we already triggered them above if (this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox")) { return event.handleObj.handler.apply(this, arguments); } }, teardown: function() { jQuery.event.remove(this, "._change"); return !rformElems.test(this.nodeName); } }; } // Create "bubbling" focus and blur events if (!jQuery.support.focusinBubbles) { jQuery.each({ focus: "focusin", blur: "focusout" }, function(orig, fix) { // Attach a single capturing handler while someone wants focusin/focusout var attaches = 0, handler = function(event) { jQuery.event.simulate(fix, event.target, jQuery.event.fix(event), true); }; jQuery.event.special[fix] = { setup: function() { if (attaches++ === 0) { document.addEventListener(orig, handler, true); } }, teardown: function() { if (--attaches === 0) { document.removeEventListener(orig, handler, true); } } }; }); } jQuery.fn.extend({ on: function(types, selector, data, fn, /*INTERNAL*/ one) { var type, origFn; // Types can be a map of types/handlers if (typeof types === "object") { // ( types-Object, selector, data ) if (typeof selector !== "string") { // ( types-Object, data ) data = data || selector; selector = undefined; } for (type in types) { this.on(type, selector, data, types[type], one); } return this; } if (data == null && fn == null) { // ( types, fn ) fn = selector; data = selector = undefined; } else if (fn == null) { if (typeof selector === "string") { // ( types, selector, fn ) fn = data; data = undefined; } else { // ( types, data, fn ) fn = data; data = selector; selector = undefined; } } if (fn === false) { fn = returnFalse; } else if (!fn) { return this; } if (one === 1) { origFn = fn; fn = function(event) { // Can use an empty set, since event contains the info jQuery().off(event); return origFn.apply(this, arguments); }; // Use same guid so caller can remove using origFn fn.guid = origFn.guid || (origFn.guid = jQuery.guid++); } return this.each(function() { jQuery.event.add(this, types, fn, data, selector); }); }, one: function(types, selector, data, fn) { return this.on(types, selector, data, fn, 1); }, off: function(types, selector, fn) { var handleObj, type; if (types && types.preventDefault && types.handleObj) { // ( event ) dispatched jQuery.Event handleObj = types.handleObj; jQuery(types.delegateTarget).off( handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, handleObj.selector, handleObj.handler); return this; } if (typeof types === "object") { // ( types-object [, selector] ) for (type in types) { this.off(type, selector, types[type]); } return this; } if (selector === false || typeof selector === "function") { // ( types [, fn] ) fn = selector; selector = undefined; } if (fn === false) { fn = returnFalse; } return this.each(function() { jQuery.event.remove(this, types, fn, selector); }); }, trigger: function(type, data) { return this.each(function() { jQuery.event.trigger(type, data, this); }); }, triggerHandler: function(type, data) { var elem = this[0]; if (elem) { return jQuery.event.trigger(type, data, elem, true); } } }); var isSimple = /^.[^:#\[\.,]*$/, rparentsprev = /^(?:parents|prev(?:Until|All))/, rneedsContext = jQuery.expr.match.needsContext, // methods guaranteed to produce a unique set when starting from a unique set guaranteedUnique = { children: true, contents: true, next: true, prev: true }; jQuery.fn.extend({ find: function(selector) { var i, ret = [], self = this, len = self.length; if (typeof selector !== "string") { return this.pushStack(jQuery(selector).filter(function() { for (i = 0; i < len; i++) { if (jQuery.contains(self[i], this)) { return true; } } })); } for (i = 0; i < len; i++) { jQuery.find(selector, self[i], ret); } // Needed because $( selector, context ) becomes $( context ).find( selector ) ret = this.pushStack(len > 1 ? jQuery.unique(ret) : ret); ret.selector = this.selector ? this.selector + " " + selector : selector; return ret; }, has: function(target) { var i, targets = jQuery(target, this), len = targets.length; return this.filter(function() { for (i = 0; i < len; i++) { if (jQuery.contains(this, targets[i])) { return true; } } }); }, not: function(selector) { return this.pushStack(winnow(this, selector || [], true)); }, filter: function(selector) { return this.pushStack(winnow(this, selector || [], false)); }, is: function(selector) { return !!winnow( this, // If this is a positional/relative selector, check membership in the returned set // so $("p:first").is("p:last") won't return true for a doc with two "p". typeof selector === "string" && rneedsContext.test(selector) ? jQuery(selector) : selector || [], false).length; }, closest: function(selectors, context) { var cur, i = 0, l = this.length, ret = [], pos = rneedsContext.test(selectors) || typeof selectors !== "string" ? jQuery(selectors, context || this.context) : 0; for (; i < l; i++) { for (cur = this[i]; cur && cur !== context; cur = cur.parentNode) { // Always skip document fragments if (cur.nodeType < 11 && (pos ? pos.index(cur) > -1 : // Don't pass non-elements to Sizzle cur.nodeType === 1 && jQuery.find.matchesSelector(cur, selectors))) { cur = ret.push(cur); break; } } } return this.pushStack(ret.length > 1 ? jQuery.unique(ret) : ret); }, // Determine the position of an element within // the matched set of elements index: function(elem) { // No argument, return index in parent if (!elem) { return (this[0] && this[0].parentNode) ? this.first().prevAll().length : -1; } // index in selector if (typeof elem === "string") { return jQuery.inArray(this[0], jQuery(elem)); } // Locate the position of the desired element return jQuery.inArray( // If it receives a jQuery object, the first element is used elem.jquery ? elem[0] : elem, this); }, add: function(selector, context) { var set = typeof selector === "string" ? jQuery(selector, context) : jQuery.makeArray(selector && selector.nodeType ? [selector] : selector), all = jQuery.merge(this.get(), set); return this.pushStack(jQuery.unique(all)); }, addBack: function(selector) { return this.add(selector == null ? this.prevObject : this.prevObject.filter(selector)); } }); function sibling(cur, dir) { do { cur = cur[dir]; } while (cur && cur.nodeType !== 1); return cur; } jQuery.each({ parent: function(elem) { var parent = elem.parentNode; return parent && parent.nodeType !== 11 ? parent : null; }, parents: function(elem) { return jQuery.dir(elem, "parentNode"); }, parentsUntil: function(elem, i, until) { return jQuery.dir(elem, "parentNode", until); }, next: function(elem) { return sibling(elem, "nextSibling"); }, prev: function(elem) { return sibling(elem, "previousSibling"); }, nextAll: function(elem) { return jQuery.dir(elem, "nextSibling"); }, prevAll: function(elem) { return jQuery.dir(elem, "previousSibling"); }, nextUntil: function(elem, i, until) { return jQuery.dir(elem, "nextSibling", until); }, prevUntil: function(elem, i, until) { return jQuery.dir(elem, "previousSibling", until); }, siblings: function(elem) { return jQuery.sibling((elem.parentNode || {}).firstChild, elem); }, children: function(elem) { return jQuery.sibling(elem.firstChild); }, contents: function(elem) { return jQuery.nodeName(elem, "iframe") ? elem.contentDocument || elem.contentWindow.document : jQuery.merge([], elem.childNodes); } }, function(name, fn) { jQuery.fn[name] = function(until, selector) { var ret = jQuery.map(this, fn, until); if (name.slice(-5) !== "Until") { selector = until; } if (selector && typeof selector === "string") { ret = jQuery.filter(selector, ret); } if (this.length > 1) { // Remove duplicates if (!guaranteedUnique[name]) { ret = jQuery.unique(ret); } // Reverse order for parents* and prev-derivatives if (rparentsprev.test(name)) { ret = ret.reverse(); } } return this.pushStack(ret); }; }); jQuery.extend({ filter: function(expr, elems, not) { var elem = elems[0]; if (not) { expr = ":not(" + expr + ")"; } return elems.length === 1 && elem.nodeType === 1 ? jQuery.find.matchesSelector(elem, expr) ? [elem] : [] : jQuery.find.matches(expr, jQuery.grep(elems, function(elem) { return elem.nodeType === 1; })); }, dir: function(elem, dir, until) { var matched = [], cur = elem[dir]; while (cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery(cur).is(until))) { if (cur.nodeType === 1) { matched.push(cur); } cur = cur[dir]; } return matched; }, sibling: function(n, elem) { var r = []; for (; n; n = n.nextSibling) { if (n.nodeType === 1 && n !== elem) { r.push(n); } } return r; } }); // Implement the identical functionality for filter and not function winnow(elements, qualifier, not) { if (jQuery.isFunction(qualifier)) { return jQuery.grep(elements, function(elem, i) { /* jshint -W018 */ return !!qualifier.call(elem, i, elem) !== not; }); } if (qualifier.nodeType) { return jQuery.grep(elements, function(elem) { return (elem === qualifier) !== not; }); } if (typeof qualifier === "string") { if (isSimple.test(qualifier)) { return jQuery.filter(qualifier, elements, not); } qualifier = jQuery.filter(qualifier, elements); } return jQuery.grep(elements, function(elem) { return (jQuery.inArray(elem, qualifier) >= 0) !== not; }); } function createSafeFragment(document) { var list = nodeNames.split("|"), safeFrag = document.createDocumentFragment(); if (safeFrag.createElement) { while (list.length) { safeFrag.createElement( list.pop()); } } return safeFrag; } var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), rleadingWhitespace = /^\s+/, rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, rtagName = /<([\w:]+)/, rtbody = /<tbody/i, rhtml = /<|&#?\w+;/, rnoInnerhtml = /<(?:script|style|link)/i, manipulation_rcheckableType = /^(?:checkbox|radio)$/i, // checked="checked" or checked rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, rscriptType = /^$|\/(?:java|ecma)script/i, rscriptTypeMasked = /^true\/(.*)/, rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, // We have to close these tags to support XHTML (#13200) wrapMap = { option: [1, "<select multiple='multiple'>", "</select>"], legend: [1, "<fieldset>", "</fieldset>"], area: [1, "<map>", "</map>"], param: [1, "<object>", "</object>"], thead: [1, "<table>", "</table>"], tr: [2, "<table><tbody>", "</tbody></table>"], col: [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"], td: [3, "<table><tbody><tr>", "</tr></tbody></table>"], // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, // unless wrapped in a div with non-breaking characters in front of it. _default: jQuery.support.htmlSerialize ? [0, "", ""] : [1, "X<div>", "</div>"] }, safeFragment = createSafeFragment(document), fragmentDiv = safeFragment.appendChild(document.createElement("div")); wrapMap.optgroup = wrapMap.option; wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; wrapMap.th = wrapMap.td; jQuery.fn.extend({ text: function(value) { return jQuery.access(this, function(value) { return value === undefined ? jQuery.text(this) : this.empty().append((this[0] && this[0].ownerDocument || document).createTextNode(value)); }, null, value, arguments.length); }, append: function() { return this.domManip(arguments, function(elem) { if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) { var target = manipulationTarget(this, elem); target.appendChild(elem); } }); }, prepend: function() { return this.domManip(arguments, function(elem) { if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) { var target = manipulationTarget(this, elem); target.insertBefore(elem, target.firstChild); } }); }, before: function() { return this.domManip(arguments, function(elem) { if (this.parentNode) { this.parentNode.insertBefore(elem, this); } }); }, after: function() { return this.domManip(arguments, function(elem) { if (this.parentNode) { this.parentNode.insertBefore(elem, this.nextSibling); } }); }, // keepData is for internal use only--do not document remove: function(selector, keepData) { var elem, elems = selector ? jQuery.filter(selector, this) : this, i = 0; for (; (elem = elems[i]) != null; i++) { if (!keepData && elem.nodeType === 1) { jQuery.cleanData(getAll(elem)); } if (elem.parentNode) { if (keepData && jQuery.contains(elem.ownerDocument, elem)) { setGlobalEval(getAll(elem, "script")); } elem.parentNode.removeChild(elem); } } return this; }, empty: function() { var elem, i = 0; for (; (elem = this[i]) != null; i++) { // Remove element nodes and prevent memory leaks if (elem.nodeType === 1) { jQuery.cleanData(getAll(elem, false)); } // Remove any remaining nodes while (elem.firstChild) { elem.removeChild(elem.firstChild); } // If this is a select, ensure that it displays empty (#12336) // Support: IE<9 if (elem.options && jQuery.nodeName(elem, "select")) { elem.options.length = 0; } } return this; }, clone: function(dataAndEvents, deepDataAndEvents) { dataAndEvents = dataAndEvents == null ? false : dataAndEvents; deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; return this.map(function() { return jQuery.clone(this, dataAndEvents, deepDataAndEvents); }); }, html: function(value) { return jQuery.access(this, function(value) { var elem = this[0] || {}, i = 0, l = this.length; if (value === undefined) { return elem.nodeType === 1 ? elem.innerHTML.replace(rinlinejQuery, "") : undefined; } // See if we can take a shortcut and just use innerHTML if (typeof value === "string" && !rnoInnerhtml.test(value) && (jQuery.support.htmlSerialize || !rnoshimcache.test(value)) && (jQuery.support.leadingWhitespace || !rleadingWhitespace.test(value)) && !wrapMap[(rtagName.exec(value) || ["", ""])[1].toLowerCase()]) { value = value.replace(rxhtmlTag, "<$1></$2>"); try { for (; i < l; i++) { // Remove element nodes and prevent memory leaks elem = this[i] || {}; if (elem.nodeType === 1) { jQuery.cleanData(getAll(elem, false)); elem.innerHTML = value; } } elem = 0; // If using innerHTML throws an exception, use the fallback method } catch (e) {} } if (elem) { this.empty().append(value); } }, null, value, arguments.length); }, replaceWith: function() { var // Snapshot the DOM in case .domManip sweeps something relevant into its fragment args = jQuery.map(this, function(elem) { return [elem.nextSibling, elem.parentNode]; }), i = 0; // Make the changes, replacing each context element with the new content this.domManip(arguments, function(elem) { var next = args[i++], parent = args[i++]; if (parent) { // Don't use the snapshot next if it has moved (#13810) if (next && next.parentNode !== parent) { next = this.nextSibling; } jQuery(this).remove(); parent.insertBefore(elem, next); } // Allow new content to include elements from the context set }, true); // Force removal if there was no new content (e.g., from empty arguments) return i ? this : this.remove(); }, detach: function(selector) { return this.remove(selector, true); }, domManip: function(args, callback, allowIntersection) { // Flatten any nested arrays args = core_concat.apply([], args); var first, node, hasScripts, scripts, doc, fragment, i = 0, l = this.length, set = this, iNoClone = l - 1, value = args[0], isFunction = jQuery.isFunction(value); // We can't cloneNode fragments that contain checked, in WebKit if (isFunction || !(l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test(value))) { return this.each(function(index) { var self = set.eq(index); if (isFunction) { args[0] = value.call(this, index, self.html()); } self.domManip(args, callback, allowIntersection); }); } if (l) { fragment = jQuery.buildFragment(args, this[0].ownerDocument, false, !allowIntersection && this); first = fragment.firstChild; if (fragment.childNodes.length === 1) { fragment = first; } if (first) { scripts = jQuery.map(getAll(fragment, "script"), disableScript); hasScripts = scripts.length; // Use the original fragment for the last item instead of the first because it can end up // being emptied incorrectly in certain situations (#8070). for (; i < l; i++) { node = fragment; if (i !== iNoClone) { node = jQuery.clone(node, true, true); // Keep references to cloned scripts for later restoration if (hasScripts) { jQuery.merge(scripts, getAll(node, "script")); } } callback.call(this[i], node, i); } if (hasScripts) { doc = scripts[scripts.length - 1].ownerDocument; // Reenable scripts jQuery.map(scripts, restoreScript); // Evaluate executable scripts on first document insertion for (i = 0; i < hasScripts; i++) { node = scripts[i]; if (rscriptType.test(node.type || "") && !jQuery._data(node, "globalEval") && jQuery.contains(doc, node)) { if (node.src) { // Hope ajax is available... jQuery._evalUrl(node.src); } else { jQuery.globalEval((node.text || node.textContent || node.innerHTML || "").replace(rcleanScript, "")); } } } } // Fix #11809: Avoid leaking memory fragment = first = null; } } return this; } }); // Support: IE<8 // Manipulating tables requires a tbody function manipulationTarget(elem, content) { return jQuery.nodeName(elem, "table") && jQuery.nodeName(content.nodeType === 1 ? content : content.firstChild, "tr") ? elem.getElementsByTagName("tbody")[0] || elem.appendChild(elem.ownerDocument.createElement("tbody")) : elem; } // Replace/restore the type attribute of script elements for safe DOM manipulation function disableScript(elem) { elem.type = (jQuery.find.attr(elem, "type") !== null) + "/" + elem.type; return elem; } function restoreScript(elem) { var match = rscriptTypeMasked.exec(elem.type); if (match) { elem.type = match[1]; } else { elem.removeAttribute("type"); } return elem; } // Mark scripts as having already been evaluated function setGlobalEval(elems, refElements) { var elem, i = 0; for (; (elem = elems[i]) != null; i++) { jQuery._data(elem, "globalEval", !refElements || jQuery._data(refElements[i], "globalEval")); } } function cloneCopyEvent(src, dest) { if (dest.nodeType !== 1 || !jQuery.hasData(src)) { return; } var type, i, l, oldData = jQuery._data(src), curData = jQuery._data(dest, oldData), events = oldData.events; if (events) { delete curData.handle; curData.events = {}; for (type in events) { for (i = 0, l = events[type].length; i < l; i++) { jQuery.event.add(dest, type, events[type][i]); } } } // make the cloned public data object a copy from the original if (curData.data) { curData.data = jQuery.extend({}, curData.data); } } function fixCloneNodeIssues(src, dest) { var nodeName, e, data; // We do not need to do anything for non-Elements if (dest.nodeType !== 1) { return; } nodeName = dest.nodeName.toLowerCase(); // IE6-8 copies events bound via attachEvent when using cloneNode. if (!jQuery.support.noCloneEvent && dest[jQuery.expando]) { data = jQuery._data(dest); for (e in data.events) { jQuery.removeEvent(dest, e, data.handle); } // Event data gets referenced instead of copied if the expando gets copied too dest.removeAttribute(jQuery.expando); } // IE blanks contents when cloning scripts, and tries to evaluate newly-set text if (nodeName === "script" && dest.text !== src.text) { disableScript(dest).text = src.text; restoreScript(dest); // IE6-10 improperly clones children of object elements using classid. // IE10 throws NoModificationAllowedError if parent is null, #12132. } else if (nodeName === "object") { if (dest.parentNode) { dest.outerHTML = src.outerHTML; } // This path appears unavoidable for IE9. When cloning an object // element in IE9, the outerHTML strategy above is not sufficient. // If the src has innerHTML and the destination does not, // copy the src.innerHTML into the dest.innerHTML. #10324 if (jQuery.support.html5Clone && (src.innerHTML && !jQuery.trim(dest.innerHTML))) { dest.innerHTML = src.innerHTML; } } else if (nodeName === "input" && manipulation_rcheckableType.test(src.type)) { // IE6-8 fails to persist the checked state of a cloned checkbox // or radio button. Worse, IE6-7 fail to give the cloned element // a checked appearance if the defaultChecked value isn't also set dest.defaultChecked = dest.checked = src.checked; // IE6-7 get confused and end up setting the value of a cloned // checkbox/radio button to an empty string instead of "on" if (dest.value !== src.value) { dest.value = src.value; } // IE6-8 fails to return the selected option to the default selected // state when cloning options } else if (nodeName === "option") { dest.defaultSelected = dest.selected = src.defaultSelected; // IE6-8 fails to set the defaultValue to the correct value when // cloning other types of input fields } else if (nodeName === "input" || nodeName === "textarea") { dest.defaultValue = src.defaultValue; } } jQuery.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function(name, original) { jQuery.fn[name] = function(selector) { var elems, i = 0, ret = [], insert = jQuery(selector), last = insert.length - 1; for (; i <= last; i++) { elems = i === last ? this : this.clone(true); jQuery(insert[i])[original](elems); // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() core_push.apply(ret, elems.get()); } return this.pushStack(ret); }; }); function getAll(context, tag) { var elems, elem, i = 0, found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName(tag || "*") : typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll(tag || "*") : undefined; if (!found) { for (found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++) { if (!tag || jQuery.nodeName(elem, tag)) { found.push(elem); } else { jQuery.merge(found, getAll(elem, tag)); } } } return tag === undefined || tag && jQuery.nodeName(context, tag) ? jQuery.merge([context], found) : found; } // Used in buildFragment, fixes the defaultChecked property function fixDefaultChecked(elem) { if (manipulation_rcheckableType.test(elem.type)) { elem.defaultChecked = elem.checked; } } jQuery.extend({ clone: function(elem, dataAndEvents, deepDataAndEvents) { var destElements, node, clone, i, srcElements, inPage = jQuery.contains(elem.ownerDocument, elem); if (jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test("<" + elem.nodeName + ">")) { clone = elem.cloneNode(true); // IE<=8 does not properly clone detached, unknown element nodes } else { fragmentDiv.innerHTML = elem.outerHTML; fragmentDiv.removeChild(clone = fragmentDiv.firstChild); } if ((!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem)) { // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 destElements = getAll(clone); srcElements = getAll(elem); // Fix all IE cloning issues for (i = 0; (node = srcElements[i]) != null; ++i) { // Ensure that the destination node is not null; Fixes #9587 if (destElements[i]) { fixCloneNodeIssues(node, destElements[i]); } } } // Copy the events from the original to the clone if (dataAndEvents) { if (deepDataAndEvents) { srcElements = srcElements || getAll(elem); destElements = destElements || getAll(clone); for (i = 0; (node = srcElements[i]) != null; i++) { cloneCopyEvent(node, destElements[i]); } } else { cloneCopyEvent(elem, clone); } } // Preserve script evaluation history destElements = getAll(clone, "script"); if (destElements.length > 0) { setGlobalEval(destElements, !inPage && getAll(elem, "script")); } destElements = srcElements = node = null; // Return the cloned set return clone; }, buildFragment: function(elems, context, scripts, selection) { var j, elem, contains, tmp, tag, tbody, wrap, l = elems.length, // Ensure a safe fragment safe = createSafeFragment(context), nodes = [], i = 0; for (; i < l; i++) { elem = elems[i]; if (elem || elem === 0) { // Add nodes directly if (jQuery.type(elem) === "object") { jQuery.merge(nodes, elem.nodeType ? [elem] : elem); // Convert non-html into a text node } else if (!rhtml.test(elem)) { nodes.push(context.createTextNode(elem)); // Convert html into DOM nodes } else { tmp = tmp || safe.appendChild(context.createElement("div")); // Deserialize a standard representation tag = (rtagName.exec(elem) || ["", ""])[1].toLowerCase(); wrap = wrapMap[tag] || wrapMap._default; tmp.innerHTML = wrap[1] + elem.replace(rxhtmlTag, "<$1></$2>") + wrap[2]; // Descend through wrappers to the right content j = wrap[0]; while (j--) { tmp = tmp.lastChild; } // Manually add leading whitespace removed by IE if (!jQuery.support.leadingWhitespace && rleadingWhitespace.test(elem)) { nodes.push(context.createTextNode(rleadingWhitespace.exec(elem)[0])); } // Remove IE's autoinserted <tbody> from table fragments if (!jQuery.support.tbody) { // String was a <table>, *may* have spurious <tbody> elem = tag === "table" && !rtbody.test(elem) ? tmp.firstChild : // String was a bare <thead> or <tfoot> wrap[1] === "<table>" && !rtbody.test(elem) ? tmp : 0; j = elem && elem.childNodes.length; while (j--) { if (jQuery.nodeName((tbody = elem.childNodes[j]), "tbody") && !tbody.childNodes.length) { elem.removeChild(tbody); } } } jQuery.merge(nodes, tmp.childNodes); // Fix #12392 for WebKit and IE > 9 tmp.textContent = ""; // Fix #12392 for oldIE while (tmp.firstChild) { tmp.removeChild(tmp.firstChild); } // Remember the top-level container for proper cleanup tmp = safe.lastChild; } } } // Fix #11356: Clear elements from fragment if (tmp) { safe.removeChild(tmp); } // Reset defaultChecked for any radios and checkboxes // about to be appended to the DOM in IE 6/7 (#8060) if (!jQuery.support.appendChecked) { jQuery.grep(getAll(nodes, "input"), fixDefaultChecked); } i = 0; while ((elem = nodes[i++])) { // #4087 - If origin and destination elements are the same, and this is // that element, do not do anything if (selection && jQuery.inArray(elem, selection) !== -1) { continue; } contains = jQuery.contains(elem.ownerDocument, elem); // Append to fragment tmp = getAll(safe.appendChild(elem), "script"); // Preserve script evaluation history if (contains) { setGlobalEval(tmp); } // Capture executables if (scripts) { j = 0; while ((elem = tmp[j++])) { if (rscriptType.test(elem.type || "")) { scripts.push(elem); } } } } tmp = null; return safe; }, cleanData: function(elems, /* internal */ acceptData) { var elem, type, id, data, i = 0, internalKey = jQuery.expando, cache = jQuery.cache, deleteExpando = jQuery.support.deleteExpando, special = jQuery.event.special; for (; (elem = elems[i]) != null; i++) { if (acceptData || jQuery.acceptData(elem)) { id = elem[internalKey]; data = id && cache[id]; if (data) { if (data.events) { for (type in data.events) { if (special[type]) { jQuery.event.remove(elem, type); // This is a shortcut to avoid jQuery.event.remove's overhead } else { jQuery.removeEvent(elem, type, data.handle); } } } // Remove cache only if it was not already removed by jQuery.event.remove if (cache[id]) { delete cache[id]; // IE does not allow us to delete expando properties from nodes, // nor does it have a removeAttribute function on Document nodes; // we must handle all of these cases if (deleteExpando) { delete elem[internalKey]; } else if (typeof elem.removeAttribute !== core_strundefined) { elem.removeAttribute(internalKey); } else { elem[internalKey] = null; } core_deletedIds.push(id); } } } } }, _evalUrl: function(url) { return jQuery.ajax({ url: url, type: "GET", dataType: "script", async: false, global: false, "throws": true }); } }); jQuery.fn.extend({ wrapAll: function(html) { if (jQuery.isFunction(html)) { return this.each(function(i) { jQuery(this).wrapAll(html.call(this, i)); }); } if (this[0]) { // The elements to wrap the target around var wrap = jQuery(html, this[0].ownerDocument).eq(0).clone(true); if (this[0].parentNode) { wrap.insertBefore(this[0]); } wrap.map(function() { var elem = this; while (elem.firstChild && elem.firstChild.nodeType === 1) { elem = elem.firstChild; } return elem; }).append(this); } return this; }, wrapInner: function(html) { if (jQuery.isFunction(html)) { return this.each(function(i) { jQuery(this).wrapInner(html.call(this, i)); }); } return this.each(function() { var self = jQuery(this), contents = self.contents(); if (contents.length) { contents.wrapAll(html); } else { self.append(html); } }); }, wrap: function(html) { var isFunction = jQuery.isFunction(html); return this.each(function(i) { jQuery(this).wrapAll(isFunction ? html.call(this, i) : html); }); }, unwrap: function() { return this.parent().each(function() { if (!jQuery.nodeName(this, "body")) { jQuery(this).replaceWith(this.childNodes); } }).end(); } }); var iframe, getStyles, curCSS, ralpha = /alpha\([^)]*\)/i, ropacity = /opacity\s*=\s*([^)]*)/, rposition = /^(top|right|bottom|left)$/, // swappable if display is none or starts with table except "table", "table-cell", or "table-caption" // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display rdisplayswap = /^(none|table(?!-c[ea]).+)/, rmargin = /^margin/, rnumsplit = new RegExp("^(" + core_pnum + ")(.*)$", "i"), rnumnonpx = new RegExp("^(" + core_pnum + ")(?!px)[a-z%]+$", "i"), rrelNum = new RegExp("^([+-])=(" + core_pnum + ")", "i"), elemdisplay = { BODY: "block" }, cssShow = { position: "absolute", visibility: "hidden", display: "block" }, cssNormalTransform = { letterSpacing: 0, fontWeight: 400 }, cssExpand = ["Top", "Right", "Bottom", "Left"], cssPrefixes = ["Webkit", "O", "Moz", "ms"]; // return a css property mapped to a potentially vendor prefixed property function vendorPropName(style, name) { // shortcut for names that are not vendor prefixed if (name in style) { return name; } // check for vendor prefixed names var capName = name.charAt(0).toUpperCase() + name.slice(1), origName = name, i = cssPrefixes.length; while (i--) { name = cssPrefixes[i] + capName; if (name in style) { return name; } } return origName; } function isHidden(elem, el) { // isHidden might be called from jQuery#filter function; // in that case, element will be second argument elem = el || elem; return jQuery.css(elem, "display") === "none" || !jQuery.contains(elem.ownerDocument, elem); } function showHide(elements, show) { var display, elem, hidden, values = [], index = 0, length = elements.length; for (; index < length; index++) { elem = elements[index]; if (!elem.style) { continue; } values[index] = jQuery._data(elem, "olddisplay"); display = elem.style.display; if (show) { // Reset the inline display of this element to learn if it is // being hidden by cascaded rules or not if (!values[index] && display === "none") { elem.style.display = ""; } // Set elements which have been overridden with display: none // in a stylesheet to whatever the default browser style is // for such an element if (elem.style.display === "" && isHidden(elem)) { values[index] = jQuery._data(elem, "olddisplay", css_defaultDisplay(elem.nodeName)); } } else { if (!values[index]) { hidden = isHidden(elem); if (display && display !== "none" || !hidden) { jQuery._data(elem, "olddisplay", hidden ? display : jQuery.css(elem, "display")); } } } } // Set the display of most of the elements in a second loop // to avoid the constant reflow for (index = 0; index < length; index++) { elem = elements[index]; if (!elem.style) { continue; } if (!show || elem.style.display === "none" || elem.style.display === "") { elem.style.display = show ? values[index] || "" : "none"; } } return elements; } jQuery.fn.extend({ css: function(name, value) { return jQuery.access(this, function(elem, name, value) { var len, styles, map = {}, i = 0; if (jQuery.isArray(name)) { styles = getStyles(elem); len = name.length; for (; i < len; i++) { map[name[i]] = jQuery.css(elem, name[i], false, styles); } return map; } return value !== undefined ? jQuery.style(elem, name, value) : jQuery.css(elem, name); }, name, value, arguments.length > 1); }, show: function() { return showHide(this, true); }, hide: function() { return showHide(this); }, toggle: function(state) { if (typeof state === "boolean") { return state ? this.show() : this.hide(); } return this.each(function() { if (isHidden(this)) { jQuery(this).show(); } else { jQuery(this).hide(); } }); } }); jQuery.extend({ // Add in style property hooks for overriding the default // behavior of getting and setting a style property cssHooks: { opacity: { get: function(elem, computed) { if (computed) { // We should always get a number back from opacity var ret = curCSS(elem, "opacity"); return ret === "" ? "1" : ret; } } } }, // Don't automatically add "px" to these possibly-unitless properties cssNumber: { "columnCount": true, "fillOpacity": true, "fontWeight": true, "lineHeight": true, "opacity": true, "order": true, "orphans": true, "widows": true, "zIndex": true, "zoom": true }, // Add in properties whose names you wish to fix before // setting or getting the value cssProps: { // normalize float css property "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat" }, // Get and set the style property on a DOM Node style: function(elem, name, value, extra) { // Don't set styles on text and comment nodes if (!elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style) { return; } // Make sure that we're working with the right name var ret, type, hooks, origName = jQuery.camelCase(name), style = elem.style; name = jQuery.cssProps[origName] || (jQuery.cssProps[origName] = vendorPropName(style, origName)); // gets hook for the prefixed version // followed by the unprefixed version hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName]; // Check if we're setting a value if (value !== undefined) { type = typeof value; // convert relative number strings (+= or -=) to relative numbers. #7345 if (type === "string" && (ret = rrelNum.exec(value))) { value = (ret[1] + 1) * ret[2] + parseFloat(jQuery.css(elem, name)); // Fixes bug #9237 type = "number"; } // Make sure that NaN and null values aren't set. See: #7116 if (value == null || type === "number" && isNaN(value)) { return; } // If a number was passed in, add 'px' to the (except for certain CSS properties) if (type === "number" && !jQuery.cssNumber[origName]) { value += "px"; } // Fixes #8908, it can be done more correctly by specifing setters in cssHooks, // but it would mean to define eight (for every problematic property) identical functions if (!jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0) { style[name] = "inherit"; } // If a hook was provided, use that value, otherwise just set the specified value if (!hooks || !("set" in hooks) || (value = hooks.set(elem, value, extra)) !== undefined) { // Wrapped to prevent IE from throwing errors when 'invalid' values are provided // Fixes bug #5509 try { style[name] = value; } catch (e) {} } } else { // If a hook was provided get the non-computed value from there if (hooks && "get" in hooks && (ret = hooks.get(elem, false, extra)) !== undefined) { return ret; } // Otherwise just get the value from the style object return style[name]; } }, css: function(elem, name, extra, styles) { var num, val, hooks, origName = jQuery.camelCase(name); // Make sure that we're working with the right name name = jQuery.cssProps[origName] || (jQuery.cssProps[origName] = vendorPropName(elem.style, origName)); // gets hook for the prefixed version // followed by the unprefixed version hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName]; // If a hook was provided get the computed value from there if (hooks && "get" in hooks) { val = hooks.get(elem, true, extra); } // Otherwise, if a way to get the computed value exists, use that if (val === undefined) { val = curCSS(elem, name, styles); } //convert "normal" to computed value if (val === "normal" && name in cssNormalTransform) { val = cssNormalTransform[name]; } // Return, converting to number if forced or a qualifier was provided and val looks numeric if (extra === "" || extra) { num = parseFloat(val); return extra === true || jQuery.isNumeric(num) ? num || 0 : val; } return val; } }); // NOTE: we've included the "window" in window.getComputedStyle // because jsdom on node.js will break without it. if (window.getComputedStyle) { getStyles = function(elem) { return window.getComputedStyle(elem, null); }; curCSS = function(elem, name, _computed) { var width, minWidth, maxWidth, computed = _computed || getStyles(elem), // getPropertyValue is only needed for .css('filter') in IE9, see #12537 ret = computed ? computed.getPropertyValue(name) || computed[name] : undefined, style = elem.style; if (computed) { if (ret === "" && !jQuery.contains(elem.ownerDocument, elem)) { ret = jQuery.style(elem, name); } // A tribute to the "awesome hack by Dean Edwards" // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values if (rnumnonpx.test(ret) && rmargin.test(name)) { // Remember the original values width = style.width; minWidth = style.minWidth; maxWidth = style.maxWidth; // Put in the new values to get a computed value out style.minWidth = style.maxWidth = style.width = ret; ret = computed.width; // Revert the changed values style.width = width; style.minWidth = minWidth; style.maxWidth = maxWidth; } } return ret; }; } else if (document.documentElement.currentStyle) { getStyles = function(elem) { return elem.currentStyle; }; curCSS = function(elem, name, _computed) { var left, rs, rsLeft, computed = _computed || getStyles(elem), ret = computed ? computed[name] : undefined, style = elem.style; // Avoid setting ret to empty string here // so we don't default to auto if (ret == null && style && style[name]) { ret = style[name]; } // From the awesome hack by Dean Edwards // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 // If we're not dealing with a regular pixel number // but a number that has a weird ending, we need to convert it to pixels // but not position css attributes, as those are proportional to the parent element instead // and we can't measure the parent instead because it might trigger a "stacking dolls" problem if (rnumnonpx.test(ret) && !rposition.test(name)) { // Remember the original values left = style.left; rs = elem.runtimeStyle; rsLeft = rs && rs.left; // Put in the new values to get a computed value out if (rsLeft) { rs.left = elem.currentStyle.left; } style.left = name === "fontSize" ? "1em" : ret; ret = style.pixelLeft + "px"; // Revert the changed values style.left = left; if (rsLeft) { rs.left = rsLeft; } } return ret === "" ? "auto" : ret; }; } function setPositiveNumber(elem, value, subtract) { var matches = rnumsplit.exec(value); return matches ? // Guard against undefined "subtract", e.g., when used as in cssHooks Math.max(0, matches[1] - (subtract || 0)) + (matches[2] || "px") : value; } function augmentWidthOrHeight(elem, name, extra, isBorderBox, styles) { var i = extra === (isBorderBox ? "border" : "content") ? // If we already have the right measurement, avoid augmentation 4 : // Otherwise initialize for horizontal or vertical properties name === "width" ? 1 : 0, val = 0; for (; i < 4; i += 2) { // both box models exclude margin, so add it if we want it if (extra === "margin") { val += jQuery.css(elem, extra + cssExpand[i], true, styles); } if (isBorderBox) { // border-box includes padding, so remove it if we want content if (extra === "content") { val -= jQuery.css(elem, "padding" + cssExpand[i], true, styles); } // at this point, extra isn't border nor margin, so remove border if (extra !== "margin") { val -= jQuery.css(elem, "border" + cssExpand[i] + "Width", true, styles); } } else { // at this point, extra isn't content, so add padding val += jQuery.css(elem, "padding" + cssExpand[i], true, styles); // at this point, extra isn't content nor padding, so add border if (extra !== "padding") { val += jQuery.css(elem, "border" + cssExpand[i] + "Width", true, styles); } } } return val; } function getWidthOrHeight(elem, name, extra) { // Start with offset property, which is equivalent to the border-box value var valueIsBorderBox = true, val = name === "width" ? elem.offsetWidth : elem.offsetHeight, styles = getStyles(elem), isBorderBox = jQuery.support.boxSizing && jQuery.css(elem, "boxSizing", false, styles) === "border-box"; // some non-html elements return undefined for offsetWidth, so check for null/undefined // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 if (val <= 0 || val == null) { // Fall back to computed then uncomputed css if necessary val = curCSS(elem, name, styles); if (val < 0 || val == null) { val = elem.style[name]; } // Computed unit is not pixels. Stop here and return. if (rnumnonpx.test(val)) { return val; } // we need the check for style in case a browser which returns unreliable values // for getComputedStyle silently falls back to the reliable elem.style valueIsBorderBox = isBorderBox && (jQuery.support.boxSizingReliable || val === elem.style[name]); // Normalize "", auto, and prepare for extra val = parseFloat(val) || 0; } // use the active box-sizing model to add/subtract irrelevant styles return (val + augmentWidthOrHeight( elem, name, extra || (isBorderBox ? "border" : "content"), valueIsBorderBox, styles)) + "px"; } // Try to determine the default display value of an element function css_defaultDisplay(nodeName) { var doc = document, display = elemdisplay[nodeName]; if (!display) { display = actualDisplay(nodeName, doc); // If the simple way fails, read from inside an iframe if (display === "none" || !display) { // Use the already-created iframe if possible iframe = (iframe || jQuery("<iframe frameborder='0' width='0' height='0'/>") .css("cssText", "display:block !important")).appendTo(doc.documentElement); // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse doc = (iframe[0].contentWindow || iframe[0].contentDocument).document; doc.write("<!doctype html><html><body>"); doc.close(); display = actualDisplay(nodeName, doc); iframe.detach(); } // Store the correct default display elemdisplay[nodeName] = display; } return display; } // Called ONLY from within css_defaultDisplay function actualDisplay(name, doc) { var elem = jQuery(doc.createElement(name)).appendTo(doc.body), display = jQuery.css(elem[0], "display"); elem.remove(); return display; } jQuery.each(["height", "width"], function(i, name) { jQuery.cssHooks[name] = { get: function(elem, computed, extra) { if (computed) { // certain elements can have dimension info if we invisibly show them // however, it must have a current display style that would benefit from this return elem.offsetWidth === 0 && rdisplayswap.test(jQuery.css(elem, "display")) ? jQuery.swap(elem, cssShow, function() { return getWidthOrHeight(elem, name, extra); }) : getWidthOrHeight(elem, name, extra); } }, set: function(elem, value, extra) { var styles = extra && getStyles(elem); return setPositiveNumber(elem, value, extra ? augmentWidthOrHeight( elem, name, extra, jQuery.support.boxSizing && jQuery.css(elem, "boxSizing", false, styles) === "border-box", styles) : 0); } }; }); if (!jQuery.support.opacity) { jQuery.cssHooks.opacity = { get: function(elem, computed) { // IE uses filters for opacity return ropacity.test((computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "") ? (0.01 * parseFloat(RegExp.$1)) + "" : computed ? "1" : ""; }, set: function(elem, value) { var style = elem.style, currentStyle = elem.currentStyle, opacity = jQuery.isNumeric(value) ? "alpha(opacity=" + value * 100 + ")" : "", filter = currentStyle && currentStyle.filter || style.filter || ""; // IE has trouble with opacity if it does not have layout // Force it by setting the zoom level style.zoom = 1; // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652 // if value === "", then remove inline opacity #12685 if ((value >= 1 || value === "") && jQuery.trim(filter.replace(ralpha, "")) === "" && style.removeAttribute) { // Setting style.filter to null, "" & " " still leave "filter:" in the cssText // if "filter:" is present at all, clearType is disabled, we want to avoid this // style.removeAttribute is IE Only, but so apparently is this code path... style.removeAttribute("filter"); // if there is no filter style applied in a css rule or unset inline opacity, we are done if (value === "" || currentStyle && !currentStyle.filter) { return; } } // otherwise, set new filter values style.filter = ralpha.test(filter) ? filter.replace(ralpha, opacity) : filter + " " + opacity; } }; } // These hooks cannot be added until DOM ready because the support test // for it is not run until after DOM ready jQuery(function() { if (!jQuery.support.reliableMarginRight) { jQuery.cssHooks.marginRight = { get: function(elem, computed) { if (computed) { // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right // Work around by temporarily setting element display to inline-block return jQuery.swap(elem, { "display": "inline-block" }, curCSS, [elem, "marginRight"]); } } }; } // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 // getComputedStyle returns percent when specified for top/left/bottom/right // rather than make the css module depend on the offset module, we just check for it here if (!jQuery.support.pixelPosition && jQuery.fn.position) { jQuery.each(["top", "left"], function(i, prop) { jQuery.cssHooks[prop] = { get: function(elem, computed) { if (computed) { computed = curCSS(elem, prop); // if curCSS returns percentage, fallback to offset return rnumnonpx.test(computed) ? jQuery(elem).position()[prop] + "px" : computed; } } }; }); } }); if (jQuery.expr && jQuery.expr.filters) { jQuery.expr.filters.hidden = function(elem) { // Support: Opera <= 12.12 // Opera reports offsetWidths and offsetHeights less than zero on some elements return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css(elem, "display")) === "none"); }; jQuery.expr.filters.visible = function(elem) { return !jQuery.expr.filters.hidden(elem); }; } // These hooks are used by animate to expand properties jQuery.each({ margin: "", padding: "", border: "Width" }, function(prefix, suffix) { jQuery.cssHooks[prefix + suffix] = { expand: function(value) { var i = 0, expanded = {}, // assumes a single number if not a string parts = typeof value === "string" ? value.split(" ") : [value]; for (; i < 4; i++) { expanded[prefix + cssExpand[i] + suffix] = parts[i] || parts[i - 2] || parts[0]; } return expanded; } }; if (!rmargin.test(prefix)) { jQuery.cssHooks[prefix + suffix].set = setPositiveNumber; } }); var r20 = /%20/g, rbracket = /\[\]$/, rCRLF = /\r?\n/g, rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, rsubmittable = /^(?:input|select|textarea|keygen)/i; jQuery.fn.extend({ serialize: function() { return jQuery.param(this.serializeArray()); }, serializeArray: function() { return this.map(function() { // Can add propHook for "elements" to filter or add form elements var elements = jQuery.prop(this, "elements"); return elements ? jQuery.makeArray(elements) : this; }) .filter(function() { var type = this.type; // Use .is(":disabled") so that fieldset[disabled] works return this.name && !jQuery(this).is(":disabled") && rsubmittable.test(this.nodeName) && !rsubmitterTypes.test(type) && (this.checked || !manipulation_rcheckableType.test(type)); }) .map(function(i, elem) { var val = jQuery(this).val(); return val == null ? null : jQuery.isArray(val) ? jQuery.map(val, function(val) { return { name: elem.name, value: val.replace(rCRLF, "\r\n") }; }) : { name: elem.name, value: val.replace(rCRLF, "\r\n") }; }).get(); } }); //Serialize an array of form elements or a set of //key/values into a query string jQuery.param = function(a, traditional) { var prefix, s = [], add = function(key, value) { // If value is a function, invoke it and return its value value = jQuery.isFunction(value) ? value() : (value == null ? "" : value); s[s.length] = encodeURIComponent(key) + "=" + encodeURIComponent(value); }; // Set traditional to true for jQuery <= 1.3.2 behavior. if (traditional === undefined) { traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; } // If an array was passed in, assume that it is an array of form elements. if (jQuery.isArray(a) || (a.jquery && !jQuery.isPlainObject(a))) { // Serialize the form elements jQuery.each(a, function() { add(this.name, this.value); }); } else { // If traditional, encode the "old" way (the way 1.3.2 or older // did it), otherwise encode params recursively. for (prefix in a) { buildParams(prefix, a[prefix], traditional, add); } } // Return the resulting serialization return s.join("&").replace(r20, "+"); }; function buildParams(prefix, obj, traditional, add) { var name; if (jQuery.isArray(obj)) { // Serialize array item. jQuery.each(obj, function(i, v) { if (traditional || rbracket.test(prefix)) { // Treat each array item as a scalar. add(prefix, v); } else { // Item is non-scalar (array or object), encode its numeric index. buildParams(prefix + "[" + (typeof v === "object" ? i : "") + "]", v, traditional, add); } }); } else if (!traditional && jQuery.type(obj) === "object") { // Serialize object item. for (name in obj) { buildParams(prefix + "[" + name + "]", obj[name], traditional, add); } } else { // Serialize scalar item. add(prefix, obj); } } jQuery.each(("blur focus focusin focusout load resize scroll unload click dblclick " + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + "change select submit keydown keypress keyup error contextmenu").split(" "), function(i, name) { // Handle event binding jQuery.fn[name] = function(data, fn) { return arguments.length > 0 ? this.on(name, null, data, fn) : this.trigger(name); }; }); jQuery.fn.extend({ hover: function(fnOver, fnOut) { return this.mouseenter(fnOver).mouseleave(fnOut || fnOver); }, bind: function(types, data, fn) { return this.on(types, null, data, fn); }, unbind: function(types, fn) { return this.off(types, null, fn); }, delegate: function(selector, types, data, fn) { return this.on(types, selector, data, fn); }, undelegate: function(selector, types, fn) { // ( namespace ) or ( selector, types [, fn] ) return arguments.length === 1 ? this.off(selector, "**") : this.off(types, selector || "**", fn); } }); var // Document location ajaxLocParts, ajaxLocation, ajax_nonce = jQuery.now(), ajax_rquery = /\?/, rhash = /#.*$/, rts = /([?&])_=[^&]*/, rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL // #7653, #8125, #8152: local protocol detection rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, rnoContent = /^(?:GET|HEAD)$/, rprotocol = /^\/\//, rurl = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/, // Keep a copy of the old load method _load = jQuery.fn.load, /* Prefilters * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) * 2) These are called: * - BEFORE asking for a transport * - AFTER param serialization (s.data is a string if s.processData is true) * 3) key is the dataType * 4) the catchall symbol "*" can be used * 5) execution will start with transport dataType and THEN continue down to "*" if needed */ prefilters = {}, /* Transports bindings * 1) key is the dataType * 2) the catchall symbol "*" can be used * 3) selection will start with transport dataType and THEN go to "*" if needed */ transports = {}, // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression allTypes = "*/".concat("*"); // #8138, IE may throw an exception when accessing // a field from window.location if document.domain has been set try { ajaxLocation = location.href; } catch (e) { // Use the href attribute of an A element // since IE will modify it given document.location ajaxLocation = document.createElement("a"); ajaxLocation.href = ""; ajaxLocation = ajaxLocation.href; } // Segment location into parts ajaxLocParts = rurl.exec(ajaxLocation.toLowerCase()) || []; // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport function addToPrefiltersOrTransports(structure) { // dataTypeExpression is optional and defaults to "*" return function(dataTypeExpression, func) { if (typeof dataTypeExpression !== "string") { func = dataTypeExpression; dataTypeExpression = "*"; } var dataType, i = 0, dataTypes = dataTypeExpression.toLowerCase().match(core_rnotwhite) || []; if (jQuery.isFunction(func)) { // For each dataType in the dataTypeExpression while ((dataType = dataTypes[i++])) { // Prepend if requested if (dataType[0] === "+") { dataType = dataType.slice(1) || "*"; (structure[dataType] = structure[dataType] || []).unshift(func); // Otherwise append } else { (structure[dataType] = structure[dataType] || []).push(func); } } } }; } // Base inspection function for prefilters and transports function inspectPrefiltersOrTransports(structure, options, originalOptions, jqXHR) { var inspected = {}, seekingTransport = (structure === transports); function inspect(dataType) { var selected; inspected[dataType] = true; jQuery.each(structure[dataType] || [], function(_, prefilterOrFactory) { var dataTypeOrTransport = prefilterOrFactory(options, originalOptions, jqXHR); if (typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[dataTypeOrTransport]) { options.dataTypes.unshift(dataTypeOrTransport); inspect(dataTypeOrTransport); return false; } else if (seekingTransport) { return !(selected = dataTypeOrTransport); } }); return selected; } return inspect(options.dataTypes[0]) || !inspected["*"] && inspect("*"); } // A special extend for ajax options // that takes "flat" options (not to be deep extended) // Fixes #9887 function ajaxExtend(target, src) { var deep, key, flatOptions = jQuery.ajaxSettings.flatOptions || {}; for (key in src) { if (src[key] !== undefined) { (flatOptions[key] ? target : (deep || (deep = {})))[key] = src[key]; } } if (deep) { jQuery.extend(true, target, deep); } return target; } jQuery.fn.load = function(url, params, callback) { if (typeof url !== "string" && _load) { return _load.apply(this, arguments); } var selector, response, type, self = this, off = url.indexOf(" "); if (off >= 0) { selector = url.slice(off, url.length); url = url.slice(0, off); } // If it's a function if (jQuery.isFunction(params)) { // We assume that it's the callback callback = params; params = undefined; // Otherwise, build a param string } else if (params && typeof params === "object") { type = "POST"; } // If we have elements to modify, make the request if (self.length > 0) { jQuery.ajax({ url: url, // if "type" variable is undefined, then "GET" method will be used type: type, dataType: "html", data: params }).done(function(responseText) { // Save response for use in complete callback response = arguments; self.html(selector ? // If a selector was specified, locate the right elements in a dummy div // Exclude scripts to avoid IE 'Permission Denied' errors jQuery("<div>").append(jQuery.parseHTML(responseText)).find(selector) : // Otherwise use the full result responseText); }).complete(callback && function(jqXHR, status) { self.each(callback, response || [jqXHR.responseText, status, jqXHR]); }); } return this; }; // Attach a bunch of functions for handling common AJAX events jQuery.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function(i, type) { jQuery.fn[type] = function(fn) { return this.on(type, fn); }; }); jQuery.extend({ // Counter for holding the number of active queries active: 0, // Last-Modified header cache for next request lastModified: {}, etag: {}, ajaxSettings: { url: ajaxLocation, type: "GET", isLocal: rlocalProtocol.test(ajaxLocParts[1]), global: true, processData: true, async: true, contentType: "application/x-www-form-urlencoded; charset=UTF-8", /* timeout: 0, data: null, dataType: null, username: null, password: null, cache: null, throws: false, traditional: false, headers: {}, */ accepts: { "*": allTypes, text: "text/plain", html: "text/html", xml: "application/xml, text/xml", json: "application/json, text/javascript" }, contents: { xml: /xml/, html: /html/, json: /json/ }, responseFields: { xml: "responseXML", text: "responseText", json: "responseJSON" }, // Data converters // Keys separate source (or catchall "*") and destination types with a single space converters: { // Convert anything to text "* text": String, // Text to html (true = no transformation) "text html": true, // Evaluate text as a json expression "text json": jQuery.parseJSON, // Parse text as xml "text xml": jQuery.parseXML }, // For options that shouldn't be deep extended: // you can add your own custom options here if // and when you create one that shouldn't be // deep extended (see ajaxExtend) flatOptions: { url: true, context: true } }, // Creates a full fledged settings object into target // with both ajaxSettings and settings fields. // If target is omitted, writes into ajaxSettings. ajaxSetup: function(target, settings) { return settings ? // Building a settings object ajaxExtend(ajaxExtend(target, jQuery.ajaxSettings), settings) : // Extending ajaxSettings ajaxExtend(jQuery.ajaxSettings, target); }, ajaxPrefilter: addToPrefiltersOrTransports(prefilters), ajaxTransport: addToPrefiltersOrTransports(transports), // Main method ajax: function(url, options) { // If url is an object, simulate pre-1.5 signature if (typeof url === "object") { options = url; url = undefined; } // Force options to be an object options = options || {}; var // Cross-domain detection vars parts, // Loop variable i, // URL without anti-cache param cacheURL, // Response headers as string responseHeadersString, // timeout handle timeoutTimer, // To know if global events are to be dispatched fireGlobals, transport, // Response headers responseHeaders, // Create the final options object s = jQuery.ajaxSetup({}, options), // Callbacks context callbackContext = s.context || s, // Context for global events is callbackContext if it is a DOM node or jQuery collection globalEventContext = s.context && (callbackContext.nodeType || callbackContext.jquery) ? jQuery(callbackContext) : jQuery.event, // Deferreds deferred = jQuery.Deferred(), completeDeferred = jQuery.Callbacks("once memory"), // Status-dependent callbacks statusCode = s.statusCode || {}, // Headers (they are sent all at once) requestHeaders = {}, requestHeadersNames = {}, // The jqXHR state state = 0, // Default abort message strAbort = "canceled", // Fake xhr jqXHR = { readyState: 0, // Builds headers hashtable if needed getResponseHeader: function(key) { var match; if (state === 2) { if (!responseHeaders) { responseHeaders = {}; while ((match = rheaders.exec(responseHeadersString))) { responseHeaders[match[1].toLowerCase()] = match[2]; } } match = responseHeaders[key.toLowerCase()]; } return match == null ? null : match; }, // Raw string getAllResponseHeaders: function() { return state === 2 ? responseHeadersString : null; }, // Caches the header setRequestHeader: function(name, value) { var lname = name.toLowerCase(); if (!state) { name = requestHeadersNames[lname] = requestHeadersNames[lname] || name; requestHeaders[name] = value; } return this; }, // Overrides response content-type header overrideMimeType: function(type) { if (!state) { s.mimeType = type; } return this; }, // Status-dependent callbacks statusCode: function(map) { var code; if (map) { if (state < 2) { for (code in map) { // Lazy-add the new callback in a way that preserves old ones statusCode[code] = [statusCode[code], map[code]]; } } else { // Execute the appropriate callbacks jqXHR.always(map[jqXHR.status]); } } return this; }, // Cancel the request abort: function(statusText) { var finalText = statusText || strAbort; if (transport) { transport.abort(finalText); } done(0, finalText); return this; } }; // Attach deferreds deferred.promise(jqXHR).complete = completeDeferred.add; jqXHR.success = jqXHR.done; jqXHR.error = jqXHR.fail; // Remove hash character (#7531: and string promotion) // Add protocol if not provided (#5866: IE7 issue with protocol-less urls) // Handle falsy url in the settings object (#10093: consistency with old signature) // We also use the url parameter if available s.url = ((url || s.url || ajaxLocation) + "").replace(rhash, "").replace(rprotocol, ajaxLocParts[1] + "//"); // Alias method option to type as per ticket #12004 s.type = options.method || options.type || s.method || s.type; // Extract dataTypes list s.dataTypes = jQuery.trim(s.dataType || "*").toLowerCase().match(core_rnotwhite) || [""]; // A cross-domain request is in order when we have a protocol:host:port mismatch if (s.crossDomain == null) { parts = rurl.exec(s.url.toLowerCase()); s.crossDomain = !! (parts && (parts[1] !== ajaxLocParts[1] || parts[2] !== ajaxLocParts[2] || (parts[3] || (parts[1] === "http:" ? "80" : "443")) !== (ajaxLocParts[3] || (ajaxLocParts[1] === "http:" ? "80" : "443")))); } // Convert data if not already a string if (s.data && s.processData && typeof s.data !== "string") { s.data = jQuery.param(s.data, s.traditional); } // Apply prefilters inspectPrefiltersOrTransports(prefilters, s, options, jqXHR); // If request was aborted inside a prefilter, stop there if (state === 2) { return jqXHR; } // We can fire global events as of now if asked to fireGlobals = s.global; // Watch for a new set of requests if (fireGlobals && jQuery.active++ === 0) { jQuery.event.trigger("ajaxStart"); } // Uppercase the type s.type = s.type.toUpperCase(); // Determine if request has content s.hasContent = !rnoContent.test(s.type); // Save the URL in case we're toying with the If-Modified-Since // and/or If-None-Match header later on cacheURL = s.url; // More options handling for requests with no content if (!s.hasContent) { // If data is available, append data to url if (s.data) { cacheURL = (s.url += (ajax_rquery.test(cacheURL) ? "&" : "?") + s.data); // #9682: remove data so that it's not used in an eventual retry delete s.data; } // Add anti-cache in url if needed if (s.cache === false) { s.url = rts.test(cacheURL) ? // If there is already a '_' parameter, set its value cacheURL.replace(rts, "$1_=" + ajax_nonce++) : // Otherwise add one to the end cacheURL + (ajax_rquery.test(cacheURL) ? "&" : "?") + "_=" + ajax_nonce++; } } // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if (s.ifModified) { if (jQuery.lastModified[cacheURL]) { jqXHR.setRequestHeader("If-Modified-Since", jQuery.lastModified[cacheURL]); } if (jQuery.etag[cacheURL]) { jqXHR.setRequestHeader("If-None-Match", jQuery.etag[cacheURL]); } } // Set the correct header, if data is being sent if (s.data && s.hasContent && s.contentType !== false || options.contentType) { jqXHR.setRequestHeader("Content-Type", s.contentType); } // Set the Accepts header for the server, depending on the dataType jqXHR.setRequestHeader("Accept", s.dataTypes[0] && s.accepts[s.dataTypes[0]] ? s.accepts[s.dataTypes[0]] + (s.dataTypes[0] !== "*" ? ", " + allTypes + "; q=0.01" : "") : s.accepts["*"]); // Check for headers option for (i in s.headers) { jqXHR.setRequestHeader(i, s.headers[i]); } // Allow custom headers/mimetypes and early abort if (s.beforeSend && (s.beforeSend.call(callbackContext, jqXHR, s) === false || state === 2)) { // Abort if not done already and return return jqXHR.abort(); } // aborting is no longer a cancellation strAbort = "abort"; // Install callbacks on deferreds for (i in { success: 1, error: 1, complete: 1 }) { jqXHR[i](s[i]); } // Get transport transport = inspectPrefiltersOrTransports(transports, s, options, jqXHR); // If no transport, we auto-abort if (!transport) { done(-1, "No Transport"); } else { jqXHR.readyState = 1; // Send global event if (fireGlobals) { globalEventContext.trigger("ajaxSend", [jqXHR, s]); } // Timeout if (s.async && s.timeout > 0) { timeoutTimer = setTimeout(function() { jqXHR.abort("timeout"); }, s.timeout); } try { state = 1; transport.send(requestHeaders, done); } catch (e) { // Propagate exception as error if not done if (state < 2) { done(-1, e); // Simply rethrow otherwise } else { throw e; } } } // Callback for when everything is done function done(status, nativeStatusText, responses, headers) { var isSuccess, success, error, response, modified, statusText = nativeStatusText; // Called once if (state === 2) { return; } // State is "done" now state = 2; // Clear timeout if it exists if (timeoutTimer) { clearTimeout(timeoutTimer); } // Dereference transport for early garbage collection // (no matter how long the jqXHR object will be used) transport = undefined; // Cache response headers responseHeadersString = headers || ""; // Set readyState jqXHR.readyState = status > 0 ? 4 : 0; // Determine if successful isSuccess = status >= 200 && status < 300 || status === 304; // Get response data if (responses) { response = ajaxHandleResponses(s, jqXHR, responses); } // Convert no matter what (that way responseXXX fields are always set) response = ajaxConvert(s, response, jqXHR, isSuccess); // If successful, handle type chaining if (isSuccess) { // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if (s.ifModified) { modified = jqXHR.getResponseHeader("Last-Modified"); if (modified) { jQuery.lastModified[cacheURL] = modified; } modified = jqXHR.getResponseHeader("etag"); if (modified) { jQuery.etag[cacheURL] = modified; } } // if no content if (status === 204 || s.type === "HEAD") { statusText = "nocontent"; // if not modified } else if (status === 304) { statusText = "notmodified"; // If we have data, let's convert it } else { statusText = response.state; success = response.data; error = response.error; isSuccess = !error; } } else { // We extract error from statusText // then normalize statusText and status for non-aborts error = statusText; if (status || !statusText) { statusText = "error"; if (status < 0) { status = 0; } } } // Set data for the fake xhr object jqXHR.status = status; jqXHR.statusText = (nativeStatusText || statusText) + ""; // Success/Error if (isSuccess) { deferred.resolveWith(callbackContext, [success, statusText, jqXHR]); } else { deferred.rejectWith(callbackContext, [jqXHR, statusText, error]); } // Status-dependent callbacks jqXHR.statusCode(statusCode); statusCode = undefined; if (fireGlobals) { globalEventContext.trigger(isSuccess ? "ajaxSuccess" : "ajaxError", [jqXHR, s, isSuccess ? success : error]); } // Complete completeDeferred.fireWith(callbackContext, [jqXHR, statusText]); if (fireGlobals) { globalEventContext.trigger("ajaxComplete", [jqXHR, s]); // Handle the global AJAX counter if (!(--jQuery.active)) { jQuery.event.trigger("ajaxStop"); } } } return jqXHR; }, getJSON: function(url, data, callback) { return jQuery.get(url, data, callback, "json"); }, getScript: function(url, callback) { return jQuery.get(url, undefined, callback, "script"); } }); jQuery.each(["get", "post"], function(i, method) { jQuery[method] = function(url, data, callback, type) { // shift arguments if data argument was omitted if (jQuery.isFunction(data)) { type = type || callback; callback = data; data = undefined; } return jQuery.ajax({ url: url, type: method, dataType: type, data: data, success: callback }); }; }); /* Handles responses to an ajax request: * - finds the right dataType (mediates between content-type and expected dataType) * - returns the corresponding response */ function ajaxHandleResponses(s, jqXHR, responses) { var firstDataType, ct, finalDataType, type, contents = s.contents, dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process while (dataTypes[0] === "*") { dataTypes.shift(); if (ct === undefined) { ct = s.mimeType || jqXHR.getResponseHeader("Content-Type"); } } // Check if we're dealing with a known content-type if (ct) { for (type in contents) { if (contents[type] && contents[type].test(ct)) { dataTypes.unshift(type); break; } } } // Check to see if we have a response for the expected dataType if (dataTypes[0] in responses) { finalDataType = dataTypes[0]; } else { // Try convertible dataTypes for (type in responses) { if (!dataTypes[0] || s.converters[type + " " + dataTypes[0]]) { finalDataType = type; break; } if (!firstDataType) { firstDataType = type; } } // Or just use first one finalDataType = finalDataType || firstDataType; } // If we found a dataType // We add the dataType to the list if needed // and return the corresponding response if (finalDataType) { if (finalDataType !== dataTypes[0]) { dataTypes.unshift(finalDataType); } return responses[finalDataType]; } } /* Chain conversions given the request and the original response * Also sets the responseXXX fields on the jqXHR instance */ function ajaxConvert(s, response, jqXHR, isSuccess) { var conv2, current, conv, tmp, prev, converters = {}, // Work with a copy of dataTypes in case we need to modify it for conversion dataTypes = s.dataTypes.slice(); // Create converters map with lowercased keys if (dataTypes[1]) { for (conv in s.converters) { converters[conv.toLowerCase()] = s.converters[conv]; } } current = dataTypes.shift(); // Convert to each sequential dataType while (current) { if (s.responseFields[current]) { jqXHR[s.responseFields[current]] = response; } // Apply the dataFilter if provided if (!prev && isSuccess && s.dataFilter) { response = s.dataFilter(response, s.dataType); } prev = current; current = dataTypes.shift(); if (current) { // There's only work to do if current dataType is non-auto if (current === "*") { current = prev; // Convert response if prev dataType is non-auto and differs from current } else if (prev !== "*" && prev !== current) { // Seek a direct converter conv = converters[prev + " " + current] || converters["* " + current]; // If none found, seek a pair if (!conv) { for (conv2 in converters) { // If conv2 outputs current tmp = conv2.split(" "); if (tmp[1] === current) { // If prev can be converted to accepted input conv = converters[prev + " " + tmp[0]] || converters["* " + tmp[0]]; if (conv) { // Condense equivalence converters if (conv === true) { conv = converters[conv2]; // Otherwise, insert the intermediate dataType } else if (converters[conv2] !== true) { current = tmp[0]; dataTypes.unshift(tmp[1]); } break; } } } } // Apply converter (if not an equivalence) if (conv !== true) { // Unless errors are allowed to bubble, catch and return them if (conv && s["throws"]) { response = conv(response); } else { try { response = conv(response); } catch (e) { return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current }; } } } } } } return { state: "success", data: response }; } // Install script dataType jQuery.ajaxSetup({ accepts: { script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" }, contents: { script: /(?:java|ecma)script/ }, converters: { "text script": function(text) { jQuery.globalEval(text); return text; } } }); // Handle cache's special case and global jQuery.ajaxPrefilter("script", function(s) { if (s.cache === undefined) { s.cache = false; } if (s.crossDomain) { s.type = "GET"; s.global = false; } }); // Bind script tag hack transport jQuery.ajaxTransport("script", function(s) { // This transport only deals with cross domain requests if (s.crossDomain) { var script, head = document.head || jQuery("head")[0] || document.documentElement; return { send: function(_, callback) { script = document.createElement("script"); script.async = true; if (s.scriptCharset) { script.charset = s.scriptCharset; } script.src = s.url; // Attach handlers for all browsers script.onload = script.onreadystatechange = function(_, isAbort) { if (isAbort || !script.readyState || /loaded|complete/.test(script.readyState)) { // Handle memory leak in IE script.onload = script.onreadystatechange = null; // Remove the script if (script.parentNode) { script.parentNode.removeChild(script); } // Dereference the script script = null; // Callback if not abort if (!isAbort) { callback(200, "success"); } } }; // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending // Use native DOM manipulation to avoid our domManip AJAX trickery head.insertBefore(script, head.firstChild); }, abort: function() { if (script) { script.onload(undefined, true); } } }; } }); var oldCallbacks = [], rjsonp = /(=)\?(?=&|$)|\?\?/; // Default jsonp settings jQuery.ajaxSetup({ jsonp: "callback", jsonpCallback: function() { var callback = oldCallbacks.pop() || (jQuery.expando + "_" + (ajax_nonce++)); this[callback] = true; return callback; } }); // Detect, normalize options and install callbacks for jsonp requests jQuery.ajaxPrefilter("json jsonp", function(s, originalSettings, jqXHR) { var callbackName, overwritten, responseContainer, jsonProp = s.jsonp !== false && (rjsonp.test(s.url) ? "url" : typeof s.data === "string" && !(s.contentType || "").indexOf("application/x-www-form-urlencoded") && rjsonp.test(s.data) && "data"); // Handle iff the expected data type is "jsonp" or we have a parameter to set if (jsonProp || s.dataTypes[0] === "jsonp") { // Get callback name, remembering preexisting value associated with it callbackName = s.jsonpCallback = jQuery.isFunction(s.jsonpCallback) ? s.jsonpCallback() : s.jsonpCallback; // Insert callback into url or form data if (jsonProp) { s[jsonProp] = s[jsonProp].replace(rjsonp, "$1" + callbackName); } else if (s.jsonp !== false) { s.url += (ajax_rquery.test(s.url) ? "&" : "?") + s.jsonp + "=" + callbackName; } // Use data converter to retrieve json after script execution s.converters["script json"] = function() { if (!responseContainer) { jQuery.error(callbackName + " was not called"); } return responseContainer[0]; }; // force json dataType s.dataTypes[0] = "json"; // Install callback overwritten = window[callbackName]; window[callbackName] = function() { responseContainer = arguments; }; // Clean-up function (fires after converters) jqXHR.always(function() { // Restore preexisting value window[callbackName] = overwritten; // Save back as free if (s[callbackName]) { // make sure that re-using the options doesn't screw things around s.jsonpCallback = originalSettings.jsonpCallback; // save the callback name for future use oldCallbacks.push(callbackName); } // Call if it was a function and we have a response if (responseContainer && jQuery.isFunction(overwritten)) { overwritten(responseContainer[0]); } responseContainer = overwritten = undefined; }); // Delegate to script return "script"; } }); var xhrCallbacks, xhrSupported, xhrId = 0, // #5280: Internet Explorer will keep connections alive if we don't abort on unload xhrOnUnloadAbort = window.ActiveXObject && function() { // Abort all pending requests var key; for (key in xhrCallbacks) { xhrCallbacks[key](undefined, true); } }; // Functions to create xhrs function createStandardXHR() { try { return new window.XMLHttpRequest(); } catch (e) {} } function createActiveXHR() { try { return new window.ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } // Create the request object // (This is still attached to ajaxSettings for backward compatibility) jQuery.ajaxSettings.xhr = window.ActiveXObject ? /* Microsoft failed to properly * implement the XMLHttpRequest in IE7 (can't request local files), * so we use the ActiveXObject when it is available * Additionally XMLHttpRequest can be disabled in IE7/IE8 so * we need a fallback. */ function() { return !this.isLocal && createStandardXHR() || createActiveXHR(); } : // For all other browsers, use the standard XMLHttpRequest object createStandardXHR; // Determine support properties xhrSupported = jQuery.ajaxSettings.xhr(); jQuery.support.cors = !! xhrSupported && ("withCredentials" in xhrSupported); xhrSupported = jQuery.support.ajax = !! xhrSupported; // Create transport if the browser can provide an xhr if (xhrSupported) { jQuery.ajaxTransport(function(s) { // Cross domain only allowed if supported through XMLHttpRequest if (!s.crossDomain || jQuery.support.cors) { var callback; return { send: function(headers, complete) { // Get a new xhr var handle, i, xhr = s.xhr(); // Open the socket // Passing null username, generates a login popup on Opera (#2865) if (s.username) { xhr.open(s.type, s.url, s.async, s.username, s.password); } else { xhr.open(s.type, s.url, s.async); } // Apply custom fields if provided if (s.xhrFields) { for (i in s.xhrFields) { xhr[i] = s.xhrFields[i]; } } // Override mime type if needed if (s.mimeType && xhr.overrideMimeType) { xhr.overrideMimeType(s.mimeType); } // X-Requested-With header // For cross-domain requests, seeing as conditions for a preflight are // akin to a jigsaw puzzle, we simply never set it to be sure. // (it can always be set on a per-request basis or even using ajaxSetup) // For same-domain requests, won't change header if already provided. if (!s.crossDomain && !headers["X-Requested-With"]) { headers["X-Requested-With"] = "XMLHttpRequest"; } // Need an extra try/catch for cross domain requests in Firefox 3 try { for (i in headers) { xhr.setRequestHeader(i, headers[i]); } } catch (err) {} // Do send the request // This may raise an exception which is actually // handled in jQuery.ajax (so no try/catch here) xhr.send((s.hasContent && s.data) || null); // Listener callback = function(_, isAbort) { var status, responseHeaders, statusText, responses; // Firefox throws exceptions when accessing properties // of an xhr when a network error occurred // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE) try { // Was never called and is aborted or complete if (callback && (isAbort || xhr.readyState === 4)) { // Only called once callback = undefined; // Do not keep as active anymore if (handle) { xhr.onreadystatechange = jQuery.noop; if (xhrOnUnloadAbort) { delete xhrCallbacks[handle]; } } // If it's an abort if (isAbort) { // Abort it manually if needed if (xhr.readyState !== 4) { xhr.abort(); } } else { responses = {}; status = xhr.status; responseHeaders = xhr.getAllResponseHeaders(); // When requesting binary data, IE6-9 will throw an exception // on any attempt to access responseText (#11426) if (typeof xhr.responseText === "string") { responses.text = xhr.responseText; } // Firefox throws an exception when accessing // statusText for faulty cross-domain requests try { statusText = xhr.statusText; } catch (e) { // We normalize with Webkit giving an empty statusText statusText = ""; } // Filter status for non standard behaviors // If the request is local and we have data: assume a success // (success with no data won't get notified, that's the best we // can do given current implementations) if (!status && s.isLocal && !s.crossDomain) { status = responses.text ? 200 : 404; // IE - #1450: sometimes returns 1223 when it should be 204 } else if (status === 1223) { status = 204; } } } } catch (firefoxAccessException) { if (!isAbort) { complete(-1, firefoxAccessException); } } // Call complete if needed if (responses) { complete(status, statusText, responses, responseHeaders); } }; if (!s.async) { // if we're in sync mode we fire the callback callback(); } else if (xhr.readyState === 4) { // (IE6 & IE7) if it's in cache and has been // retrieved directly we need to fire the callback setTimeout(callback); } else { handle = ++xhrId; if (xhrOnUnloadAbort) { // Create the active xhrs callbacks list if needed // and attach the unload handler if (!xhrCallbacks) { xhrCallbacks = {}; jQuery(window).unload(xhrOnUnloadAbort); } // Add to list of active xhrs callbacks xhrCallbacks[handle] = callback; } xhr.onreadystatechange = callback; } }, abort: function() { if (callback) { callback(undefined, true); } } }; } }); } var fxNow, timerId, rfxtypes = /^(?:toggle|show|hide)$/, rfxnum = new RegExp("^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i"), rrun = /queueHooks$/, animationPrefilters = [defaultPrefilter], tweeners = { "*": [function(prop, value) { var tween = this.createTween(prop, value), target = tween.cur(), parts = rfxnum.exec(value), unit = parts && parts[3] || (jQuery.cssNumber[prop] ? "" : "px"), // Starting value computation is required for potential unit mismatches start = (jQuery.cssNumber[prop] || unit !== "px" && +target) && rfxnum.exec(jQuery.css(tween.elem, prop)), scale = 1, maxIterations = 20; if (start && start[3] !== unit) { // Trust units reported by jQuery.css unit = unit || start[3]; // Make sure we update the tween properties later on parts = parts || []; // Iteratively approximate from a nonzero starting point start = +target || 1; do { // If previous iteration zeroed out, double until we get *something* // Use a string for doubling factor so we don't accidentally see scale as unchanged below scale = scale || ".5"; // Adjust and apply start = start / scale; jQuery.style(tween.elem, prop, start + unit); // Update scale, tolerating zero or NaN from tween.cur() // And breaking the loop if scale is unchanged or perfect, or if we've just had enough } while (scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations); } // Update tween properties if (parts) { start = tween.start = +start || +target || 0; tween.unit = unit; // If a +=/-= token was provided, we're doing a relative animation tween.end = parts[1] ? start + (parts[1] + 1) * parts[2] : +parts[2]; } return tween; }] }; // Animations created synchronously will run synchronously function createFxNow() { setTimeout(function() { fxNow = undefined; }); return (fxNow = jQuery.now()); } function createTween(value, prop, animation) { var tween, collection = (tweeners[prop] || []).concat(tweeners["*"]), index = 0, length = collection.length; for (; index < length; index++) { if ((tween = collection[index].call(animation, prop, value))) { // we're done with this property return tween; } } } function Animation(elem, properties, options) { var result, stopped, index = 0, length = animationPrefilters.length, deferred = jQuery.Deferred().always(function() { // don't match elem in the :animated selector delete tick.elem; }), tick = function() { if (stopped) { return false; } var currentTime = fxNow || createFxNow(), remaining = Math.max(0, animation.startTime + animation.duration - currentTime), // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497) temp = remaining / animation.duration || 0, percent = 1 - temp, index = 0, length = animation.tweens.length; for (; index < length; index++) { animation.tweens[index].run(percent); } deferred.notifyWith(elem, [animation, percent, remaining]); if (percent < 1 && length) { return remaining; } else { deferred.resolveWith(elem, [animation]); return false; } }, animation = deferred.promise({ elem: elem, props: jQuery.extend({}, properties), opts: jQuery.extend(true, { specialEasing: {} }, options), originalProperties: properties, originalOptions: options, startTime: fxNow || createFxNow(), duration: options.duration, tweens: [], createTween: function(prop, end) { var tween = jQuery.Tween(elem, animation.opts, prop, end, animation.opts.specialEasing[prop] || animation.opts.easing); animation.tweens.push(tween); return tween; }, stop: function(gotoEnd) { var index = 0, // if we are going to the end, we want to run all the tweens // otherwise we skip this part length = gotoEnd ? animation.tweens.length : 0; if (stopped) { return this; } stopped = true; for (; index < length; index++) { animation.tweens[index].run(1); } // resolve when we played the last frame // otherwise, reject if (gotoEnd) { deferred.resolveWith(elem, [animation, gotoEnd]); } else { deferred.rejectWith(elem, [animation, gotoEnd]); } return this; } }), props = animation.props; propFilter(props, animation.opts.specialEasing); for (; index < length; index++) { result = animationPrefilters[index].call(animation, elem, props, animation.opts); if (result) { return result; } } jQuery.map(props, createTween, animation); if (jQuery.isFunction(animation.opts.start)) { animation.opts.start.call(elem, animation); } jQuery.fx.timer( jQuery.extend(tick, { elem: elem, anim: animation, queue: animation.opts.queue })); // attach callbacks from options return animation.progress(animation.opts.progress) .done(animation.opts.done, animation.opts.complete) .fail(animation.opts.fail) .always(animation.opts.always); } function propFilter(props, specialEasing) { var index, name, easing, value, hooks; // camelCase, specialEasing and expand cssHook pass for (index in props) { name = jQuery.camelCase(index); easing = specialEasing[name]; value = props[index]; if (jQuery.isArray(value)) { easing = value[1]; value = props[index] = value[0]; } if (index !== name) { props[name] = value; delete props[index]; } hooks = jQuery.cssHooks[name]; if (hooks && "expand" in hooks) { value = hooks.expand(value); delete props[name]; // not quite $.extend, this wont overwrite keys already present. // also - reusing 'index' from above because we have the correct "name" for (index in value) { if (!(index in props)) { props[index] = value[index]; specialEasing[index] = easing; } } } else { specialEasing[name] = easing; } } } jQuery.Animation = jQuery.extend(Animation, { tweener: function(props, callback) { if (jQuery.isFunction(props)) { callback = props; props = ["*"]; } else { props = props.split(" "); } var prop, index = 0, length = props.length; for (; index < length; index++) { prop = props[index]; tweeners[prop] = tweeners[prop] || []; tweeners[prop].unshift(callback); } }, prefilter: function(callback, prepend) { if (prepend) { animationPrefilters.unshift(callback); } else { animationPrefilters.push(callback); } } }); function defaultPrefilter(elem, props, opts) { /* jshint validthis: true */ var prop, value, toggle, tween, hooks, oldfire, anim = this, orig = {}, style = elem.style, hidden = elem.nodeType && isHidden(elem), dataShow = jQuery._data(elem, "fxshow"); // handle queue: false promises if (!opts.queue) { hooks = jQuery._queueHooks(elem, "fx"); if (hooks.unqueued == null) { hooks.unqueued = 0; oldfire = hooks.empty.fire; hooks.empty.fire = function() { if (!hooks.unqueued) { oldfire(); } }; } hooks.unqueued++; anim.always(function() { // doing this makes sure that the complete handler will be called // before this completes anim.always(function() { hooks.unqueued--; if (!jQuery.queue(elem, "fx").length) { hooks.empty.fire(); } }); }); } // height/width overflow pass if (elem.nodeType === 1 && ("height" in props || "width" in props)) { // Make sure that nothing sneaks out // Record all 3 overflow attributes because IE does not // change the overflow attribute when overflowX and // overflowY are set to the same value opts.overflow = [style.overflow, style.overflowX, style.overflowY]; // Set display property to inline-block for height/width // animations on inline elements that are having width/height animated if (jQuery.css(elem, "display") === "inline" && jQuery.css(elem, "float") === "none") { // inline-level elements accept inline-block; // block-level elements need to be inline with layout if (!jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay(elem.nodeName) === "inline") { style.display = "inline-block"; } else { style.zoom = 1; } } } if (opts.overflow) { style.overflow = "hidden"; if (!jQuery.support.shrinkWrapBlocks) { anim.always(function() { style.overflow = opts.overflow[0]; style.overflowX = opts.overflow[1]; style.overflowY = opts.overflow[2]; }); } } // show/hide pass for (prop in props) { value = props[prop]; if (rfxtypes.exec(value)) { delete props[prop]; toggle = toggle || value === "toggle"; if (value === (hidden ? "hide" : "show")) { continue; } orig[prop] = dataShow && dataShow[prop] || jQuery.style(elem, prop); } } if (!jQuery.isEmptyObject(orig)) { if (dataShow) { if ("hidden" in dataShow) { hidden = dataShow.hidden; } } else { dataShow = jQuery._data(elem, "fxshow", {}); } // store state if its toggle - enables .stop().toggle() to "reverse" if (toggle) { dataShow.hidden = !hidden; } if (hidden) { jQuery(elem).show(); } else { anim.done(function() { jQuery(elem).hide(); }); } anim.done(function() { var prop; jQuery._removeData(elem, "fxshow"); for (prop in orig) { jQuery.style(elem, prop, orig[prop]); } }); for (prop in orig) { tween = createTween(hidden ? dataShow[prop] : 0, prop, anim); if (!(prop in dataShow)) { dataShow[prop] = tween.start; if (hidden) { tween.end = tween.start; tween.start = prop === "width" || prop === "height" ? 1 : 0; } } } } } function Tween(elem, options, prop, end, easing) { return new Tween.prototype.init(elem, options, prop, end, easing); } jQuery.Tween = Tween; Tween.prototype = { constructor: Tween, init: function(elem, options, prop, end, easing, unit) { this.elem = elem; this.prop = prop; this.easing = easing || "swing"; this.options = options; this.start = this.now = this.cur(); this.end = end; this.unit = unit || (jQuery.cssNumber[prop] ? "" : "px"); }, cur: function() { var hooks = Tween.propHooks[this.prop]; return hooks && hooks.get ? hooks.get(this) : Tween.propHooks._default.get(this); }, run: function(percent) { var eased, hooks = Tween.propHooks[this.prop]; if (this.options.duration) { this.pos = eased = jQuery.easing[this.easing]( percent, this.options.duration * percent, 0, 1, this.options.duration); } else { this.pos = eased = percent; } this.now = (this.end - this.start) * eased + this.start; if (this.options.step) { this.options.step.call(this.elem, this.now, this); } if (hooks && hooks.set) { hooks.set(this); } else { Tween.propHooks._default.set(this); } return this; } }; Tween.prototype.init.prototype = Tween.prototype; Tween.propHooks = { _default: { get: function(tween) { var result; if (tween.elem[tween.prop] != null && (!tween.elem.style || tween.elem.style[tween.prop] == null)) { return tween.elem[tween.prop]; } // passing an empty string as a 3rd parameter to .css will automatically // attempt a parseFloat and fallback to a string if the parse fails // so, simple values such as "10px" are parsed to Float. // complex values such as "rotate(1rad)" are returned as is. result = jQuery.css(tween.elem, tween.prop, ""); // Empty strings, null, undefined and "auto" are converted to 0. return !result || result === "auto" ? 0 : result; }, set: function(tween) { // use step hook for back compat - use cssHook if its there - use .style if its // available and use plain properties where available if (jQuery.fx.step[tween.prop]) { jQuery.fx.step[tween.prop](tween); } else if (tween.elem.style && (tween.elem.style[jQuery.cssProps[tween.prop]] != null || jQuery.cssHooks[tween.prop])) { jQuery.style(tween.elem, tween.prop, tween.now + tween.unit); } else { tween.elem[tween.prop] = tween.now; } } } }; // Support: IE <=9 // Panic based approach to setting things on disconnected nodes Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { set: function(tween) { if (tween.elem.nodeType && tween.elem.parentNode) { tween.elem[tween.prop] = tween.now; } } }; jQuery.each(["toggle", "show", "hide"], function(i, name) { var cssFn = jQuery.fn[name]; jQuery.fn[name] = function(speed, easing, callback) { return speed == null || typeof speed === "boolean" ? cssFn.apply(this, arguments) : this.animate(genFx(name, true), speed, easing, callback); }; }); jQuery.fn.extend({ fadeTo: function(speed, to, easing, callback) { // show any hidden elements after setting opacity to 0 return this.filter(isHidden).css("opacity", 0).show() // animate to the value specified .end().animate({ opacity: to }, speed, easing, callback); }, animate: function(prop, speed, easing, callback) { var empty = jQuery.isEmptyObject(prop), optall = jQuery.speed(speed, easing, callback), doAnimation = function() { // Operate on a copy of prop so per-property easing won't be lost var anim = Animation(this, jQuery.extend({}, prop), optall); // Empty animations, or finishing resolves immediately if (empty || jQuery._data(this, "finish")) { anim.stop(true); } }; doAnimation.finish = doAnimation; return empty || optall.queue === false ? this.each(doAnimation) : this.queue(optall.queue, doAnimation); }, stop: function(type, clearQueue, gotoEnd) { var stopQueue = function(hooks) { var stop = hooks.stop; delete hooks.stop; stop(gotoEnd); }; if (typeof type !== "string") { gotoEnd = clearQueue; clearQueue = type; type = undefined; } if (clearQueue && type !== false) { this.queue(type || "fx", []); } return this.each(function() { var dequeue = true, index = type != null && type + "queueHooks", timers = jQuery.timers, data = jQuery._data(this); if (index) { if (data[index] && data[index].stop) { stopQueue(data[index]); } } else { for (index in data) { if (data[index] && data[index].stop && rrun.test(index)) { stopQueue(data[index]); } } } for (index = timers.length; index--;) { if (timers[index].elem === this && (type == null || timers[index].queue === type)) { timers[index].anim.stop(gotoEnd); dequeue = false; timers.splice(index, 1); } } // start the next in the queue if the last step wasn't forced // timers currently will call their complete callbacks, which will dequeue // but only if they were gotoEnd if (dequeue || !gotoEnd) { jQuery.dequeue(this, type); } }); }, finish: function(type) { if (type !== false) { type = type || "fx"; } return this.each(function() { var index, data = jQuery._data(this), queue = data[type + "queue"], hooks = data[type + "queueHooks"], timers = jQuery.timers, length = queue ? queue.length : 0; // enable finishing flag on private data data.finish = true; // empty the queue first jQuery.queue(this, type, []); if (hooks && hooks.stop) { hooks.stop.call(this, true); } // look for any active animations, and finish them for (index = timers.length; index--;) { if (timers[index].elem === this && timers[index].queue === type) { timers[index].anim.stop(true); timers.splice(index, 1); } } // look for any animations in the old queue and finish them for (index = 0; index < length; index++) { if (queue[index] && queue[index].finish) { queue[index].finish.call(this); } } // turn off finishing flag delete data.finish; }); } }); // Generate parameters to create a standard animation function genFx(type, includeWidth) { var which, attrs = { height: type }, i = 0; // if we include width, step value is 1 to do all cssExpand values, // if we don't include width, step value is 2 to skip over Left and Right includeWidth = includeWidth ? 1 : 0; for (; i < 4; i += 2 - includeWidth) { which = cssExpand[i]; attrs["margin" + which] = attrs["padding" + which] = type; } if (includeWidth) { attrs.opacity = attrs.width = type; } return attrs; } // Generate shortcuts for custom animations jQuery.each({ slideDown: genFx("show"), slideUp: genFx("hide"), slideToggle: genFx("toggle"), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle" } }, function(name, props) { jQuery.fn[name] = function(speed, easing, callback) { return this.animate(props, speed, easing, callback); }; }); jQuery.speed = function(speed, easing, fn) { var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : { complete: fn || !fn && easing || jQuery.isFunction(speed) && speed, duration: speed, easing: fn && easing || easing && !jQuery.isFunction(easing) && easing }; opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[opt.duration] : jQuery.fx.speeds._default; // normalize opt.queue - true/undefined/null -> "fx" if (opt.queue == null || opt.queue === true) { opt.queue = "fx"; } // Queueing opt.old = opt.complete; opt.complete = function() { if (jQuery.isFunction(opt.old)) { opt.old.call(this); } if (opt.queue) { jQuery.dequeue(this, opt.queue); } }; return opt; }; jQuery.easing = { linear: function(p) { return p; }, swing: function(p) { return 0.5 - Math.cos(p * Math.PI) / 2; } }; jQuery.timers = []; jQuery.fx = Tween.prototype.init; jQuery.fx.tick = function() { var timer, timers = jQuery.timers, i = 0; fxNow = jQuery.now(); for (; i < timers.length; i++) { timer = timers[i]; // Checks the timer has not already been removed if (!timer() && timers[i] === timer) { timers.splice(i--, 1); } } if (!timers.length) { jQuery.fx.stop(); } fxNow = undefined; }; jQuery.fx.timer = function(timer) { if (timer() && jQuery.timers.push(timer)) { jQuery.fx.start(); } }; jQuery.fx.interval = 13; jQuery.fx.start = function() { if (!timerId) { timerId = setInterval(jQuery.fx.tick, jQuery.fx.interval); } }; jQuery.fx.stop = function() { clearInterval(timerId); timerId = null; }; jQuery.fx.speeds = { slow: 600, fast: 200, // Default speed _default: 400 }; // Back Compat <1.8 extension point jQuery.fx.step = {}; if (jQuery.expr && jQuery.expr.filters) { jQuery.expr.filters.animated = function(elem) { return jQuery.grep(jQuery.timers, function(fn) { return elem === fn.elem; }).length; }; } jQuery.fn.offset = function(options) { if (arguments.length) { return options === undefined ? this : this.each(function(i) { jQuery.offset.setOffset(this, options, i); }); } var docElem, win, box = { top: 0, left: 0 }, elem = this[0], doc = elem && elem.ownerDocument; if (!doc) { return; } docElem = doc.documentElement; // Make sure it's not a disconnected DOM node if (!jQuery.contains(docElem, elem)) { return box; } // If we don't have gBCR, just use 0,0 rather than error // BlackBerry 5, iOS 3 (original iPhone) if (typeof elem.getBoundingClientRect !== core_strundefined) { box = elem.getBoundingClientRect(); } win = getWindow(doc); return { top: box.top + (win.pageYOffset || docElem.scrollTop) - (docElem.clientTop || 0), left: box.left + (win.pageXOffset || docElem.scrollLeft) - (docElem.clientLeft || 0) }; }; jQuery.offset = { setOffset: function(elem, options, i) { var position = jQuery.css(elem, "position"); // set position first, in-case top/left are set even on static elem if (position === "static") { elem.style.position = "relative"; } var curElem = jQuery(elem), curOffset = curElem.offset(), curCSSTop = jQuery.css(elem, "top"), curCSSLeft = jQuery.css(elem, "left"), calculatePosition = (position === "absolute" || position === "fixed") && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1, props = {}, curPosition = {}, curTop, curLeft; // need to be able to calculate position if either top or left is auto and position is either absolute or fixed if (calculatePosition) { curPosition = curElem.position(); curTop = curPosition.top; curLeft = curPosition.left; } else { curTop = parseFloat(curCSSTop) || 0; curLeft = parseFloat(curCSSLeft) || 0; } if (jQuery.isFunction(options)) { options = options.call(elem, i, curOffset); } if (options.top != null) { props.top = (options.top - curOffset.top) + curTop; } if (options.left != null) { props.left = (options.left - curOffset.left) + curLeft; } if ("using" in options) { options.using.call(elem, props); } else { curElem.css(props); } } }; jQuery.fn.extend({ position: function() { if (!this[0]) { return; } var offsetParent, offset, parentOffset = { top: 0, left: 0 }, elem = this[0]; // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent if (jQuery.css(elem, "position") === "fixed") { // we assume that getBoundingClientRect is available when computed position is fixed offset = elem.getBoundingClientRect(); } else { // Get *real* offsetParent offsetParent = this.offsetParent(); // Get correct offsets offset = this.offset(); if (!jQuery.nodeName(offsetParent[0], "html")) { parentOffset = offsetParent.offset(); } // Add offsetParent borders parentOffset.top += jQuery.css(offsetParent[0], "borderTopWidth", true); parentOffset.left += jQuery.css(offsetParent[0], "borderLeftWidth", true); } // Subtract parent offsets and element margins // note: when an element has margin: auto the offsetLeft and marginLeft // are the same in Safari causing offset.left to incorrectly be 0 return { top: offset.top - parentOffset.top - jQuery.css(elem, "marginTop", true), left: offset.left - parentOffset.left - jQuery.css(elem, "marginLeft", true) }; }, offsetParent: function() { return this.map(function() { var offsetParent = this.offsetParent || docElem; while (offsetParent && (!jQuery.nodeName(offsetParent, "html") && jQuery.css(offsetParent, "position") === "static")) { offsetParent = offsetParent.offsetParent; } return offsetParent || docElem; }); } }); // Create scrollLeft and scrollTop methods jQuery.each({ scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function(method, prop) { var top = /Y/.test(prop); jQuery.fn[method] = function(val) { return jQuery.access(this, function(elem, method, val) { var win = getWindow(elem); if (val === undefined) { return win ? (prop in win) ? win[prop] : win.document.documentElement[method] : elem[method]; } if (win) { win.scrollTo(!top ? val : jQuery(win).scrollLeft(), top ? val : jQuery(win).scrollTop()); } else { elem[method] = val; } }, method, val, arguments.length, null); }; }); function getWindow(elem) { return jQuery.isWindow(elem) ? elem : elem.nodeType === 9 ? elem.defaultView || elem.parentWindow : false; } // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods jQuery.each({ Height: "height", Width: "width" }, function(name, type) { jQuery.each({ padding: "inner" + name, content: type, "": "outer" + name }, function(defaultExtra, funcName) { // margin is only for outerHeight, outerWidth jQuery.fn[funcName] = function(margin, value) { var chainable = arguments.length && (defaultExtra || typeof margin !== "boolean"), extra = defaultExtra || (margin === true || value === true ? "margin" : "border"); return jQuery.access(this, function(elem, type, value) { var doc; if (jQuery.isWindow(elem)) { // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there // isn't a whole lot we can do. See pull request at this URL for discussion: // https://github.com/jquery/jquery/pull/764 return elem.document.documentElement["client" + name]; } // Get document width or height if (elem.nodeType === 9) { doc = elem.documentElement; // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it. return Math.max( elem.body["scroll" + name], doc["scroll" + name], elem.body["offset" + name], doc["offset" + name], doc["client" + name]); } return value === undefined ? // Get width or height on the element, requesting but not forcing parseFloat jQuery.css(elem, type, extra) : // Set width or height on the element jQuery.style(elem, type, value, extra); }, type, chainable ? margin : undefined, chainable, null); }; }); }); // Limit scope pollution from any deprecated API // (function() { // The number of elements contained in the matched element set jQuery.fn.size = function() { return this.length; }; jQuery.fn.andSelf = jQuery.fn.addBack; // })(); if (typeof module === "object" && module && typeof module.exports === "object") { // Expose jQuery as module.exports in loaders that implement the Node // module pattern (including browserify). Do not create the global, since // the user will be storing it themselves locally, and globals are frowned // upon in the Node module world. module.exports = jQuery; } else { // Otherwise expose jQuery to the global object as usual window.jQuery = window.$ = jQuery; // Register as a named AMD module, since jQuery can be concatenated with other // files that may use define, but not via a proper concatenation script that // understands anonymous AMD modules. A named AMD is safest and most robust // way to register. Lowercase jquery is used because AMD module names are // derived from file names, and jQuery is normally delivered in a lowercase // file name. Do this after creating the global so that if an AMD module wants // to call noConflict to hide this version of jQuery, it will work. if (typeof define === "function" && define.amd) { define("jquery", [], function() { return jQuery; }); } } })(window);
ejci/MrMizo.com
dist/old/vendor/jquery/jquery-1.10.2.js
JavaScript
mit
365,268
import React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon( <React.Fragment><circle cx="16.5" cy="2.38" r="2" /><path d="M24 11.88v-4.7l-5.05-2.14c-.97-.41-2.09-.06-2.65.84l-1 1.6c-.67 1.18-1.91 2.06-3.41 2.32l.06.06c.69.69 1.52 1.07 2.46 1.17.8-.42 1.52-.98 2.09-1.64l.6 3-1.16 1.1-.94.89v7.5h2v-6l2.1-2 1.8 8H23l-2.18-11-.62-3.1 1.8.7v3.4h2zM10.29 8.09c.22.15.47.24.72.29.13.02.25.04.38.04s.26-.01.38-.04c.13-.02.25-.06.37-.11.24-.1.47-.24.66-.44.49-.49.67-1.17.55-1.8-.07-.37-.25-.74-.55-1.03-.19-.19-.42-.34-.66-.44-.12-.05-.24-.09-.37-.11s-.25-.04-.38-.04c-.12 0-.23.01-.35.03-.14.02-.28.06-.41.11-.23.11-.46.26-.65.45-.3.29-.48.66-.55 1.03-.12.63.06 1.31.55 1.8.09.1.2.18.31.26z" /><path d="M11.24 10.56l-2-2c-.1-.1-.2-.18-.31-.26-.22-.14-.47-.24-.72-.28-.13-.03-.25-.04-.38-.04-.51 0-1.02.2-1.41.59l-3.34 3.34c-.41.41-.62.98-.58 1.54 0 .18.04.37.11.55l1.07 2.95-3.63 3.63L1.46 22l4.24-4.24v-2.22L7 16.75v5.13h2v-6l-2.12-2.12 2.36-2.36.71.71c1.29 1.26 2.97 2.04 5.03 2.04l-.14-2.07c-1.5-.02-2.7-.62-3.6-1.52z" /></React.Fragment> , 'SportsKabaddiTwoTone');
kybarg/material-ui
packages/material-ui-icons/src/SportsKabaddiTwoTone.js
JavaScript
mit
1,114
package com.eeeya.fantuan.api.java.client.api; import com.eeeya.fantuan.api.java.client.invoker.ApiException; import com.eeeya.fantuan.api.java.client.invoker.ApiInvoker; import com.eeeya.fantuan.api.java.client.model.ResultModelOfTableInfo; import com.sun.jersey.multipart.FormDataMultiPart; import java.util.HashMap; import java.util.Map; public class RestaurantApi { String basePath = "http://test.daidaiduoduo.com/"; ApiInvoker apiInvoker = ApiInvoker.getInstance(); public ApiInvoker getInvoker() { return apiInvoker; } public void setBasePath(String basePath) { this.basePath = basePath; } public String getBasePath() { return basePath; } public ResultModelOfTableInfo getRecommendTableInfo (Double userLatitude, Double userLongitude) throws ApiException { Object postBody = null; // create path and map variables String path = "/api/v1/restaurant/recommend.json".replaceAll("\\{format\\}","json"); // query params Map<String, String> queryParams = new HashMap<String, String>(); Map<String, String> headerParams = new HashMap<String, String>(); Map<String, String> formParams = new HashMap<String, String>(); if(!"null".equals(String.valueOf(userLatitude))) queryParams.put("userLatitude", String.valueOf(userLatitude)); if(!"null".equals(String.valueOf(userLongitude))) queryParams.put("userLongitude", String.valueOf(userLongitude)); String[] contentTypes = { "application/json" }; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; if(contentType.startsWith("multipart/form-data")) { boolean hasFields = false; FormDataMultiPart mp = new FormDataMultiPart(); if(hasFields) postBody = mp; } else { } try { String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType); if(response != null){ return (ResultModelOfTableInfo) ApiInvoker.deserialize(response, "", ResultModelOfTableInfo.class); } else { return null; } } catch (ApiException ex) { if(ex.getCode() == 404) { return null; } else { throw ex; } } } public ResultModelOfTableInfo changeRestaurantByTableId (Long tableId, Boolean isFarther, Double userLatitude, Double userLongitude) throws ApiException { Object postBody = null; // create path and map variables String path = "/api/v1/restaurant/{tableId}/change.do".replaceAll("\\{format\\}","json") .replaceAll("\\{" + "tableId" + "\\}", apiInvoker.escapeString(tableId.toString())); // query params Map<String, String> queryParams = new HashMap<String, String>(); Map<String, String> headerParams = new HashMap<String, String>(); Map<String, String> formParams = new HashMap<String, String>(); if(!"null".equals(String.valueOf(isFarther))) queryParams.put("isFarther", String.valueOf(isFarther)); if(!"null".equals(String.valueOf(userLatitude))) queryParams.put("userLatitude", String.valueOf(userLatitude)); if(!"null".equals(String.valueOf(userLongitude))) queryParams.put("userLongitude", String.valueOf(userLongitude)); String[] contentTypes = { "application/json" }; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; if(contentType.startsWith("multipart/form-data")) { boolean hasFields = false; FormDataMultiPart mp = new FormDataMultiPart(); if(hasFields) postBody = mp; } else { } try { String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType); if(response != null){ return (ResultModelOfTableInfo) ApiInvoker.deserialize(response, "", ResultModelOfTableInfo.class); } else { return null; } } catch (ApiException ex) { if(ex.getCode() == 404) { return null; } else { throw ex; } } } }
huizhong/fantuan
fantuan-api-java-client/src/main/java/com/eeeya/fantuan/api/java/client/api/RestaurantApi.java
Java
mit
4,171
<?php namespace Ongoing; class FileResultClass { /** * @var string $ErrorMessage */ protected $ErrorMessage = null; /** * @var string $GoodsOwnerOrderNumber */ protected $GoodsOwnerOrderNumber = null; /** * @var int $OrderId */ protected $OrderId = null; /** * @var int $InOrderId */ protected $InOrderId = null; /** * @var int $ArticleDefId */ protected $ArticleDefId = null; /** * @var boolean $Success */ protected $Success = null; /** * @var string $Message */ protected $Message = null; /** * @param int $OrderId * @param int $InOrderId * @param boolean $Success */ public function __construct($OrderId, $InOrderId, $Success) { $this->OrderId = $OrderId; $this->InOrderId = $InOrderId; $this->Success = $Success; } /** * @return string */ public function getErrorMessage() { return $this->ErrorMessage; } /** * @param string $ErrorMessage * @return \Ongoing\FileResultClass */ public function setErrorMessage($ErrorMessage) { $this->ErrorMessage = $ErrorMessage; return $this; } /** * @return string */ public function getGoodsOwnerOrderNumber() { return $this->GoodsOwnerOrderNumber; } /** * @param string $GoodsOwnerOrderNumber * @return \Ongoing\FileResultClass */ public function setGoodsOwnerOrderNumber($GoodsOwnerOrderNumber) { $this->GoodsOwnerOrderNumber = $GoodsOwnerOrderNumber; return $this; } /** * @return int */ public function getOrderId() { return $this->OrderId; } /** * @param int $OrderId * @return \Ongoing\FileResultClass */ public function setOrderId($OrderId) { $this->OrderId = $OrderId; return $this; } /** * @return int */ public function getInOrderId() { return $this->InOrderId; } /** * @param int $InOrderId * @return \Ongoing\FileResultClass */ public function setInOrderId($InOrderId) { $this->InOrderId = $InOrderId; return $this; } /** * @return int */ public function getArticleDefId() { return $this->ArticleDefId; } /** * @param int $ArticleDefId * @return \Ongoing\FileResultClass */ public function setArticleDefId($ArticleDefId) { $this->ArticleDefId = $ArticleDefId; return $this; } /** * @return boolean */ public function getSuccess() { return $this->Success; } /** * @param boolean $Success * @return \Ongoing\FileResultClass */ public function setSuccess($Success) { $this->Success = $Success; return $this; } /** * @return string */ public function getMessage() { return $this->Message; } /** * @param string $Message * @return \Ongoing\FileResultClass */ public function setMessage($Message) { $this->Message = $Message; return $this; } }
starweb/ongoing
src/Ongoing/FileResultClass.php
PHP
mit
3,221